@aptos-labs/ts-sdk 5.1.1-side-effect-free.1 → 5.1.2

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 (420) hide show
  1. package/README.md +4 -4
  2. package/dist/common/{account-Dr4y1uZG.d.ts → account-147vfOGb.d.ts} +1 -0
  3. package/dist/common/chunk-347THBDE.js +4 -0
  4. package/dist/common/chunk-347THBDE.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +3 -1
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +15 -82
  9. package/dist/common/index.js +34 -34
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  12. package/dist/esm/account/AbstractKeylessAccount.mjs.map +1 -1
  13. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  14. package/dist/esm/account/AbstractedAccount.mjs.map +1 -1
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/Account.mjs.map +1 -1
  17. package/dist/esm/account/AccountUtils.mjs +1 -1
  18. package/dist/esm/account/AccountUtils.mjs.map +1 -1
  19. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  20. package/dist/esm/account/DerivableAbstractedAccount.mjs.map +1 -1
  21. package/dist/esm/account/Ed25519Account.mjs +1 -1
  22. package/dist/esm/account/Ed25519Account.mjs.map +1 -1
  23. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  24. package/dist/esm/account/EphemeralKeyPair.mjs.map +1 -1
  25. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  26. package/dist/esm/account/FederatedKeylessAccount.mjs.map +1 -1
  27. package/dist/esm/account/KeylessAccount.mjs +1 -1
  28. package/dist/esm/account/KeylessAccount.mjs.map +1 -1
  29. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  30. package/dist/esm/account/MultiEd25519Account.mjs.map +1 -1
  31. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  32. package/dist/esm/account/MultiKeyAccount.mjs.map +1 -1
  33. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  34. package/dist/esm/account/SingleKeyAccount.mjs.map +1 -1
  35. package/dist/esm/account/index.mjs +1 -1
  36. package/dist/esm/account/index.mjs.map +1 -1
  37. package/dist/esm/account/utils.mjs +1 -1
  38. package/dist/esm/account/utils.mjs.map +1 -1
  39. package/dist/esm/api/account/abstraction.mjs +1 -1
  40. package/dist/esm/api/account/abstraction.mjs.map +1 -1
  41. package/dist/esm/api/account.d.mts +1 -1
  42. package/dist/esm/api/account.mjs +1 -1
  43. package/dist/esm/api/account.mjs.map +1 -1
  44. package/dist/esm/api/ans.mjs +1 -1
  45. package/dist/esm/api/ans.mjs.map +1 -1
  46. package/dist/esm/api/aptos.d.mts +14 -81
  47. package/dist/esm/api/aptos.mjs +1 -1
  48. package/dist/esm/api/aptos.mjs.map +1 -1
  49. package/dist/esm/api/aptosConfig.mjs +1 -1
  50. package/dist/esm/api/aptosConfig.mjs.map +1 -1
  51. package/dist/esm/api/coin.mjs +1 -1
  52. package/dist/esm/api/coin.mjs.map +1 -1
  53. package/dist/esm/api/digitalAsset.mjs +1 -1
  54. package/dist/esm/api/digitalAsset.mjs.map +1 -1
  55. package/dist/esm/api/faucet.mjs +1 -1
  56. package/dist/esm/api/faucet.mjs.map +1 -1
  57. package/dist/esm/api/fungibleAsset.mjs +1 -1
  58. package/dist/esm/api/fungibleAsset.mjs.map +1 -1
  59. package/dist/esm/api/general.mjs +1 -1
  60. package/dist/esm/api/general.mjs.map +1 -1
  61. package/dist/esm/api/index.d.mts +2 -2
  62. package/dist/esm/api/index.mjs +1 -1
  63. package/dist/esm/api/index.mjs.map +1 -1
  64. package/dist/esm/api/keyless.mjs +1 -1
  65. package/dist/esm/api/keyless.mjs.map +1 -1
  66. package/dist/esm/api/object.mjs +1 -1
  67. package/dist/esm/api/object.mjs.map +1 -1
  68. package/dist/esm/api/staking.mjs +1 -1
  69. package/dist/esm/api/staking.mjs.map +1 -1
  70. package/dist/esm/api/table.mjs +1 -1
  71. package/dist/esm/api/table.mjs.map +1 -1
  72. package/dist/esm/api/transaction.mjs +1 -1
  73. package/dist/esm/api/transaction.mjs.map +1 -1
  74. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  75. package/dist/esm/api/transactionSubmission/build.mjs.map +1 -1
  76. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  77. package/dist/esm/api/transactionSubmission/helpers.mjs.map +1 -1
  78. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  79. package/dist/esm/api/transactionSubmission/management.mjs.map +1 -1
  80. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  81. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  82. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  83. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -1
  84. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  85. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -1
  86. package/dist/esm/api/utils.mjs +1 -1
  87. package/dist/esm/api/utils.mjs.map +1 -1
  88. package/dist/esm/bcs/consts.mjs +1 -1
  89. package/dist/esm/bcs/consts.mjs.map +1 -1
  90. package/dist/esm/bcs/deserializer.mjs +1 -1
  91. package/dist/esm/bcs/deserializer.mjs.map +1 -1
  92. package/dist/esm/bcs/index.mjs +1 -1
  93. package/dist/esm/bcs/index.mjs.map +1 -1
  94. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  95. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -1
  96. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  97. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -1
  98. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  99. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -1
  100. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  101. package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -1
  102. package/dist/esm/bcs/serializer.mjs +1 -1
  103. package/dist/esm/bcs/serializer.mjs.map +1 -1
  104. package/dist/esm/chunk-2OPKZKOB.mjs +2 -0
  105. package/dist/esm/chunk-2OPKZKOB.mjs.map +1 -0
  106. package/dist/esm/chunk-2PASUPUO.mjs +2 -0
  107. package/dist/esm/chunk-2PASUPUO.mjs.map +1 -0
  108. package/dist/esm/chunk-35DKMW7Q.mjs +2 -0
  109. package/dist/esm/chunk-35DKMW7Q.mjs.map +1 -0
  110. package/dist/esm/chunk-4QMXOWHP.mjs +1 -0
  111. package/dist/esm/chunk-4QMXOWHP.mjs.map +1 -0
  112. package/dist/esm/chunk-4WPQQPUF.mjs +1 -0
  113. package/dist/esm/chunk-4WPQQPUF.mjs.map +1 -0
  114. package/dist/esm/chunk-56CNRT2K.mjs +2 -0
  115. package/dist/esm/chunk-56CNRT2K.mjs.map +1 -0
  116. package/dist/esm/chunk-5HXLZHDW.mjs +1 -0
  117. package/dist/esm/chunk-5HXLZHDW.mjs.map +1 -0
  118. package/dist/esm/chunk-626KB2UQ.mjs +2 -0
  119. package/dist/esm/chunk-626KB2UQ.mjs.map +1 -0
  120. package/dist/esm/chunk-7ECCT6PK.mjs +1 -0
  121. package/dist/esm/chunk-7ECCT6PK.mjs.map +1 -0
  122. package/dist/esm/chunk-A5L76YP7.mjs +2 -0
  123. package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
  124. package/dist/esm/chunk-AQW4BUKF.mjs +2 -0
  125. package/dist/esm/chunk-AQW4BUKF.mjs.map +1 -0
  126. package/dist/esm/chunk-C3Q23D22.mjs +2 -0
  127. package/dist/esm/chunk-C3Q23D22.mjs.map +1 -0
  128. package/dist/esm/chunk-CW35YAMN.mjs +2 -0
  129. package/dist/esm/chunk-CW35YAMN.mjs.map +1 -0
  130. package/dist/esm/chunk-E2U27PNC.mjs +2 -0
  131. package/dist/esm/chunk-E2U27PNC.mjs.map +1 -0
  132. package/dist/esm/chunk-EBMEXURY.mjs +2 -0
  133. package/dist/esm/chunk-EBMEXURY.mjs.map +1 -0
  134. package/dist/esm/chunk-FC72YL4B.mjs +2 -0
  135. package/dist/esm/chunk-FC72YL4B.mjs.map +1 -0
  136. package/dist/esm/chunk-FD6FGKYY.mjs +1 -0
  137. package/dist/esm/chunk-FD6FGKYY.mjs.map +1 -0
  138. package/dist/esm/chunk-FGFLPH5K.mjs +2 -0
  139. package/dist/esm/chunk-FGFLPH5K.mjs.map +1 -0
  140. package/dist/esm/chunk-FLZPUYXQ.mjs +2 -0
  141. package/dist/esm/chunk-FLZPUYXQ.mjs.map +1 -0
  142. package/dist/esm/chunk-FZY4PMEE.mjs +1 -0
  143. package/dist/esm/chunk-FZY4PMEE.mjs.map +1 -0
  144. package/dist/esm/chunk-G3MHXDYA.mjs +1 -0
  145. package/dist/esm/chunk-G3MHXDYA.mjs.map +1 -0
  146. package/dist/esm/chunk-GOXRBEIJ.mjs +2 -0
  147. package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
  148. package/dist/esm/chunk-GQ3UIDPQ.mjs +2 -0
  149. package/dist/esm/chunk-GQ3UIDPQ.mjs.map +1 -0
  150. package/dist/esm/chunk-H3EP5CGP.mjs +2 -0
  151. package/dist/esm/chunk-H3EP5CGP.mjs.map +1 -0
  152. package/dist/esm/chunk-HGLO5LDS.mjs +1 -0
  153. package/dist/esm/chunk-HGLO5LDS.mjs.map +1 -0
  154. package/dist/esm/chunk-IF4UU2MT.mjs +2 -0
  155. package/dist/esm/chunk-IF4UU2MT.mjs.map +1 -0
  156. package/dist/esm/chunk-KDMSOCZY.mjs +2 -0
  157. package/dist/esm/chunk-KDMSOCZY.mjs.map +1 -0
  158. package/dist/esm/chunk-LA56UDUK.mjs +2 -0
  159. package/dist/esm/chunk-LA56UDUK.mjs.map +1 -0
  160. package/dist/esm/chunk-LAPXUUHK.mjs +2 -0
  161. package/dist/esm/chunk-LAPXUUHK.mjs.map +1 -0
  162. package/dist/esm/chunk-MCFQE4GC.mjs +2 -0
  163. package/dist/esm/chunk-MCFQE4GC.mjs.map +1 -0
  164. package/dist/esm/chunk-MT2RJ7H3.mjs +2 -0
  165. package/dist/esm/chunk-MT2RJ7H3.mjs.map +1 -0
  166. package/dist/esm/chunk-N6YTF76Q.mjs +2 -0
  167. package/dist/esm/chunk-N6YTF76Q.mjs.map +1 -0
  168. package/dist/esm/chunk-NCKJ7X57.mjs +2 -0
  169. package/dist/esm/chunk-NCKJ7X57.mjs.map +1 -0
  170. package/dist/esm/chunk-NECL5FCQ.mjs +1 -0
  171. package/dist/esm/chunk-NECL5FCQ.mjs.map +1 -0
  172. package/dist/esm/chunk-OLILO7VD.mjs +2 -0
  173. package/dist/esm/chunk-OLILO7VD.mjs.map +1 -0
  174. package/dist/esm/chunk-ORMOQWWH.mjs +2 -0
  175. package/dist/esm/chunk-ORMOQWWH.mjs.map +1 -0
  176. package/dist/esm/chunk-P5HCJN3A.mjs +2 -0
  177. package/dist/esm/chunk-P5HCJN3A.mjs.map +1 -0
  178. package/dist/esm/chunk-PJTG745G.mjs +4 -0
  179. package/dist/esm/chunk-PJTG745G.mjs.map +1 -0
  180. package/dist/esm/chunk-PSSIJHHC.mjs +2 -0
  181. package/dist/esm/chunk-PSSIJHHC.mjs.map +1 -0
  182. package/dist/esm/chunk-Q4W3WJ2U.mjs +2 -0
  183. package/dist/esm/chunk-Q4W3WJ2U.mjs.map +1 -0
  184. package/dist/esm/chunk-QNARIAVM.mjs +2 -0
  185. package/dist/esm/chunk-QNARIAVM.mjs.map +1 -0
  186. package/dist/esm/chunk-QREVMGQZ.mjs +2 -0
  187. package/dist/esm/chunk-QREVMGQZ.mjs.map +1 -0
  188. package/dist/esm/chunk-R7FWJP3N.mjs +2 -0
  189. package/dist/esm/chunk-R7FWJP3N.mjs.map +1 -0
  190. package/dist/esm/chunk-RGKRCZ36.mjs +4 -0
  191. package/dist/esm/chunk-RGKRCZ36.mjs.map +1 -0
  192. package/dist/esm/chunk-RQX6JOEN.mjs +2 -0
  193. package/dist/esm/chunk-RQX6JOEN.mjs.map +1 -0
  194. package/dist/esm/chunk-STY74NUA.mjs +2 -0
  195. package/dist/esm/chunk-STY74NUA.mjs.map +1 -0
  196. package/dist/esm/chunk-TOBQ5UE6.mjs +2 -0
  197. package/dist/esm/chunk-TOBQ5UE6.mjs.map +1 -0
  198. package/dist/esm/chunk-UL777LTI.mjs +494 -0
  199. package/dist/esm/chunk-UL777LTI.mjs.map +1 -0
  200. package/dist/esm/chunk-UYVPNUH3.mjs +1 -0
  201. package/dist/esm/chunk-UYVPNUH3.mjs.map +1 -0
  202. package/dist/esm/chunk-V3MBJJTL.mjs +1 -0
  203. package/dist/esm/chunk-V3MBJJTL.mjs.map +1 -0
  204. package/dist/esm/chunk-V74WPKSY.mjs +2 -0
  205. package/dist/esm/chunk-V74WPKSY.mjs.map +1 -0
  206. package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
  207. package/dist/esm/chunk-WCMW2L3P.mjs.map +1 -0
  208. package/dist/esm/chunk-WSR5EBJM.mjs +2 -0
  209. package/dist/esm/chunk-WSR5EBJM.mjs.map +1 -0
  210. package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
  211. package/dist/esm/chunk-XJJVJOX5.mjs.map +1 -0
  212. package/dist/esm/chunk-XKUIMGKU.mjs +2 -0
  213. package/dist/esm/chunk-XKUIMGKU.mjs.map +1 -0
  214. package/dist/esm/chunk-YOZBVVKL.mjs +2 -0
  215. package/dist/esm/chunk-YOZBVVKL.mjs.map +1 -0
  216. package/dist/esm/chunk-YS5IUILF.mjs +2 -0
  217. package/dist/esm/chunk-YS5IUILF.mjs.map +1 -0
  218. package/dist/esm/chunk-YZHAI55C.mjs +7 -0
  219. package/dist/esm/chunk-YZHAI55C.mjs.map +1 -0
  220. package/dist/esm/chunk-ZP4DWSQA.mjs +2 -0
  221. package/dist/esm/chunk-ZP4DWSQA.mjs.map +1 -0
  222. package/dist/esm/chunk-ZYE7UTJZ.mjs +2 -0
  223. package/dist/esm/chunk-ZYE7UTJZ.mjs.map +1 -0
  224. package/dist/esm/cli/index.mjs +1 -1
  225. package/dist/esm/cli/index.mjs.map +1 -1
  226. package/dist/esm/cli/localNode.d.mts +2 -0
  227. package/dist/esm/cli/localNode.mjs +1 -1
  228. package/dist/esm/cli/localNode.mjs.map +1 -1
  229. package/dist/esm/cli/move.mjs +1 -1
  230. package/dist/esm/cli/move.mjs.map +1 -1
  231. package/dist/esm/client/core.mjs +1 -1
  232. package/dist/esm/client/core.mjs.map +1 -1
  233. package/dist/esm/client/get.mjs +1 -1
  234. package/dist/esm/client/get.mjs.map +1 -1
  235. package/dist/esm/client/index.mjs +1 -1
  236. package/dist/esm/client/index.mjs.map +1 -1
  237. package/dist/esm/client/post.mjs +1 -1
  238. package/dist/esm/client/post.mjs.map +1 -1
  239. package/dist/esm/core/account/index.mjs +1 -1
  240. package/dist/esm/core/account/index.mjs.map +1 -1
  241. package/dist/esm/core/account/utils/address.mjs +1 -1
  242. package/dist/esm/core/account/utils/address.mjs.map +1 -1
  243. package/dist/esm/core/account/utils/index.mjs +1 -1
  244. package/dist/esm/core/account/utils/index.mjs.map +1 -1
  245. package/dist/esm/core/accountAddress.mjs +1 -3
  246. package/dist/esm/core/accountAddress.mjs.map +1 -1
  247. package/dist/esm/core/authenticationKey.mjs +1 -1
  248. package/dist/esm/core/authenticationKey.mjs.map +1 -1
  249. package/dist/esm/core/common.mjs +1 -1
  250. package/dist/esm/core/common.mjs.map +1 -1
  251. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  252. package/dist/esm/core/crypto/abstraction.mjs.map +1 -1
  253. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  254. package/dist/esm/core/crypto/deserializationUtils.mjs.map +1 -1
  255. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  256. package/dist/esm/core/crypto/ed25519.mjs.map +1 -1
  257. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  258. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -1
  259. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  260. package/dist/esm/core/crypto/federatedKeyless.mjs.map +1 -1
  261. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  262. package/dist/esm/core/crypto/hdKey.mjs.map +1 -1
  263. package/dist/esm/core/crypto/index.mjs +1 -1
  264. package/dist/esm/core/crypto/index.mjs.map +1 -1
  265. package/dist/esm/core/crypto/keyless.mjs +1 -1
  266. package/dist/esm/core/crypto/keyless.mjs.map +1 -1
  267. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  268. package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -1
  269. package/dist/esm/core/crypto/multiKey.mjs +1 -3
  270. package/dist/esm/core/crypto/multiKey.mjs.map +1 -1
  271. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  272. package/dist/esm/core/crypto/poseidon.mjs.map +1 -1
  273. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  274. package/dist/esm/core/crypto/privateKey.mjs.map +1 -1
  275. package/dist/esm/core/crypto/proof.mjs +1 -1
  276. package/dist/esm/core/crypto/proof.mjs.map +1 -1
  277. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  278. package/dist/esm/core/crypto/publicKey.mjs.map +1 -1
  279. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  280. package/dist/esm/core/crypto/secp256k1.mjs.map +1 -1
  281. package/dist/esm/core/crypto/secp256r1.mjs +1 -1
  282. package/dist/esm/core/crypto/secp256r1.mjs.map +1 -1
  283. package/dist/esm/core/crypto/signature.mjs +1 -1
  284. package/dist/esm/core/crypto/signature.mjs.map +1 -1
  285. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  286. package/dist/esm/core/crypto/singleKey.mjs.map +1 -1
  287. package/dist/esm/core/crypto/types.mjs +1 -0
  288. package/dist/esm/core/crypto/utils.mjs +1 -1
  289. package/dist/esm/core/crypto/utils.mjs.map +1 -1
  290. package/dist/esm/core/hex.mjs +1 -1
  291. package/dist/esm/core/hex.mjs.map +1 -1
  292. package/dist/esm/core/index.mjs +1 -1
  293. package/dist/esm/core/index.mjs.map +1 -1
  294. package/dist/esm/errors/index.mjs +1 -6
  295. package/dist/esm/errors/index.mjs.map +1 -1
  296. package/dist/esm/index.d.mts +1 -1
  297. package/dist/esm/index.mjs +1 -1
  298. package/dist/esm/index.mjs.map +1 -1
  299. package/dist/esm/internal/abstraction.mjs +1 -1
  300. package/dist/esm/internal/abstraction.mjs.map +1 -1
  301. package/dist/esm/internal/account.mjs +1 -1
  302. package/dist/esm/internal/account.mjs.map +1 -1
  303. package/dist/esm/internal/ans.mjs +1 -1
  304. package/dist/esm/internal/ans.mjs.map +1 -1
  305. package/dist/esm/internal/coin.mjs +1 -1
  306. package/dist/esm/internal/coin.mjs.map +1 -1
  307. package/dist/esm/internal/digitalAsset.mjs +1 -1
  308. package/dist/esm/internal/digitalAsset.mjs.map +1 -1
  309. package/dist/esm/internal/faucet.mjs +1 -1
  310. package/dist/esm/internal/faucet.mjs.map +1 -1
  311. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  312. package/dist/esm/internal/fungibleAsset.mjs.map +1 -1
  313. package/dist/esm/internal/general.mjs +1 -1
  314. package/dist/esm/internal/general.mjs.map +1 -1
  315. package/dist/esm/internal/keyless.mjs +1 -1
  316. package/dist/esm/internal/keyless.mjs.map +1 -1
  317. package/dist/esm/internal/object.mjs +1 -1
  318. package/dist/esm/internal/object.mjs.map +1 -1
  319. package/dist/esm/internal/staking.mjs +1 -1
  320. package/dist/esm/internal/staking.mjs.map +1 -1
  321. package/dist/esm/internal/table.mjs +1 -1
  322. package/dist/esm/internal/table.mjs.map +1 -1
  323. package/dist/esm/internal/transaction.mjs +1 -1
  324. package/dist/esm/internal/transaction.mjs.map +1 -1
  325. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  326. package/dist/esm/internal/transactionSubmission.mjs.map +1 -1
  327. package/dist/esm/internal/utils/index.mjs +1 -1
  328. package/dist/esm/internal/utils/index.mjs.map +1 -1
  329. package/dist/esm/internal/utils/utils.mjs +1 -1
  330. package/dist/esm/internal/utils/utils.mjs.map +1 -1
  331. package/dist/esm/internal/view.mjs +1 -1
  332. package/dist/esm/internal/view.mjs.map +1 -1
  333. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  334. package/dist/esm/transactions/authenticator/account.mjs.map +1 -1
  335. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  336. package/dist/esm/transactions/authenticator/index.mjs.map +1 -1
  337. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  338. package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -1
  339. package/dist/esm/transactions/index.mjs +1 -1
  340. package/dist/esm/transactions/index.mjs.map +1 -1
  341. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  342. package/dist/esm/transactions/instances/chainId.mjs.map +1 -1
  343. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  344. package/dist/esm/transactions/instances/identifier.mjs.map +1 -1
  345. package/dist/esm/transactions/instances/index.mjs +1 -1
  346. package/dist/esm/transactions/instances/index.mjs.map +1 -1
  347. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  348. package/dist/esm/transactions/instances/moduleId.mjs.map +1 -1
  349. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  350. package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +1 -1
  351. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  352. package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -1
  353. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  354. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -1
  355. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  356. package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -1
  357. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  358. package/dist/esm/transactions/instances/simpleTransaction.mjs.map +1 -1
  359. package/dist/esm/transactions/instances/transactionArgument.mjs +1 -0
  360. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  361. package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -1
  362. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  363. package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -1
  364. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  365. package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -1
  366. package/dist/esm/transactions/management/index.mjs +1 -1
  367. package/dist/esm/transactions/management/index.mjs.map +1 -1
  368. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  369. package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -1
  370. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  371. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -1
  372. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  373. package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -1
  374. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  375. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -1
  376. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  377. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -1
  378. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
  379. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  380. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -1
  381. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  382. package/dist/esm/transactions/typeTag/index.mjs.map +1 -1
  383. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  384. package/dist/esm/transactions/typeTag/parser.mjs.map +1 -1
  385. package/dist/esm/transactions/types.mjs +1 -0
  386. package/dist/esm/types/abstraction.mjs +1 -1
  387. package/dist/esm/types/abstraction.mjs.map +1 -1
  388. package/dist/esm/types/generated/queries.mjs +1 -493
  389. package/dist/esm/types/generated/queries.mjs.map +1 -1
  390. package/dist/esm/types/generated/types.mjs +1 -1
  391. package/dist/esm/types/generated/types.mjs.map +1 -1
  392. package/dist/esm/types/index.mjs +1 -1
  393. package/dist/esm/types/index.mjs.map +1 -1
  394. package/dist/esm/types/indexer.mjs +1 -0
  395. package/dist/esm/types/types.mjs +1 -1
  396. package/dist/esm/types/types.mjs.map +1 -1
  397. package/dist/esm/utils/apiEndpoints.d.mts +1 -0
  398. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  399. package/dist/esm/utils/apiEndpoints.mjs.map +1 -1
  400. package/dist/esm/utils/const.mjs +1 -1
  401. package/dist/esm/utils/const.mjs.map +1 -1
  402. package/dist/esm/utils/helpers.mjs +1 -1
  403. package/dist/esm/utils/helpers.mjs.map +1 -1
  404. package/dist/esm/utils/index.mjs +1 -1
  405. package/dist/esm/utils/index.mjs.map +1 -1
  406. package/dist/esm/utils/memoize.mjs +1 -1
  407. package/dist/esm/utils/memoize.mjs.map +1 -1
  408. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  409. package/dist/esm/utils/normalizeBundle.mjs.map +1 -1
  410. package/dist/esm/version.d.mts +1 -1
  411. package/dist/esm/version.mjs +1 -1
  412. package/dist/esm/version.mjs.map +1 -1
  413. package/package.json +1 -22
  414. package/src/api/aptos.ts +51 -193
  415. package/src/cli/localNode.ts +13 -2
  416. package/src/internal/ans.ts +1 -0
  417. package/src/utils/apiEndpoints.ts +9 -2
  418. package/src/version.ts +1 -1
  419. package/dist/common/chunk-AWFAHZSB.js +0 -4
  420. package/dist/common/chunk-AWFAHZSB.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{Serializable as w}from"../../bcs/serializer";import{EntryFunctionBytes as k}from"../../bcs/serializable/entryFunctionBytes";import{Bool as $,U128 as O,U16 as H,U256 as L,U32 as j,U64 as g,U8 as v}from"../../bcs/serializable/movePrimitives";import{MoveVector as q,Serialized as G}from"../../bcs/serializable/moveStructs";import{AccountAddress as A}from"../../core";import{Identifier as P}from"./identifier";import{ModuleId as _}from"./moduleId";import{ScriptTransactionArgumentVariants as a,TransactionExecutableVariants as o,TransactionExtraConfigVariants as D,TransactionInnerPayloadVariants as M,TransactionPayloadVariants as s}from"../../types";import{TypeTag as V}from"../typeTag";function J(i){const e=i.deserializeUleb128AsU32();switch(e){case a.U8:return v.deserialize(i);case a.U64:return g.deserialize(i);case a.U128:return O.deserialize(i);case a.Address:return A.deserialize(i);case a.U8Vector:return q.deserialize(i,v);case a.Bool:return $.deserialize(i);case a.U16:return H.deserialize(i);case a.U32:return j.deserialize(i);case a.U256:return L.deserialize(i);case a.Serialized:return G.deserialize(i);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}class y extends w{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case s.Script:return m.load(e);case s.EntryFunction:return x.load(e);case s.Multisig:return b.load(e);case s.Payload:return I.deserialize(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}}class m extends y{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(s.Script),this.script.serialize(e)}static load(e){const t=z.deserialize(e);return new m(t)}}class x extends y{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(s.EntryFunction),this.entryFunction.serialize(e)}static load(e){const t=c.deserialize(e);return new x(t)}}class b extends y{constructor(e){super(),this.multiSig=e}serialize(e){e.serializeU32AsUleb128(s.Multisig),this.multiSig.serialize(e)}static load(e){const t=U.deserialize(e);return new b(t)}}class c{constructor(e,t,r,n){this.module_name=e,this.function_name=t,this.type_args=r,this.args=n}static build(e,t,r,n){return new c(_.fromStr(e),new P(t),r,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){const t=_.deserialize(e),r=P.deserialize(e),n=e.deserializeVector(V),u=e.deserializeUleb128AsU32(),l=new Array;for(let d=0;d<u;d+=1){const C=e.deserializeUleb128AsU32(),N=k.deserialize(e,C);l.push(N)}return new c(t,r,n,l)}}class z{constructor(e,t,r){this.bytecode=e,this.type_args=t,this.args=r}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){const t=e.deserializeBytes(),r=e.deserializeVector(V),n=e.deserializeUleb128AsU32(),u=new Array;for(let l=0;l<n;l+=1){const d=J(e);u.push(d)}return new z(t,r,u)}}class U{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){const t=A.deserialize(e),r=e.deserializeBool();let n;return r&&(n=h.deserialize(e)),new U(t,n)}}class h extends w{constructor(e){super(),this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new h(c.deserialize(e))}}class I extends y{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case M.V1:return f.load(e);default:throw new Error(`Unknown variant index for TransactionInnerPayload: ${t}`)}}}class f extends I{constructor(e,t){super(),this.executable=e,this.extra_config=t}serialize(e){e.serializeU32AsUleb128(s.Payload),e.serializeU32AsUleb128(M.V1),this.executable.serialize(e),this.extra_config.serialize(e)}static load(e){let t=p.deserialize(e),r=B.deserialize(e);return new f(t,r)}}class p{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case o.Script:return S.load(e);case o.EntryFunction:return T.load(e);case o.Empty:return E.load(e);default:throw new Error(`Unknown variant index for TransactionExecutable: ${t}`)}}}class S extends p{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(o.Script),this.script.serialize(e)}static load(e){let t=z.deserialize(e);return new S(t)}}class T extends p{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(o.EntryFunction),this.entryFunction.serialize(e)}static load(e){let t=c.deserialize(e);return new T(t)}}class E extends p{serialize(e){e.serializeU32AsUleb128(o.Empty)}static load(e){return new E}}class B{static deserialize(e){const t=e.deserializeUleb128AsU32();switch(t){case D.V1:return F.load(e);default:throw new Error(`Unknown variant index for TransactionExtraConfig: ${t}`)}}}class F extends B{constructor(e,t){super(),this.multisigAddress=e,this.replayProtectionNonce=t!==void 0?BigInt(t):void 0}serialize(e){e.serializeU32AsUleb128(D.V1),e.serializeOption(this.multisigAddress),e.serializeOption(this.replayProtectionNonce!==void 0?new g(this.replayProtectionNonce):void 0)}static load(e){const t=e.deserializeOption(A),r=e.deserializeOption(g);return new F(t,r?.value)}}export{c as EntryFunction,U as MultiSig,h as MultiSigTransactionPayload,z as Script,p as TransactionExecutable,E as TransactionExecutableEmpty,T as TransactionExecutableEntryFunction,S as TransactionExecutableScript,B as TransactionExtraConfig,F as TransactionExtraConfigV1,I as TransactionInnerPayload,f as TransactionInnerPayloadV1,y as TransactionPayload,x as TransactionPayloadEntryFunction,b as TransactionPayloadMultiSig,m as TransactionPayloadScript,J as deserializeFromScriptArgument};
