@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.
Files changed (429) hide show
  1. package/dist/common/chunk-KSEUZTKY.js +2 -0
  2. package/dist/common/chunk-KSEUZTKY.js.map +1 -0
  3. package/dist/common/cli/index.js +1 -245
  4. package/dist/common/cli/index.js.map +1 -1
  5. package/dist/common/index.js +390 -11802
  6. package/dist/common/index.js.map +1 -1
  7. package/dist/esm/account/Account.mjs +1 -55
  8. package/dist/esm/account/Ed25519Account.mjs +1 -53
  9. package/dist/esm/account/EphemeralKeyPair.mjs +1 -36
  10. package/dist/esm/account/KeylessAccount.mjs +1 -56
  11. package/dist/esm/account/MultiKeyAccount.mjs +1 -55
  12. package/dist/esm/account/SingleKeyAccount.mjs +1 -53
  13. package/dist/esm/account/index.mjs +1 -76
  14. package/dist/esm/api/account.mjs +1 -76
  15. package/dist/esm/api/ans.mjs +1 -87
  16. package/dist/esm/api/aptos.mjs +1 -116
  17. package/dist/esm/api/aptosConfig.mjs +1 -9
  18. package/dist/esm/api/coin.mjs +1 -86
  19. package/dist/esm/api/digitalAsset.mjs +1 -87
  20. package/dist/esm/api/event.mjs +1 -54
  21. package/dist/esm/api/faucet.mjs +1 -53
  22. package/dist/esm/api/fungibleAsset.mjs +1 -87
  23. package/dist/esm/api/general.mjs +1 -84
  24. package/dist/esm/api/index.mjs +1 -120
  25. package/dist/esm/api/keyless.mjs +1 -70
  26. package/dist/esm/api/staking.mjs +1 -54
  27. package/dist/esm/api/transaction.mjs +1 -94
  28. package/dist/esm/api/transactionSubmission/build.mjs +1 -85
  29. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -9
  30. package/dist/esm/api/transactionSubmission/management.mjs +1 -89
  31. package/dist/esm/api/transactionSubmission/sign.mjs +1 -109
  32. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  33. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -86
  34. package/dist/esm/api/transactionSubmission/submit.mjs +1 -86
  35. package/dist/esm/api/utils.mjs +1 -34
  36. package/dist/esm/bcs/consts.mjs +1 -17
  37. package/dist/esm/bcs/deserializer.mjs +1 -8
  38. package/dist/esm/bcs/index.mjs +1 -57
  39. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -12
  40. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -11
  41. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -25
  42. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -18
  43. package/dist/esm/bcs/serializer.mjs +1 -18
  44. package/dist/esm/chunk-3COVJN6Z.mjs +2 -0
  45. package/dist/esm/{chunk-2JOCR2VL.mjs.map → chunk-3COVJN6Z.mjs.map} +1 -1
  46. package/dist/esm/chunk-3FVRXELT.mjs +2 -0
  47. package/dist/esm/{chunk-KK2BSALW.mjs.map → chunk-3FVRXELT.mjs.map} +1 -1
  48. package/dist/esm/chunk-3JPVQHOR.mjs +2 -0
  49. package/dist/esm/{chunk-GGMTQAQP.mjs.map → chunk-3JPVQHOR.mjs.map} +1 -1
  50. package/dist/esm/chunk-3VGX3TXH.mjs +2 -0
  51. package/dist/esm/{chunk-7FO3S6IZ.mjs.map → chunk-3VGX3TXH.mjs.map} +1 -1
  52. package/dist/esm/chunk-4D5QYFL7.mjs +2 -0
  53. package/dist/esm/{chunk-VZQXLVEP.mjs.map → chunk-4D5QYFL7.mjs.map} +1 -1
  54. package/dist/esm/chunk-4SZSI7QT.mjs +2 -0
  55. package/dist/esm/{chunk-2ZEGJU43.mjs.map → chunk-4SZSI7QT.mjs.map} +1 -1
  56. package/dist/esm/chunk-52ECIIIH.mjs +2 -0
  57. package/dist/esm/{chunk-U3IUCR2G.mjs.map → chunk-52ECIIIH.mjs.map} +1 -1
  58. package/dist/esm/chunk-53T2VRZA.mjs +2 -0
  59. package/dist/esm/{chunk-7IDBB4J4.mjs.map → chunk-53T2VRZA.mjs.map} +1 -1
  60. package/dist/esm/chunk-56CNRT2K.mjs +2 -0
  61. package/dist/esm/{chunk-SBB4YEPT.mjs.map → chunk-56CNRT2K.mjs.map} +1 -1
  62. package/dist/esm/chunk-56NB52W6.mjs +2 -0
  63. package/dist/esm/{chunk-VJP2VWMF.mjs.map → chunk-56NB52W6.mjs.map} +1 -1
  64. package/dist/esm/chunk-5JGWZSNG.mjs +2 -0
  65. package/dist/esm/{chunk-LYK4TQZO.mjs.map → chunk-5JGWZSNG.mjs.map} +1 -1
  66. package/dist/esm/chunk-6EMN3BOV.mjs +2 -0
  67. package/dist/esm/{chunk-SIJELMDP.mjs.map → chunk-6EMN3BOV.mjs.map} +1 -1
  68. package/dist/esm/chunk-6JT3CUFA.mjs +2 -0
  69. package/dist/esm/{chunk-ST4QXIMI.mjs.map → chunk-6JT3CUFA.mjs.map} +1 -1
  70. package/dist/esm/chunk-6KGDQGT2.mjs +2 -0
  71. package/dist/esm/{chunk-GBEVD2VM.mjs.map → chunk-6KGDQGT2.mjs.map} +1 -1
  72. package/dist/esm/chunk-6OETO7Q7.mjs +2 -0
  73. package/dist/esm/{chunk-UX5NSZEN.mjs.map → chunk-6OETO7Q7.mjs.map} +1 -1
  74. package/dist/esm/chunk-6RBUXB5I.mjs +2 -0
  75. package/dist/esm/{chunk-WK5ZSNE2.mjs.map → chunk-6RBUXB5I.mjs.map} +1 -1
  76. package/dist/esm/chunk-6YFCRKVC.mjs +2 -0
  77. package/dist/esm/{chunk-YYOPNUX5.mjs.map → chunk-6YFCRKVC.mjs.map} +1 -1
  78. package/dist/esm/chunk-7STYQ5ZE.mjs +2 -0
  79. package/dist/esm/{chunk-UEBBLQJ5.mjs.map → chunk-7STYQ5ZE.mjs.map} +1 -1
  80. package/dist/esm/chunk-7WJTKYRG.mjs +2 -0
  81. package/dist/esm/{chunk-2OQW7BMN.mjs.map → chunk-7WJTKYRG.mjs.map} +1 -1
  82. package/dist/esm/chunk-AFGTRMOR.mjs +2 -0
  83. package/dist/esm/{chunk-KMXSRHJ6.mjs.map → chunk-AFGTRMOR.mjs.map} +1 -1
  84. package/dist/esm/chunk-AH44UPM4.mjs +2 -0
  85. package/dist/esm/{chunk-EYHRMZPO.mjs.map → chunk-AH44UPM4.mjs.map} +1 -1
  86. package/dist/esm/chunk-AOCNYMMX.mjs +2 -0
  87. package/dist/esm/{chunk-YV7M4CFP.mjs.map → chunk-AOCNYMMX.mjs.map} +1 -1
  88. package/dist/esm/chunk-B3BLP5DP.mjs +2 -0
  89. package/dist/esm/{chunk-W76MGKZB.mjs.map → chunk-B3BLP5DP.mjs.map} +1 -1
  90. package/dist/esm/chunk-BTTXZYBD.mjs +2 -0
  91. package/dist/esm/{chunk-LI2QV6RU.mjs.map → chunk-BTTXZYBD.mjs.map} +1 -1
  92. package/dist/esm/chunk-C34M4T77.mjs +2 -0
  93. package/dist/esm/{chunk-UKU6A2W2.mjs.map → chunk-C34M4T77.mjs.map} +1 -1
  94. package/dist/esm/chunk-C3L4ETUF.mjs +2 -0
  95. package/dist/esm/{chunk-PIMQHG2J.mjs.map → chunk-C3L4ETUF.mjs.map} +1 -1
  96. package/dist/esm/chunk-CO53EOHE.mjs +2 -0
  97. package/dist/esm/{chunk-MZZLEY6O.mjs.map → chunk-CO53EOHE.mjs.map} +1 -1
  98. package/dist/esm/chunk-COW5IGYC.mjs +2 -0
  99. package/dist/esm/{chunk-FXKSE3ZP.mjs.map → chunk-COW5IGYC.mjs.map} +1 -1
  100. package/dist/esm/chunk-CPBGL37X.mjs +2 -0
  101. package/dist/esm/{chunk-D2BVBXWO.mjs.map → chunk-CPBGL37X.mjs.map} +1 -1
  102. package/dist/esm/chunk-CSP3V4UZ.mjs +2 -0
  103. package/dist/esm/{chunk-DGV7DYU4.mjs.map → chunk-CSP3V4UZ.mjs.map} +1 -1
  104. package/dist/esm/chunk-D4J3MCOI.mjs +2 -0
  105. package/dist/esm/{chunk-JV3GSIJW.mjs.map → chunk-D4J3MCOI.mjs.map} +1 -1
  106. package/dist/esm/chunk-EB7AI4B4.mjs +2 -0
  107. package/dist/esm/{chunk-AR7X6GWQ.mjs.map → chunk-EB7AI4B4.mjs.map} +1 -1
  108. package/dist/esm/chunk-EIXCAYQM.mjs +2 -0
  109. package/dist/esm/{chunk-O6PSHSN3.mjs.map → chunk-EIXCAYQM.mjs.map} +1 -1
  110. package/dist/esm/chunk-F3HH6U3Z.mjs +2 -0
  111. package/dist/esm/{chunk-IC56GQFJ.mjs.map → chunk-F3HH6U3Z.mjs.map} +1 -1
  112. package/dist/esm/chunk-FBPNHF54.mjs +2 -0
  113. package/dist/esm/{chunk-QMM2KL6C.mjs.map → chunk-FBPNHF54.mjs.map} +1 -1
  114. package/dist/esm/chunk-FHNW3DEN.mjs +2 -0
  115. package/dist/esm/{chunk-ATVFVXR6.mjs.map → chunk-FHNW3DEN.mjs.map} +1 -1
  116. package/dist/esm/chunk-FLYEALDB.mjs +2 -0
  117. package/dist/esm/{chunk-76TSTAU4.mjs.map → chunk-FLYEALDB.mjs.map} +1 -1
  118. package/dist/esm/chunk-FMBZNFEA.mjs +2 -0
  119. package/dist/esm/{chunk-ZAHJ7KXB.mjs.map → chunk-FMBZNFEA.mjs.map} +1 -1
  120. package/dist/esm/chunk-FVA2OPG4.mjs +2 -0
  121. package/dist/esm/chunk-GUO5GDBN.mjs +2 -0
  122. package/dist/esm/{chunk-HBNSRCZN.mjs.map → chunk-GUO5GDBN.mjs.map} +1 -1
  123. package/dist/esm/chunk-HGZGTBA4.mjs +2 -0
  124. package/dist/esm/{chunk-PYLOAMR2.mjs.map → chunk-HGZGTBA4.mjs.map} +1 -1
  125. package/dist/esm/chunk-HX5246EM.mjs +2 -0
  126. package/dist/esm/{chunk-JHDHNGJ3.mjs.map → chunk-HX5246EM.mjs.map} +1 -1
  127. package/dist/esm/chunk-HY5E66FY.mjs +2 -0
  128. package/dist/esm/{chunk-7FUHWL6A.mjs.map → chunk-HY5E66FY.mjs.map} +1 -1
  129. package/dist/esm/chunk-IBQWYF23.mjs +2 -0
  130. package/dist/esm/{chunk-WDRH2URB.mjs.map → chunk-IBQWYF23.mjs.map} +1 -1
  131. package/dist/esm/chunk-IWBLSSVA.mjs +2 -0
  132. package/dist/esm/{chunk-TBHU6ZW6.mjs.map → chunk-IWBLSSVA.mjs.map} +1 -1
  133. package/dist/esm/chunk-JJIANJE3.mjs +2 -0
  134. package/dist/esm/{chunk-GSVQ6EUD.mjs.map → chunk-JJIANJE3.mjs.map} +1 -1
  135. package/dist/esm/chunk-JM2B5E2I.mjs +2 -0
  136. package/dist/esm/{chunk-CX3NAVRD.mjs.map → chunk-JM2B5E2I.mjs.map} +1 -1
  137. package/dist/esm/chunk-JM544NRW.mjs +2 -0
  138. package/dist/esm/{chunk-7REUIYF4.mjs.map → chunk-JM544NRW.mjs.map} +1 -1
  139. package/dist/esm/chunk-JYUTX5G7.mjs +2 -0
  140. package/dist/esm/{chunk-LYMY63SO.mjs.map → chunk-JYUTX5G7.mjs.map} +1 -1
  141. package/dist/esm/chunk-K247GPES.mjs +2 -0
  142. package/dist/esm/{chunk-NYL77J4X.mjs.map → chunk-K247GPES.mjs.map} +1 -1
  143. package/dist/esm/chunk-KW2KIYJE.mjs +2 -0
  144. package/dist/esm/{chunk-BXMHDQHW.mjs.map → chunk-KW2KIYJE.mjs.map} +1 -1
  145. package/dist/esm/chunk-KYZCH7IK.mjs +2 -0
  146. package/dist/esm/{chunk-NXFO2W4G.mjs.map → chunk-KYZCH7IK.mjs.map} +1 -1
  147. package/dist/esm/chunk-L54P6EGN.mjs +2 -0
  148. package/dist/esm/{chunk-SS3NUM5L.mjs.map → chunk-L54P6EGN.mjs.map} +1 -1
  149. package/dist/esm/chunk-LDQ6JFEF.mjs +2 -0
  150. package/dist/esm/{chunk-N4WKFNQ6.mjs.map → chunk-LDQ6JFEF.mjs.map} +1 -1
  151. package/dist/esm/chunk-LR5YOJG2.mjs +2 -0
  152. package/dist/esm/{chunk-6LRQSBRH.mjs.map → chunk-LR5YOJG2.mjs.map} +1 -1
  153. package/dist/esm/chunk-LR65XHSF.mjs +2 -0
  154. package/dist/esm/{chunk-PU5AFUX3.mjs.map → chunk-LR65XHSF.mjs.map} +1 -1
  155. package/dist/esm/chunk-MC6O2XME.mjs +2 -0
  156. package/dist/esm/{chunk-RCQMWXEW.mjs.map → chunk-MC6O2XME.mjs.map} +1 -1
  157. package/dist/esm/chunk-MGOHPDX4.mjs +2 -0
  158. package/dist/esm/{chunk-2TJJWII2.mjs.map → chunk-MGOHPDX4.mjs.map} +1 -1
  159. package/dist/esm/chunk-MTLETLKV.mjs +2 -0
  160. package/dist/esm/{chunk-DIYZRGR6.mjs.map → chunk-MTLETLKV.mjs.map} +1 -1
  161. package/dist/esm/chunk-MWUJCP27.mjs +2 -0
  162. package/dist/esm/{chunk-6MSZMIFW.mjs.map → chunk-MWUJCP27.mjs.map} +1 -1
  163. package/dist/esm/chunk-N466X3S6.mjs +2 -0
  164. package/dist/esm/{chunk-WLTBF4DF.mjs.map → chunk-N466X3S6.mjs.map} +1 -1
  165. package/dist/esm/chunk-NC5HHEEM.mjs +2 -0
  166. package/dist/esm/{chunk-XANFAUBD.mjs.map → chunk-NC5HHEEM.mjs.map} +1 -1
  167. package/dist/esm/chunk-NNIHTVLA.mjs +2 -0
  168. package/dist/esm/{chunk-VPWUODU4.mjs.map → chunk-NNIHTVLA.mjs.map} +1 -1
  169. package/dist/esm/chunk-NT47KB7Y.mjs +2 -0
  170. package/dist/esm/{chunk-Y2LV3S5W.mjs.map → chunk-NT47KB7Y.mjs.map} +1 -1
  171. package/dist/esm/chunk-NWGBV3YO.mjs +2 -0
  172. package/dist/esm/{chunk-F2ZWA7B7.mjs.map → chunk-NWGBV3YO.mjs.map} +1 -1
  173. package/dist/esm/chunk-NWWXZ7EW.mjs +2 -0
  174. package/dist/esm/{chunk-B5S6DDUD.mjs.map → chunk-NWWXZ7EW.mjs.map} +1 -1
  175. package/dist/esm/chunk-NYTZPISE.mjs +2 -0
  176. package/dist/esm/{chunk-KVSQ57HU.mjs.map → chunk-NYTZPISE.mjs.map} +1 -1
  177. package/dist/esm/chunk-O6LITRY2.mjs +2 -0
  178. package/dist/esm/{chunk-CTJSZT5V.mjs.map → chunk-O6LITRY2.mjs.map} +1 -1
  179. package/dist/esm/chunk-OJFMOV2O.mjs +2 -0
  180. package/dist/esm/{chunk-TLNHRJB2.mjs.map → chunk-OJFMOV2O.mjs.map} +1 -1
  181. package/dist/esm/chunk-OMD4G3E6.mjs +2 -0
  182. package/dist/esm/{chunk-FF4JPDKD.mjs.map → chunk-OMD4G3E6.mjs.map} +1 -1
  183. package/dist/esm/chunk-PBDEW4TN.mjs +2 -0
  184. package/dist/esm/{chunk-IHNPN5CQ.mjs.map → chunk-PBDEW4TN.mjs.map} +1 -1
  185. package/dist/esm/chunk-PFFAQZHT.mjs +2 -0
  186. package/dist/esm/{chunk-DNPMS2OF.mjs.map → chunk-PFFAQZHT.mjs.map} +1 -1
  187. package/dist/esm/chunk-PTRUUJCS.mjs +2 -0
  188. package/dist/esm/{chunk-LLLQJWRZ.mjs.map → chunk-PTRUUJCS.mjs.map} +1 -1
  189. package/dist/esm/chunk-PYUU4OEL.mjs +2 -0
  190. package/dist/esm/{chunk-RX4VG2AT.mjs.map → chunk-PYUU4OEL.mjs.map} +1 -1
  191. package/dist/esm/chunk-QDJN5HCB.mjs +2 -0
  192. package/dist/esm/{chunk-CC4DQ6NH.mjs.map → chunk-QDJN5HCB.mjs.map} +1 -1
  193. package/dist/esm/chunk-QFMUMZXR.mjs +2 -0
  194. package/dist/esm/{chunk-ASF2VWOX.mjs.map → chunk-QFMUMZXR.mjs.map} +1 -1
  195. package/dist/esm/chunk-RJ4PSGZ4.mjs +2 -0
  196. package/dist/esm/{chunk-QFOG4LIN.mjs.map → chunk-RJ4PSGZ4.mjs.map} +1 -1
  197. package/dist/esm/chunk-RKHPXZM6.mjs +2 -0
  198. package/dist/esm/{chunk-PCLNX6FS.mjs.map → chunk-RKHPXZM6.mjs.map} +1 -1
  199. package/dist/esm/{chunk-4PJ5FYGQ.mjs → chunk-S4SEFF4K.mjs} +27 -302
  200. package/dist/esm/{chunk-4PJ5FYGQ.mjs.map → chunk-S4SEFF4K.mjs.map} +1 -1
  201. package/dist/esm/chunk-S4YEK4LM.mjs +2 -0
  202. package/dist/esm/{chunk-WVGO4D7K.mjs.map → chunk-S4YEK4LM.mjs.map} +1 -1
  203. package/dist/esm/chunk-STYDBDYL.mjs +2 -0
  204. package/dist/esm/{chunk-FDWJNY4U.mjs.map → chunk-STYDBDYL.mjs.map} +1 -1
  205. package/dist/esm/chunk-SXOQWGMT.mjs +2 -0
  206. package/dist/esm/{chunk-VDJBDX3A.mjs.map → chunk-SXOQWGMT.mjs.map} +1 -1
  207. package/dist/esm/chunk-T23OVRNF.mjs +2 -0
  208. package/dist/esm/{chunk-CMNJG4NN.mjs.map → chunk-T23OVRNF.mjs.map} +1 -1
  209. package/dist/esm/chunk-TBGRYIFW.mjs +2 -0
  210. package/dist/esm/{chunk-NW45SCPY.mjs.map → chunk-TBGRYIFW.mjs.map} +1 -1
  211. package/dist/esm/chunk-TICM455H.mjs +2 -0
  212. package/dist/esm/{chunk-ZMFKQUHL.mjs.map → chunk-TICM455H.mjs.map} +1 -1
  213. package/dist/esm/chunk-TJDC5PWD.mjs +2 -0
  214. package/dist/esm/{chunk-NMKCJNQM.mjs.map → chunk-TJDC5PWD.mjs.map} +1 -1
  215. package/dist/esm/chunk-TVRJ3M7B.mjs +2 -0
  216. package/dist/esm/{chunk-FQQW55X7.mjs.map → chunk-TVRJ3M7B.mjs.map} +1 -1
  217. package/dist/esm/chunk-U6Z4FNB7.mjs +2 -0
  218. package/dist/esm/{chunk-AC3OGAL6.mjs.map → chunk-U6Z4FNB7.mjs.map} +1 -1
  219. package/dist/esm/chunk-UAL7TX7O.mjs +2 -0
  220. package/dist/esm/{chunk-DVPQGCFT.mjs.map → chunk-UAL7TX7O.mjs.map} +1 -1
  221. package/dist/esm/chunk-UTXJOB3O.mjs +2 -0
  222. package/dist/esm/{chunk-QBBTUC66.mjs.map → chunk-UTXJOB3O.mjs.map} +1 -1
  223. package/dist/esm/chunk-VDMVO4R4.mjs +2 -0
  224. package/dist/esm/{chunk-4OYYOYSO.mjs.map → chunk-VDMVO4R4.mjs.map} +1 -1
  225. package/dist/esm/chunk-VT6XJSRO.mjs +2 -0
  226. package/dist/esm/{chunk-7JRMOHBP.mjs.map → chunk-VT6XJSRO.mjs.map} +1 -1
  227. package/dist/esm/chunk-VXZDDYG7.mjs +2 -0
  228. package/dist/esm/{chunk-55NODGHC.mjs.map → chunk-VXZDDYG7.mjs.map} +1 -1
  229. package/dist/esm/chunk-WOPMZAWX.mjs +2 -0
  230. package/dist/esm/{chunk-VKJQORON.mjs.map → chunk-WOPMZAWX.mjs.map} +1 -1
  231. package/dist/esm/chunk-XOTF6PQ7.mjs +2 -0
  232. package/dist/esm/{chunk-CXUGZXED.mjs.map → chunk-XOTF6PQ7.mjs.map} +1 -1
  233. package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
  234. package/dist/esm/{chunk-NFJCQRVK.mjs.map → chunk-YE5B2S5L.mjs.map} +1 -1
  235. package/dist/esm/chunk-ZJDNONEP.mjs +2 -0
  236. package/dist/esm/{chunk-U7QBZ6PP.mjs.map → chunk-ZJDNONEP.mjs.map} +1 -1
  237. package/dist/esm/chunk-ZLLU4XK7.mjs +2 -0
  238. package/dist/esm/{chunk-WHBWEN6N.mjs.map → chunk-ZLLU4XK7.mjs.map} +1 -1
  239. package/dist/esm/chunk-ZNEBMSNC.mjs +2 -0
  240. package/dist/esm/{chunk-JL2JHVS4.mjs.map → chunk-ZNEBMSNC.mjs.map} +1 -1
  241. package/dist/esm/cli/index.mjs +1 -12
  242. package/dist/esm/cli/localNode.mjs +1 -8
  243. package/dist/esm/cli/move.mjs +1 -7
  244. package/dist/esm/client/core.mjs +1 -27
  245. package/dist/esm/client/get.mjs +1 -32
  246. package/dist/esm/client/index.mjs +1 -55
  247. package/dist/esm/client/post.mjs +1 -36
  248. package/dist/esm/client/types.mjs +1 -7
  249. package/dist/esm/core/account/index.mjs +1 -19
  250. package/dist/esm/core/account/utils/address.mjs +1 -18
  251. package/dist/esm/core/account/utils/index.mjs +1 -19
  252. package/dist/esm/core/accountAddress.mjs +1 -15
  253. package/dist/esm/core/authenticationKey.mjs +1 -14
  254. package/dist/esm/core/common.mjs +1 -7
  255. package/dist/esm/core/crypto/ed25519.mjs +1 -29
  256. package/dist/esm/core/crypto/ephemeral.mjs +1 -28
  257. package/dist/esm/core/crypto/hdKey.mjs +1 -25
  258. package/dist/esm/core/crypto/index.mjs +1 -124
  259. package/dist/esm/core/crypto/keyless.mjs +1 -55
  260. package/dist/esm/core/crypto/multiEd25519.mjs +1 -28
  261. package/dist/esm/core/crypto/multiKey.mjs +1 -34
  262. package/dist/esm/core/crypto/poseidon.mjs +1 -15
  263. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  264. package/dist/esm/core/crypto/proof.mjs +1 -19
  265. package/dist/esm/core/crypto/publicKey.mjs +1 -21
  266. package/dist/esm/core/crypto/secp256k1.mjs +1 -27
  267. package/dist/esm/core/crypto/signature.mjs +1 -19
  268. package/dist/esm/core/crypto/singleKey.mjs +1 -33
  269. package/dist/esm/core/crypto/utils.mjs +1 -9
  270. package/dist/esm/core/hex.mjs +1 -10
  271. package/dist/esm/core/index.mjs +1 -141
  272. package/dist/esm/index.mjs +1 -635
  273. package/dist/esm/internal/account.mjs +1 -106
  274. package/dist/esm/internal/ans.mjs +1 -120
  275. package/dist/esm/internal/coin.mjs +1 -85
  276. package/dist/esm/internal/digitalAsset.mjs +1 -127
  277. package/dist/esm/internal/event.mjs +1 -55
  278. package/dist/esm/internal/faucet.mjs +1 -52
  279. package/dist/esm/internal/fungibleAsset.mjs +1 -91
  280. package/dist/esm/internal/general.mjs +1 -46
  281. package/dist/esm/internal/keyless.mjs +1 -73
  282. package/dist/esm/internal/staking.mjs +1 -53
  283. package/dist/esm/internal/transaction.mjs +1 -51
  284. package/dist/esm/internal/transactionSubmission.mjs +1 -102
  285. package/dist/esm/internal/view.mjs +1 -83
  286. package/dist/esm/transactions/authenticator/account.mjs +1 -44
  287. package/dist/esm/transactions/authenticator/index.mjs +1 -60
  288. package/dist/esm/transactions/authenticator/transaction.mjs +1 -48
  289. package/dist/esm/transactions/index.mjs +1 -284
  290. package/dist/esm/transactions/instances/chainId.mjs +1 -11
  291. package/dist/esm/transactions/instances/identifier.mjs +1 -11
  292. package/dist/esm/transactions/instances/index.mjs +1 -96
  293. package/dist/esm/transactions/instances/moduleId.mjs +1 -38
  294. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -43
  295. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -48
  296. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -20
  297. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -45
  298. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -43
  299. package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
  300. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -56
  301. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -74
  302. package/dist/esm/transactions/management/asyncQueue.mjs +1 -9
  303. package/dist/esm/transactions/management/index.mjs +1 -95
  304. package/dist/esm/transactions/management/transactionWorker.mjs +1 -91
  305. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -75
  306. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -162
  307. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -85
  308. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -58
  309. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -98
  310. package/dist/esm/transactions/typeTag/index.mjs +1 -74
  311. package/dist/esm/transactions/typeTag/parser.mjs +1 -43
  312. package/dist/esm/transactions/types.mjs +1 -1
  313. package/dist/esm/types/generated/queries.mjs +1 -57
  314. package/dist/esm/types/generated/types.mjs +1 -809
  315. package/dist/esm/types/generated/types.mjs.map +1 -1
  316. package/dist/esm/types/index.mjs +1 -68
  317. package/dist/esm/types/indexer.mjs +1 -1
  318. package/dist/esm/types/keyless.mjs +1 -9
  319. package/dist/esm/utils/apiEndpoints.mjs +1 -21
  320. package/dist/esm/utils/const.mjs +1 -21
  321. package/dist/esm/utils/helpers.mjs +1 -7
  322. package/dist/esm/utils/index.mjs +1 -56
  323. package/dist/esm/utils/memoize.mjs +1 -9
  324. package/dist/esm/utils/normalizeBundle.mjs +1 -19
  325. package/dist/esm/version.d.mts +1 -1
  326. package/dist/esm/version.mjs +1 -7
  327. package/package.json +1 -1
  328. package/src/version.ts +1 -1
  329. package/dist/common/chunk-QRI7EC4T.js +0 -24
  330. package/dist/common/chunk-QRI7EC4T.js.map +0 -1
  331. package/dist/esm/chunk-2JOCR2VL.mjs +0 -32
  332. package/dist/esm/chunk-2OQW7BMN.mjs +0 -129
  333. package/dist/esm/chunk-2TJJWII2.mjs +0 -23
  334. package/dist/esm/chunk-2ZEGJU43.mjs +0 -252
  335. package/dist/esm/chunk-4OYYOYSO.mjs +0 -336
  336. package/dist/esm/chunk-55NODGHC.mjs +0 -135
  337. package/dist/esm/chunk-6LRQSBRH.mjs +0 -130
  338. package/dist/esm/chunk-6MSZMIFW.mjs +0 -23
  339. package/dist/esm/chunk-76TSTAU4.mjs +0 -120
  340. package/dist/esm/chunk-7FO3S6IZ.mjs +0 -324
  341. package/dist/esm/chunk-7FUHWL6A.mjs +0 -42
  342. package/dist/esm/chunk-7IDBB4J4.mjs +0 -33
  343. package/dist/esm/chunk-7JRMOHBP.mjs +0 -247
  344. package/dist/esm/chunk-7REUIYF4.mjs +0 -63
  345. package/dist/esm/chunk-AC3OGAL6.mjs +0 -87
  346. package/dist/esm/chunk-AR7X6GWQ.mjs +0 -356
  347. package/dist/esm/chunk-ASF2VWOX.mjs +0 -142
  348. package/dist/esm/chunk-ATVFVXR6.mjs +0 -43
  349. package/dist/esm/chunk-B5S6DDUD.mjs +0 -120
  350. package/dist/esm/chunk-BXMHDQHW.mjs +0 -512
  351. package/dist/esm/chunk-CC4DQ6NH.mjs +0 -19
  352. package/dist/esm/chunk-CMNJG4NN.mjs +0 -345
  353. package/dist/esm/chunk-CTJSZT5V.mjs +0 -87
  354. package/dist/esm/chunk-CX3NAVRD.mjs +0 -205
  355. package/dist/esm/chunk-CXUGZXED.mjs +0 -307
  356. package/dist/esm/chunk-D2BVBXWO.mjs +0 -7
  357. package/dist/esm/chunk-DGV7DYU4.mjs +0 -413
  358. package/dist/esm/chunk-DIYZRGR6.mjs +0 -242
  359. package/dist/esm/chunk-DNPMS2OF.mjs +0 -236
  360. package/dist/esm/chunk-DVPQGCFT.mjs +0 -74
  361. package/dist/esm/chunk-EYHRMZPO.mjs +0 -34
  362. package/dist/esm/chunk-F2ZWA7B7.mjs +0 -412
  363. package/dist/esm/chunk-FDWJNY4U.mjs +0 -22
  364. package/dist/esm/chunk-FF4JPDKD.mjs +0 -315
  365. package/dist/esm/chunk-FQQW55X7.mjs +0 -288
  366. package/dist/esm/chunk-FXKSE3ZP.mjs +0 -25
  367. package/dist/esm/chunk-GBEVD2VM.mjs +0 -99
  368. package/dist/esm/chunk-GGMTQAQP.mjs +0 -11
  369. package/dist/esm/chunk-GSVQ6EUD.mjs +0 -649
  370. package/dist/esm/chunk-HBNSRCZN.mjs +0 -100
  371. package/dist/esm/chunk-IC56GQFJ.mjs +0 -127
  372. package/dist/esm/chunk-IHNPN5CQ.mjs +0 -256
  373. package/dist/esm/chunk-JHDHNGJ3.mjs +0 -126
  374. package/dist/esm/chunk-JL2JHVS4.mjs +0 -49
  375. package/dist/esm/chunk-JV3GSIJW.mjs +0 -268
  376. package/dist/esm/chunk-KK2BSALW.mjs +0 -32
  377. package/dist/esm/chunk-KMXSRHJ6.mjs +0 -93
  378. package/dist/esm/chunk-KVSQ57HU.mjs +0 -45
  379. package/dist/esm/chunk-LI2QV6RU.mjs +0 -129
  380. package/dist/esm/chunk-LLLQJWRZ.mjs +0 -35
  381. package/dist/esm/chunk-LYK4TQZO.mjs +0 -70
  382. package/dist/esm/chunk-LYMY63SO.mjs +0 -124
  383. package/dist/esm/chunk-MZZLEY6O.mjs +0 -92
  384. package/dist/esm/chunk-N4WKFNQ6.mjs +0 -156
  385. package/dist/esm/chunk-NFJCQRVK.mjs +0 -37
  386. package/dist/esm/chunk-NMKCJNQM.mjs +0 -20
  387. package/dist/esm/chunk-NW45SCPY.mjs +0 -36
  388. package/dist/esm/chunk-NXFO2W4G.mjs +0 -84
  389. package/dist/esm/chunk-NYL77J4X.mjs +0 -97
  390. package/dist/esm/chunk-O6PSHSN3.mjs +0 -53
  391. package/dist/esm/chunk-OR7TEZ25.mjs +0 -16
  392. package/dist/esm/chunk-PCLNX6FS.mjs +0 -17
  393. package/dist/esm/chunk-PIMQHG2J.mjs +0 -49
  394. package/dist/esm/chunk-PU5AFUX3.mjs +0 -52
  395. package/dist/esm/chunk-PYLOAMR2.mjs +0 -29
  396. package/dist/esm/chunk-QBBTUC66.mjs +0 -15
  397. package/dist/esm/chunk-QFOG4LIN.mjs +0 -319
  398. package/dist/esm/chunk-QMM2KL6C.mjs +0 -12
  399. package/dist/esm/chunk-RCQMWXEW.mjs +0 -35
  400. package/dist/esm/chunk-RX4VG2AT.mjs +0 -314
  401. package/dist/esm/chunk-SBB4YEPT.mjs +0 -17
  402. package/dist/esm/chunk-SIJELMDP.mjs +0 -29
  403. package/dist/esm/chunk-SS3NUM5L.mjs +0 -94
  404. package/dist/esm/chunk-ST4QXIMI.mjs +0 -37
  405. package/dist/esm/chunk-TBHU6ZW6.mjs +0 -215
  406. package/dist/esm/chunk-TLNHRJB2.mjs +0 -155
  407. package/dist/esm/chunk-U3IUCR2G.mjs +0 -54
  408. package/dist/esm/chunk-U7QBZ6PP.mjs +0 -400
  409. package/dist/esm/chunk-UEBBLQJ5.mjs +0 -94
  410. package/dist/esm/chunk-UKU6A2W2.mjs +0 -232
  411. package/dist/esm/chunk-UX5NSZEN.mjs +0 -134
  412. package/dist/esm/chunk-VDJBDX3A.mjs +0 -79
  413. package/dist/esm/chunk-VJP2VWMF.mjs +0 -58
  414. package/dist/esm/chunk-VKJQORON.mjs +0 -93
  415. package/dist/esm/chunk-VPWUODU4.mjs +0 -51
  416. package/dist/esm/chunk-VZQXLVEP.mjs +0 -197
  417. package/dist/esm/chunk-W76MGKZB.mjs +0 -33
  418. package/dist/esm/chunk-WDRH2URB.mjs +0 -91
  419. package/dist/esm/chunk-WHBWEN6N.mjs +0 -206
  420. package/dist/esm/chunk-WK5ZSNE2.mjs +0 -173
  421. package/dist/esm/chunk-WLTBF4DF.mjs +0 -22
  422. package/dist/esm/chunk-WVGO4D7K.mjs +0 -254
  423. package/dist/esm/chunk-XANFAUBD.mjs +0 -44
  424. package/dist/esm/chunk-Y2LV3S5W.mjs +0 -410
  425. package/dist/esm/chunk-YV7M4CFP.mjs +0 -137
  426. package/dist/esm/chunk-YYOPNUX5.mjs +0 -41
  427. package/dist/esm/chunk-ZAHJ7KXB.mjs +0 -81
  428. package/dist/esm/chunk-ZMFKQUHL.mjs +0 -117
  429. /package/dist/esm/{chunk-OR7TEZ25.mjs.map → chunk-FVA2OPG4.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transactions/transactionBuilder/transactionBuilder.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the transaction creation lifecycle.\n * It holds different operations to generate a transaction payload, a raw transaction,\n * and a signed transaction that can be simulated, signed and submitted to chain.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput, Hex, PublicKey } from \"../../core\";\nimport { AnyPublicKey, AnySignature, Secp256k1PublicKey, Secp256k1Signature } from \"../../core/crypto\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { getInfo } from \"../../internal/account\";\nimport { getLedgerInfo } from \"../../internal/general\";\nimport { getGasPriceEstimation } from \"../../internal/transaction\";\nimport { NetworkToChainId } from \"../../utils/apiEndpoints\";\nimport { DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from \"../../utils/const\";\nimport { normalizeBundle } from \"../../utils/normalizeBundle\";\nimport {\n AccountAuthenticator,\n AccountAuthenticatorEd25519,\n AccountAuthenticatorSingleKey,\n} from \"../authenticator/account\";\nimport {\n TransactionAuthenticator,\n TransactionAuthenticatorEd25519,\n TransactionAuthenticatorFeePayer,\n TransactionAuthenticatorMultiAgent,\n TransactionAuthenticatorSingleSender,\n} from \"../authenticator/transaction\";\nimport {\n ChainId,\n EntryFunction,\n FeePayerRawTransaction,\n MultiAgentRawTransaction,\n MultiSig,\n MultiSigTransactionPayload,\n RawTransaction,\n Script,\n TransactionPayloadEntryFunction,\n TransactionPayloadMultiSig,\n TransactionPayloadScript,\n} from \"../instances\";\nimport { SignedTransaction } from \"../instances/signedTransaction\";\nimport {\n AnyRawTransaction,\n AnyTransactionPayloadInstance,\n EntryFunctionArgumentTypes,\n InputGenerateMultiAgentRawTransactionArgs,\n InputGenerateRawTransactionArgs,\n InputGenerateSingleSignerRawTransactionArgs,\n InputGenerateTransactionOptions,\n InputScriptData,\n InputSimulateTransactionData,\n InputMultiSigDataWithRemoteABI,\n InputEntryFunctionDataWithRemoteABI,\n InputGenerateTransactionPayloadDataWithRemoteABI,\n InputSubmitTransactionData,\n InputGenerateTransactionPayloadDataWithABI,\n InputEntryFunctionDataWithABI,\n InputMultiSigDataWithABI,\n InputViewFunctionDataWithRemoteABI,\n InputViewFunctionDataWithABI,\n FunctionABI,\n} from \"../types\";\nimport { convertArgument, fetchEntryFunctionAbi, fetchViewFunctionAbi, standardizeTypeTags } from \"./remoteAbi\";\nimport { memoizeAsync } from \"../../utils/memoize\";\nimport { getFunctionParts, isScriptDataInput } from \"./helpers\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\nimport { MultiAgentTransaction } from \"../instances/multiAgentTransaction\";\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransactionPayload` function.\n * When we call our `generateTransactionPayload` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;\nexport async function generateTransactionPayload(\n args: InputEntryFunctionDataWithRemoteABI,\n): Promise<TransactionPayloadEntryFunction>;\nexport async function generateTransactionPayload(\n args: InputMultiSigDataWithRemoteABI,\n): Promise<TransactionPayloadMultiSig>;\n\n/**\n * Builds a transaction payload based on the data argument and returns\n * a transaction payload - TransactionPayloadScript | TransactionPayloadMultiSig | TransactionPayloadEntryFunction\n *\n * This uses the RemoteABI by default, and the remote ABI can be skipped by using generateTransactionPayloadWithABI\n *\n * @param args.data GenerateTransactionPayloadData\n *\n * @return TransactionPayload\n */\nexport async function generateTransactionPayload(\n args: InputGenerateTransactionPayloadDataWithRemoteABI,\n): Promise<AnyTransactionPayloadInstance> {\n if (isScriptDataInput(args)) {\n return generateTransactionPayloadScript(args);\n }\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"entry-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchEntryFunctionAbi,\n });\n\n // Fill in the ABI\n return generateTransactionPayloadWithABI({ ...args, abi: functionAbi });\n}\n\nexport function generateTransactionPayloadWithABI(args: InputEntryFunctionDataWithABI): TransactionPayloadEntryFunction;\nexport function generateTransactionPayloadWithABI(args: InputMultiSigDataWithABI): TransactionPayloadMultiSig;\nexport function generateTransactionPayloadWithABI(\n args: InputGenerateTransactionPayloadDataWithABI,\n): AnyTransactionPayloadInstance {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> = args.functionArguments.map((arg, i) =>\n convertArgument(args.function, functionAbi, arg, i, typeArguments),\n );\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n const entryFunctionPayload = EntryFunction.build(\n `${moduleAddress}::${moduleName}`,\n functionName,\n typeArguments,\n functionArguments,\n );\n\n // Send it as multi sig if it's a multisig payload\n if (\"multisigAddress\" in args) {\n const multisigAddress = AccountAddress.from(args.multisigAddress);\n return new TransactionPayloadMultiSig(\n new MultiSig(multisigAddress, new MultiSigTransactionPayload(entryFunctionPayload)),\n );\n }\n\n // Otherwise send as an entry function\n return new TransactionPayloadEntryFunction(entryFunctionPayload);\n}\n\nexport async function generateViewFunctionPayload(args: InputViewFunctionDataWithRemoteABI): Promise<EntryFunction> {\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"view-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchViewFunctionAbi,\n });\n\n // Fill in the ABI\n return generateViewFunctionPayloadWithABI({ abi: functionAbi, ...args });\n}\n\nexport function generateViewFunctionPayloadWithABI(args: InputViewFunctionDataWithABI): EntryFunction {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> =\n args?.functionArguments?.map((arg, i) => convertArgument(args.function, functionAbi, arg, i, typeArguments)) ?? [];\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n return EntryFunction.build(`${moduleAddress}::${moduleName}`, functionName, typeArguments, functionArguments);\n}\n\nfunction generateTransactionPayloadScript(args: InputScriptData) {\n return new TransactionPayloadScript(\n new Script(Hex.fromHexInput(args.bytecode).toUint8Array(), args.typeArguments ?? [], args.functionArguments),\n );\n}\n\n/**\n * Generates a raw transaction\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n *\n * @returns RawTransaction\n */\nexport async function generateRawTransaction(args: {\n aptosConfig: AptosConfig;\n sender: AccountAddressInput;\n payload: AnyTransactionPayloadInstance;\n options?: InputGenerateTransactionOptions;\n feePayerAddress?: AccountAddressInput;\n}): Promise<RawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n\n const getChainId = async () => {\n if (NetworkToChainId[aptosConfig.network]) {\n return { chainId: NetworkToChainId[aptosConfig.network] };\n }\n const info = await getLedgerInfo({ aptosConfig });\n return { chainId: info.chain_id };\n };\n\n const getGasUnitPrice = async () => {\n if (options?.gasUnitPrice) {\n return { gasEstimate: options.gasUnitPrice };\n }\n const estimation = await getGasPriceEstimation({ aptosConfig });\n return { gasEstimate: estimation.gas_estimate };\n };\n\n const getSequenceNumberForAny = async () => {\n const getSequenceNumber = async () => {\n if (options?.accountSequenceNumber !== undefined) {\n return options.accountSequenceNumber;\n }\n\n return (await getInfo({ aptosConfig, accountAddress: sender })).sequence_number;\n };\n\n /**\n * Check if is sponsored transaction to honor AIP-52\n * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-52.md}\n */\n if (feePayerAddress && AccountAddress.from(feePayerAddress).equals(AccountAddress.ZERO)) {\n // Handle sponsored transaction generation with the option that\n // the main signer has not been created on chain\n try {\n // Check if main signer has been created on chain, if not assign sequence number 0\n return await getSequenceNumber();\n } catch (e: any) {\n return 0;\n }\n } else {\n return getSequenceNumber();\n }\n };\n const [{ chainId }, { gasEstimate }, sequenceNumber] = await Promise.all([\n getChainId(),\n getGasUnitPrice(),\n getSequenceNumberForAny(),\n ]);\n\n const { maxGasAmount, gasUnitPrice, expireTimestamp } = {\n maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),\n gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),\n expireTimestamp: options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_TXN_EXP_SEC_FROM_NOW),\n };\n\n return new RawTransaction(\n AccountAddress.from(sender),\n BigInt(sequenceNumber),\n payload,\n BigInt(maxGasAmount),\n BigInt(gasUnitPrice),\n BigInt(expireTimestamp),\n new ChainId(chainId),\n );\n}\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransaction` function.\n * When we call our `generateTransaction` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SimpleTransaction>;\nexport async function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;\n\n/**\n * Generates a transaction based on the provided arguments\n *\n * Note: we can start with one function to support all different payload/transaction types,\n * and if to complex to use, we could have function for each type\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n * @param args.options optional. Transaction options object\n * @param args.secondarySignerAddresses optional. For when want to create a multi signers transaction\n * @param args.feePayerAddress optional. For when want to create a fee payer (aka sponsored) transaction\n *\n * @return An instance of a RawTransaction, plus optional secondary/fee payer addresses\n * ```\n * {\n * rawTransaction: RawTransaction,\n * secondarySignerAddresses? : Array<AccountAddress>,\n * feePayerAddress?: AccountAddress\n * }\n * ```\n */\nexport async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n // generate raw transaction\n const rawTxn = await generateRawTransaction({\n aptosConfig,\n sender,\n payload,\n options,\n feePayerAddress,\n });\n\n // if multi agent transaction\n if (\"secondarySignerAddresses\" in args) {\n const signers: Array<AccountAddress> =\n args.secondarySignerAddresses?.map((signer) => AccountAddress.from(signer)) ?? [];\n\n return new MultiAgentTransaction(\n rawTxn,\n signers,\n args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined,\n );\n }\n // return the raw transaction\n return new SimpleTransaction(rawTxn, args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined);\n}\n\n/**\n * Simulate a transaction before signing and submit to chain\n *\n * @param args.transaction A aptos transaction type to sign\n * @param args.signerPublicKey The signer public key\n * @param args.secondarySignersPublicKeys optional. The secondary signers public keys if multi signers transaction\n * @param args.feePayerPublicKey optional. The fee payer public key is a fee payer (aka sponsored) transaction\n * @param args.options optional. SimulateTransactionOptions\n *\n * @returns A signed serialized transaction that can be simulated\n */\nexport function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array {\n const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;\n\n const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);\n\n // fee payer transaction\n if (transaction.feePayerAddress) {\n const transactionToSign = new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n if (secondarySignersPublicKeys) {\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n }\n const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey!);\n\n const transactionAuthenticator = new TransactionAuthenticatorFeePayer(\n accountAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n secondaryAccountAuthenticators,\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // multi agent transaction\n if (transaction.secondarySignerAddresses) {\n const transactionToSign = new MultiAgentRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses,\n );\n\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n\n secondaryAccountAuthenticators = secondarySignersPublicKeys!.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n\n const transactionAuthenticator = new TransactionAuthenticatorMultiAgent(\n accountAuthenticator,\n transaction.secondarySignerAddresses,\n secondaryAccountAuthenticators,\n );\n\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // single signer raw transaction\n let transactionAuthenticator;\n if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {\n transactionAuthenticator = new TransactionAuthenticatorEd25519(\n accountAuthenticator.public_key,\n accountAuthenticator.signature,\n );\n } else if (accountAuthenticator instanceof AccountAuthenticatorSingleKey) {\n transactionAuthenticator = new TransactionAuthenticatorSingleSender(accountAuthenticator);\n } else {\n throw new Error(\"Invalid public key\");\n }\n return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();\n}\n\nexport function getAuthenticatorForSimulation(publicKey: PublicKey) {\n // TODO add support for AnyMultiKey\n if (publicKey instanceof AnyPublicKey) {\n if (publicKey.publicKey instanceof Ed25519PublicKey) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Ed25519Signature(new Uint8Array(64))));\n }\n if (publicKey.publicKey instanceof Secp256k1PublicKey) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Secp256k1Signature(new Uint8Array(64))));\n }\n }\n\n // legacy code\n return new AccountAuthenticatorEd25519(\n new Ed25519PublicKey(publicKey.toUint8Array()),\n new Ed25519Signature(new Uint8Array(64)),\n );\n}\n\n/**\n * Prepare a transaction to be submitted to chain\n *\n * @param args.transaction A aptos transaction type\n * @param args.senderAuthenticator The account authenticator of the transaction sender\n * @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction\n *\n * @returns A SignedTransaction\n */\nexport function generateSignedTransaction(args: InputSubmitTransactionData): Uint8Array {\n const { transaction, feePayerAuthenticator, additionalSignersAuthenticators } = args;\n const senderAuthenticator = normalizeBundle(AccountAuthenticator, args.senderAuthenticator);\n\n let txnAuthenticator: TransactionAuthenticator;\n if (transaction.feePayerAddress) {\n if (!feePayerAuthenticator) {\n throw new Error(\"Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction\");\n }\n txnAuthenticator = new TransactionAuthenticatorFeePayer(\n senderAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n additionalSignersAuthenticators ?? [],\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n } else if (transaction.secondarySignerAddresses) {\n if (!additionalSignersAuthenticators) {\n throw new Error(\n \"Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction\",\n );\n }\n txnAuthenticator = new TransactionAuthenticatorMultiAgent(\n senderAuthenticator,\n transaction.secondarySignerAddresses,\n additionalSignersAuthenticators,\n );\n } else if (senderAuthenticator instanceof AccountAuthenticatorEd25519) {\n txnAuthenticator = new TransactionAuthenticatorEd25519(\n senderAuthenticator.public_key,\n senderAuthenticator.signature,\n );\n } else {\n txnAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);\n }\n\n return new SignedTransaction(transaction.rawTransaction, txnAuthenticator).bcsToBytes();\n}\n\n/**\n * Hashes the set of values with a SHA-3 256 hash\n * @param input array of UTF-8 strings or Uint8array byte arrays\n */\nexport function hashValues(input: (Uint8Array | string)[]): Uint8Array {\n const hash = sha3Hash.create();\n for (const item of input) {\n hash.update(item);\n }\n return hash.digest();\n}\n\n/**\n * The domain separated prefix for hashing transacitons\n */\nconst TRANSACTION_PREFIX = hashValues([\"APTOS::Transaction\"]);\n\n/**\n * Generates a user transaction hash for the given transaction payload. It must already have an authenticator\n * @param args InputSubmitTransactionData\n */\nexport function generateUserTransactionHash(args: InputSubmitTransactionData): string {\n const signedTransaction = generateSignedTransaction(args);\n\n // Transaction signature is defined as, the domain separated prefix based on struct (Transaction)\n // Then followed by the type of the transaction for the enum, UserTransaction is 0\n // Then followed by BCS encoded bytes of the signed transaction\n return new Hex(hashValues([TRANSACTION_PREFIX, new Uint8Array([0]), signedTransaction])).toString();\n}\n\n/**\n * Fetches and caches ABIs with allowing for pass-through on provided ABIs\n * @param key\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n * @param abi\n * @param fetch\n */\nasync function fetchAbi<T extends FunctionABI>({\n key,\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig,\n abi,\n fetch,\n}: {\n key: string;\n moduleAddress: string;\n moduleName: string;\n functionName: string;\n aptosConfig: AptosConfig;\n abi?: T;\n fetch: (moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig) => Promise<T>;\n}): Promise<T> {\n if (abi !== undefined) {\n return abi;\n }\n\n // We fetch the entry function ABI, and then pretend that we already had the ABI\n return memoizeAsync(\n async () => fetch(moduleAddress, moduleName, functionName, aptosConfig),\n `${key}-${aptosConfig.network}-${moduleAddress}-${moduleName}-${functionName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,YAAY,gBAAgB;AAwFrC,eA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S,4BAA4B,MAA0C;AACpF,QAAM,oBAAoB,0BAA0B,IAAI;AAKxD,SAAO,IAAI,IAAI,WAAW,CAAC,oBAAoB,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,SAAS;AACpG;AAYA,eAAe,SAAgC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAQe;AACb,MAAI,QAAQ,QAAW;AACrB,WAAO;AAAA,EACT;AAGA,SAAO;AAAA,IACL,YAAY,MAAM,eAAe,YAAY,cAAc,WAAW;AAAA,IACtE,GAAG,GAAG,IAAI,YAAY,OAAO,IAAI,aAAa,IAAI,UAAU,IAAI,YAAY;AAAA,IAC5E,MAAO,KAAK;AAAA;AAAA,EACd,EAAE;AACJ;","names":["transactionAuthenticator"]}
