@aptos-labs/ts-sdk 1.22.2 → 1.24.0

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 (322) hide show
  1. package/dist/common/{accountAddress-NYtf3uZq.d.ts → accountAddress-D9blTwwp.d.ts} +57 -15
  2. package/dist/common/cli/index.d.ts +1 -1
  3. package/dist/common/index.d.ts +41 -16
  4. package/dist/common/index.js +28 -26
  5. package/dist/common/index.js.map +1 -1
  6. package/dist/esm/account/Account.mjs +1 -1
  7. package/dist/esm/account/Ed25519Account.mjs +1 -1
  8. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  9. package/dist/esm/account/KeylessAccount.d.mts +13 -2
  10. package/dist/esm/account/KeylessAccount.mjs +1 -1
  11. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  12. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  13. package/dist/esm/account/index.mjs +1 -1
  14. package/dist/esm/api/account.d.mts +4 -1
  15. package/dist/esm/api/account.mjs +1 -1
  16. package/dist/esm/api/ans.mjs +1 -1
  17. package/dist/esm/api/aptos.mjs +1 -1
  18. package/dist/esm/api/aptosConfig.mjs +1 -1
  19. package/dist/esm/api/coin.mjs +1 -1
  20. package/dist/esm/api/digitalAsset.mjs +1 -1
  21. package/dist/esm/api/event.mjs +1 -1
  22. package/dist/esm/api/faucet.mjs +1 -1
  23. package/dist/esm/api/fungibleAsset.mjs +1 -1
  24. package/dist/esm/api/general.mjs +1 -1
  25. package/dist/esm/api/index.mjs +1 -1
  26. package/dist/esm/api/keyless.mjs +1 -1
  27. package/dist/esm/api/object.mjs +1 -1
  28. package/dist/esm/api/staking.mjs +1 -1
  29. package/dist/esm/api/table.mjs +1 -1
  30. package/dist/esm/api/transaction.mjs +1 -1
  31. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  32. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  33. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  34. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  35. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  36. package/dist/esm/api/utils.mjs +1 -1
  37. package/dist/esm/bcs/index.mjs +1 -1
  38. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  39. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  40. package/dist/esm/{chunk-GGU4XOUO.mjs → chunk-25ZFJIIK.mjs} +2 -2
  41. package/dist/esm/chunk-2BJ23DXY.mjs +2 -0
  42. package/dist/esm/chunk-2BJ23DXY.mjs.map +1 -0
  43. package/dist/esm/chunk-375GMLWG.mjs +2 -0
  44. package/dist/esm/chunk-375GMLWG.mjs.map +1 -0
  45. package/dist/esm/chunk-3A6HUKXW.mjs +2 -0
  46. package/dist/esm/{chunk-Y2DHN4CV.mjs.map → chunk-3A6HUKXW.mjs.map} +1 -1
  47. package/dist/esm/{chunk-DM6HVA4K.mjs → chunk-3XFAQ6KR.mjs} +2 -2
  48. package/dist/esm/chunk-4GETVCGY.mjs +2 -0
  49. package/dist/esm/chunk-4GETVCGY.mjs.map +1 -0
  50. package/dist/esm/chunk-4LQKLXHW.mjs +2 -0
  51. package/dist/esm/chunk-4LQKLXHW.mjs.map +1 -0
  52. package/dist/esm/{chunk-K7Y2SC65.mjs → chunk-4TXG2LSP.mjs} +2 -2
  53. package/dist/esm/chunk-4YR6QO63.mjs +2 -0
  54. package/dist/esm/chunk-4YR6QO63.mjs.map +1 -0
  55. package/dist/esm/{chunk-UYF7AQLE.mjs → chunk-5JTED2JJ.mjs} +2 -2
  56. package/dist/esm/chunk-75U3LEBF.mjs +2 -0
  57. package/dist/esm/chunk-75U3LEBF.mjs.map +1 -0
  58. package/dist/esm/{chunk-OYLT6IVC.mjs → chunk-7X67Z6NJ.mjs} +2 -2
  59. package/dist/esm/chunk-ALRQRVDX.mjs +2 -0
  60. package/dist/esm/chunk-ALRQRVDX.mjs.map +1 -0
  61. package/dist/esm/{chunk-FC7IRFFN.mjs → chunk-AVNNYI7R.mjs} +2 -2
  62. package/dist/esm/{chunk-VBPDZZXC.mjs → chunk-BSAYHZ2R.mjs} +2 -2
  63. package/dist/esm/{chunk-RFMLKHUD.mjs → chunk-BTLHVOIC.mjs} +2 -2
  64. package/dist/esm/chunk-C6VIBT2D.mjs +2 -0
  65. package/dist/esm/{chunk-QA7VTFUT.mjs.map → chunk-C6VIBT2D.mjs.map} +1 -1
  66. package/dist/esm/chunk-CDLMUY5H.mjs +2 -0
  67. package/dist/esm/chunk-CDLMUY5H.mjs.map +1 -0
  68. package/dist/esm/{chunk-WL4FXFAM.mjs → chunk-CNNDK6OL.mjs} +2 -2
  69. package/dist/esm/{chunk-B6PLCJJ2.mjs → chunk-CQPJZUKQ.mjs} +2 -2
  70. package/dist/esm/{chunk-EKZHYOQH.mjs → chunk-CSW2QEVU.mjs} +2 -2
  71. package/dist/esm/{chunk-Z4OZBMSL.mjs → chunk-D3PBEHCP.mjs} +2 -2
  72. package/dist/esm/{chunk-EIKBYKIJ.mjs → chunk-DAZTLM55.mjs} +2 -2
  73. package/dist/esm/{chunk-XYWMFCL6.mjs → chunk-ETWZV5XK.mjs} +2 -2
  74. package/dist/esm/{chunk-2ZAYK464.mjs → chunk-FAHN3AZI.mjs} +2 -2
  75. package/dist/esm/{chunk-IMF5XUVW.mjs → chunk-FFF7M7E4.mjs} +2 -2
  76. package/dist/esm/{chunk-37Y7VAN7.mjs → chunk-G23ZPQCJ.mjs} +2 -2
  77. package/dist/esm/{chunk-77NXCSLY.mjs → chunk-G5MGSV7Y.mjs} +2 -2
  78. package/dist/esm/{chunk-5IRM54PL.mjs → chunk-GJWCKVN5.mjs} +2 -2
  79. package/dist/esm/{chunk-JY5LTRTM.mjs → chunk-GK7TQDBN.mjs} +2 -2
  80. package/dist/esm/{chunk-W5ZII3JO.mjs → chunk-GLUCMQZK.mjs} +2 -2
  81. package/dist/esm/{chunk-HFOLSSAQ.mjs → chunk-GYIYUBYT.mjs} +2 -2
  82. package/dist/esm/{chunk-5E672SHG.mjs → chunk-HBECYNQ6.mjs} +2 -2
  83. package/dist/esm/{chunk-5E672SHG.mjs.map → chunk-HBECYNQ6.mjs.map} +1 -1
  84. package/dist/esm/{chunk-GCPWPGCS.mjs → chunk-HKMG3LZX.mjs} +2 -2
  85. package/dist/esm/{chunk-XBTCOCZJ.mjs → chunk-HLXD3KWO.mjs} +2 -2
  86. package/dist/esm/{chunk-UIJK42CX.mjs → chunk-HWYAQTV3.mjs} +2 -2
  87. package/dist/esm/{chunk-6XCZ56O7.mjs → chunk-IG7R65TF.mjs} +2 -2
  88. package/dist/esm/{chunk-PVEPP4HR.mjs → chunk-INZXND6M.mjs} +2 -2
  89. package/dist/esm/{chunk-CPCS5KIA.mjs → chunk-ISUHNAU4.mjs} +2 -2
  90. package/dist/esm/{chunk-XT2VVDT3.mjs → chunk-J2YQTDZL.mjs} +2 -2
  91. package/dist/esm/{chunk-O4O7HSUQ.mjs → chunk-JDTU6Z6C.mjs} +2 -2
  92. package/dist/esm/{chunk-BN2PXCFR.mjs → chunk-LKLHNQF5.mjs} +2 -2
  93. package/dist/esm/{chunk-C2IJG37E.mjs → chunk-MULJ2GLJ.mjs} +2 -2
  94. package/dist/esm/{chunk-XFBB7YYI.mjs → chunk-NV5YQZ3R.mjs} +2 -2
  95. package/dist/esm/{chunk-3VUSIKCF.mjs → chunk-NWOMSL6K.mjs} +2 -2
  96. package/dist/esm/{chunk-OTK3HBAU.mjs → chunk-O2M3QKKS.mjs} +2 -2
  97. package/dist/esm/{chunk-BF46IXHH.mjs → chunk-OHRL766V.mjs} +2 -2
  98. package/dist/esm/chunk-OHRL766V.mjs.map +1 -0
  99. package/dist/esm/{chunk-4EPLOSKY.mjs → chunk-PR6363Y6.mjs} +2 -2
  100. package/dist/esm/{chunk-U7I7YKWD.mjs → chunk-PSCDBITI.mjs} +2 -2
  101. package/dist/esm/chunk-QFORDQCU.mjs +2 -0
  102. package/dist/esm/chunk-QFORDQCU.mjs.map +1 -0
  103. package/dist/esm/{chunk-U2QQD2ER.mjs → chunk-QITCB4PW.mjs} +2 -2
  104. package/dist/esm/chunk-QITCB4PW.mjs.map +1 -0
  105. package/dist/esm/{chunk-NRAQZUD5.mjs → chunk-QNTQPWLK.mjs} +2 -2
  106. package/dist/esm/{chunk-D6WTINSF.mjs → chunk-QQWBR4SK.mjs} +2 -2
  107. package/dist/esm/{chunk-FEGCUPGO.mjs → chunk-QVJV46XS.mjs} +2 -2
  108. package/dist/esm/{chunk-6AJLTBXC.mjs → chunk-RP5444TL.mjs} +2 -2
  109. package/dist/esm/{chunk-OAKHR7AG.mjs → chunk-S36XP4IE.mjs} +2 -2
  110. package/dist/esm/{chunk-RFA7BIDN.mjs → chunk-SUJLWCRN.mjs} +2 -2
  111. package/dist/esm/{chunk-4ZXCQXVC.mjs → chunk-TBJ7W5NC.mjs} +2 -2
  112. package/dist/esm/chunk-TDGQGILY.mjs +2 -0
  113. package/dist/esm/chunk-TDGQGILY.mjs.map +1 -0
  114. package/dist/esm/{chunk-EPVAT625.mjs → chunk-TX2IYMFV.mjs} +2 -2
  115. package/dist/esm/chunk-UC5BZJ23.mjs +2 -0
  116. package/dist/esm/chunk-UC5BZJ23.mjs.map +1 -0
  117. package/dist/esm/{chunk-GEP4HPQ6.mjs → chunk-URCQOJ55.mjs} +2 -2
  118. package/dist/esm/{chunk-6DDSU7HN.mjs → chunk-V3OYNKY5.mjs} +2 -2
  119. package/dist/esm/{chunk-YMFEA2TJ.mjs → chunk-VHNX2NUR.mjs} +3 -1
  120. package/dist/esm/chunk-VHNX2NUR.mjs.map +1 -0
  121. package/dist/esm/chunk-VTPF7AYM.mjs +2 -0
  122. package/dist/esm/chunk-VTPF7AYM.mjs.map +1 -0
  123. package/dist/esm/{chunk-WTJCMD4D.mjs → chunk-VTTT2G7F.mjs} +2 -2
  124. package/dist/esm/{chunk-YDXU6ALO.mjs → chunk-WMHYIP3S.mjs} +2 -2
  125. package/dist/esm/{chunk-OPGMT27G.mjs → chunk-WRRQ7L5K.mjs} +2 -2
  126. package/dist/esm/{chunk-BF3D6ADE.mjs → chunk-WUJ7XNQD.mjs} +2 -2
  127. package/dist/esm/{chunk-EOJWPF3P.mjs → chunk-X27JKATG.mjs} +2 -2
  128. package/dist/esm/{chunk-XWAOZPIP.mjs → chunk-XVJI5XXW.mjs} +2 -2
  129. package/dist/esm/{chunk-TY4IEDJD.mjs → chunk-YDZBU2DJ.mjs} +2 -2
  130. package/dist/esm/{chunk-RS2FIBMQ.mjs → chunk-YMVD7Z7Z.mjs} +2 -2
  131. package/dist/esm/{chunk-6TWRNWC3.mjs → chunk-ZW2R6VQE.mjs} +2 -2
  132. package/dist/esm/cli/index.mjs +1 -1
  133. package/dist/esm/client/core.d.mts +2 -2
  134. package/dist/esm/client/core.mjs +1 -1
  135. package/dist/esm/client/get.mjs +1 -1
  136. package/dist/esm/client/index.mjs +1 -1
  137. package/dist/esm/client/post.mjs +1 -1
  138. package/dist/esm/client/types.d.mts +8 -1
  139. package/dist/esm/client/types.mjs +1 -1
  140. package/dist/esm/core/account/index.mjs +1 -1
  141. package/dist/esm/core/account/utils/address.mjs +1 -1
  142. package/dist/esm/core/account/utils/index.mjs +1 -1
  143. package/dist/esm/core/accountAddress.d.mts +1 -0
  144. package/dist/esm/core/accountAddress.mjs +1 -1
  145. package/dist/esm/core/authenticationKey.mjs +1 -1
  146. package/dist/esm/core/crypto/ed25519.d.mts +10 -9
  147. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  148. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  149. package/dist/esm/core/crypto/index.d.mts +1 -1
  150. package/dist/esm/core/crypto/index.mjs +1 -1
  151. package/dist/esm/core/crypto/keyless.d.mts +1 -0
  152. package/dist/esm/core/crypto/keyless.mjs +1 -1
  153. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  154. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  155. package/dist/esm/core/crypto/proof.mjs +1 -1
  156. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  157. package/dist/esm/core/crypto/secp256k1.d.mts +1 -0
  158. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  159. package/dist/esm/core/crypto/signature.mjs +1 -1
  160. package/dist/esm/core/crypto/singleKey.d.mts +2 -0
  161. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  162. package/dist/esm/core/index.d.mts +1 -1
  163. package/dist/esm/core/index.mjs +1 -1
  164. package/dist/esm/index.d.mts +2 -2
  165. package/dist/esm/index.mjs +1 -1
  166. package/dist/esm/internal/account.d.mts +2 -1
  167. package/dist/esm/internal/account.mjs +1 -1
  168. package/dist/esm/internal/ans.d.mts +17 -1
  169. package/dist/esm/internal/ans.mjs +1 -1
  170. package/dist/esm/internal/coin.mjs +1 -1
  171. package/dist/esm/internal/digitalAsset.mjs +1 -1
  172. package/dist/esm/internal/event.mjs +1 -1
  173. package/dist/esm/internal/faucet.mjs +1 -1
  174. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  175. package/dist/esm/internal/general.mjs +1 -1
  176. package/dist/esm/internal/keyless.mjs +1 -1
  177. package/dist/esm/internal/object.mjs +1 -1
  178. package/dist/esm/internal/staking.mjs +1 -1
  179. package/dist/esm/internal/table.mjs +1 -1
  180. package/dist/esm/internal/transaction.mjs +1 -1
  181. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  182. package/dist/esm/internal/view.mjs +1 -1
  183. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  184. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  185. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  186. package/dist/esm/transactions/index.mjs +1 -1
  187. package/dist/esm/transactions/instances/index.mjs +1 -1
  188. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  189. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  190. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  191. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  192. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  193. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  194. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  195. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  196. package/dist/esm/transactions/management/index.mjs +1 -1
  197. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  198. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  199. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  200. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  201. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  202. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  203. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  204. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  205. package/dist/esm/types/generated/operations.d.mts +16 -12
  206. package/dist/esm/types/generated/queries.d.mts +2 -2
  207. package/dist/esm/types/generated/queries.mjs +1 -1
  208. package/dist/esm/types/generated/types.d.mts +365 -761
  209. package/dist/esm/types/generated/types.mjs +1 -1
  210. package/dist/esm/types/generated/types.mjs.map +1 -1
  211. package/dist/esm/types/index.d.mts +42 -3
  212. package/dist/esm/types/index.mjs +1 -1
  213. package/dist/esm/utils/index.mjs +1 -1
  214. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  215. package/dist/esm/version.d.mts +1 -1
  216. package/dist/esm/version.mjs +1 -1
  217. package/package.json +2 -1
  218. package/src/account/KeylessAccount.ts +20 -4
  219. package/src/api/account.ts +4 -1
  220. package/src/api/faucet.ts +6 -1
  221. package/src/client/core.ts +25 -52
  222. package/src/client/types.ts +60 -7
  223. package/src/core/accountAddress.ts +8 -6
  224. package/src/core/crypto/ed25519.ts +28 -28
  225. package/src/core/crypto/ephemeral.ts +1 -1
  226. package/src/core/crypto/keyless.ts +9 -0
  227. package/src/core/crypto/secp256k1.ts +4 -3
  228. package/src/core/crypto/singleKey.ts +20 -1
  229. package/src/internal/account.ts +35 -4
  230. package/src/internal/ans.ts +36 -4
  231. package/src/internal/queries/ansTokenFragment.graphql +2 -0
  232. package/src/transactions/transactionBuilder/transactionBuilder.ts +17 -27
  233. package/src/types/generated/operations.ts +16 -12
  234. package/src/types/generated/queries.ts +2 -0
  235. package/src/types/generated/types.ts +387 -835
  236. package/src/types/index.ts +48 -1
  237. package/src/version.ts +1 -1
  238. package/dist/esm/chunk-42XNGDUC.mjs +0 -2
  239. package/dist/esm/chunk-42XNGDUC.mjs.map +0 -1
  240. package/dist/esm/chunk-6ZQWPHLV.mjs +0 -2
  241. package/dist/esm/chunk-6ZQWPHLV.mjs.map +0 -1
  242. package/dist/esm/chunk-7LY73OAN.mjs +0 -2
  243. package/dist/esm/chunk-7LY73OAN.mjs.map +0 -1
  244. package/dist/esm/chunk-A2Z7I2EY.mjs +0 -2
  245. package/dist/esm/chunk-A2Z7I2EY.mjs.map +0 -1
  246. package/dist/esm/chunk-BF46IXHH.mjs.map +0 -1
  247. package/dist/esm/chunk-FPDE5EYE.mjs +0 -2
  248. package/dist/esm/chunk-FPDE5EYE.mjs.map +0 -1
  249. package/dist/esm/chunk-GHYE26Q5.mjs +0 -2
  250. package/dist/esm/chunk-GHYE26Q5.mjs.map +0 -1
  251. package/dist/esm/chunk-H4XMI4WZ.mjs +0 -2
  252. package/dist/esm/chunk-H4XMI4WZ.mjs.map +0 -1
  253. package/dist/esm/chunk-MI732NUU.mjs +0 -2
  254. package/dist/esm/chunk-MI732NUU.mjs.map +0 -1
  255. package/dist/esm/chunk-NBJFTE2P.mjs +0 -2
  256. package/dist/esm/chunk-NBJFTE2P.mjs.map +0 -1
  257. package/dist/esm/chunk-Q6LFIZ3L.mjs +0 -2
  258. package/dist/esm/chunk-Q6LFIZ3L.mjs.map +0 -1
  259. package/dist/esm/chunk-QA7VTFUT.mjs +0 -2
  260. package/dist/esm/chunk-U2QQD2ER.mjs.map +0 -1
  261. package/dist/esm/chunk-U6X2FYNI.mjs +0 -2
  262. package/dist/esm/chunk-U6X2FYNI.mjs.map +0 -1
  263. package/dist/esm/chunk-XCNNMSVO.mjs +0 -2
  264. package/dist/esm/chunk-XCNNMSVO.mjs.map +0 -1
  265. package/dist/esm/chunk-Y2DHN4CV.mjs +0 -2
  266. package/dist/esm/chunk-YMFEA2TJ.mjs.map +0 -1
  267. /package/dist/esm/{chunk-GGU4XOUO.mjs.map → chunk-25ZFJIIK.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-DM6HVA4K.mjs.map → chunk-3XFAQ6KR.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-K7Y2SC65.mjs.map → chunk-4TXG2LSP.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-UYF7AQLE.mjs.map → chunk-5JTED2JJ.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-OYLT6IVC.mjs.map → chunk-7X67Z6NJ.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-FC7IRFFN.mjs.map → chunk-AVNNYI7R.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-VBPDZZXC.mjs.map → chunk-BSAYHZ2R.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-RFMLKHUD.mjs.map → chunk-BTLHVOIC.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-WL4FXFAM.mjs.map → chunk-CNNDK6OL.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-B6PLCJJ2.mjs.map → chunk-CQPJZUKQ.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-EKZHYOQH.mjs.map → chunk-CSW2QEVU.mjs.map} +0 -0
  278. /package/dist/esm/{chunk-Z4OZBMSL.mjs.map → chunk-D3PBEHCP.mjs.map} +0 -0
  279. /package/dist/esm/{chunk-EIKBYKIJ.mjs.map → chunk-DAZTLM55.mjs.map} +0 -0
  280. /package/dist/esm/{chunk-XYWMFCL6.mjs.map → chunk-ETWZV5XK.mjs.map} +0 -0
  281. /package/dist/esm/{chunk-2ZAYK464.mjs.map → chunk-FAHN3AZI.mjs.map} +0 -0
  282. /package/dist/esm/{chunk-IMF5XUVW.mjs.map → chunk-FFF7M7E4.mjs.map} +0 -0
  283. /package/dist/esm/{chunk-37Y7VAN7.mjs.map → chunk-G23ZPQCJ.mjs.map} +0 -0
  284. /package/dist/esm/{chunk-77NXCSLY.mjs.map → chunk-G5MGSV7Y.mjs.map} +0 -0
  285. /package/dist/esm/{chunk-5IRM54PL.mjs.map → chunk-GJWCKVN5.mjs.map} +0 -0
  286. /package/dist/esm/{chunk-JY5LTRTM.mjs.map → chunk-GK7TQDBN.mjs.map} +0 -0
  287. /package/dist/esm/{chunk-W5ZII3JO.mjs.map → chunk-GLUCMQZK.mjs.map} +0 -0
  288. /package/dist/esm/{chunk-HFOLSSAQ.mjs.map → chunk-GYIYUBYT.mjs.map} +0 -0
  289. /package/dist/esm/{chunk-GCPWPGCS.mjs.map → chunk-HKMG3LZX.mjs.map} +0 -0
  290. /package/dist/esm/{chunk-XBTCOCZJ.mjs.map → chunk-HLXD3KWO.mjs.map} +0 -0
  291. /package/dist/esm/{chunk-UIJK42CX.mjs.map → chunk-HWYAQTV3.mjs.map} +0 -0
  292. /package/dist/esm/{chunk-6XCZ56O7.mjs.map → chunk-IG7R65TF.mjs.map} +0 -0
  293. /package/dist/esm/{chunk-PVEPP4HR.mjs.map → chunk-INZXND6M.mjs.map} +0 -0
  294. /package/dist/esm/{chunk-CPCS5KIA.mjs.map → chunk-ISUHNAU4.mjs.map} +0 -0
  295. /package/dist/esm/{chunk-XT2VVDT3.mjs.map → chunk-J2YQTDZL.mjs.map} +0 -0
  296. /package/dist/esm/{chunk-O4O7HSUQ.mjs.map → chunk-JDTU6Z6C.mjs.map} +0 -0
  297. /package/dist/esm/{chunk-BN2PXCFR.mjs.map → chunk-LKLHNQF5.mjs.map} +0 -0
  298. /package/dist/esm/{chunk-C2IJG37E.mjs.map → chunk-MULJ2GLJ.mjs.map} +0 -0
  299. /package/dist/esm/{chunk-XFBB7YYI.mjs.map → chunk-NV5YQZ3R.mjs.map} +0 -0
  300. /package/dist/esm/{chunk-3VUSIKCF.mjs.map → chunk-NWOMSL6K.mjs.map} +0 -0
  301. /package/dist/esm/{chunk-OTK3HBAU.mjs.map → chunk-O2M3QKKS.mjs.map} +0 -0
  302. /package/dist/esm/{chunk-4EPLOSKY.mjs.map → chunk-PR6363Y6.mjs.map} +0 -0
  303. /package/dist/esm/{chunk-U7I7YKWD.mjs.map → chunk-PSCDBITI.mjs.map} +0 -0
  304. /package/dist/esm/{chunk-NRAQZUD5.mjs.map → chunk-QNTQPWLK.mjs.map} +0 -0
  305. /package/dist/esm/{chunk-D6WTINSF.mjs.map → chunk-QQWBR4SK.mjs.map} +0 -0
  306. /package/dist/esm/{chunk-FEGCUPGO.mjs.map → chunk-QVJV46XS.mjs.map} +0 -0
  307. /package/dist/esm/{chunk-6AJLTBXC.mjs.map → chunk-RP5444TL.mjs.map} +0 -0
  308. /package/dist/esm/{chunk-OAKHR7AG.mjs.map → chunk-S36XP4IE.mjs.map} +0 -0
  309. /package/dist/esm/{chunk-RFA7BIDN.mjs.map → chunk-SUJLWCRN.mjs.map} +0 -0
  310. /package/dist/esm/{chunk-4ZXCQXVC.mjs.map → chunk-TBJ7W5NC.mjs.map} +0 -0
  311. /package/dist/esm/{chunk-EPVAT625.mjs.map → chunk-TX2IYMFV.mjs.map} +0 -0
  312. /package/dist/esm/{chunk-GEP4HPQ6.mjs.map → chunk-URCQOJ55.mjs.map} +0 -0
  313. /package/dist/esm/{chunk-6DDSU7HN.mjs.map → chunk-V3OYNKY5.mjs.map} +0 -0
  314. /package/dist/esm/{chunk-WTJCMD4D.mjs.map → chunk-VTTT2G7F.mjs.map} +0 -0
  315. /package/dist/esm/{chunk-YDXU6ALO.mjs.map → chunk-WMHYIP3S.mjs.map} +0 -0
  316. /package/dist/esm/{chunk-OPGMT27G.mjs.map → chunk-WRRQ7L5K.mjs.map} +0 -0
  317. /package/dist/esm/{chunk-BF3D6ADE.mjs.map → chunk-WUJ7XNQD.mjs.map} +0 -0
  318. /package/dist/esm/{chunk-EOJWPF3P.mjs.map → chunk-X27JKATG.mjs.map} +0 -0
  319. /package/dist/esm/{chunk-XWAOZPIP.mjs.map → chunk-XVJI5XXW.mjs.map} +0 -0
  320. /package/dist/esm/{chunk-TY4IEDJD.mjs.map → chunk-YDZBU2DJ.mjs.map} +0 -0
  321. /package/dist/esm/{chunk-RS2FIBMQ.mjs.map → chunk-YMVD7Z7Z.mjs.map} +0 -0
  322. /package/dist/esm/{chunk-6TWRNWC3.mjs.map → chunk-ZW2R6VQE.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-GGU4XOUO.mjs";import"../../chunk-IHYTP2EW.mjs";import"../../chunk-XWAOZPIP.mjs";import"../../chunk-GEP4HPQ6.mjs";import"../../chunk-U6Z4FNB7.mjs";import"../../chunk-UIJK42CX.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-XCNNMSVO.mjs";import"../../chunk-RFMLKHUD.mjs";import"../../chunk-6DDSU7HN.mjs";import"../../chunk-3VUSIKCF.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-FPDE5EYE.mjs";import"../../chunk-XFBB7YYI.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-OTK3HBAU.mjs";import"../../chunk-FEGCUPGO.mjs";import"../../chunk-YMFEA2TJ.mjs";import"../../chunk-JY5LTRTM.mjs";import"../../chunk-D6WTINSF.mjs";import"../../chunk-FC7IRFFN.mjs";import"../../chunk-U2QQD2ER.mjs";import"../../chunk-O4O7HSUQ.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-BN2PXCFR.mjs";import"../../chunk-UYF7AQLE.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-CPCS5KIA.mjs";import"../../chunk-GCPWPGCS.mjs";import"../../chunk-K7Y2SC65.mjs";import"../../chunk-C2IJG37E.mjs";import"../../chunk-YDXU6ALO.mjs";import"../../chunk-PVEPP4HR.mjs";import"../../chunk-RFA7BIDN.mjs";import"../../chunk-TY4IEDJD.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-EKZHYOQH.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-NRAQZUD5.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-OPGMT27G.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-4EPLOSKY.mjs";import"../../chunk-HFOLSSAQ.mjs";import"../../chunk-H4XMI4WZ.mjs";import"../../chunk-6ZQWPHLV.mjs";import"../../chunk-NBJFTE2P.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-U6X2FYNI.mjs";import"../../chunk-A2Z7I2EY.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-77NXCSLY.mjs";import"../../chunk-BF46IXHH.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-VBPDZZXC.mjs";import"../../chunk-6XCZ56O7.mjs";import"../../chunk-MI732NUU.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-GHYE26Q5.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-Q6LFIZ3L.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-QA7VTFUT.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as TransactionManagement};
