@aptos-labs/ts-sdk 0.0.3 → 0.0.5

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 (476) hide show
  1. package/README.md +1 -0
  2. package/dist/{cjs → browser}/index.d.ts +431 -237
  3. package/dist/browser/index.global.js +44 -42
  4. package/dist/browser/index.global.js.map +1 -1
  5. package/dist/common/index.d.ts +5831 -0
  6. package/dist/common/index.js +406 -0
  7. package/dist/common/index.js.map +1 -0
  8. package/dist/esm/api/account.d.ts +292 -0
  9. package/dist/esm/api/account.mjs +2 -0
  10. package/dist/esm/api/account.mjs.map +1 -0
  11. package/dist/esm/api/ans.d.ts +79 -0
  12. package/dist/esm/api/ans.mjs +2 -0
  13. package/dist/esm/api/ans.mjs.map +1 -0
  14. package/dist/esm/api/aptos.d.ts +72 -0
  15. package/dist/esm/api/aptos.mjs +2 -0
  16. package/dist/esm/api/aptos.mjs.map +1 -0
  17. package/dist/esm/api/aptosConfig.d.ts +51 -0
  18. package/dist/esm/api/aptosConfig.mjs +2 -0
  19. package/dist/esm/api/aptosConfig.mjs.map +1 -0
  20. package/dist/esm/api/coin.d.ts +59 -0
  21. package/dist/esm/api/coin.mjs +2 -0
  22. package/dist/esm/api/coin.mjs.map +1 -0
  23. package/dist/esm/api/digitalAsset.d.ts +174 -0
  24. package/dist/esm/api/digitalAsset.mjs +2 -0
  25. package/dist/esm/api/digitalAsset.mjs.map +1 -0
  26. package/dist/esm/api/event.d.ts +74 -0
  27. package/dist/esm/api/event.mjs +2 -0
  28. package/dist/esm/api/event.mjs.map +1 -0
  29. package/dist/esm/api/faucet.d.ts +37 -0
  30. package/dist/esm/api/faucet.mjs +2 -0
  31. package/dist/esm/api/faucet.mjs.map +1 -0
  32. package/dist/esm/api/fungibleAsset.d.ts +72 -0
  33. package/dist/esm/api/fungibleAsset.mjs +2 -0
  34. package/dist/esm/api/fungibleAsset.mjs.map +1 -0
  35. package/dist/esm/api/general.d.ts +150 -0
  36. package/dist/esm/api/general.mjs +2 -0
  37. package/dist/esm/api/general.mjs.map +1 -0
  38. package/dist/esm/api/index.d.ts +46 -0
  39. package/dist/esm/api/index.mjs +2 -0
  40. package/dist/esm/api/index.mjs.map +1 -0
  41. package/dist/esm/api/staking.d.ts +53 -0
  42. package/dist/esm/api/staking.mjs +2 -0
  43. package/dist/esm/api/staking.mjs.map +1 -0
  44. package/dist/esm/api/transaction.d.ts +101 -0
  45. package/dist/esm/api/transaction.mjs +2 -0
  46. package/dist/esm/api/transaction.mjs.map +1 -0
  47. package/dist/esm/api/transactionSubmission.d.ts +142 -0
  48. package/dist/esm/api/transactionSubmission.mjs +2 -0
  49. package/dist/esm/api/transactionSubmission.mjs.map +1 -0
  50. package/dist/esm/bcs/consts.d.ts +14 -0
  51. package/dist/esm/bcs/consts.mjs +2 -0
  52. package/dist/esm/bcs/consts.mjs.map +1 -0
  53. package/dist/esm/bcs/deserializer.d.ts +150 -0
  54. package/dist/esm/bcs/deserializer.mjs +2 -0
  55. package/dist/esm/bcs/deserializer.mjs.map +1 -0
  56. package/dist/esm/bcs/index.d.ts +14 -0
  57. package/dist/esm/bcs/index.mjs +2 -0
  58. package/dist/esm/bcs/index.mjs.map +1 -0
  59. package/dist/esm/bcs/serializable/entryFunctionBytes.d.ts +40 -0
  60. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +2 -0
  61. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -0
  62. package/dist/esm/bcs/serializable/fixedBytes.d.ts +52 -0
  63. package/dist/esm/bcs/serializable/fixedBytes.mjs +2 -0
  64. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -0
  65. package/dist/esm/bcs/serializable/movePrimitives.d.ts +69 -0
  66. package/dist/esm/bcs/serializable/movePrimitives.mjs +2 -0
  67. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -0
  68. package/dist/esm/bcs/serializable/moveStructs.d.ts +284 -0
  69. package/dist/esm/bcs/serializable/moveStructs.mjs +2 -0
  70. package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -0
  71. package/dist/esm/bcs/serializer.d.ts +192 -0
  72. package/dist/esm/bcs/serializer.mjs +2 -0
  73. package/dist/esm/bcs/serializer.mjs.map +1 -0
  74. package/dist/esm/chunk-2444YR3Y.mjs +2 -0
  75. package/dist/esm/chunk-2444YR3Y.mjs.map +1 -0
  76. package/dist/esm/chunk-27P7PELS.mjs +2 -0
  77. package/dist/esm/chunk-27P7PELS.mjs.map +1 -0
  78. package/dist/esm/chunk-2B5QXKPU.mjs +2 -0
  79. package/dist/esm/chunk-2B5QXKPU.mjs.map +1 -0
  80. package/dist/esm/chunk-2MQZUGO6.mjs +2 -0
  81. package/dist/esm/chunk-2MQZUGO6.mjs.map +1 -0
  82. package/dist/esm/chunk-3JPVQHOR.mjs +2 -0
  83. package/dist/esm/chunk-3JPVQHOR.mjs.map +1 -0
  84. package/dist/esm/chunk-3OJN4I42.mjs +2 -0
  85. package/dist/esm/chunk-3OJN4I42.mjs.map +1 -0
  86. package/dist/esm/chunk-3YOV42H5.mjs +2 -0
  87. package/dist/esm/chunk-3YOV42H5.mjs.map +1 -0
  88. package/dist/esm/chunk-4WPQQPUF.mjs +1 -0
  89. package/dist/esm/chunk-4WPQQPUF.mjs.map +1 -0
  90. package/dist/esm/chunk-6FBKUTGF.mjs +2 -0
  91. package/dist/esm/chunk-6FBKUTGF.mjs.map +1 -0
  92. package/dist/esm/chunk-7AIV5FEN.mjs +2 -0
  93. package/dist/esm/chunk-7AIV5FEN.mjs.map +1 -0
  94. package/dist/esm/chunk-7AQXAH6Q.mjs +2 -0
  95. package/dist/esm/chunk-7AQXAH6Q.mjs.map +1 -0
  96. package/dist/esm/chunk-7TL2MY2B.mjs +2 -0
  97. package/dist/esm/chunk-7TL2MY2B.mjs.map +1 -0
  98. package/dist/esm/chunk-ADR4XQPR.mjs +2 -0
  99. package/dist/esm/chunk-ADR4XQPR.mjs.map +1 -0
  100. package/dist/esm/chunk-AH44UPM4.mjs +2 -0
  101. package/dist/esm/chunk-AH44UPM4.mjs.map +1 -0
  102. package/dist/esm/chunk-AY2HWVDO.mjs +2 -0
  103. package/dist/esm/chunk-AY2HWVDO.mjs.map +1 -0
  104. package/dist/esm/chunk-BC2NOUYT.mjs +2 -0
  105. package/dist/esm/chunk-BC2NOUYT.mjs.map +1 -0
  106. package/dist/esm/chunk-BIUGRAMO.mjs +2 -0
  107. package/dist/esm/chunk-BIUGRAMO.mjs.map +1 -0
  108. package/dist/esm/chunk-BREUBEPM.mjs +2 -0
  109. package/dist/esm/chunk-BREUBEPM.mjs.map +1 -0
  110. package/dist/esm/chunk-BSCOVLWS.mjs +1 -0
  111. package/dist/esm/chunk-BSCOVLWS.mjs.map +1 -0
  112. package/dist/esm/chunk-BTK34A5U.mjs +406 -0
  113. package/dist/esm/chunk-BTK34A5U.mjs.map +1 -0
  114. package/dist/esm/chunk-CZZJAR3B.mjs +2 -0
  115. package/dist/esm/chunk-CZZJAR3B.mjs.map +1 -0
  116. package/dist/esm/chunk-DNDWTM7A.mjs +2 -0
  117. package/dist/esm/chunk-DNDWTM7A.mjs.map +1 -0
  118. package/dist/esm/chunk-DNYVUM3K.mjs +2 -0
  119. package/dist/esm/chunk-DNYVUM3K.mjs.map +1 -0
  120. package/dist/esm/chunk-DXUIJ6KA.mjs +2 -0
  121. package/dist/esm/chunk-DXUIJ6KA.mjs.map +1 -0
  122. package/dist/esm/chunk-E72CFUU4.mjs +2 -0
  123. package/dist/esm/chunk-E72CFUU4.mjs.map +1 -0
  124. package/dist/esm/chunk-E7FWVXGX.mjs +1 -0
  125. package/dist/esm/chunk-E7FWVXGX.mjs.map +1 -0
  126. package/dist/esm/chunk-EKAOAGNQ.mjs +2 -0
  127. package/dist/esm/chunk-EKAOAGNQ.mjs.map +1 -0
  128. package/dist/esm/chunk-FBPNHF54.mjs +2 -0
  129. package/dist/esm/chunk-FBPNHF54.mjs.map +1 -0
  130. package/dist/esm/chunk-FHJ7F7Z6.mjs +2 -0
  131. package/dist/esm/chunk-FHJ7F7Z6.mjs.map +1 -0
  132. package/dist/esm/chunk-FNB6CFQR.mjs +2 -0
  133. package/dist/esm/chunk-FNB6CFQR.mjs.map +1 -0
  134. package/dist/esm/chunk-FYIFBLHU.mjs +2 -0
  135. package/dist/esm/chunk-FYIFBLHU.mjs.map +1 -0
  136. package/dist/esm/chunk-FZY4PMEE.mjs +1 -0
  137. package/dist/esm/chunk-FZY4PMEE.mjs.map +1 -0
  138. package/dist/esm/chunk-GUT3G5CG.mjs +2 -0
  139. package/dist/esm/chunk-GUT3G5CG.mjs.map +1 -0
  140. package/dist/esm/chunk-HH5RSP2H.mjs +2 -0
  141. package/dist/esm/chunk-HH5RSP2H.mjs.map +1 -0
  142. package/dist/esm/chunk-HTZTTZQJ.mjs +1 -0
  143. package/dist/esm/chunk-HTZTTZQJ.mjs.map +1 -0
  144. package/dist/esm/chunk-I5OYNCZS.mjs +1 -0
  145. package/dist/esm/chunk-I5OYNCZS.mjs.map +1 -0
  146. package/dist/esm/chunk-IPJKGHQY.mjs +2 -0
  147. package/dist/esm/chunk-IPJKGHQY.mjs.map +1 -0
  148. package/dist/esm/chunk-IXMH6AXJ.mjs +2 -0
  149. package/dist/esm/chunk-IXMH6AXJ.mjs.map +1 -0
  150. package/dist/esm/chunk-IZHPCZE3.mjs +2 -0
  151. package/dist/esm/chunk-IZHPCZE3.mjs.map +1 -0
  152. package/dist/esm/chunk-J3QOSJFP.mjs +2 -0
  153. package/dist/esm/chunk-J3QOSJFP.mjs.map +1 -0
  154. package/dist/esm/chunk-J5OKXARS.mjs +2 -0
  155. package/dist/esm/chunk-J5OKXARS.mjs.map +1 -0
  156. package/dist/esm/chunk-JTGGMXB7.mjs +2 -0
  157. package/dist/esm/chunk-JTGGMXB7.mjs.map +1 -0
  158. package/dist/esm/chunk-KC64ESLO.mjs +2 -0
  159. package/dist/esm/chunk-KC64ESLO.mjs.map +1 -0
  160. package/dist/esm/chunk-KFP7MDSD.mjs +2 -0
  161. package/dist/esm/chunk-KFP7MDSD.mjs.map +1 -0
  162. package/dist/esm/chunk-KJDY66XF.mjs +2 -0
  163. package/dist/esm/chunk-KJDY66XF.mjs.map +1 -0
  164. package/dist/esm/chunk-KNLMUSIO.mjs +2 -0
  165. package/dist/esm/chunk-KNLMUSIO.mjs.map +1 -0
  166. package/dist/esm/chunk-KPESAXVI.mjs +2 -0
  167. package/dist/esm/chunk-KPESAXVI.mjs.map +1 -0
  168. package/dist/esm/chunk-KWJ6XKNF.mjs +2 -0
  169. package/dist/esm/chunk-KWJ6XKNF.mjs.map +1 -0
  170. package/dist/esm/chunk-KYWYIK5P.mjs +2 -0
  171. package/dist/esm/chunk-KYWYIK5P.mjs.map +1 -0
  172. package/dist/esm/chunk-LAXIJRYU.mjs +2 -0
  173. package/dist/esm/chunk-LAXIJRYU.mjs.map +1 -0
  174. package/dist/esm/chunk-LR65XHSF.mjs +2 -0
  175. package/dist/esm/chunk-LR65XHSF.mjs.map +1 -0
  176. package/dist/esm/chunk-LU6VS7PJ.mjs +2 -0
  177. package/dist/esm/chunk-LU6VS7PJ.mjs.map +1 -0
  178. package/dist/esm/chunk-LV33NV4J.mjs +2 -0
  179. package/dist/esm/chunk-LV33NV4J.mjs.map +1 -0
  180. package/dist/esm/chunk-MIBLZSNS.mjs +2 -0
  181. package/dist/esm/chunk-MIBLZSNS.mjs.map +1 -0
  182. package/dist/esm/chunk-N2FKVZ4D.mjs +1 -0
  183. package/dist/esm/chunk-N2FKVZ4D.mjs.map +1 -0
  184. package/dist/esm/chunk-N6XWY4UT.mjs +2 -0
  185. package/dist/esm/chunk-N6XWY4UT.mjs.map +1 -0
  186. package/dist/esm/chunk-NKTKHC3Z.mjs +2 -0
  187. package/dist/esm/chunk-NKTKHC3Z.mjs.map +1 -0
  188. package/dist/esm/chunk-O243HOP3.mjs +2 -0
  189. package/dist/esm/chunk-O243HOP3.mjs.map +1 -0
  190. package/dist/esm/chunk-PDLUCVJB.mjs +2 -0
  191. package/dist/esm/chunk-PDLUCVJB.mjs.map +1 -0
  192. package/dist/esm/chunk-PJDVHU7X.mjs +2 -0
  193. package/dist/esm/chunk-PJDVHU7X.mjs.map +1 -0
  194. package/dist/esm/chunk-R7G3CLRI.mjs +1 -0
  195. package/dist/esm/chunk-R7G3CLRI.mjs.map +1 -0
  196. package/dist/esm/chunk-RMMOF53Q.mjs +1 -0
  197. package/dist/esm/chunk-RMMOF53Q.mjs.map +1 -0
  198. package/dist/esm/chunk-SJLO3JIH.mjs +2 -0
  199. package/dist/esm/chunk-SJLO3JIH.mjs.map +1 -0
  200. package/dist/esm/chunk-TCTZCPQ6.mjs +1 -0
  201. package/dist/esm/chunk-TCTZCPQ6.mjs.map +1 -0
  202. package/dist/esm/chunk-TXUMB5ZO.mjs +2 -0
  203. package/dist/esm/chunk-TXUMB5ZO.mjs.map +1 -0
  204. package/dist/esm/chunk-TYHBYRUA.mjs +2 -0
  205. package/dist/esm/chunk-TYHBYRUA.mjs.map +1 -0
  206. package/dist/esm/chunk-UQIOMAXE.mjs +2 -0
  207. package/dist/esm/chunk-UQIOMAXE.mjs.map +1 -0
  208. package/dist/esm/chunk-UVGCVCNG.mjs +2 -0
  209. package/dist/esm/chunk-UVGCVCNG.mjs.map +1 -0
  210. package/dist/esm/chunk-UYVPNUH3.mjs +1 -0
  211. package/dist/esm/chunk-UYVPNUH3.mjs.map +1 -0
  212. package/dist/esm/chunk-V3MBJJTL.mjs +1 -0
  213. package/dist/esm/chunk-V3MBJJTL.mjs.map +1 -0
  214. package/dist/esm/chunk-V6AAQLLJ.mjs +2 -0
  215. package/dist/esm/chunk-V6AAQLLJ.mjs.map +1 -0
  216. package/dist/esm/chunk-VAGYTPSI.mjs +2 -0
  217. package/dist/esm/chunk-VAGYTPSI.mjs.map +1 -0
  218. package/dist/esm/chunk-WGXAIQ7K.mjs +2 -0
  219. package/dist/esm/chunk-WGXAIQ7K.mjs.map +1 -0
  220. package/dist/esm/chunk-WNEZCERQ.mjs +2 -0
  221. package/dist/esm/chunk-WNEZCERQ.mjs.map +1 -0
  222. package/dist/esm/chunk-WVMDCC4V.mjs +2 -0
  223. package/dist/esm/chunk-WVMDCC4V.mjs.map +1 -0
  224. package/dist/esm/chunk-XFS5O5GJ.mjs +2 -0
  225. package/dist/esm/chunk-XFS5O5GJ.mjs.map +1 -0
  226. package/dist/esm/chunk-XFSL7O6Q.mjs +2 -0
  227. package/dist/esm/chunk-XFSL7O6Q.mjs.map +1 -0
  228. package/dist/esm/chunk-XNFEUXDS.mjs +2 -0
  229. package/dist/esm/chunk-XNFEUXDS.mjs.map +1 -0
  230. package/dist/esm/chunk-YS2OX7AB.mjs +2 -0
  231. package/dist/esm/chunk-YS2OX7AB.mjs.map +1 -0
  232. package/dist/esm/chunk-Z56AKXJ7.mjs +2 -0
  233. package/dist/esm/chunk-Z56AKXJ7.mjs.map +1 -0
  234. package/dist/esm/chunk-ZT2A5ABR.mjs +2 -0
  235. package/dist/esm/chunk-ZT2A5ABR.mjs.map +1 -0
  236. package/dist/esm/chunk-ZXJ5ZBTL.mjs +2 -0
  237. package/dist/esm/chunk-ZXJ5ZBTL.mjs.map +1 -0
  238. package/dist/esm/client/core.d.ts +24 -0
  239. package/dist/esm/client/core.mjs +2 -0
  240. package/dist/esm/client/core.mjs.map +1 -0
  241. package/dist/esm/client/get.d.ts +55 -0
  242. package/dist/esm/client/get.mjs +2 -0
  243. package/dist/esm/client/get.mjs.map +1 -0
  244. package/dist/esm/client/index.d.ts +11 -0
  245. package/dist/esm/client/index.mjs +2 -0
  246. package/dist/esm/client/index.mjs.map +1 -0
  247. package/dist/esm/client/post.d.ts +60 -0
  248. package/dist/esm/client/post.mjs +2 -0
  249. package/dist/esm/client/post.mjs.map +1 -0
  250. package/dist/esm/client/types.d.ts +46 -0
  251. package/dist/esm/client/types.mjs +2 -0
  252. package/dist/esm/client/types.mjs.map +1 -0
  253. package/dist/esm/core/account.d.ts +184 -0
  254. package/dist/esm/core/account.mjs +2 -0
  255. package/dist/esm/core/account.mjs.map +1 -0
  256. package/dist/esm/core/accountAddress.d.ts +244 -0
  257. package/dist/esm/core/accountAddress.mjs +2 -0
  258. package/dist/esm/core/accountAddress.mjs.map +1 -0
  259. package/dist/esm/core/authenticationKey.d.ts +74 -0
  260. package/dist/esm/core/authenticationKey.mjs +2 -0
  261. package/dist/esm/core/authenticationKey.mjs.map +1 -0
  262. package/dist/esm/core/common.d.ts +32 -0
  263. package/dist/esm/core/common.mjs +2 -0
  264. package/dist/esm/core/common.mjs.map +1 -0
  265. package/dist/esm/core/crypto/anyPublicKey.d.ts +54 -0
  266. package/dist/esm/core/crypto/anyPublicKey.mjs +2 -0
  267. package/dist/esm/core/crypto/anyPublicKey.mjs.map +1 -0
  268. package/dist/esm/core/crypto/anySignature.d.ts +31 -0
  269. package/dist/esm/core/crypto/anySignature.mjs +2 -0
  270. package/dist/esm/core/crypto/anySignature.mjs.map +1 -0
  271. package/dist/esm/core/crypto/asymmetricCrypto.d.ts +74 -0
  272. package/dist/esm/core/crypto/asymmetricCrypto.mjs +2 -0
  273. package/dist/esm/core/crypto/asymmetricCrypto.mjs.map +1 -0
  274. package/dist/esm/core/crypto/ed25519.d.ts +173 -0
  275. package/dist/esm/core/crypto/ed25519.mjs +2 -0
  276. package/dist/esm/core/crypto/ed25519.mjs.map +1 -0
  277. package/dist/esm/core/crypto/hdKey.d.ts +65 -0
  278. package/dist/esm/core/crypto/hdKey.mjs +2 -0
  279. package/dist/esm/core/crypto/hdKey.mjs.map +1 -0
  280. package/dist/esm/core/crypto/index.d.ts +17 -0
  281. package/dist/esm/core/crypto/index.mjs +2 -0
  282. package/dist/esm/core/crypto/index.mjs.map +1 -0
  283. package/dist/esm/core/crypto/multiEd25519.d.ts +126 -0
  284. package/dist/esm/core/crypto/multiEd25519.mjs +2 -0
  285. package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -0
  286. package/dist/esm/core/crypto/multiKey.d.ts +52 -0
  287. package/dist/esm/core/crypto/multiKey.mjs +2 -0
  288. package/dist/esm/core/crypto/multiKey.mjs.map +1 -0
  289. package/dist/esm/core/crypto/secp256k1.d.ts +161 -0
  290. package/dist/esm/core/crypto/secp256k1.mjs +2 -0
  291. package/dist/esm/core/crypto/secp256k1.mjs.map +1 -0
  292. package/dist/esm/core/hex.d.ts +105 -0
  293. package/dist/esm/core/hex.mjs +2 -0
  294. package/dist/esm/core/hex.mjs.map +1 -0
  295. package/dist/esm/core/index.d.ts +21 -0
  296. package/dist/esm/core/index.mjs +2 -0
  297. package/dist/esm/core/index.mjs.map +1 -0
  298. package/dist/esm/index.d.ts +60 -5637
  299. package/dist/esm/index.mjs +1 -5444
  300. package/dist/esm/index.mjs.map +1 -1
  301. package/dist/esm/internal/account.d.ts +143 -0
  302. package/dist/esm/internal/account.mjs +2 -0
  303. package/dist/esm/internal/account.mjs.map +1 -0
  304. package/dist/esm/internal/ans.d.ts +83 -0
  305. package/dist/esm/internal/ans.mjs +2 -0
  306. package/dist/esm/internal/ans.mjs.map +1 -0
  307. package/dist/esm/internal/coin.d.ts +43 -0
  308. package/dist/esm/internal/coin.mjs +2 -0
  309. package/dist/esm/internal/coin.mjs.map +1 -0
  310. package/dist/esm/internal/digitalAsset.d.ts +118 -0
  311. package/dist/esm/internal/digitalAsset.mjs +2 -0
  312. package/dist/esm/internal/digitalAsset.mjs.map +1 -0
  313. package/dist/esm/internal/event.d.ts +45 -0
  314. package/dist/esm/internal/event.mjs +2 -0
  315. package/dist/esm/internal/event.mjs.map +1 -0
  316. package/dist/esm/internal/faucet.d.ts +29 -0
  317. package/dist/esm/internal/faucet.mjs +2 -0
  318. package/dist/esm/internal/faucet.mjs.map +1 -0
  319. package/dist/esm/internal/fungibleAsset.d.ts +38 -0
  320. package/dist/esm/internal/fungibleAsset.mjs +2 -0
  321. package/dist/esm/internal/fungibleAsset.mjs.map +1 -0
  322. package/dist/esm/internal/general.d.ts +60 -0
  323. package/dist/esm/internal/general.mjs +2 -0
  324. package/dist/esm/internal/general.mjs.map +1 -0
  325. package/dist/esm/internal/staking.d.ts +38 -0
  326. package/dist/esm/internal/staking.mjs +2 -0
  327. package/dist/esm/internal/staking.mjs.map +1 -0
  328. package/dist/esm/internal/transaction.d.ts +57 -0
  329. package/dist/esm/internal/transaction.mjs +2 -0
  330. package/dist/esm/internal/transaction.mjs.map +1 -0
  331. package/dist/esm/internal/transactionSubmission.d.ts +148 -0
  332. package/dist/esm/internal/transactionSubmission.mjs +2 -0
  333. package/dist/esm/internal/transactionSubmission.mjs.map +1 -0
  334. package/dist/esm/transactions/authenticator/account.d.ts +79 -0
  335. package/dist/esm/transactions/authenticator/account.mjs +2 -0
  336. package/dist/esm/transactions/authenticator/account.mjs.map +1 -0
  337. package/dist/esm/transactions/authenticator/index.d.ts +19 -0
  338. package/dist/esm/transactions/authenticator/index.mjs +2 -0
  339. package/dist/esm/transactions/authenticator/index.mjs.map +1 -0
  340. package/dist/esm/transactions/authenticator/transaction.d.ts +105 -0
  341. package/dist/esm/transactions/authenticator/transaction.mjs +2 -0
  342. package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -0
  343. package/dist/esm/transactions/index.d.ts +39 -0
  344. package/dist/esm/transactions/index.mjs +2 -0
  345. package/dist/esm/transactions/index.mjs.map +1 -0
  346. package/dist/esm/transactions/instances/chainId.d.ts +21 -0
  347. package/dist/esm/transactions/instances/chainId.mjs +2 -0
  348. package/dist/esm/transactions/instances/chainId.mjs.map +1 -0
  349. package/dist/esm/transactions/instances/identifier.d.ts +23 -0
  350. package/dist/esm/transactions/instances/identifier.mjs +2 -0
  351. package/dist/esm/transactions/instances/identifier.mjs.map +1 -0
  352. package/dist/esm/transactions/instances/index.d.ts +29 -0
  353. package/dist/esm/transactions/instances/index.mjs +2 -0
  354. package/dist/esm/transactions/instances/index.mjs.map +1 -0
  355. package/dist/esm/transactions/instances/moduleId.d.ts +37 -0
  356. package/dist/esm/transactions/instances/moduleId.mjs +2 -0
  357. package/dist/esm/transactions/instances/moduleId.mjs.map +1 -0
  358. package/dist/esm/transactions/instances/rawTransaction.d.ts +98 -0
  359. package/dist/esm/transactions/instances/rawTransaction.mjs +2 -0
  360. package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -0
  361. package/dist/esm/transactions/instances/rotationProofChallenge.d.ts +37 -0
  362. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +2 -0
  363. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -0
  364. package/dist/esm/transactions/instances/signedTransaction.d.ts +46 -0
  365. package/dist/esm/transactions/instances/signedTransaction.mjs +2 -0
  366. package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -0
  367. package/dist/esm/transactions/instances/transactionArgument.d.ts +40 -0
  368. package/dist/esm/transactions/instances/transactionArgument.mjs +2 -0
  369. package/dist/esm/transactions/instances/transactionArgument.mjs.map +1 -0
  370. package/dist/esm/transactions/instances/transactionPayload.d.ts +211 -0
  371. package/dist/esm/transactions/instances/transactionPayload.mjs +2 -0
  372. package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -0
  373. package/dist/esm/transactions/transactionBuilder/helpers.d.ts +63 -0
  374. package/dist/esm/transactions/transactionBuilder/helpers.mjs +2 -0
  375. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -0
  376. package/dist/esm/transactions/transactionBuilder/index.d.ts +35 -0
  377. package/dist/esm/transactions/transactionBuilder/index.mjs +2 -0
  378. package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -0
  379. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.ts +54 -0
  380. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +2 -0
  381. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -0
  382. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.ts +128 -0
  383. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +2 -0
  384. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -0
  385. package/dist/esm/transactions/typeTag/index.d.ts +127 -0
  386. package/dist/esm/transactions/typeTag/index.mjs +2 -0
  387. package/dist/esm/transactions/typeTag/index.mjs.map +1 -0
  388. package/dist/esm/transactions/typeTag/parser.d.ts +47 -0
  389. package/dist/esm/transactions/typeTag/parser.mjs +2 -0
  390. package/dist/esm/transactions/typeTag/parser.mjs.map +1 -0
  391. package/dist/esm/transactions/types.d.ts +253 -0
  392. package/dist/esm/transactions/types.mjs +2 -0
  393. package/dist/esm/transactions/types.mjs.map +1 -0
  394. package/dist/esm/types/generated/operations.d.ts +604 -0
  395. package/dist/esm/types/generated/operations.mjs +1 -0
  396. package/dist/esm/types/generated/operations.mjs.map +1 -0
  397. package/dist/esm/types/generated/queries.d.ts +55 -0
  398. package/dist/esm/types/generated/queries.mjs +2 -0
  399. package/dist/esm/types/generated/queries.mjs.map +1 -0
  400. package/dist/esm/types/generated/types.d.ts +9458 -0
  401. package/dist/esm/types/generated/types.mjs +2 -0
  402. package/dist/esm/types/generated/types.mjs.map +1 -0
  403. package/dist/{types → esm/types}/index.d.ts +19 -451
  404. package/dist/esm/types/index.mjs +2 -0
  405. package/dist/esm/types/index.mjs.map +1 -0
  406. package/dist/esm/types/indexer.d.ts +62 -0
  407. package/dist/esm/types/indexer.mjs +2 -0
  408. package/dist/esm/types/indexer.mjs.map +1 -0
  409. package/dist/esm/utils/apiEndpoints.d.ts +14 -0
  410. package/dist/esm/utils/apiEndpoints.mjs +2 -0
  411. package/dist/esm/utils/apiEndpoints.mjs.map +1 -0
  412. package/dist/esm/utils/const.d.ts +42 -0
  413. package/dist/esm/utils/const.mjs +2 -0
  414. package/dist/esm/utils/const.mjs.map +1 -0
  415. package/dist/esm/utils/helpers.d.ts +7 -0
  416. package/dist/esm/utils/helpers.mjs +2 -0
  417. package/dist/esm/utils/helpers.mjs.map +1 -0
  418. package/dist/esm/utils/memoize.d.ts +20 -0
  419. package/dist/esm/utils/memoize.mjs +2 -0
  420. package/dist/esm/utils/memoize.mjs.map +1 -0
  421. package/dist/esm/version.d.ts +8 -0
  422. package/dist/esm/version.mjs +2 -0
  423. package/dist/esm/version.mjs.map +1 -0
  424. package/package.json +17 -13
  425. package/src/api/account.ts +17 -18
  426. package/src/api/ans.ts +58 -0
  427. package/src/api/aptos.ts +7 -1
  428. package/src/api/coin.ts +3 -3
  429. package/src/api/digitalAsset.ts +9 -8
  430. package/src/api/event.ts +4 -3
  431. package/src/api/faucet.ts +3 -2
  432. package/src/api/general.ts +2 -2
  433. package/src/api/staking.ts +5 -4
  434. package/src/api/transactionSubmission.ts +41 -20
  435. package/src/bcs/deserializer.ts +4 -4
  436. package/src/bcs/serializable/moveStructs.ts +13 -13
  437. package/src/bcs/serializer.ts +4 -4
  438. package/src/client/core.ts +18 -8
  439. package/src/core/account.ts +90 -33
  440. package/src/core/accountAddress.ts +34 -30
  441. package/src/core/authenticationKey.ts +11 -9
  442. package/src/core/crypto/ed25519.ts +48 -1
  443. package/src/core/crypto/hdKey.ts +105 -0
  444. package/src/core/crypto/index.ts +1 -0
  445. package/src/core/crypto/secp256k1.ts +36 -0
  446. package/src/index.ts +0 -1
  447. package/src/internal/account.ts +80 -58
  448. package/src/internal/ans.ts +175 -0
  449. package/src/internal/coin.ts +5 -5
  450. package/src/internal/digitalAsset.ts +16 -17
  451. package/src/internal/event.ts +8 -8
  452. package/src/internal/faucet.ts +4 -4
  453. package/src/internal/general.ts +3 -3
  454. package/src/internal/queries/getEvents.graphql +1 -0
  455. package/src/internal/staking.ts +8 -8
  456. package/src/internal/transactionSubmission.ts +78 -19
  457. package/src/transactions/instances/index.ts +1 -0
  458. package/src/transactions/instances/moduleId.ts +1 -1
  459. package/src/transactions/instances/rotationProofChallenge.ts +58 -0
  460. package/src/transactions/transactionBuilder/helpers.ts +5 -1
  461. package/src/transactions/transactionBuilder/remoteAbi.ts +4 -4
  462. package/src/transactions/transactionBuilder/transactionBuilder.ts +31 -49
  463. package/src/transactions/typeTag/index.ts +10 -10
  464. package/src/transactions/typeTag/parser.ts +1 -1
  465. package/src/transactions/types.ts +31 -20
  466. package/src/types/generated/operations.ts +19 -18
  467. package/src/types/generated/queries.ts +20 -19
  468. package/src/types/generated/types.ts +6 -0
  469. package/src/types/index.ts +15 -18
  470. package/src/utils/apiEndpoints.ts +8 -0
  471. package/src/version.ts +1 -1
  472. package/dist/cjs/index.js +0 -5631
  473. package/dist/cjs/index.js.map +0 -1
  474. package/dist/types/index.js +0 -176
  475. package/dist/types/index.js.map +0 -1
  476. package/src/utils/hdKey.ts +0 -113
