@aptos-labs/ts-sdk 1.13.1-zeta.5 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/dist/common/index.d.ts +1399 -1821
  2. package/dist/common/index.js +26 -26
  3. package/dist/common/index.js.map +1 -1
  4. package/dist/esm/{Ed25519Account-8gJF5t3F.d.mts → Ed25519Account--qjfup2u.d.mts} +12 -10
  5. package/dist/esm/api/account.d.mts +1 -13
  6. package/dist/esm/api/account.mjs +1 -1
  7. package/dist/esm/api/ans.d.mts +2 -2
  8. package/dist/esm/api/ans.mjs +1 -1
  9. package/dist/esm/api/aptos.d.mts +8 -14
  10. package/dist/esm/api/aptos.mjs +1 -1
  11. package/dist/esm/api/aptosConfig.d.mts +0 -20
  12. package/dist/esm/api/aptosConfig.mjs +1 -1
  13. package/dist/esm/api/coin.d.mts +7 -7
  14. package/dist/esm/api/coin.mjs +1 -1
  15. package/dist/esm/api/digitalAsset.d.mts +1 -1
  16. package/dist/esm/api/digitalAsset.mjs +1 -1
  17. package/dist/esm/api/event.mjs +1 -1
  18. package/dist/esm/api/faucet.mjs +1 -1
  19. package/dist/esm/api/fungibleAsset.d.mts +5 -5
  20. package/dist/esm/api/fungibleAsset.mjs +1 -1
  21. package/dist/esm/api/general.d.mts +7 -7
  22. package/dist/esm/api/general.mjs +1 -1
  23. package/dist/esm/api/index.d.mts +8 -13
  24. package/dist/esm/api/index.mjs +1 -1
  25. package/dist/esm/api/staking.mjs +1 -1
  26. package/dist/esm/api/transaction.d.mts +1 -1
  27. package/dist/esm/api/transaction.mjs +1 -1
  28. package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
  29. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  30. package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
  31. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  32. package/dist/esm/api/transactionSubmission/sign.d.mts +1 -1
  33. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  34. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  35. package/dist/esm/api/transactionSubmission/simulate.d.mts +6 -6
  36. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  37. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  38. package/dist/esm/api/utils.d.mts +1 -1
  39. package/dist/esm/api/utils.mjs +1 -1
  40. package/dist/esm/bcs/index.mjs +1 -1
  41. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  42. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  43. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  44. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  45. package/dist/esm/bcs/serializer.d.mts +0 -2
  46. package/dist/esm/bcs/serializer.mjs +1 -1
  47. package/dist/esm/{chunk-MRTAMMS3.mjs → chunk-2PFN7LYP.mjs} +2 -2
  48. package/dist/esm/chunk-3426VLAZ.mjs +2 -0
  49. package/dist/esm/chunk-3426VLAZ.mjs.map +1 -0
  50. package/dist/esm/{chunk-PTIZKRON.mjs → chunk-3HV2C4SS.mjs} +2 -2
  51. package/dist/esm/chunk-3OCTOB2E.mjs +2 -0
  52. package/dist/esm/chunk-3OCTOB2E.mjs.map +1 -0
  53. package/dist/esm/{chunk-QJHFD2MT.mjs → chunk-3QBZU5ZD.mjs} +2 -2
  54. package/dist/esm/chunk-3QBZU5ZD.mjs.map +1 -0
  55. package/dist/esm/{chunk-GUWBE3CV.mjs → chunk-3RUY5FQK.mjs} +2 -2
  56. package/dist/esm/chunk-3RUY5FQK.mjs.map +1 -0
  57. package/dist/esm/{chunk-OJ4NIVFW.mjs → chunk-4DNVCOW7.mjs} +2 -2
  58. package/dist/esm/chunk-4DNVCOW7.mjs.map +1 -0
  59. package/dist/esm/{chunk-FFVWTX36.mjs → chunk-4LMAVPA4.mjs} +2 -2
  60. package/dist/esm/{chunk-TVRJ3M7B.mjs → chunk-52C73T26.mjs} +2 -2
  61. package/dist/esm/{chunk-TVRJ3M7B.mjs.map → chunk-52C73T26.mjs.map} +1 -1
  62. package/dist/esm/chunk-5HALZ6JC.mjs +2 -0
  63. package/dist/esm/chunk-5HALZ6JC.mjs.map +1 -0
  64. package/dist/esm/chunk-5OM4V4DR.mjs +2 -0
  65. package/dist/esm/chunk-5TMLAKSH.mjs +2 -0
  66. package/dist/esm/chunk-5TMLAKSH.mjs.map +1 -0
  67. package/dist/esm/{chunk-NCIRQZOJ.mjs → chunk-6IGEUEER.mjs} +2 -2
  68. package/dist/esm/{chunk-IGJCOZGO.mjs → chunk-6MG4JAYB.mjs} +2 -2
  69. package/dist/esm/{chunk-FYJMB23M.mjs → chunk-A556OVZY.mjs} +2 -2
  70. package/dist/esm/chunk-B252RJCU.mjs +2 -0
  71. package/dist/esm/{chunk-HTSXKHXX.mjs.map → chunk-B252RJCU.mjs.map} +1 -1
  72. package/dist/esm/{chunk-7PICPK26.mjs → chunk-BAV4XY7C.mjs} +2 -2
  73. package/dist/esm/{chunk-HGXO74Q3.mjs → chunk-BBU2EE6D.mjs} +2 -2
  74. package/dist/esm/{chunk-D4QQKQXJ.mjs → chunk-BRQYARQ3.mjs} +2 -2
  75. package/dist/esm/{chunk-MWUJCP27.mjs → chunk-BWFJHFBQ.mjs} +2 -2
  76. package/dist/esm/chunk-CYNQRMO5.mjs +2 -0
  77. package/dist/esm/chunk-CYNQRMO5.mjs.map +1 -0
  78. package/dist/esm/{chunk-3VGX3TXH.mjs → chunk-DMKUAQB7.mjs} +2 -2
  79. package/dist/esm/{chunk-MGOHPDX4.mjs → chunk-DSTKXJMA.mjs} +2 -2
  80. package/dist/esm/chunk-E7FWVXGX.mjs +1 -0
  81. package/dist/esm/{chunk-W3UCKFFU.mjs → chunk-EJCKCYYI.mjs} +2 -2
  82. package/dist/esm/chunk-FO6ZKE7A.mjs +2 -0
  83. package/dist/esm/chunk-FO6ZKE7A.mjs.map +1 -0
  84. package/dist/esm/{chunk-EB7AI4B4.mjs → chunk-FS3NSGBF.mjs} +2 -2
  85. package/dist/esm/{chunk-JTCWZB3Q.mjs → chunk-FXNFWLQC.mjs} +2 -2
  86. package/dist/esm/chunk-GED6IT3S.mjs +1 -0
  87. package/dist/esm/chunk-GMQQSSEO.mjs +2 -0
  88. package/dist/esm/chunk-GMQQSSEO.mjs.map +1 -0
  89. package/dist/esm/chunk-GNQXMS53.mjs +2 -0
  90. package/dist/esm/chunk-GNQXMS53.mjs.map +1 -0
  91. package/dist/esm/{chunk-AZABJ5QQ.mjs → chunk-GRT5PHL6.mjs} +2 -2
  92. package/dist/esm/{chunk-DORK55K3.mjs → chunk-GS5J57UA.mjs} +2 -2
  93. package/dist/esm/chunk-GS5J57UA.mjs.map +1 -0
  94. package/dist/esm/{chunk-3HL2ZWKG.mjs → chunk-GXYS45Y5.mjs} +2 -2
  95. package/dist/esm/chunk-HLVMEUWD.mjs +2 -0
  96. package/dist/esm/chunk-HLVMEUWD.mjs.map +1 -0
  97. package/dist/esm/chunk-HQSLBTW5.mjs +2 -0
  98. package/dist/esm/chunk-HQSLBTW5.mjs.map +1 -0
  99. package/dist/esm/{chunk-T23OVRNF.mjs → chunk-IOSQVDZI.mjs} +2 -2
  100. package/dist/esm/chunk-IZT6OX3R.mjs +2 -0
  101. package/dist/esm/{chunk-GHVMDDWO.mjs.map → chunk-IZT6OX3R.mjs.map} +1 -1
  102. package/dist/esm/{chunk-VLUJRHOL.mjs → chunk-KDCHX7BI.mjs} +2 -2
  103. package/dist/esm/chunk-KHOHRD2B.mjs +2 -0
  104. package/dist/esm/chunk-KHOHRD2B.mjs.map +1 -0
  105. package/dist/esm/chunk-L6PGWGFF.mjs +2 -0
  106. package/dist/esm/chunk-LR65XHSF.mjs +2 -0
  107. package/dist/esm/chunk-LR65XHSF.mjs.map +1 -0
  108. package/dist/esm/{chunk-H5YTHO4L.mjs → chunk-LV2V23Z6.mjs} +2 -2
  109. package/dist/esm/chunk-LV2V23Z6.mjs.map +1 -0
  110. package/dist/esm/chunk-MLWIHWNH.mjs +1 -0
  111. package/dist/esm/chunk-MNBYKY5P.mjs +2 -0
  112. package/dist/esm/{chunk-FJH4H4E5.mjs.map → chunk-MNBYKY5P.mjs.map} +1 -1
  113. package/dist/esm/{chunk-7STYQ5ZE.mjs → chunk-NPFNYP75.mjs} +2 -2
  114. package/dist/esm/{chunk-UT37XKQU.mjs → chunk-OGHE4AQA.mjs} +2 -2
  115. package/dist/esm/chunk-OVJQWQ2N.mjs +2 -0
  116. package/dist/esm/chunk-OVJQWQ2N.mjs.map +1 -0
  117. package/dist/esm/chunk-OWW6SIDP.mjs +2 -0
  118. package/dist/esm/chunk-OWW6SIDP.mjs.map +1 -0
  119. package/dist/esm/{chunk-FVU47J7S.mjs → chunk-PIOHC246.mjs} +2 -2
  120. package/dist/esm/chunk-PIOHC246.mjs.map +1 -0
  121. package/dist/esm/{chunk-QI2ILOP4.mjs → chunk-PJLCPRYJ.mjs} +2 -2
  122. package/dist/esm/{chunk-6RBUXB5I.mjs → chunk-QIAHBEEW.mjs} +2 -2
  123. package/dist/esm/{chunk-NC5HHEEM.mjs → chunk-QTRYMRYK.mjs} +2 -2
  124. package/dist/esm/{chunk-Q5T2WL2M.mjs → chunk-QWRH22H4.mjs} +2 -2
  125. package/dist/esm/{chunk-STYDBDYL.mjs → chunk-R5QUBEH6.mjs} +2 -2
  126. package/dist/esm/chunk-R7G3CLRI.mjs +1 -0
  127. package/dist/esm/{chunk-ZNEBMSNC.mjs → chunk-RHBCVCOS.mjs} +2 -2
  128. package/dist/esm/chunk-ROXFCLDT.mjs +2 -0
  129. package/dist/esm/chunk-ROXFCLDT.mjs.map +1 -0
  130. package/dist/esm/{chunk-LJ624HBI.mjs → chunk-RQEWIZ67.mjs} +2 -2
  131. package/dist/esm/{chunk-3FVRXELT.mjs → chunk-TBMAJ6AW.mjs} +2 -2
  132. package/dist/esm/{chunk-ZGTJMNZG.mjs → chunk-TC3VVMPY.mjs} +2 -2
  133. package/dist/esm/{chunk-YQOKWIVY.mjs → chunk-TGG7SWBO.mjs} +2 -2
  134. package/dist/esm/chunk-TGG7SWBO.mjs.map +1 -0
  135. package/dist/esm/{chunk-FEWIHUNW.mjs → chunk-TGXZVNR5.mjs} +2 -2
  136. package/dist/esm/{chunk-TTELTGMA.mjs → chunk-TORRTLWV.mjs} +2 -2
  137. package/dist/esm/chunk-TORRTLWV.mjs.map +1 -0
  138. package/dist/esm/chunk-TQR7M73S.mjs +2 -0
  139. package/dist/esm/chunk-TQR7M73S.mjs.map +1 -0
  140. package/dist/esm/{chunk-PFFAQZHT.mjs → chunk-U43IJHQN.mjs} +2 -2
  141. package/dist/esm/{chunk-GOT527V2.mjs → chunk-UMFJDDYI.mjs} +2 -2
  142. package/dist/esm/chunk-UMFJDDYI.mjs.map +1 -0
  143. package/dist/esm/{chunk-HGZGTBA4.mjs → chunk-UML2VQZT.mjs} +2 -2
  144. package/dist/esm/{chunk-47DNXBM6.mjs → chunk-UPIN5AIO.mjs} +2 -2
  145. package/dist/esm/chunk-UVSRX4SV.mjs +1 -0
  146. package/dist/esm/chunk-VNO4VHJN.mjs +2 -0
  147. package/dist/esm/chunk-VNO4VHJN.mjs.map +1 -0
  148. package/dist/esm/chunk-WBOLHLPX.mjs +2 -0
  149. package/dist/esm/chunk-WBOLHLPX.mjs.map +1 -0
  150. package/dist/esm/{chunk-COW5IGYC.mjs → chunk-WFZDFFBM.mjs} +2 -2
  151. package/dist/esm/chunk-XDGQTMDV.mjs +2 -0
  152. package/dist/esm/chunk-XDGQTMDV.mjs.map +1 -0
  153. package/dist/esm/{chunk-XHPLLMR5.mjs → chunk-XLPVG4XR.mjs} +2 -2
  154. package/dist/esm/{chunk-YQUZLZL4.mjs → chunk-YBEF3UR3.mjs} +2 -2
  155. package/dist/esm/{chunk-4MHEB5MN.mjs → chunk-YKVKSNH4.mjs} +2 -2
  156. package/dist/esm/chunk-YVSU6GOA.mjs +2 -0
  157. package/dist/esm/chunk-YVSU6GOA.mjs.map +1 -0
  158. package/dist/esm/{chunk-C3L4ETUF.mjs → chunk-ZYYK3UXP.mjs} +2 -2
  159. package/dist/esm/client/core.mjs +1 -1
  160. package/dist/esm/client/get.d.mts +1 -2
  161. package/dist/esm/client/get.mjs +1 -1
  162. package/dist/esm/client/index.d.mts +2 -2
  163. package/dist/esm/client/index.mjs +1 -1
  164. package/dist/esm/client/post.d.mts +1 -3
  165. package/dist/esm/client/post.mjs +1 -1
  166. package/dist/esm/core/account/Account.d.mts +20 -0
  167. package/dist/esm/core/account/Account.mjs +2 -0
  168. package/dist/esm/core/account/Ed25519Account.d.mts +20 -0
  169. package/dist/esm/core/account/Ed25519Account.mjs +2 -0
  170. package/dist/esm/core/account/SingleKeyAccount.d.mts +20 -0
  171. package/dist/esm/core/account/SingleKeyAccount.mjs +2 -0
  172. package/dist/esm/core/account/index.d.mts +14 -5
  173. package/dist/esm/core/account/index.mjs +1 -1
  174. package/dist/esm/core/account/utils/address.mjs +1 -1
  175. package/dist/esm/core/account/utils/index.mjs +1 -1
  176. package/dist/esm/core/accountAddress.mjs +1 -1
  177. package/dist/esm/core/authenticationKey.mjs +1 -1
  178. package/dist/esm/core/crypto/ed25519.d.mts +10 -0
  179. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  180. package/dist/esm/core/crypto/hdKey.d.mts +1 -15
  181. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  182. package/dist/esm/core/crypto/index.d.mts +5 -7
  183. package/dist/esm/core/crypto/index.mjs +1 -1
  184. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  185. package/dist/esm/core/crypto/multiKey.d.mts +3 -4
  186. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  187. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  188. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  189. package/dist/esm/core/crypto/signature.mjs +1 -1
  190. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  191. package/dist/esm/core/index.d.mts +7 -6
  192. package/dist/esm/core/index.mjs +1 -1
  193. package/dist/esm/index.d.mts +10 -15
  194. package/dist/esm/index.mjs +1 -1
  195. package/dist/esm/internal/account.d.mts +2 -14
  196. package/dist/esm/internal/account.mjs +1 -1
  197. package/dist/esm/internal/ans.d.mts +1 -1
  198. package/dist/esm/internal/ans.mjs +1 -1
  199. package/dist/esm/internal/coin.d.mts +7 -7
  200. package/dist/esm/internal/coin.mjs +1 -1
  201. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  202. package/dist/esm/internal/digitalAsset.mjs +1 -1
  203. package/dist/esm/internal/event.d.mts +1 -1
  204. package/dist/esm/internal/event.mjs +1 -1
  205. package/dist/esm/internal/faucet.d.mts +1 -1
  206. package/dist/esm/internal/faucet.mjs +1 -1
  207. package/dist/esm/internal/fungibleAsset.d.mts +5 -5
  208. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  209. package/dist/esm/internal/general.mjs +1 -1
  210. package/dist/esm/internal/staking.d.mts +1 -1
  211. package/dist/esm/internal/staking.mjs +1 -1
  212. package/dist/esm/internal/transaction.mjs +1 -1
  213. package/dist/esm/internal/transactionSubmission.d.mts +1 -1
  214. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  215. package/dist/esm/internal/view.d.mts +7 -7
  216. package/dist/esm/internal/view.mjs +1 -1
  217. package/dist/esm/transactions/authenticator/account.d.mts +4 -3
  218. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  219. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  220. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  221. package/dist/esm/transactions/index.d.mts +2 -2
  222. package/dist/esm/transactions/index.mjs +1 -1
  223. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  224. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  225. package/dist/esm/transactions/instances/index.mjs +1 -1
  226. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  227. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  228. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  229. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  230. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  231. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  232. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  233. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  234. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  235. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +1 -13
  236. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  237. package/dist/esm/transactions/management/index.d.mts +2 -2
  238. package/dist/esm/transactions/management/index.mjs +1 -1
  239. package/dist/esm/transactions/management/transactionWorker.d.mts +1 -1
  240. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  241. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
  242. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  243. package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
  244. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  245. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
  246. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  247. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +25 -13
  248. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  249. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  250. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  251. package/dist/esm/transactions/types.d.mts +6 -6
  252. package/dist/esm/types/index.d.mts +3 -17
  253. package/dist/esm/types/index.mjs +1 -1
  254. package/dist/esm/utils/apiEndpoints.d.mts +1 -3
  255. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  256. package/dist/esm/utils/const.d.mts +1 -3
  257. package/dist/esm/utils/const.mjs +1 -1
  258. package/dist/esm/utils/index.d.mts +10 -1
  259. package/dist/esm/utils/index.mjs +1 -1
  260. package/dist/esm/utils/normalizeBundle.d.mts +23 -0
  261. package/dist/esm/utils/normalizeBundle.mjs +2 -0
  262. package/dist/esm/version.d.mts +1 -1
  263. package/dist/esm/version.mjs +1 -1
  264. package/package.json +3 -8
  265. package/src/api/account.ts +1 -2
  266. package/src/api/ans.ts +1 -2
  267. package/src/api/aptos.ts +0 -6
  268. package/src/api/aptosConfig.ts +1 -46
  269. package/src/api/digitalAsset.ts +1 -2
  270. package/src/api/fungibleAsset.ts +1 -2
  271. package/src/api/transaction.ts +1 -2
  272. package/src/api/transactionSubmission/management.ts +1 -1
  273. package/src/api/transactionSubmission/sign.ts +1 -1
  274. package/src/bcs/serializer.ts +0 -18
  275. package/src/client/core.ts +0 -8
  276. package/src/client/get.ts +0 -6
  277. package/src/client/post.ts +0 -12
  278. package/src/{account → core/account}/Account.ts +16 -12
  279. package/src/{account → core/account}/Ed25519Account.ts +7 -13
  280. package/src/{account → core/account}/SingleKeyAccount.ts +8 -13
  281. package/src/core/account/index.ts +3 -1
  282. package/src/core/crypto/ed25519.ts +24 -4
  283. package/src/core/crypto/hdKey.ts +0 -31
  284. package/src/core/crypto/index.ts +0 -2
  285. package/src/core/crypto/multiKey.ts +11 -21
  286. package/src/core/crypto/singleKey.ts +0 -11
  287. package/src/core/index.ts +1 -0
  288. package/src/index.ts +0 -1
  289. package/src/internal/account.ts +1 -1
  290. package/src/internal/ans.ts +1 -2
  291. package/src/internal/digitalAsset.ts +1 -2
  292. package/src/internal/fungibleAsset.ts +1 -2
  293. package/src/internal/transactionSubmission.ts +7 -8
  294. package/src/transactions/authenticator/account.ts +11 -6
  295. package/src/transactions/management/accountSequenceNumber.ts +1 -1
  296. package/src/transactions/management/transactionWorker.ts +2 -8
  297. package/src/transactions/transactionBuilder/index.ts +0 -1
  298. package/src/transactions/transactionBuilder/transactionBuilder.ts +103 -76
  299. package/src/types/index.ts +0 -19
  300. package/src/utils/apiEndpoints.ts +0 -14
  301. package/src/utils/const.ts +0 -2
  302. package/src/utils/index.ts +1 -0
  303. package/src/utils/normalizeBundle.ts +21 -0
  304. package/src/version.ts +1 -1
  305. package/dist/esm/account/Account.d.mts +0 -34
  306. package/dist/esm/account/Account.mjs +0 -2
  307. package/dist/esm/account/Ed25519Account.d.mts +0 -34
  308. package/dist/esm/account/Ed25519Account.mjs +0 -2
  309. package/dist/esm/account/EphemeralKeyPair.d.mts +0 -46
  310. package/dist/esm/account/EphemeralKeyPair.mjs +0 -2
  311. package/dist/esm/account/KeylessAccount.d.mts +0 -87
  312. package/dist/esm/account/KeylessAccount.mjs +0 -2
  313. package/dist/esm/account/MultiKeyAccount.d.mts +0 -99
  314. package/dist/esm/account/MultiKeyAccount.mjs +0 -2
  315. package/dist/esm/account/SingleKeyAccount.d.mts +0 -34
  316. package/dist/esm/account/SingleKeyAccount.mjs +0 -2
  317. package/dist/esm/account/index.d.mts +0 -39
  318. package/dist/esm/account/index.mjs +0 -2
  319. package/dist/esm/api/keyless.d.mts +0 -65
  320. package/dist/esm/api/keyless.mjs +0 -2
  321. package/dist/esm/chunk-4MS27RPK.mjs +0 -2
  322. package/dist/esm/chunk-4VAQCOR6.mjs +0 -2
  323. package/dist/esm/chunk-4VAQCOR6.mjs.map +0 -1
  324. package/dist/esm/chunk-5VSMDXZ6.mjs +0 -2
  325. package/dist/esm/chunk-5VSMDXZ6.mjs.map +0 -1
  326. package/dist/esm/chunk-6GQAHQGW.mjs +0 -2
  327. package/dist/esm/chunk-6GQAHQGW.mjs.map +0 -1
  328. package/dist/esm/chunk-6M6XXPQQ.mjs +0 -2
  329. package/dist/esm/chunk-6M6XXPQQ.mjs.map +0 -1
  330. package/dist/esm/chunk-7JNPSNL6.mjs +0 -2
  331. package/dist/esm/chunk-7JNPSNL6.mjs.map +0 -1
  332. package/dist/esm/chunk-7QFBF7FS.mjs +0 -2
  333. package/dist/esm/chunk-7QFBF7FS.mjs.map +0 -1
  334. package/dist/esm/chunk-7Z6DYLCA.mjs +0 -1
  335. package/dist/esm/chunk-AQ4I7VVB.mjs +0 -1
  336. package/dist/esm/chunk-AQ4I7VVB.mjs.map +0 -1
  337. package/dist/esm/chunk-C3AEWQ3A.mjs +0 -2
  338. package/dist/esm/chunk-C3AEWQ3A.mjs.map +0 -1
  339. package/dist/esm/chunk-CYDWEPFL.mjs +0 -1
  340. package/dist/esm/chunk-CYDWEPFL.mjs.map +0 -1
  341. package/dist/esm/chunk-D73X3S27.mjs +0 -2
  342. package/dist/esm/chunk-D73X3S27.mjs.map +0 -1
  343. package/dist/esm/chunk-DORK55K3.mjs.map +0 -1
  344. package/dist/esm/chunk-E7HMV2GZ.mjs +0 -2
  345. package/dist/esm/chunk-E7HMV2GZ.mjs.map +0 -1
  346. package/dist/esm/chunk-FJH4H4E5.mjs +0 -2
  347. package/dist/esm/chunk-FLYEALDB.mjs +0 -2
  348. package/dist/esm/chunk-FLYEALDB.mjs.map +0 -1
  349. package/dist/esm/chunk-FTWBJZYH.mjs +0 -2
  350. package/dist/esm/chunk-FTWBJZYH.mjs.map +0 -1
  351. package/dist/esm/chunk-FVU47J7S.mjs.map +0 -1
  352. package/dist/esm/chunk-GHVMDDWO.mjs +0 -2
  353. package/dist/esm/chunk-GOT527V2.mjs.map +0 -1
  354. package/dist/esm/chunk-GUWBE3CV.mjs.map +0 -1
  355. package/dist/esm/chunk-H5YTHO4L.mjs.map +0 -1
  356. package/dist/esm/chunk-HTSXKHXX.mjs +0 -2
  357. package/dist/esm/chunk-IPH435RF.mjs +0 -2
  358. package/dist/esm/chunk-IPH435RF.mjs.map +0 -1
  359. package/dist/esm/chunk-JXCZTOYC.mjs +0 -1
  360. package/dist/esm/chunk-JXCZTOYC.mjs.map +0 -1
  361. package/dist/esm/chunk-KGJITNRZ.mjs +0 -2
  362. package/dist/esm/chunk-KGJITNRZ.mjs.map +0 -1
  363. package/dist/esm/chunk-KY3SB7JG.mjs +0 -2
  364. package/dist/esm/chunk-KY3SB7JG.mjs.map +0 -1
  365. package/dist/esm/chunk-L3OMI2PE.mjs +0 -2
  366. package/dist/esm/chunk-L3OMI2PE.mjs.map +0 -1
  367. package/dist/esm/chunk-LX2KX36Q.mjs +0 -2
  368. package/dist/esm/chunk-LX2KX36Q.mjs.map +0 -1
  369. package/dist/esm/chunk-MIMIRNUQ.mjs +0 -2
  370. package/dist/esm/chunk-MIMIRNUQ.mjs.map +0 -1
  371. package/dist/esm/chunk-MO5LGCZV.mjs +0 -2
  372. package/dist/esm/chunk-MO5LGCZV.mjs.map +0 -1
  373. package/dist/esm/chunk-MQ32XR4V.mjs +0 -2
  374. package/dist/esm/chunk-MQ32XR4V.mjs.map +0 -1
  375. package/dist/esm/chunk-OJ4NIVFW.mjs.map +0 -1
  376. package/dist/esm/chunk-OKRUEVF3.mjs +0 -2
  377. package/dist/esm/chunk-OKRUEVF3.mjs.map +0 -1
  378. package/dist/esm/chunk-OPCSBCGS.mjs +0 -2
  379. package/dist/esm/chunk-OPCSBCGS.mjs.map +0 -1
  380. package/dist/esm/chunk-PKENQYTQ.mjs +0 -2
  381. package/dist/esm/chunk-QJHFD2MT.mjs.map +0 -1
  382. package/dist/esm/chunk-R7BAM2G6.mjs +0 -2
  383. package/dist/esm/chunk-R7BAM2G6.mjs.map +0 -1
  384. package/dist/esm/chunk-RFSO3JRG.mjs +0 -1
  385. package/dist/esm/chunk-RFSO3JRG.mjs.map +0 -1
  386. package/dist/esm/chunk-RQ6M2YQF.mjs +0 -2
  387. package/dist/esm/chunk-RQ6M2YQF.mjs.map +0 -1
  388. package/dist/esm/chunk-S5HG2QUD.mjs +0 -2
  389. package/dist/esm/chunk-S5HG2QUD.mjs.map +0 -1
  390. package/dist/esm/chunk-T7XMSCZV.mjs +0 -2
  391. package/dist/esm/chunk-T7XMSCZV.mjs.map +0 -1
  392. package/dist/esm/chunk-TTELTGMA.mjs.map +0 -1
  393. package/dist/esm/chunk-WPVBC4JS.mjs +0 -2
  394. package/dist/esm/chunk-WPVBC4JS.mjs.map +0 -1
  395. package/dist/esm/chunk-WTVN3XGK.mjs +0 -2
  396. package/dist/esm/chunk-WTVN3XGK.mjs.map +0 -1
  397. package/dist/esm/chunk-YE5B2S5L.mjs +0 -2
  398. package/dist/esm/chunk-YE5B2S5L.mjs.map +0 -1
  399. package/dist/esm/chunk-YQOKWIVY.mjs.map +0 -1
  400. package/dist/esm/core/crypto/ephemeral.d.mts +0 -77
  401. package/dist/esm/core/crypto/ephemeral.mjs +0 -2
  402. package/dist/esm/core/crypto/ephemeral.mjs.map +0 -1
  403. package/dist/esm/core/crypto/keyless.d.mts +0 -217
  404. package/dist/esm/core/crypto/keyless.mjs +0 -2
  405. package/dist/esm/core/crypto/keyless.mjs.map +0 -1
  406. package/dist/esm/core/crypto/poseidon.d.mts +0 -7
  407. package/dist/esm/core/crypto/poseidon.mjs +0 -2
  408. package/dist/esm/core/crypto/poseidon.mjs.map +0 -1
  409. package/dist/esm/internal/keyless.d.mts +0 -65
  410. package/dist/esm/internal/keyless.mjs +0 -2
  411. package/dist/esm/internal/keyless.mjs.map +0 -1
  412. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +0 -47
  413. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +0 -2
  414. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +0 -1
  415. package/dist/esm/types/keyless.d.mts +0 -14
  416. package/dist/esm/types/keyless.mjs +0 -1
  417. package/dist/esm/types/keyless.mjs.map +0 -1
  418. package/src/account/EphemeralKeyPair.ts +0 -115
  419. package/src/account/KeylessAccount.ts +0 -240
  420. package/src/account/MultiKeyAccount.ts +0 -119
  421. package/src/account/index.ts +0 -6
  422. package/src/api/keyless.ts +0 -34
  423. package/src/core/crypto/ephemeral.ts +0 -149
  424. package/src/core/crypto/keyless.ts +0 -508
  425. package/src/core/crypto/poseidon.ts +0 -134
  426. package/src/internal/keyless.ts +0 -185
  427. package/src/transactions/transactionBuilder/signingMessage.ts +0 -70
  428. package/src/types/keyless.ts +0 -6
  429. /package/dist/esm/{chunk-MRTAMMS3.mjs.map → chunk-2PFN7LYP.mjs.map} +0 -0
  430. /package/dist/esm/{chunk-PTIZKRON.mjs.map → chunk-3HV2C4SS.mjs.map} +0 -0
  431. /package/dist/esm/{chunk-FFVWTX36.mjs.map → chunk-4LMAVPA4.mjs.map} +0 -0
  432. /package/dist/esm/{chunk-PKENQYTQ.mjs.map → chunk-5OM4V4DR.mjs.map} +0 -0
  433. /package/dist/esm/{chunk-NCIRQZOJ.mjs.map → chunk-6IGEUEER.mjs.map} +0 -0
  434. /package/dist/esm/{chunk-IGJCOZGO.mjs.map → chunk-6MG4JAYB.mjs.map} +0 -0
  435. /package/dist/esm/{chunk-FYJMB23M.mjs.map → chunk-A556OVZY.mjs.map} +0 -0
  436. /package/dist/esm/{chunk-7PICPK26.mjs.map → chunk-BAV4XY7C.mjs.map} +0 -0
  437. /package/dist/esm/{chunk-HGXO74Q3.mjs.map → chunk-BBU2EE6D.mjs.map} +0 -0
  438. /package/dist/esm/{chunk-D4QQKQXJ.mjs.map → chunk-BRQYARQ3.mjs.map} +0 -0
  439. /package/dist/esm/{chunk-MWUJCP27.mjs.map → chunk-BWFJHFBQ.mjs.map} +0 -0
  440. /package/dist/esm/{chunk-3VGX3TXH.mjs.map → chunk-DMKUAQB7.mjs.map} +0 -0
  441. /package/dist/esm/{chunk-MGOHPDX4.mjs.map → chunk-DSTKXJMA.mjs.map} +0 -0
  442. /package/dist/esm/{account/Account.mjs.map → chunk-E7FWVXGX.mjs.map} +0 -0
  443. /package/dist/esm/{chunk-W3UCKFFU.mjs.map → chunk-EJCKCYYI.mjs.map} +0 -0
  444. /package/dist/esm/{chunk-EB7AI4B4.mjs.map → chunk-FS3NSGBF.mjs.map} +0 -0
  445. /package/dist/esm/{chunk-JTCWZB3Q.mjs.map → chunk-FXNFWLQC.mjs.map} +0 -0
  446. /package/dist/esm/{account/Ed25519Account.mjs.map → chunk-GED6IT3S.mjs.map} +0 -0
  447. /package/dist/esm/{chunk-AZABJ5QQ.mjs.map → chunk-GRT5PHL6.mjs.map} +0 -0
  448. /package/dist/esm/{chunk-3HL2ZWKG.mjs.map → chunk-GXYS45Y5.mjs.map} +0 -0
  449. /package/dist/esm/{chunk-T23OVRNF.mjs.map → chunk-IOSQVDZI.mjs.map} +0 -0
  450. /package/dist/esm/{chunk-VLUJRHOL.mjs.map → chunk-KDCHX7BI.mjs.map} +0 -0
  451. /package/dist/esm/{chunk-4MS27RPK.mjs.map → chunk-L6PGWGFF.mjs.map} +0 -0
  452. /package/dist/esm/{account/EphemeralKeyPair.mjs.map → chunk-MLWIHWNH.mjs.map} +0 -0
  453. /package/dist/esm/{chunk-7STYQ5ZE.mjs.map → chunk-NPFNYP75.mjs.map} +0 -0
  454. /package/dist/esm/{chunk-UT37XKQU.mjs.map → chunk-OGHE4AQA.mjs.map} +0 -0
  455. /package/dist/esm/{chunk-QI2ILOP4.mjs.map → chunk-PJLCPRYJ.mjs.map} +0 -0
  456. /package/dist/esm/{chunk-6RBUXB5I.mjs.map → chunk-QIAHBEEW.mjs.map} +0 -0
  457. /package/dist/esm/{chunk-NC5HHEEM.mjs.map → chunk-QTRYMRYK.mjs.map} +0 -0
  458. /package/dist/esm/{chunk-Q5T2WL2M.mjs.map → chunk-QWRH22H4.mjs.map} +0 -0
  459. /package/dist/esm/{chunk-STYDBDYL.mjs.map → chunk-R5QUBEH6.mjs.map} +0 -0
  460. /package/dist/esm/{account/KeylessAccount.mjs.map → chunk-R7G3CLRI.mjs.map} +0 -0
  461. /package/dist/esm/{chunk-ZNEBMSNC.mjs.map → chunk-RHBCVCOS.mjs.map} +0 -0
  462. /package/dist/esm/{chunk-LJ624HBI.mjs.map → chunk-RQEWIZ67.mjs.map} +0 -0
  463. /package/dist/esm/{chunk-3FVRXELT.mjs.map → chunk-TBMAJ6AW.mjs.map} +0 -0
  464. /package/dist/esm/{chunk-ZGTJMNZG.mjs.map → chunk-TC3VVMPY.mjs.map} +0 -0
  465. /package/dist/esm/{chunk-FEWIHUNW.mjs.map → chunk-TGXZVNR5.mjs.map} +0 -0
  466. /package/dist/esm/{chunk-PFFAQZHT.mjs.map → chunk-U43IJHQN.mjs.map} +0 -0
  467. /package/dist/esm/{chunk-HGZGTBA4.mjs.map → chunk-UML2VQZT.mjs.map} +0 -0
  468. /package/dist/esm/{chunk-47DNXBM6.mjs.map → chunk-UPIN5AIO.mjs.map} +0 -0
  469. /package/dist/esm/{account/MultiKeyAccount.mjs.map → chunk-UVSRX4SV.mjs.map} +0 -0
  470. /package/dist/esm/{chunk-COW5IGYC.mjs.map → chunk-WFZDFFBM.mjs.map} +0 -0
  471. /package/dist/esm/{chunk-XHPLLMR5.mjs.map → chunk-XLPVG4XR.mjs.map} +0 -0
  472. /package/dist/esm/{chunk-YQUZLZL4.mjs.map → chunk-YBEF3UR3.mjs.map} +0 -0
  473. /package/dist/esm/{chunk-4MHEB5MN.mjs.map → chunk-YKVKSNH4.mjs.map} +0 -0
  474. /package/dist/esm/{chunk-C3L4ETUF.mjs.map → chunk-ZYYK3UXP.mjs.map} +0 -0
  475. /package/dist/esm/{account/SingleKeyAccount.mjs.map → core/account/Account.mjs.map} +0 -0
  476. /package/dist/esm/{account/index.mjs.map → core/account/Ed25519Account.mjs.map} +0 -0
  477. /package/dist/esm/{api/keyless.mjs.map → core/account/SingleKeyAccount.mjs.map} +0 -0
  478. /package/dist/esm/{chunk-7Z6DYLCA.mjs.map → utils/normalizeBundle.mjs.map} +0 -0