1
+ import{Aa as f,Ba as g,Ca as h,Da as i,Ea as j,Fa as k,Ga as l,Ha as m,Ia as n,Ja as o,Ka as p,La as q,va as a,wa as b,xa as c,ya as d,za as e}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{f as EntryFunction,h as MultiSig,i as MultiSigTransactionPayload,g as Script,l as TransactionExecutable,o as TransactionExecutableEmpty,n as TransactionExecutableEntryFunction,m as TransactionExecutableScript,p as TransactionExtraConfig,q as TransactionExtraConfigV1,j as TransactionInnerPayload,k as TransactionInnerPayloadV1,b as TransactionPayload,d as TransactionPayloadEntryFunction,e as TransactionPayloadMultiSig,c as TransactionPayloadScript,a as deserializeFromScriptArgument};
2
2
  //# sourceMappingURL=transactionPayload.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/instances/transactionPayload.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { EntryFunctionBytes } from \"../../bcs/serializable/entryFunctionBytes\";\nimport { Bool, U128, U16, U256, U32, U64, U8 } from \"../../bcs/serializable/movePrimitives\";\nimport { MoveVector, Serialized } from \"../../bcs/serializable/moveStructs\";\nimport { AccountAddress, Hex } from \"../../core\";\nimport { Identifier } from \"./identifier\";\nimport { ModuleId } from \"./moduleId\";\nimport type { EntryFunctionArgument, ScriptFunctionArgument, TransactionArgument } from \"./transactionArgument\";\nimport {\n AnyNumber,\n MoveModuleId,\n ScriptTransactionArgumentVariants,\n TransactionExecutableVariants,\n TransactionExtraConfigVariants,\n TransactionInnerPayloadVariants,\n TransactionPayloadVariants,\n} from \"../../types\";\nimport { TypeTag } from \"../typeTag\";\n\n/**\n * Deserialize a Script Transaction Argument.\n * This function retrieves and deserializes various types of script transaction arguments based on the provided deserializer.\n *\n * @param deserializer - The deserializer used to read the script transaction argument.\n * @returns The deserialized script transaction argument.\n * @throws Error if the variant index is unknown.\n * @group Implementation\n * @category Transactions\n */\nexport function deserializeFromScriptArgument(deserializer: Deserializer): TransactionArgument {\n // index enum variant\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case ScriptTransactionArgumentVariants.U8:\n return U8.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.U64:\n return U64.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.U128:\n return U128.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.Address:\n return AccountAddress.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.U8Vector:\n return MoveVector.deserialize(deserializer, U8);\n case ScriptTransactionArgumentVariants.Bool:\n return Bool.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.U16:\n return U16.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.U32:\n return U32.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.U256:\n return U256.deserialize(deserializer);\n case ScriptTransactionArgumentVariants.Serialized:\n return Serialized.deserialize(deserializer);\n default:\n throw new Error(`Unknown variant index for ScriptTransactionArgument: ${index}`);\n }\n}\n\n/**\n * Represents a supported Transaction Payload that can be serialized and deserialized.\n *\n * This class serves as a base for different types of transaction payloads, allowing for\n * their serialization into a format suitable for transmission and deserialization back\n * into their original form.\n * @group Implementation\n * @category Transactions\n */\nexport abstract class TransactionPayload extends Serializable {\n /**\n * Serialize a Transaction Payload\n * @group Implementation\n * @category Transactions\n */\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserialize a Transaction Payload\n * @group Implementation\n * @category Transactions\n */\n\n /**\n * Deserializes a multisig transaction payload from the provided deserializer.\n * This function enables the reconstruction of a MultiSigTransactionPayload object from its serialized form.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Transactions\n */\n static deserialize(deserializer: Deserializer): TransactionPayload {\n // index enum variant\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TransactionPayloadVariants.Script:\n return TransactionPayloadScript.load(deserializer);\n case TransactionPayloadVariants.EntryFunction:\n return TransactionPayloadEntryFunction.load(deserializer);\n case TransactionPayloadVariants.Multisig:\n return TransactionPayloadMultiSig.load(deserializer);\n case TransactionPayloadVariants.Payload:\n return TransactionInnerPayload.deserialize(deserializer);\n default:\n throw new Error(`Unknown variant index for TransactionPayload: ${index}`);\n }\n }\n}\n\n/**\n * Represents a transaction payload script that can be serialized and deserialized.\n *\n * This class encapsulates a script that defines the logic for a transaction payload.\n *\n * @extends TransactionPayload\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionPayloadScript extends TransactionPayload {\n public readonly script: Script;\n\n /**\n * Initializes a multi-sig account transaction with the provided payload.\n *\n * @param script - The payload of the multi-sig transaction. This can only be an EntryFunction for now, but Script might be\n * supported in the future.\n * @group Implementation\n * @category Transactions\n */\n constructor(script: Script) {\n super();\n this.script = script;\n }\n\n /**\n * Serializes the transaction payload, enabling future support for multiple types of inner transaction payloads.\n *\n * @param serializer - The serializer instance used to serialize the transaction data.\n * @group Implementation\n * @category Transactions\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionPayloadVariants.Script);\n this.script.serialize(serializer);\n }\n\n /**\n * Loads a MultiSig transaction payload from the provided deserializer.\n * This function helps in reconstructing a MultiSig transaction payload from its serialized form.\n *\n * @param deserializer - The deserializer used to read the serialized data.\n * @group Implementation\n * @category Transactions\n */\n static load(deserializer: Deserializer): TransactionPayloadScript {\n const script = Script.deserialize(deserializer);\n return new TransactionPayloadScript(script);\n }\n}\n\n/**\n * Represents a transaction payload entry function that can be serialized and deserialized.\n *\n * @extends TransactionPayload\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionPayloadEntryFunction extends TransactionPayload {\n public readonly entryFunction: EntryFunction;\n\n constructor(entryFunction: EntryFunction) {\n super();\n this.entryFunction = entryFunction;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionPayloadVariants.EntryFunction);\n this.entryFunction.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionPayloadEntryFunction {\n const entryFunction = EntryFunction.deserialize(deserializer);\n return new TransactionPayloadEntryFunction(entryFunction);\n }\n}\n\n/**\n * Represents a multi-signature transaction payload that can be serialized and deserialized.\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionPayloadMultiSig extends TransactionPayload {\n public readonly multiSig: MultiSig;\n\n constructor(multiSig: MultiSig) {\n super();\n this.multiSig = multiSig;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionPayloadVariants.Multisig);\n this.multiSig.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionPayloadMultiSig {\n const value = MultiSig.deserialize(deserializer);\n return new TransactionPayloadMultiSig(value);\n }\n}\n\n/**\n * Represents an entry function that can be serialized and deserialized.\n * This class encapsulates the details required to invoke a function within a module,\n * including the module name, function name, type arguments, and function arguments.\n *\n * @param module_name - Fully qualified module name in the format \"account_address::module_name\" (e.g., \"0x1::coin\").\n * @param function_name - The name of the function (e.g., \"transfer\").\n * @param type_args - Type arguments required by the Move function.\n * @param args - Arguments to the Move function.\n * @group Implementation\n * @category Transactions\n */\nexport class EntryFunction {\n public readonly module_name: ModuleId;\n\n public readonly function_name: Identifier;\n\n public readonly type_args: Array<TypeTag>;\n\n public readonly args: Array<EntryFunctionArgument>;\n\n /**\n * Contains the payload to run a function within a module.\n * @param module_name Fully qualified module name in format \"account_address::module_name\" e.g. \"0x1::coin\"\n * @param function_name The function name. e.g \"transfer\"\n * @param type_args Type arguments that move function requires.\n *\n * @example\n * A coin transfer function has one type argument \"CoinType\".\n * ```\n * public entry fun transfer<CoinType>(from: &signer, to: address, amount: u64)\n * ```\n * @param args arguments to the move function.\n *\n * @example\n * A coin transfer function has three arguments \"from\", \"to\" and \"amount\".\n * ```\n * public entry fun transfer<CoinType>(from: &signer, to: address, amount: u64)\n * ```\n * @group Implementation\n * @category Transactions\n */\n constructor(\n module_name: ModuleId,\n function_name: Identifier,\n type_args: Array<TypeTag>,\n args: Array<EntryFunctionArgument>,\n ) {\n this.module_name = module_name;\n this.function_name = function_name;\n this.type_args = type_args;\n this.args = args;\n }\n\n /**\n * Build an EntryFunction payload from raw primitive values.\n *\n * @param module_id - Fully qualified module name in the format \"AccountAddress::module_id\", e.g., \"0x1::coin\".\n * @param function_name - The name of the function to be called.\n * @param type_args - Type arguments that the Move function requires.\n * @param args - Arguments to the Move function.\n *\n * @example\n * A coin transfer function has one type argument \"CoinType\".\n * ```\n * public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64)\n * ```\n *\n * A coin transfer function has three arguments \"from\", \"to\", and \"amount\".\n * ```\n * public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64)\n * ```\n *\n * @returns EntryFunction\n * @group Implementation\n * @category Transactions\n */\n static build(\n module_id: MoveModuleId,\n function_name: string,\n type_args: Array<TypeTag>,\n args: Array<EntryFunctionArgument>,\n ): EntryFunction {\n return new EntryFunction(ModuleId.fromStr(module_id), new Identifier(function_name), type_args, args);\n }\n\n serialize(serializer: Serializer): void {\n this.module_name.serialize(serializer);\n this.function_name.serialize(serializer);\n serializer.serializeVector<TypeTag>(this.type_args);\n serializer.serializeU32AsUleb128(this.args.length);\n this.args.forEach((item: EntryFunctionArgument) => {\n item.serializeForEntryFunction(serializer);\n });\n }\n\n /**\n * Deserializes an entry function payload with the arguments represented as EntryFunctionBytes instances.\n * @see EntryFunctionBytes\n *\n * NOTE: When you deserialize an EntryFunction payload with this method, the entry function\n * arguments are populated into the deserialized instance as type-agnostic, raw fixed bytes\n * in the form of the EntryFunctionBytes class.\n *\n * In order to correctly deserialize these arguments as their actual type representations, you\n * must know the types of the arguments beforehand and deserialize them yourself individually.\n *\n * One way you could achieve this is by using the ABIs for an entry function and deserializing each\n * argument as its given, corresponding type.\n *\n * @param deserializer\n * @returns A deserialized EntryFunction payload for a transaction.\n *\n * @group Implementation\n * @category Transactions\n */\n static deserialize(deserializer: Deserializer): EntryFunction {\n const module_name = ModuleId.deserialize(deserializer);\n const function_name = Identifier.deserialize(deserializer);\n const type_args = deserializer.deserializeVector(TypeTag);\n\n const length = deserializer.deserializeUleb128AsU32();\n const args: Array<EntryFunctionArgument> = new Array<EntryFunctionBytes>();\n\n for (let i = 0; i < length; i += 1) {\n const fixedBytesLength = deserializer.deserializeUleb128AsU32();\n const fixedBytes = EntryFunctionBytes.deserialize(deserializer, fixedBytesLength);\n args.push(fixedBytes);\n }\n\n return new EntryFunction(module_name, function_name, type_args, args);\n }\n}\n\n/**\n * Represents a Script that can be serialized and deserialized.\n * Scripts contain the Move bytecode payload that can be submitted to the Aptos chain for execution.\n * @group Implementation\n * @category Transactions\n */\nexport class Script {\n /**\n * The move module bytecode\n * @group Implementation\n * @category Transactions\n */\n public readonly bytecode: Uint8Array;\n\n /**\n * The type arguments that the bytecode function requires.\n * @group Implementation\n * @category Transactions\n */\n public readonly type_args: Array<TypeTag>;\n\n /**\n * The arguments that the bytecode function requires.\n * @group Implementation\n * @category Transactions\n */\n public readonly args: Array<ScriptFunctionArgument>;\n\n /**\n * Scripts contain the Move bytecodes payload that can be submitted to Aptos chain for execution.\n *\n * @param bytecode The move module bytecode\n * @param type_args The type arguments that the bytecode function requires.\n *\n * @example\n * A coin transfer function has one type argument \"CoinType\".\n * ```\n * public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64)\n * ```\n * @param args The arguments that the bytecode function requires.\n *\n * @example\n * A coin transfer function has three arguments \"from\", \"to\" and \"amount\".\n * ```\n * public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64)\n * ```\n * @group Implementation\n * @category Transactions\n */\n constructor(bytecode: Uint8Array, type_args: Array<TypeTag>, args: Array<ScriptFunctionArgument>) {\n this.bytecode = bytecode;\n this.type_args = type_args;\n this.args = args;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.bytecode);\n serializer.serializeVector<TypeTag>(this.type_args);\n serializer.serializeU32AsUleb128(this.args.length);\n this.args.forEach((item: ScriptFunctionArgument) => {\n item.serializeForScriptFunction(serializer);\n });\n }\n\n static deserialize(deserializer: Deserializer): Script {\n const bytecode = deserializer.deserializeBytes();\n const type_args = deserializer.deserializeVector(TypeTag);\n const length = deserializer.deserializeUleb128AsU32();\n const args = new Array<ScriptFunctionArgument>();\n for (let i = 0; i < length; i += 1) {\n // Note that we deserialize directly to the Move value, not its Script argument representation.\n // We are abstracting away the Script argument representation because knowing about it is\n // functionally useless.\n const scriptArgument = deserializeFromScriptArgument(deserializer);\n args.push(scriptArgument);\n }\n return new Script(bytecode, type_args, args);\n }\n}\n\n/**\n * Represents a MultiSig account that can be serialized and deserialized.\n *\n * This class encapsulates the functionality to manage multi-signature transactions, including the address of the\n * multi-sig account and the associated transaction payload.\n * @group Implementation\n * @category Transactions\n */\nexport class MultiSig {\n public readonly multisig_address: AccountAddress;\n\n public readonly transaction_payload?: MultiSigTransactionPayload;\n\n /**\n * Contains the payload to run a multi-sig account transaction.\n *\n * @param multisig_address The multi-sig account address the transaction will be executed as.\n *\n * @param transaction_payload The payload of the multi-sig transaction. This is optional when executing a multi-sig\n * transaction whose payload is already stored on chain.\n * @group Implementation\n * @category Transactions\n */\n constructor(multisig_address: AccountAddress, transaction_payload?: MultiSigTransactionPayload) {\n this.multisig_address = multisig_address;\n this.transaction_payload = transaction_payload;\n }\n\n serialize(serializer: Serializer): void {\n this.multisig_address.serialize(serializer);\n // Options are encoded with an extra u8 field before the value - 0x0 is none and 0x1 is present.\n // We use serializeBool below to create this prefix value.\n if (this.transaction_payload === undefined) {\n serializer.serializeBool(false);\n } else {\n serializer.serializeBool(true);\n this.transaction_payload.serialize(serializer);\n }\n }\n\n static deserialize(deserializer: Deserializer): MultiSig {\n const multisig_address = AccountAddress.deserialize(deserializer);\n const payloadPresent = deserializer.deserializeBool();\n let transaction_payload;\n if (payloadPresent) {\n transaction_payload = MultiSigTransactionPayload.deserialize(deserializer);\n }\n return new MultiSig(multisig_address, transaction_payload);\n }\n}\n\n/**\n * Represents a multi-signature transaction payload that can be serialized and deserialized.\n * This class is designed to encapsulate the transaction payload for multi-sig account transactions\n * as defined in the `multisig_account.move` module. Future enhancements may allow support for script\n * payloads as the `multisig_account.move` module evolves.\n * @group Implementation\n * @category Transactions\n */\nexport class MultiSigTransactionPayload extends Serializable {\n public readonly transaction_payload: EntryFunction;\n\n /**\n * Contains the payload to run a multi-sig account transaction.\n *\n * @param transaction_payload The payload of the multi-sig transaction.\n * This can only be EntryFunction for now but,\n * Script might be supported in the future.\n * @group Implementation\n * @category Transactions\n */\n constructor(transaction_payload: EntryFunction) {\n super();\n this.transaction_payload = transaction_payload;\n }\n\n serialize(serializer: Serializer): void {\n /**\n * We can support multiple types of inner transaction payload in the future.\n * For now, it's only EntryFunction but if we support more types,\n * we need to serialize with the right enum values here\n * @group Implementation\n * @category Transactions\n */\n serializer.serializeU32AsUleb128(0);\n this.transaction_payload.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): MultiSigTransactionPayload {\n // TODO: Support other types of payload beside EntryFunction.\n // This is the enum value indicating which type of payload the multisig tx contains.\n deserializer.deserializeUleb128AsU32();\n return new MultiSigTransactionPayload(EntryFunction.deserialize(deserializer));\n }\n}\n\n/**\n * Represents any transaction payload that can be submitted to the Aptos chain for execution.\n *\n * This is specifically required for orderless transactions, but can be used for any transaction payload.\n */\nexport abstract class TransactionInnerPayload extends TransactionPayload {\n abstract serialize(serializer: Serializer): void;\n\n static deserialize(deserializer: Deserializer): TransactionInnerPayload {\n // index enum variant\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TransactionInnerPayloadVariants.V1:\n return TransactionInnerPayloadV1.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TransactionInnerPayload: ${index}`);\n }\n }\n}\n\nexport class TransactionInnerPayloadV1 extends TransactionInnerPayload {\n executable: TransactionExecutable;\n extra_config: TransactionExtraConfig;\n\n constructor(executable: TransactionExecutable, extra_config: TransactionExtraConfig) {\n super();\n this.executable = executable;\n this.extra_config = extra_config;\n }\n\n serialize(serializer: Serializer): void {\n // This payload must be serialized as a top level TransactionPayload, so we add that here\n serializer.serializeU32AsUleb128(TransactionPayloadVariants.Payload);\n // V1 is serialized as 0\n serializer.serializeU32AsUleb128(TransactionInnerPayloadVariants.V1);\n this.executable.serialize(serializer);\n this.extra_config.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionInnerPayloadV1 {\n let executable = TransactionExecutable.deserialize(deserializer);\n let extra_config = TransactionExtraConfig.deserialize(deserializer);\n return new TransactionInnerPayloadV1(executable, extra_config);\n }\n}\n\nexport abstract class TransactionExecutable {\n abstract serialize(serializer: Serializer): void;\n\n static deserialize(deserializer: Deserializer): TransactionExecutable {\n // index enum variant\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TransactionExecutableVariants.Script:\n return TransactionExecutableScript.load(deserializer);\n case TransactionExecutableVariants.EntryFunction:\n return TransactionExecutableEntryFunction.load(deserializer);\n case TransactionExecutableVariants.Empty:\n return TransactionExecutableEmpty.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TransactionExecutable: ${index}`);\n }\n }\n}\n\nexport class TransactionExecutableScript extends TransactionExecutable {\n script: Script;\n\n constructor(script: Script) {\n super();\n this.script = script;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionExecutableVariants.Script);\n this.script.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionExecutableScript {\n let script = Script.deserialize(deserializer);\n return new TransactionExecutableScript(script);\n }\n}\n\nexport class TransactionExecutableEntryFunction extends TransactionExecutable {\n entryFunction: EntryFunction;\n\n constructor(entryFunction: EntryFunction) {\n super();\n this.entryFunction = entryFunction;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionExecutableVariants.EntryFunction);\n this.entryFunction.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionExecutableEntryFunction {\n let entryFunction = EntryFunction.deserialize(deserializer);\n return new TransactionExecutableEntryFunction(entryFunction);\n }\n}\n\nexport class TransactionExecutableEmpty extends TransactionExecutable {\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionExecutableVariants.Empty);\n }\n\n static load(_: Deserializer): TransactionExecutableEmpty {\n return new TransactionExecutableEmpty();\n }\n}\n\nexport abstract class TransactionExtraConfig {\n abstract serialize(serializer: Serializer): void;\n\n static deserialize(deserializer: Deserializer): TransactionExtraConfig {\n // index enum variant\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TransactionExtraConfigVariants.V1:\n return TransactionExtraConfigV1.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TransactionExtraConfig: ${index}`);\n }\n }\n}\n\nexport class TransactionExtraConfigV1 extends TransactionExtraConfig {\n multisigAddress?: AccountAddress;\n replayProtectionNonce?: bigint;\n\n constructor(multisigAddress?: AccountAddress, replayProtectionNonce?: AnyNumber) {\n super();\n this.multisigAddress = multisigAddress;\n this.replayProtectionNonce = replayProtectionNonce !== undefined ? BigInt(replayProtectionNonce) : undefined;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionExtraConfigVariants.V1);\n serializer.serializeOption<AccountAddress>(this.multisigAddress);\n serializer.serializeOption<U64>(\n this.replayProtectionNonce !== undefined ? new U64(this.replayProtectionNonce) : undefined,\n );\n }\n\n static load(deserializer: Deserializer): TransactionExtraConfigV1 {\n const multisigAddress = deserializer.deserializeOption(AccountAddress);\n const replayProtectionNonce = deserializer.deserializeOption(U64);\n return new TransactionExtraConfigV1(multisigAddress, replayProtectionNonce?.value);\n }\n}\n"],"mappings":"AAMA,OAAS,gBAAAA,MAAgC,uBACzC,OAAS,sBAAAC,MAA0B,4CACnC,OAAS,QAAAC,EAAM,QAAAC,EAAM,OAAAC,EAAK,QAAAC,EAAM,OAAAC,EAAK,OAAAC,EAAK,MAAAC,MAAU,wCACpD,OAAS,cAAAC,EAAY,cAAAC,MAAkB,qCACvC,OAAS,kBAAAC,MAA2B,aACpC,OAAS,cAAAC,MAAkB,eAC3B,OAAS,YAAAC,MAAgB,aAEzB,OAGE,qCAAAC,EACA,iCAAAC,EACA,kCAAAC,EACA,mCAAAC,EACA,8BAAAC,MACK,cACP,OAAS,WAAAC,MAAe,aAYjB,SAASC,EAA8BC,EAAiD,CAE7F,MAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,KAAKR,EAAkC,GACrC,OAAON,EAAG,YAAYa,CAAY,EACpC,KAAKP,EAAkC,IACrC,OAAOP,EAAI,YAAYc,CAAY,EACrC,KAAKP,EAAkC,KACr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CAChF,CACF,CACF,CAEO,MAAMuC,UAAiCL,CAAuB,CAInE,YAAYM,EAAkCC,EAAmC,CAC/E,MAAM,EACN,KAAK,gBAAkBD,EACvB,KAAK,sBAAwBC,IAA0B,OAAY,OAAOA,CAAqB,EAAI,MACrG,CAEA,UAAUlC,EAA8B,CACtCA,EAAW,sBAAsBb,EAA+B,EAAE,EAClEa,EAAW,gBAAgC,KAAK,eAAe,EAC/DA,EAAW,gBACT,KAAK,wBAA0B,OAAY,IAAItB,EAAI,KAAK,qBAAqB,EAAI,MACnF,CACF,CAEA,OAAO,KAAKc,EAAsD,CAChE,MAAMyC,EAAkBzC,EAAa,kBAAkBV,CAAc,EAC/DoD,EAAwB1C,EAAa,kBAAkBd,CAAG,EAChE,OAAO,IAAIsD,EAAyBC,EAAiBC,GAAuB,KAAK,CACnF,CACF","names":["Serializable","EntryFunctionBytes","Bool","U128","U16","U256","U32","U64","U8","MoveVector","Serialized","AccountAddress","Identifier","ModuleId","ScriptTransactionArgumentVariants","TransactionExecutableVariants","TransactionExtraConfigVariants","TransactionInnerPayloadVariants","TransactionPayloadVariants","TypeTag","deserializeFromScriptArgument","deserializer","index","TransactionPayload","TransactionPayloadScript","TransactionPayloadEntryFunction","TransactionPayloadMultiSig","TransactionInnerPayload","script","serializer","Script","entryFunction","EntryFunction","multiSig","value","MultiSig","module_name","function_name","type_args","args","module_id","item","length","i","fixedBytesLength","fixedBytes","bytecode","scriptArgument","multisig_address","transaction_payload","payloadPresent","MultiSigTransactionPayload","TransactionInnerPayloadV1","executable","extra_config","TransactionExecutable","TransactionExtraConfig","TransactionExecutableScript","TransactionExecutableEntryFunction","TransactionExecutableEmpty","_","TransactionExtraConfigV1","multisigAddress","replayProtectionNonce"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{getInfo as s}from"../../internal/account";import{nowInSeconds as e,sleep as n}from"../../utils/helpers";class g{constructor(t,i,r,o,a){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=r,this.maximumInFlight=o,this.sleepTime=a}async nextSequenceNumber(){for(;this.lock;)await n(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();const i=e();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await n(this.sleepTime),e()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){const{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){const{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await n(this.sleepTime);this.lock=!0;try{await this.update();const t=e();for(;this.lastUncommintedNumber!==this.currentNumber;)e()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await n(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}}export{g as AccountSequenceNumber};