1
+ import{a}from"../../chunk-25ZFJIIK.mjs";import"../../chunk-IHYTP2EW.mjs";import"../../chunk-XVJI5XXW.mjs";import"../../chunk-U6Z4FNB7.mjs";import"../../chunk-URCQOJ55.mjs";import"../../chunk-HWYAQTV3.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-4LQKLXHW.mjs";import"../../chunk-BTLHVOIC.mjs";import"../../chunk-NWOMSL6K.mjs";import"../../chunk-V3OYNKY5.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ALRQRVDX.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-AVNNYI7R.mjs";import"../../chunk-QITCB4PW.mjs";import"../../chunk-GK7TQDBN.mjs";import"../../chunk-LKLHNQF5.mjs";import"../../chunk-QQWBR4SK.mjs";import"../../chunk-5JTED2JJ.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-ISUHNAU4.mjs";import"../../chunk-HKMG3LZX.mjs";import"../../chunk-4TXG2LSP.mjs";import"../../chunk-MULJ2GLJ.mjs";import"../../chunk-WMHYIP3S.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-INZXND6M.mjs";import"../../chunk-SUJLWCRN.mjs";import"../../chunk-CSW2QEVU.mjs";import"../../chunk-QNTQPWLK.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YDZBU2DJ.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-JDTU6Z6C.mjs";import"../../chunk-NV5YQZ3R.mjs";import"../../chunk-O2M3QKKS.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WRRQ7L5K.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-GYIYUBYT.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-UC5BZJ23.mjs";import"../../chunk-4GETVCGY.mjs";import"../../chunk-75U3LEBF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-QFORDQCU.mjs";import"../../chunk-PR6363Y6.mjs";import"../../chunk-CDLMUY5H.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-G5MGSV7Y.mjs";import"../../chunk-OHRL766V.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-QVJV46XS.mjs";import"../../chunk-VHNX2NUR.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-BSAYHZ2R.mjs";import"../../chunk-IG7R65TF.mjs";import"../../chunk-4YR6QO63.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-2BJ23DXY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-C6VIBT2D.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as TransactionManagement};
2
2
  //# sourceMappingURL=management.mjs.map