@@ -1,87 +0,0 @@
1
- import { SigningScheme, HexInput } from '../types/index.mjs';
2
- import { AccountAddress } from '../core/accountAddress.mjs';
3
- import { Deserializer } from '../bcs/deserializer.mjs';
4
- import { Serializer } from '../bcs/serializer.mjs';
5
- import { Hex } from '../core/hex.mjs';
6
- import { Signature } from '../core/crypto/signature.mjs';
7
- import { KeylessPublicKey, SignedGroth16Signature } from '../core/crypto/keyless.mjs';
8
- import { A as Account } from '../Ed25519Account-8gJF5t3F.mjs';
9
- import { EphemeralKeyPair } from './EphemeralKeyPair.mjs';
10
- import { AccountAuthenticatorSingleKey } from '../transactions/authenticator/account.mjs';
11
- import { AnyRawTransaction } from '../transactions/types.mjs';
12
- import '../utils/apiEndpoints.mjs';
13
- import '../types/indexer.mjs';
14
- import '../types/generated/operations.mjs';
15
- import '../types/generated/types.mjs';
16
- import '../core/common.mjs';
17
- import '../transactions/instances/transactionArgument.mjs';
18
- import '../publicKey-lq5djCIY.mjs';
19
- import '../core/crypto/ephemeral.mjs';
20
- import '../core/crypto/ed25519.mjs';
21
- import '../core/crypto/privateKey.mjs';
22
- import '../core/crypto/singleKey.mjs';
23
- import '../core/crypto/multiEd25519.mjs';
24
- import '../core/crypto/multiKey.mjs';
25
- import '../api/aptosConfig.mjs';
26
- import '../utils/const.mjs';
27
- import '../bcs/serializable/moveStructs.mjs';
28
- import '../bcs/serializable/movePrimitives.mjs';
29
- import '../bcs/serializable/fixedBytes.mjs';
30
- import '../transactions/instances/rawTransaction.mjs';
31
- import '../transactions/instances/chainId.mjs';
32
- import '../transactions/instances/transactionPayload.mjs';
33
- import '../transactions/instances/identifier.mjs';
34
- import '../transactions/instances/moduleId.mjs';
35
- import '../transactions/typeTag/index.mjs';
36
- import '../transactions/instances/simpleTransaction.mjs';
37
- import '../transactions/instances/multiAgentTransaction.mjs';
38
-
39
- declare class KeylessAccount implements Account {
40
- static readonly PEPPER_LENGTH: number;
41
- static readonly SLIP_0010_SEED: string;
42
- publicKey: KeylessPublicKey;
43
- ephemeralKeyPair: EphemeralKeyPair;
44
- uidKey: string;
45
- uidVal: string;
46
- aud: string;
47
- pepper: Uint8Array;
48
- accountAddress: AccountAddress;
49
- proof: SignedGroth16Signature;
50
- signingScheme: SigningScheme;
51
- jwt: string;
52
- constructor(args: {
53
- address?: AccountAddress;
54
- ephemeralKeyPair: EphemeralKeyPair;
55
- iss: string;
56
- uidKey: string;
57
- uidVal: string;
58
- aud: string;
59
- pepper: HexInput;
60
- proof: SignedGroth16Signature;
61
- jwt: string;
62
- });
63
- serialize(serializer: Serializer): void;
64
- static deserialize(deserializer: Deserializer): KeylessAccount;
65
- bcsToBytes(): Uint8Array;
66
- bcsToHex(): Hex;
67
- signWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey;
68
- waitForProofFetch(): Promise<void>;
69
- sign(data: HexInput): Signature;
70
- signTransaction(transaction: AnyRawTransaction): Signature;
71
- signWithOpenIdSignature(data: HexInput): Signature;
72
- verifySignature(args: {
73
- message: HexInput;
74
- signature: Signature;
75
- }): boolean;
76
- static fromBytes(bytes: Uint8Array): KeylessAccount;
77
- static fromJWTAndProof(args: {
78
- proof: SignedGroth16Signature;
79
- jwt: string;
80
- ephemeralKeyPair: EphemeralKeyPair;
81
- pepper: HexInput;
82
- uidKey?: string;
83
- }): KeylessAccount;
84
- static fromDerivationPath(path: string, seed: Uint8Array): Uint8Array;
85
- }
86
-
87
- export { KeylessAccount };
@@ -1,2 +0,0 @@
1
- import{a}from"../chunk-MQ32XR4V.mjs";import"../chunk-MO5LGCZV.mjs";import"../chunk-D73X3S27.mjs";import"../chunk-ICXA3DZH.mjs";import"../chunk-47DNXBM6.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-NC5HHEEM.mjs";import"../chunk-PKENQYTQ.mjs";import"../chunk-ZGTJMNZG.mjs";import"../chunk-WPVBC4JS.mjs";import"../chunk-UT37XKQU.mjs";import"../chunk-FEWIHUNW.mjs";import"../chunk-3VGX3TXH.mjs";import"../chunk-MWUJCP27.mjs";import"../chunk-ZNEBMSNC.mjs";import"../chunk-MGOHPDX4.mjs";import"../chunk-RFSO3JRG.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-KGJITNRZ.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-6M6XXPQQ.mjs";import"../chunk-PTIZKRON.mjs";import"../chunk-WTVN3XGK.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-R7BAM2G6.mjs";import"../chunk-XHPLLMR5.mjs";import"../chunk-7JNPSNL6.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-S5HG2QUD.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-6IFMQ5AS.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-OKRUEVF3.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{a as KeylessAccount};
2
- //# sourceMappingURL=KeylessAccount.mjs.map
@@ -1,99 +0,0 @@
1
- import { A as Account } from '../Ed25519Account-8gJF5t3F.mjs';
2
- import { SigningScheme, HexInput } from '../types/index.mjs';
3
- import { AccountAddress } from '../core/accountAddress.mjs';
4
- import { P as PublicKey } from '../publicKey-lq5djCIY.mjs';
5
- import { Signature } from '../core/crypto/signature.mjs';
6
- import { MultiKey, MultiSignature } from '../core/crypto/multiKey.mjs';
7
- import { AccountAuthenticatorMultiKey } from '../transactions/authenticator/account.mjs';
8
- import { AnyRawTransaction } from '../transactions/types.mjs';
9
- import '../core/crypto/ed25519.mjs';
10
- import '../bcs/deserializer.mjs';
11
- import '../bcs/serializer.mjs';
12
- import '../core/hex.mjs';
13
- import '../core/common.mjs';
14
- import '../core/crypto/privateKey.mjs';
15
- import '../core/crypto/singleKey.mjs';
16
- import '../utils/apiEndpoints.mjs';
17
- import '../types/indexer.mjs';
18
- import '../types/generated/operations.mjs';
19
- import '../types/generated/types.mjs';
20
- import '../transactions/instances/transactionArgument.mjs';
21
- import '../core/crypto/multiEd25519.mjs';
22
- import '../api/aptosConfig.mjs';
23
- import '../utils/const.mjs';
24
- import '../bcs/serializable/moveStructs.mjs';
25
- import '../bcs/serializable/movePrimitives.mjs';
26
- import '../bcs/serializable/fixedBytes.mjs';
27
- import '../transactions/instances/rawTransaction.mjs';
28
- import '../transactions/instances/chainId.mjs';
29
- import '../transactions/instances/transactionPayload.mjs';
30
- import '../transactions/instances/identifier.mjs';
31
- import '../transactions/instances/moduleId.mjs';
32
- import '../transactions/typeTag/index.mjs';
33
- import '../transactions/instances/simpleTransaction.mjs';
34
- import '../transactions/instances/multiAgentTransaction.mjs';
35
-
36
- declare class MultiKeyAccount implements Account {
37
- /**
38
- * Public key associated with the account
39
- */
40
- readonly publicKey: MultiKey;
41
- /**
42
- * Account address associated with the account
43
- */
44
- readonly accountAddress: AccountAddress;
45
- /**
46
- * Signing scheme used to sign transactions
47
- */
48
- readonly signingScheme: SigningScheme;
49
- signers: Account[];
50
- signaturesBitmap: Uint8Array;
51
- /**
52
- * constructor for Account
53
- *
54
- * Need to update this to use the new crypto library if new schemes are added.
55
- *
56
- * @param args.privateKey PrivateKey - private key of the account
57
- * @param args.address AccountAddress - address of the account
58
- * @param args.legacy optional. If set to false, the keypair authentication keys will be derived with a unified scheme.
59
- * Defaults to deriving an authentication key with the legacy scheme.
60
- *
61
- * This method is private because it should only be called by the factory static methods.
62
- * @returns Account
63
- */
64
- constructor(args: {
65
- multiKey: MultiKey;
66
- signers: Account[];
67
- });
68
- static fromPublicKeysAndSigners(args: {
69
- publicKeys: PublicKey[];
70
- signaturesRequired: number;
71
- signers: Account[];
72
- }): MultiKeyAccount;
73
- static isMultiKeySigner(account: Account): account is MultiKeyAccount;
74
- signWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorMultiKey;
75
- waitForProofFetch(): Promise<void>;
76
- /**
77
- * Sign the given message with the private key.
78
- *
79
- * TODO: Add sign transaction or specific types
80
- *
81
- * @param data in HexInput format
82
- * @returns Signature
83
- */
84
- sign(data: HexInput): MultiSignature;
85
- signTransaction(transaction: AnyRawTransaction): MultiSignature;
86
- /**
87
- * Verify the given message and signature with the public key.
88
- *
89
- * @param args.message raw message data in HexInput format
90
- * @param args.signature signed message Signature
91
- * @returns
92
- */
93
- verifySignature(args: {
94
- message: HexInput;
95
- signature: Signature;
96
- }): boolean;
97
- }
98
-
99
- export { MultiKeyAccount };
@@ -1,2 +0,0 @@
1
- import{a}from"../chunk-MIMIRNUQ.mjs";import"../chunk-MQ32XR4V.mjs";import"../chunk-MO5LGCZV.mjs";import"../chunk-D73X3S27.mjs";import"../chunk-ICXA3DZH.mjs";import"../chunk-47DNXBM6.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-NC5HHEEM.mjs";import"../chunk-PKENQYTQ.mjs";import"../chunk-ZGTJMNZG.mjs";import"../chunk-WPVBC4JS.mjs";import"../chunk-UT37XKQU.mjs";import"../chunk-FEWIHUNW.mjs";import"../chunk-3VGX3TXH.mjs";import"../chunk-MWUJCP27.mjs";import"../chunk-ZNEBMSNC.mjs";import"../chunk-MGOHPDX4.mjs";import"../chunk-RFSO3JRG.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-KGJITNRZ.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-6M6XXPQQ.mjs";import"../chunk-PTIZKRON.mjs";import"../chunk-WTVN3XGK.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-R7BAM2G6.mjs";import"../chunk-XHPLLMR5.mjs";import"../chunk-7JNPSNL6.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-S5HG2QUD.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-6IFMQ5AS.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-OKRUEVF3.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{a as MultiKeyAccount};
2
- //# sourceMappingURL=MultiKeyAccount.mjs.map
@@ -1,34 +0,0 @@
1
- import '../transactions/authenticator/account.mjs';
2
- import '../types/index.mjs';
3
- import '../core/accountAddress.mjs';
4
- import '../core/crypto/privateKey.mjs';
5
- import '../core/crypto/singleKey.mjs';
6
- export { l as SingleKeyAccount, S as SingleKeySignerConstructorArgs, j as SingleKeySignerFromDerivationPathArgs, i as SingleKeySignerGenerateArgs, k as VerifySingleKeySignatureArgs } from '../Ed25519Account-8gJF5t3F.mjs';
7
- import '../transactions/types.mjs';
8
- import '../bcs/deserializer.mjs';
9
- import '../utils/apiEndpoints.mjs';
10
- import '../types/indexer.mjs';
11
- import '../types/generated/operations.mjs';
12
- import '../types/generated/types.mjs';
13
- import '../bcs/serializer.mjs';
14
- import '../core/hex.mjs';
15
- import '../core/common.mjs';
16
- import '../core/crypto/ed25519.mjs';
17
- import '../publicKey-lq5djCIY.mjs';
18
- import '../core/crypto/signature.mjs';
19
- import '../transactions/instances/transactionArgument.mjs';
20
- import '../core/crypto/multiEd25519.mjs';
21
- import '../core/crypto/multiKey.mjs';
22
- import '../api/aptosConfig.mjs';
23
- import '../utils/const.mjs';
24
- import '../bcs/serializable/moveStructs.mjs';
25
- import '../bcs/serializable/movePrimitives.mjs';
26
- import '../bcs/serializable/fixedBytes.mjs';
27
- import '../transactions/instances/rawTransaction.mjs';
28
- import '../transactions/instances/chainId.mjs';
29
- import '../transactions/instances/transactionPayload.mjs';
30
- import '../transactions/instances/identifier.mjs';
31
- import '../transactions/instances/moduleId.mjs';
32
- import '../transactions/typeTag/index.mjs';
33
- import '../transactions/instances/simpleTransaction.mjs';
34
- import '../transactions/instances/multiAgentTransaction.mjs';
@@ -1,2 +0,0 @@
1
- import{a}from"../chunk-OPCSBCGS.mjs";import"../chunk-D73X3S27.mjs";import"../chunk-ICXA3DZH.mjs";import"../chunk-47DNXBM6.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-NC5HHEEM.mjs";import"../chunk-PKENQYTQ.mjs";import"../chunk-ZGTJMNZG.mjs";import"../chunk-WPVBC4JS.mjs";import"../chunk-UT37XKQU.mjs";import"../chunk-FEWIHUNW.mjs";import"../chunk-3VGX3TXH.mjs";import"../chunk-MWUJCP27.mjs";import"../chunk-ZNEBMSNC.mjs";import"../chunk-MGOHPDX4.mjs";import"../chunk-RFSO3JRG.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-KGJITNRZ.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-6M6XXPQQ.mjs";import"../chunk-PTIZKRON.mjs";import"../chunk-WTVN3XGK.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-R7BAM2G6.mjs";import"../chunk-XHPLLMR5.mjs";import"../chunk-7JNPSNL6.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-S5HG2QUD.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-6IFMQ5AS.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-OKRUEVF3.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{a as SingleKeyAccount};
2
- //# sourceMappingURL=SingleKeyAccount.mjs.map
@@ -1,39 +0,0 @@
1
- export { A as Account, e as CreateAccountFromPrivateKeyArgs, C as CreateEd25519AccountFromPrivateKeyArgs, c as CreateEd25519SingleKeyAccountFromPrivateKeyArgs, d as CreateSingleKeyAccountFromPrivateKeyArgs, b as Ed25519Account, E as Ed25519SignerConstructorArgs, a as Ed25519SignerFromDerivationPathArgs, h as GenerateAccountArgs, G as GenerateEd25519AccountArgs, f as GenerateEd25519SingleKeyAccountArgs, g as GenerateSingleKeyAccountArgs, P as PrivateKeyFromDerivationPathArgs, l as SingleKeyAccount, S as SingleKeySignerConstructorArgs, j as SingleKeySignerFromDerivationPathArgs, i as SingleKeySignerGenerateArgs, V as VerifyEd25519SignatureArgs, k as VerifySingleKeySignatureArgs } from '../Ed25519Account-8gJF5t3F.mjs';
2
- export { KeylessAccount } from './KeylessAccount.mjs';
3
- export { EphemeralKeyPair } from './EphemeralKeyPair.mjs';
4
- export { MultiKeyAccount } from './MultiKeyAccount.mjs';
5
- import '../transactions/authenticator/account.mjs';
6
- import '../bcs/deserializer.mjs';
7
- import '../types/index.mjs';
8
- import '../utils/apiEndpoints.mjs';
9
- import '../types/indexer.mjs';
10
- import '../types/generated/operations.mjs';
11
- import '../types/generated/types.mjs';
12
- import '../bcs/serializer.mjs';
13
- import '../core/hex.mjs';
14
- import '../core/common.mjs';
15
- import '../core/crypto/ed25519.mjs';
16
- import '../publicKey-lq5djCIY.mjs';
17
- import '../core/accountAddress.mjs';
18
- import '../transactions/instances/transactionArgument.mjs';
19
- import '../core/crypto/signature.mjs';
20
- import '../core/crypto/privateKey.mjs';
21
- import '../core/crypto/multiEd25519.mjs';
22
- import '../core/crypto/multiKey.mjs';
23
- import '../core/crypto/singleKey.mjs';
24
- import '../transactions/types.mjs';
25
- import '../api/aptosConfig.mjs';
26
- import '../utils/const.mjs';
27
- import '../bcs/serializable/moveStructs.mjs';
28
- import '../bcs/serializable/movePrimitives.mjs';
29
- import '../bcs/serializable/fixedBytes.mjs';
30
- import '../transactions/instances/rawTransaction.mjs';
31
- import '../transactions/instances/chainId.mjs';
32
- import '../transactions/instances/transactionPayload.mjs';
33
- import '../transactions/instances/identifier.mjs';
34
- import '../transactions/instances/moduleId.mjs';
35
- import '../transactions/typeTag/index.mjs';
36
- import '../transactions/instances/simpleTransaction.mjs';
37
- import '../transactions/instances/multiAgentTransaction.mjs';
38
- import '../core/crypto/keyless.mjs';
39
- import '../core/crypto/ephemeral.mjs';
@@ -1,2 +0,0 @@
1
- import"../chunk-7Z6DYLCA.mjs";import{a as c}from"../chunk-FVU47J7S.mjs";import{a}from"../chunk-C3AEWQ3A.mjs";import{a as f}from"../chunk-MIMIRNUQ.mjs";import{a as e}from"../chunk-MQ32XR4V.mjs";import{a as d}from"../chunk-MO5LGCZV.mjs";import{a as b}from"../chunk-OPCSBCGS.mjs";import"../chunk-D73X3S27.mjs";import"../chunk-ICXA3DZH.mjs";import"../chunk-47DNXBM6.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-NC5HHEEM.mjs";import"../chunk-PKENQYTQ.mjs";import"../chunk-ZGTJMNZG.mjs";import"../chunk-WPVBC4JS.mjs";import"../chunk-UT37XKQU.mjs";import"../chunk-FEWIHUNW.mjs";import"../chunk-3VGX3TXH.mjs";import"../chunk-MWUJCP27.mjs";import"../chunk-ZNEBMSNC.mjs";import"../chunk-MGOHPDX4.mjs";import"../chunk-RFSO3JRG.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-KGJITNRZ.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-6M6XXPQQ.mjs";import"../chunk-PTIZKRON.mjs";import"../chunk-WTVN3XGK.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-R7BAM2G6.mjs";import"../chunk-XHPLLMR5.mjs";import"../chunk-7JNPSNL6.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-S5HG2QUD.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-6IFMQ5AS.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-OKRUEVF3.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{c as Account,a as Ed25519Account,d as EphemeralKeyPair,e as KeylessAccount,f as MultiKeyAccount,b as SingleKeyAccount};
2
- //# sourceMappingURL=index.mjs.map
@@ -1,65 +0,0 @@
1
- import { HexInput } from '../types/index.mjs';
2
- import { AptosConfig } from './aptosConfig.mjs';
3
- import { KeylessAccount } from '../account/KeylessAccount.mjs';
4
- import { EphemeralKeyPair } from '../account/EphemeralKeyPair.mjs';
5
- import '../utils/apiEndpoints.mjs';
6
- import '../types/indexer.mjs';
7
- import '../types/generated/operations.mjs';
8
- import '../types/generated/types.mjs';
9
- import '../utils/const.mjs';
10
- import '../core/accountAddress.mjs';
11
- import '../bcs/serializer.mjs';
12
- import '../core/hex.mjs';
13
- import '../core/common.mjs';
14
- import '../bcs/deserializer.mjs';
15
- import '../transactions/instances/transactionArgument.mjs';
16
- import '../core/crypto/signature.mjs';
17
- import '../core/crypto/keyless.mjs';
18
- import '../publicKey-lq5djCIY.mjs';
19
- import '../core/crypto/ephemeral.mjs';
20
- import '../core/crypto/ed25519.mjs';
21
- import '../core/crypto/privateKey.mjs';
22
- import '../Ed25519Account-8gJF5t3F.mjs';
23
- import '../transactions/authenticator/account.mjs';
24
- import '../core/crypto/multiEd25519.mjs';
25
- import '../core/crypto/multiKey.mjs';
26
- import '../core/crypto/singleKey.mjs';
27
- import '../transactions/types.mjs';
28
- import '../bcs/serializable/moveStructs.mjs';
29
- import '../bcs/serializable/movePrimitives.mjs';
30
- import '../bcs/serializable/fixedBytes.mjs';
31
- import '../transactions/instances/rawTransaction.mjs';
32
- import '../transactions/instances/chainId.mjs';
33
- import '../transactions/instances/transactionPayload.mjs';
34
- import '../transactions/instances/identifier.mjs';
35
- import '../transactions/instances/moduleId.mjs';
36
- import '../transactions/typeTag/index.mjs';
37
- import '../transactions/instances/simpleTransaction.mjs';
38
- import '../transactions/instances/multiAgentTransaction.mjs';
39
-
40
- /**
41
- * A class to query all `OIDB` related queries on Aptos.
42
- */
43
- declare class Keyless {
44
- readonly config: AptosConfig;
45
- constructor(config: AptosConfig);
46
- /**
47
- * TODO
48
- *
49
- * @param args.jwt jwt token
50
- * @returns The pepper
51
- */
52
- getPepper(args: {
53
- jwt: string;
54
- ephemeralKeyPair: EphemeralKeyPair;
55
- }): Promise<Uint8Array>;
56
- deriveKeylessAccount(args: {
57
- jwt: string;
58
- ephemeralKeyPair: EphemeralKeyPair;
59
- uidKey?: string;
60
- pepper?: HexInput;
61
- extraFieldKey?: string;
62
- }): Promise<KeylessAccount>;
63
- }
64
-
65
- export { Keyless };
@@ -1,2 +0,0 @@
1
- import{a}from"../chunk-FTWBJZYH.mjs";import"../chunk-IPH435RF.mjs";import"../chunk-7Z6DYLCA.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-RQ6M2YQF.mjs";import"../chunk-FJH4H4E5.mjs";import"../chunk-HTSXKHXX.mjs";import"../chunk-CYDWEPFL.mjs";import"../chunk-6FBKUTGF.mjs";import"../chunk-5VSMDXZ6.mjs";import"../chunk-GHVMDDWO.mjs";import"../chunk-FVU47J7S.mjs";import"../chunk-C3AEWQ3A.mjs";import"../chunk-MIMIRNUQ.mjs";import"../chunk-MQ32XR4V.mjs";import"../chunk-MO5LGCZV.mjs";import"../chunk-OPCSBCGS.mjs";import"../chunk-D73X3S27.mjs";import"../chunk-ICXA3DZH.mjs";import"../chunk-47DNXBM6.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-NC5HHEEM.mjs";import"../chunk-PKENQYTQ.mjs";import"../chunk-ZGTJMNZG.mjs";import"../chunk-WPVBC4JS.mjs";import"../chunk-UT37XKQU.mjs";import"../chunk-FEWIHUNW.mjs";import"../chunk-3VGX3TXH.mjs";import"../chunk-MWUJCP27.mjs";import"../chunk-ZNEBMSNC.mjs";import"../chunk-MGOHPDX4.mjs";import"../chunk-RFSO3JRG.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-KGJITNRZ.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-6M6XXPQQ.mjs";import"../chunk-PTIZKRON.mjs";import"../chunk-WTVN3XGK.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-R7BAM2G6.mjs";import"../chunk-XHPLLMR5.mjs";import"../chunk-7JNPSNL6.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-S5HG2QUD.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-6IFMQ5AS.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-OKRUEVF3.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{a as Keyless};
2
- //# sourceMappingURL=keyless.mjs.map
@@ -1,2 +0,0 @@
1
- import{g as e}from"./chunk-4MHEB5MN.mjs";import{d as c}from"./chunk-FJH4H4E5.mjs";import{d as r}from"./chunk-YE5B2S5L.mjs";import{b as s}from"./chunk-T23OVRNF.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
2
- //# sourceMappingURL=chunk-4MS27RPK.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as d}from"./chunk-GOT527V2.mjs";import{a as A}from"./chunk-VLUJRHOL.mjs";import{a as T}from"./chunk-YQUZLZL4.mjs";import{a as y}from"./chunk-3HL2ZWKG.mjs";import{d as g,e as a,h as m,i as p,j as f}from"./chunk-E7HMV2GZ.mjs";import{a as i,b as s,c as r,d as e,e as c,g as u}from"./chunk-4MHEB5MN.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return a({...n})}signAsFeePayer(n){let{signer:t,transaction:o}=n;if(!o.feePayerAddress)throw new Error(`Transaction ${o} is not a Fee Payer transaction`);return o.feePayerAddress=t.accountAddress,a({signer:t,transaction:o})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:o,options:P}=n;this.batch.forSingleAccount({sender:t,data:o,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:o}=n;return m({aptosConfig:this.config,signer:t,transaction:o})}};export{h as a};
2
- //# sourceMappingURL=chunk-4VAQCOR6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getGasPriceEstimation,\n getTransactionByHash,\n getTransactionByVersion,\n getTransactions,\n isTransactionPending,\n waitForTransaction,\n} from \"../internal/transaction\";\nimport {\n AnyNumber,\n CommittedTransactionResponse,\n GasEstimation,\n HexInput,\n PaginationArgs,\n PendingTransactionResponse,\n TransactionResponse,\n WaitForTransactionOptions,\n} from \"../types\";\nimport {\n getSigningMessage,\n publicPackageTransaction,\n rotateAuthKey,\n signAndSubmitTransaction,\n signTransaction,\n} from \"../internal/transactionSubmission\";\nimport {\n AccountAuthenticator,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n InputGenerateTransactionPayloadData,\n} from \"../transactions\";\nimport { AccountAddressInput, PrivateKey } from \"../core\";\nimport { Account } from \"../account\";\nimport { Build } from \"./transactionSubmission/build\";\nimport { Simulate } from \"./transactionSubmission/simulate\";\nimport { Submit } from \"./transactionSubmission/submit\";\nimport { TransactionManagement } from \"./transactionSubmission/management\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\nexport class Transaction {\n readonly config: AptosConfig;\n\n readonly build: Build;\n\n readonly simulate: Simulate;\n\n readonly submit: Submit;\n\n readonly batch: TransactionManagement;\n\n constructor(config: AptosConfig) {\n this.config = config;\n this.build = new Build(this.config);\n this.simulate = new Simulate(this.config);\n this.submit = new Submit(this.config);\n this.batch = new TransactionManagement(this.config);\n }\n\n /**\n * Queries on-chain transactions. This function will not return pending\n * transactions. For that, use `getTransactionsByHash`.\n *\n * @example\n * const transactions = await aptos.getTransactions()\n *\n * @param args.options.offset The number transaction to start with\n * @param args.options.limit Number of results to return\n *\n * @returns Array of on-chain transactions\n */\n async getTransactions(args?: { options?: PaginationArgs }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by version. This function will not return pending transactions.\n *\n * @example\n * const transaction = await aptos.getTransactions({ledgerVersion:1})\n *\n * @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.\n * @returns On-chain transaction. Only on-chain transactions have versions, so this\n * function cannot be used to query pending transactions.\n */\n async getTransactionByVersion(args: { ledgerVersion: AnyNumber }): Promise<TransactionResponse> {\n return getTransactionByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by transaction hash. This function will return pending transactions.\n *\n * @example\n * const transaction = await aptos.getTransactionByHash({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash - Transaction hash should be hex-encoded bytes string with 0x prefix.\n * @returns Transaction from mempool (pending) or on-chain (committed) transaction\n */\n async getTransactionByHash(args: { transactionHash: HexInput }): Promise<TransactionResponse> {\n return getTransactionByHash({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Defines if specified transaction is currently in pending state\n *\n * To create a transaction hash:\n *\n * 1. Create a hash message from the bytes: \"Aptos::Transaction\" bytes + the BCS-serialized Transaction bytes.\n * 2. Apply hash algorithm SHA3-256 to the hash message bytes.\n * 3. Hex-encode the hash bytes with 0x prefix.\n *\n * @example\n * const isPendingTransaction = await aptos.isPendingTransaction({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash A hash of transaction\n * @returns `true` if transaction is in pending state and `false` otherwise\n */\n async isPendingTransaction(args: { transactionHash: HexInput }): Promise<boolean> {\n return isTransactionPending({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Waits for a transaction to move past the pending state.\n *\n * There are 4 cases.\n * 1. Transaction is successfully processed and committed to the chain.\n * - The function will resolve with the transaction response from the API.\n * 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.\n * - The function will throw an AptosApiError with an HTTP status code indicating some problem with the request.\n * 3. Transaction is committed but execution failed, meaning no changes were\n * written to the blockchain state.\n * - If `checkSuccess` is true, the function will throw a FailedTransactionError\n * If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.\n * 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.\n * - The function will throw a WaitForTransactionError\n *\n * @example\n * const transaction = await aptos.waitForTransaction({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash The hash of a transaction previously submitted to the blockchain.\n * @param args.options.timeoutSecs Timeout in seconds. Defaults to 20 seconds.\n * @param args.options.checkSuccess A boolean which controls whether the function will error if the transaction failed.\n * Defaults to true. See case 3 above.\n * @returns The transaction on-chain. See above for more details.\n */\n async waitForTransaction(args: {\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n }): Promise<CommittedTransactionResponse> {\n return waitForTransaction({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Gives an estimate of the gas unit price required to get a\n * transaction on chain in a reasonable amount of time.\n * For more information {@link https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}\n *\n * @returns Object holding the outputs of the estimate gas API\n *\n * @example\n * const gasPrice = await aptos.waitForTransaction()\n */\n async getGasPriceEstimation(): Promise<GasEstimation> {\n return getGasPriceEstimation({\n aptosConfig: this.config,\n });\n }\n\n /**\n * Returns a signing message for a transaction.\n *\n * This allows a user to sign a transaction using their own preferred signing method, and\n * then submit it to the network.\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const message = await aptos.getSigningMessage({transaction})\n *\n * @param args.transaction A raw transaction for signing elsewhere\n */\n // eslint-disable-next-line class-methods-use-this\n getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {\n return getSigningMessage(args);\n }\n\n /**\n * Generates a transaction to publish a move package to chain.\n *\n * To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command\n * `aptos move compile --save-metadata ...`,\n * For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}\n *\n * @example\n * const transaction = await aptos.publishPackageTransaction({\n * account: alice,\n * metadataBytes,\n * moduleBytecode: [byteCode],\n * })\n *\n * @param args.account The publisher account\n * @param args.metadataBytes The package metadata bytes\n * @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async publishPackageTransaction(args: {\n account: AccountAddressInput;\n metadataBytes: HexInput;\n moduleBytecode: Array<HexInput>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return publicPackageTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for\n * the account.\n * Note: Only legacy Ed25519 scheme is supported for now.\n * More info: {@link https://aptos.dev/guides/account-management/key-rotation/}\n *\n * @example\n * const response = await aptos.rotateAuthKey({\n * fromAccount: alice,\n * toNewPrivateKey: new ED25519PublicKey(\"0x123\"),\n * })\n *\n * @param args.fromAccount The account to rotate the auth key for\n * @param args.toNewPrivateKey The new private key to rotate to\n *\n * @returns PendingTransactionResponse\n */\n async rotateAuthKey(args: { fromAccount: Account; toNewPrivateKey: PrivateKey }): Promise<TransactionResponse> {\n return rotateAuthKey({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sign a transaction that can later be submitted to chain\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.transaction.sign({\n * signer: alice,\n * transaction\n * })\n *\n * @param args.signer The signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n /**\n * Sign a transaction as a fee payer that can later be submitted to chain\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.transaction.signAsFeePayer({\n * signer: alice,\n * transaction\n * })\n *\n * @param args.signer The fee payer signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesnt hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n }\n\n // TRANSACTION SUBMISSION //\n\n /**\n * @deprecated Prefer to use `aptos.transaction.batch.forSingleAccount()`\n *\n * Batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * dont rely on each other, i.e batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n */\n async batchTransactionsForSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): Promise<void> {\n try {\n const { sender, data, options } = args;\n this.batch.forSingleAccount({ sender, data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n\n /**\n * Sign and submit a single signer transaction to chain\n *\n * @param args.signer The signer account to sign the transaction\n * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.signAndSubmitTransaction({\n * signer: alice,\n * transaction\n * })\n *\n * @return PendingTransactionResponse\n */\n async signAndSubmitTransaction(args: {\n signer: Account;\n transaction: AnyRawTransaction;\n }): Promise<PendingTransactionResponse> {\n const { signer, transaction } = args;\n return signAndSubmitTransaction({\n aptosConfig: this.config,\n signer,\n transaction,\n });\n }\n}\n"],"mappings":"qTA2CO,IAAMA,EAAN,KAAkB,CAWvB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,EACd,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,SAAW,IAAIC,EAAS,KAAK,MAAM,EACxC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,MAAQ,IAAIC,EAAsB,KAAK,MAAM,CACpD,CAcA,MAAM,gBAAgBC,EAAqE,CACzF,OAAOC,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CAYA,MAAM,wBAAwBA,EAAkE,CAC9F,OAAOE,EAAwB,CAC7B,YAAa,KAAK,OAClB,GAAGF,CACL,CAAC,CACH,CAWA,MAAM,qBAAqBA,EAAmE,CAC5F,OAAOG,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGH,CACL,CAAC,CACH,CAiBA,MAAM,qBAAqBA,EAAuD,CAChF,OAAOI,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CA0BA,MAAM,mBAAmBA,EAGiB,CACxC,OAAOK,EAAmB,CACxB,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAYA,MAAM,uBAAgD,CACpD,OAAOM,EAAsB,CAC3B,YAAa,KAAK,MACpB,CAAC,CACH,CAeA,kBAAkBN,EAAsD,CACtE,OAAOO,EAAkBP,CAAI,CAC/B,CAsBA,MAAM,0BAA0BA,EAKD,CAC7B,OAAOQ,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGR,CAAK,CAAC,CACvE,CAmBA,MAAM,cAAcA,EAA2F,CAC7G,OAAOS,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CAC5D,CAkBA,KAAKA,EAAiF,CACpF,OAAOU,EAAgB,CACrB,GAAGV,CACL,CAAC,CACH,CAkBA,eAAeA,EAAiF,CAC9F,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAIhC,GAAI,CAACY,EAAY,gBACf,MAAM,IAAI,MAAM,eAAeA,CAAW,iCAAiC,EAI7E,OAAAA,EAAY,gBAAkBD,EAAO,eAE9BD,EAAgB,CACrB,OAAAC,EACA,YAAAC,CACF,CAAC,CACH,CAsBA,MAAM,kCAAkCZ,EAItB,CAChB,GAAI,CACF,GAAM,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,EAAIf,EAClC,KAAK,MAAM,iBAAiB,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,CAAC,CACvD,OAASC,EAAY,CACnB,MAAM,IAAI,MAAM,6CAA6CA,CAAK,EAAE,CACtE,CACF,CAiBA,MAAM,yBAAyBhB,EAGS,CACtC,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAChC,OAAOiB,EAAyB,CAC9B,YAAa,KAAK,OAClB,OAAAN,EACA,YAAAC,CACF,CAAC,CACH,CACF","names":["Transaction","config","Build","Simulate","Submit","TransactionManagement","args","getTransactions","getTransactionByVersion","getTransactionByHash","isTransactionPending","waitForTransaction","getGasPriceEstimation","getSigningMessage","publicPackageTransaction","rotateAuthKey","signTransaction","signer","transaction","sender","data","options","error","signAndSubmitTransaction"]}
@@ -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",randomnet:"https://indexer-randomnet.hasura.app/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",randomnet:"https://fullnode.random.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},n={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",randomnet:"https://faucet.random.aptoslabs.com",local:"http://127.0.0.1:8081"},a={mainnet:"mainnet not yet ready, requires sdk upgrade",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"},p={mainnet:"mainnet not yet ready, requires sdk upgrade",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.RANDOMNET="randomnet",t.LOCAL="local",t.CUSTOM="custom",t))(e||{}),r={mainnet:1,testnet:2,randomnet:70,local:4},c={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",randomnet:"randomnet",local:"local",custom:"custom"};export{s as a,o as b,n as c,a as d,p as e,e as f,r as g,c as h};
2
- //# sourceMappingURL=chunk-5VSMDXZ6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/apiEndpoints.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nexport const NetworkToIndexerAPI: Record<string, string> = {\n mainnet: \"https://api.mainnet.aptoslabs.com/v1/graphql\",\n testnet: \"https://api.testnet.aptoslabs.com/v1/graphql\",\n devnet: \"https://api.devnet.aptoslabs.com/v1/graphql\",\n randomnet: \"https://indexer-randomnet.hasura.app/v1/graphql\",\n local: \"http://127.0.0.1:8090/v1/graphql\",\n};\n\nexport const NetworkToNodeAPI: Record<string, string> = {\n mainnet: \"https://api.mainnet.aptoslabs.com/v1\",\n testnet: \"https://api.testnet.aptoslabs.com/v1\",\n devnet: \"https://api.devnet.aptoslabs.com/v1\",\n randomnet: \"https://fullnode.random.aptoslabs.com/v1\",\n local: \"http://127.0.0.1:8080/v1\",\n};\n\nexport const NetworkToFaucetAPI: Record<string, string> = {\n mainnet: \"https://faucet.mainnet.aptoslabs.com\",\n testnet: \"https://faucet.testnet.aptoslabs.com\",\n devnet: \"https://faucet.devnet.aptoslabs.com\",\n randomnet: \"https://faucet.random.aptoslabs.com\",\n local: \"http://127.0.0.1:8081\",\n};\n\nexport const NetworkToPepperAPI: Record<string, string> = {\n mainnet: \"mainnet not yet ready, requires sdk upgrade\",\n testnet: \"https://api.testnet.aptoslabs.com/keyless/pepper/v0\",\n devnet: \"https://api.devnet.aptoslabs.com/keyless/pepper/v0\",\n local: \"https://api.devnet.aptoslabs.com/keyless/pepper/v0\",\n};\n\nexport const NetworkToProverAPI: Record<string, string> = {\n mainnet: \"mainnet not yet ready, requires sdk upgrade\",\n testnet: \"https://api.testnet.aptoslabs.com/keyless/prover/v0\",\n devnet: \"https://api.devnet.aptoslabs.com/keyless/prover/v0\",\n local: \"https://api.devnet.aptoslabs.com/keyless/prover/v0\",\n};\n\nexport enum Network {\n MAINNET = \"mainnet\",\n TESTNET = \"testnet\",\n DEVNET = \"devnet\",\n RANDOMNET = \"randomnet\",\n LOCAL = \"local\",\n CUSTOM = \"custom\",\n}\n\nexport const NetworkToChainId: Record<string, number> = {\n mainnet: 1,\n testnet: 2,\n randomnet: 70,\n local: 4,\n};\n\nexport const NetworkToNetworkName: Record<string, Network> = {\n mainnet: Network.MAINNET,\n testnet: Network.TESTNET,\n devnet: Network.DEVNET,\n randomnet: Network.RANDOMNET,\n local: Network.LOCAL,\n custom: Network.CUSTOM,\n};\n"],"mappings":"AAGO,IAAMA,EAA8C,CACzD,QAAS,+CACT,QAAS,+CACT,OAAQ,8CACR,UAAW,kDACX,MAAO,kCACT,EAEaC,EAA2C,CACtD,QAAS,uCACT,QAAS,uCACT,OAAQ,sCACR,UAAW,2CACX,MAAO,0BACT,EAEaC,EAA6C,CACxD,QAAS,uCACT,QAAS,uCACT,OAAQ,sCACR,UAAW,sCACX,MAAO,uBACT,EAEaC,EAA6C,CACxD,QAAS,8CACT,QAAS,sDACT,OAAQ,qDACR,MAAO,oDACT,EAEaC,EAA6C,CACxD,QAAS,8CACT,QAAS,sDACT,OAAQ,qDACR,MAAO,oDACT,EAEYC,OACVA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,MAAQ,QACRA,EAAA,OAAS,SANCA,OAAA,IASCC,EAA2C,CACtD,QAAS,EACT,QAAS,EACT,UAAW,GACX,MAAO,CACT,EAEaC,EAAgD,CAC3D,QAAS,UACT,QAAS,UACT,OAAQ,SACR,UAAW,YACX,MAAO,QACP,OAAQ,QACV","names":["NetworkToIndexerAPI","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToPepperAPI","NetworkToProverAPI","Network","NetworkToChainId","NetworkToNetworkName"]}
@@ -1,2 +0,0 @@
1
- import{a as t,b as n,c as i,d as r,e as o}from"./chunk-5VSMDXZ6.mjs";import f from"@aptos-labs/aptos-client";var l=class{constructor(e){this.network=e?.network??"devnet",this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.pepper=e?.pepper,this.prover=e?.prover,this.indexer=e?.indexer,this.client=e?.client??{provider:f},this.clientConfig=e?.clientConfig??{},this.fullnodeConfig=e?.fullnodeConfig??{},this.indexerConfig=e?.indexerConfig??{},this.faucetConfig=e?.faucetConfig??{}}getRequestUrl(e){switch(e){case"Fullnode":if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return n[this.network];case"Faucet":if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return i[this.network];case"Indexer":if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return t[this.network];case"Pepper":if(this.pepper!==void 0)return this.pepper;if(this.network==="custom")throw new Error("Please provide a custom pepper service url");return r[this.network];case"Prover":if(this.prover!==void 0)return this.prover;if(this.network==="custom")throw new Error("Please provide a custom prover service url");return o[this.network];default:throw Error(`apiType ${e} is not supported`)}}isPepperServiceRequest(e){return r[this.network]===e}isProverServiceRequest(e){return o[this.network]===e}};export{l as a};
2
- //# sourceMappingURL=chunk-6GQAHQGW.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/aptosConfig.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport aptosClient from \"@aptos-labs/aptos-client\";\nimport { AptosSettings, ClientConfig, Client, FullNodeConfig, IndexerConfig, FaucetConfig } from \"../types\";\nimport {\n NetworkToNodeAPI,\n NetworkToFaucetAPI,\n NetworkToIndexerAPI,\n Network,\n NetworkToPepperAPI,\n NetworkToProverAPI,\n} from \"../utils/apiEndpoints\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * This class holds the config information for the SDK client instance.\n *\n * @example\n *\n * const aptosConfig = new AptosConfig({network:Network.TESTNET})\n */\nexport class AptosConfig {\n /**\n * The Network that this SDK is associated with. Defaults to DEVNET\n */\n readonly network: Network;\n\n /**\n * The client instance the SDK uses. Defaults to `@aptos-labs/aptos-client\n */\n readonly client: Client;\n\n /**\n * The optional hardcoded fullnode URL to send requests to instead of using the network\n */\n readonly fullnode?: string;\n\n /**\n * The optional hardcoded faucet URL to send requests to instead of using the network\n */\n readonly faucet?: string;\n\n /**\n * The optional hardcoded pepper service URL to send requests to instead of using the network\n */\n readonly pepper?: string;\n\n /**\n * The optional hardcoded prover service URL to send requests to instead of using the network\n */\n readonly prover?: string;\n\n /**\n * The optional hardcoded indexer URL to send requests to instead of using the network\n */\n readonly indexer?: string;\n\n /**\n * Optional client configurations\n */\n readonly clientConfig?: ClientConfig;\n\n /**\n * Optional specific Fullnode configurations\n */\n readonly fullnodeConfig?: FullNodeConfig;\n\n /**\n * Optional specific Indexer configurations\n */\n readonly indexerConfig?: IndexerConfig;\n\n /**\n * Optional specific Faucet configurations\n */\n readonly faucetConfig?: FaucetConfig;\n\n constructor(settings?: AptosSettings) {\n this.network = settings?.network ?? Network.DEVNET;\n this.fullnode = settings?.fullnode;\n this.faucet = settings?.faucet;\n this.pepper = settings?.pepper;\n this.prover = settings?.prover;\n this.indexer = settings?.indexer;\n this.client = settings?.client ?? { provider: aptosClient };\n this.clientConfig = settings?.clientConfig ?? {};\n this.fullnodeConfig = settings?.fullnodeConfig ?? {};\n this.indexerConfig = settings?.indexerConfig ?? {};\n this.faucetConfig = settings?.faucetConfig ?? {};\n }\n\n /**\n * Returns the URL endpoint to send the request to.\n * If a custom URL was provided in the config, that URL is returned.\n * If a custom URL was provided but not URL endpoints, an error is thrown.\n * Otherwise, the URL endpoint is derived from the network.\n *\n * @param apiType - The type of Aptos API to get the URL for.\n *\n * @internal\n */\n getRequestUrl(apiType: AptosApiType): string {\n switch (apiType) {\n case AptosApiType.FULLNODE:\n if (this.fullnode !== undefined) return this.fullnode;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom full node url\");\n return NetworkToNodeAPI[this.network];\n case AptosApiType.FAUCET:\n if (this.faucet !== undefined) return this.faucet;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom faucet url\");\n return NetworkToFaucetAPI[this.network];\n case AptosApiType.INDEXER:\n if (this.indexer !== undefined) return this.indexer;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom indexer url\");\n return NetworkToIndexerAPI[this.network];\n case AptosApiType.PEPPER:\n if (this.pepper !== undefined) return this.pepper;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom pepper service url\");\n return NetworkToPepperAPI[this.network];\n case AptosApiType.PROVER:\n if (this.prover !== undefined) return this.prover;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom prover service url\");\n return NetworkToProverAPI[this.network];\n default:\n throw Error(`apiType ${apiType} is not supported`);\n }\n }\n\n /**\n * Checks if the URL is a known pepper service endpoint\n *\n * @internal\n * */\n isPepperServiceRequest(url: string): boolean {\n return NetworkToPepperAPI[this.network] === url;\n }\n\n /**\n * Checks if the URL is a known prover service endpoint\n *\n * @internal\n * */\n isProverServiceRequest(url: string): boolean {\n return NetworkToProverAPI[this.network] === url;\n }\n}\n"],"mappings":"qEAGA,OAAOA,MAAiB,2BAmBjB,IAAMC,EAAN,KAAkB,CAwDvB,YAAYC,EAA0B,CACpC,KAAK,QAAUA,GAAU,kBACzB,KAAK,SAAWA,GAAU,SAC1B,KAAK,OAASA,GAAU,OACxB,KAAK,OAASA,GAAU,OACxB,KAAK,OAASA,GAAU,OACxB,KAAK,QAAUA,GAAU,QACzB,KAAK,OAASA,GAAU,QAAU,CAAE,SAAUC,CAAY,EAC1D,KAAK,aAAeD,GAAU,cAAgB,CAAC,EAC/C,KAAK,eAAiBA,GAAU,gBAAkB,CAAC,EACnD,KAAK,cAAgBA,GAAU,eAAiB,CAAC,EACjD,KAAK,aAAeA,GAAU,cAAgB,CAAC,CACjD,CAYA,cAAcE,EAA+B,CAC3C,OAAQA,EAAS,CACf,eACE,GAAI,KAAK,WAAa,OAAW,OAAO,KAAK,SAC7C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,uCAAuC,EAC5F,OAAOC,EAAiB,KAAK,OAAO,EACtC,aACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,oCAAoC,EACzF,OAAOC,EAAmB,KAAK,OAAO,EACxC,cACE,GAAI,KAAK,UAAY,OAAW,OAAO,KAAK,QAC5C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,qCAAqC,EAC1F,OAAOC,EAAoB,KAAK,OAAO,EACzC,aACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,4CAA4C,EACjG,OAAOC,EAAmB,KAAK,OAAO,EACxC,aACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,4CAA4C,EACjG,OAAOC,EAAmB,KAAK,OAAO,EACxC,QACE,MAAM,MAAM,WAAWL,CAAO,mBAAmB,CACrD,CACF,CAOA,uBAAuBM,EAAsB,CAC3C,OAAOF,EAAmB,KAAK,OAAO,IAAME,CAC9C,CAOA,uBAAuBA,EAAsB,CAC3C,OAAOD,EAAmB,KAAK,OAAO,IAAMC,CAC9C,CACF","names":["aptosClient","AptosConfig","settings","aptosClient","apiType","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToIndexerAPI","NetworkToPepperAPI","NetworkToProverAPI","url"]}
@@ -1,2 +0,0 @@
1
- import{a,c}from"./chunk-PTIZKRON.mjs";import{i as o,o as l}from"./chunk-WTVN3XGK.mjs";import{a as n,c as s}from"./chunk-7JNPSNL6.mjs";import{b}from"./chunk-COW5IGYC.mjs";import{a as p}from"./chunk-STYDBDYL.mjs";import{a as y}from"./chunk-7STYQ5ZE.mjs";var f=class t extends b{constructor(e){super();if(this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:r,signature:i}=e;return i instanceof u?this.publicKey.verifySignature({message:r,signature:i.signature}):!1}authKey(){return y.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${r}`)}return new t(i)}static isPublicKey(e){return e instanceof t}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}},u=class t extends p{constructor(e){super();if(this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${r}`)}return new t(i)}};export{f as a,u as b};
2
- //# sourceMappingURL=chunk-6M6XXPQQ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/singleKey.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { AnyPublicKeyVariant, AnySignatureVariant, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Secp256k1PublicKey, Secp256k1Signature } from \"./secp256k1\";\nimport { KeylessPublicKey, KeylessSignature } from \"./keyless\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents any public key supported by Aptos.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Any unified authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class AnyPublicKey extends AccountPublicKey {\n /**\n * Reference to the inner public key\n */\n public readonly publicKey: PublicKey;\n\n /**\n * Index of the underlying enum variant\n */\n public readonly variant: AnyPublicKeyVariant;\n\n // region Constructors\n\n constructor(publicKey: PublicKey) {\n super();\n this.publicKey = publicKey;\n if (publicKey instanceof Ed25519PublicKey) {\n this.variant = AnyPublicKeyVariant.Ed25519;\n } else if (publicKey instanceof Secp256k1PublicKey) {\n this.variant = AnyPublicKeyVariant.Secp256k1;\n } else if (publicKey instanceof KeylessPublicKey) {\n this.variant = AnyPublicKeyVariant.Keyless;\n } else {\n throw new Error(\"Unsupported public key type\");\n }\n }\n\n // endregion\n\n // region AccountPublicKey\n\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof AnySignature)) {\n return false;\n }\n\n return this.publicKey.verifySignature({\n message,\n signature: signature.signature,\n });\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.SingleKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.publicKey.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnyPublicKey {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let publicKey: PublicKey;\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519:\n publicKey = Ed25519PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Secp256k1:\n publicKey = Secp256k1PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Keyless:\n publicKey = KeylessPublicKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);\n }\n return new AnyPublicKey(publicKey);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof AnyPublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey {\n return publicKey instanceof AnyPublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Ed25519PublicKey` instead.\n */\n isEd25519(): boolean {\n return this.publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.\n */\n isSecp256k1PublicKey(): boolean {\n return this.publicKey instanceof Secp256k1PublicKey;\n }\n}\n\n/**\n * Instance of signature that uses the SingleKey authentication scheme.\n * This signature can only be generated by a `SingleKeySigner`, since it uses the\n * same authentication scheme.\n */\nexport class AnySignature extends Signature {\n public readonly signature: Signature;\n\n /**\n * Index of the underlying enum variant\n */\n private readonly variant: AnySignatureVariant;\n\n // region Constructors\n\n constructor(signature: Signature) {\n super();\n this.signature = signature;\n\n if (signature instanceof Ed25519Signature) {\n this.variant = AnySignatureVariant.Ed25519;\n } else if (signature instanceof Secp256k1Signature) {\n this.variant = AnySignatureVariant.Secp256k1;\n } else if (signature instanceof KeylessSignature) {\n this.variant = AnySignatureVariant.Keyless;\n } else {\n throw new Error(\"Unsupported signature type\");\n }\n }\n\n // endregion\n\n // region AccountSignature\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.signature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnySignature {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let signature: Signature;\n switch (variantIndex) {\n case AnySignatureVariant.Ed25519:\n signature = Ed25519Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Secp256k1:\n signature = Secp256k1Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Keyless:\n signature = KeylessSignature.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);\n }\n return new AnySignature(signature);\n }\n\n // endregion\n}\n"],"mappings":"4PAiBO,IAAMA,EAAN,MAAMC,UAAqBC,CAAiB,CAajD,YAAYC,EAAsB,CAChC,MAAM,EACN,QAAK,UAAYA,EACbA,aAAqBC,EACvB,KAAK,QAAU,UACND,aAAqBE,EAC9B,KAAK,QAAU,UACNF,aAAqBG,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,6BAA6B,CAEjD,CAMA,gBAAgBC,EAAoC,CAClD,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,OAAME,aAAqBC,EAIpB,KAAK,UAAU,gBAAgB,CACpC,QAAAF,EACA,UAAWC,EAAU,SACvB,CAAC,EANQ,EAOX,CAEA,SAA6B,CAC3B,OAAOE,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAEA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUC,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDV,EACJ,OAAQW,EAAc,CACpB,OACEX,EAAYC,EAAiB,YAAYS,CAAY,EACrD,MACF,OACEV,EAAYE,EAAmB,YAAYQ,CAAY,EACvD,MACF,OACEV,EAAYG,EAAiB,YAAYO,CAAY,EACrD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIb,EAAaE,CAAS,CACnC,CAOA,OAAO,YAAYA,EAAwD,CACzE,OAAOA,aAAqBF,CAC9B,CAKA,WAAqB,CACnB,OAAO,KAAK,qBAAqBG,CACnC,CAKA,sBAAgC,CAC9B,OAAO,KAAK,qBAAqBC,CACnC,CACF,EAOaK,EAAN,MAAMK,UAAqBC,CAAU,CAU1C,YAAYP,EAAsB,CAChC,MAAM,EACN,QAAK,UAAYA,EAEbA,aAAqBQ,EACvB,KAAK,QAAU,UACNR,aAAqBS,EAC9B,KAAK,QAAU,UACNT,aAAqBU,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,4BAA4B,CAEhD,CAMA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUP,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDJ,EACJ,OAAQK,EAAc,CACpB,OACEL,EAAYQ,EAAiB,YAAYJ,CAAY,EACrD,MACF,OACEJ,EAAYS,EAAmB,YAAYL,CAAY,EACvD,MACF,OACEJ,EAAYU,EAAiB,YAAYN,CAAY,EACrD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIC,EAAaN,CAAS,CACnC,CAGF","names":["AnyPublicKey","_AnyPublicKey","AccountPublicKey","publicKey","Ed25519PublicKey","Secp256k1PublicKey","KeylessPublicKey","args","message","signature","AnySignature","AuthenticationKey","serializer","deserializer","variantIndex","_AnySignature","Signature","Ed25519Signature","Secp256k1Signature","KeylessSignature"]}
@@ -1,2 +0,0 @@
1
- import{b as p}from"./chunk-COW5IGYC.mjs";import{a as A}from"./chunk-STYDBDYL.mjs";import{a as c}from"./chunk-TJDC5PWD.mjs";import{g as d,k as f,l as h}from"./chunk-S5HG2QUD.mjs";import{a as m}from"./chunk-7STYQ5ZE.mjs";import{a as g}from"./chunk-TVRJ3M7B.mjs";import{b as n}from"./chunk-AOCNYMMX.mjs";import{ed25519 as o}from"@noble/curves/ed25519";var K=[237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16],i=class i extends p{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==i.LENGTH)throw new Error(`PublicKey length should be ${i.LENGTH}`);this.key=t}verifySignature(e){let{message:t,signature:a}=e;if(!(a instanceof y))return!1;let u=c(t),S=n.fromHexInput(u).toUint8Array(),v=a.toUint8Array(),U=this.key.toUint8Array();return a.isCanonicalSignature()?o.verify(v,S,U):!1}authKey(){return m.fromSchemeAndBytes({scheme:0,input:this.toUint8Array()})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}};i.LENGTH=32;var l=i,r=class r extends g{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.signingKey=t}static generate(){let e=o.utils.randomPrivateKey();return new r(e)}static fromDerivationPath(e,t){if(!d(e))throw new Error(`Invalid derivation path ${e}`);return new r(f(e,r.SLIP_0010_SEED,h(t)))}publicKey(){let e=o.getPublicKey(this.signingKey.toUint8Array());return new l(e)}sign(e){let t=c(e),a=n.fromHexInput(t).toUint8Array(),u=o.sign(a,this.signingKey.toUint8Array());return new y(u)}toUint8Array(){return this.signingKey.toUint8Array()}toString(){return this.signingKey.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t)}static isPrivateKey(e){return e instanceof r}};r.LENGTH=32,r.SLIP_0010_SEED="ed25519 seed";var H=r,s=class s extends A{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==s.LENGTH)throw new Error(`Signature length should be ${s.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 s(t)}isCanonicalSignature(){let e=this.toUint8Array().slice(32);for(let t=e.length-1;t>=0;t-=1){if(e[t]<K[t])return!0;if(e[t]>K[t])return!1}return!1}};s.LENGTH=64;var y=s;export{l as a,H as b,y as c};
2
- //# sourceMappingURL=chunk-7JNPSNL6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/ed25519.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ed25519 } from \"@noble/curves/ed25519\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { HexInput, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { isValidHardenedPath, fromDerivationPath as fromDerivationPathInner, mnemonicToSeed } from \"./hdKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { AccountPublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { convertSigningMessage } from \"./utils\";\n\n/**\n * L is the value that greater than or equal to will produce a non-canonical signature, and must be rejected\n */\nconst L: number[] = [\n 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\n];\n\n/**\n * Represents the public key of an Ed25519 key pair.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Ed25519 scheme is represented in the SDK as `Legacy authentication key` and also\n * as `AnyPublicKey` that represents any `Unified authentication key`\n */\nexport class Ed25519PublicKey extends AccountPublicKey {\n /**\n * Length of an Ed25519 public key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * Bytes of the public key\n * @private\n */\n private readonly key: Hex;\n\n /**\n * Create a new PublicKey instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Ed25519PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Ed25519PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n // region AccountPublicKey\n\n /**\n * Verifies a signed data with a public key\n * @param args.message a signed message as a Hex string or Uint8Array\n * @param args.signature the signature of the message\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof Ed25519Signature)) {\n return false;\n }\n const messageToVerify = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();\n const signatureBytes = signature.toUint8Array();\n const publicKeyBytes = this.key.toUint8Array();\n // Also verify malleability\n if (!signature.isCanonicalSignature()) {\n return false;\n }\n\n return ed25519.verify(signatureBytes, messageBytes, publicKeyBytes);\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.Ed25519,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Ed25519PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PublicKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Ed25519PublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is Ed25519PublicKey {\n return publicKey instanceof Ed25519PublicKey;\n }\n}\n\n/**\n * Represents the private key of an Ed25519 key pair.\n */\nexport class Ed25519PrivateKey extends Serializable implements PrivateKey {\n /**\n * Length of an Ed25519 private key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The Ed25519 key seed to use for BIP-32 compatibility\n * See more {@link https://github.com/satoshilabs/slips/blob/master/slip-0010.md}\n */\n static readonly SLIP_0010_SEED = \"ed25519 seed\";\n\n /**\n * The Ed25519 signing key\n * @private\n */\n private readonly signingKey: Hex;\n\n // region Constructors\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * @param hexInput HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const privateKeyHex = Hex.fromHexInput(hexInput);\n if (privateKeyHex.toUint8Array().length !== Ed25519PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Ed25519PrivateKey.LENGTH}`);\n }\n\n // Create keyPair from Private key in Uint8Array format\n this.signingKey = privateKeyHex;\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Ed25519PrivateKey\n */\n static generate(): Ed25519PrivateKey {\n const keyPair = ed25519.utils.randomPrivateKey();\n return new Ed25519PrivateKey(keyPair);\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase.\n *\n * To derive multiple keys from the same phrase, change the path\n *\n * IMPORTANT: Ed25519 supports hardened derivation only (since it lacks a key homomorphism,\n * so non-hardened derivation cannot work)\n *\n * @param path the BIP44 path\n * @param mnemonics the mnemonic seed phrase\n */\n static fromDerivationPath(path: string, mnemonics: string): Ed25519PrivateKey {\n if (!isValidHardenedPath(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return new Ed25519PrivateKey(\n fromDerivationPathInner(path, Ed25519PrivateKey.SLIP_0010_SEED, mnemonicToSeed(mnemonics)),\n );\n }\n\n // endregion\n\n // region PrivateKey\n\n /**\n * Derive the Ed25519PublicKey for this private key.\n *\n * @returns Ed25519PublicKey\n */\n publicKey(): Ed25519PublicKey {\n const bytes = ed25519.getPublicKey(this.signingKey.toUint8Array());\n return new Ed25519PublicKey(bytes);\n }\n\n /**\n * Sign the given message with the private key.\n *\n * @param message a message as a string or Uint8Array\n * @returns Signature\n */\n sign(message: HexInput): Ed25519Signature {\n const messageToSign = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToSign).toUint8Array();\n const signatureBytes = ed25519.sign(messageBytes, this.signingKey.toUint8Array());\n return new Ed25519Signature(signatureBytes);\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the private key\n */\n toUint8Array(): Uint8Array {\n return this.signingKey.toUint8Array();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key\n */\n toString(): string {\n return this.signingKey.toString();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Ed25519PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PrivateKey(bytes);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof Ed25519PrivateKey` instead.\n */\n static isPrivateKey(privateKey: PrivateKey): privateKey is Ed25519PrivateKey {\n return privateKey instanceof Ed25519PrivateKey;\n }\n}\n\n/**\n * A signature of a message signed using an Ed25519 private key\n */\nexport class Ed25519Signature extends Signature {\n /**\n * Length of an Ed25519 signature\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n */\n private readonly data: Hex;\n\n // region Constructors\n\n constructor(hexInput: HexInput) {\n super();\n const data = Hex.fromHexInput(hexInput);\n if (data.toUint8Array().length !== Ed25519Signature.LENGTH) {\n throw new Error(`Signature length should be ${Ed25519Signature.LENGTH}`);\n }\n this.data = data;\n }\n\n // endregion\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Ed25519Signature {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519Signature(bytes);\n }\n\n /**\n * Checks if an ED25519 signature is non-canonical.\n *\n * Comes from Aptos Core\n * https://github.com/aptos-labs/aptos-core/blob/main/crates/aptos-crypto/src/ed25519/ed25519_sigs.rs#L47-L85\n */\n isCanonicalSignature(): boolean {\n const s = this.toUint8Array().slice(32);\n\n for (let i = s.length - 1; i >= 0; i -= 1) {\n if (s[i] < L[i]) {\n return true;\n }\n if (s[i] > L[i]) {\n return false;\n }\n }\n // As this stage S == L which implies a non-canonical S.\n return false;\n }\n\n // endregion\n}\n"],"mappings":"6SAGA,OAAS,WAAAA,MAAe,wBAexB,IAAMC,EAAc,CAClB,IAAM,IAAM,IAAM,GAAM,GAAM,GAAM,GAAM,GAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,GAAM,EAAM,EAAM,EAC5G,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAC1E,EAWaC,EAAN,MAAMA,UAAyBC,CAAiB,CAiBrD,YAAYC,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EACrC,GAAIC,EAAI,aAAa,EAAE,SAAWH,EAAiB,OACjD,MAAM,IAAI,MAAM,8BAA8BA,EAAiB,MAAM,EAAE,EAEzE,KAAK,IAAMG,CACb,CASA,gBAAgBE,EAAoC,CAClD,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,GAAI,EAAEE,aAAqBC,GACzB,MAAO,GAET,IAAMC,EAAkBC,EAAsBJ,CAAO,EAC/CK,EAAeP,EAAI,aAAaK,CAAe,EAAE,aAAa,EAC9DG,EAAiBL,EAAU,aAAa,EACxCM,EAAiB,KAAK,IAAI,aAAa,EAE7C,OAAKN,EAAU,qBAAqB,EAI7BO,EAAQ,OAAOF,EAAgBD,EAAcE,CAAc,EAHzD,EAIX,CAEA,SAA6B,CAC3B,OAAOE,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAOA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAMA,UAAUC,EAA8B,CACtCA,EAAW,eAAe,KAAK,IAAI,aAAa,CAAC,CACnD,CAEA,OAAO,YAAYC,EAA8C,CAC/D,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIjB,EAAiBkB,CAAK,CACnC,CAOA,OAAO,YAAYC,EAA4D,CAC7E,OAAOA,aAAqBnB,CAC9B,CACF,EAxFaA,EAIK,OAAiB,GAJ5B,IAAMoB,EAANpB,EA6FMqB,EAAN,MAAMA,UAA0BC,CAAmC,CAyBxE,YAAYpB,EAAoB,CAC9B,MAAM,EAEN,IAAMqB,EAAgBnB,EAAI,aAAaF,CAAQ,EAC/C,GAAIqB,EAAc,aAAa,EAAE,SAAWF,EAAkB,OAC5D,MAAM,IAAI,MAAM,+BAA+BA,EAAkB,MAAM,EAAE,EAI3E,KAAK,WAAaE,CACpB,CAOA,OAAO,UAA8B,CACnC,IAAMC,EAAUV,EAAQ,MAAM,iBAAiB,EAC/C,OAAO,IAAIO,EAAkBG,CAAO,CACtC,CAaA,OAAO,mBAAmBC,EAAcC,EAAsC,CAC5E,GAAI,CAACC,EAAoBF,CAAI,EAC3B,MAAM,IAAI,MAAM,2BAA2BA,CAAI,EAAE,EAEnD,OAAO,IAAIJ,EACTO,EAAwBH,EAAMJ,EAAkB,eAAgBQ,EAAeH,CAAS,CAAC,CAC3F,CACF,CAWA,WAA8B,CAC5B,IAAMR,EAAQJ,EAAQ,aAAa,KAAK,WAAW,aAAa,CAAC,EACjE,OAAO,IAAIM,EAAiBF,CAAK,CACnC,CAQA,KAAKZ,EAAqC,CACxC,IAAMwB,EAAgBpB,EAAsBJ,CAAO,EAC7CK,EAAeP,EAAI,aAAa0B,CAAa,EAAE,aAAa,EAC5DlB,EAAiBE,EAAQ,KAAKH,EAAc,KAAK,WAAW,aAAa,CAAC,EAChF,OAAO,IAAIH,EAAiBI,CAAc,CAC5C,CAOA,cAA2B,CACzB,OAAO,KAAK,WAAW,aAAa,CACtC,CAOA,UAAmB,CACjB,OAAO,KAAK,WAAW,SAAS,CAClC,CAMA,UAAUI,EAA8B,CACtCA,EAAW,eAAe,KAAK,aAAa,CAAC,CAC/C,CAEA,OAAO,YAAYC,EAA+C,CAChE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAII,EAAkBH,CAAK,CACpC,CAOA,OAAO,aAAaa,EAAyD,CAC3E,OAAOA,aAAsBV,CAC/B,CACF,EArIaA,EAIK,OAAiB,GAJtBA,EAUK,eAAiB,eAV5B,IAAMW,EAANX,EA0IMY,EAAN,MAAMA,UAAyBC,CAAU,CAc9C,YAAYhC,EAAoB,CAC9B,MAAM,EACN,IAAMiC,EAAO/B,EAAI,aAAaF,CAAQ,EACtC,GAAIiC,EAAK,aAAa,EAAE,SAAWF,EAAiB,OAClD,MAAM,IAAI,MAAM,8BAA8BA,EAAiB,MAAM,EAAE,EAEzE,KAAK,KAAOE,CACd,CAMA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CAMA,UAAUnB,EAA8B,CACtCA,EAAW,eAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CAEA,OAAO,YAAYC,EAA8C,CAC/D,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIgB,EAAiBf,CAAK,CACnC,CAQA,sBAAgC,CAC9B,IAAMkB,EAAI,KAAK,aAAa,EAAE,MAAM,EAAE,EAEtC,QAASC,EAAID,EAAE,OAAS,EAAGC,GAAK,EAAGA,GAAK,EAAG,CACzC,GAAID,EAAEC,CAAC,EAAItC,EAAEsC,CAAC,EACZ,MAAO,GAET,GAAID,EAAEC,CAAC,EAAItC,EAAEsC,CAAC,EACZ,MAAO,EAEX,CAEA,MAAO,EACT,CAGF,EAlEaJ,EAIK,OAAS,GAJpB,IAAMzB,EAANyB","names":["ed25519","L","_Ed25519PublicKey","AccountPublicKey","hexInput","hex","Hex","args","message","signature","Ed25519Signature","messageToVerify","convertSigningMessage","messageBytes","signatureBytes","publicKeyBytes","ed25519","AuthenticationKey","serializer","deserializer","bytes","publicKey","Ed25519PublicKey","_Ed25519PrivateKey","Serializable","privateKeyHex","keyPair","path","mnemonics","isValidHardenedPath","fromDerivationPath","mnemonicToSeed","messageToSign","privateKey","Ed25519PrivateKey","_Ed25519Signature","Signature","data","s","i"]}
@@ -1,2 +0,0 @@
1
- import{a as f}from"./chunk-LJ624HBI.mjs";import{a as g}from"./chunk-YQOKWIVY.mjs";import{a as l}from"./chunk-NCIRQZOJ.mjs";import{a as h}from"./chunk-FTWBJZYH.mjs";import{a as y}from"./chunk-FYJMB23M.mjs";import{a as u}from"./chunk-4VAQCOR6.mjs";import{a as s}from"./chunk-OJ4NIVFW.mjs";import{a as p}from"./chunk-T7XMSCZV.mjs";import{a as A}from"./chunk-6GQAHQGW.mjs";import{a as r}from"./chunk-IGJCOZGO.mjs";import{a}from"./chunk-GUWBE3CV.mjs";import{a as c}from"./chunk-AZABJ5QQ.mjs";var t=class{constructor(e){this.config=new A(e),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new y(this.config),this.transaction=new u(this.config),this.keyless=new h(this.config)}};function n(m,e,d){Object.getOwnPropertyNames(e.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&(o.value=function(...w){return this[d][i](...w)},Object.defineProperty(m.prototype,i,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,y,"staking");n(t,u,"transaction");n(t,h,"keyless");export{t as a};
2
- //# sourceMappingURL=chunk-7QFBF7FS.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Keyless } from \"./keyless\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n *\n * @example\n *\n * const aptos = new Aptos();\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly keyless: Keyless;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.keyless = new Keyless(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Keyless,\n Staking,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Keyless, \"keyless\");\n"],"mappings":"ueA2BO,IAAMA,EAAN,KAAY,CAyBjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,CACxC,CACF,EAyBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWd,EAAOG,EAAS,SAAS,EACpCW,EAAWd,EAAOI,EAAK,KAAK,EAC5BU,EAAWd,EAAOK,EAAM,MAAM,EAC9BS,EAAWd,EAAOM,EAAc,cAAc,EAC9CQ,EAAWd,EAAOO,EAAO,OAAO,EAChCO,EAAWd,EAAOQ,EAAQ,QAAQ,EAClCM,EAAWd,EAAOS,EAAe,eAAe,EAChDK,EAAWd,EAAOU,EAAS,SAAS,EACpCI,EAAWd,EAAOW,EAAS,SAAS,EACpCG,EAAWd,EAAOY,EAAa,aAAa,EAC5CE,EAAWd,EAAOa,EAAS,SAAS","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Keyless","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-7Z6DYLCA.mjs.map
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-AQ4I7VVB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
- import{d as i}from"./chunk-D73X3S27.mjs";import{b as o}from"./chunk-WPVBC4JS.mjs";import{b as n}from"./chunk-7JNPSNL6.mjs";import{b as a}from"./chunk-T23OVRNF.mjs";var c=class s{constructor(e){this.signingScheme=0;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=r.publicKey(),this.accountAddress=t?a.from(t):this.publicKey.authKey().derivedAddress()}static generate(){let e=n.generate();return new s({privateKey:e})}static fromDerivationPath(e){let{path:r,mnemonic:t}=e,u=n.fromDerivationPath(r,t);return new s({privateKey:u})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let r=this.privateKey.sign(i(e));return new o(this.publicKey,r)}sign(e){return this.privateKey.sign(e)}signTransaction(e){return this.sign(i(e))}};export{c as a};
2
- //# sourceMappingURL=chunk-C3AEWQ3A.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/account/Ed25519Account.ts"],"sourcesContent":["import { AccountAuthenticatorEd25519 } from \"../transactions/authenticator/account\";\nimport { HexInput, SigningScheme } from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature } from \"../core/crypto\";\nimport type { Account } from \"./Account\";\nimport { AnyRawTransaction } from \"../transactions/types\";\nimport { generateSigningMessageForTransaction } from \"../transactions/transactionBuilder/signingMessage\";\n\nexport interface Ed25519SignerConstructorArgs {\n privateKey: Ed25519PrivateKey;\n address?: AccountAddressInput;\n}\n\nexport interface Ed25519SignerFromDerivationPathArgs {\n path: string;\n mnemonic: string;\n}\n\nexport interface VerifyEd25519SignatureArgs {\n message: HexInput;\n signature: Ed25519Signature;\n}\n\n/**\n * Signer implementation for the Ed25519 authentication scheme.\n * This extends an {@link Ed25519Account} by adding signing capabilities through an {@link Ed25519PrivateKey}.\n *\n * Note: Generating a signer instance does not create the account on-chain.\n */\nexport class Ed25519Account implements Account {\n /**\n * Private key associated with the account\n */\n readonly privateKey: Ed25519PrivateKey;\n\n readonly publicKey: Ed25519PublicKey;\n\n readonly accountAddress: AccountAddress;\n\n readonly signingScheme = SigningScheme.Ed25519;\n\n // region Constructors\n\n constructor(args: Ed25519SignerConstructorArgs) {\n const { privateKey, address } = args;\n this.privateKey = privateKey;\n this.publicKey = privateKey.publicKey();\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n }\n\n /**\n * Derives a signer from a randomly generated private key\n */\n static generate() {\n const privateKey = Ed25519PrivateKey.generate();\n return new Ed25519Account({ privateKey });\n }\n\n /**\n * Derives an account with bip44 path and mnemonics\n *\n * @param args.path the BIP44 derive hardened path e.g. m/44'/637'/0'/0'/0'\n * Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n * @param args.mnemonic the mnemonic seed phrase of the account\n */\n static fromDerivationPath(args: Ed25519SignerFromDerivationPathArgs) {\n const { path, mnemonic } = args;\n const privateKey = Ed25519PrivateKey.fromDerivationPath(path, mnemonic);\n return new Ed25519Account({ privateKey });\n }\n\n // endregion\n\n // region Account\n\n verifySignature(args: VerifyEd25519SignatureArgs): boolean {\n return this.publicKey.verifySignature(args);\n }\n\n signWithAuthenticator(transaction: AnyRawTransaction) {\n const signature = this.privateKey.sign(generateSigningMessageForTransaction(transaction));\n return new AccountAuthenticatorEd25519(this.publicKey, signature);\n }\n\n sign(message: HexInput) {\n return this.privateKey.sign(message);\n }\n\n signTransaction(transaction: AnyRawTransaction) {\n return this.sign(generateSigningMessageForTransaction(transaction));\n }\n\n // endregion\n}\n"],"mappings":"oKA6BO,IAAMA,EAAN,MAAMC,CAAkC,CAc7C,YAAYC,EAAoC,CAJhD,KAAS,cAAgB,EAKvB,GAAM,CAAE,WAAAC,EAAY,QAAAC,CAAQ,EAAIF,EAChC,KAAK,WAAaC,EAClB,KAAK,UAAYA,EAAW,UAAU,EACtC,KAAK,eAAiBC,EAAUC,EAAe,KAAKD,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,CACzG,CAKA,OAAO,UAAW,CAChB,IAAMD,EAAaG,EAAkB,SAAS,EAC9C,OAAO,IAAIL,EAAe,CAAE,WAAAE,CAAW,CAAC,CAC1C,CASA,OAAO,mBAAmBD,EAA2C,CACnE,GAAM,CAAE,KAAAK,EAAM,SAAAC,CAAS,EAAIN,EACrBC,EAAaG,EAAkB,mBAAmBC,EAAMC,CAAQ,EACtE,OAAO,IAAIP,EAAe,CAAE,WAAAE,CAAW,CAAC,CAC1C,CAMA,gBAAgBD,EAA2C,CACzD,OAAO,KAAK,UAAU,gBAAgBA,CAAI,CAC5C,CAEA,sBAAsBO,EAAgC,CACpD,IAAMC,EAAY,KAAK,WAAW,KAAKC,EAAqCF,CAAW,CAAC,EACxF,OAAO,IAAIG,EAA4B,KAAK,UAAWF,CAAS,CAClE,CAEA,KAAKG,EAAmB,CACtB,OAAO,KAAK,WAAW,KAAKA,CAAO,CACrC,CAEA,gBAAgBJ,EAAgC,CAC9C,OAAO,KAAK,KAAKE,EAAqCF,CAAW,CAAC,CACpE,CAGF","names":["Ed25519Account","_Ed25519Account","args","privateKey","address","AccountAddress","Ed25519PrivateKey","path","mnemonic","transaction","signature","generateSigningMessageForTransaction","AccountAuthenticatorEd25519","message"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-CYDWEPFL.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
- import{a as g,c as a,d as s}from"./chunk-UT37XKQU.mjs";import{f as A,g as T}from"./chunk-YE5B2S5L.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function w(r){return r.feePayerAddress?new s(r.rawTransaction,r.secondarySignerAddresses??[],r.feePayerAddress):r.secondarySignerAddresses?new a(r.rawTransaction,r.secondarySignerAddresses):r.rawTransaction}function i(r,e){let o=y.create();if(!e.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${e}`);o.update(e);let n=o.digest(),c=r,t=new Uint8Array(n.length+c.length);return t.set(n),t.set(c,n.length),t}function S(r){return i(r.bcsToBytes(),r.constructor.name)}function h(r){let e=w(r);if(e instanceof g)return i(e.bcsToBytes(),A);if(e instanceof a||e instanceof s)return i(e.bcsToBytes(),T);throw new Error(`Unknown transaction type to sign on: ${e}`)}export{w as a,i as b,S as c,h as d};
2
- //# sourceMappingURL=chunk-D73X3S27.mjs.map