1
+ {"version":3,"sources":["../../src/transactions/transactionBuilder/transactionBuilder.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the transaction creation lifecycle.\n * It holds different operations to generate a transaction payload, a raw transaction,\n * and a signed transaction that can be simulated, signed and submitted to chain.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput, Hex, PublicKey } from \"../../core\";\nimport { AnyPublicKey, AnySignature, Secp256k1PublicKey, Secp256k1Signature } from \"../../core/crypto\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { getInfo } from \"../../internal/account\";\nimport { getLedgerInfo } from \"../../internal/general\";\nimport { getGasPriceEstimation } from \"../../internal/transaction\";\nimport { NetworkToChainId } from \"../../utils/apiEndpoints\";\nimport { DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from \"../../utils/const\";\nimport { normalizeBundle } from \"../../utils/normalizeBundle\";\nimport {\n AccountAuthenticator,\n AccountAuthenticatorEd25519,\n AccountAuthenticatorSingleKey,\n} from \"../authenticator/account\";\nimport {\n TransactionAuthenticator,\n TransactionAuthenticatorEd25519,\n TransactionAuthenticatorFeePayer,\n TransactionAuthenticatorMultiAgent,\n TransactionAuthenticatorSingleSender,\n} from \"../authenticator/transaction\";\nimport {\n ChainId,\n EntryFunction,\n FeePayerRawTransaction,\n MultiAgentRawTransaction,\n MultiSig,\n MultiSigTransactionPayload,\n RawTransaction,\n Script,\n TransactionPayloadEntryFunction,\n TransactionPayloadMultiSig,\n TransactionPayloadScript,\n} from \"../instances\";\nimport { SignedTransaction } from \"../instances/signedTransaction\";\nimport {\n AnyRawTransaction,\n AnyTransactionPayloadInstance,\n EntryFunctionArgumentTypes,\n InputGenerateMultiAgentRawTransactionArgs,\n InputGenerateRawTransactionArgs,\n InputGenerateSingleSignerRawTransactionArgs,\n InputGenerateTransactionOptions,\n InputScriptData,\n InputSimulateTransactionData,\n InputMultiSigDataWithRemoteABI,\n InputEntryFunctionDataWithRemoteABI,\n InputGenerateTransactionPayloadDataWithRemoteABI,\n InputSubmitTransactionData,\n InputGenerateTransactionPayloadDataWithABI,\n InputEntryFunctionDataWithABI,\n InputMultiSigDataWithABI,\n InputViewFunctionDataWithRemoteABI,\n InputViewFunctionDataWithABI,\n FunctionABI,\n} from \"../types\";\nimport { convertArgument, fetchEntryFunctionAbi, fetchViewFunctionAbi, standardizeTypeTags } from \"./remoteAbi\";\nimport { memoizeAsync } from \"../../utils/memoize\";\nimport { getFunctionParts, isScriptDataInput } from \"./helpers\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\nimport { MultiAgentTransaction } from \"../instances/multiAgentTransaction\";\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransactionPayload` function.\n * When we call our `generateTransactionPayload` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;\nexport async function generateTransactionPayload(\n args: InputEntryFunctionDataWithRemoteABI,\n): Promise<TransactionPayloadEntryFunction>;\nexport async function generateTransactionPayload(\n args: InputMultiSigDataWithRemoteABI,\n): Promise<TransactionPayloadMultiSig>;\n\n/**\n * Builds a transaction payload based on the data argument and returns\n * a transaction payload - TransactionPayloadScript | TransactionPayloadMultiSig | TransactionPayloadEntryFunction\n *\n * This uses the RemoteABI by default, and the remote ABI can be skipped by using generateTransactionPayloadWithABI\n *\n * @param args.data GenerateTransactionPayloadData\n *\n * @return TransactionPayload\n */\nexport async function generateTransactionPayload(\n args: InputGenerateTransactionPayloadDataWithRemoteABI,\n): Promise<AnyTransactionPayloadInstance> {\n if (isScriptDataInput(args)) {\n return generateTransactionPayloadScript(args);\n }\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"entry-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchEntryFunctionAbi,\n });\n\n // Fill in the ABI\n return generateTransactionPayloadWithABI({ ...args, abi: functionAbi });\n}\n\nexport function generateTransactionPayloadWithABI(args: InputEntryFunctionDataWithABI): TransactionPayloadEntryFunction;\nexport function generateTransactionPayloadWithABI(args: InputMultiSigDataWithABI): TransactionPayloadMultiSig;\nexport function generateTransactionPayloadWithABI(\n args: InputGenerateTransactionPayloadDataWithABI,\n): AnyTransactionPayloadInstance {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> = args.functionArguments.map((arg, i) =>\n convertArgument(args.function, functionAbi, arg, i, typeArguments),\n );\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n const entryFunctionPayload = EntryFunction.build(\n `${moduleAddress}::${moduleName}`,\n functionName,\n typeArguments,\n functionArguments,\n );\n\n // Send it as multi sig if it's a multisig payload\n if (\"multisigAddress\" in args) {\n const multisigAddress = AccountAddress.from(args.multisigAddress);\n return new TransactionPayloadMultiSig(\n new MultiSig(multisigAddress, new MultiSigTransactionPayload(entryFunctionPayload)),\n );\n }\n\n // Otherwise send as an entry function\n return new TransactionPayloadEntryFunction(entryFunctionPayload);\n}\n\nexport async function generateViewFunctionPayload(args: InputViewFunctionDataWithRemoteABI): Promise<EntryFunction> {\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"view-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchViewFunctionAbi,\n });\n\n // Fill in the ABI\n return generateViewFunctionPayloadWithABI({ abi: functionAbi, ...args });\n}\n\nexport function generateViewFunctionPayloadWithABI(args: InputViewFunctionDataWithABI): EntryFunction {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> =\n args?.functionArguments?.map((arg, i) => convertArgument(args.function, functionAbi, arg, i, typeArguments)) ?? [];\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n return EntryFunction.build(`${moduleAddress}::${moduleName}`, functionName, typeArguments, functionArguments);\n}\n\nfunction generateTransactionPayloadScript(args: InputScriptData) {\n return new TransactionPayloadScript(\n new Script(Hex.fromHexInput(args.bytecode).toUint8Array(), args.typeArguments ?? [], args.functionArguments),\n );\n}\n\n/**\n * Generates a raw transaction\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n *\n * @returns RawTransaction\n */\nexport async function generateRawTransaction(args: {\n aptosConfig: AptosConfig;\n sender: AccountAddressInput;\n payload: AnyTransactionPayloadInstance;\n options?: InputGenerateTransactionOptions;\n feePayerAddress?: AccountAddressInput;\n}): Promise<RawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n\n const getChainId = async () => {\n if (NetworkToChainId[aptosConfig.network]) {\n return { chainId: NetworkToChainId[aptosConfig.network] };\n }\n const info = await getLedgerInfo({ aptosConfig });\n return { chainId: info.chain_id };\n };\n\n const getGasUnitPrice = async () => {\n if (options?.gasUnitPrice) {\n return { gasEstimate: options.gasUnitPrice };\n }\n const estimation = await getGasPriceEstimation({ aptosConfig });\n return { gasEstimate: estimation.gas_estimate };\n };\n\n const getSequenceNumberForAny = async () => {\n const getSequenceNumber = async () => {\n if (options?.accountSequenceNumber !== undefined) {\n return options.accountSequenceNumber;\n }\n\n return (await getInfo({ aptosConfig, accountAddress: sender })).sequence_number;\n };\n\n /**\n * Check if is sponsored transaction to honor AIP-52\n * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-52.md}\n */\n if (feePayerAddress && AccountAddress.from(feePayerAddress).equals(AccountAddress.ZERO)) {\n // Handle sponsored transaction generation with the option that\n // the main signer has not been created on chain\n try {\n // Check if main signer has been created on chain, if not assign sequence number 0\n return await getSequenceNumber();\n } catch (e: any) {\n return 0;\n }\n } else {\n return getSequenceNumber();\n }\n };\n const [{ chainId }, { gasEstimate }, sequenceNumber] = await Promise.all([\n getChainId(),\n getGasUnitPrice(),\n getSequenceNumberForAny(),\n ]);\n\n const { maxGasAmount, gasUnitPrice, expireTimestamp } = {\n maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),\n gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),\n expireTimestamp: options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_TXN_EXP_SEC_FROM_NOW),\n };\n\n return new RawTransaction(\n AccountAddress.from(sender),\n BigInt(sequenceNumber),\n payload,\n BigInt(maxGasAmount),\n BigInt(gasUnitPrice),\n BigInt(expireTimestamp),\n new ChainId(chainId),\n );\n}\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransaction` function.\n * When we call our `generateTransaction` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SimpleTransaction>;\nexport async function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;\n\n/**\n * Generates a transaction based on the provided arguments\n *\n * Note: we can start with one function to support all different payload/transaction types,\n * and if to complex to use, we could have function for each type\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n * @param args.options optional. Transaction options object\n * @param args.secondarySignerAddresses optional. For when want to create a multi signers transaction\n * @param args.feePayerAddress optional. For when want to create a fee payer (aka sponsored) transaction\n *\n * @return An instance of a RawTransaction, plus optional secondary/fee payer addresses\n * ```\n * {\n * rawTransaction: RawTransaction,\n * secondarySignerAddresses? : Array<AccountAddress>,\n * feePayerAddress?: AccountAddress\n * }\n * ```\n */\nexport async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n // generate raw transaction\n const rawTxn = await generateRawTransaction({\n aptosConfig,\n sender,\n payload,\n options,\n feePayerAddress,\n });\n\n // if multi agent transaction\n if (\"secondarySignerAddresses\" in args) {\n const signers: Array<AccountAddress> =\n args.secondarySignerAddresses?.map((signer) => AccountAddress.from(signer)) ?? [];\n\n return new MultiAgentTransaction(\n rawTxn,\n signers,\n args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined,\n );\n }\n // return the raw transaction\n return new SimpleTransaction(rawTxn, args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined);\n}\n\n/**\n * Simulate a transaction before signing and submit to chain\n *\n * @param args.transaction A aptos transaction type to sign\n * @param args.signerPublicKey The signer public key\n * @param args.secondarySignersPublicKeys optional. The secondary signers public keys if multi signers transaction\n * @param args.feePayerPublicKey optional. The fee payer public key is a fee payer (aka sponsored) transaction\n * @param args.options optional. SimulateTransactionOptions\n *\n * @returns A signed serialized transaction that can be simulated\n */\nexport function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array {\n const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;\n\n const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);\n\n // fee payer transaction\n if (transaction.feePayerAddress) {\n const transactionToSign = new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n if (secondarySignersPublicKeys) {\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n }\n const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey!);\n\n const transactionAuthenticator = new TransactionAuthenticatorFeePayer(\n accountAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n secondaryAccountAuthenticators,\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // multi agent transaction\n if (transaction.secondarySignerAddresses) {\n const transactionToSign = new MultiAgentRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses,\n );\n\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n\n secondaryAccountAuthenticators = secondarySignersPublicKeys!.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n\n const transactionAuthenticator = new TransactionAuthenticatorMultiAgent(\n accountAuthenticator,\n transaction.secondarySignerAddresses,\n secondaryAccountAuthenticators,\n );\n\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // single signer raw transaction\n let transactionAuthenticator;\n if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {\n transactionAuthenticator = new TransactionAuthenticatorEd25519(\n accountAuthenticator.public_key,\n accountAuthenticator.signature,\n );\n } else if (accountAuthenticator instanceof AccountAuthenticatorSingleKey) {\n transactionAuthenticator = new TransactionAuthenticatorSingleSender(accountAuthenticator);\n } else {\n throw new Error(\"Invalid public key\");\n }\n return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();\n}\n\nexport function getAuthenticatorForSimulation(publicKey: PublicKey) {\n // TODO add support for AnyMultiKey\n if (publicKey instanceof AnyPublicKey) {\n if (publicKey.publicKey instanceof Ed25519PublicKey) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Ed25519Signature(new Uint8Array(64))));\n }\n if (publicKey.publicKey instanceof Secp256k1PublicKey) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Secp256k1Signature(new Uint8Array(64))));\n }\n }\n\n // legacy code\n return new AccountAuthenticatorEd25519(\n new Ed25519PublicKey(publicKey.toUint8Array()),\n new Ed25519Signature(new Uint8Array(64)),\n );\n}\n\n/**\n * Prepare a transaction to be submitted to chain\n *\n * @param args.transaction A aptos transaction type\n * @param args.senderAuthenticator The account authenticator of the transaction sender\n * @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction\n *\n * @returns A SignedTransaction\n */\nexport function generateSignedTransaction(args: InputSubmitTransactionData): Uint8Array {\n const { transaction, feePayerAuthenticator, additionalSignersAuthenticators } = args;\n const senderAuthenticator = normalizeBundle(AccountAuthenticator, args.senderAuthenticator);\n\n let txnAuthenticator: TransactionAuthenticator;\n if (transaction.feePayerAddress) {\n if (!feePayerAuthenticator) {\n throw new Error(\"Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction\");\n }\n txnAuthenticator = new TransactionAuthenticatorFeePayer(\n senderAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n additionalSignersAuthenticators ?? [],\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n } else if (transaction.secondarySignerAddresses) {\n if (!additionalSignersAuthenticators) {\n throw new Error(\n \"Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction\",\n );\n }\n txnAuthenticator = new TransactionAuthenticatorMultiAgent(\n senderAuthenticator,\n transaction.secondarySignerAddresses,\n additionalSignersAuthenticators,\n );\n } else if (senderAuthenticator instanceof AccountAuthenticatorEd25519) {\n txnAuthenticator = new TransactionAuthenticatorEd25519(\n senderAuthenticator.public_key,\n senderAuthenticator.signature,\n );\n } else {\n txnAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);\n }\n\n return new SignedTransaction(transaction.rawTransaction, txnAuthenticator).bcsToBytes();\n}\n\n/**\n * Hashes the set of values with a SHA-3 256 hash\n * @param input array of UTF-8 strings or Uint8array byte arrays\n */\nexport function hashValues(input: (Uint8Array | string)[]): Uint8Array {\n const hash = sha3Hash.create();\n for (const item of input) {\n hash.update(item);\n }\n return hash.digest();\n}\n\n/**\n * The domain separated prefix for hashing transacitons\n */\nconst TRANSACTION_PREFIX = hashValues([\"APTOS::Transaction\"]);\n\n/**\n * Generates a user transaction hash for the given transaction payload. It must already have an authenticator\n * @param args InputSubmitTransactionData\n */\nexport function generateUserTransactionHash(args: InputSubmitTransactionData): string {\n const signedTransaction = generateSignedTransaction(args);\n\n // Transaction signature is defined as, the domain separated prefix based on struct (Transaction)\n // Then followed by the type of the transaction for the enum, UserTransaction is 0\n // Then followed by BCS encoded bytes of the signed transaction\n return new Hex(hashValues([TRANSACTION_PREFIX, new Uint8Array([0]), signedTransaction])).toString();\n}\n\n/**\n * Fetches and caches ABIs with allowing for pass-through on provided ABIs\n * @param key\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n * @param abi\n * @param fetch\n */\nasync function fetchAbi<T extends FunctionABI>({\n key,\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig,\n abi,\n fetch,\n}: {\n key: string;\n moduleAddress: string;\n moduleName: string;\n functionName: string;\n aptosConfig: AptosConfig;\n abi?: T;\n fetch: (moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig) => Promise<T>;\n}): Promise<T> {\n if (abi !== undefined) {\n return abi;\n }\n\n // We fetch the entry function ABI, and then pretend that we already had the ABI\n return memoizeAsync(\n async () => fetch(moduleAddress, moduleName, functionName, aptosConfig),\n `${key}-${aptosConfig.network}-${moduleAddress}-${moduleName}-${functionName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n"],"mappings":"uhCAQA,OAAS,YAAYA,OAAgB,qBAwFrC,eAAsBC,GACpBC,EACwC,CACxC,GAAIC,GAAkBD,CAAI,EACxB,OAAOE,GAAiCF,CAAI,EAE9C,GAAM,CAAE,cAAAG,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBN,EAAK,QAAQ,EAE5EO,EAAc,MAAMC,GAAS,CACjC,IAAK,iBACL,cAAAL,EACA,WAAAC,EACA,aAAAC,EACA,YAAaL,EAAK,YAClB,IAAKA,EAAK,IACV,MAAOS,EACT,CAAC,EAGD,O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CAAgB,EAAE,WAAW,CACxF,CAMO,SAASC,GAAWC,EAA4C,CACrE,IAAMC,EAAOC,GAAS,OAAO,EAC7B,QAAWC,KAAQH,EACjBC,EAAK,OAAOE,CAAI,EAElB,OAAOF,EAAK,OAAO,CACrB,CAKA,IAAMG,GAAqBL,GAAW,CAAC,oBAAoB,CAAC,EAMrD,SAASM,GAA4BlG,EAA0C,CACpF,IAAMmG,EAAoBb,GAA0BtF,CAAI,EAKxD,OAAO,IAAI8B,EAAI8D,GAAW,CAACK,GAAoB,IAAI,WAAW,CAAC,CAAC,CAAC,EAAGE,CAAiB,CAAC,CAAC,EAAE,SAAS,CACpG,CAYA,eAAe3F,GAAgC,CAC7C,IAAA4F,EACA,cAAAjG,EACA,WAAAC,EACA,aAAAC,EACA,YAAA2B,EACA,IAAAqE,EACA,MAAAC,CACF,EAQe,CACb,OAAID,IAAQ,OACHA,EAIFE,EACL,SAAYD,EAAMnG,EAAeC,EAAYC,EAAc2B,CAAW,EACtE,GAAGoE,CAAG,IAAIpE,EAAY,OAAO,IAAI7B,CAAa,IAAIC,CAAU,IAAIC,CAAY,GAC5E,IAAO,GAAK,CACd,EAAE,CACJ","names":["sha3Hash","generateTransactionPayload","args","isScriptDataInput","generateTransactionPayloadScript","moduleAddress","moduleName","functionName","getFunctionParts","functionAbi","fetchAbi","fetchEntryFunctionAbi","generateTransactionPayloadWithABI","typeArguments","standardizeTypeTags","functionArguments","arg","i","convertArgument","entryFunctionPayload","EntryFunction","multisigAddress","AccountAddress","TransactionPayloadMultiSig","MultiSig","MultiSigTransactionPayload","TransactionPayloadEntryFunction","generateViewFunctionPayload","fetchViewFunctionAbi","generateViewFunctionPayloadWithABI","TransactionPayloadScript","Script","Hex","generateRawTransaction","aptosConfig","sender","payload","options","feePayerAddress","getChainId","NetworkToChainId","getLedgerInfo","getGasUnitPrice","getGasPriceEstimation","getSequenceNumberForAny","getSequenceNumber","getInfo","chainId","gasEstimate","sequenceNumber","maxGasAmount","gasUnitPrice","expireTimestamp","RawTransaction","ChainId","buildTransaction","rawTxn","signers","signer","MultiAgentTransaction","SimpleTransaction","generateSignedTransactionForSimulation","signerPublicKey","transaction","secondarySignersPublicKeys","feePayerPublicKey","accountAuthenticator","getAuthenticatorForSimulation","transactionToSign","FeePayerRawTransaction","secondaryAccountAuthenticators","publicKey","feePayerAuthenticator","transactionAuthenticator","TransactionAuthenticatorFeePayer","SignedTransaction","MultiAgentRawTransaction","TransactionAuthenticatorMultiAgent","AccountAuthenticatorEd25519","TransactionAuthenticatorEd25519","AccountAuthenticatorSingleKey","TransactionAuthenticatorSingleSender","AnyPublicKey","Ed25519PublicKey","AnySignature","Ed25519Signature","Secp256k1PublicKey","Secp256k1Signature","generateSignedTransaction","additionalSignersAuthenticators","senderAuthenticator","normalizeBundle","AccountAuthenticator","txnAuthenticator","hashValues","input","hash","sha3Hash","item","TRANSACTION_PREFIX","generateUserTransactionHash","signedTransaction","key","abi","fetch","memoizeAsync"]}
@@ -0,0 +1,2 @@
1
+ import{a as u,b as l}from"./chunk-OJFMOV2O.mjs";import{b as g}from"./chunk-COW5IGYC.mjs";import{a as f}from"./chunk-STYDBDYL.mjs";import{a as m}from"./chunk-7STYQ5ZE.mjs";function A(y){let o=y;return o-=o>>1&1431655765,o=(o&858993459)+(o>>2&858993459),(o+(o>>4)&252645135)*16843009>>24}var p=class y extends g{constructor(e){super();let{publicKeys:r,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(r.length<t)throw new Error(`Provided ${r.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=r.map(i=>i instanceof u?i:new u(i)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let r=e.deserializeVector(u),t=e.deserializeU8();return new y({publicKeys:r,signaturesRequired:t})}createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach((n,c)=>{if(c+1>this.publicKeys.length)throw new Error(`Signature index ${c+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(n))throw new Error(`Duplicate bit ${n} detected.`);a.add(n);let h=Math.floor(n/8),b=i[h];b|=t>>n%8,i[h]=b}),i}getIndex(e){let r=e instanceof u?e:new u(e),t=this.publicKeys.findIndex(i=>i.toString()===r.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}},s=class s extends f{constructor(e){super();let{signatures:r,bitmap:t}=e;if(r.length>s.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${s.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=r.map(a=>a instanceof l?a:new l(a)),!(t instanceof Uint8Array))this.bitmap=s.createBitmap({bits:t});else{if(t.length!==s.BITMAP_LEN)throw new Error(`"bitmap" length should be ${s.BITMAP_LEN}`);this.bitmap=t}let i=this.bitmap.reduce((a,n)=>a+A(n),0);if(i!==this.signatures.length)throw new Error(`Expecting ${i} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach(n=>{if(n>=s.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${s.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(n))throw new Error("Duplicate bits detected.");a.add(n);let c=Math.floor(n/8),h=i[c];h|=t>>n%8,i[c]=h}),i}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let r=e.deserializeVector(l),t=e.deserializeBytes();return new s({signatures:r,bitmap:t})}};s.BITMAP_LEN=4,s.MAX_SIGNATURES_SUPPORTED=s.BITMAP_LEN*8;var d=s;export{p as a,d as b};
2
+ //# sourceMappingURL=chunk-ZLLU4XK7.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":";;;;;;;;;;;;;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B,WAAO,KAAK,WAAW;AAAA,EACzB;AAAA;AAAA;AAAA,EAMA,UAAU,YAA8B;AAEtC,eAAW,gBAAgB,KAAK,UAAU;AAC1C,eAAW,eAAe,KAAK,MAAM;AAAA,EACvC;AAAA,EAEA,OAAO,YAAY,cAA+C;AAChE,UAAM,aAAa,aAAa,kBAAkB,YAAY;AAC9D,UAAM,SAAS,aAAa,iBAAiB;AAC7C,WAAO,IAAI,mBAAkB,EAAE,YAAY,OAAO,CAAC;AAAA,EACrD;AAAA;AAGF;AAAA;AAAA;AAAA;AAnIa,mBAIJ,aAAqB;AAAA;AAAA;AAAA;AAJjB,mBASJ,2BAA2B,mBAAkB,aAAa;AAT5D,IAAM,oBAAN;","names":[]}
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,EAA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+C,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"]}
@@ -0,0 +1,2 @@
1
+ import{a as s}from"./chunk-MGOHPDX4.mjs";import{b as i}from"./chunk-T23OVRNF.mjs";import{a as d}from"./chunk-TVRJ3M7B.mjs";var o=class t extends d{constructor(e,r){super();this.address=e,this.name=r}static fromStr(e){let r=e.split("::");if(r.length!==2)throw new Error("Invalid module id.");return new t(i.fromString(r[0]),new s(r[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let r=i.deserialize(e),n=s.deserialize(e);return new t(r,n)}};export{o as a};
2
+ //# sourceMappingURL=chunk-ZNEBMSNC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transactions/instances/moduleId.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { AccountAddress } from \"../../core\";\nimport { Identifier } from \"./identifier\";\nimport { MoveModuleId } from \"../../types\";\n\n/**\n * Representation of a ModuleId that can serialized and deserialized\n * ModuleId means the module address (e.g \"0x1\") and the module name (e.g \"coin\")\n */\nexport class ModuleId extends Serializable {\n public readonly address: AccountAddress;\n\n public readonly name: Identifier;\n\n /**\n * Full name of a module.\n * @param address The account address. e.g \"0x1\"\n * @param name The module name under the \"address\". e.g \"coin\"\n */\n constructor(address: AccountAddress, name: Identifier) {\n super();\n this.address = address;\n this.name = name;\n }\n\n /**\n * Converts a string literal to a ModuleId\n * @param moduleId String literal in format \"account_address::module_name\", e.g. \"0x1::coin\"\n * @returns ModuleId\n */\n static fromStr(moduleId: MoveModuleId): ModuleId {\n const parts = moduleId.split(\"::\");\n if (parts.length !== 2) {\n throw new Error(\"Invalid module id.\");\n }\n return new ModuleId(AccountAddress.fromString(parts[0]), new Identifier(parts[1]));\n }\n\n serialize(serializer: Serializer): void {\n this.address.serialize(serializer);\n this.name.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): ModuleId {\n const address = AccountAddress.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n return new ModuleId(address, name);\n }\n}\n"],"mappings":";;;;;;;;;;;AAaO,IAAM,WAAN,MAAM,kBAAiB,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUzC,YAAY,SAAyB,MAAkB;AACrD,UAAM;AACN,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,QAAQ,UAAkC;AAC/C,UAAM,QAAQ,SAAS,MAAM,IAAI;AACjC,QAAI,MAAM,WAAW,GAAG;AACtB,YAAM,IAAI,MAAM,oBAAoB;AAAA,IACtC;AACA,WAAO,IAAI,UAAS,eAAe,WAAW,MAAM,CAAC,CAAC,GAAG,IAAI,WAAW,MAAM,CAAC,CAAC,CAAC;AAAA,EACnF;AAAA,EAEA,UAAU,YAA8B;AACtC,SAAK,QAAQ,UAAU,UAAU;AACjC,SAAK,KAAK,UAAU,UAAU;AAAA,EAChC;AAAA,EAEA,OAAO,YAAY,cAAsC;AACvD,UAAM,UAAU,eAAe,YAAY,YAAY;AACvD,UAAM,OAAO,WAAW,YAAY,YAAY;AAChD,WAAO,IAAI,UAAS,SAAS,IAAI;AAAA,EACnC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/transactions/instances/moduleId.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { AccountAddress } from \"../../core\";\nimport { Identifier } from \"./identifier\";\nimport { MoveModuleId } from \"../../types\";\n\n/**\n * Representation of a ModuleId that can serialized and deserialized\n * ModuleId means the module address (e.g \"0x1\") and the module name (e.g \"coin\")\n */\nexport class ModuleId extends Serializable {\n public readonly address: AccountAddress;\n\n public readonly name: Identifier;\n\n /**\n * Full name of a module.\n * @param address The account address. e.g \"0x1\"\n * @param name The module name under the \"address\". e.g \"coin\"\n */\n constructor(address: AccountAddress, name: Identifier) {\n super();\n this.address = address;\n this.name = name;\n }\n\n /**\n * Converts a string literal to a ModuleId\n * @param moduleId String literal in format \"account_address::module_name\", e.g. \"0x1::coin\"\n * @returns ModuleId\n */\n static fromStr(moduleId: MoveModuleId): ModuleId {\n const parts = moduleId.split(\"::\");\n if (parts.length !== 2) {\n throw new Error(\"Invalid module id.\");\n }\n return new ModuleId(AccountAddress.fromString(parts[0]), new Identifier(parts[1]));\n }\n\n serialize(serializer: Serializer): void {\n this.address.serialize(serializer);\n this.name.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): ModuleId {\n const address = AccountAddress.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n return new ModuleId(address, name);\n }\n}\n"],"mappings":"2HAaO,IAAMA,EAAN,MAAMC,UAAiBC,CAAa,CAUzC,YAAYC,EAAyBC,EAAkB,CACrD,MAAM,EACN,KAAK,QAAUD,EACf,KAAK,KAAOC,CACd,CAOA,OAAO,QAAQC,EAAkC,CAC/C,IAAMC,EAAQD,EAAS,MAAM,IAAI,EACjC,GAAIC,EAAM,SAAW,EACnB,MAAM,IAAI,MAAM,oBAAoB,EAEtC,OAAO,IAAIL,EAASM,EAAe,WAAWD,EAAM,CAAC,CAAC,EAAG,IAAIE,EAAWF,EAAM,CAAC,CAAC,CAAC,CACnF,CAEA,UAAUG,EAA8B,CACtC,KAAK,QAAQ,UAAUA,CAAU,EACjC,KAAK,KAAK,UAAUA,CAAU,CAChC,CAEA,OAAO,YAAYC,EAAsC,CACvD,IAAMP,EAAUI,EAAe,YAAYG,CAAY,EACjDN,EAAOI,EAAW,YAAYE,CAAY,EAChD,OAAO,IAAIT,EAASE,EAASC,CAAI,CACnC,CACF","names":["ModuleId","_ModuleId","Serializable","address","name","moduleId","parts","AccountAddress","Identifier","serializer","deserializer"]}
@@ -1,13 +1,2 @@
1
- import {
2
- LocalNode
3
- } from "../chunk-SS3NUM5L.mjs";
4
- import {
5
- Move
6
- } from "../chunk-N4WKFNQ6.mjs";
7
- import "../chunk-GGMTQAQP.mjs";
8
- import "../chunk-OR7TEZ25.mjs";
9
- export {
10
- LocalNode,
11
- Move
12
- };
1
+ import{a as r}from"../chunk-LDQ6JFEF.mjs";import{a as o}from"../chunk-L54P6EGN.mjs";import"../chunk-3JPVQHOR.mjs";import"../chunk-FVA2OPG4.mjs";export{o as LocalNode,r as Move};
13
2
  //# sourceMappingURL=index.mjs.map
@@ -1,9 +1,2 @@
1
- import {
2
- LocalNode
3
- } from "../chunk-SS3NUM5L.mjs";
4
- import "../chunk-GGMTQAQP.mjs";
5
- import "../chunk-OR7TEZ25.mjs";
6
- export {
7
- LocalNode
8
- };
1
+ import{a}from"../chunk-L54P6EGN.mjs";import"../chunk-3JPVQHOR.mjs";import"../chunk-FVA2OPG4.mjs";export{a as LocalNode};
9
2
  //# sourceMappingURL=localNode.mjs.map
@@ -1,8 +1,2 @@
1
- import {
2
- Move
3
- } from "../chunk-N4WKFNQ6.mjs";
4
- import "../chunk-OR7TEZ25.mjs";
5
- export {
6
- Move
7
- };
1
+ import{a}from"../chunk-LDQ6JFEF.mjs";import"../chunk-FVA2OPG4.mjs";export{a as Move};
8
2
  //# sourceMappingURL=move.mjs.map
@@ -1,28 +1,2 @@
1
- import {
2
- aptosRequest,
3
- request
4
- } from "../chunk-VKJQORON.mjs";
5
- import "../chunk-GED6IT3S.mjs";
6
- import "../chunk-QBBTUC66.mjs";
7
- import "../chunk-PCLNX6FS.mjs";
8
- import "../chunk-7REUIYF4.mjs";
9
- import "../chunk-D2BVBXWO.mjs";
10
- import "../chunk-NFJCQRVK.mjs";
11
- import "../chunk-FZY4PMEE.mjs";
12
- import "../chunk-PIMQHG2J.mjs";
13
- import "../chunk-KK2BSALW.mjs";
14
- import "../chunk-AR7X6GWQ.mjs";
15
- import "../chunk-WK5ZSNE2.mjs";
16
- import "../chunk-CX3NAVRD.mjs";
17
- import "../chunk-4WPQQPUF.mjs";
18
- import "../chunk-7JRMOHBP.mjs";
19
- import "../chunk-FQQW55X7.mjs";
20
- import "../chunk-YV7M4CFP.mjs";
21
- import "../chunk-QMM2KL6C.mjs";
22
- import "../chunk-SBB4YEPT.mjs";
23
- import "../chunk-OR7TEZ25.mjs";
24
- export {
25
- aptosRequest,
26
- request
27
- };
1
+ import{a,b}from"../chunk-WOPMZAWX.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-UTXJOB3O.mjs";import"../chunk-RKHPXZM6.mjs";import"../chunk-JM544NRW.mjs";import"../chunk-CPBGL37X.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-FVA2OPG4.mjs";export{b as aptosRequest,a as request};
28
2
  //# sourceMappingURL=core.mjs.map
@@ -1,33 +1,2 @@
1
- import {
2
- get,
3
- getAptosFullNode,
4
- getAptosPepperService,
5
- paginateWithCursor
6
- } from "../chunk-LYK4TQZO.mjs";
7
- import "../chunk-VKJQORON.mjs";
8
- import "../chunk-GED6IT3S.mjs";
9
- import "../chunk-QBBTUC66.mjs";
10
- import "../chunk-PCLNX6FS.mjs";
11
- import "../chunk-7REUIYF4.mjs";
12
- import "../chunk-D2BVBXWO.mjs";
13
- import "../chunk-NFJCQRVK.mjs";
14
- import "../chunk-FZY4PMEE.mjs";
15
- import "../chunk-PIMQHG2J.mjs";
16
- import "../chunk-KK2BSALW.mjs";
17
- import "../chunk-AR7X6GWQ.mjs";
18
- import "../chunk-WK5ZSNE2.mjs";
19
- import "../chunk-CX3NAVRD.mjs";
20
- import "../chunk-4WPQQPUF.mjs";
21
- import "../chunk-7JRMOHBP.mjs";
22
- import "../chunk-FQQW55X7.mjs";
23
- import "../chunk-YV7M4CFP.mjs";
24
- import "../chunk-QMM2KL6C.mjs";
25
- import "../chunk-SBB4YEPT.mjs";
26
- import "../chunk-OR7TEZ25.mjs";
27
- export {
28
- get,
29
- getAptosFullNode,
30
- getAptosPepperService,
31
- paginateWithCursor
32
- };
1
+ import{a,b,c,d}from"../chunk-5JGWZSNG.mjs";import"../chunk-WOPMZAWX.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-UTXJOB3O.mjs";import"../chunk-RKHPXZM6.mjs";import"../chunk-JM544NRW.mjs";import"../chunk-CPBGL37X.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-FVA2OPG4.mjs";export{a as get,b as getAptosFullNode,c as getAptosPepperService,d as paginateWithCursor};
33
2
  //# sourceMappingURL=get.mjs.map
@@ -1,56 +1,2 @@
1
- import "../chunk-N2FKVZ4D.mjs";
2
- import {
3
- get,
4
- getAptosFullNode,
5
- getAptosPepperService,
6
- paginateWithCursor
7
- } from "../chunk-LYK4TQZO.mjs";
8
- import {
9
- post,
10
- postAptosFaucet,
11
- postAptosFullNode,
12
- postAptosIndexer,
13
- postAptosPepperService,
14
- postAptosProvingService
15
- } from "../chunk-NXFO2W4G.mjs";
16
- import {
17
- aptosRequest,
18
- request
19
- } from "../chunk-VKJQORON.mjs";
20
- import "../chunk-GED6IT3S.mjs";
21
- import "../chunk-QBBTUC66.mjs";
22
- import {
23
- AptosApiError
24
- } from "../chunk-PCLNX6FS.mjs";
25
- import "../chunk-7REUIYF4.mjs";
26
- import "../chunk-D2BVBXWO.mjs";
27
- import "../chunk-NFJCQRVK.mjs";
28
- import "../chunk-FZY4PMEE.mjs";
29
- import "../chunk-PIMQHG2J.mjs";
30
- import "../chunk-KK2BSALW.mjs";
31
- import "../chunk-AR7X6GWQ.mjs";
32
- import "../chunk-WK5ZSNE2.mjs";
33
- import "../chunk-CX3NAVRD.mjs";
34
- import "../chunk-4WPQQPUF.mjs";
35
- import "../chunk-7JRMOHBP.mjs";
36
- import "../chunk-FQQW55X7.mjs";
37
- import "../chunk-YV7M4CFP.mjs";
38
- import "../chunk-QMM2KL6C.mjs";
39
- import "../chunk-SBB4YEPT.mjs";
40
- import "../chunk-OR7TEZ25.mjs";
41
- export {
42
- AptosApiError,
43
- aptosRequest,
44
- get,
45
- getAptosFullNode,
46
- getAptosPepperService,
47
- paginateWithCursor,
48
- post,
49
- postAptosFaucet,
50
- postAptosFullNode,
51
- postAptosIndexer,
52
- postAptosPepperService,
53
- postAptosProvingService,
54
- request
55
- };
1
+ import"../chunk-N2FKVZ4D.mjs";import{a as d,b as e,c as f,d as g}from"../chunk-5JGWZSNG.mjs";import{a as h,b as i,c as j,d as k,e as l,f as m}from"../chunk-KYZCH7IK.mjs";import{a as b,b as c}from"../chunk-WOPMZAWX.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-UTXJOB3O.mjs";import{a}from"../chunk-RKHPXZM6.mjs";import"../chunk-JM544NRW.mjs";import"../chunk-CPBGL37X.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-FVA2OPG4.mjs";export{a as AptosApiError,c as aptosRequest,d as get,e as getAptosFullNode,f as getAptosPepperService,g as paginateWithCursor,h as post,k as postAptosFaucet,i as postAptosFullNode,j as postAptosIndexer,l as postAptosPepperService,m as postAptosProvingService,b as request};
56
2
  //# sourceMappingURL=index.mjs.map
@@ -1,37 +1,2 @@
1
- import {
2
- post,
3
- postAptosFaucet,
4
- postAptosFullNode,
5
- postAptosIndexer,
6
- postAptosPepperService,
7
- postAptosProvingService
8
- } from "../chunk-NXFO2W4G.mjs";
9
- import "../chunk-VKJQORON.mjs";
10
- import "../chunk-GED6IT3S.mjs";
11
- import "../chunk-QBBTUC66.mjs";
12
- import "../chunk-PCLNX6FS.mjs";
13
- import "../chunk-7REUIYF4.mjs";
14
- import "../chunk-D2BVBXWO.mjs";
15
- import "../chunk-NFJCQRVK.mjs";
16
- import "../chunk-FZY4PMEE.mjs";
17
- import "../chunk-PIMQHG2J.mjs";
18
- import "../chunk-KK2BSALW.mjs";
19
- import "../chunk-AR7X6GWQ.mjs";
20
- import "../chunk-WK5ZSNE2.mjs";
21
- import "../chunk-CX3NAVRD.mjs";
22
- import "../chunk-4WPQQPUF.mjs";
23
- import "../chunk-7JRMOHBP.mjs";
24
- import "../chunk-FQQW55X7.mjs";
25
- import "../chunk-YV7M4CFP.mjs";
26
- import "../chunk-QMM2KL6C.mjs";
27
- import "../chunk-SBB4YEPT.mjs";
28
- import "../chunk-OR7TEZ25.mjs";
29
- export {
30
- post,
31
- postAptosFaucet,
32
- postAptosFullNode,
33
- postAptosIndexer,
34
- postAptosPepperService,
35
- postAptosProvingService
36
- };
1
+ import{a,b,c,d,e,f}from"../chunk-KYZCH7IK.mjs";import"../chunk-WOPMZAWX.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-UTXJOB3O.mjs";import"../chunk-RKHPXZM6.mjs";import"../chunk-JM544NRW.mjs";import"../chunk-CPBGL37X.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-FVA2OPG4.mjs";export{a as post,d as postAptosFaucet,b as postAptosFullNode,c as postAptosIndexer,e as postAptosPepperService,f as postAptosProvingService};
37
2
  //# sourceMappingURL=post.mjs.map
@@ -1,8 +1,2 @@
1
- import {
2
- AptosApiError
3
- } from "../chunk-PCLNX6FS.mjs";
4
- import "../chunk-OR7TEZ25.mjs";
5
- export {
6
- AptosApiError
7
- };
1
+ import{a}from"../chunk-RKHPXZM6.mjs";import"../chunk-FVA2OPG4.mjs";export{a as AptosApiError};
8
2
  //# sourceMappingURL=types.mjs.map
@@ -1,20 +1,2 @@
1
- import "../../chunk-4QMXOWHP.mjs";
2
- import {
3
- createObjectAddress,
4
- createResourceAddress,
5
- createTokenAddress
6
- } from "../../chunk-PYLOAMR2.mjs";
7
- import "../../chunk-CMNJG4NN.mjs";
8
- import "../../chunk-CX3NAVRD.mjs";
9
- import "../../chunk-4WPQQPUF.mjs";
10
- import "../../chunk-FQQW55X7.mjs";
11
- import "../../chunk-YV7M4CFP.mjs";
12
- import "../../chunk-QMM2KL6C.mjs";
13
- import "../../chunk-SBB4YEPT.mjs";
14
- import "../../chunk-OR7TEZ25.mjs";
15
- export {
16
- createObjectAddress,
17
- createResourceAddress,
18
- createTokenAddress
19
- };
1
+ import"../../chunk-4QMXOWHP.mjs";import{a as o,b as r,c as e}from"../../chunk-HGZGTBA4.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-FVA2OPG4.mjs";export{o as createObjectAddress,r as createResourceAddress,e as createTokenAddress};
20
2
  //# sourceMappingURL=index.mjs.map
@@ -1,19 +1,2 @@
1
- import {
2
- createObjectAddress,
3
- createResourceAddress,
4
- createTokenAddress
5
- } from "../../../chunk-PYLOAMR2.mjs";
6
- import "../../../chunk-CMNJG4NN.mjs";
7
- import "../../../chunk-CX3NAVRD.mjs";
8
- import "../../../chunk-4WPQQPUF.mjs";
9
- import "../../../chunk-FQQW55X7.mjs";
10
- import "../../../chunk-YV7M4CFP.mjs";
11
- import "../../../chunk-QMM2KL6C.mjs";
12
- import "../../../chunk-SBB4YEPT.mjs";
13
- import "../../../chunk-OR7TEZ25.mjs";
14
- export {
15
- createObjectAddress,
16
- createResourceAddress,
17
- createTokenAddress
18
- };
1
+ import{a,b,c}from"../../../chunk-HGZGTBA4.mjs";import"../../../chunk-T23OVRNF.mjs";import"../../../chunk-JM2B5E2I.mjs";import"../../../chunk-4WPQQPUF.mjs";import"../../../chunk-TVRJ3M7B.mjs";import"../../../chunk-AOCNYMMX.mjs";import"../../../chunk-56CNRT2K.mjs";import"../../../chunk-FBPNHF54.mjs";import"../../../chunk-FVA2OPG4.mjs";export{a as createObjectAddress,b as createResourceAddress,c as createTokenAddress};
19
2
  //# sourceMappingURL=address.mjs.map
@@ -1,20 +1,2 @@
1
- import "../../../chunk-4QMXOWHP.mjs";
2
- import {
3
- createObjectAddress,
4
- createResourceAddress,
5
- createTokenAddress
6
- } from "../../../chunk-PYLOAMR2.mjs";
7
- import "../../../chunk-CMNJG4NN.mjs";
8
- import "../../../chunk-CX3NAVRD.mjs";
9
- import "../../../chunk-4WPQQPUF.mjs";
10
- import "../../../chunk-FQQW55X7.mjs";
11
- import "../../../chunk-YV7M4CFP.mjs";
12
- import "../../../chunk-QMM2KL6C.mjs";
13
- import "../../../chunk-SBB4YEPT.mjs";
14
- import "../../../chunk-OR7TEZ25.mjs";
15
- export {
16
- createObjectAddress,
17
- createResourceAddress,
18
- createTokenAddress
19
- };
1
+ import"../../../chunk-4QMXOWHP.mjs";import{a,b,c}from"../../../chunk-HGZGTBA4.mjs";import"../../../chunk-T23OVRNF.mjs";import"../../../chunk-JM2B5E2I.mjs";import"../../../chunk-4WPQQPUF.mjs";import"../../../chunk-TVRJ3M7B.mjs";import"../../../chunk-AOCNYMMX.mjs";import"../../../chunk-56CNRT2K.mjs";import"../../../chunk-FBPNHF54.mjs";import"../../../chunk-FVA2OPG4.mjs";export{a as createObjectAddress,b as createResourceAddress,c as createTokenAddress};
20
2
  //# sourceMappingURL=index.mjs.map
@@ -1,16 +1,2 @@
1
- import {
2
- AccountAddress,
3
- AddressInvalidReason
4
- } from "../chunk-CMNJG4NN.mjs";
5
- import "../chunk-CX3NAVRD.mjs";
6
- import "../chunk-4WPQQPUF.mjs";
7
- import "../chunk-FQQW55X7.mjs";
8
- import "../chunk-YV7M4CFP.mjs";
9
- import "../chunk-QMM2KL6C.mjs";
10
- import "../chunk-SBB4YEPT.mjs";
11
- import "../chunk-OR7TEZ25.mjs";
12
- export {
13
- AccountAddress,
14
- AddressInvalidReason
15
- };
1
+ import{a,b}from"../chunk-T23OVRNF.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-FVA2OPG4.mjs";export{b as AccountAddress,a as AddressInvalidReason};
16
2
  //# sourceMappingURL=accountAddress.mjs.map
@@ -1,15 +1,2 @@
1
- import {
2
- AuthenticationKey
3
- } from "../chunk-UEBBLQJ5.mjs";
4
- import "../chunk-CMNJG4NN.mjs";
5
- import "../chunk-CX3NAVRD.mjs";
6
- import "../chunk-4WPQQPUF.mjs";
7
- import "../chunk-FQQW55X7.mjs";
8
- import "../chunk-YV7M4CFP.mjs";
9
- import "../chunk-QMM2KL6C.mjs";
10
- import "../chunk-SBB4YEPT.mjs";
11
- import "../chunk-OR7TEZ25.mjs";
12
- export {
13
- AuthenticationKey
14
- };
1
+ import{a}from"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-FVA2OPG4.mjs";export{a as AuthenticationKey};
15
2
  //# sourceMappingURL=authenticationKey.mjs.map
@@ -1,8 +1,2 @@
1
- import {
2
- ParsingError
3
- } from "../chunk-QMM2KL6C.mjs";
4
- import "../chunk-OR7TEZ25.mjs";
5
- export {
6
- ParsingError
7
- };
1
+ import{a}from"../chunk-FBPNHF54.mjs";import"../chunk-FVA2OPG4.mjs";export{a as ParsingError};
8
2
  //# sourceMappingURL=common.mjs.map
@@ -1,30 +1,2 @@
1
- import {
2
- Ed25519PrivateKey,
3
- Ed25519PublicKey,
4
- Ed25519Signature
5
- } from "../../chunk-RX4VG2AT.mjs";
6
- import "../../chunk-FDWJNY4U.mjs";
7
- import "../../chunk-NMKCJNQM.mjs";
8
- import "../../chunk-FXKSE3ZP.mjs";
9
- import "../../chunk-PU5AFUX3.mjs";
10
- import "../../chunk-UEBBLQJ5.mjs";
11
- import "../../chunk-CMNJG4NN.mjs";
12
- import "../../chunk-FZY4PMEE.mjs";
13
- import "../../chunk-PIMQHG2J.mjs";
14
- import "../../chunk-KK2BSALW.mjs";
15
- import "../../chunk-AR7X6GWQ.mjs";
16
- import "../../chunk-WK5ZSNE2.mjs";
17
- import "../../chunk-CX3NAVRD.mjs";
18
- import "../../chunk-4WPQQPUF.mjs";
19
- import "../../chunk-7JRMOHBP.mjs";
20
- import "../../chunk-FQQW55X7.mjs";
21
- import "../../chunk-YV7M4CFP.mjs";
22
- import "../../chunk-QMM2KL6C.mjs";
23
- import "../../chunk-SBB4YEPT.mjs";
24
- import "../../chunk-OR7TEZ25.mjs";
25
- export {
26
- Ed25519PrivateKey,
27
- Ed25519PublicKey,
28
- Ed25519Signature
29
- };
1
+ import{a,b,c}from"../../chunk-PYUU4OEL.mjs";import"../../chunk-COW5IGYC.mjs";import"../../chunk-STYDBDYL.mjs";import"../../chunk-TJDC5PWD.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-7STYQ5ZE.mjs";import"../../chunk-T23OVRNF.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-EB7AI4B4.mjs";import"../../chunk-6RBUXB5I.mjs";import"../../chunk-C3L4ETUF.mjs";import"../../chunk-3FVRXELT.mjs";import"../../chunk-VT6XJSRO.mjs";import"../../chunk-JM2B5E2I.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-TVRJ3M7B.mjs";import"../../chunk-AOCNYMMX.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-FVA2OPG4.mjs";export{b as Ed25519PrivateKey,a as Ed25519PublicKey,c as Ed25519Signature};
30
2
  //# sourceMappingURL=ed25519.mjs.map