1
+ import{fe as a}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as AccountSequenceNumber};
2
2
  //# sourceMappingURL=accountSequenceNumber.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/management/accountSequenceNumber.ts"],"sourcesContent":["/**\n * A wrapper that handles and manages an account sequence number.\n *\n * Submit up to `maximumInFlight` transactions per account in parallel with a timeout of `sleepTime`\n * If local assumes `maximumInFlight` are in flight, determine the actual committed state from the network\n * If there are less than `maximumInFlight` due to some being committed, adjust the window\n * If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating\n * If ever waiting more than `maxWaitTime` restart the sequence number to the current on-chain state\n *\n * Assumptions:\n * Accounts are expected to be managed by a single AccountSequenceNumber and not used otherwise.\n * They are initialized to the current on-chain state, so if there are already transactions in\n * flight, they may take some time to reset.\n * Accounts are automatically initialized if not explicitly\n *\n * Notes:\n * This is co-routine safe, that is many async tasks can be reading from this concurrently.\n * The state of an account cannot be used across multiple AccountSequenceNumber services.\n * The synchronize method will create a barrier that prevents additional nextSequenceNumber\n * calls until it is complete.\n * This only manages the distribution of sequence numbers it does not help handle transaction\n * failures.\n * If a transaction fails, you should call synchronize and wait for timeouts.\n * @group Implementation\n * @category Transactions\n */\n\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { Account } from \"../../account\";\nimport { getInfo } from \"../../internal/account\";\nimport { nowInSeconds, sleep } from \"../../utils/helpers\";\n\n/**\n * Represents an account's sequence number management for transaction handling on the Aptos blockchain.\n * This class provides methods to retrieve the next available sequence number, synchronize with the on-chain sequence number,\n * and manage local sequence numbers while ensuring thread safety.\n *\n * @param aptosConfig - The configuration settings for Aptos.\n * @param account - The account associated with the sequence number.\n * @param maxWaitTime - The maximum time to wait for a transaction to commit.\n * @param maximumInFlight - The maximum number of transactions that can be in flight at once.\n * @param sleepTime - The time to wait before retrying to get the sequence number.\n * @group Implementation\n * @category Transactions\n */\nexport class AccountSequenceNumber {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // sequence number on chain\n // TODO: Change to Uncommitted\n lastUncommintedNumber: bigint | null = null;\n\n // local sequence number\n currentNumber: bigint | null = null;\n\n /**\n * We want to guarantee that we preserve ordering of workers to requests.\n *\n * `lock` is used to try to prevent multiple coroutines from accessing a shared resource at the same time,\n * which can result in race conditions and data inconsistency.\n * This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.\n *\n * The ideal solution is likely that each thread grabs the next number from an incremental integer.\n * When they complete, they increment that number and that entity is able to enter the `lock`.\n * That would guarantee ordering.\n * @group Implementation\n * @category Transactions\n */\n lock = false;\n\n maxWaitTime: number;\n\n maximumInFlight: number;\n\n sleepTime: number;\n\n /**\n * Creates an instance of the class with the specified configuration and account details.\n * This constructor initializes the necessary parameters for managing Aptos transactions.\n *\n * @param aptosConfig - The configuration settings for Aptos.\n * @param account - The account associated with the Aptos transactions.\n * @param maxWaitTime - The maximum time to wait for a transaction to be processed, in milliseconds.\n * @param maximumInFlight - The maximum number of transactions that can be in flight at the same time.\n * @param sleepTime - The time to sleep between transaction checks, in milliseconds.\n * @group Implementation\n * @category Transactions\n */\n constructor(\n aptosConfig: AptosConfig,\n account: Account,\n maxWaitTime: number,\n maximumInFlight: number,\n sleepTime: number,\n ) {\n this.aptosConfig = aptosConfig;\n this.account = account;\n this.maxWaitTime = maxWaitTime;\n this.maximumInFlight = maximumInFlight;\n this.sleepTime = sleepTime;\n }\n\n /**\n * Returns the next available sequence number for this account.\n * This function ensures that the sequence number is updated and synchronized, handling potential delays in transaction commits.\n *\n * @returns {BigInt} The next available sequence number.\n * @group Implementation\n * @category Transactions\n */\n async nextSequenceNumber(): Promise<bigint | null> {\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n let nextNumber = BigInt(0);\n try {\n if (this.lastUncommintedNumber === null || this.currentNumber === null) {\n await this.initialize();\n }\n\n if (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await this.update();\n\n const startTime = nowInSeconds();\n while (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await sleep(this.sleepTime);\n if (nowInSeconds() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await this.update();\n }\n }\n }\n nextNumber = this.currentNumber!;\n this.currentNumber! += BigInt(1);\n } catch (e) {\n console.error(\"error in getting next sequence number for this account\", e);\n } finally {\n this.lock = false;\n }\n return nextNumber;\n }\n\n /**\n * Initializes this account with the sequence number on chain.\n *\n * @returns {Promise<void>} A promise that resolves when the account has been initialized.\n *\n * @throws {Error} Throws an error if the account information cannot be retrieved.\n * @group Implementation\n * @category Transactions\n */\n async initialize(): Promise<void> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.currentNumber = BigInt(sequenceNumber);\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n }\n\n /**\n * Updates this account's sequence number with the one on-chain.\n *\n * @returns The on-chain sequence number for this account.\n * @group Implementation\n * @category Transactions\n */\n async update(): Promise<bigint> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n return this.lastUncommintedNumber;\n }\n\n /**\n * Synchronizes the local sequence number with the sequence number on-chain for the specified account.\n * This function polls the network until all submitted transactions have either been committed or until the maximum wait time has elapsed.\n *\n * @throws {Error} Throws an error if there is an issue synchronizing the account sequence number with the one on-chain.\n * @group Implementation\n * @category Transactions\n */\n async synchronize(): Promise<void> {\n if (this.lastUncommintedNumber === this.currentNumber) return;\n\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n\n try {\n await this.update();\n const startTime = nowInSeconds();\n while (this.lastUncommintedNumber !== this.currentNumber) {\n if (nowInSeconds() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await sleep(this.sleepTime);\n await this.update();\n }\n }\n } catch (e) {\n console.error(\"error in synchronizing this account sequence number with the one on chain\", e);\n } finally {\n this.lock = false;\n }\n }\n}\n"],"mappings":"AA6BA,OAAS,WAAAA,MAAe,yBACxB,OAAS,gBAAAC,EAAc,SAAAC,MAAa,sBAe7B,MAAMC,CAAsB,CA6CjC,YACEC,EACAC,EACAC,EACAC,EACAC,EACA,CA5CF,2BAAuC,KAGvC,mBAA+B,KAe/B,UAAO,GA2BL,KAAK,YAAcJ,EACnB,KAAK,QAAUC,EACf,KAAK,YAAcC,EACnB,KAAK,gBAAkBC,EACvB,KAAK,UAAYC,CACnB,CAUA,MAAM,oBAA6C,CAEjD,KAAO,KAAK,MACV,MAAMN,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GACZ,IAAIO,EAAa,OAAO,CAAC,EACzB,GAAI,CAKF,IAJI,KAAK,wBAA0B,MAAQ,KAAK,gBAAkB,OAChE,MAAM,KAAK,WAAW,EAGpB,KAAK,cAAiB,KAAK,uBAA0B,KAAK,gBAAiB,CAC7E,MAAM,KAAK,OAAO,EAElB,MAAMC,EAAYT,EAAa,EAC/B,KAAO,KAAK,cAAiB,KAAK,uBAA0B,KAAK,iBAC/D,MAAMC,EAAM,KAAK,SAAS,EACtBD,EAAa,EAAIS,EAAY,KAAK,aAEpC,QAAQ,KACN,kEAAkE,KAAK,QAAQ,eAAe,SAAS,CAAC,EAC1G,EACA,MAAM,KAAK,WAAW,GAEtB,MAAM,KAAK,OAAO,CAGxB,CACAD,EAAa,KAAK,cAClB,KAAK,eAAkB,OAAO,CAAC,CACjC,OAASE,EAAG,CACV,QAAQ,MAAM,yDAA0DA,CAAC,CAC3E,QAAE,CACA,KAAK,KAAO,EACd,CACA,OAAOF,CACT,CAWA,MAAM,YAA4B,CAChC,KAAM,CAAE,gBAAiBG,CAAe,EAAI,MAAMZ,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,KAAK,cAAgB,OAAOY,CAAc,EAC1C,KAAK,sBAAwB,OAAOA,CAAc,CACpD,CASA,MAAM,QAA0B,CAC9B,KAAM,CAAE,gBAAiBA,CAAe,EAAI,MAAMZ,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,YAAK,sBAAwB,OAAOY,CAAc,EAC3C,KAAK,qBACd,CAUA,MAAM,aAA6B,CACjC,GAAI,KAAK,wBAA0B,KAAK,cAGxC,MAAO,KAAK,MACV,MAAMV,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GAEZ,GAAI,CACF,MAAM,KAAK,OAAO,EAClB,MAAMQ,EAAYT,EAAa,EAC/B,KAAO,KAAK,wBAA0B,KAAK,eACrCA,EAAa,EAAIS,EAAY,KAAK,aAEpC,QAAQ,KACN,kEAAkE,KAAK,QAAQ,eAAe,SAAS,CAAC,EAC1G,EACA,MAAM,KAAK,WAAW,IAEtB,MAAMR,EAAM,KAAK,SAAS,EAC1B,MAAM,KAAK,OAAO,EAGxB,OAASS,EAAG,CACV,QAAQ,MAAM,4EAA6EA,CAAC,CAC9F,QAAE,CACA,KAAK,KAAO,EACd,EACF,CACF","names":["getInfo","nowInSeconds","sleep","AccountSequenceNumber","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","nextNumber","startTime","e","sequenceNumber"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- class i{constructor(){this.queue=[];this.pendingDequeue=[];this.cancelled=!1}enqueue(e){if(this.cancelled=!1,this.pendingDequeue.length>0){this.pendingDequeue.shift()?.resolve(e);return}this.queue.push(e)}async dequeue(){return this.queue.length>0?Promise.resolve(this.queue.shift()):new Promise((e,n)=>{this.pendingDequeue.push({resolve:e,reject:n})})}isEmpty(){return this.queue.length===0}cancel(){this.cancelled=!0,this.pendingDequeue.forEach(async({reject:e})=>{e(new s("Task cancelled"))}),this.pendingDequeue=[],this.queue.length=0}isCancelled(){return this.cancelled}pendingDequeueLength(){return this.pendingDequeue.length}}class s extends Error{}export{i as AsyncQueue,s as AsyncQueueCancelledError};