@@ -0,0 +1,2 @@
1
+ import{a as o}from"./chunk-J5OKXARS.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
+ //# sourceMappingURL=chunk-XFSL7O6Q.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/coin.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Account, AccountAddressInput } from \"../core\";\nimport { transferCoinTransaction } from \"../internal/coin\";\nimport { InputSingleSignerTransaction, InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AnyNumber, MoveStructType } from \"../types\";\n\n/**\n * A class to handle all `Coin` operations\n */\nexport class Coin {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Generate a transfer coin transaction that can be simulated and/or signed and submitted\n *\n * @param args.sender The sender account\n * @param args.recipient The recipient address\n * @param args.amount The amount to transfer\n * @param args.coinType optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin\n *\n * @returns SingleSignerTransaction\n */\n async transferCoinTransaction(args: {\n sender: Account;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n coinType?: MoveStructType;\n options?: InputGenerateTransactionOptions;\n }): Promise<InputSingleSignerTransaction> {\n return transferCoinTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"yCAYO,IAAMA,EAAN,KAAW,CAGhB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAYA,MAAM,wBAAwBC,EAMY,CACxC,OAAOC,EAAwB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACtE,CACF","names":["Coin","config","args","transferCoinTransaction"]}
@@ -0,0 +1,2 @@
1
+ var h=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=(g,b,d,c)=>{for(var a=c>1?void 0:c?i(b,d):b,e=g.length-1,f;e>=0;e--)(f=g[e])&&(a=(c?f(b,d,a):f(a))||a);return c&&a&&h(b,d,a),a};export{j as a};
2
+ //# sourceMappingURL=chunk-XNFEUXDS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ import{a as d,b as p,c as g}from"./chunk-E72CFUU4.mjs";import{e as m,j as x}from"./chunk-LR65XHSF.mjs";import{b as n}from"./chunk-IZHPCZE3.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as z}from"@scure/bip32";var s=class extends d{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==s.LENGTH)throw new Error(`PublicKey length should be ${s.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:t,signature:i}=e,u=n.fromHexInput(t).toUint8Array(),f=H(u),v=i.toUint8Array();return o.verify(v,f,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new s(t)}static load(e){let t=e.deserializeBytes();return new s(t)}},y=s;y.LENGTH=65;var r=class extends p{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let t=n.fromHexInput(e),i=H(t.toUint8Array()),u=o.sign(i,this.key.toUint8Array());return new l(u.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t)}static generate(){let e=o.utils.randomPrivateKey();return new r(e)}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new y(e)}static fromDerivationPath(e,t){if(!m(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,x(t))}static fromDerivationPathInner(e,t){let{privateKey:i}=z.fromMasterSeed(t).derive(e);if(i===null)throw new Error("Invalid key");return new r(i)}},c=r;c.LENGTH=32;var a=class extends g{constructor(e){super();let t=n.fromHexInput(e);if(t.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, recieved ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new a(t)}static load(e){let t=e.deserializeBytes();return new a(t)}},l=a;l.LENGTH=64;export{y as a,c as b,l as c};
2
+ //# sourceMappingURL=chunk-YS2OX7AB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/secp256k1.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { sha3_256 } from \"@noble/hashes/sha3\";\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { HDKey } from \"@scure/bip32\";\nimport { PrivateKey, PublicKey, Signature } from \"./asymmetricCrypto\";\nimport { Deserializer, Serializer } from \"../../bcs\";\nimport { Hex } from \"../hex\";\nimport { HexInput } from \"../../types\";\nimport { isValidBIP44Path, mnemonicToSeed } from \"./hdKey\";\n\n/**\n * Represents the Secp256k1 ecdsa public key\n *\n * Secp256k1 authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class Secp256k1PublicKey extends PublicKey {\n // Secp256k1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.\n static readonly LENGTH: number = 65;\n\n // Hex value of the public key\n private readonly key: Hex;\n\n /**\n * Create a new PublicKey instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Secp256k1PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Secp256k1PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n /**\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 /**\n * Get the public key as a hex string with the 0x prefix.\n *\n * @returns string representation of the public key\n */\n toString(): string {\n return this.key.toString();\n }\n\n /**\n * Verifies a signed data with a public key\n *\n * @param args.message message\n * @param args.signature The signature\n * @returns true if the signature is valid\n */\n verifySignature(args: { message: HexInput; signature: Secp256k1Signature }): boolean {\n const { message, signature } = args;\n const msgHex = Hex.fromHexInput(message).toUint8Array();\n const sha3Message = sha3_256(msgHex);\n const rawSignature = signature.toUint8Array();\n return secp256k1.verify(rawSignature, sha3Message, this.toUint8Array());\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PublicKey(bytes);\n }\n\n static load(deserializer: Deserializer): Secp256k1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PublicKey(bytes);\n }\n}\n\n/**\n * A Secp256k1 ecdsa private key\n */\nexport class Secp256k1PrivateKey extends PrivateKey {\n /**\n * Length of Secp256k1 ecdsa private key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The private key bytes\n * @private\n */\n private readonly key: Hex;\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const privateKeyHex = Hex.fromHexInput(hexInput);\n if (privateKeyHex.toUint8Array().length !== Secp256k1PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Secp256k1PrivateKey.LENGTH}`);\n }\n\n this.key = privateKeyHex;\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key\n */\n toString(): string {\n return this.key.toString();\n }\n\n /**\n * Sign the given message with the private key.\n *\n * @param message in HexInput format\n * @returns Signature\n */\n sign(message: HexInput): Secp256k1Signature {\n const msgHex = Hex.fromHexInput(message);\n const sha3Message = sha3_256(msgHex.toUint8Array());\n const signature = secp256k1.sign(sha3Message, this.key.toUint8Array());\n return new Secp256k1Signature(signature.toCompactRawBytes());\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PrivateKey(bytes);\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Secp256k1PrivateKey\n */\n static generate(): Secp256k1PrivateKey {\n const hexInput = secp256k1.utils.randomPrivateKey();\n return new Secp256k1PrivateKey(hexInput);\n }\n\n /**\n * Derive the Secp256k1PublicKey from this private key.\n *\n * @returns Secp256k1PublicKey\n */\n publicKey(): Secp256k1PublicKey {\n const bytes = secp256k1.getPublicKey(this.key.toUint8Array(), false);\n return new Secp256k1PublicKey(bytes);\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase.\n *\n * @param path the BIP44 path\n * @param mnemonics the mnemonic seed phrase\n *\n * @returns The generated key\n */\n static fromDerivationPath(path: string, mnemonics: string): Secp256k1PrivateKey {\n if (!isValidBIP44Path(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Secp256k1PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));\n }\n\n /**\n * A private inner function so we can separate from the main fromDerivationPath() method\n * to add tests to verify we create the keys correctly.\n *\n * @param path the BIP44 path\n * @param seed the seed phrase created by the mnemonics\n *\n * @returns The generated key\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array): Secp256k1PrivateKey {\n const { privateKey } = HDKey.fromMasterSeed(seed).derive(path);\n // library returns privateKey as Uint8Array | null\n if (privateKey === null) {\n throw new Error(\"Invalid key\");\n }\n\n return new Secp256k1PrivateKey(privateKey);\n }\n}\n\n/**\n * A signature of a message signed using an Secp256k1 ecdsa private key\n */\nexport class Secp256k1Signature extends Signature {\n /**\n * Secp256k1 ecdsa signatures are 256-bit.\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n */\n private readonly data: Hex;\n\n /**\n * Create a new Signature instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Secp256k1Signature.LENGTH) {\n throw new Error(`Signature length should be ${Secp256k1Signature.LENGTH}, recieved ${hex.toUint8Array().length}`);\n }\n this.data = hex;\n }\n\n /**\n * Get the signature in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the signature\n */\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n /**\n * Get the signature as a hex string with the 0x prefix.\n *\n * @returns string representation of the signature\n */\n toString(): string {\n return this.data.toString();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1Signature {\n const hex = deserializer.deserializeBytes();\n return new Secp256k1Signature(hex);\n }\n\n static load(deserializer: Deserializer): Secp256k1Signature {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1Signature(bytes);\n }\n}\n"],"mappings":"gJAGA,OAAS,YAAAA,MAAgB,qBACzB,OAAS,aAAAC,MAAiB,0BAC1B,OAAS,SAAAC,MAAa,eAYf,IAAMC,EAAN,cAAiCC,CAAU,CAYhD,YAAYC,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EACrC,GAAIC,EAAI,aAAa,EAAE,SAAWH,EAAmB,OACnD,MAAM,IAAI,MAAM,8BAA8BA,EAAmB,QAAQ,EAE3E,KAAK,IAAMG,CACb,CAOA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAOA,UAAmB,CACjB,OAAO,KAAK,IAAI,SAAS,CAC3B,CASA,gBAAgBE,EAAqE,CACnF,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EACzBG,EAASJ,EAAI,aAAaE,CAAO,EAAE,aAAa,EAChDG,EAAcC,EAASF,CAAM,EAC7BG,EAAeJ,EAAU,aAAa,EAC5C,OAAOK,EAAU,OAAOD,EAAcF,EAAa,KAAK,aAAa,CAAC,CACxE,CAEA,UAAUI,EAA8B,CACtCA,EAAW,eAAe,KAAK,IAAI,aAAa,CAAC,CACnD,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAId,EAAmBe,CAAK,CACrC,CAEA,OAAO,KAAKD,EAAgD,CAC1D,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAId,EAAmBe,CAAK,CACrC,CACF,EApEaC,EAANhB,EAAMgB,EAEK,OAAiB,GAuE5B,IAAMC,EAAN,cAAkCC,CAAW,CAiBlD,YAAYhB,EAAoB,CAC9B,MAAM,EAEN,IAAMiB,EAAgBf,EAAI,aAAaF,CAAQ,EAC/C,GAAIiB,EAAc,aAAa,EAAE,SAAWF,EAAoB,OAC9D,MAAM,IAAI,MAAM,+BAA+BA,EAAoB,QAAQ,EAG7E,KAAK,IAAME,CACb,CAOA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAOA,UAAmB,CACjB,OAAO,KAAK,IAAI,SAAS,CAC3B,CAQA,KAAKb,EAAuC,CAC1C,IAAME,EAASJ,EAAI,aAAaE,CAAO,EACjCG,EAAcC,EAASF,EAAO,aAAa,CAAC,EAC5CD,EAAYK,EAAU,KAAKH,EAAa,KAAK,IAAI,aAAa,CAAC,EACrE,OAAO,IAAIW,EAAmBb,EAAU,kBAAkB,CAAC,CAC7D,CAEA,UAAUM,EAA8B,CACtCA,EAAW,eAAe,KAAK,aAAa,CAAC,CAC/C,CAEA,OAAO,YAAYC,EAAiD,CAClE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIG,EAAoBF,CAAK,CACtC,CAOA,OAAO,UAAgC,CACrC,IAAMb,EAAWU,EAAU,MAAM,iBAAiB,EAClD,OAAO,IAAIK,EAAoBf,CAAQ,CACzC,CAOA,WAAgC,CAC9B,IAAMa,EAAQH,EAAU,aAAa,KAAK,IAAI,aAAa,EAAG,EAAK,EACnE,OAAO,IAAII,EAAmBD,CAAK,CACrC,CAUA,OAAO,mBAAmBM,EAAcC,EAAwC,CAC9E,GAAI,CAACC,EAAiBF,CAAI,EACxB,MAAM,IAAI,MAAM,2BAA2BA,GAAM,EAEnD,OAAOJ,EAAoB,wBAAwBI,EAAMG,EAAeF,CAAS,CAAC,CACpF,CAWA,OAAe,wBAAwBD,EAAcI,EAAuC,CAC1F,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAM,eAAeF,CAAI,EAAE,OAAOJ,CAAI,EAE7D,GAAIK,IAAe,KACjB,MAAM,IAAI,MAAM,aAAa,EAG/B,OAAO,IAAIT,EAAoBS,CAAU,CAC3C,CACF,EAzHaE,EAANX,EAAMW,EAIK,OAAiB,GA0H5B,IAAMC,EAAN,cAAiCC,CAAU,CAiBhD,YAAY5B,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EACrC,GAAIC,EAAI,aAAa,EAAE,SAAW0B,EAAmB,OACnD,MAAM,IAAI,MAAM,8BAA8BA,EAAmB,oBAAoB1B,EAAI,aAAa,EAAE,QAAQ,EAElH,KAAK,KAAOA,CACd,CAOA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CAOA,UAAmB,CACjB,OAAO,KAAK,KAAK,SAAS,CAC5B,CAEA,UAAUU,EAA8B,CACtCA,EAAW,eAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMX,EAAMW,EAAa,iBAAiB,EAC1C,OAAO,IAAIe,EAAmB1B,CAAG,CACnC,CAEA,OAAO,KAAKW,EAAgD,CAC1D,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIe,EAAmBd,CAAK,CACrC,CACF,EA1DaK,EAANS,EAAMT,EAIK,OAAS","names":["sha3_256","secp256k1","HDKey","_Secp256k1PublicKey","PublicKey","hexInput","hex","Hex","args","message","signature","msgHex","sha3Message","sha3_256","rawSignature","secp256k1","serializer","deserializer","bytes","Secp256k1PublicKey","_Secp256k1PrivateKey","PrivateKey","privateKeyHex","Secp256k1Signature","path","mnemonics","isValidBIP44Path","mnemonicToSeed","seed","privateKey","HDKey","Secp256k1PrivateKey","_Secp256k1Signature","Signature"]}
@@ -0,0 +1,2 @@
1
+ import{f as r,g as o}from"./chunk-FHJ7F7Z6.mjs";var s=class{constructor(e){this.config=e}async getOwnerAddress(e){return r({aptosConfig:this.config,...e})}async registerName(e){return o({aptosConfig:this.config,...e})}};export{s as a};
2
+ //# sourceMappingURL=chunk-Z56AKXJ7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/ans.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { RegisterNameParameters, getOwnerAddress, registerName } from \"../internal/ans\";\nimport { InputSingleSignerTransaction } from \"../transactions/types\";\nimport { MoveAddressType } from \"../types\";\nimport { AptosConfig } from \"./aptosConfig\";\n\n/**\n * A class to handle all `ANS` operations\n */\nexport class ANS {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Retrieve the owner address of a domain name or subdomain name.\n *\n * ```ts\n * getOwnerAddress({name: \"test.aptos\"})\n * // Will return the owner address of \"test.aptos.apt\" or undefined\n * ```\n *\n * @param args.name - A string of the name to retrieve\n *\n * @returns MoveAddressType if the name is owned, undefined otherwise\n */\n async getOwnerAddress(args: { name: string }): Promise<MoveAddressType | undefined> {\n return getOwnerAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Registers a new domain or subdomain name\n *\n * @param args.sender - The sender account\n * @param args.name - A string or {domainName: string, subdomainName?: string} of the name to register. This\n * can be inclusive or exclusive of the .apt suffix.\n * Examples include: \"xyz\", \"xyz.apt\", \"xyz.kyc.apt\", {domainName: \"xyz\"}, {domainName: \"kyc\", subdomainName: \"xyz\"}.\n * @param args.expiration - An object with the expiration policy of the name.\n * @param args.expiration.policy - 'domain' | 'subdomain:follow-domain' | 'subdomain:independent'\n * - domain: Years is required and the name will expire after the given number of years.\n * - subdomain:follow-domain: The name will expire at the same time as the domain name.\n * - subdomain:independent: The name will expire at the given date.\n * @param args.transferable - Determines if the subdomain being minted is soul-bound. Applicable only to subdomains.\n * @param args.targetAddress optional - The address the domain name will resolve to. If not provided,\n * the sender's address will be used.\n * @param args.toAddress optional - The address to send the domain name to. If not provided,\n * the transaction will be sent to the router.\n *\n * @returns InputSingleSignerTransaction\n */\n async registerName(args: Omit<RegisterNameParameters, \"aptosConfig\">): Promise<InputSingleSignerTransaction> {\n return registerName({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"gDAWO,IAAMA,EAAN,KAAU,CAGf,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAcA,MAAM,gBAAgBC,EAA8D,CAClF,OAAOC,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAC9D,CAsBA,MAAM,aAAaA,EAA0F,CAC3G,OAAOE,EAAa,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC3D,CACF","names":["ANS","config","args","getOwnerAddress","registerName"]}
@@ -0,0 +1,2 @@
1
+ import{a as d}from"./chunk-3JPVQHOR.mjs";import{a as C}from"./chunk-AH44UPM4.mjs";import{i as w}from"./chunk-MIBLZSNS.mjs";import{b as p,c as T}from"./chunk-2444YR3Y.mjs";import{e as y}from"./chunk-KC64ESLO.mjs";import{a as l}from"./chunk-6FBKUTGF.mjs";async function v(o){let{aptosConfig:n,options:t}=o;return T({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function F(o){let{aptosConfig:n}=o;return C(async()=>{let{data:t}=await p({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await p({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function x(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await p({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function B(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await x({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function G(o){let{aptosConfig:n,transactionHash:t,options:s}=o,a=s?.timeoutSecs??y,r=s?.checkSuccess??!0,A=s?.indexerVersionCheck??!0,f=!0,h=0,e,u,g=200,b=1.5;for(;f&&!(h>=a);){try{if(e=await x({aptosConfig:n,transactionHash:t}),f=e.type==="pending_transaction",!f)break}catch(i){if(!(i instanceof l)||(u=i,i.status!==404&&i.status>=400&&i.status<500))throw i}await d(g),h+=g/1e3,g*=b}if(e===void 0)throw u||new c(`Fetching transaction ${t} failed and timed out after ${a} seconds`,e);if(e.type==="pending_transaction")throw new c(`Transaction ${t} timed out in pending state after ${a} seconds`,e);if(!r)return e;if(!e.success)throw new m(`Transaction ${t} failed with an error: ${e.vm_status}`,e);if(A)try{await E({aptosConfig:n,ledgerVersion:Number(e.version)})}catch{throw new c(`Transaction ${t} committed, but timed out waiting for indexer to sync with ledger version ${e.version}.You can disable this check by setting \`indexerVersionCheck\` to false in the \`extraArgs\` parameter.`,e)}return e}async function E(o){let{aptosConfig:n,ledgerVersion:t}=o,s=3e3,a=new Date().getTime(),r=-1;for(;r<t;){if(new Date().getTime()-a>s)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(r=await w({aptosConfig:n}),r>=t)break;await d(200)}}var c=class extends Error{constructor(t,s){super(t);this.lastSubmittedTransaction=s}},m=class extends Error{constructor(t,s){super(t);this.transaction=s}};export{v as a,F as b,N as c,x as d,B as e,G as f,c as g,m as h};
2
+ //# sourceMappingURL=chunk-ZT2A5ABR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/transaction}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * transaction namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AptosApiError, getAptosFullNode, paginateWithCursor } from \"../client\";\nimport {\n TransactionResponseType,\n type AnyNumber,\n type GasEstimation,\n type HexInput,\n type PaginationArgs,\n type TransactionResponse,\n WaitForTransactionOptions,\n} from \"../types\";\nimport { DEFAULT_TXN_TIMEOUT_SEC } from \"../utils/const\";\nimport { sleep } from \"../utils/helpers\";\nimport { memoizeAsync } from \"../utils/memoize\";\nimport { getIndexerLastSuccessVersion } from \"./general\";\n\nexport async function getTransactions(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs;\n}): Promise<TransactionResponse[]> {\n const { aptosConfig, options } = args;\n return paginateWithCursor<{}, TransactionResponse[]>({\n aptosConfig,\n originMethod: \"getTransactions\",\n path: \"transactions\",\n params: { start: options?.offset, limit: options?.limit },\n });\n}\n\nexport async function getGasPriceEstimation(args: { aptosConfig: AptosConfig }) {\n const { aptosConfig } = args;\n\n return memoizeAsync(\n async () => {\n const { data } = await getAptosFullNode<{}, GasEstimation>({\n aptosConfig,\n originMethod: \"getGasPriceEstimation\",\n path: \"estimate_gas_price\",\n });\n return data;\n },\n `gas-price-${aptosConfig.network}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n\nexport async function getTransactionByVersion(args: {\n aptosConfig: AptosConfig;\n ledgerVersion: AnyNumber;\n}): Promise<TransactionResponse> {\n const { aptosConfig, ledgerVersion } = args;\n const { data } = await getAptosFullNode<{}, TransactionResponse>({\n aptosConfig,\n originMethod: \"getTransactionByVersion\",\n path: `transactions/by_version/${ledgerVersion}`,\n });\n return data;\n}\n\nexport async function getTransactionByHash(args: {\n aptosConfig: AptosConfig;\n transactionHash: HexInput;\n}): Promise<TransactionResponse> {\n const { aptosConfig, transactionHash } = args;\n const { data } = await getAptosFullNode<{}, TransactionResponse>({\n aptosConfig,\n path: `transactions/by_hash/${transactionHash}`,\n originMethod: \"getTransactionByHash\",\n });\n return data;\n}\n\nexport async function isTransactionPending(args: {\n aptosConfig: AptosConfig;\n transactionHash: HexInput;\n}): Promise<boolean> {\n const { aptosConfig, transactionHash } = args;\n try {\n const transaction = await getTransactionByHash({ aptosConfig, transactionHash });\n return transaction.type === TransactionResponseType.Pending;\n } catch (e: any) {\n if (e?.status === 404) {\n return true;\n }\n throw e;\n }\n}\n\nexport async function waitForTransaction(args: {\n aptosConfig: AptosConfig;\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n}): Promise<TransactionResponse> {\n const { aptosConfig, transactionHash, options } = args;\n const timeoutSecs = options?.timeoutSecs ?? DEFAULT_TXN_TIMEOUT_SEC;\n const checkSuccess = options?.checkSuccess ?? true;\n const indexerVersionCheck = options?.indexerVersionCheck ?? true;\n\n let isPending = true;\n let timeElapsed = 0;\n let lastTxn: TransactionResponse | undefined;\n let lastError: AptosApiError | undefined;\n let backoffIntervalMs = 200;\n const backoffMultiplier = 1.5;\n\n while (isPending) {\n if (timeElapsed >= timeoutSecs) {\n break;\n }\n try {\n // eslint-disable-next-line no-await-in-loop\n lastTxn = await getTransactionByHash({ aptosConfig, transactionHash });\n\n isPending = lastTxn.type === TransactionResponseType.Pending;\n\n if (!isPending) {\n break;\n }\n } catch (e) {\n // In short, this means we will retry if it was an AptosApiError and the code was 404 or 5xx.\n const isAptosApiError = e instanceof AptosApiError;\n if (!isAptosApiError) {\n throw e; // This would be unexpected\n }\n lastError = e;\n const isRequestError = e.status !== 404 && e.status >= 400 && e.status < 500;\n if (isRequestError) {\n throw e;\n }\n }\n // eslint-disable-next-line no-await-in-loop\n await sleep(backoffIntervalMs);\n timeElapsed += backoffIntervalMs / 1000; // Convert to seconds\n backoffIntervalMs *= backoffMultiplier;\n }\n\n // There is a chance that lastTxn is still undefined. Let's throw the last error otherwise a WaitForTransactionError\n if (lastTxn === undefined) {\n if (lastError) {\n throw lastError;\n } else {\n throw new WaitForTransactionError(\n `Fetching transaction ${transactionHash} failed and timed out after ${timeoutSecs} seconds`,\n lastTxn,\n );\n }\n }\n\n if (lastTxn.type === TransactionResponseType.Pending) {\n throw new WaitForTransactionError(\n `Transaction ${transactionHash} timed out in pending state after ${timeoutSecs} seconds`,\n lastTxn,\n );\n }\n if (!checkSuccess) {\n return lastTxn;\n }\n if (!lastTxn.success) {\n throw new FailedTransactionError(\n `Transaction ${transactionHash} failed with an error: ${(lastTxn as any).vm_status}`,\n lastTxn,\n );\n }\n\n // Make sure indexer is synced with the latest ledger version\n if (indexerVersionCheck) {\n try {\n await waitForLastSuccessIndexerVersionSync({ aptosConfig, ledgerVersion: Number(lastTxn.version) });\n } catch (_e) {\n throw new WaitForTransactionError(\n // eslint-disable-next-line max-len\n `Transaction ${transactionHash} committed, but timed out waiting for indexer to sync with ledger version ${lastTxn.version}.` +\n \"You can disable this check by setting `indexerVersionCheck` to false in the `extraArgs` parameter.\",\n lastTxn,\n );\n }\n }\n\n return lastTxn;\n}\n\n/**\n * Waits for the indexer to sync up to the ledgerVersion. Timeout is 3 seconds.\n */\nasync function waitForLastSuccessIndexerVersionSync(args: {\n aptosConfig: AptosConfig;\n ledgerVersion: number;\n}): Promise<void> {\n const { aptosConfig, ledgerVersion } = args;\n const timeoutMilliseconds = 3000; // 3 seconds\n const startTime = new Date().getTime();\n let indexerVersion = -1;\n\n while (indexerVersion < ledgerVersion) {\n // check for timeout\n if (new Date().getTime() - startTime > timeoutMilliseconds) {\n throw new Error(\"waitForLastSuccessIndexerVersionSync timeout\");\n }\n\n // eslint-disable-next-line no-await-in-loop\n indexerVersion = await getIndexerLastSuccessVersion({ aptosConfig });\n if (indexerVersion >= ledgerVersion) {\n // break out immediately if we are synced\n break;\n }\n\n // eslint-disable-next-line no-await-in-loop\n await sleep(200);\n }\n}\n\n/**\n * This error is used by `waitForTransaction` when waiting for a\n * transaction to time out or when the transaction response is undefined\n */\nexport class WaitForTransactionError extends Error {\n public readonly lastSubmittedTransaction: TransactionResponse | undefined;\n\n constructor(message: string, lastSubmittedTransaction: TransactionResponse | undefined) {\n super(message);\n this.lastSubmittedTransaction = lastSubmittedTransaction;\n }\n}\n\n/**\n * This error is used by `waitForTransaction` if `checkSuccess` is true.\n * See that function for more information.\n */\nexport class FailedTransactionError extends Error {\n public readonly transaction: TransactionResponse;\n\n constructor(message: string, transaction: TransactionResponse) {\n super(message);\n this.transaction = transaction;\n }\n}\n"],"mappings":"6PA0BA,eAAsBA,EAAgBC,EAGH,CACjC,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EACjC,OAAOG,EAA8C,CACnD,YAAAF,EACA,aAAc,kBACd,KAAM,eACN,OAAQ,CAAE,MAAOC,GAAS,OAAQ,MAAOA,GAAS,KAAM,CAC1D,CAAC,CACH,CAEA,eAAsBE,EAAsBJ,EAAoC,CAC9E,GAAM,CAAE,YAAAC,CAAY,EAAID,EAExB,OAAOK,EACL,SAAY,CACV,GAAM,CAAE,KAAAC,CAAK,EAAI,MAAMC,EAAoC,CACzD,YAAAN,EACA,aAAc,wBACd,KAAM,oBACR,CAAC,EACD,OAAOK,CACT,EACA,aAAaL,EAAY,UACzB,IAAO,GAAK,CACd,EAAE,CACJ,CAEA,eAAsBO,EAAwBR,EAGb,CAC/B,GAAM,CAAE,YAAAC,EAAa,cAAAQ,CAAc,EAAIT,EACjC,CAAE,KAAAM,CAAK,EAAI,MAAMC,EAA0C,CAC/D,YAAAN,EACA,aAAc,0BACd,KAAM,2BAA2BQ,GACnC,CAAC,EACD,OAAOH,CACT,CAEA,eAAsBI,EAAqBV,EAGV,CAC/B,GAAM,CAAE,YAAAC,EAAa,gBAAAU,CAAgB,EAAIX,EACnC,CAAE,KAAAM,CAAK,EAAI,MAAMC,EAA0C,CAC/D,YAAAN,EACA,KAAM,wBAAwBU,IAC9B,aAAc,sBAChB,CAAC,EACD,OAAOL,CACT,CAEA,eAAsBM,EAAqBZ,EAGtB,CACnB,GAAM,CAAE,YAAAC,EAAa,gBAAAU,CAAgB,EAAIX,EACzC,GAAI,CAEF,OADoB,MAAMU,EAAqB,CAAE,YAAAT,EAAa,gBAAAU,CAAgB,CAAC,GAC5D,4BACrB,OAASE,EAAP,CACA,GAAIA,GAAG,SAAW,IAChB,MAAO,GAET,MAAMA,CACR,CACF,CAEA,eAAsBC,EAAmBd,EAIR,CAC/B,GAAM,CAAE,YAAAC,EAAa,gBAAAU,EAAiB,QAAAT,CAAQ,EAAIF,EAC5Ce,EAAcb,GAAS,aAAec,EACtCC,EAAef,GAAS,cAAgB,GACxCgB,EAAsBhB,GAAS,qBAAuB,GAExDiB,EAAY,GACZC,EAAc,EACdC,EACAC,EACAC,EAAoB,IAClBC,EAAoB,IAE1B,KAAOL,GACD,EAAAC,GAAeL,IADH,CAIhB,GAAI,CAMF,GAJAM,EAAU,MAAMX,EAAqB,CAAE,YAAAT,EAAa,gBAAAU,CAAgB,CAAC,EAErEQ,EAAYE,EAAQ,6BAEhB,CAACF,EACH,KAEJ,OAASN,EAAP,CAQA,GALI,EADoBA,aAAaY,KAIrCH,EAAYT,EACWA,EAAE,SAAW,KAAOA,EAAE,QAAU,KAAOA,EAAE,OAAS,KAEvE,MAAMA,CAEV,CAEA,MAAMa,EAAMH,CAAiB,EAC7BH,GAAeG,EAAoB,IACnCA,GAAqBC,CACvB,CAGA,GAAIH,IAAY,OACd,MAAIC,GAGI,IAAIK,EACR,wBAAwBhB,gCAA8CI,YACtEM,CACF,EAIJ,GAAIA,EAAQ,6BACV,MAAM,IAAIM,EACR,eAAehB,sCAAoDI,YACnEM,CACF,EAEF,GAAI,CAACJ,EACH,OAAOI,EAET,GAAI,CAACA,EAAQ,QACX,MAAM,IAAIO,EACR,eAAejB,2BAA0CU,EAAgB,YACzEA,CACF,EAIF,GAAIH,EACF,GAAI,CACF,MAAMW,EAAqC,CAAE,YAAA5B,EAAa,cAAe,OAAOoB,EAAQ,OAAO,CAAE,CAAC,CACpG,MAAE,CACA,MAAM,IAAIM,EAER,eAAehB,8EAA4FU,EAAQ,iHAEnHA,CACF,CACF,CAGF,OAAOA,CACT,CAKA,eAAeQ,EAAqC7B,EAGlC,CAChB,GAAM,CAAE,YAAAC,EAAa,cAAAQ,CAAc,EAAIT,EACjC8B,EAAsB,IACtBC,EAAY,IAAI,KAAK,EAAE,QAAQ,EACjCC,EAAiB,GAErB,KAAOA,EAAiBvB,GAAe,CAErC,GAAI,IAAI,KAAK,EAAE,QAAQ,EAAIsB,EAAYD,EACrC,MAAM,IAAI,MAAM,8CAA8C,EAKhE,GADAE,EAAiB,MAAMC,EAA6B,CAAE,YAAAhC,CAAY,CAAC,EAC/D+B,GAAkBvB,EAEpB,MAIF,MAAMiB,EAAM,GAAG,CACjB,CACF,CAMO,IAAMC,EAAN,cAAsC,KAAM,CAGjD,YAAYO,EAAiBC,EAA2D,CACtF,MAAMD,CAAO,EACb,KAAK,yBAA2BC,CAClC,CACF,EAMaP,EAAN,cAAqC,KAAM,CAGhD,YAAYM,EAAiBE,EAAkC,CAC7D,MAAMF,CAAO,EACb,KAAK,YAAcE,CACrB,CACF","names":["getTransactions","args","aptosConfig","options","paginateWithCursor","getGasPriceEstimation","memoizeAsync","data","getAptosFullNode","getTransactionByVersion","ledgerVersion","getTransactionByHash","transactionHash","isTransactionPending","e","waitForTransaction","timeoutSecs","DEFAULT_TXN_TIMEOUT_SEC","checkSuccess","indexerVersionCheck","isPending","timeElapsed","lastTxn","lastError","backoffIntervalMs","backoffMultiplier","AptosApiError","sleep","WaitForTransactionError","FailedTransactionError","waitForLastSuccessIndexerVersionSync","timeoutMilliseconds","startTime","indexerVersion","getIndexerLastSuccessVersion","message","lastSubmittedTransaction","transaction"]}
@@ -0,0 +1,2 @@
1
+ import{a as d}from"./chunk-FNB6CFQR.mjs";import{a as h}from"./chunk-CZZJAR3B.mjs";import{a as m}from"./chunk-UVGCVCNG.mjs";import{a as y}from"./chunk-BIUGRAMO.mjs";import{b as l}from"./chunk-HH5RSP2H.mjs";import{a as u}from"./chunk-27P7PELS.mjs";import{b as s}from"./chunk-IZHPCZE3.mjs";import{sha3_256 as b}from"@noble/hashes/sha3";var i=class extends u{constructor(r){super();let{data:t}=r,e=s.fromHexInput(t);if(e.toUint8Array().length!==i.LENGTH)throw new Error(`Authentication Key length should be ${i.LENGTH}`);this.data=e}serialize(r){r.serializeFixedBytes(this.data.toUint8Array())}static deserialize(r){let t=r.deserializeFixedBytes(i.LENGTH);return new i({data:t})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(r){let{publicKey:t,scheme:e}=r,n;switch(e){case 3:case 2:{let a=t.bcsToBytes();n=new Uint8Array([...a,e]);break}case 0:case 1:{let a=t.toUint8Array(),p=s.fromHexInput(a).toUint8Array();n=new Uint8Array([...p,e]);break}default:throw new Error(`Scheme ${e} is not supported`)}let c=b.create();c.update(n);let f=c.digest();return new i({data:f})}static fromPublicKey(r){let{publicKey:t}=r,e;if(t instanceof y)e=0 .valueOf();else if(t instanceof d)e=1 .valueOf();else if(t instanceof m)e=2 .valueOf();else if(t instanceof h)e=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return i.fromPublicKeyAndScheme({publicKey:t,scheme:e})}derivedAddress(){return new l(this.data.toUint8Array())}},o=i;o.LENGTH=32;export{o as a};
2
+ //# sourceMappingURL=chunk-ZXJ5ZBTL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/authenticationKey.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { AccountAddress } from \"./accountAddress\";\nimport { PublicKey } from \"./crypto/asymmetricCrypto\";\nimport { Ed25519PublicKey } from \"./crypto/ed25519\";\nimport { MultiEd25519PublicKey } from \"./crypto/multiEd25519\";\nimport { Hex } from \"./hex\";\nimport { AuthenticationKeyScheme, HexInput, SigningScheme } from \"../types\";\nimport { AnyPublicKey } from \"./crypto/anyPublicKey\";\nimport { MultiKey } from \"./crypto/multiKey\";\nimport { Serializable, Serializer } from \"../bcs/serializer\";\nimport { Deserializer } from \"../bcs/deserializer\";\n\n/**\n * Each account stores an authentication key. Authentication key enables account owners to rotate\n * their private key(s) associated with the account without changing the address that hosts their account.\n * @see {@link https://aptos.dev/concepts/accounts | Account Basics}\n *\n * Account addresses can be derived from AuthenticationKey\n */\nexport class AuthenticationKey extends Serializable {\n /**\n * An authentication key is always a SHA3-256 hash of data, and is always 32 bytes.\n *\n * The data to hash depends on the underlying public key type and the derivation scheme.\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The raw bytes of the authentication key.\n */\n public readonly data: Hex;\n\n constructor(args: { data: HexInput }) {\n super();\n const { data } = args;\n const hex = Hex.fromHexInput(data);\n if (hex.toUint8Array().length !== AuthenticationKey.LENGTH) {\n throw new Error(`Authentication Key length should be ${AuthenticationKey.LENGTH}`);\n }\n this.data = hex;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data.toUint8Array());\n }\n\n /**\n * Deserialize an AuthenticationKey from the byte buffer in a Deserializer instance.\n * @param deserializer The deserializer to deserialize the AuthenticationKey from.\n * @returns An instance of AuthenticationKey.\n */\n static deserialize(deserializer: Deserializer): AuthenticationKey {\n const bytes = deserializer.deserializeFixedBytes(AuthenticationKey.LENGTH);\n return new AuthenticationKey({ data: bytes });\n }\n\n toString(): string {\n return this.data.toString();\n }\n\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n /**\n * Derives an AuthenticationKey from the public key seed bytes and an explicit derivation scheme.\n *\n * This facilitates targeting a specific scheme for deriving an authentication key from a public key.\n *\n * @param args - the public key and scheme to use for the derivation\n */\n public static fromPublicKeyAndScheme(args: { publicKey: PublicKey; scheme: AuthenticationKeyScheme }) {\n const { publicKey, scheme } = args;\n let authKeyBytes: Uint8Array;\n\n switch (scheme) {\n case SigningScheme.MultiKey:\n case SigningScheme.SingleKey: {\n const singleKeyBytes = publicKey.bcsToBytes();\n authKeyBytes = new Uint8Array([...singleKeyBytes, scheme]);\n break;\n }\n\n case SigningScheme.Ed25519:\n case SigningScheme.MultiEd25519: {\n const ed25519PublicKeyBytes = publicKey.toUint8Array();\n const inputBytes = Hex.fromHexInput(ed25519PublicKeyBytes).toUint8Array();\n authKeyBytes = new Uint8Array([...inputBytes, scheme]);\n break;\n }\n\n default:\n throw new Error(`Scheme ${scheme} is not supported`);\n }\n\n const hash = sha3Hash.create();\n hash.update(authKeyBytes);\n const hashDigest = hash.digest();\n return new AuthenticationKey({ data: hashDigest });\n }\n\n /**\n * Converts a PublicKey(s) to an AuthenticationKey, using the derivation scheme inferred from the\n * instance of the PublicKey type passed in.\n *\n * @param args.publicKey\n * @returns AuthenticationKey\n */\n static fromPublicKey(args: { publicKey: PublicKey }): AuthenticationKey {\n const { publicKey } = args;\n\n let scheme: number;\n if (publicKey instanceof Ed25519PublicKey) {\n // for legacy support\n scheme = SigningScheme.Ed25519.valueOf();\n } else if (publicKey instanceof MultiEd25519PublicKey) {\n // for legacy support\n scheme = SigningScheme.MultiEd25519.valueOf();\n } else if (publicKey instanceof AnyPublicKey) {\n scheme = SigningScheme.SingleKey.valueOf();\n } else if (publicKey instanceof MultiKey) {\n scheme = SigningScheme.MultiKey.valueOf();\n } else {\n throw new Error(\"No supported authentication scheme for public key\");\n }\n\n return AuthenticationKey.fromPublicKeyAndScheme({ publicKey, scheme });\n }\n\n /**\n * Derives an account address from an AuthenticationKey. Since an AccountAddress is also 32 bytes,\n * the AuthenticationKey bytes are directly translated to an AccountAddress.\n *\n * @returns AccountAddress\n */\n derivedAddress(): AccountAddress {\n return new AccountAddress(this.data.toUint8Array());\n }\n}\n"],"mappings":"+RAGA,OAAS,YAAYA,MAAgB,qBAmB9B,IAAMC,EAAN,cAAgCC,CAAa,CAalD,YAAYC,EAA0B,CACpC,MAAM,EACN,GAAM,CAAE,KAAAC,CAAK,EAAID,EACXE,EAAMC,EAAI,aAAaF,CAAI,EACjC,GAAIC,EAAI,aAAa,EAAE,SAAWJ,EAAkB,OAClD,MAAM,IAAI,MAAM,uCAAuCA,EAAkB,QAAQ,EAEnF,KAAK,KAAOI,CACd,CAEA,UAAUE,EAA8B,CACtCA,EAAW,oBAAoB,KAAK,KAAK,aAAa,CAAC,CACzD,CAOA,OAAO,YAAYC,EAA+C,CAChE,IAAMC,EAAQD,EAAa,sBAAsBP,EAAkB,MAAM,EACzE,OAAO,IAAIA,EAAkB,CAAE,KAAMQ,CAAM,CAAC,CAC9C,CAEA,UAAmB,CACjB,OAAO,KAAK,KAAK,SAAS,CAC5B,CAEA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CASA,OAAc,uBAAuBN,EAAiE,CACpG,GAAM,CAAE,UAAAO,EAAW,OAAAC,CAAO,EAAIR,EAC1BS,EAEJ,OAAQD,EAAQ,CACd,OACA,OAA8B,CAC5B,IAAME,EAAiBH,EAAU,WAAW,EAC5CE,EAAe,IAAI,WAAW,CAAC,GAAGC,EAAgBF,CAAM,CAAC,EACzD,KACF,CAEA,OACA,OAAiC,CAC/B,IAAMG,EAAwBJ,EAAU,aAAa,EAC/CK,EAAaT,EAAI,aAAaQ,CAAqB,EAAE,aAAa,EACxEF,EAAe,IAAI,WAAW,CAAC,GAAGG,EAAYJ,CAAM,CAAC,EACrD,KACF,CAEA,QACE,MAAM,IAAI,MAAM,UAAUA,oBAAyB,CACvD,CAEA,IAAMK,EAAOC,EAAS,OAAO,EAC7BD,EAAK,OAAOJ,CAAY,EACxB,IAAMM,EAAaF,EAAK,OAAO,EAC/B,OAAO,IAAIf,EAAkB,CAAE,KAAMiB,CAAW,CAAC,CACnD,CASA,OAAO,cAAcf,EAAmD,CACtE,GAAM,CAAE,UAAAO,CAAU,EAAIP,EAElBQ,EACJ,GAAID,aAAqBS,EAEvBR,KAA+B,QAAQ,UAC9BD,aAAqBU,EAE9BT,KAAoC,QAAQ,UACnCD,aAAqBW,EAC9BV,KAAiC,QAAQ,UAChCD,aAAqBY,EAC9BX,KAAgC,QAAQ,MAExC,OAAM,IAAI,MAAM,mDAAmD,EAGrE,OAAOV,EAAkB,uBAAuB,CAAE,UAAAS,EAAW,OAAAC,CAAO,CAAC,CACvE,CAQA,gBAAiC,CAC/B,OAAO,IAAIY,EAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CACF,EAvHaC,EAANvB,EAAMuB,EAMK,OAAiB","names":["sha3Hash","_AuthenticationKey","Serializable","args","data","hex","Hex","serializer","deserializer","bytes","publicKey","scheme","authKeyBytes","singleKeyBytes","ed25519PublicKeyBytes","inputBytes","hash","sha3Hash","hashDigest","Ed25519PublicKey","MultiEd25519PublicKey","AnyPublicKey","MultiKey","AccountAddress","AuthenticationKey"]}
@@ -0,0 +1,24 @@
1
+ import { AptosConfig } from '../api/aptosConfig.js';
2
+ import { AptosResponse } from './types.js';
3
+ import { ClientRequest, Client, ClientResponse, AptosRequest } from '../types/index.js';
4
+ import '../utils/apiEndpoints.js';
5
+ import '../utils/const.js';
6
+ import '../types/indexer.js';
7
+ import '../types/generated/operations.js';
8
+ import '../types/generated/types.js';
9
+
10
+ /**
11
+ * Given a url and method, sends the request with axios and
12
+ * returns the response.
13
+ */
14
+ declare function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>>;
15
+ /**
16
+ * The main function to use when doing an API request.
17
+ *
18
+ * @param options AptosRequest
19
+ * @param aptosConfig The config information for the SDK client instance
20
+ * @returns the response or AptosApiError
21
+ */
22
+ declare function aptosRequest<Req, Res>(options: AptosRequest, aptosConfig: AptosConfig): Promise<AptosResponse<Req, Res>>;
23
+
24
+ export { aptosRequest, request };
@@ -0,0 +1,2 @@
1
+ import{a,b}from"../chunk-2MQZUGO6.mjs";import"../chunk-6FBKUTGF.mjs";import"../chunk-FYIFBLHU.mjs";import"../chunk-GUT3G5CG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-XNFEUXDS.mjs";export{b as aptosRequest,a as request};
2
+ //# sourceMappingURL=core.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,55 @@
1
+ import { AptosConfig } from '../api/aptosConfig.js';
2
+ import { AptosResponse } from './types.js';
3
+ import { MimeType, AnyNumber, ClientConfig } from '../types/index.js';
4
+ import { AptosApiType } from '../utils/const.js';
5
+ import '../utils/apiEndpoints.js';
6
+ import '../types/indexer.js';
7
+ import '../types/generated/operations.js';
8
+ import '../types/generated/types.js';
9
+
10
+ declare type GetRequestOptions = {
11
+ /**
12
+ * The config for the API client
13
+ */
14
+ aptosConfig: AptosConfig;
15
+ /**
16
+ * The type of API endpoint to call e.g. fullnode, indexer, etc
17
+ */
18
+ type: AptosApiType;
19
+ /**
20
+ * The name of the API method
21
+ */
22
+ originMethod: string;
23
+ /**
24
+ * The URL path to the API method
25
+ */
26
+ path: string;
27
+ /**
28
+ * The content type of the request body
29
+ */
30
+ contentType?: MimeType;
31
+ /**
32
+ * The accepted content type of the response of the API
33
+ */
34
+ acceptType?: MimeType;
35
+ /**
36
+ * The query parameters for the request
37
+ */
38
+ params?: Record<string, string | AnyNumber | boolean | undefined>;
39
+ /**
40
+ * Specific client overrides for this request to override aptosConfig
41
+ */
42
+ overrides?: ClientConfig;
43
+ };
44
+ declare type GetAptosRequestOptions = Omit<GetRequestOptions, "type">;
45
+ /**
46
+ * Main function to do a Get request
47
+ *
48
+ * @param options GetRequestOptions
49
+ * @returns
50
+ */
51
+ declare function get<Req, Res>(options: GetRequestOptions): Promise<AptosResponse<Req, Res>>;
52
+ declare function getAptosFullNode<Req, Res>(options: GetAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
53
+ declare function paginateWithCursor<Req extends Record<string, any>, Res extends any[]>(options: GetAptosRequestOptions): Promise<Res>;
54
+
55
+ export { GetAptosRequestOptions, GetRequestOptions, get, getAptosFullNode, paginateWithCursor };
@@ -0,0 +1,2 @@
1
+ import{a,b,c}from"../chunk-2444YR3Y.mjs";import"../chunk-KC64ESLO.mjs";import"../chunk-LV33NV4J.mjs";import"../chunk-2MQZUGO6.mjs";import"../chunk-6FBKUTGF.mjs";import"../chunk-FYIFBLHU.mjs";import"../chunk-GUT3G5CG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-XNFEUXDS.mjs";export{a as get,b as getAptosFullNode,c as paginateWithCursor};
2
+ //# sourceMappingURL=get.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,11 @@
1
+ export { aptosRequest, request } from './core.js';
2
+ export { GetAptosRequestOptions, GetRequestOptions, get, getAptosFullNode, paginateWithCursor } from './get.js';
3
+ export { PostAptosRequestOptions, PostRequestOptions, post, postAptosFaucet, postAptosFullNode, postAptosIndexer } from './post.js';
4
+ export { AptosApiError, AptosResponse } from './types.js';
5
+ import '../api/aptosConfig.js';
6
+ import '../types/index.js';
7
+ import '../utils/apiEndpoints.js';
8
+ import '../types/indexer.js';
9
+ import '../types/generated/operations.js';
10
+ import '../types/generated/types.js';
11
+ import '../utils/const.js';
@@ -0,0 +1,2 @@
1
+ import"../chunk-N2FKVZ4D.mjs";import{a as g,b as h,c as i,d as j}from"../chunk-AY2HWVDO.mjs";import{a as d,b as e,c as f}from"../chunk-2444YR3Y.mjs";import"../chunk-KC64ESLO.mjs";import"../chunk-LV33NV4J.mjs";import{a as b,b as c}from"../chunk-2MQZUGO6.mjs";import{a}from"../chunk-6FBKUTGF.mjs";import"../chunk-FYIFBLHU.mjs";import"../chunk-GUT3G5CG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-XNFEUXDS.mjs";export{a as AptosApiError,c as aptosRequest,d as get,e as getAptosFullNode,f as paginateWithCursor,g as post,j as postAptosFaucet,h as postAptosFullNode,i as postAptosIndexer,b as request};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,60 @@
1
+ import { AptosConfig } from '../api/aptosConfig.js';
2
+ import { AptosResponse } from './types.js';
3
+ import { MimeType, AnyNumber, ClientConfig } from '../types/index.js';
4
+ import { AptosApiType } from '../utils/const.js';
5
+ import '../utils/apiEndpoints.js';
6
+ import '../types/indexer.js';
7
+ import '../types/generated/operations.js';
8
+ import '../types/generated/types.js';
9
+
10
+ declare type PostRequestOptions = {
11
+ /**
12
+ * The config for the API client
13
+ */
14
+ aptosConfig: AptosConfig;
15
+ /**
16
+ * The type of API endpoint to call e.g. fullnode, indexer, etc
17
+ */
18
+ type: AptosApiType;
19
+ /**
20
+ * The name of the API method
21
+ */
22
+ originMethod: string;
23
+ /**
24
+ * The URL path to the API method
25
+ */
26
+ path: string;
27
+ /**
28
+ * The content type of the request body
29
+ */
30
+ contentType?: MimeType;
31
+ /**
32
+ * The accepted content type of the response of the API
33
+ */
34
+ acceptType?: MimeType;
35
+ /**
36
+ * The query parameters for the request
37
+ */
38
+ params?: Record<string, string | AnyNumber | boolean | undefined>;
39
+ /**
40
+ * The body of the request, should match the content type of the request
41
+ */
42
+ body?: any;
43
+ /**
44
+ * Specific client overrides for this request to override aptosConfig
45
+ */
46
+ overrides?: ClientConfig;
47
+ };
48
+ declare type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
49
+ /**
50
+ * Main function to do a Post request
51
+ *
52
+ * @param options PostRequestOptions
53
+ * @returns
54
+ */
55
+ declare function post<Req, Res>(options: PostRequestOptions): Promise<AptosResponse<Req, Res>>;
56
+ declare function postAptosFullNode<Req, Res>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
57
+ declare function postAptosIndexer<Req, Res>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
58
+ declare function postAptosFaucet<Req, Res>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
59
+
60
+ export { PostAptosRequestOptions, PostRequestOptions, post, postAptosFaucet, postAptosFullNode, postAptosIndexer };
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d}from"../chunk-AY2HWVDO.mjs";import"../chunk-KC64ESLO.mjs";import"../chunk-LV33NV4J.mjs";import"../chunk-2MQZUGO6.mjs";import"../chunk-6FBKUTGF.mjs";import"../chunk-FYIFBLHU.mjs";import"../chunk-GUT3G5CG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-XNFEUXDS.mjs";export{a as post,d as postAptosFaucet,b as postAptosFullNode,c as postAptosIndexer};
2
+ //# sourceMappingURL=post.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,46 @@
1
+ import { AptosRequest } from '../types/index.js';
2
+ import '../utils/apiEndpoints.js';
3
+ import '../types/indexer.js';
4
+ import '../types/generated/operations.js';
5
+ import '../types/generated/types.js';
6
+
7
+ /**
8
+ * The API response type
9
+ *
10
+ * @param status - the response status. i.e. 200
11
+ * @param statusText - the response message
12
+ * @param data the response data
13
+ * @param url the url the request was made to
14
+ * @param headers the response headers
15
+ * @param config (optional) - the request object
16
+ * @param request (optional) - the request object
17
+ */
18
+ interface AptosResponse<Req, Res> {
19
+ status: number;
20
+ statusText: string;
21
+ data: Res;
22
+ url: string;
23
+ headers: any;
24
+ config?: any;
25
+ request?: Req;
26
+ }
27
+ /**
28
+ * The type returned from an API error
29
+ *
30
+ * @param name - the error name "AptosApiError"
31
+ * @param url the url the request was made to
32
+ * @param status - the response status. i.e. 400
33
+ * @param statusText - the response message
34
+ * @param data the response data
35
+ * @param request - the AptosRequest
36
+ */
37
+ declare class AptosApiError extends Error {
38
+ readonly url: string;
39
+ readonly status: number;
40
+ readonly statusText: string;
41
+ readonly data: any;
42
+ readonly request: AptosRequest;
43
+ constructor(request: AptosRequest, response: AptosResponse<any, any>, message: string);
44
+ }
45
+
46
+ export { AptosApiError, AptosResponse };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-6FBKUTGF.mjs";import"../chunk-XNFEUXDS.mjs";export{a as AptosApiError};
2
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,184 @@
1
+ import { AccountAddress } from './accountAddress.js';
2
+ import { AuthenticationKey } from './authenticationKey.js';
3
+ import { PublicKey, PrivateKey, Signature } from './crypto/asymmetricCrypto.js';
4
+ import { SigningScheme, GenerateAccount, SigningSchemeInput, HexInput } from '../types/index.js';
5
+ import '../bcs/serializer.js';
6
+ import './hex.js';
7
+ import './common.js';
8
+ import '../utils/apiEndpoints.js';
9
+ import '../types/indexer.js';
10
+ import '../types/generated/operations.js';
11
+ import '../types/generated/types.js';
12
+ import '../bcs/deserializer.js';
13
+ import '../transactions/instances/transactionArgument.js';
14
+
15
+ /**
16
+ * Class for creating and managing account on Aptos network
17
+ *
18
+ * Use this class to create accounts, sign transactions, and more.
19
+ * Note: Creating an account instance does not create the account on-chain.
20
+ *
21
+ * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
22
+ * `Legacy` and `Unified` authentications.
23
+ *
24
+ * @Legacy includes `ED25519` and `MultiED25519`
25
+ * @Unified includes `SingleSender` and `MultiSender`, where currently
26
+ * `SingleSender` supports `ED25519` and `Secp256k1`, and `MultiSender` supports
27
+ * `MultiED25519`.
28
+ *
29
+ * In TypeScript SDK, we support all of these options:
30
+ *
31
+ * @generate default to generate Legacy Ed25519 keys, with an optional `legacy` boolean argument
32
+ * that lets you generate new keys conforming to the Unified authentication.
33
+ *
34
+ * @fromPrivateKey derives an account by a provided private key and address, with an optional
35
+ * `legacy` boolean argument that lets you generate new keys conforming to the Unified authentication.
36
+ *
37
+ * @fromDerivationPath derives an account with bip44 path and mnemonics,
38
+ *
39
+ */
40
+ declare class Account {
41
+ /**
42
+ * Public key associated with the account
43
+ */
44
+ readonly publicKey: PublicKey;
45
+ /**
46
+ * Private key associated with the account
47
+ */
48
+ readonly privateKey: PrivateKey;
49
+ /**
50
+ * Account address associated with the account
51
+ */
52
+ readonly accountAddress: AccountAddress;
53
+ /**
54
+ * Signing scheme used to sign transactions
55
+ */
56
+ readonly signingScheme: SigningScheme;
57
+ /**
58
+ * constructor for Account
59
+ *
60
+ * Need to update this to use the new crypto library if new schemes are added.
61
+ *
62
+ * @param args.privateKey PrivateKey - private key of the account
63
+ * @param args.address AccountAddress - address of the account
64
+ * @param args.legacy optional. If set to true, the keypair authentication keys will be derived with a Legacy scheme.
65
+ * Defaults to deriving an authentication key with a Unified scheme
66
+ *
67
+ * This method is private because it should only be called by the factory static methods.
68
+ * @returns Account
69
+ */
70
+ private constructor();
71
+ /**
72
+ * Derives an account with random private key and address.
73
+ *
74
+ * Default generation is using the Legacy ED25519 key
75
+ *
76
+ * @param args optional. Unify GenerateAccount type for Legacy and Unified keys
77
+ *
78
+ * Account input type to generate an account using Legacy
79
+ * Ed25519 or MultiEd25519 keys or without a specified `scheme`.
80
+ * ```
81
+ * GenerateAccountWithLegacyKey = {
82
+ * scheme?: SigningSchemeInput.Ed25519 | SigningSchemeInput.MultiEd25519;
83
+ * legacy: true;
84
+ * };
85
+ * ```
86
+ *
87
+ * Account input type to generate an account using Unified
88
+ * Secp256k1Ecdsa key
89
+ * In this case `legacy` is always false
90
+ * ```
91
+ * GenerateAccountWithUnifiedKey = {
92
+ * scheme: SigningSchemeInput.Secp256k1Ecdsa;
93
+ * legacy?: false;
94
+ * };
95
+ * ```
96
+ *
97
+ * @returns Account with the given signing scheme
98
+ */
99
+ static generate(args?: GenerateAccount): Account;
100
+ /**
101
+ * Instantiates an account given a private key.
102
+ *
103
+ * This is used as a local calculation and therefore is used to instantiate an `Account`
104
+ * that has not had its authentication key rotated.
105
+ *
106
+ * @param privateKey PrivateKey - private key of the account
107
+ * @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
108
+ * to generating a Legacy Ed25519 keypair
109
+ *
110
+ * @returns Account
111
+ */
112
+ static fromPrivateKey(args: {
113
+ privateKey: PrivateKey;
114
+ legacy?: boolean;
115
+ }): Account;
116
+ /**
117
+ * Instantiates an account given a private key and a specified account address.
118
+ * This is primarily used to instantiate an `Account` that has had its authentication key rotated.
119
+ *
120
+ * @param args.privateKey PrivateKey - the underlying private key for the account
121
+ * @param args.address AccountAddress - The account address the `Account` will sign for
122
+ * @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
123
+ * to generating a Legacy Ed25519 keypair
124
+ *
125
+ * @returns Account
126
+ */
127
+ static fromPrivateKeyAndAddress(args: {
128
+ privateKey: PrivateKey;
129
+ address: AccountAddress;
130
+ legacy?: boolean;
131
+ }): Account;
132
+ /**
133
+ * Derives an account with bip44 path and mnemonics,
134
+ *
135
+ * @param args.scheme The signing scheme to derive with
136
+ * @param args.path the BIP44 derive hardened path (e.g. m/44'/637'/0'/0'/0') for Ed25519,
137
+ * or non-hardened path (e.g. m/44'/637'/0'/0/0) for secp256k1
138
+ * Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}
139
+ * @param args.mnemonic the mnemonic seed phrase of the account
140
+ * @param args.legacy optional. If set to false, the keypair generated is a Unified keypair. Defaults
141
+ * to generating a Legacy Ed25519 keypair
142
+ *
143
+ * @returns Account
144
+ */
145
+ static fromDerivationPath(args: {
146
+ scheme: SigningSchemeInput;
147
+ path: string;
148
+ mnemonic: string;
149
+ legacy?: boolean;
150
+ }): Account;
151
+ /**
152
+ * This key enables account owners to rotate their private key(s)
153
+ * associated with the account without changing the address that hosts their account.
154
+ * See here for more info: {@link https://aptos.dev/concepts/accounts#single-signer-authentication}
155
+ *
156
+ * @param args.publicKey PublicKey - public key of the account
157
+ * @returns The authentication key for the associated account
158
+ */
159
+ static authKey(args: {
160
+ publicKey: PublicKey;
161
+ }): AuthenticationKey;
162
+ /**
163
+ * Sign the given message with the private key.
164
+ *
165
+ * TODO: Add sign transaction or specific types
166
+ *
167
+ * @param data in HexInput format
168
+ * @returns Signature
169
+ */
170
+ sign(data: HexInput): Signature;
171
+ /**
172
+ * Verify the given message and signature with the public key.
173
+ *
174
+ * @param args.message raw message data in HexInput format
175
+ * @param args.signature signed message Signature
176
+ * @returns
177
+ */
178
+ verifySignature(args: {
179
+ message: HexInput;
180
+ signature: Signature;
181
+ }): boolean;
182
+ }
183
+
184
+ export { Account };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-J3QOSJFP.mjs";import"../chunk-ZXJ5ZBTL.mjs";import"../chunk-FNB6CFQR.mjs";import"../chunk-CZZJAR3B.mjs";import"../chunk-UVGCVCNG.mjs";import"../chunk-BIUGRAMO.mjs";import"../chunk-YS2OX7AB.mjs";import"../chunk-E72CFUU4.mjs";import"../chunk-LR65XHSF.mjs";import"../chunk-HH5RSP2H.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-LU6VS7PJ.mjs";import"../chunk-V6AAQLLJ.mjs";import"../chunk-7AQXAH6Q.mjs";import"../chunk-PDLUCVJB.mjs";import"../chunk-BC2NOUYT.mjs";import"../chunk-27P7PELS.mjs";import"../chunk-IZHPCZE3.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-DNDWTM7A.mjs";import"../chunk-GUT3G5CG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-XNFEUXDS.mjs";export{a as Account};
2
+ //# sourceMappingURL=account.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}