@@ -1,2 +1,2 @@
1
- import{e as o}from"../../chunk-UIJK42CX.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-XCNNMSVO.mjs";import"../../chunk-RFMLKHUD.mjs";import"../../chunk-6DDSU7HN.mjs";import"../../chunk-3VUSIKCF.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-FPDE5EYE.mjs";import"../../chunk-XFBB7YYI.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-OTK3HBAU.mjs";import"../../chunk-FEGCUPGO.mjs";import"../../chunk-YMFEA2TJ.mjs";import"../../chunk-JY5LTRTM.mjs";import"../../chunk-D6WTINSF.mjs";import"../../chunk-FC7IRFFN.mjs";import"../../chunk-U2QQD2ER.mjs";import"../../chunk-O4O7HSUQ.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-BN2PXCFR.mjs";import"../../chunk-UYF7AQLE.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-CPCS5KIA.mjs";import"../../chunk-GCPWPGCS.mjs";import"../../chunk-K7Y2SC65.mjs";import"../../chunk-C2IJG37E.mjs";import"../../chunk-YDXU6ALO.mjs";import"../../chunk-PVEPP4HR.mjs";import"../../chunk-RFA7BIDN.mjs";import"../../chunk-TY4IEDJD.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-EKZHYOQH.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-NRAQZUD5.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-OPGMT27G.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-4EPLOSKY.mjs";import"../../chunk-HFOLSSAQ.mjs";import"../../chunk-H4XMI4WZ.mjs";import"../../chunk-6ZQWPHLV.mjs";import"../../chunk-NBJFTE2P.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-U6X2FYNI.mjs";import"../../chunk-A2Z7I2EY.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-77NXCSLY.mjs";import"../../chunk-BF46IXHH.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-VBPDZZXC.mjs";import"../../chunk-6XCZ56O7.mjs";import"../../chunk-MI732NUU.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-GHYE26Q5.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-Q6LFIZ3L.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-QA7VTFUT.mjs";import"../../chunk-FVA2OPG4.mjs";var a=class{constructor(n){this.config=n}transaction(n){return o({...n})}transactionAsFeePayer(n){let{signer:r,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=r.accountAddress,o({signer:r,transaction:t})}};export{a as Sign};
1
+ import{e as o}from"../../chunk-HWYAQTV3.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-4LQKLXHW.mjs";import"../../chunk-BTLHVOIC.mjs";import"../../chunk-NWOMSL6K.mjs";import"../../chunk-V3OYNKY5.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ALRQRVDX.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-AVNNYI7R.mjs";import"../../chunk-QITCB4PW.mjs";import"../../chunk-GK7TQDBN.mjs";import"../../chunk-LKLHNQF5.mjs";import"../../chunk-QQWBR4SK.mjs";import"../../chunk-5JTED2JJ.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-ISUHNAU4.mjs";import"../../chunk-HKMG3LZX.mjs";import"../../chunk-4TXG2LSP.mjs";import"../../chunk-MULJ2GLJ.mjs";import"../../chunk-WMHYIP3S.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-INZXND6M.mjs";import"../../chunk-SUJLWCRN.mjs";import"../../chunk-CSW2QEVU.mjs";import"../../chunk-QNTQPWLK.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YDZBU2DJ.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-JDTU6Z6C.mjs";import"../../chunk-NV5YQZ3R.mjs";import"../../chunk-O2M3QKKS.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WRRQ7L5K.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-GYIYUBYT.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-UC5BZJ23.mjs";import"../../chunk-4GETVCGY.mjs";import"../../chunk-75U3LEBF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-QFORDQCU.mjs";import"../../chunk-PR6363Y6.mjs";import"../../chunk-CDLMUY5H.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-G5MGSV7Y.mjs";import"../../chunk-OHRL766V.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-QVJV46XS.mjs";import"../../chunk-VHNX2NUR.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-BSAYHZ2R.mjs";import"../../chunk-IG7R65TF.mjs";import"../../chunk-4YR6QO63.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-2BJ23DXY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-C6VIBT2D.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-FVA2OPG4.mjs";var a=class{constructor(n){this.config=n}transaction(n){return o({...n})}transactionAsFeePayer(n){let{signer:r,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=r.accountAddress,o({signer:r,transaction:t})}};export{a as Sign};
2
2
  //# sourceMappingURL=sign.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-EIKBYKIJ.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-UIJK42CX.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-XCNNMSVO.mjs";import"../../chunk-RFMLKHUD.mjs";import"../../chunk-6DDSU7HN.mjs";import"../../chunk-3VUSIKCF.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-FPDE5EYE.mjs";import"../../chunk-XFBB7YYI.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-OTK3HBAU.mjs";import"../../chunk-FEGCUPGO.mjs";import"../../chunk-YMFEA2TJ.mjs";import"../../chunk-JY5LTRTM.mjs";import"../../chunk-D6WTINSF.mjs";import"../../chunk-FC7IRFFN.mjs";import"../../chunk-U2QQD2ER.mjs";import"../../chunk-O4O7HSUQ.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-BN2PXCFR.mjs";import"../../chunk-UYF7AQLE.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-CPCS5KIA.mjs";import"../../chunk-GCPWPGCS.mjs";import"../../chunk-K7Y2SC65.mjs";import"../../chunk-C2IJG37E.mjs";import"../../chunk-YDXU6ALO.mjs";import"../../chunk-PVEPP4HR.mjs";import"../../chunk-RFA7BIDN.mjs";import"../../chunk-TY4IEDJD.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-EKZHYOQH.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-NRAQZUD5.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-OPGMT27G.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-4EPLOSKY.mjs";import"../../chunk-HFOLSSAQ.mjs";import"../../chunk-H4XMI4WZ.mjs";import"../../chunk-6ZQWPHLV.mjs";import"../../chunk-NBJFTE2P.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-U6X2FYNI.mjs";import"../../chunk-A2Z7I2EY.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-77NXCSLY.mjs";import"../../chunk-BF46IXHH.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-VBPDZZXC.mjs";import"../../chunk-6XCZ56O7.mjs";import"../../chunk-MI732NUU.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-GHYE26Q5.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-Q6LFIZ3L.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-QA7VTFUT.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Simulate};
1
+ import{a}from"../../chunk-DAZTLM55.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-HWYAQTV3.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-4LQKLXHW.mjs";import"../../chunk-BTLHVOIC.mjs";import"../../chunk-NWOMSL6K.mjs";import"../../chunk-V3OYNKY5.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ALRQRVDX.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-AVNNYI7R.mjs";import"../../chunk-QITCB4PW.mjs";import"../../chunk-GK7TQDBN.mjs";import"../../chunk-LKLHNQF5.mjs";import"../../chunk-QQWBR4SK.mjs";import"../../chunk-5JTED2JJ.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-ISUHNAU4.mjs";import"../../chunk-HKMG3LZX.mjs";import"../../chunk-4TXG2LSP.mjs";import"../../chunk-MULJ2GLJ.mjs";import"../../chunk-WMHYIP3S.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-INZXND6M.mjs";import"../../chunk-SUJLWCRN.mjs";import"../../chunk-CSW2QEVU.mjs";import"../../chunk-QNTQPWLK.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YDZBU2DJ.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-JDTU6Z6C.mjs";import"../../chunk-NV5YQZ3R.mjs";import"../../chunk-O2M3QKKS.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WRRQ7L5K.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-GYIYUBYT.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-UC5BZJ23.mjs";import"../../chunk-4GETVCGY.mjs";import"../../chunk-75U3LEBF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-QFORDQCU.mjs";import"../../chunk-PR6363Y6.mjs";import"../../chunk-CDLMUY5H.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-G5MGSV7Y.mjs";import"../../chunk-OHRL766V.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-QVJV46XS.mjs";import"../../chunk-VHNX2NUR.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-BSAYHZ2R.mjs";import"../../chunk-IG7R65TF.mjs";import"../../chunk-4YR6QO63.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-2BJ23DXY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-C6VIBT2D.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Simulate};
2
2
  //# sourceMappingURL=simulate.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-EPVAT625.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-UIJK42CX.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-XCNNMSVO.mjs";import"../../chunk-RFMLKHUD.mjs";import"../../chunk-6DDSU7HN.mjs";import"../../chunk-3VUSIKCF.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-FPDE5EYE.mjs";import"../../chunk-XFBB7YYI.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-OTK3HBAU.mjs";import"../../chunk-FEGCUPGO.mjs";import"../../chunk-YMFEA2TJ.mjs";import"../../chunk-JY5LTRTM.mjs";import"../../chunk-D6WTINSF.mjs";import"../../chunk-FC7IRFFN.mjs";import"../../chunk-U2QQD2ER.mjs";import"../../chunk-O4O7HSUQ.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-BN2PXCFR.mjs";import"../../chunk-UYF7AQLE.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-CPCS5KIA.mjs";import"../../chunk-GCPWPGCS.mjs";import"../../chunk-K7Y2SC65.mjs";import"../../chunk-C2IJG37E.mjs";import"../../chunk-YDXU6ALO.mjs";import"../../chunk-PVEPP4HR.mjs";import"../../chunk-RFA7BIDN.mjs";import"../../chunk-TY4IEDJD.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-EKZHYOQH.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-NRAQZUD5.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-OPGMT27G.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-4EPLOSKY.mjs";import"../../chunk-HFOLSSAQ.mjs";import"../../chunk-H4XMI4WZ.mjs";import"../../chunk-6ZQWPHLV.mjs";import"../../chunk-NBJFTE2P.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-U6X2FYNI.mjs";import"../../chunk-A2Z7I2EY.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-77NXCSLY.mjs";import"../../chunk-BF46IXHH.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-VBPDZZXC.mjs";import"../../chunk-6XCZ56O7.mjs";import"../../chunk-MI732NUU.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-GHYE26Q5.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-Q6LFIZ3L.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-QA7VTFUT.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Submit};
1
+ import{a}from"../../chunk-TX2IYMFV.mjs";import"../../chunk-6EMN3BOV.mjs";import"../../chunk-HWYAQTV3.mjs";import"../../chunk-I5OYNCZS.mjs";import"../../chunk-JXCZTOYC.mjs";import"../../chunk-4LQKLXHW.mjs";import"../../chunk-BTLHVOIC.mjs";import"../../chunk-NWOMSL6K.mjs";import"../../chunk-V3OYNKY5.mjs";import"../../chunk-BSCOVLWS.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ALRQRVDX.mjs";import"../../chunk-7Z6DYLCA.mjs";import"../../chunk-AVNNYI7R.mjs";import"../../chunk-QITCB4PW.mjs";import"../../chunk-GK7TQDBN.mjs";import"../../chunk-LKLHNQF5.mjs";import"../../chunk-QQWBR4SK.mjs";import"../../chunk-5JTED2JJ.mjs";import"../../chunk-4NMDYPUD.mjs";import"../../chunk-ISUHNAU4.mjs";import"../../chunk-HKMG3LZX.mjs";import"../../chunk-4TXG2LSP.mjs";import"../../chunk-MULJ2GLJ.mjs";import"../../chunk-WMHYIP3S.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-INZXND6M.mjs";import"../../chunk-SUJLWCRN.mjs";import"../../chunk-CSW2QEVU.mjs";import"../../chunk-QNTQPWLK.mjs";import"../../chunk-BOYYQAB4.mjs";import"../../chunk-YDZBU2DJ.mjs";import"../../chunk-YUNDX5I7.mjs";import"../../chunk-JDTU6Z6C.mjs";import"../../chunk-NV5YQZ3R.mjs";import"../../chunk-O2M3QKKS.mjs";import"../../chunk-E7FWVXGX.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-WRRQ7L5K.mjs";import"../../chunk-AQ4I7VVB.mjs";import"../../chunk-GYIYUBYT.mjs";import"../../chunk-KUX6GQ2E.mjs";import"../../chunk-UC5BZJ23.mjs";import"../../chunk-4GETVCGY.mjs";import"../../chunk-75U3LEBF.mjs";import"../../chunk-IVVWQKCF.mjs";import"../../chunk-MQGW234H.mjs";import"../../chunk-QFORDQCU.mjs";import"../../chunk-PR6363Y6.mjs";import"../../chunk-CDLMUY5H.mjs";import"../../chunk-F7EMGK4M.mjs";import"../../chunk-76OH2Z4Q.mjs";import"../../chunk-MLDQ2TY2.mjs";import"../../chunk-LR65XHSF.mjs";import"../../chunk-G5MGSV7Y.mjs";import"../../chunk-OHRL766V.mjs";import"../../chunk-YTQVMLFD.mjs";import"../../chunk-QVJV46XS.mjs";import"../../chunk-VHNX2NUR.mjs";import"../../chunk-AH44UPM4.mjs";import"../../chunk-N2FKVZ4D.mjs";import"../../chunk-BSAYHZ2R.mjs";import"../../chunk-IG7R65TF.mjs";import"../../chunk-4YR6QO63.mjs";import"../../chunk-GED6IT3S.mjs";import"../../chunk-WV5AD4IE.mjs";import"../../chunk-TDGQGILY.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-P5V7OZNN.mjs";import"../../chunk-H6YNXJNF.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-2BJ23DXY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-DZXM2MQY.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-C6VIBT2D.mjs";import"../../chunk-SCHZ67F3.mjs";import"../../chunk-L36ZHC7J.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Submit};
2
2
  //# sourceMappingURL=submit.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-6AJLTBXC.mjs";import"../chunk-OTK3HBAU.mjs";import"../chunk-FEGCUPGO.mjs";import"../chunk-YMFEA2TJ.mjs";import"../chunk-YTQVMLFD.mjs";import"../chunk-AH44UPM4.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-VBPDZZXC.mjs";import"../chunk-6XCZ56O7.mjs";import"../chunk-MI732NUU.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-WV5AD4IE.mjs";import"../chunk-GHYE26Q5.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-L36ZHC7J.mjs";import"../chunk-SCHZ67F3.mjs";import"../chunk-QA7VTFUT.mjs";import"../chunk-FVA2OPG4.mjs";export{a as waitForIndexerOnVersion};
1
+ import{a}from"../chunk-RP5444TL.mjs";import"../chunk-O2M3QKKS.mjs";import"../chunk-YTQVMLFD.mjs";import"../chunk-QVJV46XS.mjs";import"../chunk-VHNX2NUR.mjs";import"../chunk-AH44UPM4.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-BSAYHZ2R.mjs";import"../chunk-IG7R65TF.mjs";import"../chunk-4YR6QO63.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-WV5AD4IE.mjs";import"../chunk-TDGQGILY.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-C6VIBT2D.mjs";import"../chunk-SCHZ67F3.mjs";import"../chunk-L36ZHC7J.mjs";import"../chunk-FVA2OPG4.mjs";export{a as waitForIndexerOnVersion};
2
2
  //# sourceMappingURL=utils.mjs.map
@@ -1,2 +1,2 @@
1
- import"../chunk-FZY4PMEE.mjs";import{a as h}from"../chunk-P5V7OZNN.mjs";import{a as g}from"../chunk-H6YNXJNF.mjs";import{a as p,b as q,c as r}from"../chunk-KMJ6TF6Y.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o}from"../chunk-YPHH6CAO.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import{a}from"../chunk-DZXM2MQY.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,r as MoveOption,q as MoveString,p as MoveVector,b as Serializable,c as Serializer,n as U128,k as U16,o as U256,l as U32,m as U64,j as U8,d as ensureBoolean,e as outOfRangeErrorMessage,f as validateNumberInRange};
1
+ import"../chunk-FZY4PMEE.mjs";import{a as p,b as q,c as r}from"../chunk-KMJ6TF6Y.mjs";import{a as h}from"../chunk-P5V7OZNN.mjs";import{a as g}from"../chunk-H6YNXJNF.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o}from"../chunk-YPHH6CAO.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import{a}from"../chunk-DZXM2MQY.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,r as MoveOption,q as MoveString,p as MoveVector,b as Serializable,c as Serializer,n as U128,k as U16,o as U256,l as U32,m as U64,j as U8,d as ensureBoolean,e as outOfRangeErrorMessage,f as validateNumberInRange};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g}from"../../chunk-YPHH6CAO.mjs";import"../../chunk-Q6LFIZ3L.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Bool,f as U128,c as U16,g as U256,d as U32,e as U64,b as U8};
1
+ import{a,b,c,d,e,f,g}from"../../chunk-YPHH6CAO.mjs";import"../../chunk-2BJ23DXY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FVA2OPG4.mjs";export{a as Bool,f as U128,c as U16,g as U256,d as U32,e as U64,b as U8};
2
2
  //# sourceMappingURL=movePrimitives.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,b,c}from"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-Q6LFIZ3L.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FVA2OPG4.mjs";export{c as MoveOption,b as MoveString,a as MoveVector};
1
+ import{a,b,c}from"../../chunk-KMJ6TF6Y.mjs";import"../../chunk-YPHH6CAO.mjs";import"../../chunk-2BJ23DXY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-A63SMUOU.mjs";import"../../chunk-BCUSI3N6.mjs";import"../../chunk-LG7RJQ57.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-FVA2OPG4.mjs";export{c as MoveOption,b as MoveString,a as MoveVector};
2
2
  //# sourceMappingURL=moveStructs.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-XWAOZPIP.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super(),this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
- //# sourceMappingURL=chunk-GGU4XOUO.mjs.map
1
+ import{c as a}from"./chunk-XVJI5XXW.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super(),this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
+ //# sourceMappingURL=chunk-25ZFJIIK.mjs.map
@@ -0,0 +1,2 @@
1
+ var g=(e=>(e.JSON="application/json",e.BCS="application/x-bcs",e.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",e.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",e))(g||{}),y=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))(y||{}),u=(o=>(o[o.U8=0]="U8",o[o.U64=1]="U64",o[o.U128=2]="U128",o[o.Address=3]="Address",o[o.U8Vector=4]="U8Vector",o[o.Bool=5]="Bool",o[o.U16=6]="U16",o[o.U32=7]="U32",o[o.U256=8]="U256",o))(u||{}),d=(s=>(s[s.Script=0]="Script",s[s.EntryFunction=2]="EntryFunction",s[s.Multisig=3]="Multisig",s))(d||{}),c=(i=>(i[i.MultiAgentTransaction=0]="MultiAgentTransaction",i[i.FeePayerTransaction=1]="FeePayerTransaction",i))(c||{}),l=(r=>(r[r.Ed25519=0]="Ed25519",r[r.MultiEd25519=1]="MultiEd25519",r[r.MultiAgent=2]="MultiAgent",r[r.FeePayer=3]="FeePayer",r[r.SingleSender=4]="SingleSender",r))(l||{}),_=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.SingleKey=2]="SingleKey",e[e.MultiKey=3]="MultiKey",e))(_||{}),x=(s=>(s[s.Ed25519=0]="Ed25519",s[s.Secp256k1=1]="Secp256k1",s[s.Keyless=3]="Keyless",s))(x||{}),h=(s=>(s[s.Ed25519=0]="Ed25519",s[s.Secp256k1=1]="Secp256k1",s[s.Keyless=3]="Keyless",s))(h||{}),v=(p=>(p[p.Ed25519=0]="Ed25519",p))(v||{}),M=(p=>(p[p.Ed25519=0]="Ed25519",p))(M||{}),m=(p=>(p[p.ZkProof=0]="ZkProof",p))(m||{}),R=(p=>(p[p.Groth16=0]="Groth16",p))(R||{}),b=(a=>(a.Pending="pending_transaction",a.User="user_transaction",a.Genesis="genesis_transaction",a.BlockMetadata="block_metadata_transaction",a.StateCheckpoint="state_checkpoint_transaction",a.Validator="validator_transaction",a.BlockEpilogue="block_epilogue_transaction",a))(b||{});function U(n){return n.type==="pending_transaction"}function W(n){return n.type==="user_transaction"}function F(n){return n.type==="genesis_transaction"}function I(n){return n.type==="block_metadata_transaction"}function B(n){return n.type==="state_checkpoint_transaction"}function A(n){return n.type==="validator_transaction"}function P(n){return n.type==="block_epilogue_transaction"}function G(n){return"signature"in n&&n.signature==="ed25519_signature"}function O(n){return"signature"in n&&n.signature==="secp256k1_ecdsa_signature"}function D(n){return n.type==="multi_agent_signature"}function N(n){return n.type==="fee_payer_signature"}function q(n){return n.type==="multi_ed25519_signature"}var k=(s=>(s.PRIVATE="private",s.PUBLIC="public",s.FRIEND="friend",s))(k||{}),S=(e=>(e.STORE="store",e.DROP="drop",e.KEY="key",e.COPY="copy",e))(S||{}),f=(i=>(i.VALIDATOR="validator",i.FULL_NODE="full_node",i))(f||{}),C=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.SingleKey=2]="SingleKey",e[e.MultiKey=3]="MultiKey",e))(C||{}),T=(i=>(i[i.Ed25519=0]="Ed25519",i[i.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",i))(T||{}),E=(r=>(r[r.DeriveAuid=251]="DeriveAuid",r[r.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",r[r.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",r[r.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",r[r.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",r))(E||{});export{g as a,y as b,u as c,d,c as e,l as f,_ as g,x as h,h as i,v as j,M as k,m as l,R as m,b as n,U as o,W as p,F as q,I as r,B as s,A as t,P as u,G as v,O as w,D as x,N as y,q as z,k as A,S as B,f as C,C as D,T as E,E as F};
2
+ //# sourceMappingURL=chunk-2BJ23DXY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\nimport { OrderBy, TokenStandard } from \"./indexer\";\n\nexport * from \"./indexer\";\n\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n BCS_VIEW_FUNCTION = \"application/x.aptos.view_function+bcs\",\n}\n\n/**\n * Hex data as input to a function\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * TypeTag enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n Reference = 254, // This is specifically a placeholder and does not represent a real type\n Generic = 255, // This is specifically a placeholder and does not represent a real type\n}\n\n/**\n * Script transaction arguments enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n}\n\n/**\n * Transaction payload enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Transaction variants enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSender = 4,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n}\n\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n Keyless = 3,\n}\n\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n Keyless = 3,\n}\n\nexport enum EphemeralPublicKeyVariant {\n Ed25519 = 0,\n}\n\nexport enum EphemeralSignatureVariant {\n Ed25519 = 0,\n}\n\nexport enum EphemeralCertificateVariant {\n ZkProof = 0,\n}\n\nexport enum ZkpVariant {\n Groth16 = 0,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\nexport type Uint16 = number;\nexport type Uint32 = number;\nexport type Uint64 = bigint;\nexport type Uint128 = bigint;\nexport type Uint256 = bigint;\nexport type AnyNumber = number | bigint;\n\n/**\n * Set of configuration options that can be provided when initializing the SDK.\n * The purpose of these options is to configure various aspects of the SDK's\n * behavior and interaction with the Aptos network\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly pepper?: string;\n\n readonly prover?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n\n readonly fullnodeConfig?: FullNodeConfig;\n\n readonly indexerConfig?: IndexerConfig;\n\n readonly faucetConfig?: FaucetConfig;\n};\n\n/**\n *\n * Controls the number of results that are returned and the starting position of those results.\n * @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.\n * @param limit specifies the maximum number of items or records to return in a query result. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\nexport interface TokenStandardArg {\n tokenStandard?: TokenStandard;\n}\n\nexport interface OrderByArg<T extends {}> {\n orderBy?: OrderBy<T>;\n}\n\nexport interface WhereArg<T extends {}> {\n where?: T;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object we can pass with the request to the server.\n *\n * @param API_KEY - api key generated from developer portal {@link https://developers.aptoslabs.com/manage/api-keys}}\n * @param HEADERS - extra headers we want to send with the request\n * @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent\n */\nexport type ClientConfig = ClientHeadersType & {\n WITH_CREDENTIALS?: boolean;\n API_KEY?: string;\n};\n\n/**\n * A Fullnode only configuration object\n *\n * @param HEADERS - extra headers we want to send with the request\n */\nexport type FullNodeConfig = ClientHeadersType;\n\n/**\n * An Indexer only configuration object\n *\n * @param HEADERS - extra headers we want to send with the request\n */\nexport type IndexerConfig = ClientHeadersType;\n\n/**\n * A Faucet only configuration object\n *\n * @param HEADERS - extra headers we want to send with the request\n * @param AUTH_TOKEN - an auth token to send with a faucet request\n */\nexport type FaucetConfig = ClientHeadersType & {\n AUTH_TOKEN?: string;\n};\n\n/**\n * General type definition for client HEADERS\n */\nexport type ClientHeadersType = {\n HEADERS?: Record<string, string | number | boolean>;\n};\n\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n originMethod?: string;\n body?: Req;\n contentType?: string;\n params?: any;\n overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e https://fullnode.devnet.aptoslabs.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;\n};\n\n/**\n * Specifies ledger version of transactions. By default latest version will be used\n */\nexport type LedgerVersionArg = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * Type holding the outputs of the estimate gas API\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource<T = {}> = {\n type: MoveStructId;\n data: T;\n};\n\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n Validator = \"validator_transaction\",\n BlockEpilogue = \"block_epilogue_transaction\",\n}\n\nexport type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;\nexport type CommittedTransactionResponse =\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse\n | ValidatorTransactionResponse\n | BlockEpilogueTransactionResponse;\n\nexport function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse {\n return response.type === TransactionResponseType.Pending;\n}\n\nexport function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse {\n return response.type === TransactionResponseType.User;\n}\n\nexport function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse {\n return response.type === TransactionResponseType.Genesis;\n}\n\nexport function isBlockMetadataTransactionResponse(\n response: TransactionResponse,\n): response is BlockMetadataTransactionResponse {\n return response.type === TransactionResponseType.BlockMetadata;\n}\n\nexport function isStateCheckpointTransactionResponse(\n response: TransactionResponse,\n): response is StateCheckpointTransactionResponse {\n return response.type === TransactionResponseType.StateCheckpoint;\n}\n\nexport function isValidatorTransactionResponse(\n response: TransactionResponse,\n): response is ValidatorTransactionResponse {\n return response.type === TransactionResponseType.Validator;\n}\n\nexport function isBlockEpilogueTransactionResponse(\n response: TransactionResponse,\n): response is BlockEpilogueTransactionResponse {\n return response.type === TransactionResponseType.BlockEpilogue;\n}\n\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\nexport type ValidatorTransactionResponse = {\n type: TransactionResponseType.Validator;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n /**\n * The events emitted by the validator transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\n/**\n * BlockEndInfo describes the gas state of the block\n */\nexport type BlockEndInfo = {\n block_gas_limit_reached: boolean;\n block_output_limit_reached: boolean;\n block_effective_block_gas_units: number;\n block_approx_output_size: number;\n};\n\n/**\n * BlockEpilogueTransactionResponse is a transaction that is executed at the end of a block keeping track of data from\n * the whole block\n */\nexport type BlockEpilogueTransactionResponse = {\n type: TransactionResponseType.BlockEpilogue;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n block_end_info: BlockEndInfo | null;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Deleted table data\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * Move script bytecode\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * These are the JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\nexport function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"ed25519_signature\";\n}\n\nexport function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"secp256k1_ecdsa_signature\";\n}\n\nexport function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature {\n return signature.type === \"multi_agent_signature\";\n}\n\nexport function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return signature.type === \"fee_payer_signature\";\n}\n\nexport function isMultiEd25519Signature(\n signature: TransactionSignature,\n): signature is TransactionMultiEd25519Signature {\n return signature.type === \"multi_ed25519_signature\";\n}\n\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures.\n */\nexport type AccountSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * Map of Move types to local TypeScript types\n */\nexport type MoveUint8Type = number;\nexport type MoveUint16Type = number;\nexport type MoveUint32Type = number;\nexport type MoveUint64Type = string;\nexport type MoveUint128Type = string;\nexport type MoveUint256Type = string;\nexport type MoveAddressType = string;\nexport type MoveObjectType = string;\nexport type MoveOptionType = MoveType | null | undefined;\n/**\n * This is the format for a fully qualified struct, resource, or entry function in Move.\n */\nexport type MoveStructId = `${string}::${string}::${string}`;\n// These are the same, unfortunately, it reads really strangely to take a StructId for a Function and there wasn't a\n// good middle ground name.\nexport type MoveFunctionId = MoveStructId;\n\n// TODO: Add support for looking up ABI to add proper typing\nexport type MoveStructType = {};\n\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructId\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * Move module id is a string representation of Move module.\n * Module name is case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Move function visibility\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Move function ability\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities tied to the generic type param and associated with the function that uses it\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * Move struct field\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n// REQUEST TYPES\n\n/**\n * Table Item request for the GetTableItem API\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of Authentication Key schemes that are supported by Aptos.\n *\n * They are combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n\n MultiKey = 3,\n}\n\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Scheme used for deriving account addresses from other data\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\n/**\n * Option properties to pass for waitForTransaction() function\n */\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n waitForIndexer?: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Ed25519 or Legacy Ed25519\n */\nexport type GenerateAccountWithEd25519 = {\n scheme: SigningSchemeInput.Ed25519;\n legacy: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Secp256k1\n */\nexport type GenerateAccountWithSingleSignerSecp256k1Key = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa;\n legacy?: false;\n};\n\nexport type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;\n"],"mappings":"AAQO,IAAKA,OAIVA,EAAA,KAAO,mBAIPA,EAAA,IAAM,oBAINA,EAAA,uBAAyB,6CACzBA,EAAA,kBAAoB,wCAbVA,OAAA,IAyBAC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,GAAK,GAAL,KACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OACAA,IAAA,QAAU,GAAV,UACAA,IAAA,OAAS,GAAT,SACAA,IAAA,OAAS,GAAT,SACAA,IAAA,OAAS,GAAT,SACAA,IAAA,IAAM,GAAN,MACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,IAAP,OACAA,IAAA,UAAY,KAAZ,YACAA,IAAA,QAAU,KAAV,UAbUA,OAAA,IAoBAC,OACVA,IAAA,GAAK,GAAL,KACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OACAA,IAAA,QAAU,GAAV,UACAA,IAAA,SAAW,GAAX,WACAA,IAAA,KAAO,GAAP,OACAA,IAAA,IAAM,GAAN,MACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OATUA,OAAA,IAgBAC,OACVA,IAAA,OAAS,GAAT,SACAA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,SAAW,GAAX,WAHUA,OAAA,IAUAC,OACVA,IAAA,sBAAwB,GAAxB,wBACAA,IAAA,oBAAsB,GAAtB,sBAFUA,OAAA,IASAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,aAAe,GAAf,eACAA,IAAA,WAAa,GAAb,aACAA,IAAA,SAAW,GAAX,WACAA,IAAA,aAAe,GAAf,eALUA,OAAA,IAYAC,OACVA,IAAA,QAAU,GAAV,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AAU,OAAS,uBAC5B,CAEO,SAASG,EAAoBH,EAA4E,CAC9G,OAAOA,EAAU,OAAS,qBAC5B,CAEO,SAASI,EACdJ,EAC+C,CAC/C,OAAOA,EAAU,OAAS,yBAC5B,CAoLO,IAAKK,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SAHCA,OAAA,IASAC,OACVA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,KAAO,OAJGA,OAAA,IA6FAC,OACVA,EAAA,UAAY,YACZA,EAAA,UAAY,YAFFA,OAAA,IA4DAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,aAAe,GAAf,eAIAA,IAAA,UAAY,GAAZ,YAEAA,IAAA,SAAW,GAAX,WAdUA,OAAA,IAiBAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,eAAiB,GAAjB,iBARUA,OAAA,IAcAC,OAIVA,IAAA,WAAa,KAAb,aAIAA,IAAA,8BAAgC,KAAhC,gCAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,6BAA+B,KAA/B,+BApBUA,OAAA","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","AnyPublicKeyVariant","AnySignatureVariant","EphemeralPublicKeyVariant","EphemeralSignatureVariant","EphemeralCertificateVariant","ZkpVariant","TransactionResponseType","isPendingTransactionResponse","response","isUserTransactionResponse","isGenesisTransactionResponse","isBlockMetadataTransactionResponse","isStateCheckpointTransactionResponse","isValidatorTransactionResponse","isBlockEpilogueTransactionResponse","isEd25519Signature","signature","isSecp256k1Signature","isMultiAgentSignature","isFeePayerSignature","isMultiEd25519Signature","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
@@ -0,0 +1,2 @@
1
+ import{a as g}from"./chunk-S36XP4IE.mjs";import{a as m}from"./chunk-HWYAQTV3.mjs";import{b as w}from"./chunk-OHRL766V.mjs";import{c as A}from"./chunk-QVJV46XS.mjs";import{s as f}from"./chunk-VHNX2NUR.mjs";var T=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function D(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[t,n,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!D(t))throw new Error(`${t} is not valid. ${T}`);if(n&&!D(n))throw new Error(`${n} is not valid. ${T}`);return{domainName:n||t,subdomainName:n?t:void 0}}var I=(n=>(n[n.Independent=0]="Independent",n[n.FollowsDomain=1]="FollowsDomain",n))(I||{});function E(e){if(!e)return!1;let t=new Date(e.domain_expiration_timestamp).getTime()<Date.now(),n=new Date(e.expiration_timestamp).getTime()<Date.now();return e.subdomain&&t?!1:e.subdomain&&e.subdomain_expiration_policy===1?!0:!n}var j="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",O="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",v={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:O,custom:null,devnet:null};function d(e){let t=v[e.network];if(!t)throw new Error(`The ANS contract is not deployed to ${e.network}`);return t}var b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function F(e){let{aptosConfig:t,name:n}=e,o=d(t),{domainName:r,subdomainName:s}=c(n),i=await g({aptosConfig:t,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function Y(e){let{aptosConfig:t,expiration:n,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:u}=e,p=d(t),{domainName:y,subdomainName:N}=c(o),x=n.policy==="subdomain:independent"||n.policy==="subdomain:follow-domain";if(N&&!x)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(x&&!N)throw new Error(`Policy is set to ${n.policy} but no subdomain was provided`);if(n.policy==="domain"){let h=n.years??1;if(h!==1)throw new Error("For now, names can only be registered for 1 year at a time");let G=h*31536e3;return await m({aptosConfig:t,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[y,G,s,i]},options:a})}if(!N)throw new Error(`${n.policy} requires a subdomain to be provided.`);let _=await P({aptosConfig:t,name:y});if(!_)throw new Error("The domain does not exist");let S=n.policy==="subdomain:independent"?n.expirationDate:_;if(S>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await m({aptosConfig:t,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[y,N,Math.round(S/1e3),n.policy==="subdomain:follow-domain"?1:0,!!u,s,i]},options:a})}async function P(e){let{aptosConfig:t,name:n}=e,o=d(t),{domainName:r,subdomainName:s}=c(n);try{let i=await g({aptosConfig:t,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,s]}});return Number(i[0])*1e3}catch{return}}async function K(e){let{aptosConfig:t,address:n}=e,o=d(t),r=await g({aptosConfig:t,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(n).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function W(e){let{aptosConfig:t,sender:n,name:o,options:r}=e,s=d(t);if(!o)return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function H(e){let{aptosConfig:t,name:n}=e,o=d(t),{domainName:r,subdomainName:s}=c(n),i=await g({aptosConfig:t,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function J(e){let{aptosConfig:t,sender:n,name:o,address:r,options:s}=e,i=d(t),{domainName:a,subdomainName:u}=c(o);return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,u,r]},options:s})}async function X(e){let{aptosConfig:t,name:n}=e,{domainName:o,subdomainName:r=""}=c(n),a=(await A({aptosConfig:t,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=l(a)),E(a)?a:void 0}async function Z(e){let{aptosConfig:t,options:n,accountAddress:o}=e,r=await C({aptosConfig:t});return(await A({aptosConfig:t,originMethod:"getAccountNames",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(l)}async function ee(e){let{aptosConfig:t,options:n,accountAddress:o}=e,r=await C({aptosConfig:t});return(await A({aptosConfig:t,originMethod:"getAccountDomains",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(l)}async function ne(e){let{aptosConfig:t,options:n,accountAddress:o}=e,r=await C({aptosConfig:t});return(await A({aptosConfig:t,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(l)}async function te(e){let{aptosConfig:t,options:n,domain:o}=e;return(await A({aptosConfig:t,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""}}}}})).current_aptos_names.map(l).filter(E)}async function C(e){let{aptosConfig:t}=e,n=d(t),[o]=await g({aptosConfig:t,payload:{function:`${n}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function oe(e){let{aptosConfig:t,sender:n,name:o,years:r=1,options:s}=e,i=d(t),a=r*31536e3,{domainName:u,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[u,a]},options:s})}function l(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).getTime()}}export{T as a,D as b,c,I as d,E as e,j as f,O as g,F as h,Y as i,P as j,K as k,W as l,H as m,J as n,X as o,Z as p,ee as q,ne as r,te as s,oe as t};
2
+ //# sourceMappingURL=chunk-375GMLWG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/ans.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/name}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * name namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { Account } from \"../account\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { GetANSNameResponse, MoveAddressType, OrderByArg, PaginationArgs, WhereArg } from \"../types\";\nimport { GetNamesQuery } from \"../types/generated/operations\";\nimport { GetNames } from \"../types/generated/queries\";\nimport { CurrentAptosNamesBoolExp } from \"../types/generated/types\";\nimport { Network } from \"../utils/apiEndpoints\";\nimport { queryIndexer } from \"./general\";\nimport { view } from \"./view\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\nexport const VALIDATION_RULES_DESCRIPTION = [\n \"A name must be between 3 and 63 characters long,\",\n \"and can only contain lowercase a-z, 0-9, and hyphens.\",\n \"A name may not start or end with a hyphen.\",\n].join(\" \");\n\n/**\n *\n * @param fragment A fragment of a name, either the domain or subdomain\n * @returns boolean indicating if the fragment is a valid fragment\n */\nexport function isValidANSSegment(fragment: string): boolean {\n if (!fragment) return false;\n if (fragment.length < 3) return false;\n if (fragment.length > 63) return false;\n // only lowercase a-z and 0-9 are allowed, along with -. a domain may not start or end with a hyphen\n if (!/^[a-z\\d][a-z\\d-]{1,61}[a-z\\d]$/.test(fragment)) return false;\n return true;\n}\n\n/**\n * Checks if an ANS name is valid or not\n *\n * @param name A string of the domain name, can include or exclude the .apt suffix\n */\nexport function isValidANSName(name: string): { domainName: string; subdomainName?: string } {\n const [first, second, ...rest] = name.replace(/\\.apt$/, \"\").split(\".\");\n\n if (rest.length > 0) {\n throw new Error(`${name} is invalid. A name can only have two parts, a domain and a subdomain separated by a \".\"`);\n }\n\n if (!isValidANSSegment(first)) {\n throw new Error(`${first} is not valid. ${VALIDATION_RULES_DESCRIPTION}`);\n }\n\n if (second && !isValidANSSegment(second)) {\n throw new Error(`${second} is not valid. ${VALIDATION_RULES_DESCRIPTION}`);\n }\n\n return {\n domainName: second || first,\n subdomainName: second ? first : undefined,\n };\n}\n\nexport enum SubdomainExpirationPolicy {\n Independent = 0,\n FollowsDomain = 1,\n}\n\n/**\n * A helper function to determine if a given ANS name is considered active or\n * not. Domains are considered active if their expiration date is in the\n * future. Subdomains have two policies which modify their behavior. They can\n * follow their parent's expiration (1) in which they ignore their own\n * expiration timestamp or they can expire independently (0) in which they can\n * expire before their parent but not afterwards.\n *\n * @param name - An ANS name returned from one of the functions of the SDK\n * @returns A boolean representing if the contract considers the name active or not\n */\nexport function isActiveANSName(name: GetANSNameResponse[0]): boolean {\n if (!name) return false;\n\n const isTLDExpired = new Date(name.domain_expiration_timestamp).getTime() < Date.now();\n const isExpired = new Date(name.expiration_timestamp).getTime() < Date.now();\n\n // If we are a subdomain, if our parent is expired we are always expired\n if (name.subdomain && isTLDExpired) return false;\n\n // If we are a subdomain and our expiration policy is to follow the domain, we\n // are active (since we know our parent is not expired by this point)\n if (name.subdomain && name.subdomain_expiration_policy === SubdomainExpirationPolicy.FollowsDomain) return true;\n\n // At this point, we are either a TLD or a subdomain with an independent\n // expiration policy, we are active as long as we the expiration timestamp\n return !isExpired;\n}\n\nexport const LOCAL_ANS_ACCOUNT_PK =\n process.env.ANS_TEST_ACCOUNT_PRIVATE_KEY ?? \"0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221\";\nexport const LOCAL_ANS_ACCOUNT_ADDRESS =\n process.env.ANS_TEST_ACCOUNT_ADDRESS ?? \"0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82\";\n\nconst NetworkToAnsContract: Record<Network, string | null> = {\n [Network.TESTNET]: \"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c\",\n [Network.MAINNET]: \"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c\",\n [Network.LOCAL]: LOCAL_ANS_ACCOUNT_ADDRESS,\n [Network.CUSTOM]: null,\n [Network.DEVNET]: null,\n};\n\nfunction getRouterAddress(aptosConfig: AptosConfig): string {\n const address = NetworkToAnsContract[aptosConfig.network];\n if (!address) throw new Error(`The ANS contract is not deployed to ${aptosConfig.network}`);\n return address;\n}\n\nconst unwrapOption = <T>(option: any): T | undefined => {\n if (!!option && typeof option === \"object\" && \"vec\" in option && Array.isArray(option.vec)) {\n return option.vec[0];\n }\n\n return undefined;\n};\n\nexport async function getOwnerAddress(args: {\n aptosConfig: AptosConfig;\n name: string;\n}): Promise<AccountAddress | undefined> {\n const { aptosConfig, name } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n const { domainName, subdomainName } = isValidANSName(name);\n\n const res = await view({\n aptosConfig,\n payload: {\n function: `${routerAddress}::router::get_owner_addr`,\n functionArguments: [domainName, subdomainName],\n },\n });\n\n const owner = unwrapOption<MoveAddressType>(res[0]);\n\n return owner ? AccountAddress.from(owner) : undefined;\n}\n\nexport interface RegisterNameParameters {\n aptosConfig: AptosConfig;\n sender: Account;\n name: string;\n expiration:\n | { policy: \"domain\"; years?: 1 }\n | { policy: \"subdomain:follow-domain\" }\n | { policy: \"subdomain:independent\"; expirationDate: number };\n transferable?: boolean;\n toAddress?: AccountAddressInput;\n targetAddress?: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n}\n\nexport async function registerName(args: RegisterNameParameters): Promise<SimpleTransaction> {\n const { aptosConfig, expiration, name, sender, targetAddress, toAddress, options, transferable } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n const { domainName, subdomainName } = isValidANSName(name);\n\n const hasSubdomainPolicy =\n expiration.policy === \"subdomain:independent\" || expiration.policy === \"subdomain:follow-domain\";\n\n if (subdomainName && !hasSubdomainPolicy) {\n throw new Error(\n \"Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'\",\n );\n }\n\n if (hasSubdomainPolicy && !subdomainName) {\n throw new Error(`Policy is set to ${expiration.policy} but no subdomain was provided`);\n }\n\n if (expiration.policy === \"domain\") {\n const years = expiration.years ?? 1;\n if (years !== 1) {\n throw new Error(\"For now, names can only be registered for 1 year at a time\");\n }\n\n const secondsInYear = 31536000;\n const registrationDuration = years * secondsInYear;\n\n const transaction = await generateTransaction({\n aptosConfig,\n sender: sender.accountAddress.toString(),\n data: {\n function: `${routerAddress}::router::register_domain`,\n functionArguments: [domainName, registrationDuration, targetAddress, toAddress],\n },\n options,\n });\n\n return transaction;\n }\n\n // We are a subdomain\n if (!subdomainName) {\n throw new Error(`${expiration.policy} requires a subdomain to be provided.`);\n }\n\n const tldExpiration = await getExpiration({ aptosConfig, name: domainName });\n if (!tldExpiration) {\n throw new Error(\"The domain does not exist\");\n }\n\n const expirationDateInMillisecondsSinceEpoch =\n expiration.policy === \"subdomain:independent\" ? expiration.expirationDate : tldExpiration;\n\n if (expirationDateInMillisecondsSinceEpoch > tldExpiration) {\n throw new Error(\"The subdomain expiration time cannot be greater than the domain expiration time\");\n }\n\n const transaction = await generateTransaction({\n aptosConfig,\n sender: sender.accountAddress.toString(),\n data: {\n function: `${routerAddress}::router::register_subdomain`,\n functionArguments: [\n domainName,\n subdomainName,\n Math.round(expirationDateInMillisecondsSinceEpoch / 1000),\n expiration.policy === \"subdomain:follow-domain\" ? 1 : 0,\n !!transferable,\n targetAddress,\n toAddress,\n ],\n },\n options,\n });\n\n return transaction;\n}\n\nexport async function getExpiration(args: { aptosConfig: AptosConfig; name: string }): Promise<number | undefined> {\n const { aptosConfig, name } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n const { domainName, subdomainName } = isValidANSName(name);\n\n try {\n const res = await view({\n aptosConfig,\n payload: {\n function: `${routerAddress}::router::get_expiration`,\n functionArguments: [domainName, subdomainName],\n },\n });\n\n // Normalize expiration time from epoch seconds to epoch milliseconds\n return Number(res[0]) * 1000;\n } catch (e) {\n return undefined;\n }\n}\n\nexport async function getPrimaryName(args: {\n aptosConfig: AptosConfig;\n address: AccountAddressInput;\n}): Promise<string | undefined> {\n const { aptosConfig, address } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n\n const res = await view({\n aptosConfig,\n payload: {\n function: `${routerAddress}::router::get_primary_name`,\n functionArguments: [AccountAddress.from(address).toString()],\n },\n });\n\n const domainName = unwrapOption<MoveAddressType>(res[1]);\n const subdomainName = unwrapOption<MoveAddressType>(res[0]);\n\n if (!domainName) return undefined;\n\n return [subdomainName, domainName].filter(Boolean).join(\".\");\n}\n\nexport async function setPrimaryName(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n name?: string;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, name, options } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n\n if (!name) {\n const transaction = await generateTransaction({\n aptosConfig,\n sender: sender.accountAddress.toString(),\n data: {\n function: `${routerAddress}::router::clear_primary_name`,\n functionArguments: [],\n },\n options,\n });\n\n return transaction;\n }\n\n const { domainName, subdomainName } = isValidANSName(name);\n\n const transaction = await generateTransaction({\n aptosConfig,\n sender: sender.accountAddress.toString(),\n data: {\n function: `${routerAddress}::router::set_primary_name`,\n functionArguments: [domainName, subdomainName],\n },\n options,\n });\n\n return transaction;\n}\n\nexport async function getTargetAddress(args: {\n aptosConfig: AptosConfig;\n name: string;\n}): Promise<AccountAddress | undefined> {\n const { aptosConfig, name } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n const { domainName, subdomainName } = isValidANSName(name);\n\n const res = await view({\n aptosConfig,\n payload: {\n function: `${routerAddress}::router::get_target_addr`,\n functionArguments: [domainName, subdomainName],\n },\n });\n\n const target = unwrapOption<MoveAddressType>(res[0]);\n return target ? AccountAddress.from(target) : undefined;\n}\n\nexport async function setTargetAddress(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n name: string;\n address: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, name, address, options } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n const { domainName, subdomainName } = isValidANSName(name);\n\n const transaction = await generateTransaction({\n aptosConfig,\n sender: sender.accountAddress.toString(),\n data: {\n function: `${routerAddress}::router::set_target_addr`,\n functionArguments: [domainName, subdomainName, address],\n },\n options,\n });\n\n return transaction;\n}\n\nexport async function getName(args: {\n aptosConfig: AptosConfig;\n name: string;\n}): Promise<GetANSNameResponse[0] | undefined> {\n const { aptosConfig, name } = args;\n const { domainName, subdomainName = \"\" } = isValidANSName(name);\n\n const where: CurrentAptosNamesBoolExp = {\n domain: { _eq: domainName },\n subdomain: { _eq: subdomainName },\n };\n\n const data = await queryIndexer<GetNamesQuery>({\n aptosConfig,\n query: {\n query: GetNames,\n variables: {\n where_condition: where,\n limit: 1,\n },\n },\n originMethod: \"getName\",\n });\n\n // Convert the expiration_timestamp from an ISO string to milliseconds since epoch\n let res = data.current_aptos_names[0];\n if (res) {\n res = sanitizeANSName(res);\n }\n\n return isActiveANSName(res) ? res : undefined;\n}\n\ninterface QueryNamesOptions {\n options?: PaginationArgs & OrderByArg<GetANSNameResponse[0]> & WhereArg<CurrentAptosNamesBoolExp>;\n}\n\nexport interface GetAccountNamesArgs extends QueryNamesOptions {\n accountAddress: AccountAddressInput;\n}\n\nexport async function getAccountNames(\n args: { aptosConfig: AptosConfig } & GetAccountNamesArgs,\n): Promise<GetANSNameResponse> {\n const { aptosConfig, options, accountAddress } = args;\n\n const expirationDate = await getANSExpirationDate({ aptosConfig });\n\n const data = await queryIndexer<GetNamesQuery>({\n aptosConfig,\n originMethod: \"getAccountNames\",\n query: {\n query: GetNames,\n variables: {\n limit: options?.limit,\n offset: options?.offset,\n order_by: options?.orderBy,\n where_condition: {\n ...(args.options?.where ?? {}),\n owner_address: { _eq: accountAddress.toString() },\n expiration_timestamp: { _gte: expirationDate },\n },\n },\n },\n });\n\n return data.current_aptos_names.map(sanitizeANSName);\n}\n\nexport interface GetAccountDomainsArgs extends QueryNamesOptions {\n accountAddress: AccountAddressInput;\n}\n\nexport async function getAccountDomains(\n args: { aptosConfig: AptosConfig } & GetAccountDomainsArgs,\n): Promise<GetANSNameResponse> {\n const { aptosConfig, options, accountAddress } = args;\n\n const expirationDate = await getANSExpirationDate({ aptosConfig });\n\n const data = await queryIndexer<GetNamesQuery>({\n aptosConfig,\n originMethod: \"getAccountDomains\",\n query: {\n query: GetNames,\n variables: {\n limit: options?.limit,\n offset: options?.offset,\n order_by: options?.orderBy,\n where_condition: {\n ...(args.options?.where ?? {}),\n owner_address: { _eq: accountAddress.toString() },\n expiration_timestamp: { _gte: expirationDate },\n subdomain: { _eq: \"\" },\n },\n },\n },\n });\n\n return data.current_aptos_names.map(sanitizeANSName);\n}\n\nexport interface GetAccountSubdomainsArgs extends QueryNamesOptions {\n accountAddress: AccountAddressInput;\n}\n\nexport async function getAccountSubdomains(\n args: { aptosConfig: AptosConfig } & GetAccountSubdomainsArgs,\n): Promise<GetANSNameResponse> {\n const { aptosConfig, options, accountAddress } = args;\n\n const expirationDate = await getANSExpirationDate({ aptosConfig });\n\n const data = await queryIndexer<GetNamesQuery>({\n aptosConfig,\n originMethod: \"getAccountSubdomains\",\n query: {\n query: GetNames,\n variables: {\n limit: options?.limit,\n offset: options?.offset,\n order_by: options?.orderBy,\n where_condition: {\n ...(args.options?.where ?? {}),\n owner_address: { _eq: accountAddress.toString() },\n expiration_timestamp: { _gte: expirationDate },\n subdomain: { _neq: \"\" },\n },\n },\n },\n });\n\n return data.current_aptos_names.map(sanitizeANSName);\n}\n\nexport interface GetDomainSubdomainsArgs extends QueryNamesOptions {\n domain: string;\n}\n\nexport async function getDomainSubdomains(\n args: { aptosConfig: AptosConfig } & GetDomainSubdomainsArgs,\n): Promise<GetANSNameResponse> {\n const { aptosConfig, options, domain } = args;\n\n const data = await queryIndexer<GetNamesQuery>({\n aptosConfig,\n originMethod: \"getDomainSubdomains\",\n query: {\n query: GetNames,\n variables: {\n limit: options?.limit,\n offset: options?.offset,\n order_by: options?.orderBy,\n where_condition: {\n ...(args.options?.where ?? {}),\n domain: { _eq: domain },\n subdomain: { _neq: \"\" },\n },\n },\n },\n });\n\n return data.current_aptos_names.map(sanitizeANSName).filter(isActiveANSName);\n}\n\n/**\n * This function returns the expiration date in which a name is fully expired as\n * defined by the contract. The grace period allows for names to be past\n * expiration for a certain amount of time before they are released to the\n * public. The names will not function as normal, but the owner can renew\n * without others taking ownership of the name. At the time of writing, the\n * contract specified 30 days.\n *\n * @param args.aptosConfig an AptosConfig object\n * @returns\n */\nasync function getANSExpirationDate(args: { aptosConfig: AptosConfig }): Promise<string> {\n const { aptosConfig } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n\n const [gracePeriodInSeconds] = await view<[number]>({\n aptosConfig,\n payload: {\n function: `${routerAddress}::config::reregistration_grace_sec`,\n functionArguments: [],\n },\n });\n\n const gracePeriodInDays = gracePeriodInSeconds / 60 / 60 / 24;\n const now = () => new Date();\n return new Date(now().setDate(now().getDate() - gracePeriodInDays)).toISOString();\n}\n\nexport async function renewDomain(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n name: string;\n years?: 1;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, name, years = 1, options } = args;\n const routerAddress = getRouterAddress(aptosConfig);\n const renewalDuration = years * 31536000;\n const { domainName, subdomainName } = isValidANSName(name);\n\n if (subdomainName) {\n throw new Error(\"Subdomains cannot be renewed\");\n }\n\n if (years !== 1) {\n throw new Error(\"Currently, only 1 year renewals are supported\");\n }\n\n const transaction = await generateTransaction({\n aptosConfig,\n sender: sender.accountAddress.toString(),\n data: {\n function: `${routerAddress}::router::renew_domain`,\n functionArguments: [domainName, renewalDuration],\n },\n options,\n });\n\n return transaction;\n}\n\n/**\n * The indexer returns ISO strings for expiration, however the contract works in\n * epoch milliseconds. This function converts the ISO string to epoch\n * milliseconds. In the future, if other properties need sanitization, this can\n * be extended.\n */\nfunction sanitizeANSName(name: GetANSNameResponse[0]): GetANSNameResponse[0] {\n return {\n ...name,\n expiration_timestamp: new Date(name.expiration_timestamp).getTime(),\n };\n}\n"],"mappings":"6MAwBO,IAAMA,EAA+B,CAC1C,mDACA,wDACA,4CACF,EAAE,KAAK,GAAG,EAOH,SAASC,EAAkBC,EAA2B,CAK3D,MAJI,GAACA,GACDA,EAAS,OAAS,GAClBA,EAAS,OAAS,IAElB,CAAC,iCAAiC,KAAKA,CAAQ,EAErD,CAOO,SAASC,EAAeC,EAA8D,CAC3F,GAAM,CAACC,EAAOC,EAAQ,GAAGC,CAAI,EAAIH,EAAK,QAAQ,SAAU,EAAE,EAAE,MAAM,GAAG,EAErE,GAAIG,EAAK,OAAS,EAChB,MAAM,IAAI,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Q,CACpE,CACF","names":["VALIDATION_RULES_DESCRIPTION","isValidANSSegment","fragment","isValidANSName","name","first","second","rest","SubdomainExpirationPolicy","isActiveANSName","isTLDExpired","isExpired","LOCAL_ANS_ACCOUNT_PK","LOCAL_ANS_ACCOUNT_ADDRESS","NetworkToAnsContract","getRouterAddress","aptosConfig","address","unwrapOption","option","getOwnerAddress","args","routerAddress","domainName","subdomainName","res","view","owner","AccountAddress","registerName","expiration","sender","targetAddress","toAddress","options","transferable","hasSubdomainPolicy","years","registrationDuration","generateTransaction","tldExpiration","getExpiration","expirationDateInMillisecondsSinceEpoch","getPrimaryName","setPrimaryName","getTargetAddress","target","setTargetAddress","getName","queryIndexer","GetNames","sanitizeANSName","getAccountNames","accountAddress","expirationDate","getANSExpirationDate","getAccountDomains","getAccountSubdomains","getDomainSubdomains","domain","gracePeriodInSeconds","gracePeriodInDays","now","renewDomain","renewalDuration"]}
@@ -0,0 +1,2 @@
1
+ import{h as e,i as s,j as t,k as o,l as r,m as i,n as a,o as m,p as c,q as g,r as u,s as p,t as d}from"./chunk-375GMLWG.mjs";var A=class{constructor(n){this.config=n}async getOwnerAddress(n){return e({aptosConfig:this.config,...n})}async getExpiration(n){return t({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return s({aptosConfig:this.config,...n})}async renewDomain(n){return d({aptosConfig:this.config,...n})}async getName(n){return m({aptosConfig:this.config,...n})}async getAccountNames(n){return c({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return p({aptosConfig:this.config,...n})}};export{A as a};
2
+ //# sourceMappingURL=chunk-3A6HUKXW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/api/ans.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"../account\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport {\n RegisterNameParameters,\n getExpiration,\n getOwnerAddress,\n registerName,\n getPrimaryName,\n setPrimaryName,\n getTargetAddress,\n setTargetAddress,\n renewDomain,\n getName,\n getAccountDomains,\n GetAccountDomainsArgs,\n GetAccountSubdomainsArgs,\n getAccountSubdomains,\n getAccountNames,\n GetAccountNamesArgs,\n getDomainSubdomains,\n GetDomainSubdomainsArgs,\n} from \"../internal/ans\";\nimport { GetANSNameResponse } from \"../types\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to handle all `ANS` operations\n */\nexport class ANS {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Retrieve the owner address of a domain name or subdomain name from the contract.\n *\n * @example\n * // Will return the owner address of \"test.aptos.apt\" or undefined\n * const owner = await aptos.getOwnerAddress({name: \"test.aptos\"})\n * // owner = 0x123...\n *\n * @param args.name - A string of the name to retrieve\n *\n * @returns AccountAddress if the name is owned, undefined otherwise\n */\n async getOwnerAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getOwnerAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the expiration time of a domain name or subdomain name from the contract.\n *\n * @example\n * // Will return the expiration of \"test.aptos.apt\" or undefined\n * const exp = await aptos.getExpiration({name: \"test.aptos\"})\n * // new Date(exp) would give you the date in question: 2021-01-01T00:00:00.000Z\n *\n * @param args.name - A string of the name to retrieve\n *\n * @returns number as a unix timestamp in milliseconds.\n */\n async getExpiration(args: { name: string }): Promise<number | undefined> {\n return getExpiration({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the target address of a domain or subdomain name. This is the\n * address the name points to for use on chain. Note, the target address can\n * point to addresses that are not the owner of the name\n *\n * @example\n * const targetAddr = await aptos.getTargetAddress({name: \"test.aptos\"})\n * // targetAddr = 0x123...\n *\n * @param args.name - A string of the name: primary, primary.apt, secondary.primary, secondary.primary.apt, etc.\n *\n * @returns AccountAddress if the name has a target, undefined otherwise\n */\n async getTargetAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the target address of a domain or subdomain name. This is the\n * address the name points to for use on chain. Note, the target address can\n * point to addresses that are not the owner of the name\n *\n * @example\n * await aptos.setTargetAddress({sender: alice, name: \"test.aptos\", address: bob.accountAddress})\n * const address = await aptos.getTargetAddress({name: \"test.aptos\"})\n * // address = bob.accountAddress\n *\n * @param args.name - A string of the name: test.aptos.apt, test.apt, test, test.aptos, etc.\n * @param args.address - A AccountAddressInput of the address to set the domain or subdomain to\n *\n * @returns SimpleTransaction\n */\n async setTargetAddress(args: {\n sender: Account;\n name: string;\n address: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the primary name for an account. An account can have\n * multiple names that target it, but only a single name that is primary. An\n * account also may not have a primary name.\n *\n * @example\n * const name = await aptos.getPrimaryName({address: alice.accountAddress})\n * // name = test.aptos\n *\n * @param args.address - A AccountAddressInput (address) of the account\n *\n * @returns a string if the account has a primary name, undefined otherwise\n */\n async getPrimaryName(args: { address: AccountAddressInput }): Promise<string | undefined> {\n return getPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the primary name for the sender. An account can have\n * multiple names that target it, but only a single name that is primary. An\n * account also may not have a primary name.\n *\n * @example\n * await aptos.setPrimaryName({sender: alice, name: \"test.aptos\"})\n * const primaryName = await aptos.getPrimaryName({address: alice.accountAddress})\n * // primaryName = test.aptos\n *\n * @param args.sender - The sender account\n * @param args.name - A string of the name: test, test.apt, test.aptos, test.aptos.apt, etc.\n *\n * @returns SimpleTransaction\n */\n async setPrimaryName(args: {\n sender: Account;\n name?: string;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Registers a new name\n *\n * @example\n * // An example of registering a subdomain name assuming def.apt is already registered\n * // and belongs to the sender alice.\n * const txn = aptos.registerName({\n * sender: alice,\n * name: \"test.aptos.apt\",\n * expiration: {\n * policy: \"subdomain:independent\",\n * expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000,\n * },\n * });\n *\n * @param args.sender - The sender account\n * @param args.name - A string of the name to register. This can be inclusive or exclusive of the .apt suffix.\n * Examples include: \"test\", \"test.apt\", \"test.aptos.apt\", etc.\n * @param args.expiration - An object with the expiration policy of the name.\n * @param args.expiration.policy - 'domain' | 'subdomain:follow-domain' | 'subdomain:independent'\n * - domain: Years is required and the name will expire after the given number of years.\n * - subdomain:follow-domain: The name will expire at the same time as the domain name.\n * - subdomain:independent: The name will expire at the given date.\n * @param args.expiration.expirationDate - An epoch number in milliseconds of\n * the date when the subdomain will expire. Only applicable when the policy is\n * set to 'subdomain:independent'.\n * @param args.transferable - Determines if the subdomain being minted is soul-bound. Applicable only to subdomains.\n * @param args.targetAddress optional - The address the domain name will resolve to. If not provided,\n * the sender's address will be used.\n * @param args.toAddress optional - The address to send the domain name to. If not provided,\n * the transaction will be sent to the router.\n *\n * @returns SimpleTransaction\n */\n async registerName(args: Omit<RegisterNameParameters, \"aptosConfig\">): Promise<SimpleTransaction> {\n return registerName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Renews a domain name\n *\n * Note: If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.\n *\n * @example\n * await aptos.renewDomain({sender: alice, name: \"test\"})\n * // test.apt will be renewed for one year\n *\n * @param args.sender - The sender account\n * @param args.name - A string of the domain the subdomain will be under. The signer must be the domain owner.\n * Subdomains cannot be renewed.\n * @param args.years - The number of years to renew the name. Currently only one year is permitted.\n *\n * @returns SimpleTransaction\n */\n async renewDomain(args: {\n sender: Account;\n name: string;\n years?: 1;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return renewDomain({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches a single name from the indexer\n * @param args.name - A string of the name to retrieve, e.g. \"test.aptos.apt\"\n * or \"test.apt\" or \"test\". Can be inclusive or exclusive of the .apt suffix.\n * Can be a subdomain.\n *\n * @returns A promise of an ANSName or undefined\n */\n async getName(args: { name: string }): Promise<GetANSNameResponse[0] | undefined> {\n return getName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all names for an account (both top level domains and subdomains)\n *\n * @param args\n * @param args.accountAddress - A AccountAddressInput of the address to retrieve names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getAccountNames(args: GetAccountNamesArgs): Promise<GetANSNameResponse> {\n return getAccountNames({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all top level domain names for an account\n *\n * @param args\n * @param args.accountAddress - A AccountAddressInput of the address to retrieve domain names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getAccountDomains(args: GetAccountDomainsArgs): Promise<GetANSNameResponse> {\n return getAccountDomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomains names for an account\n *\n * @param args\n * @param args.accountAddress - A AccountAddressInput of the address to retrieve subdomains names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getAccountSubdomains(args: GetAccountSubdomainsArgs): Promise<GetANSNameResponse> {\n return getAccountSubdomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomains names for a given domain. Note, this will not return the domain itself.\n *\n * @param args\n * @param args.domain - A string of the domain name: eg. \"test.apt\" or \"test\" (without the suffix of .apt)\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getDomainSubdomains(args: GetDomainSubdomainsArgs): Promise<GetANSNameResponse> {\n return getDomainSubdomains({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"wHAiCO,IAAMA,EAAN,KAAU,CACf,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAc3C,MAAM,gBAAgBC,EAA6D,CACjF,OAAOC,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAC9D,CAcA,MAAM,cAAcA,EAAqD,CACvE,OAAOE,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC5D,CAeA,MAAM,iBAAiBA,EAA6D,CAClF,OAAOG,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC/D,CAiBA,MAAM,iBAAiBA,EAKQ,CAC7B,OAAOI,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CAC/D,CAeA,MAAM,eAAeA,EAAqE,CACxF,OAAOK,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGL,CAAK,CAAC,CAC7D,CAiBA,MAAM,eAAeA,EAIU,CAC7B,OAAOM,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGN,CAAK,CAAC,CAC7D,CAoCA,MAAM,aAAaA,EAA+E,CAChG,OAAOO,EAAa,CAAE,YAAa,KAAK,OAAQ,GAAGP,CAAK,CAAC,CAC3D,CAkBA,MAAM,YAAYA,EAKa,CAC7B,OAAOQ,EAAY,CAAE,YAAa,KAAK,OAAQ,GAAGR,CAAK,CAAC,CAC1D,CAUA,MAAM,QAAQA,EAAoE,CAChF,OAAOS,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CACtD,CAcA,MAAM,gBAAgBA,EAAwD,CAC5E,OAAOU,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGV,CAAK,CAAC,CAC9D,CAcA,MAAM,kBAAkBA,EAA0D,CAChF,OAAOW,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGX,CAAK,CAAC,CAChE,CAcA,MAAM,qBAAqBA,EAA6D,CACtF,OAAOY,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGZ,CAAK,CAAC,CACnE,CAcA,MAAM,oBAAoBA,EAA4D,CACpF,OAAOa,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGb,CAAK,CAAC,CAClE,CACF","names":["ANS","config","args","getOwnerAddress","getExpiration","getTargetAddress","setTargetAddress","getPrimaryName","setPrimaryName","registerName","renewDomain","getName","getAccountNames","getAccountDomains","getAccountSubdomains","getDomainSubdomains"]}
1
+ {"version":3,"sources":["../../src/api/ans.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"../account\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport {\n RegisterNameParameters,\n getExpiration,\n getOwnerAddress,\n registerName,\n getPrimaryName,\n setPrimaryName,\n getTargetAddress,\n setTargetAddress,\n renewDomain,\n getName,\n getAccountDomains,\n GetAccountDomainsArgs,\n GetAccountSubdomainsArgs,\n getAccountSubdomains,\n getAccountNames,\n GetAccountNamesArgs,\n getDomainSubdomains,\n GetDomainSubdomainsArgs,\n} from \"../internal/ans\";\nimport { GetANSNameResponse } from \"../types\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to handle all `ANS` operations\n */\nexport class ANS {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Retrieve the owner address of a domain name or subdomain name from the contract.\n *\n * @example\n * // Will return the owner address of \"test.aptos.apt\" or undefined\n * const owner = await aptos.getOwnerAddress({name: \"test.aptos\"})\n * // owner = 0x123...\n *\n * @param args.name - A string of the name to retrieve\n *\n * @returns AccountAddress if the name is owned, undefined otherwise\n */\n async getOwnerAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getOwnerAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the expiration time of a domain name or subdomain name from the contract.\n *\n * @example\n * // Will return the expiration of \"test.aptos.apt\" or undefined\n * const exp = await aptos.getExpiration({name: \"test.aptos\"})\n * // new Date(exp) would give you the date in question: 2021-01-01T00:00:00.000Z\n *\n * @param args.name - A string of the name to retrieve\n *\n * @returns number as a unix timestamp in milliseconds.\n */\n async getExpiration(args: { name: string }): Promise<number | undefined> {\n return getExpiration({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the target address of a domain or subdomain name. This is the\n * address the name points to for use on chain. Note, the target address can\n * point to addresses that are not the owner of the name\n *\n * @example\n * const targetAddr = await aptos.getTargetAddress({name: \"test.aptos\"})\n * // targetAddr = 0x123...\n *\n * @param args.name - A string of the name: primary, primary.apt, secondary.primary, secondary.primary.apt, etc.\n *\n * @returns AccountAddress if the name has a target, undefined otherwise\n */\n async getTargetAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the target address of a domain or subdomain name. This is the\n * address the name points to for use on chain. Note, the target address can\n * point to addresses that are not the owner of the name\n *\n * @example\n * await aptos.setTargetAddress({sender: alice, name: \"test.aptos\", address: bob.accountAddress})\n * const address = await aptos.getTargetAddress({name: \"test.aptos\"})\n * // address = bob.accountAddress\n *\n * @param args.name - A string of the name: test.aptos.apt, test.apt, test, test.aptos, etc.\n * @param args.address - A AccountAddressInput of the address to set the domain or subdomain to\n *\n * @returns SimpleTransaction\n */\n async setTargetAddress(args: {\n sender: Account;\n name: string;\n address: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the primary name for an account. An account can have\n * multiple names that target it, but only a single name that is primary. An\n * account also may not have a primary name.\n *\n * @example\n * const name = await aptos.getPrimaryName({address: alice.accountAddress})\n * // name = test.aptos\n *\n * @param args.address - A AccountAddressInput (address) of the account\n *\n * @returns a string if the account has a primary name, undefined otherwise\n */\n async getPrimaryName(args: { address: AccountAddressInput }): Promise<string | undefined> {\n return getPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the primary name for the sender. An account can have\n * multiple names that target it, but only a single name that is primary. An\n * account also may not have a primary name.\n *\n * @example\n * await aptos.setPrimaryName({sender: alice, name: \"test.aptos\"})\n * const primaryName = await aptos.getPrimaryName({address: alice.accountAddress})\n * // primaryName = test.aptos\n *\n * @param args.sender - The sender account\n * @param args.name - A string of the name: test, test.apt, test.aptos, test.aptos.apt, etc.\n *\n * @returns SimpleTransaction\n */\n async setPrimaryName(args: {\n sender: Account;\n name?: string;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Registers a new name\n *\n * @example\n * // An example of registering a subdomain name assuming def.apt is already registered\n * // and belongs to the sender alice.\n * const txn = aptos.registerName({\n * sender: alice,\n * name: \"test.aptos.apt\",\n * expiration: {\n * policy: \"subdomain:independent\",\n * expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000,\n * },\n * });\n *\n * @param args.sender - The sender account\n * @param args.name - A string of the name to register. This can be inclusive or exclusive of the .apt suffix.\n * Examples include: \"test\", \"test.apt\", \"test.aptos.apt\", etc.\n * @param args.expiration - An object with the expiration policy of the name.\n * @param args.expiration.policy - 'domain' | 'subdomain:follow-domain' | 'subdomain:independent'\n * - domain: Years is required and the name will expire after the given number of years.\n * - subdomain:follow-domain: The name will expire at the same time as the domain name.\n * - subdomain:independent: The name will expire at the given date.\n * @param args.expiration.expirationDate - An epoch number in milliseconds of\n * the date when the subdomain will expire. Only applicable when the policy is\n * set to 'subdomain:independent'.\n * @param args.transferable - Determines if the subdomain being minted is soul-bound. Applicable only to subdomains.\n * @param args.targetAddress optional - The address the domain name will resolve to. If not provided,\n * the sender's address will be used.\n * @param args.toAddress optional - The address to send the domain name to. If not provided,\n * the transaction will be sent to the router.\n *\n * @returns SimpleTransaction\n */\n async registerName(args: Omit<RegisterNameParameters, \"aptosConfig\">): Promise<SimpleTransaction> {\n return registerName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Renews a domain name\n *\n * Note: If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.\n *\n * @example\n * await aptos.renewDomain({sender: alice, name: \"test\"})\n * // test.apt will be renewed for one year\n *\n * @param args.sender - The sender account\n * @param args.name - A string of the domain the subdomain will be under. The signer must be the domain owner.\n * Subdomains cannot be renewed.\n * @param args.years - The number of years to renew the name. Currently only one year is permitted.\n *\n * @returns SimpleTransaction\n */\n async renewDomain(args: {\n sender: Account;\n name: string;\n years?: 1;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return renewDomain({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches a single name from the indexer\n * @param args.name - A string of the name to retrieve, e.g. \"test.aptos.apt\"\n * or \"test.apt\" or \"test\". Can be inclusive or exclusive of the .apt suffix.\n * Can be a subdomain.\n *\n * @returns A promise of an ANSName or undefined\n */\n async getName(args: { name: string }): Promise<GetANSNameResponse[0] | undefined> {\n return getName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all names for an account (both top level domains and subdomains)\n *\n * @param args\n * @param args.accountAddress - A AccountAddressInput of the address to retrieve names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getAccountNames(args: GetAccountNamesArgs): Promise<GetANSNameResponse> {\n return getAccountNames({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all top level domain names for an account\n *\n * @param args\n * @param args.accountAddress - A AccountAddressInput of the address to retrieve domain names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getAccountDomains(args: GetAccountDomainsArgs): Promise<GetANSNameResponse> {\n return getAccountDomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomains names for an account\n *\n * @param args\n * @param args.accountAddress - A AccountAddressInput of the address to retrieve subdomains names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getAccountSubdomains(args: GetAccountSubdomainsArgs): Promise<GetANSNameResponse> {\n return getAccountSubdomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomains names for a given domain. Note, this will not return the domain itself.\n *\n * @param args\n * @param args.domain - A string of the domain name: eg. \"test.apt\" or \"test\" (without the suffix of .apt)\n * @param args.options.offset - Optional, the offset to start from when fetching names\n * @param args.options.limit - Optional, A number of the names to fetch per request\n * @param args.options.orderBy - The order to sort the names by\n * @param args.options.where - Additional filters to apply to the query\n *\n * @returns a promise of an array of ANSName\n */\n async getDomainSubdomains(args: GetDomainSubdomainsArgs): Promise<GetANSNameResponse> {\n return getDomainSubdomains({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"6HAiCO,IAAMA,EAAN,KAAU,CACf,YAAqBC,EAAqB,CAAr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AAoBA,EAA4D,CACpF,OAAOa,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGb,CAAK,CAAC,CAClE,CACF","names":["ANS","config","args","getOwnerAddress","getExpiration","getTargetAddress","setTargetAddress","getPrimaryName","setPrimaryName","registerName","renewDomain","getName","getAccountNames","getAccountDomains","getAccountSubdomains","getDomainSubdomains"]}
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-UIJK42CX.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
2
- //# sourceMappingURL=chunk-DM6HVA4K.mjs.map
1
+ import{a as t}from"./chunk-HWYAQTV3.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
2
+ //# sourceMappingURL=chunk-3XFAQ6KR.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as c}from"./chunk-F7EMGK4M.mjs";import{a as d}from"./chunk-76OH2Z4Q.mjs";import{a as f}from"./chunk-MLDQ2TY2.mjs";import{e as g,j as h}from"./chunk-LR65XHSF.mjs";import{a as p}from"./chunk-A63SMUOU.mjs";import{b as s}from"./chunk-BCUSI3N6.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as S}from"@scure/bip32";var i=class i extends d{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==i.LENGTH)throw new Error(`PublicKey length should be ${i.LENGTH}`);this.key=t}verifySignature(e){let{message:t,signature:n}=e,y=c(t),l=s.fromHexInput(y).toUint8Array(),A=H(l),x=n.toUint8Array();return o.verify(x,A,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}static isInstance(e){return"key"in e&&e.key?.data?.length===i.LENGTH}};i.LENGTH=65;var u=i,r=class r extends p{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.key=t}static generate(){let e=o.utils.randomPrivateKey();return new r(e)}static fromDerivationPath(e,t){if(!g(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,h(t))}static fromDerivationPathInner(e,t){let{privateKey:n}=S.fromMasterSeed(t).derive(e);if(n===null)throw new Error("Invalid key");return new r(n)}sign(e){let t=c(e),n=s.fromHexInput(t),y=H(n.toUint8Array()),l=o.sign(y,this.key.toUint8Array(),{lowS:!0});return new m(l.toCompactRawBytes())}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new u(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t)}static isPrivateKey(e){return e instanceof r}};r.LENGTH=32;var v=r,a=class a extends f{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new a(t)}};a.LENGTH=64;var m=a;export{u as a,v as b,m as c};
2
+ //# sourceMappingURL=chunk-4GETVCGY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/secp256k1.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { sha3_256 } from \"@noble/hashes/sha3\";\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { HDKey } from \"@scure/bip32\";\nimport { Serializable, Deserializer, Serializer } from \"../../bcs\";\nimport { Hex } from \"../hex\";\nimport { HexInput } from \"../../types\";\nimport { isValidBIP44Path, mnemonicToSeed } from \"./hdKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { convertSigningMessage } from \"./utils\";\n\n/**\n * Represents the Secp256k1 ecdsa public key\n *\n * Secp256k1 authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class Secp256k1PublicKey extends PublicKey {\n // Secp256k1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.\n static readonly LENGTH: number = 65;\n\n // Hex value of the public key\n private readonly key: Hex;\n\n /**\n * Create a new PublicKey instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Secp256k1PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Secp256k1PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n // region PublicKey\n /**\n * Verifies a Secp256k1 signature against the public key\n *\n * Note signatures are validated to be canonical as a malleability check\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n const messageToVerify = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();\n const messageSha3Bytes = sha3_256(messageBytes);\n const signatureBytes = signature.toUint8Array();\n return secp256k1.verify(signatureBytes, messageSha3Bytes, this.key.toUint8Array(), { lowS: true });\n }\n\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PublicKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Secp256k1PublicKey` instead\n * @param publicKey\n */\n static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey {\n return publicKey instanceof Secp256k1PublicKey;\n }\n\n static isInstance(publicKey: PublicKey): publicKey is Secp256k1PublicKey {\n return \"key\" in publicKey && (publicKey.key as any)?.data?.length === Secp256k1PublicKey.LENGTH;\n }\n}\n\n/**\n * A Secp256k1 ecdsa private key\n */\nexport class Secp256k1PrivateKey extends Serializable implements PrivateKey {\n /**\n * Length of Secp256k1 ecdsa private key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The private key bytes\n * @private\n */\n private readonly key: Hex;\n\n // region Constructors\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const privateKeyHex = Hex.fromHexInput(hexInput);\n if (privateKeyHex.toUint8Array().length !== Secp256k1PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Secp256k1PrivateKey.LENGTH}`);\n }\n\n this.key = privateKeyHex;\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Secp256k1PrivateKey\n */\n static generate(): Secp256k1PrivateKey {\n const hexInput = secp256k1.utils.randomPrivateKey();\n return new Secp256k1PrivateKey(hexInput);\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase.\n *\n * @param path the BIP44 path\n * @param mnemonics the mnemonic seed phrase\n *\n * @returns The generated key\n */\n static fromDerivationPath(path: string, mnemonics: string): Secp256k1PrivateKey {\n if (!isValidBIP44Path(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Secp256k1PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));\n }\n\n /**\n * A private inner function so we can separate from the main fromDerivationPath() method\n * to add tests to verify we create the keys correctly.\n *\n * @param path the BIP44 path\n * @param seed the seed phrase created by the mnemonics\n *\n * @returns The generated key\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array): Secp256k1PrivateKey {\n const { privateKey } = HDKey.fromMasterSeed(seed).derive(path);\n // library returns privateKey as Uint8Array | null\n if (privateKey === null) {\n throw new Error(\"Invalid key\");\n }\n\n return new Secp256k1PrivateKey(privateKey);\n }\n\n // endregion\n\n // region PrivateKey\n\n /**\n * Sign the given message with the private key.\n *\n * Note: signatures are canonical, and non-malleable\n *\n * @param message a message as a string or Uint8Array\n * @returns Signature\n */\n sign(message: HexInput): Secp256k1Signature {\n const messageToSign = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToSign);\n const messageHashBytes = sha3_256(messageBytes.toUint8Array());\n const signature = secp256k1.sign(messageHashBytes, this.key.toUint8Array(), { lowS: true });\n return new Secp256k1Signature(signature.toCompactRawBytes());\n }\n\n /**\n * Derive the Secp256k1PublicKey from this private key.\n *\n * @returns Secp256k1PublicKey\n */\n publicKey(): Secp256k1PublicKey {\n const bytes = secp256k1.getPublicKey(this.key.toUint8Array(), false);\n return new Secp256k1PublicKey(bytes);\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key\n */\n toString(): string {\n return this.key.toString();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PrivateKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Secp256k1PrivateKey` instead\n */\n static isPrivateKey(privateKey: PrivateKey): privateKey is Secp256k1PrivateKey {\n return privateKey instanceof Secp256k1PrivateKey;\n }\n}\n\n/**\n * A signature of a message signed using a Secp256k1 ecdsa private key\n */\nexport class Secp256k1Signature extends Signature {\n /**\n * Secp256k1 ecdsa signatures are 256-bit.\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n */\n private readonly data: Hex;\n\n // region Constructors\n\n /**\n * Create a new Signature instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n const data = Hex.fromHexInput(hexInput);\n if (data.toUint8Array().length !== Secp256k1Signature.LENGTH) {\n throw new Error(\n `Signature length should be ${Secp256k1Signature.LENGTH}, received ${data.toUint8Array().length}`,\n );\n }\n this.data = data;\n }\n\n // endregion\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1Signature {\n const hex = deserializer.deserializeBytes();\n return new Secp256k1Signature(hex);\n }\n\n // endregion\n}\n"],"mappings":"6PAGA,OAAS,YAAAA,MAAgB,qBACzB,OAAS,aAAAC,MAAiB,0BAC1B,OAAS,SAAAC,MAAa,eAef,IAAMC,EAAN,MAAMA,UAA2BC,CAAU,CAYhD,YAAYC,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EACrC,GAAIC,EAAI,aAAa,EAAE,SAAWH,EAAmB,OACnD,MAAM,IAAI,MAAM,8BAA8BA,EAAmB,MAAM,EAAE,EAE3E,KAAK,IAAMG,CACb,CAQA,gBAAgBE,EAAoC,CAClD,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EACzBG,EAAkBC,EAAsBH,CAAO,EAC/CI,EAAeN,EAAI,aAAaI,CAAe,EAAE,aAAa,EAC9DG,EAAmBC,EAASF,CAAY,EACxCG,EAAiBN,EAAU,aAAa,EAC9C,OAAOO,EAAU,OAAOD,EAAgBF,EAAkB,KAAK,IAAI,aAAa,EAAG,CAAE,KAAM,EAAK,CAAC,CACnG,CAEA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAMA,UAAUI,EAA8B,CACtCA,EAAW,eAAe,KAAK,IAAI,aAAa,CAAC,CACnD,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO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BAAkB,CAAC,CAC7D,CAOA,WAAgC,CAC9B,IAAMU,EAAQH,EAAU,aAAa,KAAK,IAAI,aAAa,EAAG,EAAK,EACnE,OAAO,IAAIK,EAAmBF,CAAK,CACrC,CAOA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAOA,UAAmB,CACjB,OAAO,KAAK,IAAI,SAAS,CAC3B,CAMA,UAAUF,EAA8B,CACtCA,EAAW,eAAe,KAAK,aAAa,CAAC,CAC/C,CAEA,OAAO,YAAYC,EAAiD,CAClE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAII,EAAoBH,CAAK,CACtC,CAOA,OAAO,aAAaW,EAA2D,CAC7E,OAAOA,aAAsBR,CAC/B,CACF,EA/IaA,EAIK,OAAiB,GAJ5B,IAAMa,EAANb,EAoJMc,EAAN,MAAMA,UAA2BC,CAAU,CAmBhD,YAAYjC,EAAoB,CAC9B,MAAM,EACN,IAAMkC,EAAOhC,EAAI,aAAaF,CAAQ,EACtC,GAAIkC,EAAK,aAAa,EAAE,SAAWF,EAAmB,OACpD,MAAM,IAAI,MACR,8BAA8BA,EAAmB,MAAM,cAAcE,EAAK,aAAa,EAAE,MAAM,EACjG,EAEF,KAAK,KAAOA,CACd,CAMA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CAMA,UAAUrB,EAA8B,CACtCA,EAAW,eAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMb,EAAMa,EAAa,iBAAiB,EAC1C,OAAO,IAAIkB,EAAmB/B,CAAG,CACnC,CAGF,EApDa+B,EAIK,OAAS,GAJpB,IAAMF,EAANE","names":["sha3_256","secp256k1","HDKey","_Secp256k1PublicKey","PublicKey","hexInput","hex","Hex","args","message","signature","messageToVerify","convertSigningMessage","messageBytes","messageSha3Bytes","sha3_256","signatureBytes","secp256k1","serializer","deserializer","bytes","publicKey","Secp256k1PublicKey","_Secp256k1PrivateKey","Serializable","privateKeyHex","path","mnemonics","isValidBIP44Path","mnemonicToSeed","seed","privateKey","HDKey","messageToSign","messageHashBytes","Secp256k1Signature","Secp256k1PrivateKey","_Secp256k1Signature","Signature","data"]}
@@ -0,0 +1,2 @@
1
+ import{a as l,c as tn,d as en,e as D}from"./chunk-BTLHVOIC.mjs";import{r as nn,u as y}from"./chunk-V3OYNKY5.mjs";import{a as Q}from"./chunk-ALRQRVDX.mjs";import{a as j}from"./chunk-ISUHNAU4.mjs";import{a as A}from"./chunk-4TXG2LSP.mjs";import{a as Z}from"./chunk-MULJ2GLJ.mjs";import{a as X,c as z,d as L}from"./chunk-WMHYIP3S.mjs";import{c as v,d as K,e as O,f as b,g as V,h as q,i as H}from"./chunk-INZXND6M.mjs";import{b as x,d as E,e as B,f as F}from"./chunk-CSW2QEVU.mjs";import{a as _,b as p,d as g}from"./chunk-QNTQPWLK.mjs";import{a as k}from"./chunk-BOYYQAB4.mjs";import{b as Y}from"./chunk-O2M3QKKS.mjs";import{a as P,b as S}from"./chunk-UC5BZJ23.mjs";import{a as M}from"./chunk-4GETVCGY.mjs";import{i as C}from"./chunk-75U3LEBF.mjs";import{b as R,d as $}from"./chunk-CDLMUY5H.mjs";import{b as u}from"./chunk-OHRL766V.mjs";import{a as J}from"./chunk-QVJV46XS.mjs";import{a as U}from"./chunk-AH44UPM4.mjs";import{a as G}from"./chunk-WV5AD4IE.mjs";import{b as w}from"./chunk-BCUSI3N6.mjs";import{g as I}from"./chunk-SCHZ67F3.mjs";import{b as N,c as W}from"./chunk-L36ZHC7J.mjs";import{sha3_256 as un}from"@noble/hashes/sha3";async function kn(n){if(nn(n))return An(n);let{moduleAddress:t,moduleName:e,functionName:i}=y(n.function),a=await rn({key:"entry-function",moduleAddress:t,moduleName:e,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:tn});return dn({...n,abi:a})}function dn(n){let t=n.abi,{moduleAddress:e,moduleName:i,functionName:a}=y(n.function),r=l(n.typeArguments);if(r.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${r.length}`);let o=n.functionArguments.map((s,d)=>D(n.function,t,s,d,r));if(o.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${i}::${a}', expected ${t.parameters.length} but got ${o.length}`);let c=b.build(`${e}::${i}`,a,r,o);if("multisigAddress"in n){let s=u.from(n.multisigAddress);return new O(new q(s,new H(c)))}return new K(c)}async function vn(n){let{moduleAddress:t,moduleName:e,functionName:i}=y(n.function),a=await rn({key:"view-function",moduleAddress:t,moduleName:e,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:en});return mn({abi:a,...n})}function mn(n){let t=n.abi,{moduleAddress:e,moduleName:i,functionName:a}=y(n.function),r=l(n.typeArguments);if(r.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${r.length}`);let o=n?.functionArguments?.map((c,s)=>D(n.function,t,c,s,r))??[];if(o.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${i}::${a}', expected ${t.parameters.length} but got ${o.length}`);return b.build(`${e}::${i}`,a,r,o)}function An(n){return new v(new V(w.fromHexInput(n.bytecode).toUint8Array(),l(n.typeArguments),n.functionArguments))}async function yn(n){let{aptosConfig:t,sender:e,payload:i,options:a,feePayerAddress:r}=n,o=async()=>I[t.network]?{chainId:I[t.network]}:{chainId:(await J({aptosConfig:t})).chain_id},c=async()=>a?.gasUnitPrice?{gasEstimate:a.gasUnitPrice}:{gasEstimate:(await Y({aptosConfig:t})).gas_estimate},s=async()=>{let f=async()=>a?.accountSequenceNumber!==void 0?a.accountSequenceNumber:(await Q({aptosConfig:t,accountAddress:e})).sequence_number;if(r&&u.from(r).equals(u.ZERO))try{return await f()}catch{return 0}else return f()},[{chainId:d},{gasEstimate:m},h]=await Promise.all([o(),c(),s()]),{maxGasAmount:on,gasUnitPrice:sn,expireTimestamp:cn}={maxGasAmount:a?.maxGasAmount?BigInt(a.maxGasAmount):BigInt(2e5),gasUnitPrice:a?.gasUnitPrice??BigInt(m),expireTimestamp:a?.expireTimestamp??BigInt(Math.floor(Date.now()/1e3)+20)};return new X(u.from(e),BigInt(h),i,BigInt(on),BigInt(sn),BigInt(cn),new k(d))}async function Kn(n){let{aptosConfig:t,sender:e,payload:i,options:a,feePayerAddress:r}=n,o=await yn({aptosConfig:t,sender:e,payload:i,options:a,feePayerAddress:r});if("secondarySignerAddresses"in n){let c=n.secondarySignerAddresses?.map(s=>u.from(s))??[];return new j(o,c,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}return new Z(o,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}function On(n){let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:i,feePayerPublicKey:a}=n,r=T(t);if(e.feePayerAddress){let c=new L(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress),s=[];i&&(s=i.map(h=>T(h)));let d=T(a),m=new B(r,e.secondarySignerAddresses??[],s,{address:e.feePayerAddress,authenticator:d});return new A(c.raw_txn,m).bcsToBytes()}if(e.secondarySignerAddresses){let c=new z(e.rawTransaction,e.secondarySignerAddresses),s=[];s=i.map(m=>T(m));let d=new E(r,e.secondarySignerAddresses,s);return new A(c.raw_txn,d).bcsToBytes()}let o;if(r instanceof p)o=new x(r.public_key,r.signature);else if(r instanceof g)o=new F(r);else throw new Error("Invalid public key");return new A(e.rawTransaction,o).bcsToBytes()}function T(n){let t=new $(new Uint8Array(64));if(R.isInstance(n))return new p(n,t);if(P.isInstance(n))return new g(n,new S(t));if(C.isInstance(n)||M.isInstance(n))return console.warn("Expected AccountPublicKey, but got PublicKey. Please wrap your public key with AnyPublicKey."),new g(new P(n),new S(t));throw new Error("Unsupported public key")}function fn(n){let{transaction:t,feePayerAuthenticator:e,additionalSignersAuthenticators:i}=n,a=G(_,n.senderAuthenticator),r;if(t.feePayerAddress){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");r=new B(a,t.secondarySignerAddresses??[],i??[],{address:t.feePayerAddress,authenticator:e})}else if(t.secondarySignerAddresses){if(!i)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");r=new E(a,t.secondarySignerAddresses,i)}else a instanceof p?r=new x(a.public_key,a.signature):r=new F(a);return new A(t.rawTransaction,r).bcsToBytes()}function an(n){let t=un.create();for(let e of n)t.update(e);return t.digest()}var pn=an(["APTOS::Transaction"]);function Vn(n){let t=fn(n);return new w(an([pn,new Uint8Array([0]),t])).toString()}async function rn({key:n,moduleAddress:t,moduleName:e,functionName:i,aptosConfig:a,abi:r,fetch:o}){return r!==void 0?r:U(async()=>o(t,e,i,a),`${n}-${a.network}-${t}-${e}-${i}`,1e3*60*5)()}export{kn as a,dn as b,vn as c,mn as d,yn as e,Kn as f,On as g,T as h,fn as i,an as j,Vn as k};
2
+ //# sourceMappingURL=chunk-4LQKLXHW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/transactionBuilder/transactionBuilder.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the transaction creation lifecycle.\n * It holds different operations to generate a transaction payload, a raw transaction,\n * and a signed transaction that can be simulated, signed and submitted to chain.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput, Hex, PublicKey } from \"../../core\";\nimport { AnyPublicKey, AnySignature, KeylessPublicKey, Secp256k1PublicKey } from \"../../core/crypto\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { getInfo } from \"../../internal/account\";\nimport { getLedgerInfo } from \"../../internal/general\";\nimport { getGasPriceEstimation } from \"../../internal/transaction\";\nimport { NetworkToChainId } from \"../../utils/apiEndpoints\";\nimport { DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from \"../../utils/const\";\nimport { normalizeBundle } from \"../../utils/normalizeBundle\";\nimport {\n AccountAuthenticator,\n AccountAuthenticatorEd25519,\n AccountAuthenticatorSingleKey,\n} from \"../authenticator/account\";\nimport {\n TransactionAuthenticator,\n TransactionAuthenticatorEd25519,\n TransactionAuthenticatorFeePayer,\n TransactionAuthenticatorMultiAgent,\n TransactionAuthenticatorSingleSender,\n} from \"../authenticator/transaction\";\nimport {\n ChainId,\n EntryFunction,\n FeePayerRawTransaction,\n MultiAgentRawTransaction,\n MultiSig,\n MultiSigTransactionPayload,\n RawTransaction,\n Script,\n TransactionPayloadEntryFunction,\n TransactionPayloadMultiSig,\n TransactionPayloadScript,\n} from \"../instances\";\nimport { SignedTransaction } from \"../instances/signedTransaction\";\nimport {\n AnyRawTransaction,\n AnyTransactionPayloadInstance,\n EntryFunctionArgumentTypes,\n InputGenerateMultiAgentRawTransactionArgs,\n InputGenerateRawTransactionArgs,\n InputGenerateSingleSignerRawTransactionArgs,\n InputGenerateTransactionOptions,\n InputScriptData,\n InputSimulateTransactionData,\n InputMultiSigDataWithRemoteABI,\n InputEntryFunctionDataWithRemoteABI,\n InputGenerateTransactionPayloadDataWithRemoteABI,\n InputSubmitTransactionData,\n InputGenerateTransactionPayloadDataWithABI,\n InputEntryFunctionDataWithABI,\n InputMultiSigDataWithABI,\n InputViewFunctionDataWithRemoteABI,\n InputViewFunctionDataWithABI,\n FunctionABI,\n} from \"../types\";\nimport { convertArgument, fetchEntryFunctionAbi, fetchViewFunctionAbi, standardizeTypeTags } from \"./remoteAbi\";\nimport { memoizeAsync } from \"../../utils/memoize\";\nimport { getFunctionParts, isScriptDataInput } from \"./helpers\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\nimport { MultiAgentTransaction } from \"../instances/multiAgentTransaction\";\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransactionPayload` function.\n * When we call our `generateTransactionPayload` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;\nexport async function generateTransactionPayload(\n args: InputEntryFunctionDataWithRemoteABI,\n): Promise<TransactionPayloadEntryFunction>;\nexport async function generateTransactionPayload(\n args: InputMultiSigDataWithRemoteABI,\n): Promise<TransactionPayloadMultiSig>;\n\n/**\n * Builds a transaction payload based on the data argument and returns\n * a transaction payload - TransactionPayloadScript | TransactionPayloadMultiSig | TransactionPayloadEntryFunction\n *\n * This uses the RemoteABI by default, and the remote ABI can be skipped by using generateTransactionPayloadWithABI\n *\n * @param args.data GenerateTransactionPayloadData\n *\n * @return TransactionPayload\n */\nexport async function generateTransactionPayload(\n args: InputGenerateTransactionPayloadDataWithRemoteABI,\n): Promise<AnyTransactionPayloadInstance> {\n if (isScriptDataInput(args)) {\n return generateTransactionPayloadScript(args);\n }\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"entry-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchEntryFunctionAbi,\n });\n\n // Fill in the ABI\n return generateTransactionPayloadWithABI({ ...args, abi: functionAbi });\n}\n\nexport function generateTransactionPayloadWithABI(args: InputEntryFunctionDataWithABI): TransactionPayloadEntryFunction;\nexport function generateTransactionPayloadWithABI(args: InputMultiSigDataWithABI): TransactionPayloadMultiSig;\nexport function generateTransactionPayloadWithABI(\n args: InputGenerateTransactionPayloadDataWithABI,\n): AnyTransactionPayloadInstance {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> = args.functionArguments.map((arg, i) =>\n convertArgument(args.function, functionAbi, arg, i, typeArguments),\n );\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n const entryFunctionPayload = EntryFunction.build(\n `${moduleAddress}::${moduleName}`,\n functionName,\n typeArguments,\n functionArguments,\n );\n\n // Send it as multi sig if it's a multisig payload\n if (\"multisigAddress\" in args) {\n const multisigAddress = AccountAddress.from(args.multisigAddress);\n return new TransactionPayloadMultiSig(\n new MultiSig(multisigAddress, new MultiSigTransactionPayload(entryFunctionPayload)),\n );\n }\n\n // Otherwise send as an entry function\n return new TransactionPayloadEntryFunction(entryFunctionPayload);\n}\n\nexport async function generateViewFunctionPayload(args: InputViewFunctionDataWithRemoteABI): Promise<EntryFunction> {\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"view-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchViewFunctionAbi,\n });\n\n // Fill in the ABI\n return generateViewFunctionPayloadWithABI({ abi: functionAbi, ...args });\n}\n\nexport function generateViewFunctionPayloadWithABI(args: InputViewFunctionDataWithABI): EntryFunction {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> =\n args?.functionArguments?.map((arg, i) => convertArgument(args.function, functionAbi, arg, i, typeArguments)) ?? [];\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n return EntryFunction.build(`${moduleAddress}::${moduleName}`, functionName, typeArguments, functionArguments);\n}\n\nfunction generateTransactionPayloadScript(args: InputScriptData) {\n return new TransactionPayloadScript(\n new Script(\n Hex.fromHexInput(args.bytecode).toUint8Array(),\n standardizeTypeTags(args.typeArguments),\n args.functionArguments,\n ),\n );\n}\n\n/**\n * Generates a raw transaction\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n *\n * @returns RawTransaction\n */\nexport async function generateRawTransaction(args: {\n aptosConfig: AptosConfig;\n sender: AccountAddressInput;\n payload: AnyTransactionPayloadInstance;\n options?: InputGenerateTransactionOptions;\n feePayerAddress?: AccountAddressInput;\n}): Promise<RawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n\n const getChainId = async () => {\n if (NetworkToChainId[aptosConfig.network]) {\n return { chainId: NetworkToChainId[aptosConfig.network] };\n }\n const info = await getLedgerInfo({ aptosConfig });\n return { chainId: info.chain_id };\n };\n\n const getGasUnitPrice = async () => {\n if (options?.gasUnitPrice) {\n return { gasEstimate: options.gasUnitPrice };\n }\n const estimation = await getGasPriceEstimation({ aptosConfig });\n return { gasEstimate: estimation.gas_estimate };\n };\n\n const getSequenceNumberForAny = async () => {\n const getSequenceNumber = async () => {\n if (options?.accountSequenceNumber !== undefined) {\n return options.accountSequenceNumber;\n }\n\n return (await getInfo({ aptosConfig, accountAddress: sender })).sequence_number;\n };\n\n /**\n * Check if is sponsored transaction to honor AIP-52\n * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-52.md}\n */\n if (feePayerAddress && AccountAddress.from(feePayerAddress).equals(AccountAddress.ZERO)) {\n // Handle sponsored transaction generation with the option that\n // the main signer has not been created on chain\n try {\n // Check if main signer has been created on chain, if not assign sequence number 0\n return await getSequenceNumber();\n } catch (e: any) {\n return 0;\n }\n } else {\n return getSequenceNumber();\n }\n };\n const [{ chainId }, { gasEstimate }, sequenceNumber] = await Promise.all([\n getChainId(),\n getGasUnitPrice(),\n getSequenceNumberForAny(),\n ]);\n\n const { maxGasAmount, gasUnitPrice, expireTimestamp } = {\n maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),\n gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),\n expireTimestamp: options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_TXN_EXP_SEC_FROM_NOW),\n };\n\n return new RawTransaction(\n AccountAddress.from(sender),\n BigInt(sequenceNumber),\n payload,\n BigInt(maxGasAmount),\n BigInt(gasUnitPrice),\n BigInt(expireTimestamp),\n new ChainId(chainId),\n );\n}\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransaction` function.\n * When we call our `generateTransaction` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SimpleTransaction>;\nexport async function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;\n\n/**\n * Generates a transaction based on the provided arguments\n *\n * Note: we can start with one function to support all different payload/transaction types,\n * and if to complex to use, we could have function for each type\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n * @param args.options optional. Transaction options object\n * @param args.secondarySignerAddresses optional. For when want to create a multi signers transaction\n * @param args.feePayerAddress optional. For when want to create a fee payer (aka sponsored) transaction\n *\n * @return An instance of a RawTransaction, plus optional secondary/fee payer addresses\n * ```\n * {\n * rawTransaction: RawTransaction,\n * secondarySignerAddresses? : Array<AccountAddress>,\n * feePayerAddress?: AccountAddress\n * }\n * ```\n */\nexport async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n // generate raw transaction\n const rawTxn = await generateRawTransaction({\n aptosConfig,\n sender,\n payload,\n options,\n feePayerAddress,\n });\n\n // if multi agent transaction\n if (\"secondarySignerAddresses\" in args) {\n const signers: Array<AccountAddress> =\n args.secondarySignerAddresses?.map((signer) => AccountAddress.from(signer)) ?? [];\n\n return new MultiAgentTransaction(\n rawTxn,\n signers,\n args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined,\n );\n }\n // return the raw transaction\n return new SimpleTransaction(rawTxn, args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined);\n}\n\n/**\n * Simulate a transaction before signing and submit to chain\n *\n * @param args.transaction A aptos transaction type to sign\n * @param args.signerPublicKey The signer public key\n * @param args.secondarySignersPublicKeys optional. The secondary signers public keys if multi signers transaction\n * @param args.feePayerPublicKey optional. The fee payer public key is a fee payer (aka sponsored) transaction\n * @param args.options optional. SimulateTransactionOptions\n *\n * @returns A signed serialized transaction that can be simulated\n */\nexport function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array {\n const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;\n\n const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);\n\n // fee payer transaction\n if (transaction.feePayerAddress) {\n const transactionToSign = new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n if (secondarySignersPublicKeys) {\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n }\n const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey!);\n\n const transactionAuthenticator = new TransactionAuthenticatorFeePayer(\n accountAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n secondaryAccountAuthenticators,\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // multi agent transaction\n if (transaction.secondarySignerAddresses) {\n const transactionToSign = new MultiAgentRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses,\n );\n\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n\n secondaryAccountAuthenticators = secondarySignersPublicKeys!.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n\n const transactionAuthenticator = new TransactionAuthenticatorMultiAgent(\n accountAuthenticator,\n transaction.secondarySignerAddresses,\n secondaryAccountAuthenticators,\n );\n\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // single signer raw transaction\n let transactionAuthenticator;\n if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {\n transactionAuthenticator = new TransactionAuthenticatorEd25519(\n accountAuthenticator.public_key,\n accountAuthenticator.signature,\n );\n } else if (accountAuthenticator instanceof AccountAuthenticatorSingleKey) {\n transactionAuthenticator = new TransactionAuthenticatorSingleSender(accountAuthenticator);\n } else {\n throw new Error(\"Invalid public key\");\n }\n return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();\n}\n\nexport function getAuthenticatorForSimulation(publicKey: PublicKey) {\n // No need to for the signature to be matching in scheme. All that matters for simulations is that it's not valid\n const invalidSignature = new Ed25519Signature(new Uint8Array(64));\n\n if (Ed25519PublicKey.isInstance(publicKey)) {\n return new AccountAuthenticatorEd25519(publicKey, invalidSignature);\n }\n\n if (AnyPublicKey.isInstance(publicKey)) {\n return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(invalidSignature));\n }\n\n // TODO: remove this, non-account public keys should never make it here\n if (KeylessPublicKey.isInstance(publicKey) || Secp256k1PublicKey.isInstance(publicKey)) {\n // eslint-disable-next-line no-console\n console.warn(\"Expected AccountPublicKey, but got PublicKey. Please wrap your public key with AnyPublicKey.\");\n return new AccountAuthenticatorSingleKey(new AnyPublicKey(publicKey), new AnySignature(invalidSignature));\n }\n\n // TODO add support for AnyMultiKey\n throw new Error(\"Unsupported public key\");\n}\n\n/**\n * Prepare a transaction to be submitted to chain\n *\n * @param args.transaction A aptos transaction type\n * @param args.senderAuthenticator The account authenticator of the transaction sender\n * @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction\n *\n * @returns A SignedTransaction\n */\nexport function generateSignedTransaction(args: InputSubmitTransactionData): Uint8Array {\n const { transaction, feePayerAuthenticator, additionalSignersAuthenticators } = args;\n const senderAuthenticator = normalizeBundle(AccountAuthenticator, args.senderAuthenticator);\n\n let txnAuthenticator: TransactionAuthenticator;\n if (transaction.feePayerAddress) {\n if (!feePayerAuthenticator) {\n throw new Error(\"Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction\");\n }\n txnAuthenticator = new TransactionAuthenticatorFeePayer(\n senderAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n additionalSignersAuthenticators ?? [],\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n } else if (transaction.secondarySignerAddresses) {\n if (!additionalSignersAuthenticators) {\n throw new Error(\n \"Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction\",\n );\n }\n txnAuthenticator = new TransactionAuthenticatorMultiAgent(\n senderAuthenticator,\n transaction.secondarySignerAddresses,\n additionalSignersAuthenticators,\n );\n } else if (senderAuthenticator instanceof AccountAuthenticatorEd25519) {\n txnAuthenticator = new TransactionAuthenticatorEd25519(\n senderAuthenticator.public_key,\n senderAuthenticator.signature,\n );\n } else {\n txnAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);\n }\n\n return new SignedTransaction(transaction.rawTransaction, txnAuthenticator).bcsToBytes();\n}\n\n/**\n * Hashes the set of values with a SHA-3 256 hash\n * @param input array of UTF-8 strings or Uint8array byte arrays\n */\nexport function hashValues(input: (Uint8Array | string)[]): Uint8Array {\n const hash = sha3Hash.create();\n for (const item of input) {\n hash.update(item);\n }\n return hash.digest();\n}\n\n/**\n * The domain separated prefix for hashing transacitons\n */\nconst TRANSACTION_PREFIX = hashValues([\"APTOS::Transaction\"]);\n\n/**\n * Generates a user transaction hash for the given transaction payload. It must already have an authenticator\n * @param args InputSubmitTransactionData\n */\nexport function generateUserTransactionHash(args: InputSubmitTransactionData): string {\n const signedTransaction = generateSignedTransaction(args);\n\n // Transaction signature is defined as, the domain separated prefix based on struct (Transaction)\n // Then followed by the type of the transaction for the enum, UserTransaction is 0\n // Then followed by BCS encoded bytes of the signed transaction\n return new Hex(hashValues([TRANSACTION_PREFIX, new Uint8Array([0]), signedTransaction])).toString();\n}\n\n/**\n * Fetches and caches ABIs with allowing for pass-through on provided ABIs\n * @param key\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n * @param abi\n * @param fetch\n */\nasync function fetchAbi<T extends FunctionABI>({\n key,\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig,\n abi,\n fetch,\n}: {\n key: string;\n moduleAddress: string;\n moduleName: string;\n functionName: string;\n aptosConfig: AptosConfig;\n abi?: T;\n fetch: (moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig) => Promise<T>;\n}): Promise<T> {\n if (abi !== undefined) {\n return abi;\n }\n\n // We fetch the entry function ABI, and then pretend that we already had the ABI\n return memoizeAsync(\n async () => fetch(moduleAddress, moduleName, functionName, aptosConfig),\n `${key}-${aptosConfig.network}-${moduleAddress}-${moduleName}-${functionName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n"],"mappings":"8jCAQA,OAAS,YAAYA,OAAgB,qBAwFrC,eAAsBC,GACpBC,EACwC,CACxC,GAAIC,GAAkBD,CAAI,EACxB,OAAOE,GAAiCF,CAAI,EAE9C,GAAM,CAAE,cAAAG,EAAe,WA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IAAI,MACR,sGACF,EAEFI,EAAmB,IAAIjB,EACrBc,EACA5B,EAAY,yBACZ2B,CACF,CACF,MAAWC,aAA+Bb,EACxCgB,EAAmB,IAAIf,EACrBY,EAAoB,WACpBA,EAAoB,SACtB,EAEAG,EAAmB,IAAIb,EAAqCU,CAAmB,EAGjF,OAAO,IAAIhB,EAAkBZ,EAAY,eAAgB+B,CAAgB,EAAE,WAAW,CACxF,CAMO,SAASC,GAAWC,EAA4C,CACrE,IAAMC,EAAOC,GAAS,OAAO,EAC7B,QAAWC,KAAQH,EACjBC,EAAK,OAAOE,CAAI,EAElB,OAAOF,EAAK,OAAO,CACrB,CAKA,IAAMG,GAAqBL,GAAW,CAAC,oBAAoB,CAAC,EAMrD,SAASM,GAA4BnG,EAA0C,CACpF,IAAMoG,EAAoBb,GAA0BvF,CAAI,EAKxD,OAAO,IAAI8B,EAAI+D,GAAW,CAACK,GAAoB,IAAI,WAAW,CAAC,CAAC,CAAC,EAAGE,CAAiB,CAAC,CAAC,EAAE,SAAS,CACpG,CAYA,eAAe5F,GAAgC,CAC7C,IAAA6F,EACA,cAAAlG,EACA,WAAAC,EACA,aAAAC,EACA,YAAA2B,EACA,IAAAsE,EACA,MAAAC,CACF,EAQe,CACb,OAAID,IAAQ,OACHA,EAIFE,EACL,SAAYD,EAAMpG,EAAeC,EAAYC,EAAc2B,CAAW,EACtE,GAAGqE,CAAG,IAAIrE,EAAY,OAAO,IAAI7B,CAAa,IAAIC,CAAU,IAAIC,CAAY,GAC5E,IAAO,GAAK,CACd,EAAE,CACJ","names":["sha3Hash","generateTransactionPayload","args","isScriptDataInput","generateTransactionPayloadScript","moduleAddress","moduleName","functionName","getFunctionParts","functionAbi","fetchAbi","fetchEntryFunctionAbi","generateTransactionPayloadWithABI","typeArguments","standardizeTypeTags","functionArguments","arg","i","convertArgument","entryFunctionPayload","EntryFunction","multisigAddress","AccountAddress","TransactionPayloadMultiSig","MultiSig","MultiSigTransactionPayload","TransactionPayloadEntryFunction","generateViewFunctionPayload","fetchViewFunctionAbi","generateViewFunctionPayloadWithABI","TransactionPayloadScript","Script","Hex","generateRawTransaction","aptosConfig","sender","payload","options","feePayerAddress","getChainId","NetworkToChainId","getLedgerInfo","getGasUnitPrice","getGasPriceEstimation","getSequenceNumberForAny","getSequenceNumber","getInfo","chainId","gasEstimate","sequenceNumber","maxGasAmount","gasUnitPrice","expireTimestamp","RawTransaction","ChainId","buildTransaction","rawTxn","signers","signer","MultiAgentTransaction","SimpleTransaction","generateSignedTransactionForSimulation","signerPublicKey","transaction","secondarySignersPublicKeys","feePayerPublicKey","accountAuthenticator","getAuthenticatorForSimulation","transactionToSign","FeePayerRawTransaction","secondaryAccountAuthenticators","publicKey","feePayerAuthenticator","transactionAuthenticator","TransactionAuthenticatorFeePayer","SignedTransaction","MultiAgentRawTransaction","TransactionAuthenticatorMultiAgent","AccountAuthenticatorEd25519","TransactionAuthenticatorEd25519","AccountAuthenticatorSingleKey","TransactionAuthenticatorSingleSender","invalidSignature","Ed25519Signature","Ed25519PublicKey","AnyPublicKey","AnySignature","KeylessPublicKey","Secp256k1PublicKey","generateSignedTransaction","additionalSignersAuthenticators","senderAuthenticator","normalizeBundle","AccountAuthenticator","txnAuthenticator","hashValues","input","hash","sha3Hash","item","TRANSACTION_PREFIX","generateUserTransactionHash","signedTransaction","key","abi","fetch","memoizeAsync"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-YDXU6ALO.mjs";import{a as e}from"./chunk-EKZHYOQH.mjs";import{a as r}from"./chunk-A63SMUOU.mjs";var n=class o extends r{constructor(t,a){super(),this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
2
- //# sourceMappingURL=chunk-K7Y2SC65.mjs.map
1
+ import{a as i}from"./chunk-WMHYIP3S.mjs";import{a as e}from"./chunk-CSW2QEVU.mjs";import{a as r}from"./chunk-A63SMUOU.mjs";var n=class o extends r{constructor(t,a){super(),this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
2
+ //# sourceMappingURL=chunk-4TXG2LSP.mjs.map