1
+ import{a,b}from"../../chunk-A5L76YP7.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as AsyncQueue,b as AsyncQueueCancelledError};
2
2
  //# sourceMappingURL=asyncQueue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/management/asyncQueue.ts"],"sourcesContent":["/**\n * The AsyncQueue class is an async-aware data structure that provides a queue-like\n * behavior for managing asynchronous tasks or operations.\n * It allows to enqueue items and dequeue them asynchronously.\n * This is not thread-safe, but it is async concurrency safe, and\n * it does not guarantee ordering for those that call into and await on enqueue.\n * @group Implementation\n * @category Transactions\n */\n\ninterface PendingDequeue<T> {\n resolve: (value: T) => void;\n reject: (reason?: AsyncQueueCancelledError) => void;\n}\n\nexport class AsyncQueue<T> {\n readonly queue: T[] = [];\n\n // The pendingDequeue is used to handle the resolution of promises when items are enqueued and dequeued.\n private pendingDequeue: PendingDequeue<T>[] = [];\n\n private cancelled: boolean = false;\n\n /**\n * Adds an item to the queue. If there are pending dequeued promises, it resolves the oldest promise with the enqueued item\n * immediately; otherwise, it adds the item to the queue.\n *\n * @param item - The item to be added to the queue.\n * @group Implementation\n * @category Transactions\n */\n enqueue(item: T): void {\n this.cancelled = false;\n\n if (this.pendingDequeue.length > 0) {\n const promise = this.pendingDequeue.shift();\n\n promise?.resolve(item);\n\n return;\n }\n\n this.queue.push(item);\n }\n\n /**\n * Dequeues the next item from the queue and returns a promise that resolves to it.\n * If the queue is empty, it creates a new promise that will be resolved when an item is enqueued.\n *\n * @returns Promise<T>\n * @group Implementation\n * @category Transactions\n */\n async dequeue(): Promise<T> {\n if (this.queue.length > 0) {\n return Promise.resolve(this.queue.shift()!);\n }\n\n return new Promise<T>((resolve, reject) => {\n this.pendingDequeue.push({ resolve, reject });\n });\n }\n\n /**\n * Determine whether the queue is empty.\n *\n * @returns boolean - Returns true if the queue has no elements, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isEmpty(): boolean {\n return this.queue.length === 0;\n }\n\n /**\n * Cancels all pending promises in the queue and rejects them with an AsyncQueueCancelledError.\n * This ensures that any awaiting code can handle the cancellation appropriately.\n *\n * @returns {void}\n * @group Implementation\n * @category Transactions\n */\n cancel(): void {\n this.cancelled = true;\n\n this.pendingDequeue.forEach(async ({ reject }) => {\n reject(new AsyncQueueCancelledError(\"Task cancelled\"));\n });\n\n this.pendingDequeue = [];\n\n this.queue.length = 0;\n }\n\n /**\n * Determine whether the queue has been cancelled.\n *\n * @returns boolean - Returns true if the queue is cancelled, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isCancelled(): boolean {\n return this.cancelled;\n }\n\n /**\n * Retrieve the length of the pending dequeue.\n *\n * @returns number - The number of items currently in the pending dequeue.\n * @group Implementation\n * @category Transactions\n */\n pendingDequeueLength(): number {\n return this.pendingDequeue.length;\n }\n}\n\n/**\n * Represents an error that occurs when an asynchronous queue operation is cancelled.\n * This error extends the built-in Error class to provide additional context for cancellation events.\n *\n * @extends Error\n * @group Implementation\n * @category Transactions\n */\nexport class AsyncQueueCancelledError extends Error {}\n"],"mappings":"AAeO,MAAMA,CAAc,CAApB,cACL,KAAS,MAAa,CAAC,EAGvB,KAAQ,eAAsC,CAAC,EAE/C,KAAQ,UAAqB,GAU7B,QAAQC,EAAe,CAGrB,GAFA,KAAK,UAAY,GAEb,KAAK,eAAe,OAAS,EAAG,CAClB,KAAK,eAAe,MAAM,GAEjC,QAAQA,CAAI,EAErB,MACF,CAEA,KAAK,MAAM,KAAKA,CAAI,CACtB,CAUA,MAAM,SAAsB,CAC1B,OAAI,KAAK,MAAM,OAAS,EACf,QAAQ,QAAQ,KAAK,MAAM,MAAM,CAAE,EAGrC,IAAI,QAAW,CAACC,EAASC,IAAW,CACzC,KAAK,eAAe,KAAK,CAAE,QAAAD,EAAS,OAAAC,CAAO,CAAC,CAC9C,CAAC,CACH,CASA,SAAmB,CACjB,OAAO,KAAK,MAAM,SAAW,CAC/B,CAUA,QAAe,CACb,KAAK,UAAY,GAEjB,KAAK,eAAe,QAAQ,MAAO,CAAE,OAAAA,CAAO,IAAM,CAChDA,EAAO,IAAIC,EAAyB,gBAAgB,CAAC,CACvD,CAAC,EAED,KAAK,eAAiB,CAAC,EAEvB,KAAK,MAAM,OAAS,CACtB,CASA,aAAuB,CACrB,OAAO,KAAK,SACd,CASA,sBAA+B,CAC7B,OAAO,KAAK,eAAe,MAC7B,CACF,CAUO,MAAMA,UAAiC,KAAM,CAAC","names":["AsyncQueue","item","resolve","reject","AsyncQueueCancelledError"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- export*from"./accountSequenceNumber";export*from"./transactionWorker";
