@aptos-labs/ts-sdk 3.1.2 → 4.0.0-zeta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (645) hide show
  1. package/dist/common/{account-Bb5REyaT.d.ts → account-D4dsN-1K.d.ts} +1 -1
  2. package/dist/common/chunk-MU4IJVW5.js +1390 -0
  3. package/dist/common/chunk-MU4IJVW5.js.map +1 -0
  4. package/dist/common/cli/index.d.ts +1 -1
  5. package/dist/common/cli/index.js +480 -1
  6. package/dist/common/cli/index.js.map +1 -1
  7. package/dist/common/index.d.ts +598 -511
  8. package/dist/common/index.js +19842 -451
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/account/AbstractKeylessAccount.mjs +66 -1
  11. package/dist/esm/account/AbstractedAccount.mjs +62 -1
  12. package/dist/esm/account/Account.mjs +62 -1
  13. package/dist/esm/account/AccountUtils.mjs +62 -1
  14. package/dist/esm/account/DerivableAbstractedAccount.mjs +62 -1
  15. package/dist/esm/account/Ed25519Account.mjs +62 -1
  16. package/dist/esm/account/EphemeralKeyPair.mjs +62 -1
  17. package/dist/esm/account/FederatedKeylessAccount.mjs +62 -1
  18. package/dist/esm/account/KeylessAccount.mjs +62 -1
  19. package/dist/esm/account/MultiEd25519Account.mjs +62 -1
  20. package/dist/esm/account/MultiKeyAccount.mjs +62 -1
  21. package/dist/esm/account/SingleKeyAccount.mjs +64 -1
  22. package/dist/esm/account/index.mjs +90 -1
  23. package/dist/esm/account/utils.mjs +62 -1
  24. package/dist/esm/api/account/abstraction.mjs +62 -1
  25. package/dist/esm/api/account.d.mts +1 -0
  26. package/dist/esm/api/account.mjs +62 -1
  27. package/dist/esm/api/ans.mjs +62 -1
  28. package/dist/esm/api/aptos.d.mts +3 -4
  29. package/dist/esm/api/aptos.mjs +62 -1
  30. package/dist/esm/api/aptosConfig.mjs +9 -1
  31. package/dist/esm/api/coin.mjs +62 -1
  32. package/dist/esm/api/digitalAsset.mjs +62 -1
  33. package/dist/esm/api/faucet.mjs +62 -1
  34. package/dist/esm/api/fungibleAsset.mjs +62 -1
  35. package/dist/esm/api/general.mjs +62 -1
  36. package/dist/esm/api/index.d.mts +2 -1
  37. package/dist/esm/api/index.mjs +67 -1
  38. package/dist/esm/api/keyless.mjs +62 -1
  39. package/dist/esm/api/manager.d.mts +313 -0
  40. package/dist/esm/api/manager.mjs +63 -0
  41. package/dist/esm/api/object.mjs +62 -1
  42. package/dist/esm/api/staking.mjs +62 -1
  43. package/dist/esm/api/table.mjs +39 -1
  44. package/dist/esm/api/transaction.d.mts +56 -36
  45. package/dist/esm/api/transaction.mjs +62 -1
  46. package/dist/esm/api/transactionSubmission/build.mjs +62 -1
  47. package/dist/esm/api/transactionSubmission/helpers.mjs +9 -1
  48. package/dist/esm/api/transactionSubmission/management.mjs +62 -1
  49. package/dist/esm/api/transactionSubmission/sign.mjs +182 -1
  50. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  51. package/dist/esm/api/transactionSubmission/simulate.mjs +62 -1
  52. package/dist/esm/api/transactionSubmission/submit.mjs +62 -1
  53. package/dist/esm/api/utils.mjs +37 -1
  54. package/dist/esm/bcs/consts.mjs +17 -1
  55. package/dist/esm/bcs/deserializer.mjs +10 -1
  56. package/dist/esm/bcs/index.mjs +60 -1
  57. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +12 -1
  58. package/dist/esm/bcs/serializable/fixedBytes.mjs +11 -1
  59. package/dist/esm/bcs/serializable/movePrimitives.mjs +26 -1
  60. package/dist/esm/bcs/serializable/moveStructs.mjs +22 -1
  61. package/dist/esm/bcs/serializer.mjs +18 -1
  62. package/dist/esm/chunk-2EQWS4BO.mjs +15 -0
  63. package/dist/esm/{chunk-HPQMAP7O.mjs.map → chunk-2EQWS4BO.mjs.map} +1 -1
  64. package/dist/esm/chunk-3WEOSEUE.mjs +221 -0
  65. package/dist/esm/{chunk-Y7ZQTLH4.mjs.map → chunk-3WEOSEUE.mjs.map} +1 -1
  66. package/dist/esm/chunk-4OAWQT57.mjs +281 -0
  67. package/dist/esm/{chunk-DW6WLD2B.mjs.map → chunk-4OAWQT57.mjs.map} +1 -1
  68. package/dist/esm/chunk-53SXUNRK.mjs +12 -0
  69. package/dist/esm/{chunk-OYUW6ZN2.mjs.map → chunk-53SXUNRK.mjs.map} +1 -1
  70. package/dist/esm/chunk-55VEYGKK.mjs +46 -0
  71. package/dist/esm/{chunk-OYH2T6V5.mjs.map → chunk-55VEYGKK.mjs.map} +1 -1
  72. package/dist/esm/chunk-6ZZZXQX5.mjs +138 -0
  73. package/dist/esm/{chunk-6PKBXYG3.mjs.map → chunk-6ZZZXQX5.mjs.map} +1 -1
  74. package/dist/esm/chunk-A4IKXI43.mjs +339 -0
  75. package/dist/esm/{chunk-6Y6ZO7TS.mjs.map → chunk-A4IKXI43.mjs.map} +1 -1
  76. package/dist/esm/{chunk-UL777LTI.mjs → chunk-A5FS7NAD.mjs} +380 -31
  77. package/dist/esm/{chunk-UL777LTI.mjs.map → chunk-A5FS7NAD.mjs.map} +1 -1
  78. package/dist/esm/chunk-APM7OSLS.mjs +122 -0
  79. package/dist/esm/{chunk-GOXRBEIJ.mjs.map → chunk-APM7OSLS.mjs.map} +1 -1
  80. package/dist/esm/chunk-BEYIOC2H.mjs +34 -0
  81. package/dist/esm/{chunk-YOZBVVKL.mjs.map → chunk-BEYIOC2H.mjs.map} +1 -1
  82. package/dist/esm/chunk-BQCCGCK4.mjs +22 -0
  83. package/dist/esm/{chunk-QREVMGQZ.mjs.map → chunk-BQCCGCK4.mjs.map} +1 -1
  84. package/dist/esm/chunk-CYKMZPCW.mjs +71 -0
  85. package/dist/esm/{chunk-XIQFX5FV.mjs.map → chunk-CYKMZPCW.mjs.map} +1 -1
  86. package/dist/esm/chunk-DTLPTPJW.mjs +7 -0
  87. package/dist/esm/{chunk-4R4AI5RT.mjs.map → chunk-DTLPTPJW.mjs.map} +1 -1
  88. package/dist/esm/chunk-DUYTCDXO.mjs +29 -0
  89. package/dist/esm/{chunk-BUUV6B4P.mjs.map → chunk-DUYTCDXO.mjs.map} +1 -1
  90. package/dist/esm/chunk-EPKBDH2H.mjs +177 -0
  91. package/dist/esm/{chunk-AQQEQB35.mjs.map → chunk-EPKBDH2H.mjs.map} +1 -1
  92. package/dist/esm/chunk-F7W7KS5C.mjs +52 -0
  93. package/dist/esm/{chunk-C3Q23D22.mjs.map → chunk-F7W7KS5C.mjs.map} +1 -1
  94. package/dist/esm/chunk-FHHBIGGL.mjs +43 -0
  95. package/dist/esm/{chunk-JCFTAG5Z.mjs.map → chunk-FHHBIGGL.mjs.map} +1 -1
  96. package/dist/esm/chunk-FJJ3KCPC.mjs +376 -0
  97. package/dist/esm/{chunk-NJN3EAOM.mjs.map → chunk-FJJ3KCPC.mjs.map} +1 -1
  98. package/dist/esm/chunk-GHQTJGG6.mjs +196 -0
  99. package/dist/esm/{chunk-STY74NUA.mjs.map → chunk-GHQTJGG6.mjs.map} +1 -1
  100. package/dist/esm/chunk-GREMFKLA.mjs +84 -0
  101. package/dist/esm/{chunk-PQS3II2E.mjs.map → chunk-GREMFKLA.mjs.map} +1 -1
  102. package/dist/esm/chunk-GUA5YTIK.mjs +362 -0
  103. package/dist/esm/{chunk-35DKMW7Q.mjs.map → chunk-GUA5YTIK.mjs.map} +1 -1
  104. package/dist/esm/chunk-HKXZMGVA.mjs +73 -0
  105. package/dist/esm/{chunk-WLUXOUZH.mjs.map → chunk-HKXZMGVA.mjs.map} +1 -1
  106. package/dist/esm/chunk-HXS6ZS4S.mjs +16311 -0
  107. package/dist/esm/chunk-HXS6ZS4S.mjs.map +1 -0
  108. package/dist/esm/chunk-IBRCEHIR.mjs +77 -0
  109. package/dist/esm/{chunk-IXYGZ57N.mjs.map → chunk-IBRCEHIR.mjs.map} +1 -1
  110. package/dist/esm/chunk-ITS22VZT.mjs +48 -0
  111. package/dist/esm/{chunk-BYINW7I2.mjs.map → chunk-ITS22VZT.mjs.map} +1 -1
  112. package/dist/esm/chunk-KJY6HBMF.mjs +114 -0
  113. package/dist/esm/{chunk-NII5Q32W.mjs.map → chunk-KJY6HBMF.mjs.map} +1 -1
  114. package/dist/esm/chunk-MOQKSDHO.mjs +33 -0
  115. package/dist/esm/{chunk-Z6KQX6VX.mjs.map → chunk-MOQKSDHO.mjs.map} +1 -1
  116. package/dist/esm/chunk-NATYEXGE.mjs +45 -0
  117. package/dist/esm/{chunk-PRUQZNAP.mjs.map → chunk-NATYEXGE.mjs.map} +1 -1
  118. package/dist/esm/chunk-O3EP3HB3.mjs +257 -0
  119. package/dist/esm/{chunk-IJE2LVZG.mjs.map → chunk-O3EP3HB3.mjs.map} +1 -1
  120. package/dist/esm/chunk-ORIVGO5I.mjs +73 -0
  121. package/dist/esm/{chunk-E6IUB35J.mjs.map → chunk-ORIVGO5I.mjs.map} +1 -1
  122. package/dist/esm/chunk-OWG3TOG6.mjs +11 -0
  123. package/dist/esm/{chunk-KJH4KKG6.mjs.map → chunk-OWG3TOG6.mjs.map} +1 -1
  124. package/dist/esm/chunk-P6RWWRGG.mjs +440 -0
  125. package/dist/esm/{chunk-GYVSI3TS.mjs.map → chunk-P6RWWRGG.mjs.map} +1 -1
  126. package/dist/esm/chunk-PT2QHUB6.mjs +96 -0
  127. package/dist/esm/{chunk-A5L76YP7.mjs.map → chunk-PT2QHUB6.mjs.map} +1 -1
  128. package/dist/esm/chunk-Q5W46UAQ.mjs +123 -0
  129. package/dist/esm/{chunk-ZMT2M6YT.mjs.map → chunk-Q5W46UAQ.mjs.map} +1 -1
  130. package/dist/esm/chunk-QIM243UU.mjs +89 -0
  131. package/dist/esm/{chunk-THUSLDD6.mjs.map → chunk-QIM243UU.mjs.map} +1 -1
  132. package/dist/esm/chunk-QPT4BSAB.mjs +20 -0
  133. package/dist/esm/{chunk-IF4UU2MT.mjs.map → chunk-QPT4BSAB.mjs.map} +1 -1
  134. package/dist/esm/chunk-SAWN7RJP.mjs +15 -0
  135. package/dist/esm/chunk-SBB4YEPT.mjs +17 -0
  136. package/dist/esm/{chunk-56CNRT2K.mjs.map → chunk-SBB4YEPT.mjs.map} +1 -1
  137. package/dist/esm/chunk-SCWOUBOV.mjs +101 -0
  138. package/dist/esm/{chunk-YFFDF22R.mjs.map → chunk-SCWOUBOV.mjs.map} +1 -1
  139. package/dist/esm/chunk-SFLQPB72.mjs +63 -0
  140. package/dist/esm/{chunk-4RXKALLC.mjs.map → chunk-SFLQPB72.mjs.map} +1 -1
  141. package/dist/esm/chunk-SQ3VDIBO.mjs +47 -0
  142. package/dist/esm/{chunk-RFQFTIOA.mjs.map → chunk-SQ3VDIBO.mjs.map} +1 -1
  143. package/dist/esm/chunk-TPJY5GTS.mjs +502 -0
  144. package/dist/esm/{chunk-6MWXV62C.mjs.map → chunk-TPJY5GTS.mjs.map} +1 -1
  145. package/dist/esm/chunk-TSXVHRQB.mjs +216 -0
  146. package/dist/esm/{chunk-C6JRJNK3.mjs.map → chunk-TSXVHRQB.mjs.map} +1 -1
  147. package/dist/esm/chunk-UAXZDOSV.mjs +19 -0
  148. package/dist/esm/{chunk-GRB6YSIT.mjs.map → chunk-UAXZDOSV.mjs.map} +1 -1
  149. package/dist/esm/chunk-UKXKN5YN.mjs +72 -0
  150. package/dist/esm/{chunk-ROT6S6BM.mjs.map → chunk-UKXKN5YN.mjs.map} +1 -1
  151. package/dist/esm/chunk-WZD3K77H.mjs +53 -0
  152. package/dist/esm/{chunk-FBCXUC7J.mjs.map → chunk-WZD3K77H.mjs.map} +1 -1
  153. package/dist/esm/chunk-XBBBLYRH.mjs +66 -0
  154. package/dist/esm/{chunk-QQEK2GJC.mjs.map → chunk-XBBBLYRH.mjs.map} +1 -1
  155. package/dist/esm/chunk-YJJUYS67.mjs +329 -0
  156. package/dist/esm/{chunk-UCBUUH5M.mjs.map → chunk-YJJUYS67.mjs.map} +1 -1
  157. package/dist/esm/cli/index.mjs +21 -1
  158. package/dist/esm/cli/localNode.mjs +17 -1
  159. package/dist/esm/cli/move.mjs +7 -1
  160. package/dist/esm/client/core.mjs +31 -1
  161. package/dist/esm/client/get.mjs +40 -1
  162. package/dist/esm/client/index.mjs +60 -1
  163. package/dist/esm/client/post.mjs +40 -1
  164. package/dist/esm/core/account/index.mjs +21 -1
  165. package/dist/esm/core/account/utils/address.mjs +19 -1
  166. package/dist/esm/core/account/utils/index.mjs +20 -1
  167. package/dist/esm/core/accountAddress.mjs +16 -1
  168. package/dist/esm/core/authenticationKey.mjs +15 -1
  169. package/dist/esm/core/common.mjs +7 -1
  170. package/dist/esm/core/crypto/abstraction.mjs +26 -1
  171. package/dist/esm/core/crypto/deserializationUtils.mjs +64 -1
  172. package/dist/esm/core/crypto/ed25519.mjs +68 -1
  173. package/dist/esm/core/crypto/ephemeral.mjs +64 -1
  174. package/dist/esm/core/crypto/federatedKeyless.mjs +62 -1
  175. package/dist/esm/core/crypto/hdKey.mjs +25 -1
  176. package/dist/esm/core/crypto/index.mjs +196 -1
  177. package/dist/esm/core/crypto/keyless.mjs +110 -1
  178. package/dist/esm/core/crypto/multiEd25519.mjs +64 -1
  179. package/dist/esm/core/crypto/multiKey.mjs +66 -1
  180. package/dist/esm/core/crypto/poseidon.mjs +15 -1
  181. package/dist/esm/core/crypto/privateKey.mjs +12 -1
  182. package/dist/esm/core/crypto/proof.mjs +20 -1
  183. package/dist/esm/core/crypto/publicKey.mjs +22 -1
  184. package/dist/esm/core/crypto/secp256k1.mjs +66 -1
  185. package/dist/esm/core/crypto/signature.mjs +20 -1
  186. package/dist/esm/core/crypto/singleKey.mjs +64 -1
  187. package/dist/esm/core/crypto/types.mjs +1 -1
  188. package/dist/esm/core/crypto/utils.d.mts +5 -2
  189. package/dist/esm/core/crypto/utils.mjs +66 -1
  190. package/dist/esm/core/hex.mjs +12 -1
  191. package/dist/esm/core/index.mjs +221 -1
  192. package/dist/esm/errors/index.mjs +26 -1
  193. package/dist/esm/index.d.mts +1 -1
  194. package/dist/esm/index.mjs +716 -1
  195. package/dist/esm/internal/abstraction.mjs +66 -1
  196. package/dist/esm/internal/account.d.mts +27 -21
  197. package/dist/esm/internal/account.mjs +108 -1
  198. package/dist/esm/internal/ans.d.mts +19 -8
  199. package/dist/esm/internal/ans.mjs +100 -1
  200. package/dist/esm/internal/coin.mjs +62 -1
  201. package/dist/esm/internal/digitalAsset.mjs +108 -1
  202. package/dist/esm/internal/faucet.mjs +62 -1
  203. package/dist/esm/internal/fungibleAsset.mjs +70 -1
  204. package/dist/esm/internal/general.mjs +44 -1
  205. package/dist/esm/internal/keyless.mjs +68 -1
  206. package/dist/esm/internal/object.mjs +64 -1
  207. package/dist/esm/internal/staking.mjs +66 -1
  208. package/dist/esm/internal/table.mjs +39 -1
  209. package/dist/esm/internal/transaction.mjs +58 -1
  210. package/dist/esm/internal/transactionSubmission.mjs +82 -1
  211. package/dist/esm/internal/utils/index.mjs +37 -1
  212. package/dist/esm/internal/utils/utils.mjs +36 -1
  213. package/dist/esm/internal/view.mjs +64 -1
  214. package/dist/esm/transactions/authenticator/account.mjs +74 -1
  215. package/dist/esm/transactions/authenticator/index.mjs +86 -1
  216. package/dist/esm/transactions/authenticator/transaction.mjs +72 -1
  217. package/dist/esm/transactions/index.mjs +277 -1
  218. package/dist/esm/transactions/instances/chainId.mjs +11 -1
  219. package/dist/esm/transactions/instances/identifier.mjs +11 -1
  220. package/dist/esm/transactions/instances/index.mjs +119 -1
  221. package/dist/esm/transactions/instances/moduleId.mjs +62 -1
  222. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +62 -1
  223. package/dist/esm/transactions/instances/rawTransaction.mjs +68 -1
  224. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +21 -1
  225. package/dist/esm/transactions/instances/signedTransaction.mjs +62 -1
  226. package/dist/esm/transactions/instances/simpleTransaction.mjs +62 -1
  227. package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
  228. package/dist/esm/transactions/instances/transactionPayload.mjs +94 -1
  229. package/dist/esm/transactions/management/accountSequenceNumber.mjs +62 -1
  230. package/dist/esm/transactions/management/asyncQueue.mjs +9 -1
  231. package/dist/esm/transactions/management/index.mjs +68 -1
  232. package/dist/esm/transactions/management/transactionWorker.mjs +66 -1
  233. package/dist/esm/transactions/transactionBuilder/helpers.mjs +100 -1
  234. package/dist/esm/transactions/transactionBuilder/index.mjs +148 -1
  235. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +76 -1
  236. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +68 -1
  237. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +84 -1
  238. package/dist/esm/transactions/typeTag/index.mjs +98 -1
  239. package/dist/esm/transactions/typeTag/parser.mjs +66 -1
  240. package/dist/esm/transactions/types.mjs +1 -1
  241. package/dist/esm/types/abstraction.mjs +7 -1
  242. package/dist/esm/types/generated/queries.mjs +65 -1
  243. package/dist/esm/types/generated/types.mjs +758 -1
  244. package/dist/esm/types/generated/types.mjs.map +1 -1
  245. package/dist/esm/types/index.mjs +83 -1
  246. package/dist/esm/types/indexer.d.mts +1 -1
  247. package/dist/esm/types/indexer.mjs +1 -1
  248. package/dist/esm/types/types.mjs +81 -1
  249. package/dist/esm/utils/apiEndpoints.mjs +21 -1
  250. package/dist/esm/utils/const.mjs +25 -1
  251. package/dist/esm/utils/helpers.mjs +42 -1
  252. package/dist/esm/utils/index.mjs +93 -1
  253. package/dist/esm/utils/memoize.mjs +9 -1
  254. package/dist/esm/utils/normalizeBundle.mjs +20 -1
  255. package/dist/esm/version.d.mts +1 -1
  256. package/dist/esm/version.mjs +7 -1
  257. package/package.json +1 -1
  258. package/src/api/aptos.ts +10 -9
  259. package/src/api/index.ts +1 -0
  260. package/src/api/manager.ts +872 -0
  261. package/src/api/transaction.ts +59 -36
  262. package/src/core/crypto/utils.ts +38 -1
  263. package/src/internal/account.ts +36 -83
  264. package/src/internal/ans.ts +19 -8
  265. package/src/internal/move/jwks/build/jwk/BuildInfo.yaml +56 -0
  266. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/account.mv +0 -0
  267. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aggregator.mv +0 -0
  268. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aggregator_factory.mv +0 -0
  269. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aggregator_v2.mv +0 -0
  270. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aptos_account.mv +0 -0
  271. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aptos_coin.mv +0 -0
  272. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aptos_governance.mv +0 -0
  273. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/block.mv +0 -0
  274. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/chain_id.mv +0 -0
  275. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/chain_status.mv +0 -0
  276. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/code.mv +0 -0
  277. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/coin.mv +0 -0
  278. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/config_buffer.mv +0 -0
  279. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/consensus_config.mv +0 -0
  280. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/create_signer.mv +0 -0
  281. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/delegation_pool.mv +0 -0
  282. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/dispatchable_fungible_asset.mv +0 -0
  283. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/dkg.mv +0 -0
  284. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/event.mv +0 -0
  285. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/execution_config.mv +0 -0
  286. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/function_info.mv +0 -0
  287. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/fungible_asset.mv +0 -0
  288. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/gas_schedule.mv +0 -0
  289. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/genesis.mv +0 -0
  290. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/governance_proposal.mv +0 -0
  291. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/guid.mv +0 -0
  292. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/jwk_consensus_config.mv +0 -0
  293. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/jwks.mv +0 -0
  294. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/keyless_account.mv +0 -0
  295. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/managed_coin.mv +0 -0
  296. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/multisig_account.mv +0 -0
  297. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/object.mv +0 -0
  298. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/object_code_deployment.mv +0 -0
  299. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/optional_aggregator.mv +0 -0
  300. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/primary_fungible_store.mv +0 -0
  301. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness.mv +0 -0
  302. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness_api_v0_config.mv +0 -0
  303. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness_config.mv +0 -0
  304. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness_config_seqnum.mv +0 -0
  305. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/reconfiguration.mv +0 -0
  306. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/reconfiguration_state.mv +0 -0
  307. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/reconfiguration_with_dkg.mv +0 -0
  308. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/resource_account.mv +0 -0
  309. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/stake.mv +0 -0
  310. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/staking_config.mv +0 -0
  311. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/staking_contract.mv +0 -0
  312. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/staking_proxy.mv +0 -0
  313. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/state_storage.mv +0 -0
  314. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/storage_gas.mv +0 -0
  315. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/system_addresses.mv +0 -0
  316. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/timestamp.mv +0 -0
  317. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/transaction_context.mv +0 -0
  318. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/transaction_fee.mv +0 -0
  319. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/transaction_validation.mv +0 -0
  320. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/util.mv +0 -0
  321. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/validator_consensus_info.mv +0 -0
  322. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/version.mv +0 -0
  323. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/vesting.mv +0 -0
  324. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/voting.mv +0 -0
  325. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/any.mv +0 -0
  326. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/aptos_hash.mv +0 -0
  327. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/big_vector.mv +0 -0
  328. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/bls12381.mv +0 -0
  329. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/bls12381_algebra.mv +0 -0
  330. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/bn254_algebra.mv +0 -0
  331. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/capability.mv +0 -0
  332. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/comparator.mv +0 -0
  333. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/copyable_any.mv +0 -0
  334. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/crypto_algebra.mv +0 -0
  335. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/debug.mv +0 -0
  336. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ed25519.mv +0 -0
  337. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/fixed_point64.mv +0 -0
  338. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/from_bcs.mv +0 -0
  339. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math128.mv +0 -0
  340. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math64.mv +0 -0
  341. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math_fixed.mv +0 -0
  342. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math_fixed64.mv +0 -0
  343. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/multi_ed25519.mv +0 -0
  344. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/pool_u64.mv +0 -0
  345. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/pool_u64_unbound.mv +0 -0
  346. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255.mv +0 -0
  347. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255_bulletproofs.mv +0 -0
  348. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255_elgamal.mv +0 -0
  349. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255_pedersen.mv +0 -0
  350. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/secp256k1.mv +0 -0
  351. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/simple_map.mv +0 -0
  352. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/smart_table.mv +0 -0
  353. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/smart_vector.mv +0 -0
  354. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/string_utils.mv +0 -0
  355. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/table.mv +0 -0
  356. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/table_with_length.mv +0 -0
  357. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/type_info.mv +0 -0
  358. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/acl.mv +0 -0
  359. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/bcs.mv +0 -0
  360. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/bit_vector.mv +0 -0
  361. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/error.mv +0 -0
  362. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/features.mv +0 -0
  363. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/fixed_point32.mv +0 -0
  364. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/hash.mv +0 -0
  365. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/option.mv +0 -0
  366. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/signer.mv +0 -0
  367. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/string.mv +0 -0
  368. package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/vector.mv +0 -0
  369. package/src/internal/move/jwks/build/jwk/bytecode_scripts/main.mv +0 -0
  370. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/account.mvsm +0 -0
  371. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aggregator.mvsm +0 -0
  372. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aggregator_factory.mvsm +0 -0
  373. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aggregator_v2.mvsm +0 -0
  374. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aptos_account.mvsm +0 -0
  375. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aptos_coin.mvsm +0 -0
  376. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aptos_governance.mvsm +0 -0
  377. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/block.mvsm +0 -0
  378. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/chain_id.mvsm +0 -0
  379. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/chain_status.mvsm +0 -0
  380. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/code.mvsm +0 -0
  381. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/coin.mvsm +0 -0
  382. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/config_buffer.mvsm +0 -0
  383. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/consensus_config.mvsm +0 -0
  384. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/create_signer.mvsm +0 -0
  385. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/delegation_pool.mvsm +0 -0
  386. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/dispatchable_fungible_asset.mvsm +0 -0
  387. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/dkg.mvsm +0 -0
  388. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/event.mvsm +0 -0
  389. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/execution_config.mvsm +0 -0
  390. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/function_info.mvsm +0 -0
  391. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/fungible_asset.mvsm +0 -0
  392. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/gas_schedule.mvsm +0 -0
  393. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/genesis.mvsm +0 -0
  394. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/governance_proposal.mvsm +0 -0
  395. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/guid.mvsm +0 -0
  396. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/jwk_consensus_config.mvsm +0 -0
  397. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/jwks.mvsm +0 -0
  398. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/keyless_account.mvsm +0 -0
  399. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/managed_coin.mvsm +0 -0
  400. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/multisig_account.mvsm +0 -0
  401. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/object.mvsm +0 -0
  402. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/object_code_deployment.mvsm +0 -0
  403. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/optional_aggregator.mvsm +0 -0
  404. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/primary_fungible_store.mvsm +0 -0
  405. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness.mvsm +0 -0
  406. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness_api_v0_config.mvsm +0 -0
  407. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness_config.mvsm +0 -0
  408. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness_config_seqnum.mvsm +0 -0
  409. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/reconfiguration.mvsm +0 -0
  410. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/reconfiguration_state.mvsm +0 -0
  411. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/reconfiguration_with_dkg.mvsm +0 -0
  412. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/resource_account.mvsm +0 -0
  413. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/stake.mvsm +0 -0
  414. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/staking_config.mvsm +0 -0
  415. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/staking_contract.mvsm +0 -0
  416. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/staking_proxy.mvsm +0 -0
  417. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/state_storage.mvsm +0 -0
  418. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/storage_gas.mvsm +0 -0
  419. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/system_addresses.mvsm +0 -0
  420. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/timestamp.mvsm +0 -0
  421. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/transaction_context.mvsm +0 -0
  422. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/transaction_fee.mvsm +0 -0
  423. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/transaction_validation.mvsm +0 -0
  424. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/util.mvsm +0 -0
  425. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/validator_consensus_info.mvsm +0 -0
  426. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/version.mvsm +0 -0
  427. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/vesting.mvsm +0 -0
  428. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/voting.mvsm +0 -0
  429. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/any.mvsm +0 -0
  430. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/aptos_hash.mvsm +0 -0
  431. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/big_vector.mvsm +0 -0
  432. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/bls12381.mvsm +0 -0
  433. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/bls12381_algebra.mvsm +0 -0
  434. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/bn254_algebra.mvsm +0 -0
  435. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/capability.mvsm +0 -0
  436. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/comparator.mvsm +0 -0
  437. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/copyable_any.mvsm +0 -0
  438. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/crypto_algebra.mvsm +0 -0
  439. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/debug.mvsm +0 -0
  440. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ed25519.mvsm +0 -0
  441. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/fixed_point64.mvsm +0 -0
  442. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/from_bcs.mvsm +0 -0
  443. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math128.mvsm +0 -0
  444. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math64.mvsm +0 -0
  445. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math_fixed.mvsm +0 -0
  446. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math_fixed64.mvsm +0 -0
  447. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/multi_ed25519.mvsm +0 -0
  448. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/pool_u64.mvsm +0 -0
  449. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/pool_u64_unbound.mvsm +0 -0
  450. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255.mvsm +0 -0
  451. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255_bulletproofs.mvsm +0 -0
  452. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255_elgamal.mvsm +0 -0
  453. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255_pedersen.mvsm +0 -0
  454. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/secp256k1.mvsm +0 -0
  455. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/simple_map.mvsm +0 -0
  456. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/smart_table.mvsm +0 -0
  457. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/smart_vector.mvsm +0 -0
  458. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/string_utils.mvsm +0 -0
  459. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/table.mvsm +0 -0
  460. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/table_with_length.mvsm +0 -0
  461. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/type_info.mvsm +0 -0
  462. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/acl.mvsm +0 -0
  463. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/bcs.mvsm +0 -0
  464. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/bit_vector.mvsm +0 -0
  465. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/error.mvsm +0 -0
  466. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/features.mvsm +0 -0
  467. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/fixed_point32.mvsm +0 -0
  468. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/hash.mvsm +0 -0
  469. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/option.mvsm +0 -0
  470. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/signer.mvsm +0 -0
  471. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/string.mvsm +0 -0
  472. package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/vector.mvsm +0 -0
  473. package/src/internal/move/jwks/build/jwk/source_maps/main.mvsm +0 -0
  474. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/account.move +1533 -0
  475. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator.move +48 -0
  476. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator_factory.move +66 -0
  477. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator_v2.move +280 -0
  478. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_account.move +443 -0
  479. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_coin.move +204 -0
  480. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_governance.move +1387 -0
  481. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/block.move +394 -0
  482. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/chain_id.move +41 -0
  483. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/chain_status.move +48 -0
  484. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/code.move +367 -0
  485. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/coin.move +2214 -0
  486. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/config_buffer.move +101 -0
  487. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/consensus_config.move +77 -0
  488. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/create_signer.move +21 -0
  489. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/delegation_pool.move +5568 -0
  490. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/dispatchable_fungible_asset.move +228 -0
  491. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/dkg.move +121 -0
  492. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/event.move +92 -0
  493. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/execution_config.move +66 -0
  494. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/function_info.move +100 -0
  495. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/fungible_asset.move +1566 -0
  496. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/gas_schedule.move +176 -0
  497. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/genesis.move +550 -0
  498. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/governance_proposal.move +23 -0
  499. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/guid.move +68 -0
  500. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/jwk_consensus_config.move +148 -0
  501. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/jwks.move +817 -0
  502. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/keyless_account.move +312 -0
  503. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/managed_coin.move +205 -0
  504. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/multisig_account.move +2477 -0
  505. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/object.move +1073 -0
  506. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/object_code_deployment.move +147 -0
  507. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/optional_aggregator.move +295 -0
  508. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/primary_fungible_store.move +405 -0
  509. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness.move +574 -0
  510. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_api_v0_config.move +57 -0
  511. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_config.move +153 -0
  512. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_config_seqnum.move +49 -0
  513. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration.move +237 -0
  514. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration_state.move +132 -0
  515. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration_with_dkg.move +69 -0
  516. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/resource_account.move +267 -0
  517. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/stake.move +3286 -0
  518. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_config.move +686 -0
  519. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_contract.move +1618 -0
  520. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_proxy.move +228 -0
  521. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/state_storage.move +90 -0
  522. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/storage_gas.move +622 -0
  523. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/system_addresses.move +82 -0
  524. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/timestamp.move +88 -0
  525. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_context.move +262 -0
  526. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_fee.move +457 -0
  527. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_validation.move +501 -0
  528. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/util.move +16 -0
  529. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/validator_consensus_info.move +42 -0
  530. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/version.move +115 -0
  531. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/vesting.move +2183 -0
  532. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/voting.move +1279 -0
  533. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/any.move +57 -0
  534. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/aptos_hash.move +253 -0
  535. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/big_vector.move +469 -0
  536. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bls12381.move +985 -0
  537. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bls12381_algebra.move +802 -0
  538. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bn254_algebra.move +855 -0
  539. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/capability.move +193 -0
  540. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/comparator.move +173 -0
  541. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/copyable_any.move +45 -0
  542. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/crypto_algebra.move +351 -0
  543. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/debug.move +278 -0
  544. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ed25519.move +262 -0
  545. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/fixed_point64.move +447 -0
  546. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/from_bcs.move +91 -0
  547. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math128.move +381 -0
  548. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math64.move +336 -0
  549. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math_fixed.move +139 -0
  550. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math_fixed64.move +142 -0
  551. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/multi_ed25519.move +482 -0
  552. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/pool_u64.move +571 -0
  553. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/pool_u64_unbound.move +270 -0
  554. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255.move +1310 -0
  555. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_bulletproofs.move +253 -0
  556. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_elgamal.move +234 -0
  557. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_pedersen.move +158 -0
  558. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/secp256k1.move +114 -0
  559. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/simple_map.move +319 -0
  560. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/smart_table.move +769 -0
  561. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/smart_vector.move +766 -0
  562. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/string_utils.move +148 -0
  563. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/table.move +152 -0
  564. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/table_with_length.move +141 -0
  565. package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/type_info.move +351 -0
  566. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/acl.move +46 -0
  567. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/bcs.move +27 -0
  568. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/bit_vector.move +239 -0
  569. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/error.move +88 -0
  570. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/features.move +780 -0
  571. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/fixed_point32.move +295 -0
  572. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/hash.move +8 -0
  573. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/option.move +356 -0
  574. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/signer.move +21 -0
  575. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/string.move +93 -0
  576. package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/vector.move +669 -0
  577. package/src/internal/move/jwks/build/jwk/sources/main.move +20 -0
  578. package/src/version.ts +1 -1
  579. package/dist/common/chunk-6MMUUJHX.js +0 -4
  580. package/dist/common/chunk-6MMUUJHX.js.map +0 -1
  581. package/dist/esm/api/event.d.mts +0 -193
  582. package/dist/esm/api/event.mjs +0 -2
  583. package/dist/esm/chunk-35DKMW7Q.mjs +0 -2
  584. package/dist/esm/chunk-4R4AI5RT.mjs +0 -2
  585. package/dist/esm/chunk-4RXKALLC.mjs +0 -2
  586. package/dist/esm/chunk-56CNRT2K.mjs +0 -2
  587. package/dist/esm/chunk-6MWXV62C.mjs +0 -2
  588. package/dist/esm/chunk-6PKBXYG3.mjs +0 -2
  589. package/dist/esm/chunk-6Y6ZO7TS.mjs +0 -7
  590. package/dist/esm/chunk-A5L76YP7.mjs +0 -2
  591. package/dist/esm/chunk-AQQEQB35.mjs +0 -2
  592. package/dist/esm/chunk-BUUV6B4P.mjs +0 -2
  593. package/dist/esm/chunk-BYINW7I2.mjs +0 -2
  594. package/dist/esm/chunk-C3Q23D22.mjs +0 -2
  595. package/dist/esm/chunk-C6JRJNK3.mjs +0 -2
  596. package/dist/esm/chunk-DPW6ELCQ.mjs +0 -2
  597. package/dist/esm/chunk-DPW6ELCQ.mjs.map +0 -1
  598. package/dist/esm/chunk-DW6WLD2B.mjs +0 -2
  599. package/dist/esm/chunk-E6IUB35J.mjs +0 -2
  600. package/dist/esm/chunk-EPMBZCYJ.mjs +0 -2
  601. package/dist/esm/chunk-EPMBZCYJ.mjs.map +0 -1
  602. package/dist/esm/chunk-FBCXUC7J.mjs +0 -2
  603. package/dist/esm/chunk-FWGLACJS.mjs +0 -2
  604. package/dist/esm/chunk-FWGLACJS.mjs.map +0 -1
  605. package/dist/esm/chunk-GOXRBEIJ.mjs +0 -2
  606. package/dist/esm/chunk-GRB6YSIT.mjs +0 -2
  607. package/dist/esm/chunk-GYVSI3TS.mjs +0 -4
  608. package/dist/esm/chunk-HPQMAP7O.mjs +0 -2
  609. package/dist/esm/chunk-I4NMWLUZ.mjs +0 -6
  610. package/dist/esm/chunk-I4NMWLUZ.mjs.map +0 -1
  611. package/dist/esm/chunk-IF4UU2MT.mjs +0 -2
  612. package/dist/esm/chunk-IJE2LVZG.mjs +0 -2
  613. package/dist/esm/chunk-IXYGZ57N.mjs +0 -2
  614. package/dist/esm/chunk-JCFTAG5Z.mjs +0 -2
  615. package/dist/esm/chunk-KDMSOCZY.mjs +0 -2
  616. package/dist/esm/chunk-KJH4KKG6.mjs +0 -2
  617. package/dist/esm/chunk-NII5Q32W.mjs +0 -2
  618. package/dist/esm/chunk-NJN3EAOM.mjs +0 -2
  619. package/dist/esm/chunk-OYH2T6V5.mjs +0 -2
  620. package/dist/esm/chunk-OYUW6ZN2.mjs +0 -2
  621. package/dist/esm/chunk-PQS3II2E.mjs +0 -2
  622. package/dist/esm/chunk-PRUQZNAP.mjs +0 -2
  623. package/dist/esm/chunk-QGFWOGAV.mjs +0 -2
  624. package/dist/esm/chunk-QGFWOGAV.mjs.map +0 -1
  625. package/dist/esm/chunk-QQEK2GJC.mjs +0 -2
  626. package/dist/esm/chunk-QREVMGQZ.mjs +0 -2
  627. package/dist/esm/chunk-RFQFTIOA.mjs +0 -2
  628. package/dist/esm/chunk-ROT6S6BM.mjs +0 -2
  629. package/dist/esm/chunk-STY74NUA.mjs +0 -2
  630. package/dist/esm/chunk-THUSLDD6.mjs +0 -2
  631. package/dist/esm/chunk-UCBUUH5M.mjs +0 -2
  632. package/dist/esm/chunk-WLUXOUZH.mjs +0 -2
  633. package/dist/esm/chunk-XIQFX5FV.mjs +0 -2
  634. package/dist/esm/chunk-Y7ZQTLH4.mjs +0 -2
  635. package/dist/esm/chunk-YFFDF22R.mjs +0 -2
  636. package/dist/esm/chunk-YOZBVVKL.mjs +0 -2
  637. package/dist/esm/chunk-Z6KQX6VX.mjs +0 -2
  638. package/dist/esm/chunk-ZMT2M6YT.mjs +0 -2
  639. package/dist/esm/internal/event.d.mts +0 -82
  640. package/dist/esm/internal/event.mjs +0 -2
  641. package/dist/esm/internal/event.mjs.map +0 -1
  642. package/src/api/event.ts +0 -230
  643. package/src/internal/event.ts +0 -166
  644. /package/dist/esm/api/{event.mjs.map → manager.mjs.map} +0 -0
  645. /package/dist/esm/{chunk-KDMSOCZY.mjs.map → chunk-SAWN7RJP.mjs.map} +0 -0
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var N=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var h=(r,e,t,n)=>{for(var s=n>1?void 0:n?C(e,t):e,i=r.length-1,u;i>=0;i--)(u=r[i])&&(s=(n?u(e,t,s):u(s))||s);return n&&s&&N(e,t,s),s};var c=class extends Error{constructor(e,t){super(e),this.invalidReason=t}};var _utils = require('@noble/hashes/utils');var O=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(O||{}),_= exports.j =class r{constructor(e){this.data=e}toUint8Array(){return this.data}toStringWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(e){let t=e;if(t.startsWith("0x")&&(t=t.slice(2)),t.length===0)throw new c("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(t.length%2!==0)throw new c("Hex string must be an even number of hex characters.","invalid_length");try{return new r(_utils.hexToBytes.call(void 0, t))}catch(n){throw new c(`Hex string contains invalid hex characters: ${_optionalChain([n, 'optionalAccess', _2 => _2.message])}`,"invalid_hex_chars")}}static fromHexInput(e){return e instanceof Uint8Array?new r(e):r.fromHexString(e)}static hexInputToUint8Array(e){return e instanceof Uint8Array?e:r.fromHexString(e).toUint8Array()}static hexInputToString(e){return r.fromHexInput(e).toString()}static hexInputToStringWithoutPrefix(e){return r.fromHexInput(e).toStringWithoutPrefix()}static isValid(e){try{return r.fromHexString(e),{valid:!0}}catch(t){return{valid:!1,invalidReason:_optionalChain([t, 'optionalAccess', _3 => _3.invalidReason]),invalidReasonMessage:_optionalChain([t, 'optionalAccess', _4 => _4.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((t,n)=>t===e.data[n])}},_e= exports.k =r=>new TextDecoder().decode(_.fromHexInput(r).toUint8Array());var R=255,U= exports.c =65535,x= exports.d =4294967295,S= exports.e =18446744073709551615n,b= exports.f =340282366920938463463374607431768211455n,v= exports.g =115792089237316195423570985008687907853269984665640564039457584007913129639935n;var m=class{bcsToBytes(){let e=new l;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return _.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},l= exports.m =class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,n){this.ensureBufferWillHandleSize(t);let s=new DataView(this.buffer,this.offset);e.apply(s,[0,n,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){H(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(x),n=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(n))}serializeU128(e){let t=BigInt(e)&S,n=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(n)}serializeU256(e){let t=BigInt(e)&b,n=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(n)}serializeU32AsUleb128(e){let t=e,n=[];for(;t>>>7;)n.push(t&127|128),t>>>=7;n.push(t),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e,t){let n=e!==void 0;this.serializeBool(n),n&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?t!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};h([f(0,R)],l.prototype,"serializeU8",1),h([f(0,U)],l.prototype,"serializeU16",1),h([f(0,x)],l.prototype,"serializeU32",1),h([f(BigInt(0),S)],l.prototype,"serializeU64",1),h([f(BigInt(0),b)],l.prototype,"serializeU128",1),h([f(BigInt(0),v)],l.prototype,"serializeU256",1),h([f(0,x)],l.prototype,"serializeU32AsUleb128",1);function H(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var D=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function P(r,e,t){let n=BigInt(r);if(n>BigInt(t)||n<BigInt(e))throw new Error(D(r,e,t))}function f(r,e){return(t,n,s)=>{let i=s.value;return s.value=function(d){return P(d,r,e),i.apply(this,[d])},s}}var F=(s=>(s.JSON="application/json",s.BCS="application/x-bcs",s.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",s.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",s))(F||{}),W= exports.r =(a=>(a[a.Bool=0]="Bool",a[a.U8=1]="U8",a[a.U64=2]="U64",a[a.U128=3]="U128",a[a.Address=4]="Address",a[a.Signer=5]="Signer",a[a.Vector=6]="Vector",a[a.Struct=7]="Struct",a[a.U16=8]="U16",a[a.U32=9]="U32",a[a.U256=10]="U256",a[a.Reference=254]="Reference",a[a.Generic=255]="Generic",a))(W||{}),I= exports.s =(p=>(p[p.U8=0]="U8",p[p.U64=1]="U64",p[p.U128=2]="U128",p[p.Address=3]="Address",p[p.U8Vector=4]="U8Vector",p[p.Bool=5]="Bool",p[p.U16=6]="U16",p[p.U32=7]="U32",p[p.U256=8]="U256",p[p.Serialized=9]="Serialized",p))(I||{}),z= exports.t =(s=>(s[s.Script=0]="Script",s[s.EntryFunction=2]="EntryFunction",s[s.Multisig=3]="Multisig",s[s.Payload=4]="Payload",s))(z||{}),G= exports.u =(e=>(e[e.V1=0]="V1",e))(G||{}),L= exports.v =(n=>(n[n.Script=0]="Script",n[n.EntryFunction=1]="EntryFunction",n[n.Empty=2]="Empty",n))(L||{}),$= exports.w =(e=>(e[e.V1=0]="V1",e))($||{}),q= exports.x =(t=>(t[t.MultiAgentTransaction=0]="MultiAgentTransaction",t[t.FeePayerTransaction=1]="FeePayerTransaction",t))(q||{}),X= exports.y =(i=>(i[i.Ed25519=0]="Ed25519",i[i.MultiEd25519=1]="MultiEd25519",i[i.MultiAgent=2]="MultiAgent",i[i.FeePayer=3]="FeePayer",i[i.SingleSender=4]="SingleSender",i))(X||{}),K= exports.z =(u=>(u[u.Ed25519=0]="Ed25519",u[u.MultiEd25519=1]="MultiEd25519",u[u.SingleKey=2]="SingleKey",u[u.MultiKey=3]="MultiKey",u[u.NoAccountAuthenticator=4]="NoAccountAuthenticator",u[u.Abstraction=5]="Abstraction",u))(K||{}),Y= exports.A =(t=>(t.Ed25519="ed25519",t.Secp256k1="secp256k1",t))(Y||{}),j= exports.B =(s=>(s[s.Ed25519=0]="Ed25519",s[s.Secp256k1=1]="Secp256k1",s[s.Keyless=3]="Keyless",s[s.FederatedKeyless=4]="FederatedKeyless",s))(j||{});function Re(r){switch(r){case 0:return"ed25519";case 1:return"secp256k1";case 3:return"keyless";case 4:return"federated_keyless";default:throw new Error("Unknown public key variant")}}var Z=(n=>(n[n.Ed25519=0]="Ed25519",n[n.Secp256k1=1]="Secp256k1",n[n.Keyless=3]="Keyless",n))(Z||{}),Q= exports.E =(e=>(e[e.Ed25519=0]="Ed25519",e))(Q||{}),J= exports.F =(e=>(e[e.Ed25519=0]="Ed25519",e))(J||{}),V= exports.G =(e=>(e[e.ZkProof=0]="ZkProof",e))(V||{}),ee= exports.H =(e=>(e[e.Groth16=0]="Groth16",e))(ee||{}),te= exports.I =(d=>(d.Pending="pending_transaction",d.User="user_transaction",d.Genesis="genesis_transaction",d.BlockMetadata="block_metadata_transaction",d.StateCheckpoint="state_checkpoint_transaction",d.Validator="validator_transaction",d.BlockEpilogue="block_epilogue_transaction",d))(te||{});function Ue(r){return r.type==="pending_transaction"}function ve(r){return r.type==="user_transaction"}function Ie(r){return r.type==="genesis_transaction"}function Me(r){return r.type==="block_metadata_transaction"}function Ee(r){return r.type==="state_checkpoint_transaction"}function Be(r){return r.type==="validator_transaction"}function Ne(r){return r.type==="block_epilogue_transaction"}function Ce(r){return"signature"in r&&r.type==="ed25519_signature"}function ke(r){return"signature"in r&&r.signature==="secp256k1_ecdsa_signature"}function we(r){return r.type==="multi_agent_signature"}function Oe(r){return r.type==="fee_payer_signature"}function He(r){return r.type==="multi_ed25519_signature"}function De(r){return r.type==="single_sender"}var re=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(re||{}),ne= exports.X =(s=>(s.STORE="store",s.DROP="drop",s.KEY="key",s.COPY="copy",s))(ne||{}),se= exports.Y =(t=>(t.VALIDATOR="validator",t.FULL_NODE="full_node",t))(se||{}),ie= exports.Z =(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.SingleKey=2]="SingleKey",s[s.MultiKey=3]="MultiKey",s))(ie||{}),oe= exports._ =(t=>(t[t.Ed25519=0]="Ed25519",t[t.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",t))(oe||{}),M= exports.$ =(i=>(i[i.DeriveAuid=251]="DeriveAuid",i[i.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",i[i.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",i[i.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",i[i.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",i))(M||{});var pe=(y=>(y.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",y.INVALID_HEX_CHARS="invalid_hex_chars",y.TOO_SHORT="too_short",y.TOO_LONG="too_long",y.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",y.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",y.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",y.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",y))(pe||{}),o=class o extends m{constructor(e){if(super(),e.length!==o.LENGTH)throw new c("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toStringShort(){return`0x${this.toStringShortWithoutPrefix()}`}toStringShortWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data).replace(/^0+/,"");return e===""?"0":e}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let t=e.deserializeFixedBytes(o.LENGTH);return new o(t)}static fromStringStrict(e){if(!e.startsWith("0x"))throw new c("Hex string must start with a leading 0x.","leading_zero_x_required");let t=o.fromString(e);if(e.length!==o.LONG_STRING_LENGTH+2)if(t.isSpecial()){if(e.length!==3)throw new c(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new c(`The given hex string ${e} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return t}static fromString(e,{maxMissingChars:t=4}={}){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new c("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new c("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(t>63||t<0)throw new c(`maxMissingChars must be between or equal to 0 and 63. Received ${t}`,"INVALID_PADDING_STRICTNESS");let s;try{s=_utils.hexToBytes.call(void 0, n.padStart(64,"0"))}catch(u){throw new c(`Hex characters are invalid: ${_optionalChain([u, 'optionalAccess', _5 => _5.message])}`,"invalid_hex_chars")}let i=new o(s);if(n.length<64-t&&!i.isSpecial())throw new c(`Hex string is too short, must be ${64-t} to 64 chars long, excluding the leading 0x. You may need to fix
2
- the addresss by padding it with 0s before passing it to \`fromString\` (e.g. <addressString>.padStart(64, '0')).
3
- Received ${e}`,"too_short");return i}static from(e,{maxMissingChars:t=4}={}){return typeof e=="string"?o.fromString(e,{maxMissingChars:t}):e instanceof Uint8Array?new o(e):e}static fromStrict(e){return typeof e=="string"?o.fromStringStrict(e):e instanceof Uint8Array?new o(e):e}static isValid(e){try{return e.strict?o.fromStrict(e.input):o.from(e.input),{valid:!0}}catch(t){return{valid:!1,invalidReason:_optionalChain([t, 'optionalAccess', _6 => _6.invalidReason]),invalidReasonMessage:_optionalChain([t, 'optionalAccess', _7 => _7.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((t,n)=>t===e.data[n])}};o.LENGTH=32,o.LONG_STRING_LENGTH=64,o.ZERO=o.from("0x0"),o.ONE=o.from("0x1"),o.TWO=o.from("0x2"),o.THREE=o.from("0x3"),o.FOUR=o.from("0x4"),o.A=o.from("0xA");var g=o;var _sha3 = require('@noble/hashes/sha3');var T=(r,e)=>{let t=r.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...t,...n,254]);return new g(_sha3.sha3_256.call(void 0, s))},Ve= exports.da =(r,e)=>{let t=r.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...t,...n,255]);return new g(_sha3.sha3_256.call(void 0, s))},et= exports.ea =(r,e,t)=>{let n=`${e}::${t}`;return T(r,n)};var _jsbase64 = require('js-base64');async function it(r){return new Promise(e=>{setTimeout(e,r)})}function ot(r){return r instanceof Error?r.message:String(r)}var at=()=>Math.floor(Date.now()/1e3);function pt(r){let e=new Date(r*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function ut(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t=e+"==".substring(0,(3-e.length%3)%3);return _jsbase64.decode.call(void 0, t)}function ct(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4!==0;)e+="=";return new Uint8Array(Buffer.from(e,"base64"))}var gt=(r,e)=>r*10**e,dt= exports.ma =(r,e)=>r/10**e,B=r=>{let e="";for(let t=2;t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substring(t,t+2),16));return e},lt= exports.na =r=>{let{account_address:e,module_name:t,struct_name:n}=r,s=B(t),i=B(n);return`${e}::${s}::${i}`},yt= exports.oa =r=>typeof r=="object"&&!Array.isArray(r)&&r!==null&&"account_address"in r&&"module_name"in r&&"struct_name"in r&&typeof r.account_address=="string"&&typeof r.module_name=="string"&&typeof r.struct_name=="string";function ht(r){let e=r.split("::");if(e.length!==3)throw new Error(`Invalid function ${r}`);let t=e[0],n=e[1],s=e[2];return{moduleAddress:t,moduleName:n,functionName:s}}function ft(r){let e=r.split("::");return e.length===3&&g.isValid({input:e[0]}).valid}function _t(r,e=6,t=5){return`${r.slice(0,e)}...${r.slice(-t)}`}var ce="0x1::aptos_coin::AptosCoin",xt=g.A.toStringLong();function ge(r){let e=/0x[0-9a-fA-F]+/g;return r.replace(e,t=>g.from(t,{maxMissingChars:63}).toStringShort())}function mt(r){let e=ge(r);return e===ce?g.A:T(g.A,e)}exports.a = h; exports.b = R; exports.c = U; exports.d = x; exports.e = S; exports.f = b; exports.g = v; exports.h = c; exports.i = O; exports.j = _; exports.k = _e; exports.l = m; exports.m = l; exports.n = H; exports.o = D; exports.p = P; exports.q = F; exports.r = W; exports.s = I; exports.t = z; exports.u = G; exports.v = L; exports.w = $; exports.x = q; exports.y = X; exports.z = K; exports.A = Y; exports.B = j; exports.C = Re; exports.D = Z; exports.E = Q; exports.F = J; exports.G = V; exports.H = ee; exports.I = te; exports.J = Ue; exports.K = ve; exports.L = Ie; exports.M = Me; exports.N = Ee; exports.O = Be; exports.P = Ne; exports.Q = Ce; exports.R = ke; exports.S = we; exports.T = Oe; exports.U = He; exports.V = De; exports.W = re; exports.X = ne; exports.Y = se; exports.Z = ie; exports._ = oe; exports.$ = M; exports.aa = pe; exports.ba = g; exports.ca = T; exports.da = Ve; exports.ea = et; exports.fa = it; exports.ga = ot; exports.ha = at; exports.ia = pt; exports.ja = ut; exports.ka = ct; exports.la = gt; exports.ma = dt; exports.na = lt; exports.oa = yt; exports.pa = ht; exports.qa = ft; exports.ra = _t; exports.sa = mt;
4
- //# sourceMappingURL=chunk-6MMUUJHX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/chunk-6MMUUJHX.js","../../src/core/common.ts","../../src/core/hex.ts","../../src/core/accountAddress.ts"],"names":["ParsingError","message","invalidReason","HexInvalidReason","Hex","_Hex","data","bytesToHex"],"mappings":"AAAA,ilBAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CCQhM,IAAMA,CAAAA,CAAN,MAAA,QAA8B,KAAM,CAkBzC,WAAA,CAAYC,CAAAA,CAAiBC,CAAAA,CAAkB,CAC7C,KAAA,CAAMD,CAAO,CAAA,CACb,IAAA,CAAK,aAAA,CAAgBC,CACvB,CACF,CAAA,CC3BA,4CAAuC,IAS3BC,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACVA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA,CAAAA,CAAA,cAAA,CAAiB,gBAAA,CACjBA,CAAAA,CAAA,iBAAA,CAAoB,mBAAA,CAHVA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA,CAAA,CAAA,CAAA,CAgCCC,CAAAA,aAAN,MAAMC,CAAI,CAUf,WAAA,CAAYC,CAAAA,CAAkB,CAC5B,IAAA,CAAK,IAAA,CAAOA,CACd,CAaA,YAAA,CAAA,CAA2B,CACzB,OAAO,IAAA,CAAK,IACd,CASA,qBAAA,CAAA,CAAgC,CAC9B,OAAOC,+BAAAA,IAAW,CAAK,IAAI,CAC7B,CASA,QAAA,CAAA,CAAmB,CACjB,MAAO,CAAA,EAAA,EAAK,IAAA,CAAK,qBAAA,CAAsB,CAAC,CAAA,CAAA;ACkVsB;AAnWV,SAAA","file":"/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/chunk-6MMUUJHX.js","sourcesContent":[null,"// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This error is used to explain why parsing failed.\n * @group Implementation\n * @category Serialization\n */\nexport class ParsingError<T> extends Error {\n /**\n * This provides a programmatic way to access why parsing failed. Downstream devs\n * might want to use this to build their own error messages if the default error\n * messages are not suitable for their use case. This should be an enum.\n * @group Implementation\n * @category Serialization\n */\n public invalidReason: T;\n\n /**\n * Creates an instance of the error with a specified message and invalid reason.\n *\n * @param message The error message that describes the issue.\n * @param invalidReason The reason why the input is considered invalid.\n * @group Implementation\n * @category Serialization\n */\n constructor(message: string, invalidReason: T) {\n super(message);\n this.invalidReason = invalidReason;\n }\n}\n\n/**\n * Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,\n * this type is returned from \"defensive\" functions like isValid.\n * @group Implementation\n * @category Serialization\n */\nexport type ParsingResult<T> = {\n /**\n * True if valid, false otherwise.\n * @group Implementation\n * @category Serialization\n */\n valid: boolean;\n\n /**\n * If valid is false, this will be a code explaining why parsing failed.\n * @group Implementation\n * @category Serialization\n */\n invalidReason?: T;\n\n /**\n * If valid is false, this will be a string explaining why parsing failed.\n * @group Implementation\n * @category Serialization\n */\n invalidReasonMessage?: string;\n};\n","// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { HexInput } from \"../types\";\n\n/**\n * Provides reasons for parsing failures related to hexadecimal values.\n * @group Implementation\n * @category Serialization\n */\nexport enum HexInvalidReason {\n TOO_SHORT = \"too_short\",\n INVALID_LENGTH = \"invalid_length\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n}\n\n/**\n * NOTE: Do not use this class when working with account addresses; use AccountAddress instead.\n * When accepting hex data as input to a function, prefer to accept HexInput and\n *\n * A helper class for working with hex data. Hex data, when represented as a string,\n * generally looks like this, for example: 0xaabbcc, 45cd32, etc.\n *\n * then use the static helper methods of this class to convert it into the desired\n * format. This enables the greatest flexibility for the developer.\n *\n * Example usage:\n * ```typescript\n * getTransactionByHash(txnHash: HexInput): Promise<Transaction> {\n * const txnHashString = Hex.fromHexInput(txnHash).toString();\n * return await getTransactionByHashInner(txnHashString);\n * }\n * ```\n * This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string\n * with a leading 0x prefix, regardless of what the input format was.\n *\n * Other ways to chain the functions together:\n * - `Hex.fromHexString({ hexInput: \"0x1f\" }).toUint8Array()`\n * - `new Hex([1, 3]).toStringWithoutPrefix()`\n * @group Implementation\n * @category Serialization\n */\nexport class Hex {\n private readonly data: Uint8Array;\n\n /**\n * Create a new Hex instance from a Uint8Array.\n *\n * @param data - The Uint8Array containing the data to initialize the Hex instance.\n * @group Implementation\n * @category Serialization\n */\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n // ===\n // Methods for representing an instance of Hex as other types.\n // ===\n\n /**\n * Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Get the hex data as a string without the 0x prefix.\n *\n * @returns Hex string without 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toStringWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Get the hex data as a string with the 0x prefix.\n *\n * @returns Hex string with 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n // ===\n // Methods for creating an instance of Hex from other types.\n // ===\n\n /**\n * Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.\n *\n * @param str - A hex string, with or without the 0x prefix.\n *\n * @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.\n *\n * @returns Hex - The resulting Hex instance created from the provided string.\n * @group Implementation\n * @category Serialization\n */\n static fromHexString(str: string): Hex {\n let input = str;\n\n if (input.startsWith(\"0x\")) {\n input = input.slice(2);\n }\n\n if (input.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.\",\n HexInvalidReason.TOO_SHORT,\n );\n }\n\n if (input.length % 2 !== 0) {\n throw new ParsingError(\"Hex string must be an even number of hex characters.\", HexInvalidReason.INVALID_LENGTH);\n }\n\n try {\n return new Hex(hexToBytes(input));\n } catch (error: any) {\n throw new ParsingError(\n `Hex string contains invalid hex characters: ${error?.message}`,\n HexInvalidReason.INVALID_HEX_CHARS,\n );\n }\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.\n * This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Hex instance created from the provided hexInput.\n * @group Implementation\n * @category Serialization\n */\n static fromHexInput(hexInput: HexInput): Hex {\n if (hexInput instanceof Uint8Array) return new Hex(hexInput);\n return Hex.fromHexString(hexInput);\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Uint8Array created from the provided hexInput.\n */\n static hexInputToUint8Array(hexInput: HexInput): Uint8Array {\n if (hexInput instanceof Uint8Array) return hexInput;\n return Hex.fromHexString(hexInput).toUint8Array();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string with '0x' prefix (e.g., \"0x1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToString(\"1234\") // returns \"0x1234\"\n * Hex.hexInputToString(\"0x1234\") // returns \"0x1234\"\n * Hex.hexInputToString(new Uint8Array([0x12, 0x34])) // returns \"0x1234\"\n * ```\n */\n static hexInputToString(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toString();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string without '0x' prefix (e.g., \"1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToStringWithoutPrefix(\"1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(\"0x1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(new Uint8Array([0x12, 0x34])) // returns \"1234\"\n * ```\n */\n static hexInputToStringWithoutPrefix(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toStringWithoutPrefix();\n }\n\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided string is a valid hexadecimal representation.\n *\n * @param str - A hex string representing byte data.\n *\n * @returns An object containing:\n * - valid: A boolean indicating whether the string is valid.\n * - invalidReason: The reason for invalidity if the string is not valid.\n * - invalidReasonMessage: A message explaining why the string is invalid.\n * @group Implementation\n * @category Serialization\n */\n static isValid(str: string): ParsingResult<HexInvalidReason> {\n try {\n Hex.fromHexString(str);\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 * Determine if two Hex instances are equal by comparing their underlying byte data.\n *\n * @param other The Hex instance to compare to.\n * @returns true if the Hex instances are equal, false if not.\n * @group Implementation\n * @category Serialization\n */\n equals(other: Hex): 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\nexport const hexToAsciiString = (hex: string) => new TextDecoder().decode(Hex.fromHexInput(hex).toUint8Array());\n","// 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 * Provides reasons for an address was invalid.\n * @group Implementation\n * @category Serialization\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 INVALID_PADDING_STRICTNESS = \"INVALID_PADDING_STRICTNESS\",\n}\n\n/**\n * The input for an account address, which can be either a hexadecimal string or a standard account address.\n * @group Implementation\n * @category Serialization\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 * @group Implementation\n * @category Serialization\n */\nexport class AccountAddress extends Serializable implements TransactionArgument {\n /**\n * This is the internal representation of an account address.\n * @group Implementation\n * @category Serialization\n */\n readonly data: Uint8Array;\n\n /**\n * The number of bytes that make up an account address.\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The length of an address string in LONG form without a leading 0x.\n * @group Implementation\n * @category Serialization\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 static A: AccountAddress = AccountAddress.from(\"0xA\");\n\n /**\n * Creates an instance of AccountAddress from a Uint8Array.\n *\n * This function ensures that the input data is exactly 32 bytes long, which is required for a valid account address.\n *\n * @param input A Uint8Array representing an account address.\n * @throws ParsingError if the input length is not equal to 32 bytes.\n * @group Implementation\n * @category Serialization\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 * Determines if the address is classified as special, which is defined as 0x0 to 0xf inclusive.\n * 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 otherwise.\n * @group Implementation\n * @category Serialization\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 // 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 * This representation returns special addresses in SHORT form (0xf)\n * and other addresses in LONG form (0x + 64 characters).\n *\n * @returns AccountAddress as a string conforming to AIP-40.\n * @group Implementation\n * @category Serialization\n */\n toString(): `0x${string}` {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n /**\n * Return the AccountAddress as a string conforming to AIP-40 but without the leading 0x.\n *\n * NOTE: Prefer to use `toString` where possible.\n *\n * @returns AccountAddress as a string without the leading 0x.\n * @group Implementation\n * @category Serialization\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 * Convert the account address to a string in LONG format, which is always 0x followed by 64 hex characters.\n *\n * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).\n *\n * @returns AccountAddress as a string in LONG form.\n * @group Implementation\n * @category Serialization\n */\n toStringLong(): `0x${string}` {\n return `0x${this.toStringLongWithoutPrefix()}`;\n }\n\n /**\n * Returns the account address as a string in LONG form without a leading 0x.\n * This function will include leading zeroes and will produce a string of 64 hex characters.\n *\n * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).\n *\n * @returns {string} The account address in LONG form.\n * @group Implementation\n * @category Serialization\n */\n toStringLongWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Convert the account address to a string in SHORT format, which is 0x followed by the shortest\n * possible representation (no leading zeros).\n *\n * @returns AccountAddress as a string in SHORT form.\n * @group Implementation\n * @category Serialization\n */\n toStringShort(): `0x${string}` {\n return `0x${this.toStringShortWithoutPrefix()}`;\n }\n\n /**\n * Returns a lossless short string representation of the address by trimming leading zeros.\n * If the address consists of all zeros, returns \"0\".\n *\n * @returns A string representation of the address without leading zeros\n * @group Implementation\n * @category Serialization\n */\n toStringShortWithoutPrefix(): string {\n const hex = bytesToHex(this.data).replace(/^0+/, \"\");\n return hex === \"\" ? \"0\" : hex;\n }\n\n /**\n * Get the inner data as a Uint8Array.\n * The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n * @group Implementation\n * @category Serialization\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 * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data);\n }\n\n /**\n * Serializes the current instance into a byte sequence suitable for entry functions.\n * This allows for the proper encoding of data when interacting with entry functions in the blockchain.\n *\n * @param serializer - The serializer instance used to convert the data into bytes.\n * @group Implementation\n * @category Serialization\n */\n serializeForEntryFunction(serializer: Serializer): void {\n const bcsBytes = this.bcsToBytes();\n serializer.serializeBytes(bcsBytes);\n }\n\n /**\n * Serializes the current instance for use in a script function by encoding it into a byte sequence.\n * This process involves serializing the variant index and the instance data, making it suitable for transmission.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Serialization\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 * This function allows you to convert a byte representation of an AccountAddress into an instance of AccountAddress.\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 * @group Implementation\n * @category Serialization\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 * @param input - A hex string representing an account address.\n *\n * @throws {ParsingError} If the hex string does not start with 0x or is not in a valid format.\n *\n * @remarks\n *\n * This function has strict parsing behavior. For relaxed behavior, please use the `fromString` function.\n *\n * @see AIP-40 documentation for more details on address formats:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @returns An instance of AccountAddress.\n * @group Implementation\n * @category Serialization\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`.\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. The address can have missing values up to `maxMissingChars` before it is padded.\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 * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.\n *\n * @returns An instance of AccountAddress.\n *\n * @throws ParsingError if the hex string is too short, too long, or contains invalid characters.\n * @group Implementation\n * @category Serialization\n */\n static fromString(input: string, { maxMissingChars = 4 }: { maxMissingChars?: number } = {}): 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 // Ensure that the maxMissingChars is between or equal to 0 and 63.\n if (maxMissingChars > 63 || maxMissingChars < 0) {\n throw new ParsingError(\n `maxMissingChars must be between or equal to 0 and 63. Received ${maxMissingChars}`,\n AddressInvalidReason.INVALID_PADDING_STRICTNESS,\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 const address = new AccountAddress(addressBytes);\n\n // Cannot pad the address if it has more than maxMissingChars missing.\n if (parsedInput.length < 64 - maxMissingChars) {\n if (!address.isSpecial()) {\n throw new ParsingError(\n `Hex string is too short, must be ${64 - maxMissingChars} to 64 chars long, excluding the leading 0x. You may need to fix \nthe addresss by padding it with 0s before passing it to \\`fromString\\` (e.g. <addressString>.padStart(64, '0')). \nReceived ${input}`,\n AddressInvalidReason.TOO_SHORT,\n );\n }\n }\n\n return address;\n }\n\n /**\n * Convenience method for creating an AccountAddress from various input types.\n * This function accepts a string, Uint8Array, or an existing AccountAddress instance and returns the corresponding\n * AccountAddress.\n *\n * @param input - The input to convert into an AccountAddress. This can be a string representation of an address, a Uint8Array,\n * or an existing AccountAddress.\n * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.\n * @group Implementation\n * @category Serialization\n */\n static from(input: AccountAddressInput, { maxMissingChars = 4 }: { maxMissingChars?: number } = {}): AccountAddress {\n if (typeof input === \"string\") {\n return AccountAddress.fromString(input, { maxMissingChars });\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return input;\n }\n\n /**\n * Create an AccountAddress from various input types, including strings, Uint8Array, and AccountAddress instances.\n *\n * @param input - The input to convert into an AccountAddress, which can be a string, a Uint8Array, or an AccountAddress.\n * @group Implementation\n * @category Serialization\n */\n static fromStrict(input: AccountAddressInput): AccountAddress {\n if (typeof input === \"string\") {\n return AccountAddress.fromStringStrict(input);\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return input;\n }\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided input is a valid AccountAddress.\n *\n * @param args - The arguments for validation.\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 An object indicating whether the address is valid. If valid, valid = true; if not, valid = false with additional details.\n * If the address is invalid, invalidReason will explain why it is invalid, and invalidReasonMessage will provide the error message.\n * @group Implementation\n * @category Serialization\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 * Determine if two AccountAddresses are equal based on their underlying byte data.\n *\n * @param other - The AccountAddress to compare to.\n * @returns true if the AccountAddresses are equal, false if not.\n * @group Implementation\n * @category Serialization\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"]}
@@ -1,193 +0,0 @@
1
- import { GetEventsResponse } from '../types/indexer.mjs';
2
- import { A as AptosConfig, d7 as MoveStructId, bM as AnyNumber, bO as PaginationArgs, bR as OrderByArg, m as AccountAddressInput, bS as WhereArg } from '../account--Q9z_xMN.mjs';
3
- import { EventsBoolExp } from '../types/generated/types.mjs';
4
- import '../types/generated/operations.mjs';
5
- import '../utils/apiEndpoints.mjs';
6
- import '../utils/const.mjs';
7
- import '../core/common.mjs';
8
-
9
- /**
10
- * A class to query all `Event` Aptos related queries.
11
- * @group Event
12
- */
13
- declare class Event {
14
- readonly config: AptosConfig;
15
- /**
16
- * Initializes a new instance of the Aptos client with the provided configuration.
17
- *
18
- * @param config - The configuration settings for the Aptos client.
19
- * @param config.network - The network to connect to (e.g., Testnet, Mainnet).
20
- * @param config.nodeUrl - The URL of the Aptos node to connect to.
21
- * @param config.faucetUrl - The URL of the faucet to use for funding accounts.
22
- *
23
- * @example
24
- * ```typescript
25
- * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
26
- *
27
- * async function runExample() {
28
- * // Create a new Aptos client with Testnet configuration
29
- * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own network if needed
30
- * const aptos = new Aptos(config);
31
- *
32
- * console.log("Aptos client initialized:", aptos);
33
- * }
34
- * runExample().catch(console.error);
35
- * ```
36
- * @group Event
37
- */
38
- constructor(config: AptosConfig);
39
- /**
40
- * Retrieve module events based on a specified event type.
41
- * This function allows you to query for events that are associated with a particular module event type in the Aptos blockchain.
42
- *
43
- * @param args - The arguments for retrieving module events.
44
- * @param args.eventType - The event type to filter the results.
45
- * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
46
- * @param args.options - Optional pagination and ordering parameters for the event results.
47
- *
48
- * @returns Promise<GetEventsResponse> - A promise that resolves to the retrieved events.
49
- *
50
- * @example
51
- * ```typescript
52
- * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
53
- *
54
- * const config = new AptosConfig({ network: Network.TESTNET });
55
- * const aptos = new Aptos(config);
56
- *
57
- * async function runExample() {
58
- * // Retrieve module events for a specific event type
59
- * const events = await aptos.getModuleEventsByEventType({
60
- * eventType: "0x1::transaction_fee::FeeStatement", // specify the event type
61
- * minimumLedgerVersion: 1, // optional: specify minimum ledger version if needed
62
- * });
63
- *
64
- * console.log(events); // log the retrieved events
65
- * }
66
- * runExample().catch(console.error);
67
- * ```
68
- * @group Event
69
- */
70
- getModuleEventsByEventType(args: {
71
- eventType: MoveStructId;
72
- minimumLedgerVersion?: AnyNumber;
73
- options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
74
- }): Promise<GetEventsResponse>;
75
- /**
76
- * Retrieve events associated with a specific account address and creation number.
77
- *
78
- * @param args - The parameters for retrieving account events.
79
- * @param args.accountAddress - The account address to query events for.
80
- * @param args.creationNumber - The event creation number to filter the events.
81
- * @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.
82
- *
83
- * @returns Promise<GetEventsResponse>
84
- *
85
- * @example
86
- * ```typescript
87
- * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
88
- *
89
- * const config = new AptosConfig({ network: Network.TESTNET });
90
- * const aptos = new Aptos(config);
91
- *
92
- * async function runExample() {
93
- * // Get events for the account at creation number 0
94
- * const events = await aptos.getAccountEventsByCreationNumber({
95
- * accountAddress: "0x1", // replace with a real account address
96
- * creationNumber: 0,
97
- * });
98
- *
99
- * console.log(events);
100
- * }
101
- * runExample().catch(console.error);
102
- * ```
103
- * @group Event
104
- */
105
- getAccountEventsByCreationNumber(args: {
106
- accountAddress: AccountAddressInput;
107
- creationNumber: AnyNumber;
108
- minimumLedgerVersion?: AnyNumber;
109
- }): Promise<GetEventsResponse>;
110
- /**
111
- * Retrieve events associated with a specific account address and event type.
112
- *
113
- * @param args.accountAddress - The account address to query events for.
114
- * @param args.eventType - The type of event to filter by.
115
- * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
116
- * @param args.options - Optional pagination and ordering parameters for the event query.
117
- *
118
- * @returns Promise<GetEventsResponse>
119
- *
120
- * @example
121
- * ```typescript
122
- * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
123
- *
124
- * const config = new AptosConfig({ network: Network.TESTNET });
125
- * const aptos = new Aptos(config);
126
- *
127
- * async function runExample() {
128
- * // Get events for a specific account and event type
129
- * const events = await aptos.getAccountEventsByEventType({
130
- * accountAddress: "0x1", // replace with a real account address
131
- * eventType: "0x1::transaction_fee::FeeStatement", // replace with a real event type
132
- * minimumLedgerVersion: 1, // optional, specify if needed
133
- * });
134
- *
135
- * console.log(events);
136
- * }
137
- * runExample().catch(console.error);
138
- * ```
139
- * @group Event
140
- */
141
- getAccountEventsByEventType(args: {
142
- accountAddress: AccountAddressInput;
143
- eventType: MoveStructId;
144
- minimumLedgerVersion?: AnyNumber;
145
- options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
146
- }): Promise<GetEventsResponse>;
147
- /**
148
- * Retrieve all events from the Aptos blockchain.
149
- * An optional `where` clause can be provided to filter the results based on specific criteria.
150
- *
151
- * @param args Optional parameters for the query.
152
- * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
153
- * @param args.options Optional pagination and filtering options.
154
- * @param args.options.where Optional condition to filter events.
155
- * @param args.options.offset Optional pagination offset.
156
- * @param args.options.limit Optional maximum number of events to return.
157
- * @param args.options.orderBy Optional ordering of the results.
158
- *
159
- * @returns GetEventsQuery response type containing the events.
160
- *
161
- * @example
162
- * ```typescript
163
- * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
164
- *
165
- * const config = new AptosConfig({ network: Network.TESTNET });
166
- * const aptos = new Aptos(config);
167
- *
168
- * async function runExample() {
169
- * // Retrieve all events
170
- * const events = await aptos.getEvents();
171
- *
172
- * // Retrieve events with filtering by account address
173
- * const whereCondition = {
174
- * account_address: { _eq: "0x123" }, // replace with a real account address
175
- * };
176
- * const filteredEvents = await aptos.getEvents({
177
- * options: { where: whereCondition },
178
- * });
179
- *
180
- * console.log(events);
181
- * console.log(filteredEvents);
182
- * }
183
- * runExample().catch(console.error);
184
- * ```
185
- * @group Event
186
- */
187
- getEvents(args?: {
188
- minimumLedgerVersion?: AnyNumber;
189
- options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>;
190
- }): Promise<GetEventsResponse>;
191
- }
192
-
193
- export { Event };
@@ -1,2 +0,0 @@
1
- import{ld as a}from"../chunk-I4NMWLUZ.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-RFQFTIOA.mjs";import"../chunk-XIQFX5FV.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-OYH2T6V5.mjs";import"../chunk-PRUQZNAP.mjs";import"../chunk-EPMBZCYJ.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-OYUW6ZN2.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-FBCXUC7J.mjs";import"../chunk-FWGLACJS.mjs";import"../chunk-QGFWOGAV.mjs";import"../chunk-DPW6ELCQ.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-BYINW7I2.mjs";import"../chunk-Z6KQX6VX.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-KJH4KKG6.mjs";import"../chunk-6PKBXYG3.mjs";import"../chunk-AQQEQB35.mjs";import"../chunk-QQEK2GJC.mjs";import"../chunk-GRB6YSIT.mjs";import"../chunk-DW6WLD2B.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-THUSLDD6.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-Y7ZQTLH4.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-NII5Q32W.mjs";import"../chunk-PQS3II2E.mjs";import"../chunk-E6IUB35J.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-HPQMAP7O.mjs";import"../chunk-6Y6ZO7TS.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-6MWXV62C.mjs";import"../chunk-C6JRJNK3.mjs";import"../chunk-IXYGZ57N.mjs";import"../chunk-WLUXOUZH.mjs";import"../chunk-UCBUUH5M.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-JCFTAG5Z.mjs";import"../chunk-YFFDF22R.mjs";import"../chunk-BUUV6B4P.mjs";import"../chunk-GYVSI3TS.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-NJN3EAOM.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-4R4AI5RT.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Event};
2
- //# sourceMappingURL=event.mjs.map
@@ -1,2 +0,0 @@
1
- import{spawn as p}from"child_process";import{platform as g}from"os";var u=class{async init(t){let{network:o,profile:e,extraArguments:r,showStdout:a}=t,s=["aptos","init",`--network=${o??"local"}`,`--profile=${e??"default"}`];return r&&s.push(...r),this.runCommand(s,a)}async compile(t){let{packageDirectoryPath:o,namedAddresses:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","compile","--package-dir",o],n=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(n)),r&&s.push(...r),this.runCommand(s,a)}async test(t){let{packageDirectoryPath:o,namedAddresses:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","test","--package-dir",o],n=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(n)),r&&s.push(...r),this.runCommand(s,a)}async publish(t){let{packageDirectoryPath:o,namedAddresses:e,profile:r,extraArguments:a,showStdout:s}=t,n=["aptos","move","publish","--package-dir",o,`--profile=${r??"default"}`],d=this.parseNamedAddresses(e);return n.push(...this.prepareNamedAddresses(d)),a&&n.push(...a),this.runCommand(n,s)}async createObjectAndPublishPackage(t){let{packageDirectoryPath:o,addressName:e,namedAddresses:r,profile:a,extraArguments:s,showStdout:n}=t,d=["aptos","move","create-object-and-publish-package","--package-dir",o,"--address-name",e,`--profile=${a??"default"}`],i=this.parseNamedAddresses(r);d.push(...this.prepareNamedAddresses(i)),s&&d.push(...s);let{output:c}=await this.runCommand(d,n);return{objectAddress:this.extractAddressFromOutput(c)}}async upgradeObjectPackage(t){let{packageDirectoryPath:o,objectAddress:e,namedAddresses:r,profile:a,extraArguments:s,showStdout:n}=t,d=["aptos","move","upgrade-object-package","--package-dir",o,"--object-address",e,`--profile=${a??"default"}`],i=this.parseNamedAddresses(r);return d.push(...this.prepareNamedAddresses(i)),s&&d.push(...s),this.runCommand(d,n)}async buildPublishPayload(t){let{outputFile:o,packageDirectoryPath:e,namedAddresses:r,extraArguments:a,showStdout:s}=t,n=["aptos","move","build-publish-payload","--json-output-file",o,"--package-dir",e],d=this.parseNamedAddresses(r);return n.push(...this.prepareNamedAddresses(d)),a&&n.push(...a),this.runCommand(n,s)}async runScript(t){let{compiledScriptPath:o,profile:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","run-script","--compiled-script-path",o,`--profile=${e??"default"}`];return r&&s.push(...r),this.runCommand(s,a)}async gasProfile(t){let{network:o,transactionId:e,extraArguments:r,showStdout:a}=t,s=["aptos","move","replay","--profile-gas","--network",o,"--txn-id",e];return r&&s.push(...r),this.runCommand(s,a)}async runCommand(t,o=!0){return new Promise((e,r)=>{let a=g(),s,n="",d="";a==="win32"?s=p("npx",t,{shell:!0}):s=p("npx",t),s.stdout.on("data",i=>{d=i.toString(),n+=i.toString()}),o&&(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),process.stdin.pipe(s.stdin),s.on("close",i=>{if(i===0)try{let c=JSON.parse(d);c.Error?r(new Error(`Error: ${c.Error}`)):c.Result&&e({result:c.Result,output:n})}catch{e({output:n})}else r(new Error(`Child process exited with code ${i}`))})})}prepareNamedAddresses(t){let o=t.size,e=[];if(o===0)return e;e.push("--named-addresses");let r=[];return t.forEach((a,s)=>{let n=`${s}=${a.toString()}`;r.push(n)}),e.push(r.join(",")),e}parseNamedAddresses(t){let o=new Map;return Object.keys(t).forEach(e=>{let r=t[e];o.set(e,r)}),o}extractAddressFromOutput(t){let o=t.match("Code was successfully deployed to object address (0x[0-9a-fA-F]+)");if(o)return o[1];throw new Error("Failed to extract object address from output")}};export{u as a};
2
- //# sourceMappingURL=chunk-35DKMW7Q.mjs.map
@@ -1,2 +0,0 @@
1
- var o="3.1.2";export{o as a};
2
- //# sourceMappingURL=chunk-4R4AI5RT.mjs.map
@@ -1,2 +0,0 @@
1
- var s={mainnet:"https://api.mainnet.aptoslabs.com/v1/graphql",testnet:"https://api.testnet.aptoslabs.com/v1/graphql",devnet:"https://api.devnet.aptoslabs.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},o={mainnet:"https://api.mainnet.aptoslabs.com/v1",testnet:"https://api.testnet.aptoslabs.com/v1",devnet:"https://api.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},p={devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},a={mainnet:"https://api.mainnet.aptoslabs.com/keyless/pepper/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/pepper/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/pepper/v0",local:"https://api.devnet.aptoslabs.com/keyless/pepper/v0"},n={mainnet:"https://api.mainnet.aptoslabs.com/keyless/prover/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/prover/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/prover/v0",local:"https://api.devnet.aptoslabs.com/keyless/prover/v0"},e=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.DEVNET="devnet",t.LOCAL="local",t.CUSTOM="custom",t))(e||{}),r={mainnet:1,testnet:2,local:4},l={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",local:"local",custom:"custom"};export{s as a,o as b,p as c,a as d,n as e,e as f,r as g,l as h};
2
- //# sourceMappingURL=chunk-4RXKALLC.mjs.map
@@ -1,2 +0,0 @@
1
- var t=255,n=65535,U=4294967295,_=18446744073709551615n,o=340282366920938463463374607431768211455n,i=115792089237316195423570985008687907853269984665640564039457584007913129639935n;export{t as a,n as b,U as c,_ as d,o as e,i as f};
2
- //# sourceMappingURL=chunk-56CNRT2K.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as c,b as o,c as d,d as z,e as m,f as U,g as y}from"./chunk-C6JRJNK3.mjs";import{a as b}from"./chunk-UCBUUH5M.mjs";import{a as s}from"./chunk-NJN3EAOM.mjs";import{b as u}from"./chunk-STY74NUA.mjs";var t=class i extends s{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof o)){new p(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&e.length===0)r=[];else if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let n=u.fromHexInput(e);r=Array.from(n.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new i(r.map(n=>new o(n)))}static U16(e){return new i(e.map(r=>new d(r)))}static U32(e){return new i(e.map(r=>new z(r)))}static U64(e){return new i(e.map(r=>new m(r)))}static U128(e){return new i(e.map(r=>new U(r)))}static U256(e){return new i(e.map(r=>new y(r)))}static Bool(e){return new i(e.map(r=>new c(r)))}static MoveString(e){return new i(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let n=e.deserializeUleb128AsU32(),l=new Array;for(let w=0;w<n;w+=1)l.push(r.deserialize(e));return new i(l)}},p=class i extends s{constructor(e){super(),this.value=u.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new i(e.deserializeBytes())}toMoveVector(e){let r=new b(this.bcsToBytes());r.deserializeUleb128AsU32();let n=r.deserializeVector(e);return new t(n)}},a=class i extends s{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let n=new TextEncoder().encode(this.value);t.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new i(e.deserializeStr())}},A=class i extends s{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new i(e!=null?new o(e):void 0)}static U16(e){return new i(e!=null?new d(e):void 0)}static U32(e){return new i(e!=null?new z(e):void 0)}static U64(e){return new i(e!=null?new m(e):void 0)}static U128(e){return new i(e!=null?new U(e):void 0)}static U256(e){return new i(e!=null?new y(e):void 0)}static Bool(e){return new i(e!=null?new c(e):void 0)}static MoveString(e){return new i(e!=null?new a(e):void 0)}static deserialize(e,r){let n=t.deserialize(e,r);return new i(n.values[0])}};export{t as a,p as b,a as c,A as d};
2
- //# sourceMappingURL=chunk-6MWXV62C.mjs.map
@@ -1,2 +0,0 @@
1
- import{b as c}from"./chunk-GYVSI3TS.mjs";import{a as o}from"./chunk-NJN3EAOM.mjs";import{b as n}from"./chunk-STY74NUA.mjs";import{sha3_256 as d}from"@noble/hashes/sha3";var r=class r extends o{constructor(t){super();let{data:e}=t,i=n.fromHexInput(e);if(i.toUint8Array().length!==r.LENGTH)throw new Error(`Authentication Key length should be ${r.LENGTH}`);this.data=i}serialize(t){t.serializeFixedBytes(this.data.toUint8Array())}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r({data:e})}toUint8Array(){return this.data.toUint8Array()}static fromSchemeAndBytes(t){let{scheme:e,input:i}=t,u=n.fromHexInput(i).toUint8Array(),h=new Uint8Array([...u,e]),a=d.create();a.update(h);let y=a.digest();return new r({data:y})}static fromPublicKeyAndScheme(t){let{publicKey:e}=t;return e.authKey()}static fromPublicKey(t){let{publicKey:e}=t;return e.authKey()}derivedAddress(){return new c(this.data.toUint8Array())}};r.LENGTH=32;var s=r;export{s as a};
2
- //# sourceMappingURL=chunk-6PKBXYG3.mjs.map
@@ -1,7 +0,0 @@
1
- import{b as a}from"./chunk-YFFDF22R.mjs";var l=(t=>(t[t.API_ERROR=0]="API_ERROR",t[t.EXTERNAL_API_ERROR=1]="EXTERNAL_API_ERROR",t[t.SESSION_EXPIRED=2]="SESSION_EXPIRED",t[t.INVALID_STATE=3]="INVALID_STATE",t[t.INVALID_SIGNATURE=4]="INVALID_SIGNATURE",t[t.UNKNOWN=5]="UNKNOWN",t))(l||{}),O=(s=>(s.REAUTHENTICATE="Re-authentiate to continue using your keyless account",s.REAUTHENTICATE_UNSURE="Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support",s.UPDATE_REQUEST_PARAMS="Update the invalid request parameters and reauthenticate.",s.RATE_LIMIT_EXCEEDED="Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.",s.SERVER_ERROR="Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.CALL_PRECHECK="Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.",s.REINSTANTIATE="Try instantiating the account again. Avoid manipulating the account object directly",s.JOIN_SUPPORT_GROUP="For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.UNKNOWN="Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s))(O||{}),u=(e=>(e[e.EPHEMERAL_KEY_PAIR_EXPIRED=0]="EPHEMERAL_KEY_PAIR_EXPIRED",e[e.PROOF_NOT_FOUND=1]="PROOF_NOT_FOUND",e[e.ASYNC_PROOF_FETCH_FAILED=2]="ASYNC_PROOF_FETCH_FAILED",e[e.INVALID_PROOF_VERIFICATION_FAILED=3]="INVALID_PROOF_VERIFICATION_FAILED",e[e.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND=4]="INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND",e[e.INVALID_JWT_SIG=5]="INVALID_JWT_SIG",e[e.INVALID_JWT_JWK_NOT_FOUND=6]="INVALID_JWT_JWK_NOT_FOUND",e[e.INVALID_JWT_ISS_NOT_RECOGNIZED=7]="INVALID_JWT_ISS_NOT_RECOGNIZED",e[e.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED=8]="INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED",e[e.INVALID_TW_SIG_VERIFICATION_FAILED=9]="INVALID_TW_SIG_VERIFICATION_FAILED",e[e.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND=10]="INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND",e[e.INVALID_EXPIRY_HORIZON=11]="INVALID_EXPIRY_HORIZON",e[e.JWT_PARSING_ERROR=12]="JWT_PARSING_ERROR",e[e.JWK_FETCH_FAILED=13]="JWK_FETCH_FAILED",e[e.JWK_FETCH_FAILED_FEDERATED=14]="JWK_FETCH_FAILED_FEDERATED",e[e.RATE_LIMIT_EXCEEDED=15]="RATE_LIMIT_EXCEEDED",e[e.PEPPER_SERVICE_INTERNAL_ERROR=16]="PEPPER_SERVICE_INTERNAL_ERROR",e[e.PEPPER_SERVICE_BAD_REQUEST=17]="PEPPER_SERVICE_BAD_REQUEST",e[e.PEPPER_SERVICE_OTHER=18]="PEPPER_SERVICE_OTHER",e[e.PROVER_SERVICE_INTERNAL_ERROR=19]="PROVER_SERVICE_INTERNAL_ERROR",e[e.PROVER_SERVICE_BAD_REQUEST=20]="PROVER_SERVICE_BAD_REQUEST",e[e.PROVER_SERVICE_OTHER=21]="PROVER_SERVICE_OTHER",e[e.FULL_NODE_CONFIG_LOOKUP_ERROR=22]="FULL_NODE_CONFIG_LOOKUP_ERROR",e[e.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR=23]="FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR",e[e.FULL_NODE_JWKS_LOOKUP_ERROR=24]="FULL_NODE_JWKS_LOOKUP_ERROR",e[e.FULL_NODE_OTHER=25]="FULL_NODE_OTHER",e[e.SIGNATURE_TYPE_INVALID=26]="SIGNATURE_TYPE_INVALID",e[e.SIGNATURE_EXPIRED=27]="SIGNATURE_EXPIRED",e[e.MAX_EXPIRY_HORIZON_EXCEEDED=28]="MAX_EXPIRY_HORIZON_EXCEEDED",e[e.EPHEMERAL_SIGNATURE_VERIFICATION_FAILED=29]="EPHEMERAL_SIGNATURE_VERIFICATION_FAILED",e[e.TRAINING_WHEELS_SIGNATURE_MISSING=30]="TRAINING_WHEELS_SIGNATURE_MISSING",e[e.TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED=31]="TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED",e[e.PROOF_VERIFICATION_FAILED=32]="PROOF_VERIFICATION_FAILED",e[e.UNKNOWN=33]="UNKNOWN",e))(u||{}),A={0:["The ephemeral keypair has expired.",2,"Re-authentiate to continue using your keyless account"],1:["The required proof could not be found.",3,"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing."],2:["The required proof failed to fetch.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],3:["The provided proof is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],4:["The verification key used to authenticate was updated.",2,"Re-authentiate to continue using your keyless account"],5:["The JWK was found, but JWT failed verification",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],6:["The JWK required to verify the JWT could not be found. The JWK may have been rotated out.",2,"Re-authentiate to continue using your keyless account"],7:["The JWT issuer is not recognized.",3,"Update the invalid request parameters and reauthenticate."],8:["The JWT issuer is not supported by the Federated Keyless ",0,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],9:["The training wheels signature is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],10:["The public key used to verify the training wheels signature was not found.",2,"Re-authentiate to continue using your keyless account"],11:["The expiry horizon is invalid.",2,"Re-authentiate to continue using your keyless account"],13:["Failed to fetch JWKS.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],14:["Failed to fetch JWKS for Federated Keyless provider.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],15:["Rate limit exceeded. Too many requests in a short period.",0,"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest."],16:["Internal error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],17:["Bad request sent to Pepper service.",0,"Update the invalid request parameters and reauthenticate."],18:["Unknown error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],19:["Internal error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],20:["Bad request sent to Prover service.",0,"Update the invalid request parameters and reauthenticate."],21:["Unknown error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],12:["Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support",3,"Try instantiating the account again. Avoid manipulating the account object directly"],22:["Error when looking up on-chain keyless configuration.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],23:["Error when looking up on-chain verification key.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],24:["Error when looking up on-chain JWKS.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],25:["Unknown error from full node.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],26:["The signature is not a valid Keyless signature.",4,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],27:["The ephemeral key pair used to sign the message has expired.",4,"Re-authentiate to continue using your keyless account"],28:["The expiry horizon on the signature exceeds the maximum allowed value.",4,"Re-authentiate to continue using your keyless account"],29:["Failed to verify the ephemeral signature with the ephemeral public key.",4,"Re-authentiate to continue using your keyless account"],30:["The training wheels signature is missing but is required by the Keyless configuration.",4,"Re-authentiate to continue using your keyless account"],31:["Failed to verify the training wheels signature with the training wheels public key.",4,"Re-authentiate to continue using your keyless account"],32:["The proof verification failed.",4,"Re-authentiate to continue using your keyless account"],33:["An unknown error has occurred.",5,"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"]},N=class _ extends Error{constructor(o){let{innerError:r,category:E,resolutionTip:i,type:R,message:t=A[R][0],details:I}=o;super(t),this.name="KeylessError",this.innerError=r,this.category=E,this.resolutionTip=i,this.type=R,this.details=I,this.message=_.constructMessage(t,i,r,I)}static constructMessage(o,r,E,i){let R=`
2
- Message: ${o}`;return i&&(R+=`
3
- Details: ${i}`),E instanceof T?R+=`
4
- AptosApiError: ${E.message}`:E!==void 0&&(R+=`
5
- Error: ${a(E)}`),R+=`
6
- KeylessErrorResolutionTip: ${r}`,R}static fromErrorType(o){let{error:r,type:E,details:i}=o,[R,t,I]=A[E];return new _({message:R,details:i,innerError:r,category:t,resolutionTip:I,type:E})}},T=class extends Error{constructor({apiType:o,aptosRequest:r,aptosResponse:E}){super(S({apiType:o,aptosRequest:r,aptosResponse:E})),this.name="AptosApiError",this.url=E.url,this.status=E.status,this.statusText=E.statusText,this.data=E.data,this.request=r}};function S({apiType:_,aptosRequest:o,aptosResponse:r}){let E=r.headers?.traceparent?.split("-")[1],i=E?`(trace_id:${E}) `:"",R=`Request to [${_}]: ${o.method} ${r.url??o.url} ${i}failed with`;return _==="Indexer"&&r.data?.errors?.[0]?.message!=null?`${R}: ${r.data.errors[0].message}`:r.data?.message!=null&&r.data?.error_code!=null?`${R}: ${JSON.stringify(r.data)}`:`${R} status: ${r.statusText}(code:${r.status}) and response body: ${P(r.data)}`}var n=400;function P(_){let o=JSON.stringify(_);return o.length<=n?o:`truncated(original_size:${o.length}): ${o.slice(0,n/2)}...${o.slice(-n/2)}`}export{l as a,O as b,u as c,N as d,T as e};
7
- //# sourceMappingURL=chunk-6Y6ZO7TS.mjs.map
@@ -1,2 +0,0 @@
1
- var i=class{constructor(){this.queue=[];this.pendingDequeue=[];this.cancelled=!1}enqueue(e){if(this.cancelled=!1,this.pendingDequeue.length>0){this.pendingDequeue.shift()?.resolve(e);return}this.queue.push(e)}async dequeue(){return this.queue.length>0?Promise.resolve(this.queue.shift()):new Promise((e,u)=>{this.pendingDequeue.push({resolve:e,reject:u})})}isEmpty(){return this.queue.length===0}cancel(){this.cancelled=!0,this.pendingDequeue.forEach(async({reject:e})=>{e(new n("Task cancelled"))}),this.pendingDequeue=[],this.queue.length=0}isCancelled(){return this.cancelled}pendingDequeueLength(){return this.pendingDequeue.length}},n=class extends Error{};export{i as a,n as b};
2
- //# sourceMappingURL=chunk-A5L76YP7.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as o,b as r,c as s}from"./chunk-QQEK2GJC.mjs";import{a as t}from"./chunk-GRB6YSIT.mjs";var a=class{constructor(e){this.config=e}async getTableItem(e){return o({aptosConfig:this.config,...e})}async getTableItemsData(e){return await t({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),r({aptosConfig:this.config,...e})}async getTableItemsMetadata(e){return await t({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),s({aptosConfig:this.config,...e})}};export{a};
2
- //# sourceMappingURL=chunk-AQQEQB35.mjs.map
@@ -1,2 +0,0 @@
1
- import{b as c}from"./chunk-GYVSI3TS.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
2
- //# sourceMappingURL=chunk-BUUV6B4P.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as i}from"./chunk-NJN3EAOM.mjs";import{b as e}from"./chunk-STY74NUA.mjs";var r=class extends i{async verifySignatureAsync(t){return this.verifySignature(t)}toUint8Array(){return this.bcsToBytes()}toString(){let t=this.toUint8Array();return e.fromHexInput(t).toString()}},n=class extends r{};export{r as a,n as b};
2
- //# sourceMappingURL=chunk-BYINW7I2.mjs.map
@@ -1,2 +0,0 @@
1
- import{hmac as c}from"@noble/hashes/hmac";import{sha512 as p}from"@noble/hashes/sha512";import*as i from"@scure/bip39";var d=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,m=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,y=(t=>(t.ED25519="ed25519 seed",t))(y||{}),u=2147483648;function D(e){return m.test(e)}function E(e){return d.test(e)}var A=(e,t)=>{let r=c.create(p,e).update(t).digest();return{key:r.slice(0,32),chainCode:r.slice(32)}},f=({key:e,chainCode:t},r)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,r);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...e,...o]);return A(t,a)},x=e=>e.replace(/'/g,""),U=e=>e.split("/").slice(1).map(x),h=e=>{let t=e.trim().split(/\s+/).map(r=>r.toLowerCase()).join(" ");return i.mnemonicToSeedSync(t)};export{d as a,m as b,y as c,u as d,D as e,E as f,A as g,f as h,U as i,h as j};
2
- //# sourceMappingURL=chunk-C3Q23D22.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as s,c as d,e as t}from"./chunk-NJN3EAOM.mjs";import{a as l,b as n,c as o,d as z,e as c,f as u}from"./chunk-56CNRT2K.mjs";var U=class i extends s{constructor(e){super(),d(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)}deserialize(e){return new a(e.deserializeU256())}static deserialize(e){return new i(e.deserializeBool())}},p=class i extends s{constructor(e){super(),t(e,0,l),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())}},b=class i extends s{constructor(e){super(),t(e,0,n),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())}},y=class i extends s{constructor(e){super(),t(e,0,o),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())}},m=class i extends s{constructor(e){super(),t(e,BigInt(0),z),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())}},B=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())}},a=class i extends s{constructor(e){super(),t(e,BigInt(0),u),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{U as a,p as b,b as c,y as d,m as e,B as f,a as g};
2
- //# sourceMappingURL=chunk-C6JRJNK3.mjs.map
@@ -1,2 +0,0 @@
1
- import{b as t}from"./chunk-STY74NUA.mjs";var o=n=>typeof n=="string"?t.isValid(n).valid?n:new TextEncoder().encode(n):n;export{o as a};
2
- //# sourceMappingURL=chunk-DPW6ELCQ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/utils.ts"],"sourcesContent":["import { HexInput } from \"../../types\";\nimport { Hex } from \"../hex\";\n\n/**\n * Helper function to convert a message to sign or to verify to a valid message input\n *\n * @param message a message as a string or Uint8Array\n *\n * @returns a valid HexInput - string or Uint8Array\n * @group Implementation\n * @category Serialization\n */\nexport const convertSigningMessage = (message: HexInput): HexInput => {\n // if message is of type string, verify it is a valid Hex string\n if (typeof message === \"string\") {\n const isValid = Hex.isValid(message);\n // If message is not a valid Hex string, convert it\n if (!isValid.valid) {\n return new TextEncoder().encode(message);\n }\n // If message is a valid Hex string, return it\n return message;\n }\n // message is a Uint8Array\n return message;\n};\n"],"mappings":"yCAYO,IAAMA,EAAyBC,GAEhC,OAAOA,GAAY,SACLC,EAAI,QAAQD,CAAO,EAEtB,MAINA,EAHE,IAAI,YAAY,EAAE,OAAOA,CAAO,EAMpCA","names":["convertSigningMessage","message","Hex"]}
@@ -1,2 +0,0 @@
1
- import{a as k}from"./chunk-YOZBVVKL.mjs";import{e as x,f as B}from"./chunk-THUSLDD6.mjs";import{b as f,d as A}from"./chunk-NII5Q32W.mjs";import{e as b}from"./chunk-6Y6ZO7TS.mjs";import{d as C}from"./chunk-JCFTAG5Z.mjs";import{a as d}from"./chunk-YFFDF22R.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
2
- //# sourceMappingURL=chunk-DW6WLD2B.mjs.map
@@ -1,2 +0,0 @@
1
- import{e as r}from"./chunk-6Y6ZO7TS.mjs";import{a as d}from"./chunk-4R4AI5RT.mjs";async function A(s,u){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:R}=s,p={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${d}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":R};return e?.AUTH_TOKEN&&(p.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(p.Authorization=`Bearer ${e?.API_KEY}`),u.provider({url:t,method:n,body:i,params:o,headers:p,overrides:e})}async function P(s,u,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},u.client),e={status:o.status,statusText:o.statusText??"No status text provided",data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let R=e.data;if(R.errors)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});e.data=R.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new r({apiType:t,aptosRequest:s,aptosResponse:e})}export{A as a,P as b};
2
- //# sourceMappingURL=chunk-E6IUB35J.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as p}from"./chunk-DPW6ELCQ.mjs";import{e as d,j as S}from"./chunk-C3Q23D22.mjs";import{a as u}from"./chunk-ROT6S6BM.mjs";import{a as f}from"./chunk-BYINW7I2.mjs";import{a as h}from"./chunk-Z6KQX6VX.mjs";import{a as g}from"./chunk-NJN3EAOM.mjs";import{b as s}from"./chunk-STY74NUA.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as y}from"@noble/curves/secp256k1";import{HDKey as A}from"@scure/bip32";var i=class i extends f{constructor(e){super();let t=s.fromHexInput(e),{length:r}=t.toUint8Array();if(r===i.LENGTH)this.key=t;else if(r===i.COMPRESSED_LENGTH){let o=y.ProjectivePoint.fromHex(t.toUint8Array());this.key=s.fromHexInput(o.toRawBytes(!1))}else throw new Error(`PublicKey length should be ${i.LENGTH} or ${i.COMPRESSED_LENGTH}, received ${r}`)}verifySignature(e){let{message:t,signature:r}=e,o=p(t),c=s.fromHexInput(o).toUint8Array(),P=H(c),x=r.toUint8Array();return y.verify(x,P,this.key.toUint8Array(),{lowS:!0})}async verifySignatureAsync(e){return this.verifySignature(e)}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}deserialize(e){let t=e.deserializeBytes();return new l(t)}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}static isInstance(e){return"key"in e&&e.key?.data?.length===i.LENGTH}};i.LENGTH=65,i.COMPRESSED_LENGTH=33;var m=i,n=class n extends g{constructor(e,t){super();let r=u.parseHexInput(e,"secp256k1",t);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PrivateKey length should be ${n.LENGTH}`);this.key=r}static generate(){let e=y.utils.randomPrivateKey();return new n(e,!1)}static fromDerivationPath(e,t){if(!d(e))throw new Error(`Invalid derivation path ${e}`);return n.fromDerivationPathInner(e,S(t))}static fromDerivationPathInner(e,t){let{privateKey:r}=A.fromMasterSeed(t).derive(e);if(r===null)throw new Error("Invalid key");return new n(r,!1)}sign(e){let t=p(e),r=s.fromHexInput(t),o=H(r.toUint8Array()),c=y.sign(o,this.key.toUint8Array(),{lowS:!0});return new l(c.toCompactRawBytes())}publicKey(){let e=y.getPublicKey(this.key.toUint8Array(),!1);return new m(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.toAIP80String()}toHexString(){return this.key.toString()}toAIP80String(){return u.formatPrivateKey(this.key.toString(),"secp256k1")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t,!1)}static isPrivateKey(e){return e instanceof n}};n.LENGTH=32;var v=n,a=class a extends h{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new a(t)}};a.LENGTH=64;var l=a;export{m as a,v as b,l as c};
2
- //# sourceMappingURL=chunk-EPMBZCYJ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/secp256k1.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { sha3_256 } from \"@noble/hashes/sha3\";\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { HDKey } from \"@scure/bip32\";\nimport { Serializable, Deserializer, Serializer } from \"../../bcs\";\nimport { Hex } from \"../hex\";\nimport { HexInput, PrivateKeyVariants } from \"../../types\";\nimport { isValidBIP44Path, mnemonicToSeed } from \"./hdKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { PublicKey } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { convertSigningMessage } from \"./utils\";\nimport { AptosConfig } from \"../../api\";\n\n/**\n * Represents a Secp256k1 ECDSA public key.\n *\n * @extends PublicKey\n * @property LENGTH - The length of the Secp256k1 public key in bytes.\n * @group Implementation\n * @category Serialization\n */\nexport class Secp256k1PublicKey extends PublicKey {\n // Secp256k1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.\n static readonly LENGTH: number = 65;\n\n // If it's compressed, it is only 33 bytes\n static readonly COMPRESSED_LENGTH: number = 33;\n\n // Hex value of the public key\n private readonly key: Hex;\n\n /**\n * Create a new PublicKey instance from a HexInput, which can be a string or Uint8Array.\n * This constructor validates the length of the provided signature data.\n *\n * @param hexInput - A HexInput (string or Uint8Array) representing the signature data.\n * @throws Error if the length of the signature data is not equal to Secp256k1Signature.LENGTH.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n const { length } = hex.toUint8Array();\n if (length === Secp256k1PublicKey.LENGTH) {\n this.key = hex;\n } else if (length === Secp256k1PublicKey.COMPRESSED_LENGTH) {\n const point = secp256k1.ProjectivePoint.fromHex(hex.toUint8Array());\n this.key = Hex.fromHexInput(point.toRawBytes(false));\n } else {\n throw new Error(\n `PublicKey length should be ${Secp256k1PublicKey.LENGTH} or ${Secp256k1PublicKey.COMPRESSED_LENGTH}, received ${length}`,\n );\n }\n }\n\n // region PublicKey\n /**\n * Verifies a Secp256k1 signature against the public key.\n *\n * This function checks the validity of a signature for a given message, ensuring that the signature is canonical as a malleability check.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify against the public key.\n * @group Implementation\n * @category Serialization\n */\n verifySignature(args: { message: HexInput; signature: Secp256k1Signature }): boolean {\n const { message, signature } = args;\n const messageToVerify = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();\n const messageSha3Bytes = sha3_256(messageBytes);\n const signatureBytes = signature.toUint8Array();\n return secp256k1.verify(signatureBytes, messageSha3Bytes, this.key.toUint8Array(), { lowS: true });\n }\n\n /**\n * Note: Secp256k1Signatures can be verified syncronously.\n *\n * Verifies the provided signature against the given message.\n * This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.\n *\n * @param args - The arguments for signature verification.\n * @param args.aptosConfig - The configuration object for connecting to the Aptos network\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify, which must be an instance of Secp256k1Signature.\n * @returns A boolean indicating whether the signature is valid for the given message.\n * @group Implementation\n * @category Serialization\n */\n async verifySignatureAsync(args: {\n aptosConfig: AptosConfig;\n message: HexInput;\n signature: Secp256k1Signature;\n }): Promise<boolean> {\n return this.verifySignature(args);\n }\n\n /**\n * Get the data as a Uint8Array representation.\n *\n * @returns Uint8Array representation of the data.\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the data into a byte array using the provided serializer.\n * This function is essential for converting data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to convert the data.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n /**\n * Deserializes a Secp256k1Signature from the provided deserializer.\n * This function allows you to reconstruct a Secp256k1Signature object from its serialized byte representation.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n // eslint-disable-next-line class-methods-use-this\n deserialize(deserializer: Deserializer) {\n const hex = deserializer.deserializeBytes();\n return new Secp256k1Signature(hex);\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PublicKey(bytes);\n }\n\n // endregion\n\n /**\n * Determine if the provided public key is an instance of Secp256k1PublicKey.\n *\n * @deprecated use `instanceof Secp256k1PublicKey` instead\n * @param publicKey - The public key to check.\n * @group Implementation\n * @category Serialization\n */\n static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey {\n return publicKey instanceof Secp256k1PublicKey;\n }\n\n /**\n * Determines if the provided public key is a valid instance of a Secp256k1 public key.\n * This function checks for the presence of a \"key\" property and validates the length of the key data.\n *\n * @param publicKey - The public key to validate.\n * @returns A boolean indicating whether the public key is a valid Secp256k1 public key.\n * @group Implementation\n * @category Serialization\n */\n static isInstance(publicKey: PublicKey): publicKey is Secp256k1PublicKey {\n return \"key\" in publicKey && (publicKey.key as any)?.data?.length === Secp256k1PublicKey.LENGTH;\n }\n}\n\n/**\n * Represents a Secp256k1 ECDSA private key, providing functionality to create, sign messages,\n * derive public keys, and serialize/deserialize the key.\n * @group Implementation\n * @category Serialization\n */\nexport class Secp256k1PrivateKey extends Serializable implements PrivateKey {\n /**\n * Length of Secp256k1 ecdsa private key\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The private key bytes\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly key: Hex;\n\n // region Constructors\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param hexInput A HexInput (string or Uint8Array)\n * @param strict If true, private key must AIP-80 compliant.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput, strict?: boolean) {\n super();\n\n const privateKeyHex = PrivateKey.parseHexInput(hexInput, PrivateKeyVariants.Secp256k1, strict);\n if (privateKeyHex.toUint8Array().length !== Secp256k1PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Secp256k1PrivateKey.LENGTH}`);\n }\n\n this.key = privateKeyHex;\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Secp256k1PrivateKey - A newly generated Secp256k1 private key.\n * @group Implementation\n * @category Serialization\n */\n static generate(): Secp256k1PrivateKey {\n const hexInput = secp256k1.utils.randomPrivateKey();\n return new Secp256k1PrivateKey(hexInput, false);\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase using a specified BIP44 path.\n *\n * @param path - The BIP44 path to derive the key from.\n * @param mnemonics - The mnemonic seed phrase used for key generation.\n *\n * @returns The generated private key.\n *\n * @throws Error if the provided path is not a valid BIP44 path.\n * @group Implementation\n * @category Serialization\n */\n static fromDerivationPath(path: string, mnemonics: string): Secp256k1PrivateKey {\n if (!isValidBIP44Path(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Secp256k1PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));\n }\n\n /**\n * Derives a private key from a specified BIP44 path using a given seed.\n * This function is essential for generating keys that follow the hierarchical deterministic (HD) wallet structure.\n *\n * @param path - The BIP44 path used for key derivation.\n * @param seed - The seed phrase created by the mnemonics, represented as a Uint8Array.\n * @returns The generated private key as an instance of Secp256k1PrivateKey.\n * @throws Error if the derived private key is invalid.\n * @group Implementation\n * @category Serialization\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array): Secp256k1PrivateKey {\n const { privateKey } = HDKey.fromMasterSeed(seed).derive(path);\n // library returns privateKey as Uint8Array | null\n if (privateKey === null) {\n throw new Error(\"Invalid key\");\n }\n\n return new Secp256k1PrivateKey(privateKey, false);\n }\n\n // endregion\n\n // region PrivateKey\n\n /**\n * Sign the given message with the private key.\n * This function generates a cryptographic signature for the provided message, ensuring the signature is canonical and non-malleable.\n *\n * @param message - A message in HexInput format to be signed.\n * @returns Signature - The generated signature for the provided message.\n * @group Implementation\n * @category Serialization\n */\n sign(message: HexInput): Secp256k1Signature {\n const messageToSign = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToSign);\n const messageHashBytes = sha3_256(messageBytes.toUint8Array());\n const signature = secp256k1.sign(messageHashBytes, this.key.toUint8Array(), { lowS: true });\n return new Secp256k1Signature(signature.toCompactRawBytes());\n }\n\n /**\n * Derive the Secp256k1PublicKey from this private key.\n *\n * @returns Secp256k1PublicKey The derived public key.\n * @group Implementation\n * @category Serialization\n */\n publicKey(): Secp256k1PublicKey {\n const bytes = secp256k1.getPublicKey(this.key.toUint8Array(), false);\n return new Secp256k1PublicKey(bytes);\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n /**\n * Get the private key as a string representation.\n *\n * @returns string representation of the private key\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return this.toAIP80String();\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 toHexString(): string {\n return this.key.toString();\n }\n\n /**\n * Get the private key as a AIP-80 compliant hex string.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @returns AIP-80 compliant string representation of the private key.\n */\n toAIP80String(): string {\n return PrivateKey.formatPrivateKey(this.key.toString(), PrivateKeyVariants.Secp256k1);\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PrivateKey(bytes, false);\n }\n\n // endregion\n\n /**\n * Determines if the provided private key is an instance of Secp256k1PrivateKey.\n *\n * @param privateKey - The private key to be checked.\n *\n * @deprecated use `instanceof Secp256k1PrivateKey` instead\n * @group Implementation\n * @category Serialization\n */\n static isPrivateKey(privateKey: PrivateKey): privateKey is Secp256k1PrivateKey {\n return privateKey instanceof Secp256k1PrivateKey;\n }\n}\n\n/**\n * Represents a signature of a message signed using a Secp256k1 ECDSA private key.\n *\n * @group Implementation\n * @category Serialization\n */\nexport class Secp256k1Signature extends Signature {\n /**\n * Secp256k1 ecdsa signatures are 256-bit.\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly data: Hex;\n\n // region Constructors\n\n /**\n * Create a new Signature instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput) {\n super();\n const data = Hex.fromHexInput(hexInput);\n if (data.toUint8Array().length !== Secp256k1Signature.LENGTH) {\n throw new Error(\n `Signature length should be ${Secp256k1Signature.LENGTH}, received ${data.toUint8Array().length}`,\n );\n }\n this.data = data;\n }\n\n // endregion\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1Signature {\n const hex = deserializer.deserializeBytes();\n return new Secp256k1Signature(hex);\n }\n\n // endregion\n}\n"],"mappings":"sSAGA,OAAS,YAAAA,MAAgB,qBACzB,OAAS,aAAAC,MAAiB,0BAC1B,OAAS,SAAAC,MAAa,eAmBf,IAAMC,EAAN,MAAMA,UAA2BC,CAAU,CAmBhD,YAAYC,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EAC/B,CAAE,OAAAG,CAAO,EAAIF,EAAI,aAAa,EACpC,GAAIE,IAAWL,EAAmB,OAChC,KAAK,IAAMG,UACFE,IAAWL,EAAmB,kBAAmB,CAC1D,IAAMM,EAAQC,EAAU,gBAAgB,QAAQJ,EAAI,aAAa,CAAC,EAClE,KAAK,IAAMC,EAAI,aAAaE,EAAM,WAAW,EAAK,CAAC,CACrD,KACE,OAAM,IAAI,MACR,8BAA8BN,EAAmB,MAAM,OAAOA,EAAmB,iBAAiB,cAAcK,CAAM,EACxH,CAEJ,CAcA,gBAAgBG,EAAqE,CACnF,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EACzBG,EAAkBC,EAAsBH,CAAO,EAC/CI,EAAeT,EAAI,aAAaO,CAAe,EAAE,aAAa,EAC9DG,EAAmBC,EAASF,CAAY,EACxCG,EAAiBN,EAAU,aAAa,EAC9C,OAAOH,EAAU,OAAOS,EAAgBF,EAAkB,KAAK,IAAI,aAAa,EAAG,CAAE,KAAM,EAAK,CAAC,CACnG,CAgBA,MAAM,qBAAqBN,EAIN,CACnB,OAAO,KAAK,gBAAgBA,CAAI,CAClC,CASA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAcA,UAAUS,EAA8B,CACtCA,EAAW,eAAe,KAAK,IAAI,aAAa,CAAC,CACnD,CAWA,YAAYC,EAA4B,CACtC,IAAMf,EAAMe,EAAa,iBAAiB,EAC1C,OAAO,IAAIC,EAAmBhB,CAAG,CACnC,CAEA,OAAO,YAAYe,EAAgD,CACjE,IAAME,EAAQF,EAAa,iBAAiB,EAC5C,OAAO,IAAIlB,EAAmBoB,CAAK,CACrC,CAYA,OAAO,YAAYC,EAAuD,CACxE,OAAOA,aAAqBrB,CAC9B,CAWA,OAAO,WAAWqB,EAAuD,CACvE,MAAO,QAASA,GAAcA,EAAU,KAAa,MAAM,SAAWrB,EAAmB,MAC3F,CACF,EAvJaA,EAEK,OAAiB,GAFtBA,EAKK,kBAA4B,GALvC,IAAMsB,EAANtB,EA+JMuB,EAAN,MAAMA,UAA4BC,CAAmC,CA4B1E,YAAYtB,EAAoBuB,EAAkB,CAChD,MAAM,EAEN,IAAMC,EAAgBC,EAAW,cAAczB,cAAwCuB,CAAM,EAC7F,GAAIC,EAAc,aAAa,EAAE,SAAWH,EAAoB,OAC9D,MAAM,IAAI,MAAM,+BAA+BA,EAAoB,MAAM,EAAE,EAG7E,KAAK,IAAMG,CACb,CASA,OAAO,UAAgC,CACrC,IAAMxB,EAAWK,EAAU,MAAM,iBAAiB,EAClD,OAAO,IAAIgB,EAAoBrB,EAAU,EAAK,CAChD,CAcA,OAAO,mBAAmB0B,EAAcC,EAAwC,CAC9E,GAAI,CAACC,EAAiBF,CAAI,EACxB,MAAM,IAAI,MAAM,2BAA2BA,CAAI,EAAE,EAEnD,OAAOL,EAAoB,wBAAwBK,EAAMG,EAAeF,CAAS,CAAC,CACpF,CAaA,OAAe,wBAAwBD,EAAcI,EAAuC,CAC1F,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAM,eAAeF,CAAI,EAAE,OAAOJ,CAAI,EAE7D,GAAIK,IAAe,KACjB,MAAM,IAAI,MAAM,aAAa,EAG/B,OAAO,IAAIV,EAAoBU,EAAY,EAAK,CAClD,CAeA,KAAKxB,EAAuC,CAC1C,IAAM0B,EAAgBvB,EAAsBH,CAAO,EAC7CI,EAAeT,EAAI,aAAa+B,CAAa,EAC7CC,EAAmBrB,EAASF,EAAa,aAAa,CAAC,EACvDH,EAAYH,EAAU,KAAK6B,EAAkB,KAAK,IAAI,aAAa,EAAG,CAAE,KAAM,EAAK,CAAC,EAC1F,OAAO,IAAIjB,EAAmBT,EAAU,kBAAkB,CAAC,CAC7D,CASA,WAAgC,CAC9B,IAAMU,EAAQb,EAAU,aAAa,KAAK,IAAI,aAAa,EAAG,EAAK,EACnE,OAAO,IAAIe,EAAmBF,CAAK,CACrC,CASA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CASA,UAAmB,CACjB,OAAO,KAAK,cAAc,CAC5B,CAOA,aAAsB,CACpB,OAAO,KAAK,IAAI,SAAS,CAC3B,CASA,eAAwB,CACtB,OAAOO,EAAW,iBAAiB,KAAK,IAAI,SAAS,aAA+B,CACtF,CAMA,UAAUV,EAA8B,CACtCA,EAAW,eAAe,KAAK,aAAa,CAAC,CAC/C,CAEA,OAAO,YAAYC,EAAiD,CAClE,IAAME,EAAQF,EAAa,iBAAiB,EAC5C,OAAO,IAAIK,EAAoBH,EAAO,EAAK,CAC7C,CAaA,OAAO,aAAaa,EAA2D,CAC7E,OAAOA,aAAsBV,CAC/B,CACF,EAjMaA,EAMK,OAAiB,GAN5B,IAAMc,EAANd,EAyMMe,EAAN,MAAMA,UAA2BC,CAAU,CAyBhD,YAAYrC,EAAoB,CAC9B,MAAM,EACN,IAAMsC,EAAOpC,EAAI,aAAaF,CAAQ,EACtC,GAAIsC,EAAK,aAAa,EAAE,SAAWF,EAAmB,OACpD,MAAM,IAAI,MACR,8BAA8BA,EAAmB,MAAM,cAAcE,EAAK,aAAa,EAAE,MAAM,EACjG,EAEF,KAAK,KAAOA,CACd,CAMA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CAMA,UAAUvB,EAA8B,CACtCA,EAAW,eAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMf,EAAMe,EAAa,iBAAiB,EAC1C,OAAO,IAAIoB,EAAmBnC,CAAG,CACnC,CAGF,EA1DamC,EAMK,OAAS,GANpB,IAAMnB,EAANmB","names":["sha3_256","secp256k1","HDKey","_Secp256k1PublicKey","PublicKey","hexInput","hex","Hex","length","point","secp256k1","args","message","signature","messageToVerify","convertSigningMessage","messageBytes","messageSha3Bytes","sha3_256","signatureBytes","serializer","deserializer","Secp256k1Signature","bytes","publicKey","Secp256k1PublicKey","_Secp256k1PrivateKey","Serializable","strict","privateKeyHex","PrivateKey","path","mnemonics","isValidBIP44Path","mnemonicToSeed","seed","privateKey","HDKey","messageToSign","messageHashBytes","Secp256k1PrivateKey","_Secp256k1Signature","Signature","data"]}
@@ -1,2 +0,0 @@
1
- import{b as o}from"./chunk-BYINW7I2.mjs";import{a as s}from"./chunk-Z6KQX6VX.mjs";import{a as t}from"./chunk-6PKBXYG3.mjs";import{b as i}from"./chunk-STY74NUA.mjs";var n=class e extends s{constructor(r){super(),this.value=i.fromHexInput(r).toUint8Array()}serialize(r){r.serializeBytes(this.value)}static deserialize(r){return new e(r.deserializeBytes())}},a=class extends o{constructor(r){super(),this.accountAddress=r}authKey(){return new t({data:this.accountAddress.toUint8Array()})}verifySignature(r){throw new Error("This function is not implemented for AbstractPublicKey.")}async verifySignatureAsync(r){throw new Error("This function is not implemented for AbstractPublicKey.")}serialize(r){throw new Error("This function is not implemented for AbstractPublicKey.")}};export{n as a,a as b};
2
- //# sourceMappingURL=chunk-FBCXUC7J.mjs.map
@@ -1,2 +0,0 @@
1
- import{b as t,d as n}from"./chunk-QGFWOGAV.mjs";import{a as u}from"./chunk-BYINW7I2.mjs";import{a as l}from"./chunk-Z6KQX6VX.mjs";import{a as o}from"./chunk-UCBUUH5M.mjs";import{b as s}from"./chunk-STY74NUA.mjs";var c=class i extends u{constructor(e){super();let r=e.constructor.name;switch(r){case t.name:this.publicKey=e,this.variant=0;break;default:throw new Error(`Unsupported key for EphemeralPublicKey - ${r}`)}}verifySignature(e){let{message:r,signature:a}=e;return this.publicKey.verifySignature({message:r,signature:a.signature})}async verifySignatureAsync(e){return this.verifySignature(e)}serialize(e){if(this.publicKey instanceof t)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(t.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}}static isPublicKey(e){return e instanceof i}},p=class i extends l{constructor(e){super();let r=e.constructor.name;switch(r){case n.name:this.signature=e;break;default:throw new Error(`Unsupported signature for EphemeralSignature - ${r}`)}}static fromHex(e){let r=s.fromHexInput(e),a=new o(r.toUint8Array());return i.deserialize(a)}serialize(e){if(this.signature instanceof n)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(n.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralSignature: ${r}`)}}};export{c as a,p as b};
2
- //# sourceMappingURL=chunk-FWGLACJS.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/ephemeral.ts"],"sourcesContent":["import { Serializer, Deserializer } from \"../../bcs\";\nimport { EphemeralPublicKeyVariant, EphemeralSignatureVariant, HexInput } from \"../../types\";\nimport { PublicKey } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { Hex } from \"../hex\";\nimport { AptosConfig } from \"../../api\";\n\n/**\n * Represents ephemeral public keys for Aptos Keyless accounts.\n *\n * These keys are used only temporarily within Keyless accounts and are not utilized as public keys for account identification.\n * @group Implementation\n * @category Serialization\n */\nexport class EphemeralPublicKey extends PublicKey {\n /**\n * The public key itself\n * @group Implementation\n * @category Serialization\n */\n public readonly publicKey: PublicKey;\n\n /**\n * An enum indicating the scheme of the ephemeral public key\n * @group Implementation\n * @category Serialization\n */\n public readonly variant: EphemeralPublicKeyVariant;\n\n /**\n * Creates an instance of EphemeralPublicKey using the provided public key.\n * This constructor ensures that only supported signature types are accepted.\n *\n * @param publicKey - The public key to be used for the ephemeral public key.\n * @throws Error if the signature type is unsupported.\n * @group Implementation\n * @category Serialization\n */\n constructor(publicKey: PublicKey) {\n super();\n const publicKeyType = publicKey.constructor.name;\n switch (publicKeyType) {\n case Ed25519PublicKey.name:\n this.publicKey = publicKey;\n this.variant = EphemeralPublicKeyVariant.Ed25519;\n break;\n default:\n throw new Error(`Unsupported key for EphemeralPublicKey - ${publicKeyType}`);\n }\n }\n\n /**\n * Verifies a signed message using the ephemeral public key.\n *\n * @param args - The arguments for the verification.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature that was signed by the private key of the ephemeral public key.\n * @returns true if the signature is valid, otherwise false.\n * @group Implementation\n * @category Serialization\n */\n verifySignature(args: { message: HexInput; signature: EphemeralSignature }): boolean {\n const { message, signature } = args;\n return this.publicKey.verifySignature({ message, signature: signature.signature });\n }\n\n async verifySignatureAsync(args: {\n aptosConfig: AptosConfig;\n message: HexInput;\n signature: EphemeralSignature;\n }): Promise<boolean> {\n return this.verifySignature(args);\n }\n\n /**\n * Serializes the current instance, specifically handling the Ed25519 signature type.\n * This function ensures that the signature is properly serialized using the provided serializer.\n *\n * @param serializer - The serializer instance used to serialize the signature.\n * @throws Error if the signature type is unknown.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n if (this.publicKey instanceof Ed25519PublicKey) {\n serializer.serializeU32AsUleb128(EphemeralPublicKeyVariant.Ed25519);\n this.publicKey.serialize(serializer);\n } else {\n throw new Error(\"Unknown public key type\");\n }\n }\n\n /**\n * Deserializes an EphemeralSignature from the provided deserializer.\n * This function allows you to retrieve an EphemeralSignature based on the deserialized data.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): EphemeralPublicKey {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case EphemeralPublicKeyVariant.Ed25519:\n return new EphemeralPublicKey(Ed25519PublicKey.deserialize(deserializer));\n default:\n throw new Error(`Unknown variant index for EphemeralPublicKey: ${index}`);\n }\n }\n\n /**\n * Determines if the provided public key is an instance of `EphemeralPublicKey`.\n *\n * @param publicKey - The public key to check.\n * @returns A boolean indicating whether the public key is an ephemeral type.\n * @group Implementation\n * @category Serialization\n */\n static isPublicKey(publicKey: PublicKey): publicKey is EphemeralPublicKey {\n return publicKey instanceof EphemeralPublicKey;\n }\n}\n\n/**\n * Represents ephemeral signatures used in Aptos Keyless accounts.\n *\n * These signatures are utilized within the KeylessSignature framework.\n * @group Implementation\n * @category Serialization\n */\nexport class EphemeralSignature extends Signature {\n /**\n * The signature signed by the private key of an EphemeralKeyPair\n * @group Implementation\n * @category Serialization\n */\n public readonly signature: Signature;\n\n constructor(signature: Signature) {\n super();\n const signatureType = signature.constructor.name;\n switch (signatureType) {\n case Ed25519Signature.name:\n this.signature = signature;\n break;\n default:\n throw new Error(`Unsupported signature for EphemeralSignature - ${signatureType}`);\n }\n }\n\n /**\n * Deserializes an ephemeral signature from a hexadecimal input.\n * This function allows you to convert a hexadecimal representation of an ephemeral signature into its deserialized form for\n * further processing.\n *\n * @param hexInput - The hexadecimal input representing the ephemeral signature.\n * @group Implementation\n * @category Serialization\n */\n static fromHex(hexInput: HexInput): EphemeralSignature {\n const data = Hex.fromHexInput(hexInput);\n const deserializer = new Deserializer(data.toUint8Array());\n return EphemeralSignature.deserialize(deserializer);\n }\n\n serialize(serializer: Serializer): void {\n if (this.signature instanceof Ed25519Signature) {\n serializer.serializeU32AsUleb128(EphemeralSignatureVariant.Ed25519);\n this.signature.serialize(serializer);\n } else {\n throw new Error(\"Unknown signature type\");\n }\n }\n\n static deserialize(deserializer: Deserializer): EphemeralSignature {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case EphemeralSignatureVariant.Ed25519:\n return new EphemeralSignature(Ed25519Signature.deserialize(deserializer));\n default:\n throw new Error(`Unknown variant index for EphemeralSignature: ${index}`);\n }\n }\n}\n"],"mappings":"oNAeO,IAAMA,EAAN,MAAMC,UAA2BC,CAAU,CAwBhD,YAAYC,EAAsB,CAChC,MAAM,EACN,IAAMC,EAAgBD,EAAU,YAAY,KAC5C,OAAQC,EAAe,CACrB,KAAKC,EAAiB,KACpB,KAAK,UAAYF,EACjB,KAAK,QAAU,EACf,MACF,QACE,MAAM,IAAI,MAAM,4CAA4CC,CAAa,EAAE,CAC/E,CACF,CAYA,gBAAgBE,EAAqE,CACnF,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,OAAO,KAAK,UAAU,gBAAgB,CAAE,QAAAC,EAAS,UAAWC,EAAU,SAAU,CAAC,CACnF,CAEA,MAAM,qBAAqBF,EAIN,CACnB,OAAO,KAAK,gBAAgBA,CAAI,CAClC,CAWA,UAAUG,EAA8B,CACtC,GAAI,KAAK,qBAAqBJ,EAC5BI,EAAW,uBAAuD,EAClE,KAAK,UAAU,UAAUA,CAAU,MAEnC,OAAM,IAAI,MAAM,yBAAyB,CAE7C,CAUA,OAAO,YAAYC,EAAgD,CACjE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAO,IAAIV,EAAmBI,EAAiB,YAAYK,CAAY,CAAC,EAC1E,QACE,MAAM,IAAI,MAAM,iDAAiDC,CAAK,EAAE,CAC5E,CACF,CAUA,OAAO,YAAYR,EAAuD,CACxE,OAAOA,aAAqBF,CAC9B,CACF,EASaW,EAAN,MAAMC,UAA2BC,CAAU,CAQhD,YAAYN,EAAsB,CAChC,MAAM,EACN,IAAMO,EAAgBP,EAAU,YAAY,KAC5C,OAAQO,EAAe,CACrB,KAAKC,EAAiB,KACpB,KAAK,UAAYR,EACjB,MACF,QACE,MAAM,IAAI,MAAM,kDAAkDO,CAAa,EAAE,CACrF,CACF,CAWA,OAAO,QAAQE,EAAwC,CACrD,IAAMC,EAAOC,EAAI,aAAaF,CAAQ,EAChCP,EAAe,IAAIU,EAAaF,EAAK,aAAa,CAAC,EACzD,OAAOL,EAAmB,YAAYH,CAAY,CACpD,CAEA,UAAUD,EAA8B,CACtC,GAAI,KAAK,qBAAqBO,EAC5BP,EAAW,uBAAuD,EAClE,KAAK,UAAU,UAAUA,CAAU,MAEnC,OAAM,IAAI,MAAM,wBAAwB,CAE5C,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAO,IAAIE,EAAmBG,EAAiB,YAAYN,CAAY,CAAC,EAC1E,QACE,MAAM,IAAI,MAAM,iDAAiDC,CAAK,EAAE,CAC5E,CACF,CACF","names":["EphemeralPublicKey","_EphemeralPublicKey","PublicKey","publicKey","publicKeyType","Ed25519PublicKey","args","message","signature","serializer","deserializer","index","EphemeralSignature","_EphemeralSignature","Signature","signatureType","Ed25519Signature","hexInput","data","Hex","Deserializer"]}
@@ -1,2 +0,0 @@
1
- import{poseidon1 as h,poseidon2 as u,poseidon3 as a,poseidon4 as l,poseidon5 as c,poseidon6 as d,poseidon7 as p,poseidon8 as f,poseidon9 as A,poseidon10 as U,poseidon11 as b,poseidon12 as w,poseidon13 as E,poseidon14 as I,poseidon15 as y,poseidon16 as B}from"poseidon-lite";var i=[h,u,a,l,c,d,p,f,A,U,b,w,E,I,y,B],g=31,m=16,s=(m-1)*g;function C(n,t){let o=new TextEncoder().encode(n);return $(o,t)}function $(n,t){if(n.length>t)throw new Error(`Inputted bytes of length ${n} is longer than ${t}`);let r=_(n,t);return M(r)}function T(n,t){if(n.length>t)throw new Error(`Input bytes of length ${n} is longer than ${t}`);let r=k(n,t);return P(r)}function _(n,t){if(n.length>t)throw new Error(`Input bytes of length ${n} is longer than ${t}`);return T(n,t).concat([BigInt(n.length)])}function P(n){if(n.length>s)throw new Error(`Can't pack more than ${s}. Was given ${n.length} bytes`);return L(n,g).map(t=>N(t))}function L(n,t){let r=[];for(let o=0;o<n.length;o+=t)r.push(n.subarray(o,o+t));return r}function N(n){let t=BigInt(0);for(let r=n.length-1;r>=0;r-=1)t=t<<BigInt(8)|BigInt(n[r]);return t}function W(n,t){let r=BigInt(n),o=new Uint8Array(t);for(let e=0;e<t;e+=1)o[e]=Number(r&BigInt(255)),r>>=BigInt(8);return o}function k(n,t){if(t<n.length)throw new Error("Padded size must be greater than or equal to the input array size.");let r=new Uint8Array(t);r.set(n);for(let o=n.length;o<t;o+=1)r[o]=0;return r}function M(n){if(n.length>i.length)throw new Error(`Unable to hash input of length ${n.length}. Max input length is ${i.length}`);return i[n.length-1](n)}export{C as a,_ as b,N as c,W as d,M as e};
2
- //# sourceMappingURL=chunk-GOXRBEIJ.mjs.map
@@ -1,2 +0,0 @@
1
- import{h as e}from"./chunk-DW6WLD2B.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
2
- //# sourceMappingURL=chunk-GRB6YSIT.mjs.map
@@ -1,4 +0,0 @@
1
- import{a as c}from"./chunk-NJN3EAOM.mjs";import{a as i}from"./chunk-IF4UU2MT.mjs";import{bytesToHex as a,hexToBytes as g}from"@noble/hashes/utils";var u=(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.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",s))(u||{}),e=class e extends c{constructor(t){if(super(),t.length!==e.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=a(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return a(this.data)}toStringShort(){return`0x${this.toStringShortWithoutPrefix()}`}toStringShortWithoutPrefix(){let t=a(this.data).replace(/^0+/,"");return t===""?"0":t}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let r=this.bcsToBytes();t.serializeBytes(r)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let r=t.deserializeFixedBytes(e.LENGTH);return new e(r)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let r=e.fromString(t);if(t.length!==e.LONG_STRING_LENGTH+2)if(r.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 r}static fromString(t,{maxMissingChars:r=4}={}){let n=t;if(t.startsWith("0x")&&(n=t.slice(2)),n.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(r>63||r<0)throw new i(`maxMissingChars must be between or equal to 0 and 63. Received ${r}`,"INVALID_PADDING_STRICTNESS");let o;try{o=g(n.padStart(64,"0"))}catch(h){throw new i(`Hex characters are invalid: ${h?.message}`,"invalid_hex_chars")}let d=new e(o);if(n.length<64-r&&!d.isSpecial())throw new i(`Hex string is too short, must be ${64-r} to 64 chars long, excluding the leading 0x. You may need to fix
2
- the addresss by padding it with 0s before passing it to \`fromString\` (e.g. <addressString>.padStart(64, '0')).
3
- Received ${t}`,"too_short");return d}static from(t,{maxMissingChars:r=4}={}){return typeof t=="string"?e.fromString(t,{maxMissingChars:r}):t instanceof Uint8Array?new e(t):t}static fromStrict(t){return typeof t=="string"?e.fromStringStrict(t):t instanceof Uint8Array?new e(t):t}static isValid(t){try{return t.strict?e.fromStrict(t.input):e.from(t.input),{valid:!0}}catch(r){return{valid:!1,invalidReason:r?.invalidReason,invalidReasonMessage:r?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,n)=>r===t.data[n])}};e.LENGTH=32,e.LONG_STRING_LENGTH=64,e.ZERO=e.from("0x0"),e.ONE=e.from("0x1"),e.TWO=e.from("0x2"),e.THREE=e.from("0x3"),e.FOUR=e.from("0x4"),e.A=e.from("0xA");var l=e;export{u as a,l as b};
4
- //# sourceMappingURL=chunk-GYVSI3TS.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as e}from"./chunk-UCBUUH5M.mjs";function t(i,r){let l=r.bcsToBytes(),a=new e(l);return i.deserialize(a)}export{t as a};
2
- //# sourceMappingURL=chunk-HPQMAP7O.mjs.map