@aptos-labs/ts-sdk 1.9.0 → 1.9.1-plugin.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/README.md +1 -1
  2. package/dist/common/index.d.ts +94 -1
  3. package/dist/common/index.js +24 -24
  4. package/dist/common/index.js.map +1 -1
  5. package/dist/esm/api/account.d.mts +1 -1
  6. package/dist/esm/api/account.mjs +1 -1
  7. package/dist/esm/api/ans.d.mts +1 -1
  8. package/dist/esm/api/ans.mjs +1 -1
  9. package/dist/esm/api/aptos.d.mts +1 -1
  10. package/dist/esm/api/aptos.mjs +1 -1
  11. package/dist/esm/api/aptosConfig.d.mts +7 -0
  12. package/dist/esm/api/aptosConfig.mjs +1 -1
  13. package/dist/esm/api/coin.d.mts +1 -1
  14. package/dist/esm/api/coin.mjs +1 -1
  15. package/dist/esm/api/digitalAsset.d.mts +1 -1
  16. package/dist/esm/api/digitalAsset.mjs +1 -1
  17. package/dist/esm/api/event.mjs +1 -1
  18. package/dist/esm/api/faucet.mjs +1 -1
  19. package/dist/esm/api/fungibleAsset.d.mts +1 -1
  20. package/dist/esm/api/fungibleAsset.mjs +1 -1
  21. package/dist/esm/api/general.mjs +1 -1
  22. package/dist/esm/api/index.d.mts +1 -1
  23. package/dist/esm/api/index.mjs +1 -1
  24. package/dist/esm/api/staking.mjs +1 -1
  25. package/dist/esm/api/transaction.d.mts +1 -1
  26. package/dist/esm/api/transaction.mjs +1 -1
  27. package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
  28. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  29. package/dist/esm/api/transactionSubmission/management.d.mts +1 -1
  30. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  31. package/dist/esm/api/transactionSubmission/sign.d.mts +1 -1
  32. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  33. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  34. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  35. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  36. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  37. package/dist/esm/api/utils.mjs +1 -1
  38. package/dist/esm/assetUploader/assetUploader.d.mts +109 -0
  39. package/dist/esm/assetUploader/assetUploader.mjs +2 -0
  40. package/dist/esm/assetUploader/assetUploader.mjs.map +1 -0
  41. package/dist/esm/assetUploader/index.d.mts +24 -0
  42. package/dist/esm/assetUploader/index.mjs +2 -0
  43. package/dist/esm/assetUploader/index.mjs.map +1 -0
  44. package/dist/esm/assetUploader/irys.d.mts +64 -0
  45. package/dist/esm/assetUploader/irys.mjs +2 -0
  46. package/dist/esm/assetUploader/irys.mjs.map +1 -0
  47. package/dist/esm/bcs/index.mjs +1 -1
  48. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  49. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  50. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  51. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  52. package/dist/esm/bcs/serializer.mjs +1 -1
  53. package/dist/esm/chunk-2BGOMPDV.mjs +2 -0
  54. package/dist/esm/{chunk-S2F6CSH4.mjs → chunk-2TRSGKMS.mjs} +2 -2
  55. package/dist/esm/{chunk-NL3XVNS5.mjs → chunk-2ZLKKVWJ.mjs} +2 -2
  56. package/dist/esm/chunk-4LQNMXX3.mjs +2 -0
  57. package/dist/esm/{chunk-JEHR6GKW.mjs → chunk-4PCEBFIT.mjs} +2 -2
  58. package/dist/esm/chunk-52PEPCCF.mjs +2 -0
  59. package/dist/esm/{chunk-YDAA4RG4.mjs → chunk-5VY5VSRG.mjs} +2 -2
  60. package/dist/esm/{chunk-QA4XWNIH.mjs → chunk-7FMG66Z4.mjs} +2 -2
  61. package/dist/esm/{chunk-7U36LMP4.mjs → chunk-7TPQMQK4.mjs} +2 -2
  62. package/dist/esm/{chunk-R4VJDSIP.mjs → chunk-AK75KOT3.mjs} +2 -2
  63. package/dist/esm/{chunk-XKD7W5NO.mjs → chunk-ALXMJOCO.mjs} +2 -2
  64. package/dist/esm/{chunk-NURFZOR4.mjs → chunk-BVAY3B44.mjs} +2 -2
  65. package/dist/esm/{chunk-GQOOXOTN.mjs → chunk-BYODEYSX.mjs} +2 -2
  66. package/dist/esm/{chunk-NL72WE3E.mjs → chunk-BZMO6Q6L.mjs} +2 -2
  67. package/dist/esm/{chunk-YR2R3LW4.mjs → chunk-CNHM36ZH.mjs} +2 -2
  68. package/dist/esm/{chunk-Q6WOHF4A.mjs → chunk-CSXY6Z3K.mjs} +2 -2
  69. package/dist/esm/{chunk-2E2JOGE5.mjs → chunk-CXB2C2SJ.mjs} +2 -2
  70. package/dist/esm/{chunk-TN5BUH4F.mjs → chunk-DHQWLSD6.mjs} +2 -2
  71. package/dist/esm/chunk-DPHEHCIM.mjs +2 -0
  72. package/dist/esm/chunk-DQHNZBA5.mjs +2 -0
  73. package/dist/esm/chunk-DQHNZBA5.mjs.map +1 -0
  74. package/dist/esm/chunk-EBCIZ4D6.mjs +2 -0
  75. package/dist/esm/{chunk-EF2F7NWO.mjs → chunk-EGUJAHAO.mjs} +2 -2
  76. package/dist/esm/{chunk-C3HM7HQP.mjs → chunk-FE5USPGB.mjs} +2 -2
  77. package/dist/esm/{chunk-FVMVV4V3.mjs → chunk-FOSJSOXX.mjs} +2 -2
  78. package/dist/esm/{chunk-Y5AJLNUD.mjs → chunk-FYZLJM4W.mjs} +2 -2
  79. package/dist/esm/{chunk-VEVBHH3M.mjs → chunk-FZIAMWFX.mjs} +2 -2
  80. package/dist/esm/{chunk-UIUSDBCL.mjs → chunk-GE7VQ5NZ.mjs} +2 -2
  81. package/dist/esm/{chunk-F7CR75CJ.mjs → chunk-GHMYWL3R.mjs} +2 -2
  82. package/dist/esm/{chunk-F7CR75CJ.mjs.map → chunk-GHMYWL3R.mjs.map} +1 -1
  83. package/dist/esm/{chunk-6FBKUTGF.mjs → chunk-GHYE26Q5.mjs} +2 -2
  84. package/dist/esm/{chunk-EQZ757ES.mjs → chunk-GRCJKGVR.mjs} +2 -2
  85. package/dist/esm/chunk-HIUJDWMR.mjs +2 -0
  86. package/dist/esm/{chunk-DE5OOOVY.mjs.map → chunk-HIUJDWMR.mjs.map} +1 -1
  87. package/dist/esm/chunk-I4RVDRYR.mjs +2 -0
  88. package/dist/esm/{chunk-7BDYKJXX.mjs.map → chunk-I4RVDRYR.mjs.map} +1 -1
  89. package/dist/esm/{chunk-CHA5DSSD.mjs → chunk-IF7ODXD7.mjs} +2 -2
  90. package/dist/esm/chunk-IWPVPIKD.mjs +2 -0
  91. package/dist/esm/{chunk-QR72RXBS.mjs → chunk-JIC5IJLP.mjs} +2 -2
  92. package/dist/esm/{chunk-SXIFL5DQ.mjs → chunk-JX3IRXNX.mjs} +2 -2
  93. package/dist/esm/{chunk-LLL2LFYH.mjs → chunk-KPO5IM5R.mjs} +2 -2
  94. package/dist/esm/chunk-L7ORFGZ7.mjs +1 -0
  95. package/dist/esm/chunk-L7ORFGZ7.mjs.map +1 -0
  96. package/dist/esm/chunk-LG7RJQ57.mjs +2 -0
  97. package/dist/esm/{chunk-F67Y7YH6.mjs → chunk-MSVYA75Y.mjs} +2 -2
  98. package/dist/esm/{chunk-CVEJHRAU.mjs → chunk-NCDLIACO.mjs} +1 -1
  99. package/dist/esm/chunk-NCDLIACO.mjs.map +1 -0
  100. package/dist/esm/{chunk-WTHNSNAX.mjs → chunk-NIOGYWR4.mjs} +2 -2
  101. package/dist/esm/chunk-O4MQVPLP.mjs +2 -0
  102. package/dist/esm/chunk-OH5ADEJO.mjs +2 -0
  103. package/dist/esm/{chunk-52RTAMN7.mjs → chunk-P434YHBQ.mjs} +2 -2
  104. package/dist/esm/{chunk-TNVR7SNR.mjs → chunk-P633OFBI.mjs} +2 -2
  105. package/dist/esm/chunk-PEOCYUOO.mjs +2 -0
  106. package/dist/esm/chunk-PEOCYUOO.mjs.map +1 -0
  107. package/dist/esm/{chunk-BBUAAJRA.mjs → chunk-PGZ67PEU.mjs} +2 -2
  108. package/dist/esm/chunk-PISONN6H.mjs +2 -0
  109. package/dist/esm/chunk-PISONN6H.mjs.map +1 -0
  110. package/dist/esm/{chunk-B7M3OWHV.mjs → chunk-Q2V2K5AT.mjs} +2 -2
  111. package/dist/esm/chunk-QDD2MDJZ.mjs +2 -0
  112. package/dist/esm/{chunk-VRSUCKJA.mjs.map → chunk-QDD2MDJZ.mjs.map} +1 -1
  113. package/dist/esm/{chunk-ILJWEPDW.mjs → chunk-QG76NDGM.mjs} +2 -2
  114. package/dist/esm/{chunk-F7MOQC7Z.mjs → chunk-RP4FMC6O.mjs} +2 -2
  115. package/dist/esm/{chunk-J6MWD4XN.mjs → chunk-SASVQCT6.mjs} +2 -2
  116. package/dist/esm/{chunk-VMXBMAYK.mjs → chunk-SKF6E6X7.mjs} +2 -2
  117. package/dist/esm/{chunk-7D5LHQNS.mjs → chunk-SQW7K56J.mjs} +2 -2
  118. package/dist/esm/chunk-TTM66JZ4.mjs +2 -0
  119. package/dist/esm/{chunk-UMLDKLDL.mjs → chunk-TVEFB6OB.mjs} +2 -2
  120. package/dist/esm/{chunk-DGOT2VR5.mjs → chunk-UFD443TT.mjs} +2 -2
  121. package/dist/esm/chunk-UZUMQY43.mjs +2 -0
  122. package/dist/esm/{chunk-TX7UK75Q.mjs → chunk-V5GIZQF6.mjs} +2 -2
  123. package/dist/esm/{chunk-TX7UK75Q.mjs.map → chunk-V5GIZQF6.mjs.map} +1 -1
  124. package/dist/esm/{chunk-INORE66K.mjs → chunk-VHUFFKFT.mjs} +2 -2
  125. package/dist/esm/{chunk-N65SOKJQ.mjs → chunk-VJUCSKNE.mjs} +2 -2
  126. package/dist/esm/{chunk-N4RBQZ2B.mjs → chunk-VKWPCOZA.mjs} +2 -2
  127. package/dist/esm/{chunk-GRJJBGHT.mjs → chunk-VN2YZGFJ.mjs} +2 -2
  128. package/dist/esm/chunk-W5PK4QCX.mjs +2 -0
  129. package/dist/esm/{chunk-PJNPLRPR.mjs → chunk-WHNLDDPT.mjs} +2 -2
  130. package/dist/esm/{chunk-KWJTVJ7C.mjs → chunk-WT3OKY3G.mjs} +2 -2
  131. package/dist/esm/{chunk-LMXP3JUU.mjs → chunk-XDZF5IUF.mjs} +2 -2
  132. package/dist/esm/{chunk-OG56TYZE.mjs → chunk-XHUPYPN4.mjs} +2 -2
  133. package/dist/esm/{chunk-G62HQC77.mjs → chunk-XM3BQ5L6.mjs} +2 -2
  134. package/dist/esm/chunk-Y7G5W2QZ.mjs +2 -0
  135. package/dist/esm/client/core.mjs +1 -1
  136. package/dist/esm/client/get.mjs +1 -1
  137. package/dist/esm/client/index.mjs +1 -1
  138. package/dist/esm/client/post.mjs +1 -1
  139. package/dist/esm/client/types.mjs +1 -1
  140. package/dist/esm/core/account/Account.d.mts +1 -1
  141. package/dist/esm/core/account/Account.mjs +1 -1
  142. package/dist/esm/core/account/Ed25519Account.d.mts +1 -1
  143. package/dist/esm/core/account/Ed25519Account.mjs +1 -1
  144. package/dist/esm/core/account/SingleKeyAccount.d.mts +1 -1
  145. package/dist/esm/core/account/SingleKeyAccount.mjs +1 -1
  146. package/dist/esm/core/account/index.d.mts +1 -1
  147. package/dist/esm/core/account/index.mjs +1 -1
  148. package/dist/esm/core/accountAddress.mjs +1 -1
  149. package/dist/esm/core/authenticationKey.d.mts +1 -1
  150. package/dist/esm/core/authenticationKey.mjs +1 -1
  151. package/dist/esm/core/common.mjs +1 -1
  152. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  153. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  154. package/dist/esm/core/crypto/index.d.mts +1 -1
  155. package/dist/esm/core/crypto/index.mjs +1 -1
  156. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  157. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  158. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  159. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  160. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  161. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  162. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  163. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  164. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  165. package/dist/esm/core/crypto/signature.mjs +1 -1
  166. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  167. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  168. package/dist/esm/core/hex.mjs +1 -1
  169. package/dist/esm/core/index.d.mts +1 -1
  170. package/dist/esm/core/index.mjs +1 -1
  171. package/dist/esm/index.d.mts +3 -1
  172. package/dist/esm/index.mjs +1 -1
  173. package/dist/esm/internal/account.d.mts +2 -2
  174. package/dist/esm/internal/account.mjs +1 -1
  175. package/dist/esm/internal/ans.d.mts +1 -1
  176. package/dist/esm/internal/ans.mjs +1 -1
  177. package/dist/esm/internal/coin.d.mts +1 -1
  178. package/dist/esm/internal/coin.mjs +1 -1
  179. package/dist/esm/internal/digitalAsset.d.mts +1 -1
  180. package/dist/esm/internal/digitalAsset.mjs +1 -1
  181. package/dist/esm/internal/event.mjs +1 -1
  182. package/dist/esm/internal/faucet.mjs +1 -1
  183. package/dist/esm/internal/fungibleAsset.d.mts +1 -1
  184. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  185. package/dist/esm/internal/general.mjs +1 -1
  186. package/dist/esm/internal/staking.mjs +1 -1
  187. package/dist/esm/internal/transaction.mjs +1 -1
  188. package/dist/esm/internal/transactionSubmission.d.mts +1 -1
  189. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  190. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  191. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  192. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  193. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  194. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  195. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  196. package/dist/esm/transactions/index.d.mts +1 -1
  197. package/dist/esm/transactions/index.mjs +1 -1
  198. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  199. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  200. package/dist/esm/transactions/instances/index.d.mts +1 -1
  201. package/dist/esm/transactions/instances/index.mjs +1 -1
  202. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  203. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  204. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  205. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  206. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  207. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  208. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  209. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +1 -1
  210. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  211. package/dist/esm/transactions/management/index.d.mts +1 -1
  212. package/dist/esm/transactions/management/index.mjs +1 -1
  213. package/dist/esm/transactions/management/transactionWorker.d.mts +1 -1
  214. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  215. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
  216. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  217. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  218. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  219. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
  220. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  221. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  222. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  223. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  224. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  225. package/dist/esm/transactions/types.d.mts +1 -1
  226. package/dist/esm/types/index.d.mts +1 -0
  227. package/dist/esm/types/index.mjs +1 -1
  228. package/dist/esm/version.d.mts +1 -1
  229. package/dist/esm/version.mjs +1 -1
  230. package/package.json +13 -4
  231. package/src/api/aptosConfig.ts +9 -0
  232. package/src/assetUploader/assetUploader.ts +87 -0
  233. package/src/assetUploader/index.ts +1 -0
  234. package/src/assetUploader/irys.ts +102 -0
  235. package/src/index.ts +1 -0
  236. package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +0 -1
  237. package/src/types/index.ts +2 -0
  238. package/src/version.ts +1 -1
  239. package/dist/browser/index.d.ts +0 -7139
  240. package/dist/browser/index.global.js +0 -483
  241. package/dist/browser/index.global.js.map +0 -1
  242. package/dist/esm/chunk-3EUOBVCT.mjs +0 -2
  243. package/dist/esm/chunk-7BDYKJXX.mjs +0 -2
  244. package/dist/esm/chunk-ARIC32W7.mjs +0 -2
  245. package/dist/esm/chunk-B2ZKW23W.mjs +0 -2
  246. package/dist/esm/chunk-CVEJHRAU.mjs.map +0 -1
  247. package/dist/esm/chunk-DE5OOOVY.mjs +0 -2
  248. package/dist/esm/chunk-FBPNHF54.mjs +0 -2
  249. package/dist/esm/chunk-FWDKABRW.mjs +0 -2
  250. package/dist/esm/chunk-FWDKABRW.mjs.map +0 -1
  251. package/dist/esm/chunk-I3TCHVQQ.mjs +0 -2
  252. package/dist/esm/chunk-IHCIKE42.mjs +0 -2
  253. package/dist/esm/chunk-PPTG6BDV.mjs +0 -2
  254. package/dist/esm/chunk-QKTV6AZ7.mjs +0 -2
  255. package/dist/esm/chunk-VRSUCKJA.mjs +0 -2
  256. package/dist/esm/chunk-WKUXBIYB.mjs +0 -2
  257. package/dist/esm/chunk-WME5D6YR.mjs +0 -2
  258. package/dist/esm/chunk-X5C3LYI7.mjs +0 -2
  259. package/dist/esm/chunk-XTPFQ4MH.mjs +0 -2
  260. package/dist/esm/chunk-YZZO6VDC.mjs +0 -2
  261. /package/dist/esm/{chunk-PPTG6BDV.mjs.map → chunk-2BGOMPDV.mjs.map} +0 -0
  262. /package/dist/esm/{chunk-S2F6CSH4.mjs.map → chunk-2TRSGKMS.mjs.map} +0 -0
  263. /package/dist/esm/{chunk-NL3XVNS5.mjs.map → chunk-2ZLKKVWJ.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-QKTV6AZ7.mjs.map → chunk-4LQNMXX3.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-JEHR6GKW.mjs.map → chunk-4PCEBFIT.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-I3TCHVQQ.mjs.map → chunk-52PEPCCF.mjs.map} +0 -0
  267. /package/dist/esm/{chunk-YDAA4RG4.mjs.map → chunk-5VY5VSRG.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-QA4XWNIH.mjs.map → chunk-7FMG66Z4.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-7U36LMP4.mjs.map → chunk-7TPQMQK4.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-R4VJDSIP.mjs.map → chunk-AK75KOT3.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-XKD7W5NO.mjs.map → chunk-ALXMJOCO.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-NURFZOR4.mjs.map → chunk-BVAY3B44.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-GQOOXOTN.mjs.map → chunk-BYODEYSX.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-NL72WE3E.mjs.map → chunk-BZMO6Q6L.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-YR2R3LW4.mjs.map → chunk-CNHM36ZH.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-Q6WOHF4A.mjs.map → chunk-CSXY6Z3K.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-2E2JOGE5.mjs.map → chunk-CXB2C2SJ.mjs.map} +0 -0
  278. /package/dist/esm/{chunk-TN5BUH4F.mjs.map → chunk-DHQWLSD6.mjs.map} +0 -0
  279. /package/dist/esm/{chunk-YZZO6VDC.mjs.map → chunk-DPHEHCIM.mjs.map} +0 -0
  280. /package/dist/esm/{chunk-IHCIKE42.mjs.map → chunk-EBCIZ4D6.mjs.map} +0 -0
  281. /package/dist/esm/{chunk-EF2F7NWO.mjs.map → chunk-EGUJAHAO.mjs.map} +0 -0
  282. /package/dist/esm/{chunk-C3HM7HQP.mjs.map → chunk-FE5USPGB.mjs.map} +0 -0
  283. /package/dist/esm/{chunk-FVMVV4V3.mjs.map → chunk-FOSJSOXX.mjs.map} +0 -0
  284. /package/dist/esm/{chunk-Y5AJLNUD.mjs.map → chunk-FYZLJM4W.mjs.map} +0 -0
  285. /package/dist/esm/{chunk-VEVBHH3M.mjs.map → chunk-FZIAMWFX.mjs.map} +0 -0
  286. /package/dist/esm/{chunk-UIUSDBCL.mjs.map → chunk-GE7VQ5NZ.mjs.map} +0 -0
  287. /package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-GHYE26Q5.mjs.map} +0 -0
  288. /package/dist/esm/{chunk-EQZ757ES.mjs.map → chunk-GRCJKGVR.mjs.map} +0 -0
  289. /package/dist/esm/{chunk-CHA5DSSD.mjs.map → chunk-IF7ODXD7.mjs.map} +0 -0
  290. /package/dist/esm/{chunk-WKUXBIYB.mjs.map → chunk-IWPVPIKD.mjs.map} +0 -0
  291. /package/dist/esm/{chunk-QR72RXBS.mjs.map → chunk-JIC5IJLP.mjs.map} +0 -0
  292. /package/dist/esm/{chunk-SXIFL5DQ.mjs.map → chunk-JX3IRXNX.mjs.map} +0 -0
  293. /package/dist/esm/{chunk-LLL2LFYH.mjs.map → chunk-KPO5IM5R.mjs.map} +0 -0
  294. /package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-LG7RJQ57.mjs.map} +0 -0
  295. /package/dist/esm/{chunk-F67Y7YH6.mjs.map → chunk-MSVYA75Y.mjs.map} +0 -0
  296. /package/dist/esm/{chunk-WTHNSNAX.mjs.map → chunk-NIOGYWR4.mjs.map} +0 -0
  297. /package/dist/esm/{chunk-3EUOBVCT.mjs.map → chunk-O4MQVPLP.mjs.map} +0 -0
  298. /package/dist/esm/{chunk-WME5D6YR.mjs.map → chunk-OH5ADEJO.mjs.map} +0 -0
  299. /package/dist/esm/{chunk-52RTAMN7.mjs.map → chunk-P434YHBQ.mjs.map} +0 -0
  300. /package/dist/esm/{chunk-TNVR7SNR.mjs.map → chunk-P633OFBI.mjs.map} +0 -0
  301. /package/dist/esm/{chunk-BBUAAJRA.mjs.map → chunk-PGZ67PEU.mjs.map} +0 -0
  302. /package/dist/esm/{chunk-B7M3OWHV.mjs.map → chunk-Q2V2K5AT.mjs.map} +0 -0
  303. /package/dist/esm/{chunk-ILJWEPDW.mjs.map → chunk-QG76NDGM.mjs.map} +0 -0
  304. /package/dist/esm/{chunk-F7MOQC7Z.mjs.map → chunk-RP4FMC6O.mjs.map} +0 -0
  305. /package/dist/esm/{chunk-J6MWD4XN.mjs.map → chunk-SASVQCT6.mjs.map} +0 -0
  306. /package/dist/esm/{chunk-VMXBMAYK.mjs.map → chunk-SKF6E6X7.mjs.map} +0 -0
  307. /package/dist/esm/{chunk-7D5LHQNS.mjs.map → chunk-SQW7K56J.mjs.map} +0 -0
  308. /package/dist/esm/{chunk-B2ZKW23W.mjs.map → chunk-TTM66JZ4.mjs.map} +0 -0
  309. /package/dist/esm/{chunk-UMLDKLDL.mjs.map → chunk-TVEFB6OB.mjs.map} +0 -0
  310. /package/dist/esm/{chunk-DGOT2VR5.mjs.map → chunk-UFD443TT.mjs.map} +0 -0
  311. /package/dist/esm/{chunk-ARIC32W7.mjs.map → chunk-UZUMQY43.mjs.map} +0 -0
  312. /package/dist/esm/{chunk-INORE66K.mjs.map → chunk-VHUFFKFT.mjs.map} +0 -0
  313. /package/dist/esm/{chunk-N65SOKJQ.mjs.map → chunk-VJUCSKNE.mjs.map} +0 -0
  314. /package/dist/esm/{chunk-N4RBQZ2B.mjs.map → chunk-VKWPCOZA.mjs.map} +0 -0
  315. /package/dist/esm/{chunk-GRJJBGHT.mjs.map → chunk-VN2YZGFJ.mjs.map} +0 -0
  316. /package/dist/esm/{chunk-X5C3LYI7.mjs.map → chunk-W5PK4QCX.mjs.map} +0 -0
  317. /package/dist/esm/{chunk-PJNPLRPR.mjs.map → chunk-WHNLDDPT.mjs.map} +0 -0
  318. /package/dist/esm/{chunk-KWJTVJ7C.mjs.map → chunk-WT3OKY3G.mjs.map} +0 -0
  319. /package/dist/esm/{chunk-LMXP3JUU.mjs.map → chunk-XDZF5IUF.mjs.map} +0 -0
  320. /package/dist/esm/{chunk-OG56TYZE.mjs.map → chunk-XHUPYPN4.mjs.map} +0 -0
  321. /package/dist/esm/{chunk-G62HQC77.mjs.map → chunk-XM3BQ5L6.mjs.map} +0 -0
  322. /package/dist/esm/{chunk-XTPFQ4MH.mjs.map → chunk-Y7G5W2QZ.mjs.map} +0 -0
  323. /package/dist/esm/{publicKey-lq5djCIY.d.mts → publicKey-B3XRNhHO.d.mts} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-KWJTVJ7C.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-FVMVV4V3.mjs.map