1
+ import{fe as a,ge as b,he as c,ie as d}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as AccountSequenceNumber,d as TransactionWorker,c as TransactionWorkerEventsEnum,b as promiseFulfilledStatus};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/management/index.ts"],"sourcesContent":["export * from \"./accountSequenceNumber\";\nexport * from \"./transactionWorker\";\n"],"mappings":"AAAA,WAAc,0BACd,WAAc","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import h from"eventemitter3";import{waitForTransaction as d}from"../../internal/transaction";import{generateTransaction as l,signAndSubmitTransaction as p}from"../../internal/transactionSubmission";import{AccountSequenceNumber as m}from"./accountSequenceNumber";import{AsyncQueue as o,AsyncQueueCancelledError as c}from"./asyncQueue";const u="fulfilled";var g=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(g||{});class G extends h{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 m(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){const t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;const e=await this.generateNextTransaction(this.account,t);if(!e)return;const a=p({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(;;){const t=[],e=[];let[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);const i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){const r=i[s];n=e[s],r.status===u?(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{const a=[];a.push(d({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));const n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){const s=n[i];s.status===u?(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;const[a,n]=await this.transactionsQueue.dequeue();return l({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e,replayProtectionNonce:void 0}})}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{G as TransactionWorker,g as TransactionWorkerEventsEnum,u as promiseFulfilledStatus};
1
+ import{ge as a,he as b,ie as c}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{c as TransactionWorker,b as TransactionWorkerEventsEnum,a as promiseFulfilledStatus};
2
2
  //# sourceMappingURL=transactionWorker.mjs.map
