@aptos-labs/ts-sdk 1.13.2 → 1.13.3-zeta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (474) hide show
  1. package/dist/common/index.d.ts +1800 -1346
  2. package/dist/common/index.js +26 -26
  3. package/dist/common/index.js.map +1 -1
  4. package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-8gJF5t3F.d.mts} +10 -12
  5. package/dist/esm/account/Account.d.mts +34 -0
  6. package/dist/esm/account/Account.mjs +2 -0
  7. package/dist/esm/account/Ed25519Account.d.mts +34 -0
  8. package/dist/esm/account/Ed25519Account.mjs +2 -0
  9. package/dist/esm/account/EphemeralKeyPair.d.mts +47 -0
  10. package/dist/esm/account/EphemeralKeyPair.mjs +2 -0
  11. package/dist/esm/account/KeylessAccount.d.mts +106 -0
  12. package/dist/esm/account/KeylessAccount.mjs +2 -0
  13. package/dist/esm/account/MultiKeyAccount.d.mts +99 -0
  14. package/dist/esm/account/MultiKeyAccount.mjs +2 -0
  15. package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
  16. package/dist/esm/account/SingleKeyAccount.mjs +2 -0
  17. package/dist/esm/account/index.d.mts +40 -0
  18. package/dist/esm/account/index.mjs +2 -0
  19. package/dist/esm/api/account.d.mts +13 -1
  20. package/dist/esm/api/account.mjs +1 -1
  21. package/dist/esm/api/ans.d.mts +2 -2
  22. package/dist/esm/api/ans.mjs +1 -1
  23. package/dist/esm/api/aptos.d.mts +14 -8
  24. package/dist/esm/api/aptos.mjs +1 -1
  25. package/dist/esm/api/aptosConfig.d.mts +20 -0
  26. package/dist/esm/api/aptosConfig.mjs +1 -1
  27. package/dist/esm/api/coin.d.mts +7 -7
  28. package/dist/esm/api/coin.mjs +1 -1
  29. package/dist/esm/api/digitalAsset.d.mts +1 -1
  30. package/dist/esm/api/digitalAsset.mjs +1 -1
  31. package/dist/esm/api/event.mjs +1 -1
  32. package/dist/esm/api/faucet.mjs +1 -1
  33. package/dist/esm/api/fungibleAsset.d.mts +5 -5
  34. package/dist/esm/api/fungibleAsset.mjs +1 -1
  35. package/dist/esm/api/general.d.mts +7 -7
  36. package/dist/esm/api/general.mjs +1 -1
  37. package/dist/esm/api/index.d.mts +13 -8
  38. package/dist/esm/api/index.mjs +1 -1
  39. package/dist/esm/api/keyless.d.mts +67 -0
  40. package/dist/esm/api/keyless.mjs +2 -0
  41. package/dist/esm/api/staking.mjs +1 -1
  42. package/dist/esm/api/transaction.d.mts +1 -1
  43. package/dist/esm/api/transaction.mjs +1 -1
  44. package/dist/esm/api/transactionSubmission/build.d.mts +3 -3
  45. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  46. package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
  47. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  48. package/dist/esm/api/transactionSubmission/sign.d.mts +1 -1
  49. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  50. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  51. package/dist/esm/api/transactionSubmission/simulate.d.mts +6 -6
  52. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  53. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  54. package/dist/esm/api/utils.mjs +1 -1
  55. package/dist/esm/bcs/index.mjs +1 -1
  56. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  57. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  58. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  59. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  60. package/dist/esm/bcs/serializer.d.mts +2 -0
  61. package/dist/esm/bcs/serializer.mjs +1 -1
  62. package/dist/esm/chunk-2Q6K4CLJ.mjs +2 -0
  63. package/dist/esm/chunk-2Q6K4CLJ.mjs.map +1 -0
  64. package/dist/esm/chunk-2YDIOWRJ.mjs +2 -0
  65. package/dist/esm/chunk-2YDIOWRJ.mjs.map +1 -0
  66. package/dist/esm/{chunk-2PFN7LYP.mjs → chunk-33WBJV5U.mjs} +2 -2
  67. package/dist/esm/{chunk-PIOHC246.mjs → chunk-37CYBCWS.mjs} +2 -2
  68. package/dist/esm/chunk-37CYBCWS.mjs.map +1 -0
  69. package/dist/esm/{chunk-TBMAJ6AW.mjs → chunk-3FVRXELT.mjs} +2 -2
  70. package/dist/esm/{chunk-GS5J57UA.mjs → chunk-3QHRPREO.mjs} +2 -2
  71. package/dist/esm/chunk-3QHRPREO.mjs.map +1 -0
  72. package/dist/esm/{chunk-DMKUAQB7.mjs → chunk-3VGX3TXH.mjs} +2 -2
  73. package/dist/esm/{chunk-PJLCPRYJ.mjs → chunk-3YNRBMPS.mjs} +2 -2
  74. package/dist/esm/chunk-4NMDYPUD.mjs +1 -0
  75. package/dist/esm/chunk-4NMDYPUD.mjs.map +1 -0
  76. package/dist/esm/chunk-4XB3D2ZD.mjs +2 -0
  77. package/dist/esm/chunk-4XB3D2ZD.mjs.map +1 -0
  78. package/dist/esm/chunk-5QBTBH64.mjs +2 -0
  79. package/dist/esm/chunk-5VSMDXZ6.mjs +2 -0
  80. package/dist/esm/chunk-5VSMDXZ6.mjs.map +1 -0
  81. package/dist/esm/{chunk-A556OVZY.mjs → chunk-6CQH7JPF.mjs} +2 -2
  82. package/dist/esm/chunk-6GQAHQGW.mjs +2 -0
  83. package/dist/esm/chunk-6GQAHQGW.mjs.map +1 -0
  84. package/dist/esm/chunk-6J3CB3DN.mjs +2 -0
  85. package/dist/esm/chunk-6J3CB3DN.mjs.map +1 -0
  86. package/dist/esm/chunk-6M6XXPQQ.mjs +2 -0
  87. package/dist/esm/chunk-6M6XXPQQ.mjs.map +1 -0
  88. package/dist/esm/{chunk-QIAHBEEW.mjs → chunk-6RBUXB5I.mjs} +2 -2
  89. package/dist/esm/{chunk-FXNFWLQC.mjs → chunk-7H3HRFVM.mjs} +2 -2
  90. package/dist/esm/chunk-7JNPSNL6.mjs +2 -0
  91. package/dist/esm/chunk-7JNPSNL6.mjs.map +1 -0
  92. package/dist/esm/{chunk-NPFNYP75.mjs → chunk-7STYQ5ZE.mjs} +2 -2
  93. package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
  94. package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
  95. package/dist/esm/{chunk-4LMAVPA4.mjs → chunk-A7L2Z5DW.mjs} +2 -2
  96. package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
  97. package/dist/esm/chunk-AQ4I7VVB.mjs.map +1 -0
  98. package/dist/esm/{chunk-ZYYK3UXP.mjs → chunk-C3L4ETUF.mjs} +2 -2
  99. package/dist/esm/chunk-CHQ6IKE3.mjs +2 -0
  100. package/dist/esm/{chunk-MNBYKY5P.mjs.map → chunk-CHQ6IKE3.mjs.map} +1 -1
  101. package/dist/esm/{chunk-WFZDFFBM.mjs → chunk-COW5IGYC.mjs} +2 -2
  102. package/dist/esm/{chunk-RQEWIZ67.mjs → chunk-DIBNAYZ2.mjs} +2 -2
  103. package/dist/esm/chunk-DMKFITUM.mjs +2 -0
  104. package/dist/esm/chunk-DMKFITUM.mjs.map +1 -0
  105. package/dist/esm/{chunk-TORRTLWV.mjs → chunk-DOCYCNXV.mjs} +2 -2
  106. package/dist/esm/chunk-DOCYCNXV.mjs.map +1 -0
  107. package/dist/esm/{chunk-TGG7SWBO.mjs → chunk-DX62SMGM.mjs} +2 -2
  108. package/dist/esm/chunk-DX62SMGM.mjs.map +1 -0
  109. package/dist/esm/{chunk-FS3NSGBF.mjs → chunk-EB7AI4B4.mjs} +2 -2
  110. package/dist/esm/chunk-EFRNRARV.mjs +2 -0
  111. package/dist/esm/chunk-EFRNRARV.mjs.map +1 -0
  112. package/dist/esm/chunk-EKOIHFAW.mjs +2 -0
  113. package/dist/esm/{chunk-B252RJCU.mjs.map → chunk-EKOIHFAW.mjs.map} +1 -1
  114. package/dist/esm/chunk-FLYEALDB.mjs +2 -0
  115. package/dist/esm/chunk-FLYEALDB.mjs.map +1 -0
  116. package/dist/esm/{chunk-YKVKSNH4.mjs → chunk-GI52SX32.mjs} +2 -2
  117. package/dist/esm/{chunk-3RUY5FQK.mjs → chunk-GKCO5PQJ.mjs} +2 -2
  118. package/dist/esm/chunk-GKCO5PQJ.mjs.map +1 -0
  119. package/dist/esm/{chunk-UML2VQZT.mjs → chunk-HGZGTBA4.mjs} +2 -2
  120. package/dist/esm/chunk-HJULFJXF.mjs +2 -0
  121. package/dist/esm/chunk-HJULFJXF.mjs.map +1 -0
  122. package/dist/esm/{chunk-TGXZVNR5.mjs → chunk-IEZO4PIG.mjs} +2 -2
  123. package/dist/esm/{chunk-UMFJDDYI.mjs → chunk-IM32PZOD.mjs} +2 -2
  124. package/dist/esm/chunk-IM32PZOD.mjs.map +1 -0
  125. package/dist/esm/chunk-IOVRZ2CA.mjs +2 -0
  126. package/dist/esm/chunk-IOVRZ2CA.mjs.map +1 -0
  127. package/dist/esm/chunk-ITEV72BZ.mjs +2 -0
  128. package/dist/esm/chunk-ITEV72BZ.mjs.map +1 -0
  129. package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
  130. package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
  131. package/dist/esm/{chunk-KDCHX7BI.mjs → chunk-KFJMLLOA.mjs} +2 -2
  132. package/dist/esm/chunk-KGJITNRZ.mjs +2 -0
  133. package/dist/esm/chunk-KGJITNRZ.mjs.map +1 -0
  134. package/dist/esm/chunk-KOCKKI4F.mjs +2 -0
  135. package/dist/esm/{chunk-YBEF3UR3.mjs → chunk-LV7OW245.mjs} +2 -2
  136. package/dist/esm/{chunk-DSTKXJMA.mjs → chunk-MGOHPDX4.mjs} +2 -2
  137. package/dist/esm/{chunk-BBU2EE6D.mjs → chunk-MJGZJL3W.mjs} +2 -2
  138. package/dist/esm/{chunk-UPIN5AIO.mjs → chunk-MKUAW7KW.mjs} +2 -2
  139. package/dist/esm/{chunk-BWFJHFBQ.mjs → chunk-MWUJCP27.mjs} +2 -2
  140. package/dist/esm/{chunk-QTRYMRYK.mjs → chunk-NC5HHEEM.mjs} +2 -2
  141. package/dist/esm/{chunk-6MG4JAYB.mjs → chunk-NPNAKSCR.mjs} +2 -2
  142. package/dist/esm/chunk-NWLZDI2I.mjs +2 -0
  143. package/dist/esm/chunk-NWLZDI2I.mjs.map +1 -0
  144. package/dist/esm/{chunk-6IGEUEER.mjs → chunk-ODTNF2YP.mjs} +2 -2
  145. package/dist/esm/{chunk-LV2V23Z6.mjs → chunk-OKG6X5TX.mjs} +2 -2
  146. package/dist/esm/chunk-OKG6X5TX.mjs.map +1 -0
  147. package/dist/esm/chunk-OKRUEVF3.mjs +2 -0
  148. package/dist/esm/chunk-OKRUEVF3.mjs.map +1 -0
  149. package/dist/esm/chunk-OYTLWUQT.mjs +2 -0
  150. package/dist/esm/chunk-OYTLWUQT.mjs.map +1 -0
  151. package/dist/esm/chunk-P5VCS2F5.mjs +2 -0
  152. package/dist/esm/chunk-P5VCS2F5.mjs.map +1 -0
  153. package/dist/esm/{chunk-U43IJHQN.mjs → chunk-PFFAQZHT.mjs} +2 -2
  154. package/dist/esm/{chunk-3HV2C4SS.mjs → chunk-PTIZKRON.mjs} +2 -2
  155. package/dist/esm/chunk-R4UIPTBH.mjs +2 -0
  156. package/dist/esm/chunk-R4UIPTBH.mjs.map +1 -0
  157. package/dist/esm/chunk-R7BAM2G6.mjs +2 -0
  158. package/dist/esm/chunk-R7BAM2G6.mjs.map +1 -0
  159. package/dist/esm/{chunk-GXYS45Y5.mjs → chunk-RDNPWCZ4.mjs} +2 -2
  160. package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
  161. package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
  162. package/dist/esm/chunk-S5HG2QUD.mjs +2 -0
  163. package/dist/esm/chunk-S5HG2QUD.mjs.map +1 -0
  164. package/dist/esm/chunk-SA7MZPM3.mjs +2 -0
  165. package/dist/esm/chunk-SA7MZPM3.mjs.map +1 -0
  166. package/dist/esm/{chunk-R5QUBEH6.mjs → chunk-STYDBDYL.mjs} +2 -2
  167. package/dist/esm/{chunk-IOSQVDZI.mjs → chunk-T23OVRNF.mjs} +2 -2
  168. package/dist/esm/{chunk-BRQYARQ3.mjs → chunk-T7JIGO3O.mjs} +2 -2
  169. package/dist/esm/{chunk-4DNVCOW7.mjs → chunk-TFJCMFKE.mjs} +2 -2
  170. package/dist/esm/chunk-TFJCMFKE.mjs.map +1 -0
  171. package/dist/esm/{chunk-3QBZU5ZD.mjs → chunk-TV64AINP.mjs} +2 -2
  172. package/dist/esm/chunk-TV64AINP.mjs.map +1 -0
  173. package/dist/esm/{chunk-52C73T26.mjs → chunk-TVRJ3M7B.mjs} +2 -2
  174. package/dist/esm/{chunk-52C73T26.mjs.map → chunk-TVRJ3M7B.mjs.map} +1 -1
  175. package/dist/esm/{chunk-GRT5PHL6.mjs → chunk-UKJUHLZW.mjs} +2 -2
  176. package/dist/esm/chunk-VTX77UM3.mjs +2 -0
  177. package/dist/esm/chunk-VTX77UM3.mjs.map +1 -0
  178. package/dist/esm/{chunk-BAV4XY7C.mjs → chunk-W637YAND.mjs} +2 -2
  179. package/dist/esm/chunk-WPVBC4JS.mjs +2 -0
  180. package/dist/esm/chunk-WPVBC4JS.mjs.map +1 -0
  181. package/dist/esm/chunk-WTVN3XGK.mjs +2 -0
  182. package/dist/esm/chunk-WTVN3XGK.mjs.map +1 -0
  183. package/dist/esm/chunk-X7GVXVT4.mjs +2 -0
  184. package/dist/esm/{chunk-IZT6OX3R.mjs.map → chunk-X7GVXVT4.mjs.map} +1 -1
  185. package/dist/esm/{chunk-XLPVG4XR.mjs → chunk-XHPLLMR5.mjs} +2 -2
  186. package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
  187. package/dist/esm/chunk-YE5B2S5L.mjs.map +1 -0
  188. package/dist/esm/{chunk-QWRH22H4.mjs → chunk-YGB7MEH3.mjs} +2 -2
  189. package/dist/esm/chunk-YH6UKGIX.mjs +2 -0
  190. package/dist/esm/chunk-YH6UKGIX.mjs.map +1 -0
  191. package/dist/esm/{chunk-EJCKCYYI.mjs → chunk-YI7FZPIK.mjs} +2 -2
  192. package/dist/esm/{chunk-OGHE4AQA.mjs → chunk-Z2ZR4PTF.mjs} +2 -2
  193. package/dist/esm/{chunk-TC3VVMPY.mjs → chunk-ZGTJMNZG.mjs} +2 -2
  194. package/dist/esm/{chunk-RHBCVCOS.mjs → chunk-ZNEBMSNC.mjs} +2 -2
  195. package/dist/esm/client/core.mjs +1 -1
  196. package/dist/esm/client/get.d.mts +2 -1
  197. package/dist/esm/client/get.mjs +1 -1
  198. package/dist/esm/client/index.d.mts +2 -2
  199. package/dist/esm/client/index.mjs +1 -1
  200. package/dist/esm/client/post.d.mts +3 -1
  201. package/dist/esm/client/post.mjs +1 -1
  202. package/dist/esm/core/account/index.d.mts +5 -14
  203. package/dist/esm/core/account/index.mjs +1 -1
  204. package/dist/esm/core/account/utils/address.mjs +1 -1
  205. package/dist/esm/core/account/utils/index.mjs +1 -1
  206. package/dist/esm/core/accountAddress.mjs +1 -1
  207. package/dist/esm/core/authenticationKey.mjs +1 -1
  208. package/dist/esm/core/crypto/ed25519.d.mts +0 -10
  209. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  210. package/dist/esm/core/crypto/ephemeral.d.mts +77 -0
  211. package/dist/esm/core/crypto/ephemeral.mjs +2 -0
  212. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
  213. package/dist/esm/core/crypto/hdKey.d.mts +15 -1
  214. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  215. package/dist/esm/core/crypto/index.d.mts +7 -5
  216. package/dist/esm/core/crypto/index.mjs +1 -1
  217. package/dist/esm/core/crypto/keyless.d.mts +217 -0
  218. package/dist/esm/core/crypto/keyless.mjs +2 -0
  219. package/dist/esm/core/crypto/keyless.mjs.map +1 -0
  220. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  221. package/dist/esm/core/crypto/multiKey.d.mts +4 -3
  222. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  223. package/dist/esm/core/crypto/poseidon.d.mts +7 -0
  224. package/dist/esm/core/crypto/poseidon.mjs +2 -0
  225. package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
  226. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  227. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  228. package/dist/esm/core/crypto/signature.mjs +1 -1
  229. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  230. package/dist/esm/core/index.d.mts +6 -7
  231. package/dist/esm/core/index.mjs +1 -1
  232. package/dist/esm/index.d.mts +17 -11
  233. package/dist/esm/index.mjs +1 -1
  234. package/dist/esm/internal/account.d.mts +14 -2
  235. package/dist/esm/internal/account.mjs +1 -1
  236. package/dist/esm/internal/ans.d.mts +1 -1
  237. package/dist/esm/internal/ans.mjs +1 -1
  238. package/dist/esm/internal/coin.d.mts +7 -7
  239. package/dist/esm/internal/coin.mjs +1 -1
  240. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  241. package/dist/esm/internal/digitalAsset.mjs +1 -1
  242. package/dist/esm/internal/event.d.mts +1 -1
  243. package/dist/esm/internal/event.mjs +1 -1
  244. package/dist/esm/internal/faucet.d.mts +1 -1
  245. package/dist/esm/internal/faucet.mjs +1 -1
  246. package/dist/esm/internal/fungibleAsset.d.mts +5 -5
  247. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  248. package/dist/esm/internal/general.mjs +1 -1
  249. package/dist/esm/internal/keyless.d.mts +67 -0
  250. package/dist/esm/internal/keyless.mjs +2 -0
  251. package/dist/esm/internal/keyless.mjs.map +1 -0
  252. package/dist/esm/internal/staking.d.mts +1 -1
  253. package/dist/esm/internal/staking.mjs +1 -1
  254. package/dist/esm/internal/transaction.mjs +1 -1
  255. package/dist/esm/internal/transactionSubmission.d.mts +1 -1
  256. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  257. package/dist/esm/internal/view.d.mts +7 -7
  258. package/dist/esm/internal/view.mjs +1 -1
  259. package/dist/esm/transactions/authenticator/account.d.mts +3 -4
  260. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  261. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  262. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  263. package/dist/esm/transactions/index.d.mts +3 -3
  264. package/dist/esm/transactions/index.mjs +1 -1
  265. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  266. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  267. package/dist/esm/transactions/instances/index.d.mts +1 -0
  268. package/dist/esm/transactions/instances/index.mjs +1 -1
  269. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  270. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  271. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  272. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  273. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  274. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  275. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  276. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  277. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  278. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +13 -1
  279. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  280. package/dist/esm/transactions/management/index.d.mts +2 -2
  281. package/dist/esm/transactions/management/index.mjs +1 -1
  282. package/dist/esm/transactions/management/transactionWorker.d.mts +1 -1
  283. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  284. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
  285. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  286. package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
  287. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  288. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
  289. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  290. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +47 -0
  291. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +2 -0
  292. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
  293. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +13 -25
  294. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  295. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  296. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  297. package/dist/esm/transactions/types.d.mts +7 -7
  298. package/dist/esm/types/index.d.mts +17 -3
  299. package/dist/esm/types/index.mjs +1 -1
  300. package/dist/esm/types/keyless.d.mts +14 -0
  301. package/dist/esm/types/keyless.mjs +1 -0
  302. package/dist/esm/types/keyless.mjs.map +1 -0
  303. package/dist/esm/utils/apiEndpoints.d.mts +3 -1
  304. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  305. package/dist/esm/utils/const.d.mts +3 -1
  306. package/dist/esm/utils/const.mjs +1 -1
  307. package/dist/esm/utils/index.d.mts +1 -1
  308. package/dist/esm/utils/index.mjs +1 -1
  309. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  310. package/dist/esm/version.d.mts +1 -1
  311. package/dist/esm/version.mjs +1 -1
  312. package/package.json +7 -2
  313. package/src/{core/account → account}/Account.ts +12 -16
  314. package/src/{core/account → account}/Ed25519Account.ts +13 -7
  315. package/src/account/EphemeralKeyPair.ts +123 -0
  316. package/src/account/KeylessAccount.ts +299 -0
  317. package/src/account/MultiKeyAccount.ts +119 -0
  318. package/src/{core/account → account}/SingleKeyAccount.ts +13 -8
  319. package/src/account/index.ts +6 -0
  320. package/src/api/account.ts +2 -1
  321. package/src/api/ans.ts +2 -1
  322. package/src/api/aptos.ts +6 -0
  323. package/src/api/aptosConfig.ts +46 -1
  324. package/src/api/digitalAsset.ts +2 -1
  325. package/src/api/fungibleAsset.ts +2 -1
  326. package/src/api/keyless.ts +35 -0
  327. package/src/api/transaction.ts +2 -1
  328. package/src/api/transactionSubmission/management.ts +1 -1
  329. package/src/api/transactionSubmission/sign.ts +1 -1
  330. package/src/bcs/serializer.ts +18 -0
  331. package/src/client/core.ts +8 -0
  332. package/src/client/get.ts +6 -0
  333. package/src/client/post.ts +12 -0
  334. package/src/core/account/index.ts +1 -3
  335. package/src/core/crypto/ed25519.ts +4 -24
  336. package/src/core/crypto/ephemeral.ts +149 -0
  337. package/src/core/crypto/hdKey.ts +31 -0
  338. package/src/core/crypto/index.ts +2 -0
  339. package/src/core/crypto/keyless.ts +508 -0
  340. package/src/core/crypto/multiKey.ts +21 -11
  341. package/src/core/crypto/poseidon.ts +134 -0
  342. package/src/core/crypto/singleKey.ts +11 -0
  343. package/src/core/index.ts +0 -1
  344. package/src/index.ts +1 -0
  345. package/src/internal/account.ts +1 -1
  346. package/src/internal/ans.ts +2 -1
  347. package/src/internal/digitalAsset.ts +2 -1
  348. package/src/internal/fungibleAsset.ts +2 -1
  349. package/src/internal/keyless.ts +188 -0
  350. package/src/internal/transactionSubmission.ts +8 -7
  351. package/src/transactions/authenticator/account.ts +6 -11
  352. package/src/transactions/instances/index.ts +1 -0
  353. package/src/transactions/management/accountSequenceNumber.ts +1 -1
  354. package/src/transactions/management/transactionWorker.ts +8 -2
  355. package/src/transactions/transactionBuilder/index.ts +1 -0
  356. package/src/transactions/transactionBuilder/signingMessage.ts +70 -0
  357. package/src/transactions/transactionBuilder/transactionBuilder.ts +41 -70
  358. package/src/types/index.ts +19 -0
  359. package/src/types/keyless.ts +6 -0
  360. package/src/utils/apiEndpoints.ts +14 -0
  361. package/src/utils/const.ts +2 -0
  362. package/src/version.ts +1 -1
  363. package/dist/esm/chunk-3426VLAZ.mjs +0 -2
  364. package/dist/esm/chunk-3426VLAZ.mjs.map +0 -1
  365. package/dist/esm/chunk-3OCTOB2E.mjs +0 -2
  366. package/dist/esm/chunk-3OCTOB2E.mjs.map +0 -1
  367. package/dist/esm/chunk-3QBZU5ZD.mjs.map +0 -1
  368. package/dist/esm/chunk-3RUY5FQK.mjs.map +0 -1
  369. package/dist/esm/chunk-4DNVCOW7.mjs.map +0 -1
  370. package/dist/esm/chunk-5HALZ6JC.mjs +0 -2
  371. package/dist/esm/chunk-5HALZ6JC.mjs.map +0 -1
  372. package/dist/esm/chunk-5OM4V4DR.mjs +0 -2
  373. package/dist/esm/chunk-5TMLAKSH.mjs +0 -2
  374. package/dist/esm/chunk-5TMLAKSH.mjs.map +0 -1
  375. package/dist/esm/chunk-B252RJCU.mjs +0 -2
  376. package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
  377. package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
  378. package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
  379. package/dist/esm/chunk-FO6ZKE7A.mjs +0 -2
  380. package/dist/esm/chunk-FO6ZKE7A.mjs.map +0 -1
  381. package/dist/esm/chunk-GMQQSSEO.mjs +0 -2
  382. package/dist/esm/chunk-GMQQSSEO.mjs.map +0 -1
  383. package/dist/esm/chunk-GNQXMS53.mjs +0 -2
  384. package/dist/esm/chunk-GNQXMS53.mjs.map +0 -1
  385. package/dist/esm/chunk-GS5J57UA.mjs.map +0 -1
  386. package/dist/esm/chunk-HLVMEUWD.mjs +0 -2
  387. package/dist/esm/chunk-HLVMEUWD.mjs.map +0 -1
  388. package/dist/esm/chunk-HQSLBTW5.mjs +0 -2
  389. package/dist/esm/chunk-HQSLBTW5.mjs.map +0 -1
  390. package/dist/esm/chunk-ICXA3DZH.mjs +0 -1
  391. package/dist/esm/chunk-IZT6OX3R.mjs +0 -2
  392. package/dist/esm/chunk-KHOHRD2B.mjs +0 -2
  393. package/dist/esm/chunk-KHOHRD2B.mjs.map +0 -1
  394. package/dist/esm/chunk-L6PGWGFF.mjs +0 -2
  395. package/dist/esm/chunk-LR65XHSF.mjs +0 -2
  396. package/dist/esm/chunk-LR65XHSF.mjs.map +0 -1
  397. package/dist/esm/chunk-LV2V23Z6.mjs.map +0 -1
  398. package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
  399. package/dist/esm/chunk-MNBYKY5P.mjs +0 -2
  400. package/dist/esm/chunk-OVJQWQ2N.mjs +0 -2
  401. package/dist/esm/chunk-OVJQWQ2N.mjs.map +0 -1
  402. package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
  403. package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
  404. package/dist/esm/chunk-PIOHC246.mjs.map +0 -1
  405. package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
  406. package/dist/esm/chunk-TGG7SWBO.mjs.map +0 -1
  407. package/dist/esm/chunk-TORRTLWV.mjs.map +0 -1
  408. package/dist/esm/chunk-TQR7M73S.mjs +0 -2
  409. package/dist/esm/chunk-TQR7M73S.mjs.map +0 -1
  410. package/dist/esm/chunk-UMFJDDYI.mjs.map +0 -1
  411. package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
  412. package/dist/esm/chunk-VNO4VHJN.mjs +0 -2
  413. package/dist/esm/chunk-VNO4VHJN.mjs.map +0 -1
  414. package/dist/esm/chunk-WBOLHLPX.mjs +0 -2
  415. package/dist/esm/chunk-WBOLHLPX.mjs.map +0 -1
  416. package/dist/esm/chunk-XDGQTMDV.mjs +0 -2
  417. package/dist/esm/chunk-XDGQTMDV.mjs.map +0 -1
  418. package/dist/esm/chunk-YVSU6GOA.mjs +0 -2
  419. package/dist/esm/chunk-YVSU6GOA.mjs.map +0 -1
  420. package/dist/esm/core/account/Account.d.mts +0 -20
  421. package/dist/esm/core/account/Account.mjs +0 -2
  422. package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
  423. package/dist/esm/core/account/Ed25519Account.mjs +0 -2
  424. package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
  425. package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
  426. /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
  427. /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
  428. /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
  429. /package/dist/esm/{chunk-ICXA3DZH.mjs.map → account/KeylessAccount.mjs.map} +0 -0
  430. /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
  431. /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
  432. /package/dist/esm/{chunk-R7G3CLRI.mjs.map → account/index.mjs.map} +0 -0
  433. /package/dist/esm/{chunk-UVSRX4SV.mjs.map → api/keyless.mjs.map} +0 -0
  434. /package/dist/esm/{chunk-2PFN7LYP.mjs.map → chunk-33WBJV5U.mjs.map} +0 -0
  435. /package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-3FVRXELT.mjs.map} +0 -0
  436. /package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-3VGX3TXH.mjs.map} +0 -0
  437. /package/dist/esm/{chunk-PJLCPRYJ.mjs.map → chunk-3YNRBMPS.mjs.map} +0 -0
  438. /package/dist/esm/{chunk-5OM4V4DR.mjs.map → chunk-5QBTBH64.mjs.map} +0 -0
  439. /package/dist/esm/{chunk-A556OVZY.mjs.map → chunk-6CQH7JPF.mjs.map} +0 -0
  440. /package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-6RBUXB5I.mjs.map} +0 -0
  441. /package/dist/esm/{chunk-FXNFWLQC.mjs.map → chunk-7H3HRFVM.mjs.map} +0 -0
  442. /package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-7STYQ5ZE.mjs.map} +0 -0
  443. /package/dist/esm/{chunk-4LMAVPA4.mjs.map → chunk-A7L2Z5DW.mjs.map} +0 -0
  444. /package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-C3L4ETUF.mjs.map} +0 -0
  445. /package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-COW5IGYC.mjs.map} +0 -0
  446. /package/dist/esm/{chunk-RQEWIZ67.mjs.map → chunk-DIBNAYZ2.mjs.map} +0 -0
  447. /package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-EB7AI4B4.mjs.map} +0 -0
  448. /package/dist/esm/{chunk-YKVKSNH4.mjs.map → chunk-GI52SX32.mjs.map} +0 -0
  449. /package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-HGZGTBA4.mjs.map} +0 -0
  450. /package/dist/esm/{chunk-TGXZVNR5.mjs.map → chunk-IEZO4PIG.mjs.map} +0 -0
  451. /package/dist/esm/{chunk-KDCHX7BI.mjs.map → chunk-KFJMLLOA.mjs.map} +0 -0
  452. /package/dist/esm/{chunk-L6PGWGFF.mjs.map → chunk-KOCKKI4F.mjs.map} +0 -0
  453. /package/dist/esm/{chunk-YBEF3UR3.mjs.map → chunk-LV7OW245.mjs.map} +0 -0
  454. /package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-MGOHPDX4.mjs.map} +0 -0
  455. /package/dist/esm/{chunk-BBU2EE6D.mjs.map → chunk-MJGZJL3W.mjs.map} +0 -0
  456. /package/dist/esm/{chunk-UPIN5AIO.mjs.map → chunk-MKUAW7KW.mjs.map} +0 -0
  457. /package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-MWUJCP27.mjs.map} +0 -0
  458. /package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-NC5HHEEM.mjs.map} +0 -0
  459. /package/dist/esm/{chunk-6MG4JAYB.mjs.map → chunk-NPNAKSCR.mjs.map} +0 -0
  460. /package/dist/esm/{chunk-6IGEUEER.mjs.map → chunk-ODTNF2YP.mjs.map} +0 -0
  461. /package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-PFFAQZHT.mjs.map} +0 -0
  462. /package/dist/esm/{chunk-3HV2C4SS.mjs.map → chunk-PTIZKRON.mjs.map} +0 -0
  463. /package/dist/esm/{chunk-GXYS45Y5.mjs.map → chunk-RDNPWCZ4.mjs.map} +0 -0
  464. /package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-STYDBDYL.mjs.map} +0 -0
  465. /package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-T23OVRNF.mjs.map} +0 -0
  466. /package/dist/esm/{chunk-BRQYARQ3.mjs.map → chunk-T7JIGO3O.mjs.map} +0 -0
  467. /package/dist/esm/{chunk-GRT5PHL6.mjs.map → chunk-UKJUHLZW.mjs.map} +0 -0
  468. /package/dist/esm/{chunk-BAV4XY7C.mjs.map → chunk-W637YAND.mjs.map} +0 -0
  469. /package/dist/esm/{chunk-XLPVG4XR.mjs.map → chunk-XHPLLMR5.mjs.map} +0 -0
  470. /package/dist/esm/{chunk-QWRH22H4.mjs.map → chunk-YGB7MEH3.mjs.map} +0 -0
  471. /package/dist/esm/{chunk-EJCKCYYI.mjs.map → chunk-YI7FZPIK.mjs.map} +0 -0
  472. /package/dist/esm/{chunk-OGHE4AQA.mjs.map → chunk-Z2ZR4PTF.mjs.map} +0 -0
  473. /package/dist/esm/{chunk-TC3VVMPY.mjs.map → chunk-ZGTJMNZG.mjs.map} +0 -0
  474. /package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-ZNEBMSNC.mjs.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/poseidon.ts"],"sourcesContent":["/* eslint-disable no-bitwise */\nimport {\n poseidon1,\n poseidon2,\n poseidon3,\n poseidon4,\n poseidon5,\n poseidon6,\n poseidon7,\n poseidon8,\n poseidon9,\n poseidon10,\n poseidon11,\n poseidon12,\n poseidon13,\n poseidon14,\n poseidon15,\n poseidon16,\n} from \"poseidon-lite\";\n\nconst numInputsToPoseidonFunc = [\n poseidon1,\n poseidon2,\n poseidon3,\n poseidon4,\n poseidon5,\n poseidon6,\n poseidon7,\n poseidon8,\n poseidon9,\n poseidon10,\n poseidon11,\n poseidon12,\n poseidon13,\n poseidon14,\n poseidon15,\n poseidon16,\n];\n\nconst BYTES_PACKED_PER_SCALAR = 31;\nconst MAX_NUM_INPUT_SCALARS = 16;\nconst MAX_NUM_INPUT_BYTES = (MAX_NUM_INPUT_SCALARS - 1) * BYTES_PACKED_PER_SCALAR;\n\n// hashes an ASCII string to a field element\nexport function hashASCIIStrToField(str: string, maxSizeBytes: number) {\n const textEncoder = new TextEncoder();\n const strBytes = textEncoder.encode(str);\n return hashBytesWithLen(strBytes, maxSizeBytes);\n}\n\nfunction hashBytesWithLen(bytes: Uint8Array, maxSizeBytes: number) {\n if (bytes.length > maxSizeBytes) {\n throw new Error(`Inputted bytes of length ${bytes} is longer than ${maxSizeBytes}`);\n }\n const packed = padAndPackBytesWithLen(bytes, maxSizeBytes);\n return poseidonHash(packed);\n}\n\nfunction padAndPackBytesNoLen(bytes: Uint8Array, maxSizeBytes: number): bigint[] {\n if (bytes.length > maxSizeBytes) {\n throw new Error(`Input bytes of length ${bytes} is longer than ${maxSizeBytes}`);\n }\n const paddedStrBytes = padUint8ArrayWithZeros(bytes, maxSizeBytes);\n return packBytes(paddedStrBytes);\n}\n\nexport function padAndPackBytesWithLen(bytes: Uint8Array, maxSizeBytes: number): bigint[] {\n if (bytes.length > maxSizeBytes) {\n throw new Error(`Input bytes of length ${bytes} is longer than ${maxSizeBytes}`);\n }\n return padAndPackBytesNoLen(bytes, maxSizeBytes).concat([BigInt(bytes.length)]);\n}\n\nfunction packBytes(bytes: Uint8Array): bigint[] {\n if (bytes.length > MAX_NUM_INPUT_BYTES) {\n throw new Error(`Can't pack more than ${MAX_NUM_INPUT_BYTES}. Was given ${bytes.length} bytes`);\n }\n return chunkUint8Array(bytes, BYTES_PACKED_PER_SCALAR).map((chunk) => bytesToBigIntLE(chunk));\n}\n\nfunction chunkUint8Array(array: Uint8Array, chunkSize: number): Uint8Array[] {\n const result: Uint8Array[] = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.subarray(i, i + chunkSize));\n }\n return result;\n}\n\nexport function bytesToBigIntLE(bytes: Uint8Array): bigint {\n let result = BigInt(0);\n for (let i = bytes.length - 1; i >= 0; i -= 1) {\n result = (result << BigInt(8)) | BigInt(bytes[i]);\n }\n return result;\n}\n\nexport function bigIntToBytesLE(value: bigint, length: number): Uint8Array {\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; i += 1) {\n bytes[i] = Number(value & BigInt(0xff));\n // eslint-disable-next-line no-param-reassign\n value >>= BigInt(8);\n }\n return bytes;\n}\n\n// From chatGPT\nfunction padUint8ArrayWithZeros(inputArray: Uint8Array, paddedSize: number): Uint8Array {\n if (paddedSize < inputArray.length) {\n throw new Error(\"Padded size must be greater than or equal to the input array size.\");\n }\n\n // Create a new Uint8Array with the padded size\n const paddedArray = new Uint8Array(paddedSize);\n\n // Copy the content of the input array to the new array\n paddedArray.set(inputArray);\n\n // Fill the remaining space with zeros\n for (let i = inputArray.length; i < paddedSize; i += 1) {\n paddedArray[i] = 0;\n }\n\n return paddedArray;\n}\n\nexport function poseidonHash(inputs: (number | bigint | string)[]): bigint {\n const poseidonFixedHash = numInputsToPoseidonFunc[inputs.length - 1];\n\n if (poseidonFixedHash) {\n return poseidonFixedHash(inputs);\n }\n throw new Error(`Unable to hash input of length ${inputs.length}`);\n}\n"],"mappings":"AACA,OACE,aAAAA,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,cAAAC,EACA,cAAAC,EACA,cAAAC,EACA,cAAAC,EACA,cAAAC,EACA,cAAAC,EACA,cAAAC,MACK,gBAEP,IAAMC,EAA0B,CAC9BhB,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CACF,EAEME,EAA0B,GAC1BC,EAAwB,GACxBC,GAAuBD,EAAwB,GAAKD,EAGnD,SAASG,EAAoBC,EAAaC,EAAsB,CAErE,IAAMC,EADc,IAAI,YAAY,EACP,OAAOF,CAAG,EACvC,OAAOG,EAAiBD,EAAUD,CAAY,CAChD,CAEA,SAASE,EAAiBC,EAAmBH,EAAsB,CACjE,GAAIG,EAAM,OAASH,EACjB,MAAM,IAAI,MAAM,4BAA4BG,CAAK,mBAAmBH,CAAY,EAAE,EAEpF,IAAMI,EAASC,EAAuBF,EAAOH,CAAY,EACzD,OAAOM,EAAaF,CAAM,CAC5B,CAEA,SAASG,EAAqBJ,EAAmBH,EAAgC,CAC/E,GAAIG,EAAM,OAASH,EACjB,MAAM,IAAI,MAAM,yBAAyBG,CAAK,mBAAmBH,CAAY,EAAE,EAEjF,IAAMQ,EAAiBC,EAAuBN,EAAOH,CAAY,EACjE,OAAOU,EAAUF,CAAc,CACjC,CAEO,SAASH,EAAuBF,EAAmBH,EAAgC,CACxF,GAAIG,EAAM,OAASH,EACjB,MAAM,IAAI,MAAM,yBAAyBG,CAAK,mBAAmBH,CAAY,EAAE,EAEjF,OAAOO,EAAqBJ,EAAOH,CAAY,EAAE,OAAO,CAAC,OAAOG,EAAM,MAAM,CAAC,CAAC,CAChF,CAEA,SAASO,EAAUP,EAA6B,CAC9C,GAAIA,EAAM,OAASN,EACjB,MAAM,IAAI,MAAM,wBAAwBA,CAAmB,gBAAgBM,EAAM,MAAM,QAAQ,EAEjG,OAAOQ,EAAgBR,EAAOR,CAAuB,EAAE,IAAKiB,GAAUC,EAAgBD,CAAK,CAAC,CAC9F,CAEA,SAASD,EAAgBG,EAAmBC,EAAiC,CAC3E,IAAMC,EAAuB,CAAC,EAC9B,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO,KAAKF,EAAM,SAASG,EAAGA,EAAIF,CAAS,CAAC,EAE9C,OAAOC,CACT,CAEO,SAASH,EAAgBV,EAA2B,CACzD,IAAIa,EAAS,OAAO,CAAC,EACrB,QAASC,EAAId,EAAM,OAAS,EAAGc,GAAK,EAAGA,GAAK,EAC1CD,EAAUA,GAAU,OAAO,CAAC,EAAK,OAAOb,EAAMc,CAAC,CAAC,EAElD,OAAOD,CACT,CAEO,SAASE,EAAgBC,EAAeC,EAA4B,CACzE,IAAMjB,EAAQ,IAAI,WAAWiB,CAAM,EACnC,QAASH,EAAI,EAAGA,EAAIG,EAAQH,GAAK,EAC/Bd,EAAMc,CAAC,EAAI,OAAOE,EAAQ,OAAO,GAAI,CAAC,EAEtCA,IAAU,OAAO,CAAC,EAEpB,OAAOhB,CACT,CAGA,SAASM,EAAuBY,EAAwBC,EAAgC,CACtF,GAAIA,EAAaD,EAAW,OAC1B,MAAM,IAAI,MAAM,oEAAoE,EAItF,IAAME,EAAc,IAAI,WAAWD,CAAU,EAG7CC,EAAY,IAAIF,CAAU,EAG1B,QAASJ,EAAII,EAAW,OAAQJ,EAAIK,EAAYL,GAAK,EACnDM,EAAYN,CAAC,EAAI,EAGnB,OAAOM,CACT,CAEO,SAASjB,EAAakB,EAA8C,CACzE,IAAMC,EAAoB/B,EAAwB8B,EAAO,OAAS,CAAC,EAEnE,GAAIC,EACF,OAAOA,EAAkBD,CAAM,EAEjC,MAAM,IAAI,MAAM,kCAAkCA,EAAO,MAAM,EAAE,CACnE","names":["poseidon1","poseidon2","poseidon3","poseidon4","poseidon5","poseidon6","poseidon7","poseidon8","poseidon9","poseidon10","poseidon11","poseidon12","poseidon13","poseidon14","poseidon15","poseidon16","numInputsToPoseidonFunc","BYTES_PACKED_PER_SCALAR","MAX_NUM_INPUT_SCALARS","MAX_NUM_INPUT_BYTES","hashASCIIStrToField","str","maxSizeBytes","strBytes","hashBytesWithLen","bytes","packed","padAndPackBytesWithLen","poseidonHash","padAndPackBytesNoLen","paddedStrBytes","padUint8ArrayWithZeros","packBytes","chunkUint8Array","chunk","bytesToBigIntLE","array","chunkSize","result","i","bigIntToBytesLE","value","length","inputArray","paddedSize","paddedArray","inputs","poseidonFixedHash"]}
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-QWRH22H4.mjs";import{b as c,c as A}from"./chunk-KHOHRD2B.mjs";import{a as w}from"./chunk-6FBKUTGF.mjs";import{d as C}from"./chunk-CYNQRMO5.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof w)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
- //# sourceMappingURL=chunk-YKVKSNH4.mjs.map
1
+ import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-YGB7MEH3.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";import{b as c,d as A}from"./chunk-SA7MZPM3.mjs";import{a as C}from"./chunk-6FBKUTGF.mjs";import{d as w}from"./chunk-YE5B2S5L.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
+ //# sourceMappingURL=chunk-GI52SX32.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n,b as s,c as r,d as i,e as o,f as a,g as c,h as p,i as d,j as g,k as u,l as A,m as y,n as l,o as m,p as T,q as f,r as I,s as C,t as O,u as P,v as D}from"./chunk-3OCTOB2E.mjs";import{a as e}from"./chunk-2PFN7LYP.mjs";var V=class{constructor(t){this.config=t}async getCollectionData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),p({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),n({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),s({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),r({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return o({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return d({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return g({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return u({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return A({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return y({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return l({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return m({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return T({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return f({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return I({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return C({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return O({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return P({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return D({aptosConfig:this.config,...t})}};export{V as a};
2
- //# sourceMappingURL=chunk-3RUY5FQK.mjs.map
1
+ import{a as n,b as s,c as r,d as i,e as o,f as a,g as c,h as p,i as d,j as g,k as u,l as A,m as y,n as l,o as m,p as T,q as f,r as I,s as C,t as O,u as P,v as D}from"./chunk-OYTLWUQT.mjs";import{a as e}from"./chunk-33WBJV5U.mjs";var V=class{constructor(t){this.config=t}async getCollectionData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),p({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),n({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),s({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),r({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return o({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return d({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return g({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return u({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return A({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return y({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return l({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return m({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return T({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return f({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return I({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return C({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return O({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return P({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return D({aptosConfig:this.config,...t})}};export{V as a};
2
+ //# sourceMappingURL=chunk-GKCO5PQJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/digitalAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n AnyNumber,\n GetCollectionDataResponse,\n GetCurrentTokenOwnershipResponse,\n GetOwnedTokensResponse,\n GetTokenActivityResponse,\n GetTokenDataResponse,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n} from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { Account } from \"../account\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport {\n addDigitalAssetPropertyTransaction,\n addDigitalAssetTypedPropertyTransaction,\n burnDigitalAssetTransaction,\n CreateCollectionOptions,\n createCollectionTransaction,\n freezeDigitalAssetTransferTransaction,\n getCollectionData,\n getCollectionDataByCollectionId,\n getCollectionId,\n getCurrentDigitalAssetOwnership,\n getDigitalAssetActivity,\n getDigitalAssetData,\n getOwnedDigitalAssets,\n mintDigitalAssetTransaction,\n mintSoulBoundTransaction,\n PropertyType,\n PropertyValue,\n removeDigitalAssetPropertyTransaction,\n setDigitalAssetDescriptionTransaction,\n setDigitalAssetNameTransaction,\n setDigitalAssetURITransaction,\n transferDigitalAssetTransaction,\n unfreezeDigitalAssetTransferTransaction,\n updateDigitalAssetPropertyTransaction,\n updateDigitalAssetTypedPropertyTransaction,\n} from \"../internal/digitalAsset\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to query all `DigitalAsset` related queries on Aptos.\n */\nexport class DigitalAsset {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries data of a specific collection by the collection creator address and the collection name.\n *\n * If, for some reason, a creator account has 2 collections with the same name in v1 and v2,\n * can pass an optional `tokenStandard` parameter to query a specific standard\n *\n * @example\n * const collection = await aptos.getCollectionData({creatorAddress:\"0x123\",collectionName:\"myCollection\"})\n *\n * @param args.creatorAddress the address of the collection's creator\n * @param args.collectionName the name of the collection\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard the token standard to query\n * @returns GetCollectionDataResponse response type\n */\n async getCollectionData(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries data of a specific collection by the collection ID.\n *\n * @example\n * const collection = await aptos.getCollectionDataByCollectionId({collectionId:\"0x123\"})\n *\n * @param args.collectionId the ID of the collection, it's the same thing as the address of the collection object\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns GetCollectionDataResponse response type\n */\n async getCollectionDataByCollectionId(args: {\n collectionId: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionDataByCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a collection's ID.\n *\n * This is the same as the collection's object address in V2, but V1 does\n * not use objects, and does not have an address\n *\n * @example\n * const collection = await aptos.getCollectionId({creatorAddress:\"0x123\",collectionName:\"myCollection\"})\n *\n * @param args.creatorAddress the address of the collection's creator\n * @param args.collectionName the name of the collection\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard the token standard to query\n * @returns the collection id\n */\n async getCollectionId(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<string> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets digital asset data given the address of a digital asset.\n *\n * @example\n * const digitalAsset = await aptos.getDigitalAssetData({digitalAssetAddress:\"0x123\"})\n *\n * @param args.tokenAddress The address of the digital asset\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns GetTokenDataResponse containing relevant data to the digital asset.\n */\n async getDigitalAssetData(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetTokenDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets digital asset ownership data given the address of a digital asset.\n *\n * @example\n * const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({digitalAssetAddress:\"0x123\"})\n *\n * @param args.tokenAddress The address of the digital asset\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.\n */\n async getCurrentDigitalAssetOwnership(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetCurrentTokenOwnershipResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCurrentDigitalAssetOwnership({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets the digital assets that the given address owns.\n *\n * @example\n * const digitalAssets = await aptos.getOwnedDigitalAssets({ownerAddress:\"0x123\"})\n *\n * @param args.ownerAddress The address of the owner\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddresss.\n */\n async getOwnedDigitalAssets(args: {\n ownerAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetOwnedTokensResponse[0]>;\n }): Promise<GetOwnedTokensResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getOwnedDigitalAssets({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets the activity data given the address of a digital asset.\n *\n * @example\n * const digitalAssetActivity = await aptos.getDigitalAssetActivity({digitalAssetAddress:\"0x123\"})\n *\n * @param args.tokenAddress The address of the digital asset\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns GetTokenActivityResponse containing relevant activity data to the digital asset.\n */\n async getDigitalAssetActivity(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;\n }): Promise<GetTokenActivityResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetActivity({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Creates a new collection within the specified account\n *\n * @example\n * const transaction = await aptos.createCollectionTransaction({\n * creator: alice,\n * description: \"collectionDescription\",\n * name: \"collectionName\",\n * uri: \"collection-uri.com\",\n * });\n *\n * @param args.creator the account of the collection's creator\n * @param args.description the description of the collection\n * @param args.name the name of the collection\n * @param args.uri the URI to additional info about the collection\n *\n * The parameters below are optional.\n * @param args.maxSupply controls the max supply of the digital assets - defaults MAX_U64_BIG_INT\n * @param args.mutableDescription controls mutability of the collection's description - defaults true\n * @param args.mutableRoyalty controls mutability of the collection's description - defaults true\n * @param args.mutableUri controls mutability of the collection's URI - defaults true\n * @param args.mutableTokenDescription controls mutability of the digital asset's description - defaults true\n * @param args.mutableTokenName controls mutability of the digital asset's name - defaults true\n * @param args.mutableTokenProperties controls mutability of digital asset's properties - defaults true\n * @param args.mutableTokenUri controls mutability of the digital asset's URI - defaults true\n * @param args.tokensBurnableByCreator controls whether digital assets can be burnable by the creator - defaults true\n * @param args.tokensFreezableByCreator controls whether digital assets can be frozen by the creator - defaults true\n * @param args.royaltyNumerator the numerator of the royalty to be paid to the creator when\n * a digital asset is transferred - defaults 0\n * @param args.royaltyDenominator the denominator of the royalty to be paid to the creator\n * when a digital asset is transferred - defaults 1\n *\n * @returns A SimpleTransaction that when submitted will create the collection.\n */\n async createCollectionTransaction(\n args: {\n creator: Account;\n description: string;\n name: string;\n uri: string;\n options?: InputGenerateTransactionOptions;\n } & CreateCollectionOptions,\n ): Promise<SimpleTransaction> {\n return createCollectionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Create a transaction to mint a digital asset into the creators account within an existing collection.\n *\n * @example\n * const transaction = await aptos.mintDigitalAssetTransaction({\n * creator: alice,\n * description: \"collectionDescription\",\n * collection: \"collectionName\",\n * name: \"digitalAssetName\",\n * uri: \"digital-asset-uri.com\",\n * });\n *\n * @param args.creator the creator of the collection\n * @param args.collection the name of the collection the digital asset belongs to\n * @param args.description the description of the digital asset\n * @param args.name the name of the digital asset\n * @param args.uri the URI to additional info about the digital asset\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async mintDigitalAssetTransaction(args: {\n creator: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Transfer a digital asset (non fungible digital asset) ownership.\n *\n * We can transfer a digital asset only when the digital asset is not frozen\n * (i.e. owner transfer is not disabled such as for soul bound digital assets)\n *\n * @example\n * const transaction = await aptos.transferDigitalAssetTransaction({\n * sender: alice,\n * digitalAssetAddress: \"0x123\",\n * recipient: \"0x456\",\n * });\n *\n * @param args.sender The sender account of the current digital asset owner\n * @param args.digitalAssetAddress The digital asset address\n * @param args.recipient The recipient account address\n * @param args.digitalAssetType optional. The digital asset type, default to \"0x4::token::Token\"\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async transferDigitalAssetTransaction(args: {\n sender: Account;\n digitalAssetAddress: AccountAddressInput;\n recipient: AccountAddress;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Mint a soul bound digital asset into a recipient's account\n *\n * @example\n * const transaction = await aptos.mintSoulBoundTransaction({\n * account: alice,\n * collection: \"collectionName\",\n * description: \"collectionDescription\",\n * name: \"digitalAssetName\",\n * uri: \"digital-asset-uri.com\",\n * recipient: \"0x123\"\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.collection The collection name that the digital asset belongs to\n * @param args.description The digital asset description\n * @param args.name The digital asset name\n * @param args.uri The digital asset URL\n * @param args.recipient The account address where the digital asset will be created\n * @param args.propertyKeys The property keys for storing on-chain properties\n * @param args.propertyTypes The type of property values\n * @param args.propertyValues The property values to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async mintSoulBoundTransaction(args: {\n account: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n recipient: AccountAddressInput;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintSoulBoundTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Burn a digital asset by its creator\n *\n * @example\n * const transaction = await aptos.burnDigitalAssetTransaction({\n * creator: alice,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async burnDigitalAssetTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return burnDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Freeze digital asset transfer ability\n *\n * @example\n * const transaction = await aptos.freezeDigitalAssetTransaferTransaction({\n * creator: alice,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async freezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return freezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Unfreeze digital asset transfer ability\n *\n * @example\n * const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({\n * creator: alice,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async unfreezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return unfreezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset description\n *\n * @example\n * const transaction = await aptos.setDigitalAssetDescriptionTransaction({\n * creator: alice,\n * description: \"digitalAssetDescription\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.description The digital asset description\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async setDigitalAssetDescriptionTransaction(args: {\n creator: Account;\n description: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetDescriptionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset name\n *\n * @example\n * const transaction = await aptos.setDigitalAssetNameTransaction({\n * creator: alice,\n * name: \"digitalAssetName\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.name The digital asset name\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async setDigitalAssetNameTransaction(args: {\n creator: Account;\n name: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetNameTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset name\n *\n * @example\n * const transaction = await aptos.setDigitalAssetURITransaction({\n * creator: alice,\n * uri: \"digital-asset-uri.com\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.uri The digital asset uri\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async setDigitalAssetURITransaction(args: {\n creator: Account;\n uri: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetURITransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a digital asset property\n *\n * @example\n * const transaction = await aptos.addDigitalAssetPropertyTransaction({\n * creator: alice,\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async addDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Remove a digital asset property\n *\n * @example\n * const transaction = await aptos.removeDigitalAssetPropertyTransaction({\n * creator: alice,\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async removeDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return removeDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a digital asset property\n *\n * @example\n * const transaction = await aptos.updateDigitalAssetPropertyTransaction({\n * creator: alice,\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: false,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async updateDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a typed digital asset property\n *\n * @example\n * const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({\n * creator: alice,\n * propertyKey: \"typedKey\",\n * propertyType: \"STRING\",\n * propertyValue: \"hello\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async addDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a typed digital asset property\n *\n * @example\n * const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({\n * creator: alice,\n * propertyKey: \"typedKey\",\n * propertyType: \"U8\",\n * propertyValue: 2,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async updateDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"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","names":["DigitalAsset","config","args","waitForIndexerOnVersion","getCollectionData","getCollectionDataByCollectionId","getCollectionId","getDigitalAssetData","getCurrentDigitalAssetOwnership","getOwnedDigitalAssets","getDigitalAssetActivity","createCollectionTransaction","mintDigitalAssetTransaction","transferDigitalAssetTransaction","mintSoulBoundTransaction","burnDigitalAssetTransaction","freezeDigitalAssetTransferTransaction","unfreezeDigitalAssetTransferTransaction","setDigitalAssetDescriptionTransaction","setDigitalAssetNameTransaction","setDigitalAssetURITransaction","addDigitalAssetPropertyTransaction","removeDigitalAssetPropertyTransaction","updateDigitalAssetPropertyTransaction","addDigitalAssetTypedPropertyTransaction","updateDigitalAssetTypedPropertyTransaction"]}
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-IOSQVDZI.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
2
- //# sourceMappingURL=chunk-UML2VQZT.mjs.map
1
+ import{b as c}from"./chunk-T23OVRNF.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
2
+ //# sourceMappingURL=chunk-HGZGTBA4.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as c}from"./chunk-VTX77UM3.mjs";import{c as p}from"./chunk-PFFAQZHT.mjs";import{f as o}from"./chunk-YGB7MEH3.mjs";import{o as u,r as g,s as A}from"./chunk-S4SEFF4K.mjs";import{f as a,i as r}from"./chunk-3VGX3TXH.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
2
+ //# sourceMappingURL=chunk-HJULFJXF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/fungibleAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/fungible_asset}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * fungible_asset namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport {\n AnyNumber,\n GetCurrentFungibleAssetBalancesResponse,\n GetFungibleAssetActivitiesResponse,\n GetFungibleAssetMetadataResponse,\n PaginationArgs,\n WhereArg,\n} from \"../types\";\nimport { queryIndexer } from \"./general\";\nimport {\n GetCurrentFungibleAssetBalances,\n GetFungibleAssetActivities,\n GetFungibleAssetMetadata,\n} from \"../types/generated/queries\";\nimport {\n GetCurrentFungibleAssetBalancesQuery,\n GetFungibleAssetActivitiesQuery,\n GetFungibleAssetMetadataQuery,\n} from \"../types/generated/operations\";\nimport {\n CurrentFungibleAssetBalancesBoolExp,\n FungibleAssetActivitiesBoolExp,\n FungibleAssetMetadataBoolExp,\n} from \"../types/generated/types\";\nimport { AccountAddressInput } from \"../core\";\nimport { Account } from \"../account\";\nimport {\n EntryFunctionABI,\n InputGenerateTransactionOptions,\n parseTypeTag,\n TypeTagAddress,\n TypeTagU64,\n} from \"../transactions\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\nexport async function getFungibleAssetMetadata(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>;\n}): Promise<GetFungibleAssetMetadataResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetFungibleAssetMetadata,\n variables: {\n where_condition: options?.where,\n limit: options?.limit,\n offset: options?.offset,\n },\n };\n\n const data = await queryIndexer<GetFungibleAssetMetadataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getFungibleAssetMetadata\",\n });\n\n return data.fungible_asset_metadata;\n}\n\nexport async function getFungibleAssetActivities(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>;\n}): Promise<GetFungibleAssetActivitiesResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetFungibleAssetActivities,\n variables: {\n where_condition: options?.where,\n limit: options?.limit,\n offset: options?.offset,\n },\n };\n\n const data = await queryIndexer<GetFungibleAssetActivitiesQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getFungibleAssetActivities\",\n });\n\n return data.fungible_asset_activities;\n}\n\nexport async function getCurrentFungibleAssetBalances(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n}): Promise<GetCurrentFungibleAssetBalancesResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetCurrentFungibleAssetBalances,\n variables: {\n where_condition: options?.where,\n limit: options?.limit,\n offset: options?.offset,\n },\n };\n\n const data = await queryIndexer<GetCurrentFungibleAssetBalancesQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getCurrentFungibleAssetBalances\",\n });\n\n return data.current_fungible_asset_balances;\n}\n\nconst faTransferAbi: EntryFunctionABI = {\n typeParameters: [],\n parameters: [parseTypeTag(\"0x1::object::Object\"), new TypeTagAddress(), new TypeTagU64()],\n};\n\nexport async function transferFungibleAsset(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n fungibleAssetMetadataAddress: AccountAddressInput;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, fungibleAssetMetadataAddress, recipient, amount, options } = args;\n return generateTransaction({\n aptosConfig,\n sender: sender.accountAddress,\n data: {\n function: \"0x1::primary_fungible_store::transfer\",\n typeArguments: [\"0x1::fungible_asset::Metadata\"],\n functionArguments: [fungibleAssetMetadataAddress, recipient, amount],\n abi: faTransferAbi,\n },\n options,\n });\n}\n"],"mappings":"kOA+CA,eAAsBA,EAAyBC,EAGD,CAC5C,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOC,EACP,UAAW,CACT,gBAAiBF,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAA4C,CAC7D,YAAAJ,EACA,MAAOE,EACP,aAAc,0BAChB,CAAC,GAEW,uBACd,CAEA,eAAsBG,EAA2BN,EAGD,CAC9C,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOI,EACP,UAAW,CACT,gBAAiBL,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAA8C,CAC/D,YAAAJ,EACA,MAAOE,EACP,aAAc,4BAChB,CAAC,GAEW,yBACd,CAEA,eAAsBK,EAAgCR,EAGD,CACnD,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOM,EACP,UAAW,CACT,gBAAiBP,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAAmD,CACpE,YAAAJ,EACA,MAAOE,EACP,aAAc,iCAChB,CAAC,GAEW,+BACd,CAEA,IAAMO,EAAkC,CACtC,eAAgB,CAAC,EACjB,WAAY,CAACC,EAAa,qBAAqB,EAAG,IAAIC,EAAkB,IAAIC,CAAY,CAC1F,EAEA,eAAsBC,EAAsBd,EAOb,CAC7B,GAAM,CAAE,YAAAC,EAAa,OAAAc,EAAQ,6BAAAC,EAA8B,UAAAC,EAAW,OAAAC,EAAQ,QAAAhB,CAAQ,EAAIF,EAC1F,OAAOmB,EAAoB,CACzB,YAAAlB,EACA,OAAQc,EAAO,eACf,KAAM,CACJ,SAAU,wCACV,cAAe,CAAC,+BAA+B,EAC/C,kBAAmB,CAACC,EAA8BC,EAAWC,CAAM,EACnE,IAAKR,CACP,EACA,QAAAR,CACF,CAAC,CACH","names":["getFungibleAssetMetadata","args","aptosConfig","options","graphqlQuery","GetFungibleAssetMetadata","queryIndexer","getFungibleAssetActivities","GetFungibleAssetActivities","getCurrentFungibleAssetBalances","GetCurrentFungibleAssetBalances","faTransferAbi","parseTypeTag","TypeTagAddress","TypeTagU64","transferFungibleAsset","sender","fungibleAssetMetadataAddress","recipient","amount","generateTransaction"]}
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-DMKUAQB7.mjs";import{a as g}from"./chunk-RHBCVCOS.mjs";import{a as p}from"./chunk-DSTKXJMA.mjs";import{b as y}from"./chunk-IOSQVDZI.mjs";import{a as v}from"./chunk-FS3NSGBF.mjs";import{a as F,b as d,c as T,d as x,e as E,f as _,g as w}from"./chunk-QIAHBEEW.mjs";import{a as S}from"./chunk-ZYYK3UXP.mjs";import{a as u}from"./chunk-52C73T26.mjs";function D(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return d.deserialize(r);case 1:return E.deserialize(r);case 2:return _.deserialize(r);case 3:return y.deserialize(r);case 4:return v.deserialize(r,d);case 5:return F.deserialize(r);case 6:return T.deserialize(r);case 7:return x.deserialize(r);case 8:return w.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends u{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return A.load(e);case 2:return z.load(e);case 3:return h.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},A=class r extends a{constructor(t){super();this.script=t}serialize(t){t.serializeU32AsUleb128(0),this.script.serialize(t)}static load(t){let i=U.deserialize(t);return new r(i)}},z=class r extends a{constructor(t){super();this.entryFunction=t}serialize(t){t.serializeU32AsUleb128(2),this.entryFunction.serialize(t)}static load(t){let i=l.deserialize(t);return new r(i)}},h=class r extends a{constructor(t){super();this.multiSig=t}serialize(t){t.serializeU32AsUleb128(3),this.multiSig.serialize(t)}static load(t){let i=f.deserialize(t);return new r(i)}},l=class r{constructor(e,t,i,n){this.module_name=e,this.function_name=t,this.type_args=i,this.args=n}static build(e,t,i,n){return new r(g.fromStr(e),new p(t),i,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForEntryFunction(e)})}static deserialize(e){let t=g.deserialize(e),i=p.deserialize(e),n=e.deserializeVector(m),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let M=e.deserializeUleb128AsU32(),B=S.deserialize(e,M);s.push(B)}return new r(t,i,n,s)}},U=class r{constructor(e,t,i){this.bytecode=e,this.type_args=t,this.args=i}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForScriptFunction(e)})}static deserialize(e){let t=e.deserializeBytes(),i=e.deserializeVector(m),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=D(e);o.push(c)}return new r(t,i,o)}},f=class r{constructor(e,t){this.multisig_address=e,this.transaction_payload=t}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let t=y.deserialize(e),i=e.deserializeBool(),n;return i&&(n=b.deserialize(e)),new r(t,n)}},b=class r extends u{constructor(t){super();this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new r(l.deserialize(t))}};export{D as a,a as b,A as c,z as d,h as e,l as f,U as g,f as h,b as i};
2
- //# sourceMappingURL=chunk-TGXZVNR5.mjs.map
1
+ import{a as m}from"./chunk-3VGX3TXH.mjs";import{a as g}from"./chunk-ZNEBMSNC.mjs";import{a as p}from"./chunk-MGOHPDX4.mjs";import{b as y}from"./chunk-T23OVRNF.mjs";import{a as S}from"./chunk-C3L4ETUF.mjs";import{a as v}from"./chunk-EB7AI4B4.mjs";import{a as F,b as d,c as T,d as x,e as E,f as _,g as w}from"./chunk-6RBUXB5I.mjs";import{a as u}from"./chunk-TVRJ3M7B.mjs";function D(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return d.deserialize(r);case 1:return E.deserialize(r);case 2:return _.deserialize(r);case 3:return y.deserialize(r);case 4:return v.deserialize(r,d);case 5:return F.deserialize(r);case 6:return T.deserialize(r);case 7:return x.deserialize(r);case 8:return w.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends u{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return A.load(e);case 2:return z.load(e);case 3:return h.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},A=class r extends a{constructor(t){super();this.script=t}serialize(t){t.serializeU32AsUleb128(0),this.script.serialize(t)}static load(t){let i=U.deserialize(t);return new r(i)}},z=class r extends a{constructor(t){super();this.entryFunction=t}serialize(t){t.serializeU32AsUleb128(2),this.entryFunction.serialize(t)}static load(t){let i=l.deserialize(t);return new r(i)}},h=class r extends a{constructor(t){super();this.multiSig=t}serialize(t){t.serializeU32AsUleb128(3),this.multiSig.serialize(t)}static load(t){let i=f.deserialize(t);return new r(i)}},l=class r{constructor(e,t,i,n){this.module_name=e,this.function_name=t,this.type_args=i,this.args=n}static build(e,t,i,n){return new r(g.fromStr(e),new p(t),i,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForEntryFunction(e)})}static deserialize(e){let t=g.deserialize(e),i=p.deserialize(e),n=e.deserializeVector(m),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let M=e.deserializeUleb128AsU32(),B=S.deserialize(e,M);s.push(B)}return new r(t,i,n,s)}},U=class r{constructor(e,t,i){this.bytecode=e,this.type_args=t,this.args=i}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForScriptFunction(e)})}static deserialize(e){let t=e.deserializeBytes(),i=e.deserializeVector(m),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=D(e);o.push(c)}return new r(t,i,o)}},f=class r{constructor(e,t){this.multisig_address=e,this.transaction_payload=t}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let t=y.deserialize(e),i=e.deserializeBool(),n;return i&&(n=b.deserialize(e)),new r(t,n)}},b=class r extends u{constructor(t){super();this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new r(l.deserialize(t))}};export{D as a,a as b,A as c,z as d,h as e,l as f,U as g,f as h,b as i};
2
+ //# sourceMappingURL=chunk-IEZO4PIG.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-LV2V23Z6.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super();this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
- //# sourceMappingURL=chunk-UMFJDDYI.mjs.map
1
+ import{c as a}from"./chunk-OKG6X5TX.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super();this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
+ //# sourceMappingURL=chunk-IM32PZOD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/transactionSubmission/management.ts"],"sourcesContent":["import EventEmitter from \"eventemitter3\";\nimport { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from \"../../transactions/management\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { Account } from \"../../account\";\n\nexport class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {\n account!: Account;\n\n transactionWorker!: TransactionWorker;\n\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n super();\n this.config = config;\n }\n\n /**\n * Internal function to start the transaction worker and\n * listen to worker events\n *\n * @param args.sender The sender account to sign and submit the transaction\n */\n private start(args: { sender: Account }): void {\n const { sender } = args;\n this.account = sender;\n this.transactionWorker = new TransactionWorker(this.config, sender);\n\n this.transactionWorker.start();\n this.registerToEvents();\n }\n\n /**\n * Internal function to push transaction data to the transaction worker.\n *\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * TODO - make this public once worker supports adding transactions to existing queue\n */\n private push(args: {\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n const { data, options } = args;\n\n for (const d of data) {\n this.transactionWorker.push(d, options);\n }\n }\n\n /**\n * Internal function to start listening to transaction worker events\n *\n * TODO - should we ask events to listen to as an input?\n */\n private registerToEvents() {\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSent, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSent, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSendFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecuted, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecutionFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.ExecutionFinish, async (data) => {\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, data);\n });\n }\n\n /**\n * Send batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * dont rely on each other, i.e batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n */\n forSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n try {\n const { sender, data, options } = args;\n this.start({ sender });\n\n this.push({ data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n}\n"],"mappings":"yCAAA,OAAOA,MAAkB,gBAMlB,IAAMC,EAAN,cAAoCC,CAAsC,CAO/E,YAAYC,EAAqB,CAC/B,MAAM,EACN,KAAK,OAASA,CAChB,CAQQ,MAAMC,EAAiC,CAC7C,GAAM,CAAE,OAAAC,CAAO,EAAID,EACnB,KAAK,QAAUC,EACf,KAAK,kBAAoB,IAAIC,EAAkB,KAAK,OAAQD,CAAM,EAElE,KAAK,kBAAkB,MAAM,EAC7B,KAAK,iBAAiB,CACxB,CAUQ,KAAKD,EAGJ,CACP,GAAM,CAAE,KAAAG,EAAM,QAAAC,CAAQ,EAAIJ,EAE1B,QAAWK,KAAKF,EACd,KAAK,kBAAkB,KAAKE,EAAGD,CAAO,CAE1C,CAOQ,kBAAmB,CACzB,KAAK,kBAAkB,qBAAgD,MAAOD,GAAS,CACrF,KAAK,uBAAkDA,CAAI,CAC7D,CAAC,EACD,KAAK,kBAAkB,2BAAsD,MAAOA,GAAS,CAC3F,KAAK,6BAAwDA,CAAI,CACnE,CAAC,EACD,KAAK,kBAAkB,yBAAoD,MAAOA,GAAS,CACzF,KAAK,2BAAsDA,CAAI,CACjE,CAAC,EACD,KAAK,kBAAkB,gCAA2D,MAAOA,GAAS,CAChG,KAAK,kCAA6DA,CAAI,CACxE,CAAC,EACD,KAAK,kBAAkB,qBAAgD,MAAOA,GAAS,CACrF,KAAK,uBAAkDA,CAAI,CAC7D,CAAC,CACH,CAkBA,iBAAiBH,EAIR,CACP,GAAI,CACF,GAAM,CAAE,OAAAC,EAAQ,KAAAE,EAAM,QAAAC,CAAQ,EAAIJ,EAClC,KAAK,MAAM,CAAE,OAAAC,CAAO,CAAC,EAErB,KAAK,KAAK,CAAE,KAAAE,EAAM,QAAAC,CAAQ,CAAC,CAC7B,OAASE,EAAY,CACnB,MAAM,IAAI,MAAM,6CAA6CA,CAAK,EAAE,CACtE,CACF,CACF","names":["EventEmitter","TransactionManagement","EventEmitter","config","args","sender","TransactionWorker","data","options","d","error"]}
@@ -0,0 +1,2 @@
1
+ import{c as E}from"./chunk-SA7MZPM3.mjs";import{e as b,f as x}from"./chunk-CHQ6IKE3.mjs";import{a as l}from"./chunk-P5VCS2F5.mjs";import{a as m,l as h,m as A}from"./chunk-WTVN3XGK.mjs";import{b as S}from"./chunk-R7BAM2G6.mjs";import{c as d}from"./chunk-S5HG2QUD.mjs";import{b as _}from"./chunk-TVRJ3M7B.mjs";import{b as a}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as K}from"jwt-decode";import{bls12_381 as p}from"@noble/curves/bls12-381";var v="APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST";function w(e){return new TextEncoder().encode(e)}var I=p.G2.hashToCurve(w("APTOS_KEYLESS_PEPPER_PINKAS_VUF_SECRET_KEY_BASE"),{DST:v}).toAffine();function C(e){let{jwt:i,uidKey:t}=e,r=K(i),o=new _;o.serializeStr(r.iss),o.serializeStr(r.aud),o.serializeStr(r[t||"sub"]),o.serializeStr(t||"sub");let s=o.toUint8Array(),n=p.G1.hashToCurve(s,{DST:"APTOS_PEPPER_SERVICE_BLS12381_VUF_DST"}).toAffine();return p.G1.ProjectivePoint.fromAffine(n)}async function F(e){let{aptosConfig:i,pepperInput:t,pepperBase:r}=e,{data:o}=await E({aptosConfig:i,path:"vrf-pub-key",originMethod:"getPepper"}),s=p.G2.ProjectivePoint.fromHex(o.vrf_public_key_hex_string);return p.verifyShortSignature(r,t,s)}async function j(e){let{aptosConfig:i,jwt:t,ephemeralKeyPair:r,uidKey:o,verify:s}=e,{derivationPath:n}=e,c={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:Number(r.expiryDateSecs),epk_blinder:a.fromHexInput(r.blinder).toStringWithoutPrefix(),uid_key:o},{data:f}=await b({aptosConfig:i,path:"fetch",body:c,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}}),P=a.fromHexInput(f.signature).toUint8Array();if(s&&!F({aptosConfig:i,pepperBase:P,pepperInput:C(e)}))throw new Error("Unable to verify");let u=p.pairing(p.G1.ProjectivePoint.fromHex(P),p.G2.ProjectivePoint.fromAffine(I));return n===void 0&&(n=d),l.fromDerivationPath(n,p.fields.Fp12.toBytes(u)).slice(0,31)}async function k(e){let{aptosConfig:i,jwt:t,ephemeralKeyPair:r,pepper:o,uidKey:s,extraFieldKey:n}=e,c=K(t),f;if(n){let T=c[n];f=`"${n}":"${T}",`}let P={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:a.fromHexInput(r.blinder).toStringWithoutPrefix(),exp_date_secs:Number(r.expiryDateSecs),exp_horizon_secs:m,pepper:a.fromHexInput(o).toStringWithoutPrefix(),extra_field:n,uid_key:s||"sub"},{data:u}=await x({aptosConfig:i,path:"prove",body:P,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),y=u.proof,g=new h({a:y.a,b:y.b,c:y.c});return new A({proof:g,extraField:f,trainingWheelsSignature:S.fromHex(u.training_wheels_signature)})}async function O(e){let{proofFetchCallback:i}=e,{pepper:t}=e;if(t===void 0)t=await j(e);else if(a.fromHexInput(t).toUint8Array().length!==31)throw new Error("Pepper needs to be 31 bytes");let r=k({...e,pepper:t}),o=i?r:await r;return l.fromJWTAndProof({...e,proof:o,pepper:t,proofFetchCallback:i})}export{j as a,k as b,O as c};
2
+ //# sourceMappingURL=chunk-IOVRZ2CA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/keyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/oidb}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * faucet namespace and without having a dependency cycle error.\n */\nimport { jwtDecode } from \"jwt-decode\";\nimport { bls12_381 as bls } from \"@noble/curves/bls12-381\";\nimport { ProjPointType } from \"@noble/curves/abstract/weierstrass\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { getAptosPepperService, postAptosPepperService, postAptosProvingService } from \"../client\";\nimport {\n APTOS_BIP44_DEFAULT_DERIVATION_PATH,\n EPK_HORIZON_SECS,\n EphemeralSignature,\n Groth16Zkp,\n Hex,\n SignedGroth16Signature,\n} from \"../core\";\nimport { HexInput } from \"../types\";\nimport { Serializer } from \"../bcs\";\nimport { EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from \"../account\";\nimport { PepperFetchResponse, ProverResponse } from \"../types/keyless\";\n\nconst APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST = \"APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST\";\n\nfunction stringToUint8Array(str: string): Uint8Array {\n const encoder = new TextEncoder();\n return encoder.encode(str);\n}\n\nconst PINKAS_VUF_SECRET_KEY_BASE_AFFINE = bls.G2.hashToCurve(\n stringToUint8Array(\"APTOS_KEYLESS_PEPPER_PINKAS_VUF_SECRET_KEY_BASE\"),\n { DST: APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST },\n).toAffine();\n\nfunction getPepperInput(args: { jwt: string; uidKey?: string }): ProjPointType<bigint> {\n const { jwt, uidKey } = args;\n const jwtPayload = jwtDecode<{ [key: string]: string }>(jwt);\n const serializer = new Serializer();\n serializer.serializeStr(jwtPayload.iss);\n serializer.serializeStr(jwtPayload.aud);\n serializer.serializeStr(jwtPayload[uidKey || \"sub\"]);\n serializer.serializeStr(uidKey || \"sub\");\n const serial = serializer.toUint8Array();\n const msg = bls.G1.hashToCurve(serial, { DST: \"APTOS_PEPPER_SERVICE_BLS12381_VUF_DST\" }).toAffine();\n const pp = bls.G1.ProjectivePoint.fromAffine(msg);\n return pp;\n}\n\nasync function verifyPepperBase(args: {\n aptosConfig: AptosConfig;\n pepperInput: ProjPointType<bigint>;\n pepperBase: Uint8Array;\n}): Promise<boolean> {\n const { aptosConfig, pepperInput, pepperBase } = args;\n const { data: pubKeyResponse } = await getAptosPepperService<any, { vrf_public_key_hex_string: string }>({\n aptosConfig,\n path: \"vrf-pub-key\",\n originMethod: \"getPepper\",\n });\n const publicKeyFromService = bls.G2.ProjectivePoint.fromHex(pubKeyResponse.vrf_public_key_hex_string);\n return bls.verifyShortSignature(pepperBase, pepperInput, publicKeyFromService);\n}\n\nexport async function getPepper(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n derivationPath?: string;\n verify?: boolean;\n}): Promise<Uint8Array> {\n const { aptosConfig, jwt, ephemeralKeyPair, uidKey, verify } = args;\n let { derivationPath } = args;\n\n const body = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n exp_date_secs: Number(ephemeralKeyPair.expiryDateSecs),\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n uid_key: uidKey,\n };\n const { data } = await postAptosPepperService<any, PepperFetchResponse>({\n aptosConfig,\n path: \"fetch\",\n body,\n originMethod: \"getPepper\",\n overrides: { WITH_CREDENTIALS: false },\n });\n const pepperBase = Hex.fromHexInput(data.signature).toUint8Array();\n\n if (verify) {\n const pepperVerified = verifyPepperBase({ aptosConfig, pepperBase, pepperInput: getPepperInput(args) });\n if (!pepperVerified) {\n throw new Error(\"Unable to verify\");\n }\n }\n // This takes the BLS VUF H(m)^sk and transforms it into a Pinkas VUF e(H(m), g_3^sk), where g_3 is the base of the secret key (computed pseudo-randomly via hash-to-curve).\n // This gives us the freedom of either decentralizing the pepper service as a BLS-based MPC or on top of the validators, by reusing the Pinkas WVUF-based randomness infrastructure.\n const newPepperBase = bls.pairing(\n bls.G1.ProjectivePoint.fromHex(pepperBase),\n bls.G2.ProjectivePoint.fromAffine(PINKAS_VUF_SECRET_KEY_BASE_AFFINE),\n );\n\n if (derivationPath === undefined) {\n derivationPath = APTOS_BIP44_DEFAULT_DERIVATION_PATH;\n }\n const pepper = KeylessAccount.fromDerivationPath(derivationPath, bls.fields.Fp12.toBytes(newPepperBase));\n return pepper.slice(0, 31);\n}\n\nexport async function getProof(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n uidKey?: string;\n extraFieldKey?: string;\n}): Promise<SignedGroth16Signature> {\n const { aptosConfig, jwt, ephemeralKeyPair, pepper, uidKey, extraFieldKey } = args;\n const jwtPayload = jwtDecode<{ [key: string]: string }>(jwt);\n let extraField;\n if (extraFieldKey) {\n const extraFieldVal = jwtPayload[extraFieldKey];\n extraField = `\"${extraFieldKey}\":\"${extraFieldVal}\",`;\n }\n const json = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n exp_date_secs: Number(ephemeralKeyPair.expiryDateSecs),\n exp_horizon_secs: EPK_HORIZON_SECS,\n pepper: Hex.fromHexInput(pepper).toStringWithoutPrefix(),\n extra_field: extraFieldKey,\n uid_key: uidKey || \"sub\",\n };\n\n const { data } = await postAptosProvingService<any, ProverResponse>({\n aptosConfig,\n path: \"prove\",\n body: json,\n originMethod: \"getProof\",\n overrides: { WITH_CREDENTIALS: false },\n });\n\n const proofPoints = data.proof;\n const proof = new Groth16Zkp({\n a: proofPoints.a,\n b: proofPoints.b,\n c: proofPoints.c,\n });\n\n const signedProof = new SignedGroth16Signature({\n proof,\n extraField,\n trainingWheelsSignature: EphemeralSignature.fromHex(data.training_wheels_signature),\n });\n return signedProof;\n}\n\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n pepper?: HexInput;\n extraFieldKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<KeylessAccount> {\n const { proofFetchCallback } = args;\n let { pepper } = args;\n if (pepper === undefined) {\n pepper = await getPepper(args);\n } else if (Hex.fromHexInput(pepper).toUint8Array().length !== 31) {\n throw new Error(\"Pepper needs to be 31 bytes\");\n }\n\n const proofPromise = getProof({ ...args, pepper });\n const proof = proofFetchCallback ? proofPromise : await proofPromise;\n\n const keylessAccount = KeylessAccount.fromJWTAndProof({ ...args, proof, pepper, proofFetchCallback });\n\n return keylessAccount;\n}\n"],"mappings":"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","names":["jwtDecode","bls","APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST","stringToUint8Array","str","PINKAS_VUF_SECRET_KEY_BASE_AFFINE","bls","getPepperInput","args","jwt","uidKey","jwtPayload","jwtDecode","serializer","Serializer","serial","msg","verifyPepperBase","aptosConfig","pepperInput","pepperBase","pubKeyResponse","getAptosPepperService","publicKeyFromService","getPepper","ephemeralKeyPair","verify","derivationPath","body","Hex","data","postAptosPepperService","newPepperBase","APTOS_BIP44_DEFAULT_DERIVATION_PATH","KeylessAccount","getProof","pepper","extraFieldKey","extraField","extraFieldVal","json","EPK_HORIZON_SECS","postAptosProvingService","proofPoints","proof","Groth16Zkp","SignedGroth16Signature","EphemeralSignature","deriveKeylessAccount","proofFetchCallback","proofPromise"]}
@@ -0,0 +1,2 @@
1
+ import{d as i}from"./chunk-2YDIOWRJ.mjs";import{b as o}from"./chunk-WPVBC4JS.mjs";import{b as n}from"./chunk-7JNPSNL6.mjs";import{b as a}from"./chunk-T23OVRNF.mjs";var c=class s{constructor(e){this.signingScheme=0;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=r.publicKey(),this.accountAddress=t?a.from(t):this.publicKey.authKey().derivedAddress()}static generate(){let e=n.generate();return new s({privateKey:e})}static fromDerivationPath(e){let{path:r,mnemonic:t}=e,u=n.fromDerivationPath(r,t);return new s({privateKey:u})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let r=this.privateKey.sign(i(e));return new o(this.publicKey,r)}sign(e){return this.privateKey.sign(e)}signTransaction(e){return this.sign(i(e))}};export{c as a};
2
+ //# sourceMappingURL=chunk-ITEV72BZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/Ed25519Account.ts"],"sourcesContent":["import { AccountAuthenticatorEd25519 } from \"../transactions/authenticator/account\";\nimport { HexInput, SigningScheme } from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature } from \"../core/crypto\";\nimport type { Account } from \"./Account\";\nimport { AnyRawTransaction } from \"../transactions/types\";\nimport { generateSigningMessageForTransaction } from \"../transactions/transactionBuilder/signingMessage\";\n\nexport interface Ed25519SignerConstructorArgs {\n privateKey: Ed25519PrivateKey;\n address?: AccountAddressInput;\n}\n\nexport interface Ed25519SignerFromDerivationPathArgs {\n path: string;\n mnemonic: string;\n}\n\nexport interface VerifyEd25519SignatureArgs {\n message: HexInput;\n signature: Ed25519Signature;\n}\n\n/**\n * Signer implementation for the Ed25519 authentication scheme.\n * This extends an {@link Ed25519Account} by adding signing capabilities through an {@link Ed25519PrivateKey}.\n *\n * Note: Generating a signer instance does not create the account on-chain.\n */\nexport class Ed25519Account implements Account {\n /**\n * Private key associated with the account\n */\n readonly privateKey: Ed25519PrivateKey;\n\n readonly publicKey: Ed25519PublicKey;\n\n readonly accountAddress: AccountAddress;\n\n readonly signingScheme = SigningScheme.Ed25519;\n\n // region Constructors\n\n constructor(args: Ed25519SignerConstructorArgs) {\n const { privateKey, address } = args;\n this.privateKey = privateKey;\n this.publicKey = privateKey.publicKey();\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n }\n\n /**\n * Derives a signer from a randomly generated private key\n */\n static generate() {\n const privateKey = Ed25519PrivateKey.generate();\n return new Ed25519Account({ privateKey });\n }\n\n /**\n * Derives an account with bip44 path and mnemonics\n *\n * @param args.path the BIP44 derive hardened path e.g. m/44'/637'/0'/0'/0'\n * Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n * @param args.mnemonic the mnemonic seed phrase of the account\n */\n static fromDerivationPath(args: Ed25519SignerFromDerivationPathArgs) {\n const { path, mnemonic } = args;\n const privateKey = Ed25519PrivateKey.fromDerivationPath(path, mnemonic);\n return new Ed25519Account({ privateKey });\n }\n\n // endregion\n\n // region Account\n\n verifySignature(args: VerifyEd25519SignatureArgs): boolean {\n return this.publicKey.verifySignature(args);\n }\n\n signWithAuthenticator(transaction: AnyRawTransaction) {\n const signature = this.privateKey.sign(generateSigningMessageForTransaction(transaction));\n return new AccountAuthenticatorEd25519(this.publicKey, signature);\n }\n\n sign(message: HexInput) {\n return this.privateKey.sign(message);\n }\n\n signTransaction(transaction: AnyRawTransaction) {\n return this.sign(generateSigningMessageForTransaction(transaction));\n }\n\n // endregion\n}\n"],"mappings":"oKA6BO,IAAMA,EAAN,MAAMC,CAAkC,CAc7C,YAAYC,EAAoC,CAJhD,KAAS,cAAgB,EAKvB,GAAM,CAAE,WAAAC,EAAY,QAAAC,CAAQ,EAAIF,EAChC,KAAK,WAAaC,EAClB,KAAK,UAAYA,EAAW,UAAU,EACtC,KAAK,eAAiBC,EAAUC,EAAe,KAAKD,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,CACzG,CAKA,OAAO,UAAW,CAChB,IAAMD,EAAaG,EAAkB,SAAS,EAC9C,OAAO,IAAIL,EAAe,CAAE,WAAAE,CAAW,CAAC,CAC1C,CASA,OAAO,mBAAmBD,EAA2C,CACnE,GAAM,CAAE,KAAAK,EAAM,SAAAC,CAAS,EAAIN,EACrBC,EAAaG,EAAkB,mBAAmBC,EAAMC,CAAQ,EACtE,OAAO,IAAIP,EAAe,CAAE,WAAAE,CAAW,CAAC,CAC1C,CAMA,gBAAgBD,EAA2C,CACzD,OAAO,KAAK,UAAU,gBAAgBA,CAAI,CAC5C,CAEA,sBAAsBO,EAAgC,CACpD,IAAMC,EAAY,KAAK,WAAW,KAAKC,EAAqCF,CAAW,CAAC,EACxF,OAAO,IAAIG,EAA4B,KAAK,UAAWF,CAAS,CAClE,CAEA,KAAKG,EAAmB,CACtB,OAAO,KAAK,WAAW,KAAKA,CAAO,CACrC,CAEA,gBAAgBJ,EAAgC,CAC9C,OAAO,KAAK,KAAKE,EAAqCF,CAAW,CAAC,CACpE,CAGF","names":["Ed25519Account","_Ed25519Account","args","privateKey","address","AccountAddress","Ed25519PrivateKey","path","mnemonic","transaction","signature","generateSigningMessageForTransaction","AccountAuthenticatorEd25519","message"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-JXCZTOYC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-HLVMEUWD.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
- //# sourceMappingURL=chunk-KDCHX7BI.mjs.map
1
+ import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-VTX77UM3.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
+ //# sourceMappingURL=chunk-KFJMLLOA.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as u,b as l}from"./chunk-6M6XXPQQ.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 p(y){let o=y;return o-=o>>1&1431655765,o=(o&858993459)+(o>>2&858993459),(o+(o>>4)&252645135)*16843009>>24}var d=class y extends g{constructor(e){super();let{publicKeys:i,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(i.length<t)throw new Error(`Provided ${i.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=i.map(r=>r instanceof u?r:new u(r)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let i=e.deserializeVector(u),t=e.deserializeU8();return new y({publicKeys:i,signaturesRequired:t})}createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.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(s.has(n))throw new Error(`Duplicate bit ${n} detected.`);s.add(n);let h=Math.floor(n/8),b=r[h];b|=t>>n%8,r[h]=b}),r}getIndex(e){let i=e instanceof u?e:new u(e),t=this.publicKeys.findIndex(r=>r.toString()===i.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}},a=class a extends f{constructor(e){super();let{signatures:i,bitmap:t}=e;if(i.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=i.map(s=>s instanceof l?s:new l(s)),!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}let r=this.bitmap.reduce((s,n)=>s+p(n),0);if(r!==this.signatures.length)throw new Error(`Expecting ${r} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.forEach(n=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(s.has(n))throw new Error("Duplicate bits detected.");s.add(n);let c=Math.floor(n/8),h=r[c];h|=t>>n%8,r[c]=h}),r}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let i=e.deserializeBytes(),t=i.reduce((s,n)=>s+p(n),0),r=[];for(let s=0;s<t;s+=1){let n=l.deserialize(e);r.push(n)}return new a({signatures:r,bitmap:i})}};a.BITMAP_LEN=4,a.MAX_SIGNATURES_SUPPORTED=a.BITMAP_LEN*8;var A=a;export{d as a,A as b};
2
+ //# sourceMappingURL=chunk-KGJITNRZ.mjs.map
@@ -0,0 +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 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 MultiSignature 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 = MultiSignature.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 > MultiSignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiSignature.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 = MultiSignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiSignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiSignature.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 >= MultiSignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiSignature.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): MultiSignature {\n const bitmap = deserializer.deserializeBytes();\n const nSignatures = bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n const signatures: AnySignature[] = [];\n for (let i = 0; i < nSignatures; i += 1) {\n const signature = AnySignature.deserialize(deserializer);\n signatures.push(signature);\n }\n return new MultiSignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"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","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","_MultiSignature","Signature","signatures","signature","AnySignature","nSignatures","acc","i","MultiSignature"]}
@@ -0,0 +1,2 @@
1
+ import{g as e}from"./chunk-GI52SX32.mjs";import{d as c}from"./chunk-CHQ6IKE3.mjs";import{d as r}from"./chunk-YE5B2S5L.mjs";import{b as s}from"./chunk-T23OVRNF.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
2
+ //# sourceMappingURL=chunk-KOCKKI4F.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-HLVMEUWD.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
- //# sourceMappingURL=chunk-YBEF3UR3.mjs.map
1
+ import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-VTX77UM3.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
+ //# sourceMappingURL=chunk-LV7OW245.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-52C73T26.mjs";var r=class t extends e{constructor(i){super();this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
2
- //# sourceMappingURL=chunk-DSTKXJMA.mjs.map
1
+ import{a as e}from"./chunk-TVRJ3M7B.mjs";var r=class t extends e{constructor(i){super();this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
2
+ //# sourceMappingURL=chunk-MGOHPDX4.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as r}from"./chunk-WBOLHLPX.mjs";import{b as i}from"./chunk-MNBYKY5P.mjs";import{b as t}from"./chunk-52C73T26.mjs";async function v(a){let{aptosConfig:o,payload:n,options:s}=a,p=await r({...n,aptosConfig:o}),e=new t;p.serialize(e);let l=e.toUint8Array(),{data:d}=await i({aptosConfig:o,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:s?.ledgerVersion},body:l});return d}export{v as a};
2
- //# sourceMappingURL=chunk-BBU2EE6D.mjs.map
1
+ import{c as r}from"./chunk-6J3CB3DN.mjs";import{b as i}from"./chunk-CHQ6IKE3.mjs";import{b as t}from"./chunk-TVRJ3M7B.mjs";async function v(a){let{aptosConfig:o,payload:n,options:s}=a,p=await r({...n,aptosConfig:o}),e=new t;p.serialize(e);let l=e.toUint8Array(),{data:d}=await i({aptosConfig:o,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:s?.ledgerVersion},body:l});return d}export{v as a};
2
+ //# sourceMappingURL=chunk-MJGZJL3W.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-OGHE4AQA.mjs";import{b as a}from"./chunk-IOSQVDZI.mjs";import{a as i}from"./chunk-52C73T26.mjs";var o=class t extends i{constructor(e,r){super();this.rawTransaction=e,this.feePayerAddress=r}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let r=n.deserialize(e),d=e.deserializeBool(),s;return d&&(s=a.deserialize(e)),new t(r,s)}};export{o as a};
2
- //# sourceMappingURL=chunk-UPIN5AIO.mjs.map
1
+ import{a as n}from"./chunk-Z2ZR4PTF.mjs";import{b as a}from"./chunk-T23OVRNF.mjs";import{a as i}from"./chunk-TVRJ3M7B.mjs";var o=class t extends i{constructor(e,r){super();this.rawTransaction=e,this.feePayerAddress=r}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let r=n.deserialize(e),d=e.deserializeBool(),s;return d&&(s=a.deserialize(e)),new t(r,s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-MKUAW7KW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-52C73T26.mjs";var r=class a extends i{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
2
- //# sourceMappingURL=chunk-BWFJHFBQ.mjs.map
1
+ import{a as i}from"./chunk-TVRJ3M7B.mjs";var r=class a extends i{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
2
+ //# sourceMappingURL=chunk-MWUJCP27.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-IOSQVDZI.mjs";import{a as u,b as r}from"./chunk-FS3NSGBF.mjs";import{e as t}from"./chunk-QIAHBEEW.mjs";import{a as i}from"./chunk-52C73T26.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
- //# sourceMappingURL=chunk-QTRYMRYK.mjs.map
1
+ import{b as o}from"./chunk-T23OVRNF.mjs";import{a as u,b as r}from"./chunk-EB7AI4B4.mjs";import{e as t}from"./chunk-6RBUXB5I.mjs";import{a as i}from"./chunk-TVRJ3M7B.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
+ //# sourceMappingURL=chunk-NC5HHEEM.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-4LMAVPA4.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
- //# sourceMappingURL=chunk-6MG4JAYB.mjs.map
1
+ import{a as o}from"./chunk-A7L2Z5DW.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
+ //# sourceMappingURL=chunk-NPNAKSCR.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as h}from"./chunk-EFRNRARV.mjs";import{a as y}from"./chunk-6CQH7JPF.mjs";import{a as u}from"./chunk-R4UIPTBH.mjs";import{a as A}from"./chunk-6GQAHQGW.mjs";import{a as r}from"./chunk-NPNAKSCR.mjs";import{a}from"./chunk-GKCO5PQJ.mjs";import{a as c}from"./chunk-UKJUHLZW.mjs";import{a as f}from"./chunk-DIBNAYZ2.mjs";import{a as g}from"./chunk-DX62SMGM.mjs";import{a as l}from"./chunk-ODTNF2YP.mjs";import{a as s}from"./chunk-TFJCMFKE.mjs";import{a as p}from"./chunk-4XB3D2ZD.mjs";var t=class{constructor(e){this.config=new A(e),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new y(this.config),this.transaction=new u(this.config),this.keyless=new h(this.config)}};function n(m,e,d){Object.getOwnPropertyNames(e.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&(o.value=function(...w){return this[d][i](...w)},Object.defineProperty(m.prototype,i,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,y,"staking");n(t,u,"transaction");n(t,h,"keyless");export{t as a};
2
+ //# sourceMappingURL=chunk-NWLZDI2I.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Keyless } from \"./keyless\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n *\n * @example\n *\n * const aptos = new Aptos();\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly keyless: Keyless;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.keyless = new Keyless(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Keyless,\n Staking,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Keyless, \"keyless\");\n"],"mappings":"ueA2BO,IAAMA,EAAN,KAAY,CAyBjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,CACxC,CACF,EAyBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWd,EAAOG,EAAS,SAAS,EACpCW,EAAWd,EAAOI,EAAK,KAAK,EAC5BU,EAAWd,EAAOK,EAAM,MAAM,EAC9BS,EAAWd,EAAOM,EAAc,cAAc,EAC9CQ,EAAWd,EAAOO,EAAO,OAAO,EAChCO,EAAWd,EAAOQ,EAAQ,QAAQ,EAClCM,EAAWd,EAAOS,EAAe,eAAe,EAChDK,EAAWd,EAAOU,EAAS,SAAS,EACpCI,EAAWd,EAAOW,EAAS,SAAS,EACpCG,EAAWd,EAAOY,EAAa,aAAa,EAC5CE,EAAWd,EAAOa,EAAS,SAAS","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Keyless","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-BBU2EE6D.mjs";import{a as o,b as s,c as t,d as r,e as n,f as i,h as a,i as g}from"./chunk-QWRH22H4.mjs";var p=class{constructor(e){this.config=e}async getLedgerInfo(){return o({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(e){return s({aptosConfig:this.config,...e})}async getBlockByHeight(e){return t({aptosConfig:this.config,...e})}async getTableItem(e){return r({aptosConfig:this.config,...e})}async view(e){return c({aptosConfig:this.config,...e})}async getChainTopUserTransactions(e){return n({aptosConfig:this.config,...e})}async queryIndexer(e){return i({aptosConfig:this.config,...e})}async getIndexerLastSuccessVersion(){return a({aptosConfig:this.config})}async getProcessorStatus(e){return g({aptosConfig:this.config,processorType:e})}};export{p as a};
2
- //# sourceMappingURL=chunk-6IGEUEER.mjs.map
1
+ import{a as c}from"./chunk-MJGZJL3W.mjs";import{a as o,b as s,c as t,d as r,e as n,f as i,h as a,i as g}from"./chunk-YGB7MEH3.mjs";var p=class{constructor(e){this.config=e}async getLedgerInfo(){return o({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(e){return s({aptosConfig:this.config,...e})}async getBlockByHeight(e){return t({aptosConfig:this.config,...e})}async getTableItem(e){return r({aptosConfig:this.config,...e})}async view(e){return c({aptosConfig:this.config,...e})}async getChainTopUserTransactions(e){return n({aptosConfig:this.config,...e})}async queryIndexer(e){return i({aptosConfig:this.config,...e})}async getIndexerLastSuccessVersion(){return a({aptosConfig:this.config})}async getProcessorStatus(e){return g({aptosConfig:this.config,processorType:e})}};export{p as a};
2
+ //# sourceMappingURL=chunk-ODTNF2YP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-TORRTLWV.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-HLVMEUWD.mjs";import{g as u}from"./chunk-YKVKSNH4.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
- //# sourceMappingURL=chunk-LV2V23Z6.mjs.map
1
+ import{a as l}from"./chunk-DOCYCNXV.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-VTX77UM3.mjs";import{g as u}from"./chunk-GI52SX32.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash,options:{timeoutSecs:3}}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
+ //# sourceMappingURL=chunk-OKG6X5TX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/management/transactionWorker.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\n\nimport EventEmitter from \"eventemitter3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { Account } from \"../../account\";\nimport { waitForTransaction } from \"../../internal/transaction\";\nimport { generateTransaction, signAndSubmitTransaction } from \"../../internal/transactionSubmission\";\nimport { PendingTransactionResponse, TransactionResponse } from \"../../types\";\nimport { InputGenerateTransactionOptions, InputGenerateTransactionPayloadData } from \"../types\";\nimport { AccountSequenceNumber } from \"./accountSequenceNumber\";\nimport { AsyncQueue, AsyncQueueCancelledError } from \"./asyncQueue\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\n\nexport const promiseFulfilledStatus = \"fulfilled\";\n\n// Event types the worker fires during execution and\n// the dapp can listen to\nexport enum TransactionWorkerEventsEnum {\n // fired after a transaction gets sent to the chain\n TransactionSent = \"transactionSent\",\n // fired if there is an error sending the transaction to the chain\n TransactionSendFailed = \"transactionSendFailed\",\n // fired when a single transaction has executed successfully\n TransactionExecuted = \"transactionExecuted\",\n // fired if a single transaction fails in execution\n TransactionExecutionFailed = \"transactionExecutionFailed\",\n // fired when the worker has finished its job / when the queue has been emptied\n ExecutionFinish = \"executionFinish\",\n}\n\n// Typed interface of the worker events\nexport interface TransactionWorkerEvents {\n transactionSent: (data: SuccessEventData) => void;\n transactionSendFailed: (data: FailureEventData) => void;\n transactionExecuted: (data: SuccessEventData) => void;\n transactionExecutionFailed: (data: FailureEventData) => void;\n executionFinish: (data: ExecutionFinishEventData) => void;\n}\n\n// Type for when the worker has finished its job\nexport type ExecutionFinishEventData = {\n message: string;\n};\n\n// Type for a success event\nexport type SuccessEventData = {\n message: string;\n transactionHash: string;\n};\n\n// Type for a failure event\nexport type FailureEventData = {\n message: string;\n error: string;\n};\n\n/**\n * TransactionWorker provides a simple framework for receiving payloads to be processed.\n *\n * Once one `start()` the process and pushes a new transaction, the worker acquires\n * the current account's next sequence number (by using the AccountSequenceNumber class),\n * generates a signed transaction and pushes an async submission process into the `outstandingTransactions` queue.\n * At the same time, the worker processes transactions by reading the `outstandingTransactions` queue\n * and submits the next transaction to chain, it\n * 1) waits for resolution of the submission process or get pre-execution validation error\n * and 2) waits for the resolution of the execution process or get an execution error.\n * The worker fires events for any submission and/or execution success and/or failure.\n */\nexport class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // current account sequence number\n readonly accountSequnceNumber: AccountSequenceNumber;\n\n readonly taskQueue: AsyncQueue<() => Promise<void>> = new AsyncQueue<() => Promise<void>>();\n\n // process has started\n started: boolean;\n\n /**\n * transactions payloads waiting to be generated and signed\n *\n * TODO support entry function payload from ABI builder\n */\n transactionsQueue = new AsyncQueue<\n [InputGenerateTransactionPayloadData, InputGenerateTransactionOptions | undefined]\n >();\n\n /**\n * signed transactions waiting to be submitted\n */\n outstandingTransactions = new AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>();\n\n /**\n * transactions that have been submitted to chain\n */\n sentTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * transactions that have been committed to chain\n */\n executedTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * Provides a simple framework for receiving payloads to be processed.\n *\n * @param aptosConfig - a config object\n * @param sender - a sender as Account\n * @param maxWaitTime - the max wait time to wait before resyncing the sequence number\n * to the current on-chain state, default to 30\n * @param maximumInFlight - submit up to `maximumInFlight` transactions per account.\n * Mempool limits the number of transactions per account to 100, hence why we default to 100.\n * @param sleepTime - If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating, default to 10\n */\n constructor(\n aptosConfig: AptosConfig,\n account: Account,\n maxWaitTime: number = 30,\n maximumInFlight: number = 100,\n sleepTime: number = 10,\n ) {\n super();\n this.aptosConfig = aptosConfig;\n this.account = account;\n this.started = false;\n this.accountSequnceNumber = new AccountSequenceNumber(\n aptosConfig,\n account,\n maxWaitTime,\n maximumInFlight,\n sleepTime,\n );\n }\n\n /**\n * Gets the current account sequence number,\n * generates the transaction with the account sequence number,\n * adds the transaction to the outstanding transaction queue\n * to be processed later.\n */\n async submitNextTransaction() {\n try {\n /* eslint-disable no-constant-condition */\n while (true) {\n const sequenceNumber = await this.accountSequnceNumber.nextSequenceNumber();\n if (sequenceNumber === null) return;\n const transaction = await this.generateNextTransaction(this.account, sequenceNumber);\n if (!transaction) return;\n const pendingTransaction = signAndSubmitTransaction({\n aptosConfig: this.aptosConfig,\n transaction,\n signer: this.account,\n });\n await this.outstandingTransactions.enqueue([pendingTransaction, sequenceNumber]);\n }\n } catch (error: any) {\n if (error instanceof AsyncQueueCancelledError) {\n return;\n }\n throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Reads the outstanding transaction queue and submits the transaction to chain.\n *\n * If the transaction has fulfilled, it pushes the transaction to the processed\n * transactions queue and fires a transactionsFulfilled event.\n *\n * If the transaction has failed, it pushes the transaction to the processed\n * transactions queue with the failure reason and fires a transactionsFailed event.\n */\n async processTransactions() {\n try {\n /* eslint-disable no-constant-condition */\n while (true) {\n const awaitingTransactions = [];\n const sequenceNumbers = [];\n let [pendingTransaction, sequenceNumber] = await this.outstandingTransactions.dequeue();\n\n awaitingTransactions.push(pendingTransaction);\n sequenceNumbers.push(sequenceNumber);\n\n while (!this.outstandingTransactions.isEmpty()) {\n [pendingTransaction, sequenceNumber] = await this.outstandingTransactions.dequeue();\n\n awaitingTransactions.push(pendingTransaction);\n sequenceNumbers.push(sequenceNumber);\n }\n // send awaiting transactions to chain\n const sentTransactions = await Promise.allSettled(awaitingTransactions);\n for (let i = 0; i < sentTransactions.length && i < sequenceNumbers.length; i += 1) {\n // check sent transaction status\n const sentTransaction = sentTransactions[i];\n sequenceNumber = sequenceNumbers[i];\n if (sentTransaction.status === promiseFulfilledStatus) {\n // transaction sent to chain\n this.sentTransactions.push([sentTransaction.value.hash, sequenceNumber, null]);\n // check sent transaction execution\n this.emit(TransactionWorkerEventsEnum.TransactionSent, {\n message: `transaction hash ${sentTransaction.value.hash} has been committed to chain`,\n transactionHash: sentTransaction.value.hash,\n });\n await this.checkTransaction(sentTransaction, sequenceNumber);\n } else {\n // send transaction failed\n this.sentTransactions.push([sentTransaction.status, sequenceNumber, sentTransaction.reason]);\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, {\n message: `failed to commit transaction ${this.sentTransactions.length} with error ${sentTransaction.reason}`,\n error: sentTransaction.reason,\n });\n }\n }\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, {\n message: `execute ${sentTransactions.length} transactions finished`,\n });\n }\n } catch (error: any) {\n if (error instanceof AsyncQueueCancelledError) {\n return;\n }\n throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Once transaction has been sent to chain, we check for its execution status.\n * @param sentTransaction transactions that were sent to chain and are now waiting to be executed\n * @param sequenceNumber the account's sequence number that was sent with the transaction\n */\n async checkTransaction(sentTransaction: PromiseFulfilledResult<PendingTransactionResponse>, sequenceNumber: bigint) {\n try {\n const waitFor: Array<Promise<TransactionResponse>> = [];\n waitFor.push(\n waitForTransaction({\n aptosConfig: this.aptosConfig,\n transactionHash: sentTransaction.value.hash,\n options: { timeoutSecs: 3 },\n }),\n );\n const sentTransactions = await Promise.allSettled(waitFor);\n\n for (let i = 0; i < sentTransactions.length; i += 1) {\n const executedTransaction = sentTransactions[i];\n if (executedTransaction.status === promiseFulfilledStatus) {\n // transaction executed to chain\n this.executedTransactions.push([executedTransaction.value.hash, sequenceNumber, null]);\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, {\n message: `transaction hash ${executedTransaction.value.hash} has been executed on chain`,\n transactionHash: sentTransaction.value.hash,\n });\n } else {\n // transaction execution failed\n this.executedTransactions.push([executedTransaction.status, sequenceNumber, executedTransaction.reason]);\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, {\n message: `failed to execute transaction ${this.executedTransactions.length} with error ${executedTransaction.reason}`,\n error: executedTransaction.reason,\n });\n }\n }\n } catch (error: any) {\n throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Push transaction to the transactions queue\n *\n * @param transactionData Transaction payload\n * @param transactionData.abi For all entry function payloads, the ABI to skip remote ABI lookups\n * @param options.maxGasAmount Maximum gas amount for the transaction\n * @param options.gasUnitPrice Gas unit price for the transaction\n * @param options.expireTimestamp expiration timestamp on the transaction\n * @param options.accountSequenceNumber the sequence number for the transaction\n */\n async push(\n transactionData: InputGenerateTransactionPayloadData,\n options?: InputGenerateTransactionOptions,\n ): Promise<void> {\n this.transactionsQueue.enqueue([transactionData, options]);\n }\n\n /**\n * Generates a signed transaction that can be submitted to chain\n * @param account an Aptos account\n * @param sequenceNumber a sequence number the transaction will be generated with\n * @returns\n */\n async generateNextTransaction(account: Account, sequenceNumber: bigint): Promise<SimpleTransaction | undefined> {\n if (this.transactionsQueue.isEmpty()) return undefined;\n const [transactionData, options] = await this.transactionsQueue.dequeue();\n return generateTransaction({\n aptosConfig: this.aptosConfig,\n sender: account.accountAddress,\n data: transactionData,\n options: { ...options, accountSequenceNumber: sequenceNumber },\n });\n }\n\n /**\n * Starts transaction submission and transaction processing.\n */\n async run() {\n try {\n while (!this.taskQueue.isCancelled()) {\n const task = await this.taskQueue.dequeue();\n await task();\n }\n } catch (error: any) {\n throw new Error(`Unable to start transaction batching: ${error}`);\n }\n }\n\n /**\n * Starts the transaction management process.\n */\n start() {\n if (this.started) {\n throw new Error(\"worker has already started\");\n }\n this.started = true;\n this.taskQueue.enqueue(() => this.submitNextTransaction());\n this.taskQueue.enqueue(() => this.processTransactions());\n this.run();\n }\n\n /**\n * Stops the the transaction management process.\n */\n stop() {\n if (this.taskQueue.isCancelled()) {\n throw new Error(\"worker has already stopped\");\n }\n this.started = false;\n this.taskQueue.cancel();\n }\n}\n"],"mappings":"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","names":["EventEmitter","promiseFulfilledStatus","TransactionWorkerEventsEnum","TransactionWorker","EventEmitter","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","AsyncQueue","AccountSequenceNumber","sequenceNumber","transaction","pendingTransaction","signAndSubmitTransaction","error","AsyncQueueCancelledError","awaitingTransactions","sequenceNumbers","sentTransactions","i","sentTransaction","waitFor","waitForTransaction","executedTransaction","transactionData","options","generateTransaction"]}
@@ -0,0 +1,2 @@
1
+ var g=(e=>(e.JSON="application/json",e.BCS="application/x-bcs",e.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",e.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",e))(g||{}),y=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))(y||{}),d=(o=>(o[o.U8=0]="U8",o[o.U64=1]="U64",o[o.U128=2]="U128",o[o.Address=3]="Address",o[o.U8Vector=4]="U8Vector",o[o.Bool=5]="Bool",o[o.U16=6]="U16",o[o.U32=7]="U32",o[o.U256=8]="U256",o))(d||{}),u=(n=>(n[n.Script=0]="Script",n[n.EntryFunction=2]="EntryFunction",n[n.Multisig=3]="Multisig",n))(u||{}),c=(i=>(i[i.MultiAgentTransaction=0]="MultiAgentTransaction",i[i.FeePayerTransaction=1]="FeePayerTransaction",i))(c||{}),l=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(l||{}),_=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.SingleKey=2]="SingleKey",e[e.MultiKey=3]="MultiKey",e))(_||{}),x=(n=>(n[n.Ed25519=0]="Ed25519",n[n.Secp256k1=1]="Secp256k1",n[n.Keyless=3]="Keyless",n))(x||{}),v=(n=>(n[n.Ed25519=0]="Ed25519",n[n.Secp256k1=1]="Secp256k1",n[n.Keyless=3]="Keyless",n))(v||{}),h=(a=>(a[a.Ed25519=0]="Ed25519",a))(h||{}),M=(a=>(a[a.Ed25519=0]="Ed25519",a))(M||{}),R=(i=>(i[i.ZkProof=0]="ZkProof",i[i.OpenIdSignature=1]="OpenIdSignature",i))(R||{}),m=(p=>(p.Pending="pending_transaction",p.User="user_transaction",p.Genesis="genesis_transaction",p.BlockMetadata="block_metadata_transaction",p.StateCheckpoint="state_checkpoint_transaction",p.Validator="validator_transaction",p))(m||{});function U(r){return r.type==="pending_transaction"}function E(r){return r.type==="user_transaction"}function W(r){return r.type==="genesis_transaction"}function F(r){return r.type==="block_metadata_transaction"}function I(r){return r.type==="state_checkpoint_transaction"}function A(r){return r.type==="validator_transaction"}function P(r){return"signature"in r&&r.signature==="ed25519_signature"}function O(r){return"signature"in r&&r.signature==="secp256k1_ecdsa_signature"}function G(r){return r.type==="multi_agent_signature"}function B(r){return r.type==="fee_payer_signature"}function D(r){return r.type==="multi_ed25519_signature"}var b=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(b||{}),S=(e=>(e.STORE="store",e.DROP="drop",e.KEY="key",e.COPY="copy",e))(S||{}),k=(i=>(i.VALIDATOR="validator",i.FULL_NODE="full_node",i))(k||{}),C=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.SingleKey=2]="SingleKey",e[e.MultiKey=3]="MultiKey",e))(C||{}),f=(i=>(i[i.Ed25519=0]="Ed25519",i[i.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",i))(f||{}),T=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(T||{});export{g as a,y as b,d as c,u as d,c as e,l as f,_ as g,x as h,v as i,h as j,M as k,R as l,m,U as n,E as o,W as p,F as q,I as r,A as s,P as t,O as u,G as v,B as w,D as x,b as y,S as z,k as A,C as B,f as C,T as D};
2
+ //# sourceMappingURL=chunk-OKRUEVF3.mjs.map