1
+ import{a as t}from"./chunk-WT3OKY3G.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-FOSJSOXX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-JEHR6GKW.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
- //# sourceMappingURL=chunk-Y5AJLNUD.mjs.map
1
+ import{a as s}from"./chunk-4PCEBFIT.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
+ //# sourceMappingURL=chunk-FYZLJM4W.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-KWJTVJ7C.mjs";import{f as t,i as o}from"./chunk-PJNPLRPR.mjs";import{e as n}from"./chunk-HEPV52CH.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:a,coinType:p,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[p??n],functionArguments:[c,a],abi:u},options:m})}export{y as a};
2
- //# sourceMappingURL=chunk-VEVBHH3M.mjs.map
1
+ import{a as r}from"./chunk-WT3OKY3G.mjs";import{f as t,i as o}from"./chunk-WHNLDDPT.mjs";import{e as n}from"./chunk-HEPV52CH.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:a,coinType:p,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[p??n],functionArguments:[c,a],abi:u},options:m})}export{y as a};
2
+ //# sourceMappingURL=chunk-FZIAMWFX.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-VMXBMAYK.mjs";async function s(e){let{type:p,originMethod:n,path:i,body:r,acceptType:R,contentType:y,params:u,aptosConfig:t,overrides:m}=e,c=t.getRequestUrl(p);return o({url:c,method:"POST",originMethod:n,path:i,body:r,contentType:y?.valueOf(),acceptType:R?.valueOf(),params:u,overrides:{...t.clientConfig,...m}},t)}async function A(e){return s({...e,type:0})}async function f(e){return s({...e,type:1})}async function x(e){return s({...e,type:2})}export{s as a,A as b,f as c,x as d};
2
- //# sourceMappingURL=chunk-UIUSDBCL.mjs.map
1
+ import{b as o}from"./chunk-SKF6E6X7.mjs";async function s(e){let{type:p,originMethod:n,path:i,body:r,acceptType:R,contentType:y,params:u,aptosConfig:t,overrides:m}=e,c=t.getRequestUrl(p);return o({url:c,method:"POST",originMethod:n,path:i,body:r,contentType:y?.valueOf(),acceptType:R?.valueOf(),params:u,overrides:{...t.clientConfig,...m}},t)}async function A(e){return s({...e,type:0})}async function f(e){return s({...e,type:1})}async function x(e){return s({...e,type:2})}export{s as a,A as b,f as c,x as d};
2
+ //# sourceMappingURL=chunk-GE7VQ5NZ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-N4RBQZ2B.mjs";import{a as i}from"./chunk-FBPNHF54.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var h=(s=>(s.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",s.INVALID_HEX_CHARS="invalid_hex_chars",s.TOO_SHORT="too_short",s.TOO_LONG="too_long",s.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",s.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",s.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",s))(h||{}),r=class r extends a{constructor(t){super();if(t.length!==r.LENGTH)throw new i("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=t}isSpecial(){return this.data.slice(0,this.data.length-1).every(t=>t===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let t=o(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return o(this.data)}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let e=this.bcsToBytes();t.serializeBytes(e)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r(e)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let e=r.fromString(t);if(t.length!==r.LONG_STRING_LENGTH+2)if(e.isSpecial()){if(t.length!==3)throw new i(`The given hex string ${t} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new i(`The given hex string ${t} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return e}static fromString(t){let e=t;if(t.startsWith("0x")&&(e=t.slice(2)),e.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(e.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let n;try{n=l(e.padStart(64,"0"))}catch(d){throw new i(`Hex characters are invalid: ${d?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromString(t)}static fromStrict(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromStringStrict(t)}static isValid(t){try{return t.strict?r.fromStrict(t.input):r.from(t.input),{valid:!0}}catch(e){return{valid:!1,invalidReason:e?.invalidReason,invalidReasonMessage:e?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};r.LENGTH=32,r.LONG_STRING_LENGTH=64,r.ZERO=r.from("0x0"),r.ONE=r.from("0x1"),r.TWO=r.from("0x2"),r.THREE=r.from("0x3"),r.FOUR=r.from("0x4");var c=r;export{h as a,c as b};
2
- //# sourceMappingURL=chunk-F7CR75CJ.mjs.map
1
+ import{a}from"./chunk-VKWPCOZA.mjs";import{a as i}from"./chunk-LG7RJQ57.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var h=(s=>(s.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",s.INVALID_HEX_CHARS="invalid_hex_chars",s.TOO_SHORT="too_short",s.TOO_LONG="too_long",s.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",s.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",s.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",s))(h||{}),r=class r extends a{constructor(t){if(super(),t.length!==r.LENGTH)throw new i("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=t}isSpecial(){return this.data.slice(0,this.data.length-1).every(t=>t===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let t=o(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return o(this.data)}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let e=this.bcsToBytes();t.serializeBytes(e)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r(e)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let e=r.fromString(t);if(t.length!==r.LONG_STRING_LENGTH+2)if(e.isSpecial()){if(t.length!==3)throw new i(`The given hex string ${t} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new i(`The given hex string ${t} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return e}static fromString(t){let e=t;if(t.startsWith("0x")&&(e=t.slice(2)),e.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(e.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let n;try{n=l(e.padStart(64,"0"))}catch(d){throw new i(`Hex characters are invalid: ${d?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromString(t)}static fromStrict(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromStringStrict(t)}static isValid(t){try{return t.strict?r.fromStrict(t.input):r.from(t.input),{valid:!0}}catch(e){return{valid:!1,invalidReason:e?.invalidReason,invalidReasonMessage:e?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};r.LENGTH=32,r.LONG_STRING_LENGTH=64,r.ZERO=r.from("0x0"),r.ONE=r.from("0x1"),r.TWO=r.from("0x2"),r.THREE=r.from("0x3"),r.FOUR=r.from("0x4");var c=r;export{h as a,c as b};
2
+ //# sourceMappingURL=chunk-GHMYWL3R.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/accountAddress.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { Serializable, Serializer } from \"../bcs/serializer\";\nimport { Deserializer } from \"../bcs/deserializer\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { TransactionArgument } from \"../transactions/instances/transactionArgument\";\nimport { HexInput, ScriptTransactionArgumentVariants } from \"../types\";\n\n/**\n * This enum is used to explain why an address was invalid.\n */\nexport enum AddressInvalidReason {\n INCORRECT_NUMBER_OF_BYTES = \"incorrect_number_of_bytes\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n TOO_SHORT = \"too_short\",\n TOO_LONG = \"too_long\",\n LEADING_ZERO_X_REQUIRED = \"leading_zero_x_required\",\n LONG_FORM_REQUIRED_UNLESS_SPECIAL = \"long_form_required_unless_special\",\n INVALID_PADDING_ZEROES = \"INVALID_PADDING_ZEROES\",\n}\n\nexport type AccountAddressInput = HexInput | AccountAddress;\n\n/**\n * NOTE: Only use this class for account addresses. For other hex data, e.g. transaction\n * hashes, use the Hex class.\n *\n * AccountAddress is used for working with account addresses. Account addresses, when\n * represented as a string, generally look like these examples:\n * - 0x1\n * - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c\n *\n * Proper formatting and parsing of account addresses is defined by AIP-40.\n * To learn more about the standard, read the AIP here:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * The comments in this class make frequent reference to the LONG and SHORT formats,\n * as well as \"special\" addresses. To learn what these refer to see AIP-40.\n */\nexport class AccountAddress extends Serializable implements TransactionArgument {\n /**\n * This is the internal representation of an account address.\n */\n readonly data: Uint8Array;\n\n /**\n * The number of bytes that make up an account address.\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The length of an address string in LONG form without a leading 0x.\n */\n static readonly LONG_STRING_LENGTH: number = 64;\n\n static ZERO: AccountAddress = AccountAddress.from(\"0x0\");\n\n static ONE: AccountAddress = AccountAddress.from(\"0x1\");\n\n static TWO: AccountAddress = AccountAddress.from(\"0x2\");\n\n static THREE: AccountAddress = AccountAddress.from(\"0x3\");\n\n static FOUR: AccountAddress = AccountAddress.from(\"0x4\");\n\n /**\n * Creates an instance of AccountAddress from a Uint8Array.\n *\n * @param args.data A Uint8Array representing an account address.\n */\n constructor(input: Uint8Array) {\n super();\n if (input.length !== AccountAddress.LENGTH) {\n throw new ParsingError(\n \"AccountAddress data should be exactly 32 bytes long\",\n AddressInvalidReason.INCORRECT_NUMBER_OF_BYTES,\n );\n }\n this.data = input;\n }\n\n /**\n * Returns whether an address is special, where special is defined as 0x0 to 0xf\n * inclusive. In other words, the last byte of the address must be < 0b10000 (16)\n * and every other byte must be zero.\n *\n * For more information on how special addresses are defined see AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @returns true if the address is special, false if not.\n */\n isSpecial(): boolean {\n return (\n this.data.slice(0, this.data.length - 1).every((byte) => byte === 0) && this.data[this.data.length - 1] < 0b10000\n );\n }\n\n // ===\n // Methods for representing an instance of AccountAddress as other types.\n // ===\n\n /**\n * Return the AccountAddress as a string as per AIP-40.\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * In short, it means that special addresses are represented in SHORT form, meaning\n * 0x0 through to 0xf inclusive, and every other address is represented in LONG form,\n * meaning 0x + 64 hex characters.\n *\n * @returns AccountAddress as a string conforming to AIP-40.\n */\n toString(): `0x${string}` {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n /**\n * NOTE: Prefer to use `toString` where possible.\n *\n * Return the AccountAddress as a string as per AIP-40 but without the leading 0x.\n *\n * Learn more by reading the docstring of `toString`.\n *\n * @returns AccountAddress as a string conforming to AIP-40 but without the leading 0x.\n */\n toStringWithoutPrefix(): string {\n let hex = bytesToHex(this.data);\n if (this.isSpecial()) {\n hex = hex[hex.length - 1];\n }\n return hex;\n }\n\n /**\n * NOTE: Prefer to use `toString` where possible.\n *\n * Whereas toString will format special addresses (as defined by isSpecial) using the\n * SHORT form (no leading 0s), this format the address in the LONG format\n * unconditionally.\n *\n * This means it will be 0x + 64 hex characters.\n *\n * @returns AccountAddress as a string in LONG form.\n */\n toStringLong(): `0x${string}` {\n return `0x${this.toStringLongWithoutPrefix()}`;\n }\n\n /**\n * NOTE: Prefer to use `toString` where possible.\n *\n * Whereas toString will format special addresses (as defined by isSpecial) using the\n * SHORT form (no leading 0s), this function will include leading zeroes. The string\n * will not have a leading zero.\n *\n * This means it will be 64 hex characters without a leading 0x.\n *\n * @returns AccountAddress as a string in LONG form without a leading 0x.\n */\n toStringLongWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Get the inner hex data. The inner data is already a Uint8Array so no conversion\n * is taking place here, it just returns the inner data.\n *\n * @returns Hex data as Uint8Array\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Serialize the AccountAddress to a Serializer instance's data buffer.\n * @param serializer The serializer to serialize the AccountAddress to.\n * @returns void\n * @example\n * const serializer = new Serializer();\n * const address = AccountAddress.fromString(\"0x1\");\n * address.serialize(serializer);\n * const bytes = serializer.toUint8Array();\n * // `bytes` is now the BCS-serialized address.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data);\n }\n\n serializeForEntryFunction(serializer: Serializer): void {\n const bcsBytes = this.bcsToBytes();\n serializer.serializeBytes(bcsBytes);\n }\n\n serializeForScriptFunction(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(ScriptTransactionArgumentVariants.Address);\n serializer.serialize(this);\n }\n\n /**\n * Deserialize an AccountAddress from the byte buffer in a Deserializer instance.\n * @param deserializer The deserializer to deserialize the AccountAddress from.\n * @returns An instance of AccountAddress.\n * @example\n * const bytes = hexToBytes(\"0x0102030405060708091011121314151617181920212223242526272829303132\");\n * const deserializer = new Deserializer(bytes);\n * const address = AccountAddress.deserialize(deserializer);\n * // `address` is now an instance of AccountAddress.\n */\n static deserialize(deserializer: Deserializer): AccountAddress {\n const bytes = deserializer.deserializeFixedBytes(AccountAddress.LENGTH);\n return new AccountAddress(bytes);\n }\n\n // ===\n // Methods for creating an instance of AccountAddress from other types.\n // ===\n\n /**\n * NOTE: This function has strict parsing behavior. For relaxed behavior, please use\n * the `fromString` function.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows only the strictest formats defined by AIP-40. In short this\n * means only the following formats are accepted:\n *\n * - LONG\n * - SHORT for special addresses\n *\n * Where:\n * - LONG is defined as 0x + 64 hex characters.\n * - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.\n *\n * This means the following are not accepted:\n * - SHORT for non-special addresses.\n * - Any address without a leading 0x.\n *\n * Learn more about the different address formats by reading AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @param input A hex string representing an account address.\n *\n * @returns An instance of AccountAddress.\n */\n static fromStringStrict(input: string): AccountAddress {\n // Assert the string starts with 0x.\n if (!input.startsWith(\"0x\")) {\n throw new ParsingError(\"Hex string must start with a leading 0x.\", AddressInvalidReason.LEADING_ZERO_X_REQUIRED);\n }\n\n const address = AccountAddress.fromString(input);\n\n // Check if the address is in LONG form. If it is not, this is only allowed for\n // special addresses, in which case we check it is in proper SHORT form.\n if (input.length !== AccountAddress.LONG_STRING_LENGTH + 2) {\n if (!address.isSpecial()) {\n throw new ParsingError(\n `The given hex string ${input} is not a special address, it must be represented as 0x + 64 chars.`,\n AddressInvalidReason.LONG_FORM_REQUIRED_UNLESS_SPECIAL,\n );\n } else if (input.length !== 3) {\n // 0x + one hex char is the only valid SHORT form for special addresses.\n throw new ParsingError(\n // eslint-disable-next-line max-len\n `The given hex string ${input} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,\n AddressInvalidReason.INVALID_PADDING_ZEROES,\n );\n }\n }\n\n return address;\n }\n\n /**\n * NOTE: This function has relaxed parsing behavior. For strict behavior, please use\n * the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this\n * function, `fromString` is only provided for backwards compatibility.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows all formats defined by AIP-40. In short this means the\n * following formats are accepted:\n *\n * - LONG, with or without leading 0x\n * - SHORT, with or without leading 0x\n *\n * Where:\n * - LONG is 64 hex characters.\n * - SHORT is 1 to 63 hex characters inclusive.\n * - Padding zeroes are allowed, e.g. 0x0123 is valid.\n *\n * Learn more about the different address formats by reading AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @param input A hex string representing an account address.\n *\n * @returns An instance of AccountAddress.\n */\n static fromString(input: string): AccountAddress {\n let parsedInput = input;\n // Remove leading 0x for parsing.\n if (input.startsWith(\"0x\")) {\n parsedInput = input.slice(2);\n }\n\n // Ensure the address string is at least 1 character long.\n if (parsedInput.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_SHORT,\n );\n }\n\n // Ensure the address string is not longer than 64 characters.\n if (parsedInput.length > 64) {\n throw new ParsingError(\n \"Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_LONG,\n );\n }\n\n let addressBytes: Uint8Array;\n try {\n // Pad the address with leading zeroes, so it is 64 chars long and then convert\n // the hex string to bytes. Every two characters in a hex string constitutes a\n // single byte. So a 64 length hex string becomes a 32 byte array.\n addressBytes = hexToBytes(parsedInput.padStart(64, \"0\"));\n } catch (error: any) {\n // At this point the only way this can fail is if the hex string contains\n // invalid characters.\n throw new ParsingError(`Hex characters are invalid: ${error?.message}`, AddressInvalidReason.INVALID_HEX_CHARS);\n }\n\n return new AccountAddress(addressBytes);\n }\n\n /**\n * Convenience method for creating an AccountAddress from all known inputs.\n *\n * This handles, Uint8array, string, and AccountAddress itself\n * @param input\n */\n static from(input: AccountAddressInput): AccountAddress {\n if (input instanceof AccountAddress) {\n return input;\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return AccountAddress.fromString(input);\n }\n\n /**\n * Convenience method for creating an AccountAddress from all known inputs.\n *\n * This handles, Uint8array, string, and AccountAddress itself\n * @param input\n */\n static fromStrict(input: AccountAddressInput): AccountAddress {\n if (input instanceof AccountAddress) {\n return input;\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return AccountAddress.fromStringStrict(input);\n }\n\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the string is a valid AccountAddress.\n *\n * @param args.input A hex string representing an account address.\n * @param args.strict If true, use strict parsing behavior. If false, use relaxed parsing behavior.\n *\n * @returns valid = true if the string is valid, valid = false if not. If the string\n * is not valid, invalidReason will be set explaining why it is invalid.\n */\n static isValid(args: { input: AccountAddressInput; strict?: boolean }): ParsingResult<AddressInvalidReason> {\n try {\n if (args.strict) {\n AccountAddress.fromStrict(args.input);\n } else {\n AccountAddress.from(args.input);\n }\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Return whether AccountAddresses are equal. AccountAddresses are considered equal\n * if their underlying byte data is identical.\n *\n * @param other The AccountAddress to compare to.\n * @returns true if the AccountAddresses are equal, false if not.\n */\n equals(other: AccountAddress): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n"],"mappings":"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","names":["bytesToHex","hexToBytes","AddressInvalidReason","_AccountAddress","Serializable","input","ParsingError","byte","hex","bytesToHex","serializer","bcsBytes","deserializer","bytes","address","parsedInput","addressBytes","hexToBytes","error","args","other","value","index","AccountAddress"]}
1
+ {"version":3,"sources":["../../src/core/accountAddress.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { Serializable, Serializer } from \"../bcs/serializer\";\nimport { Deserializer } from \"../bcs/deserializer\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { TransactionArgument } from \"../transactions/instances/transactionArgument\";\nimport { HexInput, ScriptTransactionArgumentVariants } from \"../types\";\n\n/**\n * This enum is used to explain why an address was invalid.\n */\nexport enum AddressInvalidReason {\n INCORRECT_NUMBER_OF_BYTES = \"incorrect_number_of_bytes\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n TOO_SHORT = \"too_short\",\n TOO_LONG = \"too_long\",\n LEADING_ZERO_X_REQUIRED = \"leading_zero_x_required\",\n LONG_FORM_REQUIRED_UNLESS_SPECIAL = \"long_form_required_unless_special\",\n INVALID_PADDING_ZEROES = \"INVALID_PADDING_ZEROES\",\n}\n\nexport type AccountAddressInput = HexInput | AccountAddress;\n\n/**\n * NOTE: Only use this class for account addresses. For other hex data, e.g. transaction\n * hashes, use the Hex class.\n *\n * AccountAddress is used for working with account addresses. Account addresses, when\n * represented as a string, generally look like these examples:\n * - 0x1\n * - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c\n *\n * Proper formatting and parsing of account addresses is defined by AIP-40.\n * To learn more about the standard, read the AIP here:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * The comments in this class make frequent reference to the LONG and SHORT formats,\n * as well as \"special\" addresses. To learn what these refer to see AIP-40.\n */\nexport class AccountAddress extends Serializable implements TransactionArgument {\n /**\n * This is the internal representation of an account address.\n */\n readonly data: Uint8Array;\n\n /**\n * The number of bytes that make up an account address.\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The length of an address string in LONG form without a leading 0x.\n */\n static readonly LONG_STRING_LENGTH: number = 64;\n\n static ZERO: AccountAddress = AccountAddress.from(\"0x0\");\n\n static ONE: AccountAddress = AccountAddress.from(\"0x1\");\n\n static TWO: AccountAddress = AccountAddress.from(\"0x2\");\n\n static THREE: AccountAddress = AccountAddress.from(\"0x3\");\n\n static FOUR: AccountAddress = AccountAddress.from(\"0x4\");\n\n /**\n * Creates an instance of AccountAddress from a Uint8Array.\n *\n * @param args.data A Uint8Array representing an account address.\n */\n constructor(input: Uint8Array) {\n super();\n if (input.length !== AccountAddress.LENGTH) {\n throw new ParsingError(\n \"AccountAddress data should be exactly 32 bytes long\",\n AddressInvalidReason.INCORRECT_NUMBER_OF_BYTES,\n );\n }\n this.data = input;\n }\n\n /**\n * Returns whether an address is special, where special is defined as 0x0 to 0xf\n * inclusive. In other words, the last byte of the address must be < 0b10000 (16)\n * and every other byte must be zero.\n *\n * For more information on how special addresses are defined see AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @returns true if the address is special, false if not.\n */\n isSpecial(): boolean {\n return (\n this.data.slice(0, this.data.length - 1).every((byte) => byte === 0) && this.data[this.data.length - 1] < 0b10000\n );\n }\n\n // ===\n // Methods for representing an instance of AccountAddress as other types.\n // ===\n\n /**\n * Return the AccountAddress as a string as per AIP-40.\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * In short, it means that special addresses are represented in SHORT form, meaning\n * 0x0 through to 0xf inclusive, and every other address is represented in LONG form,\n * meaning 0x + 64 hex characters.\n *\n * @returns AccountAddress as a string conforming to AIP-40.\n */\n toString(): `0x${string}` {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n /**\n * NOTE: Prefer to use `toString` where possible.\n *\n * Return the AccountAddress as a string as per AIP-40 but without the leading 0x.\n *\n * Learn more by reading the docstring of `toString`.\n *\n * @returns AccountAddress as a string conforming to AIP-40 but without the leading 0x.\n */\n toStringWithoutPrefix(): string {\n let hex = bytesToHex(this.data);\n if (this.isSpecial()) {\n hex = hex[hex.length - 1];\n }\n return hex;\n }\n\n /**\n * NOTE: Prefer to use `toString` where possible.\n *\n * Whereas toString will format special addresses (as defined by isSpecial) using the\n * SHORT form (no leading 0s), this format the address in the LONG format\n * unconditionally.\n *\n * This means it will be 0x + 64 hex characters.\n *\n * @returns AccountAddress as a string in LONG form.\n */\n toStringLong(): `0x${string}` {\n return `0x${this.toStringLongWithoutPrefix()}`;\n }\n\n /**\n * NOTE: Prefer to use `toString` where possible.\n *\n * Whereas toString will format special addresses (as defined by isSpecial) using the\n * SHORT form (no leading 0s), this function will include leading zeroes. The string\n * will not have a leading zero.\n *\n * This means it will be 64 hex characters without a leading 0x.\n *\n * @returns AccountAddress as a string in LONG form without a leading 0x.\n */\n toStringLongWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Get the inner hex data. The inner data is already a Uint8Array so no conversion\n * is taking place here, it just returns the inner data.\n *\n * @returns Hex data as Uint8Array\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Serialize the AccountAddress to a Serializer instance's data buffer.\n * @param serializer The serializer to serialize the AccountAddress to.\n * @returns void\n * @example\n * const serializer = new Serializer();\n * const address = AccountAddress.fromString(\"0x1\");\n * address.serialize(serializer);\n * const bytes = serializer.toUint8Array();\n * // `bytes` is now the BCS-serialized address.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data);\n }\n\n serializeForEntryFunction(serializer: Serializer): void {\n const bcsBytes = this.bcsToBytes();\n serializer.serializeBytes(bcsBytes);\n }\n\n serializeForScriptFunction(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(ScriptTransactionArgumentVariants.Address);\n serializer.serialize(this);\n }\n\n /**\n * Deserialize an AccountAddress from the byte buffer in a Deserializer instance.\n * @param deserializer The deserializer to deserialize the AccountAddress from.\n * @returns An instance of AccountAddress.\n * @example\n * const bytes = hexToBytes(\"0x0102030405060708091011121314151617181920212223242526272829303132\");\n * const deserializer = new Deserializer(bytes);\n * const address = AccountAddress.deserialize(deserializer);\n * // `address` is now an instance of AccountAddress.\n */\n static deserialize(deserializer: Deserializer): AccountAddress {\n const bytes = deserializer.deserializeFixedBytes(AccountAddress.LENGTH);\n return new AccountAddress(bytes);\n }\n\n // ===\n // Methods for creating an instance of AccountAddress from other types.\n // ===\n\n /**\n * NOTE: This function has strict parsing behavior. For relaxed behavior, please use\n * the `fromString` function.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows only the strictest formats defined by AIP-40. In short this\n * means only the following formats are accepted:\n *\n * - LONG\n * - SHORT for special addresses\n *\n * Where:\n * - LONG is defined as 0x + 64 hex characters.\n * - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.\n *\n * This means the following are not accepted:\n * - SHORT for non-special addresses.\n * - Any address without a leading 0x.\n *\n * Learn more about the different address formats by reading AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @param input A hex string representing an account address.\n *\n * @returns An instance of AccountAddress.\n */\n static fromStringStrict(input: string): AccountAddress {\n // Assert the string starts with 0x.\n if (!input.startsWith(\"0x\")) {\n throw new ParsingError(\"Hex string must start with a leading 0x.\", AddressInvalidReason.LEADING_ZERO_X_REQUIRED);\n }\n\n const address = AccountAddress.fromString(input);\n\n // Check if the address is in LONG form. If it is not, this is only allowed for\n // special addresses, in which case we check it is in proper SHORT form.\n if (input.length !== AccountAddress.LONG_STRING_LENGTH + 2) {\n if (!address.isSpecial()) {\n throw new ParsingError(\n `The given hex string ${input} is not a special address, it must be represented as 0x + 64 chars.`,\n AddressInvalidReason.LONG_FORM_REQUIRED_UNLESS_SPECIAL,\n );\n } else if (input.length !== 3) {\n // 0x + one hex char is the only valid SHORT form for special addresses.\n throw new ParsingError(\n // eslint-disable-next-line max-len\n `The given hex string ${input} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,\n AddressInvalidReason.INVALID_PADDING_ZEROES,\n );\n }\n }\n\n return address;\n }\n\n /**\n * NOTE: This function has relaxed parsing behavior. For strict behavior, please use\n * the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this\n * function, `fromString` is only provided for backwards compatibility.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows all formats defined by AIP-40. In short this means the\n * following formats are accepted:\n *\n * - LONG, with or without leading 0x\n * - SHORT, with or without leading 0x\n *\n * Where:\n * - LONG is 64 hex characters.\n * - SHORT is 1 to 63 hex characters inclusive.\n * - Padding zeroes are allowed, e.g. 0x0123 is valid.\n *\n * Learn more about the different address formats by reading AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @param input A hex string representing an account address.\n *\n * @returns An instance of AccountAddress.\n */\n static fromString(input: string): AccountAddress {\n let parsedInput = input;\n // Remove leading 0x for parsing.\n if (input.startsWith(\"0x\")) {\n parsedInput = input.slice(2);\n }\n\n // Ensure the address string is at least 1 character long.\n if (parsedInput.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_SHORT,\n );\n }\n\n // Ensure the address string is not longer than 64 characters.\n if (parsedInput.length > 64) {\n throw new ParsingError(\n \"Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_LONG,\n );\n }\n\n let addressBytes: Uint8Array;\n try {\n // Pad the address with leading zeroes, so it is 64 chars long and then convert\n // the hex string to bytes. Every two characters in a hex string constitutes a\n // single byte. So a 64 length hex string becomes a 32 byte array.\n addressBytes = hexToBytes(parsedInput.padStart(64, \"0\"));\n } catch (error: any) {\n // At this point the only way this can fail is if the hex string contains\n // invalid characters.\n throw new ParsingError(`Hex characters are invalid: ${error?.message}`, AddressInvalidReason.INVALID_HEX_CHARS);\n }\n\n return new AccountAddress(addressBytes);\n }\n\n /**\n * Convenience method for creating an AccountAddress from all known inputs.\n *\n * This handles, Uint8array, string, and AccountAddress itself\n * @param input\n */\n static from(input: AccountAddressInput): AccountAddress {\n if (input instanceof AccountAddress) {\n return input;\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return AccountAddress.fromString(input);\n }\n\n /**\n * Convenience method for creating an AccountAddress from all known inputs.\n *\n * This handles, Uint8array, string, and AccountAddress itself\n * @param input\n */\n static fromStrict(input: AccountAddressInput): AccountAddress {\n if (input instanceof AccountAddress) {\n return input;\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return AccountAddress.fromStringStrict(input);\n }\n\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the string is a valid AccountAddress.\n *\n * @param args.input A hex string representing an account address.\n * @param args.strict If true, use strict parsing behavior. If false, use relaxed parsing behavior.\n *\n * @returns valid = true if the string is valid, valid = false if not. If the string\n * is not valid, invalidReason will be set explaining why it is invalid.\n */\n static isValid(args: { input: AccountAddressInput; strict?: boolean }): ParsingResult<AddressInvalidReason> {\n try {\n if (args.strict) {\n AccountAddress.fromStrict(args.input);\n } else {\n AccountAddress.from(args.input);\n }\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Return whether AccountAddresses are equal. AccountAddresses are considered equal\n * if their underlying byte data is identical.\n *\n * @param other The AccountAddress to compare to.\n * @returns true if the AccountAddresses are equal, false if not.\n */\n equals(other: AccountAddress): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n"],"mappings":"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","names":["bytesToHex","hexToBytes","AddressInvalidReason","_AccountAddress","Serializable","input","ParsingError","byte","hex","bytesToHex","serializer","bcsBytes","deserializer","bytes","address","parsedInput","addressBytes","hexToBytes","error","args","other","value","index","AccountAddress"]}
@@ -1,2 +1,2 @@
1
- var s=class extends Error{constructor(e,t,a){super(a);this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=e}};export{s as a};
2
- //# sourceMappingURL=chunk-6FBKUTGF.mjs.map
1
+ var s=class extends Error{constructor(e,t,a){super(a),this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=e}};export{s as a};
2
+ //# sourceMappingURL=chunk-GHYE26Q5.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-TN5BUH4F.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-EQZ757ES.mjs.map
1
+ import{c as a}from"./chunk-DHQWLSD6.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-GRCJKGVR.mjs.map
@@ -0,0 +1,2 @@
1
+ var o="1.9.1";export{o as a};
2
+ //# sourceMappingURL=chunk-HIUJDWMR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.9.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
1
+ {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.9.1\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
@@ -0,0 +1,2 @@
1
+ import{a as v}from"./chunk-OH5ADEJO.mjs";import{d as p,f,g as K,h as A,i as H,j as P}from"./chunk-LR65XHSF.mjs";import{b as E}from"./chunk-IWPVPIKD.mjs";import{a as h}from"./chunk-XDZF5IUF.mjs";import{a as g}from"./chunk-VKWPCOZA.mjs";import{b as i}from"./chunk-BZMO6Q6L.mjs";import o from"tweetnacl";var n=class n extends E{constructor(e){super();let t=i.fromHexInput(e);if(t.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=t}verifySignature(e){let{message:t,signature:s}=e;if(!(s instanceof y))return!1;let c=i.fromHexInput(t).toUint8Array(),u=s.toUint8Array(),l=this.key.toUint8Array();return o.sign.detached.verify(c,u,l)}authKey(){return h.fromSchemeAndBytes({scheme:0,input:this.toUint8Array()})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t)}static isPublicKey(e){return e instanceof n}};n.LENGTH=32;var m=n,r=class r extends g{constructor(e){super();let t=i.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.signingKeyPair=o.sign.keyPair.fromSeed(t.toUint8Array().slice(0,r.LENGTH))}static generate(){let e=o.sign.keyPair();return new r(e.secretKey.slice(0,r.LENGTH))}static fromDerivationPath(e,t){if(!f(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,P(t))}static fromDerivationPathInner(e,t,s=p){let{key:c,chainCode:u}=K(r.SLIP_0010_SEED,t),l=H(e).map(d=>parseInt(d,10)),{key:x}=l.reduce((d,U)=>A(d,U+s),{key:c,chainCode:u});return new r(x)}publicKey(){let e=this.signingKeyPair.publicKey;return new m(e)}sign(e){let t=i.fromHexInput(e).toUint8Array(),s=o.sign.detached(t,this.signingKeyPair.secretKey);return new y(s)}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,r.LENGTH)}toString(){return i.fromHexInput(this.toUint8Array()).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,r.SLIP_0010_SEED="ed25519 seed";var S=r,a=class a extends v{constructor(e){super();let t=i.fromHexInput(e);if(t.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.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 y=a;export{m as a,S as b,y as c};
2
+ //# sourceMappingURL=chunk-I4RVDRYR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/crypto/ed25519.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport nacl from \"tweetnacl\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { HexInput, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { CKDPriv, deriveKey, HARDENED_OFFSET, isValidHardenedPath, mnemonicToSeed, splitPath } from \"./hdKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { AccountPublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents the public key of an Ed25519 key pair.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Ed25519 scheme is represented in the SDK as `Legacy authentication key` and also\n * as `AnyPublicKey` that represents any `Unified authentication key`\n */\nexport class Ed25519PublicKey extends AccountPublicKey {\n /**\n * Length of an Ed25519 public key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * Bytes of the public key\n * @private\n */\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 !== Ed25519PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Ed25519PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n // region AccountPublicKey\n\n /**\n * Verifies a signed data with a public key\n * @param args.message a signed message\n * @param args.signature the signature of the message\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof Ed25519Signature)) {\n return false;\n }\n\n const messageBytes = Hex.fromHexInput(message).toUint8Array();\n const signatureBytes = signature.toUint8Array();\n const publicKeyBytes = this.key.toUint8Array();\n return nacl.sign.detached.verify(messageBytes, signatureBytes, publicKeyBytes);\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.Ed25519,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\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): Ed25519PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PublicKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Ed25519PublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is Ed25519PublicKey {\n return publicKey instanceof Ed25519PublicKey;\n }\n}\n\n/**\n * Represents the private key of an Ed25519 key pair.\n */\nexport class Ed25519PrivateKey extends Serializable implements PrivateKey {\n /**\n * Length of an Ed25519 private key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The Ed25519 key seed to use for BIP-32 compatibility\n * See more {@link https://github.com/satoshilabs/slips/blob/master/slip-0010.md}\n */\n static readonly SLIP_0010_SEED = \"ed25519 seed\";\n\n /**\n * The Ed25519 signing key\n * @private\n */\n private readonly signingKeyPair: nacl.SignKeyPair;\n\n // region Constructors\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * @param hexInput HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const privateKeyHex = Hex.fromHexInput(hexInput);\n if (privateKeyHex.toUint8Array().length !== Ed25519PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Ed25519PrivateKey.LENGTH}`);\n }\n\n // Create keyPair from Private key in Uint8Array format\n this.signingKeyPair = nacl.sign.keyPair.fromSeed(privateKeyHex.toUint8Array().slice(0, Ed25519PrivateKey.LENGTH));\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Ed25519PrivateKey\n */\n static generate(): Ed25519PrivateKey {\n const keyPair = nacl.sign.keyPair();\n return new Ed25519PrivateKey(keyPair.secretKey.slice(0, Ed25519PrivateKey.LENGTH));\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase.\n *\n * To derive multiple keys from the same phrase, change the path\n *\n * IMPORTANT: Ed25519 supports hardened derivation only (since it lacks a key homomorphism,\n * so non-hardened derivation cannot work)\n *\n * @param path the BIP44 path\n * @param mnemonics the mnemonic seed phrase\n */\n static fromDerivationPath(path: string, mnemonics: string): Ed25519PrivateKey {\n if (!isValidHardenedPath(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Ed25519PrivateKey.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 * @param offset the offset used for key derivation, defaults to 0x80000000\n * @returns\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array, offset = HARDENED_OFFSET): Ed25519PrivateKey {\n const { key, chainCode } = deriveKey(Ed25519PrivateKey.SLIP_0010_SEED, seed);\n\n const segments = splitPath(path).map((el) => parseInt(el, 10));\n\n // Derive the child key based on the path\n const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {\n key,\n chainCode,\n });\n return new Ed25519PrivateKey(privateKey);\n }\n\n // endregion\n\n // region PrivateKey\n\n /**\n * Derive the Ed25519PublicKey for this private key.\n *\n * @returns Ed25519PublicKey\n */\n publicKey(): Ed25519PublicKey {\n const bytes = this.signingKeyPair.publicKey;\n return new Ed25519PublicKey(bytes);\n }\n\n /**\n * Sign the given message with the private key.\n *\n * @param message in HexInput format\n * @returns Signature\n */\n sign(message: HexInput): Ed25519Signature {\n const messageBytes = Hex.fromHexInput(message).toUint8Array();\n const signatureBytes = nacl.sign.detached(messageBytes, this.signingKeyPair.secretKey);\n return new Ed25519Signature(signatureBytes);\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the private key\n */\n toUint8Array(): Uint8Array {\n return this.signingKeyPair.secretKey.slice(0, Ed25519PrivateKey.LENGTH);\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 Hex.fromHexInput(this.toUint8Array()).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): Ed25519PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PrivateKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Ed25519PrivateKey` instead.\n */\n static isPrivateKey(privateKey: PrivateKey): privateKey is Ed25519PrivateKey {\n return privateKey instanceof Ed25519PrivateKey;\n }\n}\n\n/**\n * A signature of a message signed using an Ed25519 private key\n */\nexport class Ed25519Signature extends Signature {\n /**\n * Length of an Ed25519 signature\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 constructor(hexInput: HexInput) {\n super();\n const data = Hex.fromHexInput(hexInput);\n if (data.toUint8Array().length !== Ed25519Signature.LENGTH) {\n throw new Error(`Signature length should be ${Ed25519Signature.LENGTH}`);\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): Ed25519Signature {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519Signature(bytes);\n }\n\n // endregion\n}\n"],"mappings":"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","names":["nacl","_Ed25519PublicKey","AccountPublicKey","hexInput","hex","Hex","args","message","signature","Ed25519Signature","messageBytes","signatureBytes","publicKeyBytes","nacl","AuthenticationKey","serializer","deserializer","bytes","publicKey","Ed25519PublicKey","_Ed25519PrivateKey","Serializable","privateKeyHex","keyPair","path","mnemonics","isValidHardenedPath","mnemonicToSeed","seed","offset","HARDENED_OFFSET","key","chainCode","deriveKey","segments","splitPath","el","privateKey","parentKeys","segment","CKDPriv","Ed25519PrivateKey","_Ed25519Signature","Signature","data"]}
1
+ {"version":3,"sources":["../../src/core/crypto/ed25519.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport nacl from \"tweetnacl\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { HexInput, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { CKDPriv, deriveKey, HARDENED_OFFSET, isValidHardenedPath, mnemonicToSeed, splitPath } from \"./hdKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { AccountPublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents the public key of an Ed25519 key pair.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Ed25519 scheme is represented in the SDK as `Legacy authentication key` and also\n * as `AnyPublicKey` that represents any `Unified authentication key`\n */\nexport class Ed25519PublicKey extends AccountPublicKey {\n /**\n * Length of an Ed25519 public key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * Bytes of the public key\n * @private\n */\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 !== Ed25519PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Ed25519PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n // region AccountPublicKey\n\n /**\n * Verifies a signed data with a public key\n * @param args.message a signed message\n * @param args.signature the signature of the message\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof Ed25519Signature)) {\n return false;\n }\n\n const messageBytes = Hex.fromHexInput(message).toUint8Array();\n const signatureBytes = signature.toUint8Array();\n const publicKeyBytes = this.key.toUint8Array();\n return nacl.sign.detached.verify(messageBytes, signatureBytes, publicKeyBytes);\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.Ed25519,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\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): Ed25519PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PublicKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Ed25519PublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is Ed25519PublicKey {\n return publicKey instanceof Ed25519PublicKey;\n }\n}\n\n/**\n * Represents the private key of an Ed25519 key pair.\n */\nexport class Ed25519PrivateKey extends Serializable implements PrivateKey {\n /**\n * Length of an Ed25519 private key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The Ed25519 key seed to use for BIP-32 compatibility\n * See more {@link https://github.com/satoshilabs/slips/blob/master/slip-0010.md}\n */\n static readonly SLIP_0010_SEED = \"ed25519 seed\";\n\n /**\n * The Ed25519 signing key\n * @private\n */\n private readonly signingKeyPair: nacl.SignKeyPair;\n\n // region Constructors\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * @param hexInput HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const privateKeyHex = Hex.fromHexInput(hexInput);\n if (privateKeyHex.toUint8Array().length !== Ed25519PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Ed25519PrivateKey.LENGTH}`);\n }\n\n // Create keyPair from Private key in Uint8Array format\n this.signingKeyPair = nacl.sign.keyPair.fromSeed(privateKeyHex.toUint8Array().slice(0, Ed25519PrivateKey.LENGTH));\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Ed25519PrivateKey\n */\n static generate(): Ed25519PrivateKey {\n const keyPair = nacl.sign.keyPair();\n return new Ed25519PrivateKey(keyPair.secretKey.slice(0, Ed25519PrivateKey.LENGTH));\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase.\n *\n * To derive multiple keys from the same phrase, change the path\n *\n * IMPORTANT: Ed25519 supports hardened derivation only (since it lacks a key homomorphism,\n * so non-hardened derivation cannot work)\n *\n * @param path the BIP44 path\n * @param mnemonics the mnemonic seed phrase\n */\n static fromDerivationPath(path: string, mnemonics: string): Ed25519PrivateKey {\n if (!isValidHardenedPath(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Ed25519PrivateKey.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 * @param offset the offset used for key derivation, defaults to 0x80000000\n * @returns\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array, offset = HARDENED_OFFSET): Ed25519PrivateKey {\n const { key, chainCode } = deriveKey(Ed25519PrivateKey.SLIP_0010_SEED, seed);\n\n const segments = splitPath(path).map((el) => parseInt(el, 10));\n\n // Derive the child key based on the path\n const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {\n key,\n chainCode,\n });\n return new Ed25519PrivateKey(privateKey);\n }\n\n // endregion\n\n // region PrivateKey\n\n /**\n * Derive the Ed25519PublicKey for this private key.\n *\n * @returns Ed25519PublicKey\n */\n publicKey(): Ed25519PublicKey {\n const bytes = this.signingKeyPair.publicKey;\n return new Ed25519PublicKey(bytes);\n }\n\n /**\n * Sign the given message with the private key.\n *\n * @param message in HexInput format\n * @returns Signature\n */\n sign(message: HexInput): Ed25519Signature {\n const messageBytes = Hex.fromHexInput(message).toUint8Array();\n const signatureBytes = nacl.sign.detached(messageBytes, this.signingKeyPair.secretKey);\n return new Ed25519Signature(signatureBytes);\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the private key\n */\n toUint8Array(): Uint8Array {\n return this.signingKeyPair.secretKey.slice(0, Ed25519PrivateKey.LENGTH);\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 Hex.fromHexInput(this.toUint8Array()).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): Ed25519PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PrivateKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Ed25519PrivateKey` instead.\n */\n static isPrivateKey(privateKey: PrivateKey): privateKey is Ed25519PrivateKey {\n return privateKey instanceof Ed25519PrivateKey;\n }\n}\n\n/**\n * A signature of a message signed using an Ed25519 private key\n */\nexport class Ed25519Signature extends Signature {\n /**\n * Length of an Ed25519 signature\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 constructor(hexInput: HexInput) {\n super();\n const data = Hex.fromHexInput(hexInput);\n if (data.toUint8Array().length !== Ed25519Signature.LENGTH) {\n throw new Error(`Signature length should be ${Ed25519Signature.LENGTH}`);\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): Ed25519Signature {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519Signature(bytes);\n }\n\n // endregion\n}\n"],"mappings":"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","names":["nacl","_Ed25519PublicKey","AccountPublicKey","hexInput","hex","Hex","args","message","signature","Ed25519Signature","messageBytes","signatureBytes","publicKeyBytes","nacl","AuthenticationKey","serializer","deserializer","bytes","publicKey","Ed25519PublicKey","_Ed25519PrivateKey","Serializable","privateKeyHex","keyPair","path","mnemonics","isValidHardenedPath","mnemonicToSeed","seed","offset","HARDENED_OFFSET","key","chainCode","deriveKey","segments","splitPath","el","privateKey","parentKeys","segment","CKDPriv","Ed25519PrivateKey","_Ed25519Signature","Signature","data"]}
@@ -1,2 +1,2 @@
1
- import{m as g,v as i}from"./chunk-S4SEFF4K.mjs";import{b as n}from"./chunk-DGOT2VR5.mjs";import{b as a,c}from"./chunk-UIUSDBCL.mjs";async function l(o){let{aptosConfig:e}=o,{data:t}=await n({aptosConfig:e,originMethod:"getLedgerInfo",path:""});return t}async function h(o){let{aptosConfig:e,ledgerVersion:t,options:s}=o,{data:r}=await n({aptosConfig:e,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return r}async function m(o){let{aptosConfig:e,blockHeight:t,options:s}=o,{data:r}=await n({aptosConfig:e,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return r}async function C(o){let{aptosConfig:e,handle:t,data:s,options:r}=o;return(await a({aptosConfig:e,originMethod:"getTableItem",path:`tables/${t}/item`,params:{ledger_version:r?.ledgerVersion},body:s})).data}async function T(o){let{aptosConfig:e,payload:t,options:s}=o,{data:r}=await a({aptosConfig:e,originMethod:"view",path:"view",params:{ledger_version:s?.ledgerVersion},body:{function:t.function,type_arguments:t.typeArguments??[],arguments:t.functionArguments??[]}});return r}async function q(o){let{aptosConfig:e,limit:t}=o;return(await p({aptosConfig:e,query:{query:g,variables:{limit:t}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function p(o){let{aptosConfig:e,query:t,originMethod:s}=o,{data:r}=await c({aptosConfig:e,originMethod:s??"queryIndexer",path:"",body:t,overrides:{WITH_CREDENTIALS:!1}});return r}async function f(o){let{aptosConfig:e}=o;return(await p({aptosConfig:e,query:{query:i},originMethod:"getProcessorStatuses"})).processor_status}async function w(o){let e=await f({aptosConfig:o.aptosConfig});return BigInt(e[0].last_success_version)}async function A(o){let{aptosConfig:e,processorType:t}=o,s={processor:{_eq:t.valueOf()}};return(await p({aptosConfig:e,query:{query:i,variables:{where_condition:s}},originMethod:"getProcessorStatus"})).processor_status[0]}export{l as a,h as b,m as c,C as d,T as e,q as f,p as g,f as h,w as i,A as j};
2
- //# sourceMappingURL=chunk-CHA5DSSD.mjs.map
1
+ import{m as g,v as i}from"./chunk-S4SEFF4K.mjs";import{b as a,c}from"./chunk-GE7VQ5NZ.mjs";import{b as n}from"./chunk-UFD443TT.mjs";async function l(o){let{aptosConfig:e}=o,{data:t}=await n({aptosConfig:e,originMethod:"getLedgerInfo",path:""});return t}async function h(o){let{aptosConfig:e,ledgerVersion:t,options:s}=o,{data:r}=await n({aptosConfig:e,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return r}async function m(o){let{aptosConfig:e,blockHeight:t,options:s}=o,{data:r}=await n({aptosConfig:e,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return r}async function C(o){let{aptosConfig:e,handle:t,data:s,options:r}=o;return(await a({aptosConfig:e,originMethod:"getTableItem",path:`tables/${t}/item`,params:{ledger_version:r?.ledgerVersion},body:s})).data}async function T(o){let{aptosConfig:e,payload:t,options:s}=o,{data:r}=await a({aptosConfig:e,originMethod:"view",path:"view",params:{ledger_version:s?.ledgerVersion},body:{function:t.function,type_arguments:t.typeArguments??[],arguments:t.functionArguments??[]}});return r}async function q(o){let{aptosConfig:e,limit:t}=o;return(await p({aptosConfig:e,query:{query:g,variables:{limit:t}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function p(o){let{aptosConfig:e,query:t,originMethod:s}=o,{data:r}=await c({aptosConfig:e,originMethod:s??"queryIndexer",path:"",body:t,overrides:{WITH_CREDENTIALS:!1}});return r}async function f(o){let{aptosConfig:e}=o;return(await p({aptosConfig:e,query:{query:i},originMethod:"getProcessorStatuses"})).processor_status}async function w(o){let e=await f({aptosConfig:o.aptosConfig});return BigInt(e[0].last_success_version)}async function A(o){let{aptosConfig:e,processorType:t}=o,s={processor:{_eq:t.valueOf()}};return(await p({aptosConfig:e,query:{query:i,variables:{where_condition:s}},originMethod:"getProcessorStatus"})).processor_status[0]}export{l as a,h as b,m as c,C as d,T as e,q as f,p as g,f as h,w as i,A as j};
2
+ //# sourceMappingURL=chunk-IF7ODXD7.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./chunk-VKWPCOZA.mjs";import{b as r}from"./chunk-BZMO6Q6L.mjs";var t=class extends e{toString(){let n=this.toUint8Array();return r.fromHexInput(n).toString()}},a=class extends t{};export{t as a,a as b};
2
+ //# sourceMappingURL=chunk-IWPVPIKD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-WKUXBIYB.mjs";import{a as f}from"./chunk-WME5D6YR.mjs";import{e as p,j as h}from"./chunk-LR65XHSF.mjs";import{a as m}from"./chunk-N4RBQZ2B.mjs";import{b as a}from"./chunk-NL72WE3E.mjs";import{sha3_256 as v}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as x}from"@scure/bip32";var n=class n extends d{constructor(e){super();let r=a.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=a.fromHexInput(r).toUint8Array(),H=v(l),A=i.toUint8Array();return o.verify(A,H,this.key.toUint8Array())}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var u=n,t=class t extends m{constructor(e){super();let r=a.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!p(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,h(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=x.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=a.fromHexInput(e),i=v(r.toUint8Array()),l=o.sign(i,this.key.toUint8Array());return new y(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 r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var g=t,s=class s extends f{constructor(e){super();let r=a.fromHexInput(e);if(r.toUint8Array().length!==s.LENGTH)throw new Error(`Signature length should be ${s.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new s(r)}};s.LENGTH=64;var y=s;export{u as a,g as b,y as c};
2
- //# sourceMappingURL=chunk-QR72RXBS.mjs.map
1
+ import{a as d}from"./chunk-OH5ADEJO.mjs";import{e as m,j as p}from"./chunk-LR65XHSF.mjs";import{a as h}from"./chunk-IWPVPIKD.mjs";import{a as c}from"./chunk-VKWPCOZA.mjs";import{b as a}from"./chunk-BZMO6Q6L.mjs";import{sha3_256 as g}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as A}from"@scure/bip32";var n=class n extends h{constructor(e){super();let r=a.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=a.fromHexInput(r).toUint8Array(),v=g(l),H=i.toUint8Array();return o.verify(H,v,this.key.toUint8Array())}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var u=n,t=class t extends c{constructor(e){super();let r=a.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!m(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,p(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=A.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=a.fromHexInput(e),i=g(r.toUint8Array()),l=o.sign(i,this.key.toUint8Array());return new y(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 r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var f=t,s=class s extends d{constructor(e){super();let r=a.fromHexInput(e);if(r.toUint8Array().length!==s.LENGTH)throw new Error(`Signature length should be ${s.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new s(r)}};s.LENGTH=64;var y=s;export{u as a,f as b,y as c};
2
+ //# sourceMappingURL=chunk-JIC5IJLP.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-PJNPLRPR.mjs";import{a as d}from"./chunk-IHCIKE42.mjs";import{b as w}from"./chunk-F7CR75CJ.mjs";function N(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function V(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e,n){let i=n;for(;i<e.length;i+=1){let c=e[i];if(!V(c))break}return i}var S=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t))(S||{}),r=class extends Error{constructor(n,i){super(`Failed to parse typeTag '${n}', ${i}`)}};function Z(e,n){let i=n?.allowGenerics??!1,c=[],o=[],p=[],T=0,a="",u=1;for(;T<e.length;){let g=e[T];if(g==="<")c.push({savedExpectedTypes:u,savedStr:a,savedTypes:p}),a="",p=[],u=1;else if(g===">"){if(a!==""){let _=m(a,o,i);p.push(_)}let s=c.pop();if(s===void 0)throw new r(e,"unexpected '>'");if(u!==p.length)throw new r(e,"type argument count doesn't match expected amount");let{savedStr:h,savedTypes:t,savedExpectedTypes:W}=s;o=p,p=t,a=h,u=W}else if(g===","){if(a.length!==0){let s=m(a,o,i);o=[],p.push(s),a="",u+=1}}else if(V(g)){let s=!1;if(a.length!==0){let t=m(a,o,i);o=[],p.push(t),a="",s=!0}T=F(e,T);let h=e[T];if(T<e.length&&s&&h!==","&&h!==">")throw new r(e,"unexpected whitespace character");continue}else a+=g;T+=1}if(c.length>0)throw new r(e,"no matching '>' for '<'");switch(p.length){case 0:return m(a,o,i);case 1:if(a==="")return p[0];throw new r(e,"unexpected ','");default:throw new r(e,"unexpected whitespace character")}}function m(e,n,i){switch(e){case"&signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new E(new y);case"signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new y;case"bool":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new l;case"address":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new C;case"u8":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new f;case"u16":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new x;case"u32":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new v;case"u64":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new U;case"u128":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new A;case"u256":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new P;case"vector":if(n.length!==1)throw new r(e,"vector type expected to have exactly one type argument");return new I(n[0]);default:if($(e)){if(i)return new b(Number(e.split("T")[1]));throw new r(e,"unexpected generic type")}if(!e.match(/:/))throw new r(e,"unknown type");let c=e.split("::");if(c.length!==3)throw new r(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!N(c[1]))throw new r(e,"module name must only contain alphanumeric or '_' characters");if(!N(c[2]))throw new r(e,"struct name must only contain alphanumeric or '_' characters");return new G(new M(w.fromString(c[0]),new d(c[1]),new d(c[2]),n))}}export{S as a,r as b,Z as c};
2
- //# sourceMappingURL=chunk-SXIFL5DQ.mjs.map
1
+ import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-WHNLDDPT.mjs";import{a as d}from"./chunk-EBCIZ4D6.mjs";import{b as w}from"./chunk-GHMYWL3R.mjs";function N(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function V(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e,n){let i=n;for(;i<e.length;i+=1){let c=e[i];if(!V(c))break}return i}var S=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t))(S||{}),r=class extends Error{constructor(n,i){super(`Failed to parse typeTag '${n}', ${i}`)}};function Z(e,n){let i=n?.allowGenerics??!1,c=[],o=[],p=[],T=0,a="",u=1;for(;T<e.length;){let g=e[T];if(g==="<")c.push({savedExpectedTypes:u,savedStr:a,savedTypes:p}),a="",p=[],u=1;else if(g===">"){if(a!==""){let _=m(a,o,i);p.push(_)}let s=c.pop();if(s===void 0)throw new r(e,"unexpected '>'");if(u!==p.length)throw new r(e,"type argument count doesn't match expected amount");let{savedStr:h,savedTypes:t,savedExpectedTypes:W}=s;o=p,p=t,a=h,u=W}else if(g===","){if(a.length!==0){let s=m(a,o,i);o=[],p.push(s),a="",u+=1}}else if(V(g)){let s=!1;if(a.length!==0){let t=m(a,o,i);o=[],p.push(t),a="",s=!0}T=F(e,T);let h=e[T];if(T<e.length&&s&&h!==","&&h!==">")throw new r(e,"unexpected whitespace character");continue}else a+=g;T+=1}if(c.length>0)throw new r(e,"no matching '>' for '<'");switch(p.length){case 0:return m(a,o,i);case 1:if(a==="")return p[0];throw new r(e,"unexpected ','");default:throw new r(e,"unexpected whitespace character")}}function m(e,n,i){switch(e){case"&signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new E(new y);case"signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new y;case"bool":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new l;case"address":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new C;case"u8":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new f;case"u16":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new x;case"u32":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new v;case"u64":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new U;case"u128":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new A;case"u256":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new P;case"vector":if(n.length!==1)throw new r(e,"vector type expected to have exactly one type argument");return new I(n[0]);default:if($(e)){if(i)return new b(Number(e.split("T")[1]));throw new r(e,"unexpected generic type")}if(!e.match(/:/))throw new r(e,"unknown type");let c=e.split("::");if(c.length!==3)throw new r(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!N(c[1]))throw new r(e,"module name must only contain alphanumeric or '_' characters");if(!N(c[2]))throw new r(e,"struct name must only contain alphanumeric or '_' characters");return new G(new M(w.fromString(c[0]),new d(c[1]),new d(c[2]),n))}}export{S as a,r as b,Z as c};
2
+ //# sourceMappingURL=chunk-JX3IRXNX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as A}from"./chunk-F67Y7YH6.mjs";import{a as T}from"./chunk-EF2F7NWO.mjs";import{a as y}from"./chunk-FVMVV4V3.mjs";import{a as d}from"./chunk-EQZ757ES.mjs";import{d as g,e as o,h as m,i as p,j as f}from"./chunk-KWJTVJ7C.mjs";import{a as i,b as s,c as r,d as e,e as c,f as u}from"./chunk-3EUOBVCT.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return o({...n})}signAsFeePayer(n){let{signer:t,transaction:a}=n;if(!a.feePayerAddress)throw new Error(`Transaction ${a} is not a Fee Payer transaction`);return a.feePayerAddress=t.accountAddress,o({signer:t,transaction:a})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:a,options:P}=n;this.batch.forSingleAccount({sender:t,data:a,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:a}=n;return m({aptosConfig:this.config,signer:t,transaction:a})}};export{h as a};
2
- //# sourceMappingURL=chunk-LLL2LFYH.mjs.map
1
+ import{a as d}from"./chunk-GRCJKGVR.mjs";import{a as A}from"./chunk-MSVYA75Y.mjs";import{a as T}from"./chunk-EGUJAHAO.mjs";import{a as y}from"./chunk-FOSJSOXX.mjs";import{d as g,e as o,h as m,i as p,j as f}from"./chunk-WT3OKY3G.mjs";import{a as i,b as s,c as r,d as e,e as c,f as u}from"./chunk-O4MQVPLP.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return o({...n})}signAsFeePayer(n){let{signer:t,transaction:a}=n;if(!a.feePayerAddress)throw new Error(`Transaction ${a} is not a Fee Payer transaction`);return a.feePayerAddress=t.accountAddress,o({signer:t,transaction:a})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:a,options:P}=n;this.batch.forSingleAccount({sender:t,data:a,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:a}=n;return m({aptosConfig:this.config,signer:t,transaction:a})}};export{h as a};
2
+ //# sourceMappingURL=chunk-KPO5IM5R.mjs.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-L7ORFGZ7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ var s=class extends Error{constructor(e,i){super(e),this.invalidReason=i}};export{s as a};
2
+ //# sourceMappingURL=chunk-LG7RJQ57.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-KWJTVJ7C.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
- //# sourceMappingURL=chunk-F67Y7YH6.mjs.map
1
+ import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-WT3OKY3G.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
+ //# sourceMappingURL=chunk-MSVYA75Y.mjs.map
@@ -1,2 +1,2 @@
1
1
  var a=(i=>(i.JSON="application/json",i.BCS="application/x-bcs",i.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",i))(a||{}),g=(e=>(e[e.Bool=0]="Bool",e[e.U8=1]="U8",e[e.U64=2]="U64",e[e.U128=3]="U128",e[e.Address=4]="Address",e[e.Signer=5]="Signer",e[e.Vector=6]="Vector",e[e.Struct=7]="Struct",e[e.U16=8]="U16",e[e.U32=9]="U32",e[e.U256=10]="U256",e[e.Reference=254]="Reference",e[e.Generic=255]="Generic",e))(g||{}),y=(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))(y||{}),u=(i=>(i[i.Script=0]="Script",i[i.EntryFunction=2]="EntryFunction",i[i.Multisig=3]="Multisig",i))(u||{}),d=(r=>(r[r.MultiAgentTransaction=0]="MultiAgentTransaction",r[r.FeePayerTransaction=1]="FeePayerTransaction",r))(d||{}),c=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(c||{}),l=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.SingleKey=2]="SingleKey",n[n.MultiKey=3]="MultiKey",n))(l||{}),_=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1=1]="Secp256k1",r))(_||{}),x=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1=1]="Secp256k1",r))(x||{}),v=(p=>(p.Pending="pending_transaction",p.User="user_transaction",p.Genesis="genesis_transaction",p.BlockMetadata="block_metadata_transaction",p.StateCheckpoint="state_checkpoint_transaction",p.Validator="validator_transaction",p))(v||{});function k(t){return t.type==="pending_transaction"}function f(t){return t.type==="user_transaction"}function T(t){return t.type==="genesis_transaction"}function E(t){return t.type==="block_metadata_transaction"}function C(t){return t.type==="state_checkpoint_transaction"}function U(t){return t.type==="validator_transaction"}function A(t){return"signature"in t&&t.signature==="ed25519_signature"}function W(t){return"signature"in t&&t.signature==="secp256k1_ecdsa_signature"}function P(t){return t.type==="multi_agent_signature"}function F(t){return t.type==="fee_payer_signature"}function I(t){return t.type==="multi_ed25519_signature"}var h=(i=>(i.PRIVATE="private",i.PUBLIC="public",i.FRIEND="friend",i))(h||{}),M=(n=>(n.STORE="store",n.DROP="drop",n.KEY="key",n.COPY="copy",n))(M||{}),m=(r=>(r.VALIDATOR="validator",r.FULL_NODE="full_node",r))(m||{}),R=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.SingleKey=2]="SingleKey",n[n.MultiKey=3]="MultiKey",n))(R||{}),S=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",r))(S||{}),b=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(b||{});export{a,g as b,y as c,u as d,d as e,c as f,l as g,_ as h,x as i,v as j,k,f as l,T as m,E as n,C as o,U as p,A as q,W as r,P as s,F as t,I as u,h as v,M as w,m as x,R as y,S as z,b as A};
2
- //# sourceMappingURL=chunk-CVEJHRAU.mjs.map
2
+ //# sourceMappingURL=chunk-NCDLIACO.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}\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}\n\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\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 clientConfig?: ClientConfig;\n\n readonly client?: Client;\n\n readonly assetUploaderProvider?: string;\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 AUTH_TOKEN - an auth token to send with a faucet request\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 = {\n AUTH_TOKEN?: string;\n API_KEY?: string;\n HEADERS?: Record<string, string | number | boolean>;\n WITH_CREDENTIALS?: boolean;\n};\n\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n body?: Req;\n contentType?: string;\n params?: any;\n overrides?: ClientConfig;\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.aptoslabs.devnet.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;\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 = {\n type: MoveStructId;\n data: {};\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}\n\nexport type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;\nexport type CommittedTransactionResponse =\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse\n | ValidatorTransactionResponse;\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 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 * 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/**\n * The data needed to generate a View Request payload\n */\nexport type InputViewRequestData = {\n function: MoveFunctionId;\n typeArguments?: Array<MoveStructId>;\n functionArguments?: Array<MoveValue>;\n};\n\n// REQUEST TYPES\n\n/**\n * View request for the Move view function API\n *\n * `type MoveFunctionId = ${string}::${string}::${string}`;\n */\nexport type ViewRequest = {\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n typeArguments: Array<MoveStructId>;\n /**\n * Arguments of the function\n */\n functionArguments: Array<MoveValue>;\n};\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":"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","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","AnyPublicKeyVariant","AnySignatureVariant","TransactionResponseType","isPendingTransactionResponse","response","isUserTransactionResponse","isGenesisTransactionResponse","isBlockMetadataTransactionResponse","isStateCheckpointTransactionResponse","isValidatorTransactionResponse","isEd25519Signature","signature","isSecp256k1Signature","isMultiAgentSignature","isFeePayerSignature","isMultiEd25519Signature","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-YZZO6VDC.mjs";import{b as i}from"./chunk-7BDYKJXX.mjs";import{b as s}from"./chunk-F7CR75CJ.mjs";var a=class n{constructor(e){this.signingScheme=0;let{privateKey:t,address:r}=e;this.privateKey=t,this.publicKey=t.publicKey(),this.accountAddress=r?s.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let e=i.generate();return new n({privateKey:e})}static fromDerivationPath(e){let{path:t,mnemonic:r}=e,c=i.fromDerivationPath(t,r);return new n({privateKey:c})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let t=this.privateKey.sign(e);return new o(this.publicKey,t)}sign(e){return this.signWithAuthenticator(e).signature}};export{a};
2
- //# sourceMappingURL=chunk-WTHNSNAX.mjs.map
1
+ import{b as o}from"./chunk-DPHEHCIM.mjs";import{b as i}from"./chunk-I4RVDRYR.mjs";import{b as s}from"./chunk-GHMYWL3R.mjs";var a=class n{constructor(e){this.signingScheme=0;let{privateKey:t,address:r}=e;this.privateKey=t,this.publicKey=t.publicKey(),this.accountAddress=r?s.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let e=i.generate();return new n({privateKey:e})}static fromDerivationPath(e){let{path:t,mnemonic:r}=e,c=i.fromDerivationPath(t,r);return new n({privateKey:c})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let t=this.privateKey.sign(e);return new o(this.publicKey,t)}sign(e){return this.signWithAuthenticator(e).signature}};export{a};
2
+ //# sourceMappingURL=chunk-NIOGYWR4.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as A}from"./chunk-AH44UPM4.mjs";import{a as d}from"./chunk-3JPVQHOR.mjs";import{i as w,j as C}from"./chunk-IF7ODXD7.mjs";import{b as c,c as l}from"./chunk-UFD443TT.mjs";import{a as h}from"./chunk-GHYE26Q5.mjs";import{d as y}from"./chunk-HEPV52CH.mjs";async function F(s){let{aptosConfig:n,options:t}=s;return l({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function L(s){let{aptosConfig:n}=s;return A(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function v(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function x(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function N(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await x({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function G(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,f=o?.checkSuccess??!0,i=!0,u=0,e,g,m=200,P=1.5;for(;i&&!(u>=r);){try{if(e=await x({aptosConfig:n,transactionHash:t}),i=e.type==="pending_transaction",!i)break}catch(a){if(!(a instanceof h)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}await d(m),u+=m/1e3,m*=P}if(e===void 0)throw g||new p(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new p(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!f)return e;if(!e.success)throw new T(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function D(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,f=new Date().getTime(),i=BigInt(-1);for(;i<o;){if(new Date().getTime()-f>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?i=await w({aptosConfig:n}):i=(await C({aptosConfig:n,processorType:t})).last_success_version,i>=o)break;await d(200)}}var p=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};export{F as a,L as b,v as c,x as d,N as e,G as f,D as g,p as h,T as i};
2
+ //# sourceMappingURL=chunk-O4MQVPLP.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as r}from"./chunk-VKWPCOZA.mjs";import{b as t}from"./chunk-BZMO6Q6L.mjs";var o=class extends r{toString(){let i=this.toUint8Array();return t.fromHexInput(i).toString()}};export{o as a};
2
+ //# sourceMappingURL=chunk-OH5ADEJO.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-B2ZKW23W.mjs";import{a,b as g,c as f}from"./chunk-F7MOQC7Z.mjs";import{a as o,b as u,c as s,d as c,e as p,f as y,g as m}from"./chunk-VRSUCKJA.mjs";import{b as r}from"./chunk-F7CR75CJ.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof a||n instanceof f}function A(n){return n instanceof o}function T(n){return n instanceof r}function E(n){return n instanceof g}function d(n){return n instanceof i}function x(n){return n instanceof u}function S(n){return n instanceof s}function B(n){return n instanceof c}function U(n){return n instanceof p}function I(n){return n instanceof y}function b(n){return n instanceof m}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
2
- //# sourceMappingURL=chunk-52RTAMN7.mjs.map
1
+ import{a as i}from"./chunk-TTM66JZ4.mjs";import{a,b as g,c as f}from"./chunk-RP4FMC6O.mjs";import{a as o,b as u,c as s,d as c,e as p,f as y,g as m}from"./chunk-QDD2MDJZ.mjs";import{b as r}from"./chunk-GHMYWL3R.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof a||n instanceof f}function A(n){return n instanceof o}function T(n){return n instanceof r}function E(n){return n instanceof g}function d(n){return n instanceof i}function x(n){return n instanceof u}function S(n){return n instanceof s}function B(n){return n instanceof c}function U(n){return n instanceof p}function I(n){return n instanceof y}function b(n){return n instanceof m}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
2
+ //# sourceMappingURL=chunk-P434YHBQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-WTHNSNAX.mjs";import{a as c}from"./chunk-GRJJBGHT.mjs";import{b as i}from"./chunk-7BDYKJXX.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
- //# sourceMappingURL=chunk-TNVR7SNR.mjs.map
1
+ import{a as n}from"./chunk-NIOGYWR4.mjs";import{a as c}from"./chunk-VN2YZGFJ.mjs";import{b as i}from"./chunk-I4RVDRYR.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
+ //# sourceMappingURL=chunk-P633OFBI.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as r,b as t,c as o}from"./chunk-77SKA4HT.mjs";import i from"@aptos-labs/aptos-client";var n=class{constructor(e){this.network=e?.network??"devnet",this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.indexer=e?.indexer,this.client=e?.client??{provider:i},this.clientConfig=e?.clientConfig??{},this.assetUploaderProvider=e?.assetUploaderProvider??"irys"}getRequestUrl(e){switch(e){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return t[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return o[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return r[this.network];default:throw Error(`apiType ${e} is not supported`)}}isIndexerRequest(e){return r[this.network]===e}isFullnodeRequest(e){return t[this.network]===e}isFaucetRequest(e){return o[this.network]===e}};export{n as a};
2
+ //# sourceMappingURL=chunk-PEOCYUOO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/aptosConfig.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport aptosClient from \"@aptos-labs/aptos-client\";\nimport { AptosSettings, ClientConfig, Client } from \"../types\";\nimport { NetworkToNodeAPI, NetworkToFaucetAPI, NetworkToIndexerAPI, Network } from \"../utils/apiEndpoints\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * This class holds the config information for the SDK client instance.\n */\nexport class AptosConfig {\n /** The Network that this SDK is associated with. Defaults to DEVNET */\n readonly network: Network;\n\n /**\n * The client instance the SDK uses. Defaults to `@aptos-labs/aptos-client\n */\n readonly client: Client;\n\n /**\n * The optional hardcoded fullnode URL to send requests to instead of using the network\n */\n readonly fullnode?: string;\n\n /**\n * The optional hardcoded faucet URL to send requests to instead of using the network\n */\n readonly faucet?: string;\n\n /**\n * The optional hardcoded indexer URL to send requests to instead of using the network\n */\n readonly indexer?: string;\n\n /**\n * Optional client config to set\n */\n readonly clientConfig?: ClientConfig;\n\n /**\n * Optional asset uploader provider, default to \"irys\"\n */\n readonly assetUploaderProvider?: string;\n\n constructor(settings?: AptosSettings) {\n this.network = settings?.network ?? Network.DEVNET;\n this.fullnode = settings?.fullnode;\n this.faucet = settings?.faucet;\n this.indexer = settings?.indexer;\n this.client = settings?.client ?? { provider: aptosClient };\n this.clientConfig = settings?.clientConfig ?? {};\n this.assetUploaderProvider = settings?.assetUploaderProvider ?? \"irys\";\n }\n\n /**\n * Returns the URL endpoint to send the request to.\n * If a custom URL was provided in the config, that URL is returned.\n * If a custom URL was provided but not URL endpoints, an error is thrown.\n * Otherwise, the URL endpoint is derived from the network.\n *\n * @param apiType - The type of Aptos API to get the URL for.\n *\n * @internal\n */\n getRequestUrl(apiType: AptosApiType): string {\n switch (apiType) {\n case AptosApiType.FULLNODE:\n if (this.fullnode !== undefined) return this.fullnode;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom full node url\");\n return NetworkToNodeAPI[this.network];\n case AptosApiType.FAUCET:\n if (this.faucet !== undefined) return this.faucet;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom faucet url\");\n return NetworkToFaucetAPI[this.network];\n case AptosApiType.INDEXER:\n if (this.indexer !== undefined) return this.indexer;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom indexer url\");\n return NetworkToIndexerAPI[this.network];\n default:\n throw Error(`apiType ${apiType} is not supported`);\n }\n }\n\n /**\n * Checks if the URL is a known indexer endpoint\n *\n * @internal\n * */\n isIndexerRequest(url: string): boolean {\n return NetworkToIndexerAPI[this.network] === url;\n }\n\n /**\n * Checks if the URL is a known fullnode endpoint\n *\n * @internal\n * */\n isFullnodeRequest(url: string): boolean {\n return NetworkToNodeAPI[this.network] === url;\n }\n\n /**\n * Checks if the URL is a known faucet endpoint\n *\n * @internal\n * */\n isFaucetRequest(url: string): boolean {\n return NetworkToFaucetAPI[this.network] === url;\n }\n}\n"],"mappings":"uDAGA,OAAOA,MAAiB,2BAQjB,IAAMC,EAAN,KAAkB,CAkCvB,YAAYC,EAA0B,CACpC,KAAK,QAAUA,GAAU,kBACzB,KAAK,SAAWA,GAAU,SAC1B,KAAK,OAASA,GAAU,OACxB,KAAK,QAAUA,GAAU,QACzB,KAAK,OAASA,GAAU,QAAU,CAAE,SAAUC,CAAY,EAC1D,KAAK,aAAeD,GAAU,cAAgB,CAAC,EAC/C,KAAK,sBAAwBA,GAAU,uBAAyB,MAClE,CAYA,cAAcE,EAA+B,CAC3C,OAAQA,EAAS,CACf,OACE,GAAI,KAAK,WAAa,OAAW,OAAO,KAAK,SAC7C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,uCAAuC,EAC5F,OAAOC,EAAiB,KAAK,OAAO,EACtC,OACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,oCAAoC,EACzF,OAAOC,EAAmB,KAAK,OAAO,EACxC,OACE,GAAI,KAAK,UAAY,OAAW,OAAO,KAAK,QAC5C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,qCAAqC,EAC1F,OAAOC,EAAoB,KAAK,OAAO,EACzC,QACE,MAAM,MAAM,WAAWH,CAAO,mBAAmB,CACrD,CACF,CAOA,iBAAiBI,EAAsB,CACrC,OAAOD,EAAoB,KAAK,OAAO,IAAMC,CAC/C,CAOA,kBAAkBA,EAAsB,CACtC,OAAOH,EAAiB,KAAK,OAAO,IAAMG,CAC5C,CAOA,gBAAgBA,EAAsB,CACpC,OAAOF,EAAmB,KAAK,OAAO,IAAME,CAC9C,CACF","names":["aptosClient","AptosConfig","settings","aptosClient","apiType","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToIndexerAPI","url"]}
@@ -1,2 +1,2 @@
1
- import{a as i,b as t,c as n,d as o}from"./chunk-R4VJDSIP.mjs";import{a as s}from"./chunk-UMLDKLDL.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
2
- //# sourceMappingURL=chunk-BBUAAJRA.mjs.map
1
+ import{a as i,b as t,c as n,d as o}from"./chunk-AK75KOT3.mjs";import{a as s}from"./chunk-TVEFB6OB.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
2
+ //# sourceMappingURL=chunk-PGZ67PEU.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as s}from"./chunk-DQHNZBA5.mjs";var e=class{constructor(o){switch(this.config=o,o.assetUploaderProvider){case"irys":this.assetUploader=new s(this.config);break;default:throw new Error("Invalid asset uploader provided")}}async fundNode(o){return this.assetUploader.fundNode({...o})}async uploadData(o){return this.assetUploader.uploadData({...o})}async uploadFile(o){return this.assetUploader.uploadFile({...o})}async uploadFolder(o){return this.assetUploader.uploadFolder({...o})}};export{e as a};
2
+ //# sourceMappingURL=chunk-PISONN6H.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/assetUploader/assetUploader.ts"],"sourcesContent":["import type { FundResponse, UploadResponse } from \"@irys/sdk/build/cjs/common/types\";\nimport { AptosConfig } from \"../api\";\nimport { Account } from \"../core\";\nimport { IrysAssetUploader } from \"./irys\";\n\n/**\n * Shared interfae for asset uploader providers to implement\n *\n * When extending the SDK to use different providers, we need to have those\n * function arguments inputs and outputs use generics.\n */\nexport interface IAssetUploader {\n fundNode(args: { account: Account; amount: number }): Promise<FundResponse>;\n uploadData(args: { account: Account; data: string | Buffer; options?: any }): Promise<UploadResponse>;\n uploadFile(args: { account: Account; filePathToUpload: string; options?: any }): Promise<UploadResponse>;\n uploadFolder(args: { account: Account; folderToUpload: string; options?: any }): Promise<UploadResponse | undefined>;\n}\n\nexport class AssetUploader {\n readonly config: AptosConfig;\n\n readonly assetUploader: IAssetUploader;\n\n constructor(config: AptosConfig) {\n this.config = config;\n\n switch (config.assetUploaderProvider) {\n case \"irys\":\n this.assetUploader = new IrysAssetUploader(this.config);\n break;\n default:\n throw new Error(\"Invalid asset uploader provided\");\n }\n }\n\n /**\n * Funds the node you connected to with the specified amount of tokens\n *\n * @param args.account The account to sign and pay the fund transaction with\n * @param args.amount The amount to fund the node in\n *\n * @return FundResponse\n */\n async fundNode(args: { account: Account; amount: number }): Promise<FundResponse> {\n return this.assetUploader.fundNode({ ...args });\n }\n\n /**\n * Upload a data\n *\n * @param args.account The account to sign and pay the fund transaction with\n * @param args.data The data to upload\n *\n * @return UploadResponse\n */\n async uploadData(args: { account: Account; data: string | Buffer; options?: any }): Promise<UploadResponse> {\n return this.assetUploader.uploadData({ ...args });\n }\n\n /**\n * Upload a file\n *\n * @param args.account The account to sign and pay the upload file transaction with\n * @param args.filePathToUpload The file to upload as the file path\n *\n * @return UploadResponse\n */\n async uploadFile(args: { account: Account; filePathToUpload: string; options?: any }): Promise<UploadResponse> {\n return this.assetUploader.uploadFile({ ...args });\n }\n\n /**\n * Upload a folder\n *\n * @param args.account The account to sign and pay the upload folder transaction with\n * @param args.folderToUpload The folder to upload as the folder path\n *\n * @return UploadResponse | undefined\n */\n async uploadFolder(args: {\n account: Account;\n folderToUpload: string;\n options?: any;\n }): Promise<UploadResponse | undefined> {\n return this.assetUploader.uploadFolder({ ...args });\n }\n}\n"],"mappings":"yCAkBO,IAAMA,EAAN,KAAoB,CAKzB,YAAYC,EAAqB,CAG/B,OAFA,KAAK,OAASA,EAENA,EAAO,sBAAuB,CACpC,IAAK,OACH,KAAK,cAAgB,IAAIC,EAAkB,KAAK,MAAM,EACtD,MACF,QACE,MAAM,IAAI,MAAM,iCAAiC,CACrD,CACF,CAUA,MAAM,SAASC,EAAmE,CAChF,OAAO,KAAK,cAAc,SAAS,CAAE,GAAGA,CAAK,CAAC,CAChD,CAUA,MAAM,WAAWA,EAA2F,CAC1G,OAAO,KAAK,cAAc,WAAW,CAAE,GAAGA,CAAK,CAAC,CAClD,CAUA,MAAM,WAAWA,EAA8F,CAC7G,OAAO,KAAK,cAAc,WAAW,CAAE,GAAGA,CAAK,CAAC,CAClD,CAUA,MAAM,aAAaA,EAIqB,CACtC,OAAO,KAAK,cAAc,aAAa,CAAE,GAAGA,CAAK,CAAC,CACpD,CACF","names":["AssetUploader","config","IrysAssetUploader","args"]}
@@ -1,2 +1,2 @@
1
- import{a as r,b as i,c as s}from"./chunk-NL3XVNS5.mjs";import{a as o}from"./chunk-UMLDKLDL.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
- //# sourceMappingURL=chunk-B7M3OWHV.mjs.map
1
+ import{a as r,b as i,c as s}from"./chunk-2ZLKKVWJ.mjs";import{a as o}from"./chunk-TVEFB6OB.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
+ //# sourceMappingURL=chunk-Q2V2K5AT.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as s,c as u,e as t}from"./chunk-VKWPCOZA.mjs";import{a,b as l,c as n,d as o,e as c,f as z}from"./chunk-56CNRT2K.mjs";var d=class i extends s{constructor(e){super(),u(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new i(e.deserializeBool())}},U=class i extends s{constructor(e){super(),t(e,0,a),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new i(e.deserializeU8())}},p=class i extends s{constructor(e){super(),t(e,0,l),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new i(e.deserializeU16())}},b=class i extends s{constructor(e){super(),t(e,0,n),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new i(e.deserializeU32())}},y=class i extends s{constructor(e){super(),t(e,BigInt(0),o),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new i(e.deserializeU64())}},m=class i extends s{constructor(e){super(),t(e,BigInt(0),c),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new i(e.deserializeU128())}},B=class i extends s{constructor(e){super(),t(e,BigInt(0),z),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new i(e.deserializeU256())}};export{d as a,U as b,p as c,b as d,y as e,m as f,B as g};
2
+ //# sourceMappingURL=chunk-QDD2MDJZ.mjs.map