@@ -1 +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\n/**\n * @group Implementation\n * @category Transactions\n */\nexport const promiseFulfilledStatus = \"fulfilled\";\n\n/**\n * Events emitted by the transaction worker during its operation, allowing the dapp to respond to various transaction states.\n * @group Implementation\n * @category Transactions\n */\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/**\n * Defines the events emitted by the transaction worker during various stages of transaction processing. *\n * @group Implementation\n * @category Transactions\n */\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/**\n * The payload for when the worker has finished its job.\n * @group Implementation\n * @category Transactions\n */\nexport type ExecutionFinishEventData = {\n message: string;\n};\n\n/**\n * The payload for a success event.\n * @group Implementation\n * @category Transactions\n */\nexport type SuccessEventData = {\n message: string;\n transactionHash: string;\n};\n\n/**\n * The payload for a failure event.\n * @group Implementation\n * @category Transactions\n */\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 * @group Implementation\n * @category Transactions\n */\nexport class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // current account sequence number\n // TODO: Rename Sequnce -> Sequence\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 * @group Implementation\n * @category Transactions\n */\n transactionsQueue = new AsyncQueue<\n [InputGenerateTransactionPayloadData, InputGenerateTransactionOptions | undefined]\n >();\n\n /**\n * signed transactions waiting to be submitted\n * @group Implementation\n * @category Transactions\n */\n outstandingTransactions = new AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>();\n\n /**\n * transactions that have been submitted to chain\n * @group Implementation\n * @category Transactions\n */\n sentTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * transactions that have been committed to chain\n * @group Implementation\n * @category Transactions\n */\n executedTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * Initializes a new instance of the class, providing a framework for receiving payloads to be processed.\n *\n * @param aptosConfig - A configuration object for Aptos.\n * @param account - The account that will be used for sending transactions.\n * @param maxWaitTime - The maximum wait time to wait before re-syncing the sequence number to the current on-chain state,\n * default is 30 seconds.\n * @param maximumInFlight - The maximum number of transactions that can be submitted per account, default is 100.\n * @param sleepTime - The time to wait in seconds before re-evaluating if the maximum number of transactions are in flight,\n * default is 10 seconds.\n * @group Implementation\n * @category Transactions\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 * Submits the next transaction for the account by generating it with the current sequence number\n * and adding it to the outstanding transaction queue for processing.\n * This function continues to submit transactions until there are no more to process.\n *\n * @throws {Error} Throws an error if the transaction submission fails.\n * @group Implementation\n * @category Transactions\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 transactions to the chain.\n * This function processes each transaction, checking their status and emitting events based on whether they were successfully\n * sent or failed.\n *\n * @throws {Error} Throws an error if the process execution fails.\n * @event TransactionWorkerEventsEnum.TransactionSent - Emitted when a transaction has been successfully committed to the chain.\n * @event TransactionWorkerEventsEnum.TransactionSendFailed - Emitted when a transaction fails to commit, along with the error\n * reason.\n * @event TransactionWorkerEventsEnum.ExecutionFinish - Emitted when the execution of transactions is complete.\n * @group Implementation\n * @category Transactions\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 a transaction has been sent to the chain, this function checks for its execution status.\n * @param sentTransaction - The transaction that was sent to the chain and is now waiting to be executed.\n * @param sequenceNumber - The account's sequence number that was sent with the transaction.\n * @group Implementation\n * @category Transactions\n */\n async checkTransaction(sentTransaction: PromiseFulfilledResult<PendingTransactionResponse>, sequenceNumber: bigint) {\n try {\n const waitFor: Array<Promise<TransactionResponse>> = [];\n waitFor.push(waitForTransaction({ aptosConfig: this.aptosConfig, transactionHash: sentTransaction.value.hash }));\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 * Pushes a transaction to the transactions queue for processing.\n *\n * @param transactionData - The transaction payload containing necessary details.\n * @param transactionData.abi - For all entry function payloads, the ABI to skip remote ABI lookups.\n * @param options - Optional parameters for transaction configuration.\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 * @group Implementation\n * @category Transactions\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 the chain.\n *\n * @param account - An Aptos account used as the sender of the transaction.\n * @param sequenceNumber - A sequence number the transaction will be generated with.\n * @returns A signed transaction object or undefined if the transaction queue is empty.\n * @group Implementation\n * @category Transactions\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, replayProtectionNonce: undefined },\n });\n }\n\n /**\n * Starts transaction submission and processing by executing tasks from the queue until it is cancelled.\n *\n * @throws {Error} Throws an error if unable to start transaction batching.\n * @group Implementation\n * @category Transactions\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 * @throws {Error} Throws an error if the worker has already started.\n * @group Implementation\n * @category Transactions\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 transaction management process.\n *\n * @throws {Error} Throws an error if the worker has already stopped.\n * @group Implementation\n * @category Transactions\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":"AAEA,OAAOA,MAAkB,gBAGzB,OAAS,sBAAAC,MAA0B,6BACnC,OAAS,uBAAAC,EAAqB,4BAAAC,MAAgC,uCAG9D,OAAS,yBAAAC,MAA6B,0BACtC,OAAS,cAAAC,EAAY,4BAAAC,MAAgC,eAO9C,MAAMC,EAAyB,YAO/B,IAAKC,OAEVA,EAAA,gBAAkB,kBAElBA,EAAA,sBAAwB,wBAExBA,EAAA,oBAAsB,sBAEtBA,EAAA,2BAA6B,6BAE7BA,EAAA,gBAAkB,kBAVRA,OAAA,IAqEL,MAAMC,UAA0BT,CAAsC,CA2D3E,YACEU,EACAC,EACAC,EAAsB,GACtBC,EA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I,MAAM,4BAA4B,EAE9C,KAAK,QAAU,GACf,KAAK,UAAU,OAAO,CACxB,CACF","names":["EventEmitter","waitForTransaction","generateTransaction","signAndSubmitTransaction","AccountSequenceNumber","AsyncQueue","AsyncQueueCancelledError","promiseFulfilledStatus","TransactionWorkerEventsEnum","TransactionWorker","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","sequenceNumber","transaction","pendingTransaction","error","awaitingTransactions","sequenceNumbers","sentTransactions","i","sentTransaction","waitFor","executedTransaction","transactionData","options"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{Bool as r,FixedBytes as i,MoveOption as o,MoveString as u,MoveVector as s,U128 as p,U16 as c,U256 as y,U32 as m,U64 as a,U8 as f}from"../../bcs";import{AccountAddress as g}from"../../core";function W(n){return typeof n=="boolean"}function A(n){return typeof n=="string"}function F(n){return typeof n=="number"}function $(n){if(F(n))return n;if(A(n)&&n!=="")return Number.parseInt(n,10)}function L(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function V(n){return n==null}function j(n){return T(n)||x(n)||S(n)||B(n)||U(n)||b(n)||I(n)||E(n)||l(n)||d(n)||n instanceof s||n instanceof o}function T(n){return n instanceof r}function E(n){return n instanceof g}function l(n){return n instanceof u}function d(n){return n instanceof i}function x(n){return n instanceof f}function S(n){return n instanceof c}function B(n){return n instanceof m}function U(n){return n instanceof a}function b(n){return n instanceof p}function I(n){return n instanceof y}function k(n){return"bytecode"in n}function q(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function z(n){const t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}export{$ as convertNumber,z as findFirstNonSignerArg,E as isBcsAddress,T as isBcsBool,d as isBcsFixedBytes,l as isBcsString,b as isBcsU128,S as isBcsU16,I as isBcsU256,B as isBcsU32,U as isBcsU64,x as isBcsU8,W as isBool,V as isEmptyOption,j as isEncodedEntryFunctionArgument,L as isLargeNumber,F as isNumber,k as isScriptDataInput,A as isString,q as throwTypeMismatch};
1
+ import{Ab as g,Bb as h,Cb as i,Db as j,Eb as k,Fb as l,Gb as m,Hb as n,Ib as o,Jb as p,Kb as q,Lb as r,Mb as s,Nb as t,ub as a,vb as b,wb as c,xb as d,yb as e,zb as f}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{d as convertNumber,t as findFirstNonSignerArg,i as isBcsAddress,h as isBcsBool,k as isBcsFixedBytes,j as isBcsString,p as isBcsU128,m as isBcsU16,q as isBcsU256,n as isBcsU32,o as isBcsU64,l as isBcsU8,a as isBool,f as isEmptyOption,g as isEncodedEntryFunctionArgument,e as isLargeNumber,c as isNumber,r as isScriptDataInput,b as isString,s as throwTypeMismatch};
2
2
  //# sourceMappingURL=helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/transactionBuilder/helpers.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n EntryFunctionArgumentTypes,\n InputGenerateTransactionPayloadData,\n InputGenerateTransactionPayloadDataWithRemoteABI,\n InputScriptData,\n SimpleEntryFunctionArgumentTypes,\n} from \"../types\";\nimport { Bool, FixedBytes, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { MoveFunction } from \"../../types\";\n\n/**\n * Determines if the provided argument is of type boolean.\n * This can help in validating input types before processing them further.\n *\n * @param arg - The argument to check, which can be of various types.\n * @returns A boolean indicating whether the argument is a boolean.\n * @group Implementation\n * @category Transactions\n */\nexport function isBool(arg: SimpleEntryFunctionArgumentTypes): arg is boolean {\n return typeof arg === \"boolean\";\n}\n\n/**\n * Checks if the provided argument is of type string.\n *\n * @param arg - The value to be checked for string type.\n * @returns A boolean indicating whether the argument is a string.\n * @group Implementation\n * @category Transactions\n */\nexport function isString(arg: any): arg is string {\n return typeof arg === \"string\";\n}\n\n/**\n * Determines if the provided argument is of type number.\n *\n * @param arg - The argument to check, which can be of various types.\n * @returns A boolean indicating whether the argument is a number.\n * @group Implementation\n * @category Transactions\n */\nexport function isNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number {\n return typeof arg === \"number\";\n}\n\n/**\n * Converts a number or a string representation of a number into a number type.\n * This function is useful for ensuring that the input is in a consistent numeric format,\n * which can help prevent type mismatches in further processing.\n *\n * @param arg - The input value to be converted. This can be a number, a string representing a number, or any other type.\n * @returns Returns the converted number if the input is valid; otherwise, it returns undefined.\n * @group Implementation\n * @category Transactions\n */\nexport function convertNumber(arg: SimpleEntryFunctionArgumentTypes): number | undefined {\n if (isNumber(arg)) {\n return arg;\n }\n if (isString(arg) && arg !== \"\") {\n return Number.parseInt(arg, 10);\n }\n\n return undefined;\n}\n\n/**\n * Determines if the provided argument is a large number, which can be a number, bigint, or string representation of a number.\n *\n * @param arg - The argument to check, which can be of type number, bigint, or string.\n * @group Implementation\n * @category Transactions\n */\nexport function isLargeNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number | bigint | string {\n return typeof arg === \"number\" || typeof arg === \"bigint\" || typeof arg === \"string\";\n}\n\n/**\n * Checks if the provided argument is empty, meaning it is either null or undefined.\n *\n * @param arg - The argument to check for emptiness.\n * @returns A boolean indicating whether the argument is empty.\n * @group Implementation\n * @category Transactions\n */\nexport function isEmptyOption(arg: SimpleEntryFunctionArgumentTypes): arg is null | undefined {\n return arg === null || arg === undefined;\n}\n\n/**\n * Determines if the provided argument is a valid encoded entry function argument type.\n * This function helps validate that the argument conforms to the expected types for entry function parameters.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\nexport function isEncodedEntryFunctionArgument(\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n): arg is EntryFunctionArgumentTypes {\n return (\n /**\n * Determines if the provided argument is an instance of the Bool class.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsBool(arg) ||\n /**\n * Determines if the provided argument is an instance of U8.\n * This function helps validate the type of the argument passed to ensure it is a U8 type.\n *\n * @param arg - The argument to be checked, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsU8(arg) ||\n /**\n * Determines if the provided argument is an instance of U16.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsU16(arg) ||\n /**\n * Determines if the provided argument is an instance of U32.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @returns A boolean indicating whether the argument is a U32 instance.\n * @group Implementation\n * @category Transactions\n */\n isBcsU32(arg) ||\n /**\n * Determine if the provided argument is an instance of U64.\n * This function helps validate that the argument conforms to the expected U64 type.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsU64(arg) ||\n /**\n * Determines if the provided argument is an instance of U128.\n * This function helps validate the type of the argument passed to ensure it is a U128 type.\n *\n * @param arg - The argument to be checked, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsU128(arg) ||\n /**\n * Determines if the provided argument is an instance of U256.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @returns A boolean indicating whether the argument is a U256 instance.\n * @group Implementation\n * @category Transactions\n */\n isBcsU256(arg) ||\n /**\n * Determines if the provided argument is an instance of AccountAddress.\n * This function helps validate whether a given input corresponds to a valid BCS address type.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsAddress(arg) ||\n /**\n * Determine if the provided argument is an instance of MoveString.\n *\n * @param arg - The argument to check, which can be of types EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsString(arg) ||\n /**\n * Determine if the provided argument is an instance of FixedBytes.\n * This function helps to validate the type of the argument being passed.\n *\n * @param arg - The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.\n * @group Implementation\n * @category Transactions\n */\n isBcsFixedBytes(arg) ||\n arg instanceof MoveVector ||\n arg instanceof MoveOption\n );\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsBool(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is Bool {\n return arg instanceof Bool;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsAddress(\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n): arg is AccountAddress {\n return arg instanceof AccountAddress;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsString(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is MoveString {\n return arg instanceof MoveString;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsFixedBytes(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is FixedBytes {\n return arg instanceof FixedBytes;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsU8(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U8 {\n return arg instanceof U8;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsU16(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U16 {\n return arg instanceof U16;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsU32(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U32 {\n return arg instanceof U32;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsU64(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U64 {\n return arg instanceof U64;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsU128(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U128 {\n return arg instanceof U128;\n}\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function isBcsU256(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U256 {\n return arg instanceof U256;\n}\n\n/**\n * Determines if the provided argument contains script data input by checking for the presence of bytecode.\n *\n * @param arg - The input data to be checked, which can either be a payload with remote ABI or a standard payload.\n * @param arg.bytecode - The bytecode of the script, present if the input is script data.\n * @param arg.function - The function associated with the transaction, which is relevant for standard payloads.\n * @param arg.args - The arguments for the function, applicable in the context of standard payloads.\n * @group Implementation\n * @category Transactions\n */\nexport function isScriptDataInput(\n arg: InputGenerateTransactionPayloadDataWithRemoteABI | InputGenerateTransactionPayloadData,\n): arg is InputScriptData {\n return \"bytecode\" in arg;\n}\n\n/**\n * Throws an error indicating a type mismatch for a specified argument position.\n * This function helps in debugging by providing clear feedback on expected types.\n *\n * @param expectedType - The type that was expected for the argument.\n * @param position - The position of the argument that caused the type mismatch.\n * @group Implementation\n * @category Transactions\n */\nexport function throwTypeMismatch(expectedType: string, position: number) {\n throw new Error(`Type mismatch for argument ${position}, expected '${expectedType}'`);\n}\n\n/**\n * Finds the index of the first non-signer argument in the function ABI parameters.\n *\n * A function is often defined with a `signer` or `&signer` arguments at the start, which are filled in\n * by signatures and not by the caller. This function helps identify the position of the first argument that\n * can be provided by the caller, allowing for easier handling of function parameters.\n *\n * @param functionAbi - The ABI of the function to analyze.\n * @returns The index of the first non-signer argument, or the length of the parameters array if none are found.\n * @group Implementation\n * @category Transactions\n */\nexport function findFirstNonSignerArg(functionAbi: MoveFunction): number {\n const index = functionAbi.params.findIndex((param) => param !== \"signer\" && param !== \"&signer\");\n if (index < 0) {\n return functionAbi.params.length;\n }\n return index;\n}\n"],"mappings":"AAUA,OAAS,QAAAA,EAAM,cAAAC,EAAY,cAAAC,EAAY,cAAAC,EAAY,cAAAC,EAAY,QAAAC,EAAM,OAAAC,EAAK,QAAAC,EAAM,OAAAC,EAAK,OAAAC,EAAK,MAAAC,MAAU,YACpG,OAAS,kBAAAC,MAAsB,aAYxB,SAASC,EAAOC,EAAuD,CAC5E,OAAO,OAAOA,GAAQ,SACxB,CAUO,SAASC,EAASD,EAAyB,CAChD,OAAO,OAAOA,GAAQ,QACxB,CAUO,SAASE,EAASF,EAAsD,CAC7E,OAAO,OAAOA,GAAQ,QACxB,CAYO,SAASG,EAAcH,EAA2D,CACvF,GAAIE,EAASF,CAAG,EACd,OAAOA,EAET,GAAIC,EAASD,CAAG,GAAKA,IAAQ,GAC3B,OAAO,OAAO,SAASA,EAAK,EAAE,CAIlC,CASO,SAASI,EAAcJ,EAAwE,CACpG,OAAO,OAAOA,GAAQ,UAAY,OAAOA,GAAQ,UAAY,OAAOA,GAAQ,QAC9E,CAUO,SAASK,EAAcL,EAAgE,CAC5F,OAAOA,GAAQ,IACjB,CAUO,SAASM,EACdN,EACmC,CACnC,OAQEO,EAAUP,CAAG,GASbQ,EAAQR,CAAG,GAQXS,EAAST,CAAG,GASZU,EAASV,CAAG,GASZW,EAASX,CAAG,GASZY,EAAUZ,CAAG,GASba,EAAUb,CAAG,GASbc,EAAad,CAAG,GAQhBe,EAAYf,CAAG,GASfgB,EAAgBhB,CAAG,GACnBA,aAAeT,GACfS,aAAeX,CAEnB,CAKO,SAASkB,EAAUP,EAAiF,CACzG,OAAOA,aAAeb,CACxB,CAKO,SAAS2B,EACdd,EACuB,CACvB,OAAOA,aAAeF,CACxB,CAKO,SAASiB,EAAYf,EAAuF,CACjH,OAAOA,aAAeV,CACxB,CAKO,SAAS0B,EAAgBhB,EAAuF,CACrH,OAAOA,aAAeZ,CACxB,CAKO,SAASoB,EAAQR,EAA+E,CACrG,OAAOA,aAAeH,CACxB,CAKO,SAASY,EAAST,EAAgF,CACvG,OAAOA,aAAeP,CACxB,CAKO,SAASiB,EAASV,EAAgF,CACvG,OAAOA,aAAeL,CACxB,CAKO,SAASgB,EAASX,EAAgF,CACvG,OAAOA,aAAeJ,CACxB,CAKO,SAASgB,EAAUZ,EAAiF,CACzG,OAAOA,aAAeR,CACxB,CAKO,SAASqB,EAAUb,EAAiF,CACzG,OAAOA,aAAeN,CACxB,CAYO,SAASuB,EACdjB,EACwB,CACxB,MAAO,aAAcA,CACvB,CAWO,SAASkB,EAAkBC,EAAsBC,EAAkB,CACxE,MAAM,IAAI,MAAM,8BAA8BA,CAAQ,eAAeD,CAAY,GAAG,CACtF,CAcO,SAASE,EAAsBC,EAAmC,CACvE,MAAMC,EAAQD,EAAY,OAAO,UAAWE,GAAUA,IAAU,UAAYA,IAAU,SAAS,EAC/F,OAAID,EAAQ,EACHD,EAAY,OAAO,OAErBC,CACT","names":["Bool","FixedBytes","MoveOption","MoveString","MoveVector","U128","U16","U256","U32","U64","U8","AccountAddress","isBool","arg","isString","isNumber","convertNumber","isLargeNumber","isEmptyOption","isEncodedEntryFunctionArgument","isBcsBool","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","isBcsAddress","isBcsString","isBcsFixedBytes","isScriptDataInput","throwTypeMismatch","expectedType","position","findFirstNonSignerArg","functionAbi","index","param"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- export*from"./helpers";export*from"./transactionBuilder";export*from"./remoteAbi";export*from"./signingMessage";
1
+ import{$a as c,$b as L,Ab as k,Bb as l,Cb as m,Db as n,Eb as o,Fb as p,Gb as q,Hb as r,Ib as s,Jb as t,Kb as u,Lb as v,Mb as w,Nb as x,Ob as y,Pb as z,Qb as A,Rb as B,Sb as C,Tb as D,Ub as E,Vb as F,Wb as G,Xb as H,Yb as I,Za as a,Zb as J,_a as b,_b as K,ab as d,ac as M,bc as N,cc as O,dc as P,ec as Q,fc as R,ub as e,vb as f,wb as g,xb as h,yb as i,zb as j}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{M as buildTransaction,F as checkOrConvertArgument,E as convertArgument,h as convertNumber,L as convertPayloadToInnerPayload,a as deriveTransactionType,C as fetchEntryFunctionAbi,A as fetchFunctionAbi,z as fetchModuleAbi,B as fetchMoveFunctionAbi,D as fetchViewFunctionAbi,x as findFirstNonSignerArg,K as generateRawTransaction,P as generateSignedTransaction,N as generateSignedTransactionForSimulation,b as generateSigningMessage,c as generateSigningMessageForSerializable,d as generateSigningMessageForTransaction,G as generateTransactionPayload,H as generateTransactionPayloadWithABI,R as generateUserTransactionHash,I as generateViewFunctionPayload,J as generateViewFunctionPayloadWithABI,O as getAuthenticatorForSimulation,Q as hashValues,m as isBcsAddress,l as isBcsBool,o as isBcsFixedBytes,n as isBcsString,t as isBcsU128,q as isBcsU16,u as isBcsU256,r as isBcsU32,s as isBcsU64,p as isBcsU8,e as isBool,j as isEmptyOption,k as isEncodedEntryFunctionArgument,i as isLargeNumber,g as isNumber,v as isScriptDataInput,f as isString,y as standardizeTypeTags,w as throwTypeMismatch};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/transactionBuilder/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from \"./helpers\";\nexport * from \"./transactionBuilder\";\nexport * from \"./remoteAbi\";\nexport * from \"./signingMessage\";\n"],"mappings":"AAGA,WAAc,YACd,WAAc,uBACd,WAAc,cACd,WAAc","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{parseTypeTag as w}from"../typeTag/parser";import{TypeTagAddress as v,TypeTagBool as E,TypeTagStruct as a,TypeTagU128 as S,TypeTagU16 as F,TypeTagU256 as x,TypeTagU32 as b,TypeTagU64 as I,TypeTagU8 as M}from"../typeTag";import{Bool as d,FixedBytes as A,MoveOption as c,MoveString as C,MoveVector as l,U128 as _,U16 as k,U256 as G,U32 as V,U64 as j,U8 as D}from"../../bcs";import{AccountAddress as U}from"../../core";import{getModule as P}from"../../internal/account";import{findFirstNonSignerArg as L,isBcsAddress as B,isBcsBool as O,isBcsString as R,isBcsU128 as z,isBcsU16 as J,isBcsU256 as K,isBcsU32 as W,isBcsU64 as X,isBcsU8 as q,isBool as H,isEncodedEntryFunctionArgument as Q,isLargeNumber as g,isEmptyOption as Y,isString as y,throwTypeMismatch as o,convertNumber as p}from"./helpers";const Z=new TextEncoder;function Bn(n){return n?.map(e=>y(e)?w(e):e)??[]}async function N(n,e,t){return(await P({aptosConfig:t,accountAddress:n,moduleName:e})).abi}async function h(n,e,t,u){const r=await N(n,e,u);if(!r)throw new Error(`Could not find module ABI for '${n}::${e}'`);return r.exposed_functions.find(f=>f.name===t)}async function $n(n,e,t,u){const r=await h(n,e,t,u);if(!r)throw new Error(`Could not find function ABI for '${n}::${e}::${t}'`);const f=[];for(let i=0;i<r.params.length;i+=1)f.push(w(r.params[i],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:f}}async function vn(n,e,t,u){const r=await h(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);const f=L(r),i=[];for(let s=f;s<r.params.length;s+=1)i.push(w(r.params[s],{allowGenerics:!0}));return{signers:f,typeParameters:r.generic_type_params,parameters:i}}async function En(n,e,t,u){const r=await h(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);const f=[];for(let s=0;s<r.params.length;s+=1)f.push(w(r.params[s],{allowGenerics:!0}));const i=[];for(let s=0;s<r.return.length;s+=1)i.push(w(r.return[s],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:f,returnTypes:i}}function an(n,e,t,u,r,f){let i;if("exposed_functions"in e){const s=e.exposed_functions.find($=>$.name===n);if(!s)throw new Error(`Could not find function ABI for '${e.address}::${e.name}::${n}'`);if(u>=s.params.length)throw new Error(`Too many arguments for '${n}', expected ${s.params.length}`);i=w(s.params[u],{allowGenerics:!0})}else{if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);i=e.parameters[u]}return T(t,i,u,r,"exposed_functions"in e?e:void 0,f)}function T(n,e,t,u,r,f){return Q(n)?(m(e,n,t),n):nn(n,e,t,u,r,f)}function nn(n,e,t,u,r,f){if(e.isBool()){if(H(n))return new d(n);if(y(n)){if(n==="true")return new d(!0);if(n==="false")return new d(!1)}o("boolean",t)}if(e.isAddress()){if(y(n))return U.fromString(n);if(n&&typeof n=="object"&&"data"in n&&n.data instanceof Uint8Array)return new U(n.data);o("string | AccountAddress",t)}if(e.isU8()){const i=p(n);if(i!==void 0)return new D(i);o("number | string",t)}if(e.isU16()){const i=p(n);if(i!==void 0)return new k(i);o("number | string",t)}if(e.isU32()){const i=p(n);if(i!==void 0)return new V(i);o("number | string",t)}if(e.isU64()){if(g(n))return new j(BigInt(n));o("bigint | number | string",t)}if(e.isU128()){if(g(n))return new _(BigInt(n));o("bigint | number | string",t)}if(e.isU256()){if(g(n))return new G(BigInt(n));o("bigint | number | string",t)}if(e.isGeneric()){const i=e.value;if(i<0||i>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return T(n,u[i],t,u,r)}if(e.isVector()){if(e.value.isU8()){if(y(n))return l.U8(Z.encode(n));if(n instanceof Uint8Array)return l.U8(n);if(n instanceof ArrayBuffer)return l.U8(new Uint8Array(n))}if(y(n)&&n.startsWith("["))return T(JSON.parse(n),e,t,u);if(Array.isArray(n))return new l(n.map(i=>T(i,e.value,t,u,r)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(y(n))return new C(n);o("string",t)}if(e.isObject()){if(y(n))return U.fromString(n);if(n&&typeof n=="object"&&"data"in n&&n.data instanceof Uint8Array)return new U(n.data);o("string | AccountAddress",t)}if(e.isDelegationKey()||e.isRateLimiter()){if(n instanceof Uint8Array)return new A(n);o("Uint8Array",t)}if(e.isOption()){if(Y(n)){const s=e.value.typeArgs[0];return s instanceof E?new c(null):s instanceof v?new c(null):s instanceof M?new c(null):s instanceof F?new c(null):s instanceof b?new c(null):s instanceof I?new c(null):s instanceof S?new c(null):s instanceof x?new c(null):new c(null)}return new c(T(n,e.value.typeArgs[0],t,u,r))}if(r?.structs.find(s=>s.name===e.value.name.identifier)?.fields.length===0&&n instanceof Uint8Array)return new A(n);if(n instanceof Uint8Array&&f?.allowUnknownStructs)return console.warn(`Unsupported struct input type for argument ${t}. Continuing since 'allowUnknownStructs' is enabled.`),new A(n);throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function m(n,e,t){if(n.isBool()){if(O(e))return;o("Bool",t)}if(n.isAddress()){if(B(e))return;o("AccountAddress",t)}if(n.isU8()){if(q(e))return;o("U8",t)}if(n.isU16()){if(J(e))return;o("U16",t)}if(n.isU32()){if(W(e))return;o("U32",t)}if(n.isU64()){if(X(e))return;o("U64",t)}if(n.isU128()){if(z(e))return;o("U128",t)}if(n.isU256()){if(K(e))return;o("U256",t)}if(n.isVector()){if(e instanceof l){e.values.length>0&&m(n.value,e.values[0],t);return}o("MoveVector",t)}if(n instanceof a){if(n.isString()){if(R(e))return;o("MoveString",t)}if(n.isObject()){if(B(e))return;o("AccountAddress",t)}if(n.isOption()){if(e instanceof c){e.value!==void 0&&m(n.value.typeArgs[0],e.value,t);return}o("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{T as checkOrConvertArgument,an as convertArgument,vn as fetchEntryFunctionAbi,h as fetchFunctionAbi,N as fetchModuleAbi,$n as fetchMoveFunctionAbi,En as fetchViewFunctionAbi,Bn as standardizeTypeTags};
1
+ import{Ob as a,Pb as b,Qb as c,Rb as d,Sb as e,Tb as f,Ub as g,Vb as h}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{h as checkOrConvertArgument,g as convertArgument,e as fetchEntryFunctionAbi,c as fetchFunctionAbi,b as fetchModuleAbi,d as fetchMoveFunctionAbi,f as fetchViewFunctionAbi,a as standardizeTypeTags};
2
2
  //# sourceMappingURL=remoteAbi.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/transactionBuilder/remoteAbi.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseTypeTag } from \"../typeTag/parser\";\nimport {\n TypeTag,\n TypeTagAddress,\n TypeTagBool,\n TypeTagStruct,\n TypeTagU128,\n TypeTagU16,\n TypeTagU256,\n TypeTagU32,\n TypeTagU64,\n TypeTagU8,\n} from \"../typeTag\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport {\n EntryFunctionArgumentTypes,\n SimpleEntryFunctionArgumentTypes,\n EntryFunctionABI,\n ViewFunctionABI,\n FunctionABI,\n TypeArgument,\n} from \"../types\";\nimport { Bool, FixedBytes, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { getModule } from \"../../internal/account\";\nimport {\n findFirstNonSignerArg,\n isBcsAddress,\n isBcsBool,\n isBcsString,\n isBcsU128,\n isBcsU16,\n isBcsU256,\n isBcsU32,\n isBcsU64,\n isBcsU8,\n isBool,\n isEncodedEntryFunctionArgument,\n isLargeNumber,\n isEmptyOption,\n isString,\n throwTypeMismatch,\n convertNumber,\n} from \"./helpers\";\nimport { MoveFunction, MoveModule } from \"../../types\";\n\nconst TEXT_ENCODER = new TextEncoder();\n\n/**\n * Convert type arguments to only type tags, allowing for string representations of type tags.\n *\n * @param typeArguments - An optional array of type arguments that may include string representations.\n * @returns An array of TypeTag objects derived from the provided type arguments.\n * @group Implementation\n * @category Transactions\n */\nexport function standardizeTypeTags(typeArguments?: Array<TypeArgument>): Array<TypeTag> {\n return (\n typeArguments?.map((typeArg: TypeArgument): TypeTag => {\n // Convert to TypeTag if it's a string representation\n if (isString(typeArg)) {\n return parseTypeTag(typeArg);\n }\n return typeArg;\n }) ?? []\n );\n}\n\n/**\n * Fetches the ABI of a specified module from the on-chain module ABI.\n *\n * @param moduleAddress - The address of the module from which to fetch the ABI.\n * @param moduleName - The name of the module containing the ABI.\n * @param aptosConfig - The configuration settings for Aptos.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchModuleAbi(\n moduleAddress: string,\n moduleName: string,\n aptosConfig: AptosConfig,\n): Promise<MoveModule | undefined> {\n const moduleBytecode = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n return moduleBytecode.abi;\n}\n\n/**\n * Fetches the ABI of a specified function from the on-chain module ABI. This function allows you to access the details of a\n * specific function within a module.\n *\n * @param moduleAddress - The address of the module from which to fetch the function ABI.\n * @param moduleName - The name of the module containing the function.\n * @param functionName - The name of the function whose ABI is to be fetched.\n * @param aptosConfig - The configuration settings for Aptos.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<MoveFunction | undefined> {\n const moduleAbi = await fetchModuleAbi(moduleAddress, moduleName, aptosConfig);\n if (!moduleAbi) throw new Error(`Could not find module ABI for '${moduleAddress}::${moduleName}'`);\n return moduleAbi.exposed_functions.find((func) => func.name === functionName);\n}\n\n/**\n * @deprecated Use `fetchFunctionAbi` instead and manually parse the type tags.\n */\nexport async function fetchMoveFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<FunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n if (!functionAbi) {\n throw new Error(`Could not find function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for an entry function from the specified module address.\n * This function validates if the ABI corresponds to an entry function and retrieves its parameters.\n *\n * @param moduleAddress - The address of the module containing the entry function.\n * @param moduleName - The name of the module containing the entry function.\n * @param functionName - The name of the entry function to fetch the ABI for.\n * @param aptosConfig - The configuration settings for Aptos.\n * @returns An object containing the number of signers, type parameters, and function parameters.\n * @throws Error if the ABI cannot be found or if the function is not an entry function.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchEntryFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<EntryFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find entry function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-entry functions also can't be used\n if (!functionAbi.is_entry) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an entry function`);\n }\n\n // Remove the signer arguments\n const numSigners = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = numSigners; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n signers: numSigners,\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for a view function from the specified module address.\n * This function ensures that the ABI is valid and retrieves the type parameters, parameters, and return types for the view function.\n *\n * @param moduleAddress - The address of the module containing the view function.\n * @param moduleName - The name of the module containing the view function.\n * @param functionName - The name of the view function for which to fetch the ABI.\n * @param aptosConfig - The configuration settings for Aptos.\n * @returns An object containing the type parameters, parameters, and return types of the view function.\n * @throws Error if the ABI cannot be found or if the function is not a view function.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchViewFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<ViewFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find view function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-view functions can't be used\n if (!functionAbi.is_view) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an view function`);\n }\n\n // Type tag parameters for the function\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n // The return types of the view function\n const returnTypes: TypeTag[] = [];\n for (let i = 0; i < functionAbi.return.length; i += 1) {\n returnTypes.push(parseTypeTag(functionAbi.return[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n returnTypes,\n };\n}\n\n/**\n * Converts a non-BCS encoded argument into BCS encoded, if necessary.\n * This function checks the provided argument against the expected parameter type and converts it accordingly.\n *\n * @param functionName - The name of the function for which the argument is being converted.\n * @param functionAbiOrModuleAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.\n * @param arg - The argument to be converted, which can be of various types.\n * @param position - The index of the argument in the function's parameter list.\n * @param genericTypeParams - An array of type tags for any generic type parameters.\n * @param options - Options for the conversion process.\n * @param options.allowUnknownStructs - If true, unknown structs will be allowed and converted to a `FixedBytes`.\n * @group Implementation\n * @category Transactions\n */\nexport function convertArgument(\n functionName: string,\n functionAbiOrModuleAbi: MoveModule | FunctionABI,\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n position: number,\n genericTypeParams: Array<TypeTag>,\n options?: { allowUnknownStructs?: boolean },\n) {\n let param: TypeTag;\n\n if (\"exposed_functions\" in functionAbiOrModuleAbi) {\n const functionAbi = functionAbiOrModuleAbi.exposed_functions.find((func) => func.name === functionName);\n if (!functionAbi) {\n throw new Error(\n `Could not find function ABI for '${functionAbiOrModuleAbi.address}::${functionAbiOrModuleAbi.name}::${functionName}'`,\n );\n }\n\n if (position >= functionAbi.params.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.params.length}`);\n }\n\n param = parseTypeTag(functionAbi.params[position], { allowGenerics: true });\n } else {\n if (position >= functionAbiOrModuleAbi.parameters.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbiOrModuleAbi.parameters.length}`);\n }\n\n param = functionAbiOrModuleAbi.parameters[position];\n }\n\n return checkOrConvertArgument(\n arg,\n param,\n position,\n genericTypeParams,\n \"exposed_functions\" in functionAbiOrModuleAbi ? functionAbiOrModuleAbi : undefined,\n options,\n );\n}\n\n/**\n * Checks if the provided argument is BCS encoded and converts it if necessary, ensuring type compatibility with the ABI.\n * This function helps in validating and converting arguments for entry functions based on their expected types.\n *\n * @param arg - The argument to check or convert, which can be either a simple or entry function argument type.\n * @param param - The expected type tag for the argument.\n * @param position - The position of the argument in the function call.\n * @param genericTypeParams - An array of generic type parameters that may be used for conversion.\n * @group Implementation\n * @category Transactions\n */\nexport function checkOrConvertArgument(\n arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n moduleAbi?: MoveModule,\n options?: { allowUnknownStructs?: boolean },\n) {\n // If the argument is bcs encoded, we can just use it directly\n if (isEncodedEntryFunctionArgument(arg)) {\n // Ensure the type matches the ABI\n\n /**\n * Checks the type of the provided argument against the expected type.\n * This function helps validate that the argument conforms to the specified type requirements.\n *\n * @param typeArgs - The expected type arguments.\n * @param arg - The argument to be checked.\n * @param position - The position of the argument in the context of the check.\n * @param moduleAbi - The ABI of the module containing the function, used for type checking.\n * This will typically have information about structs, enums, and other types.\n * @group Implementation\n * @category Transactions\n */\n checkType(param, arg, position);\n return arg;\n }\n\n // If it is not BCS encoded, we will need to convert it with the ABI\n return parseArg(arg, param, position, genericTypeParams, moduleAbi, options);\n}\n\n/**\n * Parses a non-BCS encoded argument into a BCS encoded argument recursively.\n * This function helps convert various types of input arguments into their corresponding BCS encoded formats based on the\n * specified parameter type.\n *\n * @param arg - The argument to be parsed, which can be of various types.\n * @param param - The type tag that defines the expected type of the argument.\n * @param position - The position of the argument in the function call, used for error reporting.\n * @param genericTypeParams - An array of type tags for generic type parameters, used when the parameter type is generic.\n * @param moduleAbi - The ABI of the module containing the function, used for type checking.\n * This will typically have information about structs, enums, and other types.\n * @param options - Options for the conversion process.\n * @param options.allowUnknownStructs - If true, unknown structs will be allowed and converted to a `FixedBytes`.\n * @group Implementation\n * @category Transactions\n */\nfunction parseArg(\n arg: SimpleEntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n moduleAbi?: MoveModule,\n options?: { allowUnknownStructs?: boolean },\n): EntryFunctionArgumentTypes {\n if (param.isBool()) {\n if (isBool(arg)) {\n return new Bool(arg);\n }\n if (isString(arg)) {\n if (arg === \"true\") return new Bool(true);\n if (arg === \"false\") return new Bool(false);\n }\n\n /**\n * Throws a type mismatch error for the specified move option.\n *\n * @param moveOption - The name of the move option that caused the type mismatch.\n * @param position - The position where the error occurred.\n * @group Implementation\n * @category Transactions\n */\n throwTypeMismatch(\"boolean\", position);\n }\n if (param.isAddress()) {\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n // Support for Uint8Array coming from external sources\n // Usually, dapps will be getting the account address as a Uint8Array from the wallet (following\n // the wallet standard).\n if (arg && typeof arg === \"object\" && \"data\" in arg && arg.data instanceof Uint8Array) {\n return new AccountAddress(arg.data);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n if (param.isU8()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U8(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU16()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U16(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU32()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U32(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU64()) {\n if (isLargeNumber(arg)) {\n return new U64(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU128()) {\n if (isLargeNumber(arg)) {\n return new U128(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU256()) {\n if (isLargeNumber(arg)) {\n return new U256(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n\n // Generic needs to use the subtype\n if (param.isGeneric()) {\n const genericIndex = param.value;\n if (genericIndex < 0 || genericIndex >= genericTypeParams.length) {\n throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);\n }\n\n return checkOrConvertArgument(arg, genericTypeParams[genericIndex], position, genericTypeParams, moduleAbi);\n }\n\n // We have to special case some vectors for Vector<u8>\n if (param.isVector()) {\n // Check special case for Vector<u8>\n if (param.value.isU8()) {\n // We don't allow vector<u8>, but we convert strings to UTF8 Uint8Array\n // This is legacy behavior from the original SDK\n if (isString(arg)) {\n return MoveVector.U8(TEXT_ENCODER.encode(arg));\n }\n if (arg instanceof Uint8Array) {\n return MoveVector.U8(arg);\n }\n if (arg instanceof ArrayBuffer) {\n return MoveVector.U8(new Uint8Array(arg));\n }\n }\n\n if (isString(arg)) {\n // In a web env, arguments are passing as strings\n if (arg.startsWith(\"[\")) {\n return checkOrConvertArgument(JSON.parse(arg), param, position, genericTypeParams);\n }\n }\n\n // TODO: Support Uint16Array, Uint32Array, BigUint64Array?\n\n if (Array.isArray(arg)) {\n return new MoveVector(\n arg.map((item) => checkOrConvertArgument(item, param.value, position, genericTypeParams, moduleAbi)),\n );\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n }\n\n // Handle structs as they're more complex\n if (param.isStruct()) {\n if (param.isString()) {\n if (isString(arg)) {\n return new MoveString(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isObject()) {\n // The inner type of Object doesn't matter, since it's just syntactic sugar\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n // Support for Uint8Array coming from external sources\n if (arg && typeof arg === \"object\" && \"data\" in arg && arg.data instanceof Uint8Array) {\n return new AccountAddress(arg.data);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n // Handle known enum types from Aptos framework\n if (param.isDelegationKey() || param.isRateLimiter()) {\n if (arg instanceof Uint8Array) {\n return new FixedBytes(arg);\n }\n throwTypeMismatch(\"Uint8Array\", position);\n }\n\n if (param.isOption()) {\n if (isEmptyOption(arg)) {\n // Here we attempt to reconstruct the underlying type\n // Note, for some reason the `isBool` etc. does not work with the compiler\n const innerParam = param.value.typeArgs[0];\n if (innerParam instanceof TypeTagBool) {\n return new MoveOption<Bool>(null);\n }\n if (innerParam instanceof TypeTagAddress) {\n return new MoveOption<AccountAddress>(null);\n }\n if (innerParam instanceof TypeTagU8) {\n return new MoveOption<U8>(null);\n }\n if (innerParam instanceof TypeTagU16) {\n return new MoveOption<U16>(null);\n }\n if (innerParam instanceof TypeTagU32) {\n return new MoveOption<U32>(null);\n }\n if (innerParam instanceof TypeTagU64) {\n return new MoveOption<U64>(null);\n }\n if (innerParam instanceof TypeTagU128) {\n return new MoveOption<U128>(null);\n }\n if (innerParam instanceof TypeTagU256) {\n return new MoveOption<U256>(null);\n }\n\n // In all other cases, we will use a placeholder, it doesn't actually matter what the type is, but it will be obvious\n // Note: This is a placeholder U8 type, and does not match the actual type, as that can't be dynamically grabbed\n return new MoveOption<MoveString>(null);\n }\n\n return new MoveOption(\n checkOrConvertArgument(arg, param.value.typeArgs[0], position, genericTypeParams, moduleAbi),\n );\n }\n\n // We are assuming that fieldless structs are enums, and therefore we cannot typecheck any further due\n // to limited information from the ABI. This does not work for structs on other modules.\n const structDefinition = moduleAbi?.structs.find((s) => s.name === param.value.name.identifier);\n if (structDefinition?.fields.length === 0 && arg instanceof Uint8Array) {\n return new FixedBytes(arg);\n }\n\n if (arg instanceof Uint8Array && options?.allowUnknownStructs) {\n // eslint-disable-next-line no-console\n console.warn(\n // eslint-disable-next-line max-len\n `Unsupported struct input type for argument ${position}. Continuing since 'allowUnknownStructs' is enabled.`,\n );\n return new FixedBytes(arg);\n }\n\n throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n}\n\n/**\n * Checks that the type of the BCS encoded argument matches the ABI\n * @param param\n * @param arg\n * @param position\n * @group Implementation\n * @category Transactions\n */\nfunction checkType(param: TypeTag, arg: EntryFunctionArgumentTypes, position: number) {\n if (param.isBool()) {\n if (isBcsBool(arg)) {\n return;\n }\n throwTypeMismatch(\"Bool\", position);\n }\n if (param.isAddress()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isBcsU8(arg)) {\n return;\n }\n throwTypeMismatch(\"U8\", position);\n }\n if (param.isU16()) {\n if (isBcsU16(arg)) {\n return;\n }\n throwTypeMismatch(\"U16\", position);\n }\n if (param.isU32()) {\n if (isBcsU32(arg)) {\n return;\n }\n throwTypeMismatch(\"U32\", position);\n }\n if (param.isU64()) {\n if (isBcsU64(arg)) {\n return;\n }\n throwTypeMismatch(\"U64\", position);\n }\n if (param.isU128()) {\n if (isBcsU128(arg)) {\n return;\n }\n throwTypeMismatch(\"U128\", position);\n }\n if (param.isU256()) {\n if (isBcsU256(arg)) {\n return;\n }\n throwTypeMismatch(\"U256\", position);\n }\n if (param.isVector()) {\n if (arg instanceof MoveVector) {\n // If there's anything in it, check that the inner types match\n // Note that since it's typed, the first item should be the same as the rest\n if (arg.values.length > 0) {\n checkType(param.value, arg.values[0], position);\n }\n\n return;\n }\n throwTypeMismatch(\"MoveVector\", position);\n }\n\n // Handle structs as they're more complex\n if (param instanceof TypeTagStruct) {\n if (param.isString()) {\n if (isBcsString(arg)) {\n return;\n }\n throwTypeMismatch(\"MoveString\", position);\n }\n if (param.isObject()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isOption()) {\n if (arg instanceof MoveOption) {\n // If there's a value, we can check the inner type (otherwise it doesn't really matter)\n if (arg.value !== undefined) {\n checkType(param.value.typeArgs[0], arg.value, position);\n }\n return;\n }\n throwTypeMismatch(\"MoveOption\", position);\n }\n }\n\n throw new Error(`Type mismatch for argument ${position}, expected '${param.toString()}'`);\n}\n"],"mappings":"AAGA,OAAS,gBAAAA,MAAoB,oBAC7B,OAEE,kBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,cAAAC,EACA,eAAAC,EACA,cAAAC,EACA,cAAAC,EACA,aAAAC,MACK,aAUP,OAAS,QAAAC,EAAM,cAAAC,EAAY,cAAAC,EAAY,cAAAC,EAAY,cAAAC,EAAY,QAAAC,EAAM,OAAAC,EAAK,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ACA,GAAIG,EAAM,SAAS,EAAG,CACpB,GAAI1C,EAAasC,CAAG,EAClB,OAEFxB,EAAkB,iBAAkByB,CAAQ,CAC9C,CACA,GAAIG,EAAM,SAAS,EAAG,CACpB,GAAIJ,aAAelD,EAAY,CAEzBkD,EAAI,QAAU,QAChBM,EAAUF,EAAM,MAAM,SAAS,CAAC,EAAGJ,EAAI,MAAOC,CAAQ,EAExD,MACF,CACAzB,EAAkB,aAAcyB,CAAQ,CAC1C,CACF,CAEA,MAAM,IAAI,MAAM,8BAA8BA,CAAQ,eAAeG,EAAM,SAAS,CAAC,GAAG,CAC1F","names":["parseTypeTag","TypeTagAddress","TypeTagBool","TypeTagStruct","TypeTagU128","TypeTagU16","TypeTagU256","TypeTagU32","TypeTagU64","TypeTagU8","Bool","FixedBytes","MoveOption","MoveString","MoveVector","U128","U16","U256","U32","U64","U8","AccountAddress","getModule","findFirstNonSignerArg","isBcsAddress","isBcsBool","isBcsString","isBcsU128","isBcsU16","isBcsU256","isBcsU32","isBcsU64","isBcsU8","isBool","isEncodedEntryFunctionArgument","isLargeNumber","isEmptyOption","isString","throwTypeMismatch","convertNumber","TEXT_ENCODER","standardizeTypeTags","typeArguments","typeArg","fetchModuleAbi","moduleAddress","moduleName","aptosConfig","fetchFunctionAbi","functionName","moduleAbi","func","fetchMoveFunctionAbi","functionAbi","params","fetchEntryFunctionAbi","numSigners","i","fetchViewFunctionAbi","returnTypes","convertArgument","functionAbiOrModuleAbi","arg","position","genericTypeParams","options","param","checkOrConvertArgument","checkType","parseArg","num","genericIndex","item","innerParam"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{sha3_256 as A}from"@noble/hashes/sha3";import{RAW_TRANSACTION_SALT as T,RAW_TRANSACTION_WITH_DATA_SALT as o}from"../../utils/const";import{FeePayerRawTransaction as c,MultiAgentRawTransaction as y}from"../instances";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new y(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){const a=A.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);a.update(r);const s=a.digest(),i=e,t=new Uint8Array(s.length+i.length);return t.set(s),t.set(i,s.length),t}function R(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function l(e){const r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),o):e.secondarySignerAddresses?n(r.bcsToBytes(),o):n(r.bcsToBytes(),T)}export{d as deriveTransactionType,n as generateSigningMessage,R as generateSigningMessageForSerializable,l as generateSigningMessageForTransaction};
1
+ import{$a as c,Za as a,_a as b,ab as d}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as deriveTransactionType,b as generateSigningMessage,c as generateSigningMessageForSerializable,d as generateSigningMessageForTransaction};
2
2
  //# sourceMappingURL=signingMessage.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/transactions/transactionBuilder/signingMessage.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the generation of the signing message.\n * @group Implementation\n * @category Transactions\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from \"../../utils/const\";\nimport { FeePayerRawTransaction, MultiAgentRawTransaction } from \"../instances\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../types\";\nimport { Serializable } from \"../../bcs\";\n\n/**\n * Derives the appropriate raw transaction type based on the provided transaction details.\n * This function helps in identifying whether the transaction is a FeePayerRawTransaction,\n * MultiAgentRawTransaction, or a standard RawTransaction.\n *\n * @param transaction - An object representing an Aptos transaction, which may include:\n * - feePayerAddress - The address of the fee payer (optional).\n * - secondarySignerAddresses - An array of secondary signer addresses (optional).\n * - rawTransaction - The raw transaction data.\n *\n * @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction\n * @group Implementation\n * @category Transactions\n */\nexport function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {\n if (transaction.feePayerAddress) {\n return new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n }\n if (transaction.secondarySignerAddresses) {\n return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);\n }\n\n return transaction.rawTransaction;\n}\n\n/**\n * Generates the 'signing message' form of a message to be signed.\n * This function combines a domain separator with the byte representation of the message to create a signing message.\n *\n * @param bytes - The byte representation of the message to be signed and sent to the chain.\n * @param domainSeparator - A domain separator that starts with 'APTOS::'.\n *\n * @returns The Uint8Array of the signing message.\n * @group Implementation\n * @category Transactions\n */\nexport function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array {\n const hash = sha3Hash.create();\n\n if (!domainSeparator.startsWith(\"APTOS::\")) {\n throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${domainSeparator}`);\n }\n\n hash.update(domainSeparator);\n\n const prefix = hash.digest();\n\n const body = bytes;\n\n const mergedArray = new Uint8Array(prefix.length + body.length);\n mergedArray.set(prefix);\n mergedArray.set(body, prefix.length);\n\n return mergedArray;\n}\n\n/**\n * @deprecated\n * Use CryptoHashable instead by having your class implement it and call hash() to get the signing message.\n *\n * Generates the 'signing message' form of a serializable value by serializing it and using the constructor name as the domain\n * separator.\n *\n * @param serializable - An object that has a BCS serialized form.\n *\n * @returns The Uint8Array of the signing message.\n * @group Implementation\n * @category Transactions\n */\nexport function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array {\n return generateSigningMessage(serializable.bcsToBytes(), `APTOS::${serializable.constructor.name}`);\n}\n\n/**\n * Generates the 'signing message' form of a transaction by deriving the type of transaction and applying the appropriate domain\n * separator based on the presence of a fee payer or secondary signers.\n *\n * @param transaction - A transaction that is to be signed, which can include a fee payer address or secondary signer addresses.\n *\n * @returns The Uint8Array of the signing message.\n * @group Implementation\n * @category Transactions\n */\nexport function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array {\n const rawTxn = deriveTransactionType(transaction);\n if (transaction.feePayerAddress) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n if (transaction.secondarySignerAddresses) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_SALT);\n}\n"],"mappings":"AAQA,OAAS,YAAYA,MAAgB,qBACrC,OAAS,wBAAAC,EAAsB,kCAAAC,MAAsC,oBACrE,OAAS,0BAAAC,EAAwB,4BAAAC,MAAgC,eAkB1D,SAASC,EAAsBC,EAA2D,CAC/F,OAAIA,EAAY,gBACP,IAAIH,EACTG,EAAY,eACZA,EAAY,0BAA4B,CAAC,EACzCA,EAAY,eACd,EAEEA,EAAY,yBACP,IAAIF,EAAyBE,EAAY,eAAgBA,EAAY,wBAAwB,EAG/FA,EAAY,cACrB,CAaO,SAASC,EAAuBC,EAAmBC,EAAqC,CAC7F,MAAMC,EAAOV,EAAS,OAAO,EAE7B,GAAI,CAACS,EAAgB,WAAW,SAAS,EACvC,MAAM,IAAI,MAAM,+DAA+DA,CAAe,EAAE,EAGlGC,EAAK,OAAOD,CAAe,EAE3B,MAAME,EAASD,EAAK,OAAO,EAErBE,EAAOJ,EAEPK,EAAc,IAAI,WAAWF,EAAO,OAASC,EAAK,MAAM,EAC9D,OAAAC,EAAY,IAAIF,CAAM,EACtBE,EAAY,IAAID,EAAMD,EAAO,MAAM,EAE5BE,CACT,CAeO,SAASC,EAAsCC,EAAwC,CAC5F,OAAOR,EAAuBQ,EAAa,WAAW,EAAG,UAAUA,EAAa,YAAY,IAAI,EAAE,CACpG,CAYO,SAASC,EAAqCV,EAA4C,CAC/F,MAAMW,EAASZ,EAAsBC,CAAW,EAChD,OAAIA,EAAY,gBACPC,EAAuBU,EAAO,WAAW,EAAGf,CAA8B,EAE/EI,EAAY,yBACPC,EAAuBU,EAAO,WAAW,EAAGf,CAA8B,EAE5EK,EAAuBU,EAAO,WAAW,EAAGhB,CAAoB,CACzE","names":["sha3Hash","RAW_TRANSACTION_SALT","RAW_TRANSACTION_WITH_DATA_SALT","FeePayerRawTransaction","MultiAgentRawTransaction","deriveTransactionType","transaction","generateSigningMessage","bytes","domainSeparator","hash","prefix","body","mergedArray","generateSigningMessageForSerializable","serializable","generateSigningMessageForTransaction","rawTxn"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
- import { b4 as InputScriptData, ae as TransactionPayloadScript, b1 as InputEntryFunctionDataWithRemoteABI, af as TransactionPayloadEntryFunction, b3 as InputMultiSigDataWithRemoteABI, ag as TransactionPayloadMultiSig, a$ as InputEntryFunctionDataWithABI, b0 as InputMultiSigDataWithABI, b8 as InputViewFunctionDataWithRemoteABI, ah as EntryFunction, b9 as InputViewFunctionDataWithABI, A as AptosConfig, m as AccountAddressInput, aW as AnyTransactionPayloadInstance, aT as InputGenerateTransactionOptions, a5 as RawTransaction, al as TransactionInnerPayload, bd as InputGenerateSingleSignerRawTransactionArgs, at as SimpleTransaction, be as InputGenerateMultiAgentRawTransactionArgs, au as MultiAgentTransaction, bh as InputSimulateTransactionData, C as PublicKey, X as AccountAuthenticatorEd25519, Z as AccountAuthenticatorSingleKey, _ as AccountAuthenticatorMultiKey, $ as AccountAuthenticatorNoAccountAuthenticator, bn as InputSubmitTransactionData } from '../../account-BortO8g2.mjs';
1
+ import { b4 as InputScriptData, ae as TransactionPayloadScript, b1 as InputEntryFunctionDataWithRemoteABI, af as TransactionPayloadEntryFunction, b3 as InputMultiSigDataWithRemoteABI, ag as TransactionPayloadMultiSig, a$ as InputEntryFunctionDataWithABI, b0 as InputMultiSigDataWithABI, b8 as InputViewFunctionDataWithRemoteABI, ah as EntryFunction, b9 as InputViewFunctionDataWithABI, A as AptosConfig, m as AccountAddressInput, aW as AnyTransactionPayloadInstance, aT as InputGenerateTransactionOptions, a5 as RawTransaction, al as TransactionInnerPayload, bd as InputGenerateSingleSignerRawTransactionArgs, at as SimpleTransaction, be as InputGenerateMultiAgentRawTransactionArgs, au as MultiAgentTransaction, bh as InputSimulateTransactionData, C as PublicKey, $ as AccountAuthenticatorNoAccountAuthenticator, X as AccountAuthenticatorEd25519, Z as AccountAuthenticatorSingleKey, _ as AccountAuthenticatorMultiKey, bn as InputSubmitTransactionData } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -149,7 +149,7 @@ declare function generateSignedTransactionForSimulation(args: InputSimulateTrans
149
149
  * @group Implementation
150
150
  * @category Transactions
151
151
  */
152
- declare function getAuthenticatorForSimulation(publicKey?: PublicKey): AccountAuthenticatorEd25519 | AccountAuthenticatorSingleKey | AccountAuthenticatorMultiKey | AccountAuthenticatorNoAccountAuthenticator;
152
+ declare function getAuthenticatorForSimulation(publicKey?: PublicKey): AccountAuthenticatorNoAccountAuthenticator | AccountAuthenticatorEd25519 | AccountAuthenticatorSingleKey | AccountAuthenticatorMultiKey;
153
153
  /**
154
154
  * Generate a signed transaction ready for submission to the blockchain.
155
155
  * This function prepares the transaction by authenticating the sender and any additional signers based on the provided arguments.
@@ -1,2 +1,2 @@
1
- import{sha3_256 as X}from"@noble/hashes/sha3";import{AccountAddress as d,Hex as F}from"../../core";import{AnyPublicKey as D,AnySignature as l,KeylessPublicKey as w,KeylessSignature as N,Secp256k1PublicKey as Z,FederatedKeylessPublicKey as M,MultiKey as j,MultiKeySignature as J}from"../../core/crypto";import{Ed25519PublicKey as Q,Ed25519Signature as Y}from"../../core/crypto/ed25519";import{getInfo as nn}from"../../internal/utils";import{getLedgerInfo as tn}from"../../internal/general";import{getGasPriceEstimation as en}from"../../internal/transaction";import{NetworkToChainId as R}from"../../utils/apiEndpoints";import{normalizeBundle as an}from"../../utils/normalizeBundle";import{AccountAuthenticator as rn,AccountAuthenticatorEd25519 as h,AccountAuthenticatorMultiEd25519 as on,AccountAuthenticatorMultiKey as $,AccountAuthenticatorNoAccountAuthenticator as K,AccountAuthenticatorSingleKey as T}from"../authenticator/account";import{TransactionAuthenticatorEd25519 as W,TransactionAuthenticatorFeePayer as G,TransactionAuthenticatorMultiAgent as C,TransactionAuthenticatorMultiEd25519 as sn,TransactionAuthenticatorSingleSender as P}from"../authenticator/transaction";import{ChainId as cn,EntryFunction as I,FeePayerRawTransaction as un,MultiAgentRawTransaction as dn,MultiSig as fn,MultiSigTransactionPayload as yn,RawTransaction as mn,Script as ln,TransactionPayloadEntryFunction as U,TransactionPayloadMultiSig as _,TransactionPayloadScript as k}from"../instances";import{SignedTransaction as A}from"../instances/signedTransaction";import{convertArgument as v,fetchEntryFunctionAbi as An,fetchViewFunctionAbi as pn,standardizeTypeTags as S}from"./remoteAbi";import{memoizeAsync as gn}from"../../utils/memoize";import{isScriptDataInput as wn}from"./helpers";import{SimpleTransaction as hn}from"../instances/simpleTransaction";import{MultiAgentTransaction as Tn}from"../instances/multiAgentTransaction";import{getFunctionParts as p}from"../../utils/helpers";import{TransactionExecutableEmpty as Pn,TransactionExecutableEntryFunction as V,TransactionExecutableScript as In,TransactionExtraConfigV1 as b,TransactionInnerPayloadV1 as x}from"../instances/transactionPayload";async function bt(n){if(wn(n))return xn(n);const{moduleAddress:e,moduleName:t,functionName:i}=p(n.function),a=await O({key:"entry-function",moduleAddress:e,moduleName:t,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:An});return Sn({...n,abi:a})}function Sn(n){const e=n.abi,{moduleAddress:t,moduleName:i,functionName:a}=p(n.function),r=S(n.typeArguments);if(r.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${r.length}`);const o=n.functionArguments.map((s,u)=>v(n.function,e,s,u,r));if(o.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${i}::${a}', expected ${e.parameters.length} but got ${o.length}`);const c=I.build(`${t}::${i}`,a,r,o);if("multisigAddress"in n){const s=d.from(n.multisigAddress);return new _(new fn(s,new yn(c)))}return new U(c)}async function xt(n){const{moduleAddress:e,moduleName:t,functionName:i}=p(n.function),a=await O({key:"view-function",moduleAddress:e,moduleName:t,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:pn});return bn({abi:a,...n})}function bn(n){const e=n.abi,{moduleAddress:t,moduleName:i,functionName:a}=p(n.function),r=S(n.typeArguments);if(r.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${r.length}`);const o=n?.functionArguments?.map((c,s)=>v(n.function,e,c,s,r))??[];if(o.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${i}::${a}', expected ${e.parameters.length} but got ${o.length}`);return I.build(`${t}::${i}`,a,r,o)}function xn(n){return new k(new ln(F.fromHexInput(n.bytecode).toUint8Array(),S(n.typeArguments),n.functionArguments))}async function En(n){const{aptosConfig:e,sender:t,payload:i,options:a,feePayerAddress:r}=n;if(a?.replayProtectionNonce!==void 0&&a?.accountSequenceNumber!==void 0)throw new Error("Cannot specify both replayProtectionNonce and accountSequenceNumber in options.");const o=async()=>R[e.network]?{chainId:R[e.network]}:{chainId:(await tn({aptosConfig:e})).chain_id},c=async()=>a?.gasUnitPrice?{gasEstimate:a.gasUnitPrice}:{gasEstimate:(await en({aptosConfig:e})).gas_estimate},s=async()=>{const m=async()=>a?.accountSequenceNumber!==void 0?a.accountSequenceNumber:a?.replayProtectionNonce!==void 0?0xdeadbeefn:(await nn({aptosConfig:e,accountAddress:t})).sequence_number;if(r&&d.from(r).equals(d.ZERO))try{return await m()}catch{return 0}else return m()},[{chainId:u},{gasEstimate:y},g]=await Promise.all([o(),c(),s()]),{maxGasAmount:H,gasUnitPrice:z,expireTimestamp:L,replayProtectionNonce:E}={maxGasAmount:a?.maxGasAmount?BigInt(a.maxGasAmount):BigInt(e.getDefaultMaxGasAmount()),gasUnitPrice:a?.gasUnitPrice??BigInt(y),expireTimestamp:a?.expireTimestamp??BigInt(Math.floor(Date.now()/1e3)+e.getDefaultTxnExpirySecFromNow()),replayProtectionNonce:a?.replayProtectionNonce?BigInt(a.replayProtectionNonce):void 0};let B=i;return E!==void 0&&(B=Bn(i,E)),new mn(d.from(t),BigInt(g),B,BigInt(H),BigInt(z),BigInt(L),new cn(u))}function Bn(n,e){if(n instanceof k)return new x(new In(n.script),new b(void 0,e));if(n instanceof U)return new x(new V(n.entryFunction),new b(void 0,e));if(n instanceof _){const t=n.multiSig.transaction_payload;let i;if(t===void 0||t?.transaction_payload===void 0)i=new Pn;else if(t.transaction_payload instanceof I)i=new V(t.transaction_payload);else throw new Error("Scripts are not supported in multi-sig transactions.");return new x(i,new b(n.multiSig.multisig_address,e))}else throw new Error(`Unsupported payload type: ${n}`)}async function Et(n){const{aptosConfig:e,sender:t,payload:i,options:a,feePayerAddress:r}=n,o=await En({aptosConfig:e,sender:t,payload:i,options:a,feePayerAddress:r});if("secondarySignerAddresses"in n){const c=n.secondarySignerAddresses?.map(s=>d.from(s))??[];return new Tn(o,c,n.feePayerAddress?d.from(n.feePayerAddress):void 0)}return new hn(o,n.feePayerAddress?d.from(n.feePayerAddress):void 0)}function Bt(n){const{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:i,feePayerPublicKey:a}=n,r=f(e);if(t.feePayerAddress){const c=new un(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress);let s=[];t.secondarySignerAddresses&&(i?s=i.map(g=>f(g)):s=Array.from({length:t.secondarySignerAddresses.length},()=>f(void 0)));const u=f(a),y=new G(r,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:u});return new A(c.raw_txn,y).bcsToBytes()}if(t.secondarySignerAddresses){const c=new dn(t.rawTransaction,t.secondarySignerAddresses);let s=[];i?s=i.map(y=>f(y)):s=Array.from({length:t.secondarySignerAddresses.length},()=>f(void 0));const u=new C(r,t.secondarySignerAddresses,s);return new A(c.raw_txn,u).bcsToBytes()}let o;if(r instanceof h)o=new W(r.public_key,r.signature);else if(r instanceof T||r instanceof $)o=new P(r);else if(r instanceof K)o=new P(r);else throw new Error("Invalid public key");return new A(t.rawTransaction,o).bcsToBytes()}function f(n){if(!n)return new K;const t=w.isInstance(n)||M.isInstance(n)||Z.isInstance(n)?new D(n):n,i=new Y(new Uint8Array(64));if(Q.isInstance(t))return new h(t,i);if(D.isInstance(t))return w.isInstance(t.publicKey)?new T(t,new l(N.getSimulationSignature())):new T(t,new l(i));if(j.isInstance(t))return new $(t,new J({signatures:t.publicKeys.map(a=>w.isInstance(a.publicKey)||M.isInstance(a.publicKey)?new l(N.getSimulationSignature()):new l(i)),bitmap:t.createBitmap({bits:Array(t.publicKeys.length).fill(0).map((a,r)=>r)})}));throw new Error("Unsupported PublicKey used for simulations")}function Fn(n){const{transaction:e,feePayerAuthenticator:t,additionalSignersAuthenticators:i}=n,a=an(rn,n.senderAuthenticator);let r;if(e.feePayerAddress){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");r=new G(a,e.secondarySignerAddresses??[],i??[],{address:e.feePayerAddress,authenticator:t})}else if(e.secondarySignerAddresses){if(!i)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");r=new C(a,e.secondarySignerAddresses,i)}else a instanceof h?r=new W(a.public_key,a.signature):a instanceof on?r=new sn(a.public_key,a.signature):r=new P(a);return new A(e.rawTransaction,r).bcsToBytes()}function q(n){const e=X.create();for(const t of n)e.update(t);return e.digest()}const Dn=q(["APTOS::Transaction"]);function Ft(n){const e=Fn(n);return new F(q([Dn,new Uint8Array([0]),e])).toString()}async function O({key:n,moduleAddress:e,moduleName:t,functionName:i,aptosConfig:a,abi:r,fetch:o}){return r!==void 0?r:gn(async()=>o(e,t,i,a),`${n}-${a.network}-${e}-${t}-${i}`,1e3*60*5)()}export{Et as buildTransaction,Bn as convertPayloadToInnerPayload,En as generateRawTransaction,Fn as generateSignedTransaction,Bt as generateSignedTransactionForSimulation,bt as generateTransactionPayload,Sn as generateTransactionPayloadWithABI,Ft as generateUserTransactionHash,xt as generateViewFunctionPayload,bn as generateViewFunctionPayloadWithABI,f as getAuthenticatorForSimulation,q as hashValues};
1
+ import{$b as f,Wb as a,Xb as b,Yb as c,Zb as d,_b as e,ac as g,bc as h,cc as i,dc as j,ec as k,fc as l}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{g as buildTransaction,f as convertPayloadToInnerPayload,e as generateRawTransaction,j as generateSignedTransaction,h as generateSignedTransactionForSimulation,a as generateTransactionPayload,b as generateTransactionPayloadWithABI,l as generateUserTransactionHash,c as generateViewFunctionPayload,d as generateViewFunctionPayloadWithABI,i as getAuthenticatorForSimulation,k as hashValues};
2
2
  //# sourceMappingURL=transactionBuilder.mjs.map