@aptos-labs/ts-sdk 1.12.1 → 1.13.0-zeta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (538) hide show
  1. package/dist/common/chunk-KSEUZTKY.js +2 -0
  2. package/dist/common/chunk-KSEUZTKY.js.map +1 -0
  3. package/dist/common/cli/index.d.ts +37 -0
  4. package/dist/common/cli/index.js +2 -0
  5. package/dist/common/cli/index.js.map +1 -0
  6. package/dist/common/index.d.ts +2131 -1432
  7. package/dist/common/index.js +26 -26
  8. package/dist/common/index.js.map +1 -1
  9. package/dist/esm/{Ed25519Account-DHqzsb8B.d.mts → Ed25519Account-hkKk3b4Z.d.mts} +12 -14
  10. package/dist/esm/account/Account.d.mts +34 -0
  11. package/dist/esm/account/Account.mjs +2 -0
  12. package/dist/esm/account/Ed25519Account.d.mts +34 -0
  13. package/dist/esm/account/Ed25519Account.mjs +2 -0
  14. package/dist/esm/account/EphemeralKeyPair.d.mts +42 -0
  15. package/dist/esm/account/EphemeralKeyPair.mjs +2 -0
  16. package/dist/esm/account/KeylessAccount.d.mts +85 -0
  17. package/dist/esm/account/KeylessAccount.mjs +2 -0
  18. package/dist/esm/account/MultiKeyAccount.d.mts +99 -0
  19. package/dist/esm/account/MultiKeyAccount.mjs +2 -0
  20. package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
  21. package/dist/esm/account/SingleKeyAccount.mjs +2 -0
  22. package/dist/esm/account/index.d.mts +39 -0
  23. package/dist/esm/account/index.mjs +2 -0
  24. package/dist/esm/api/account.d.mts +62 -9
  25. package/dist/esm/api/account.mjs +1 -1
  26. package/dist/esm/api/ans.d.mts +20 -28
  27. package/dist/esm/api/ans.mjs +1 -1
  28. package/dist/esm/api/aptos.d.mts +20 -9
  29. package/dist/esm/api/aptos.mjs +1 -1
  30. package/dist/esm/api/aptosConfig.d.mts +24 -0
  31. package/dist/esm/api/aptosConfig.mjs +1 -1
  32. package/dist/esm/api/coin.d.mts +14 -7
  33. package/dist/esm/api/coin.mjs +1 -1
  34. package/dist/esm/api/digitalAsset.d.mts +149 -10
  35. package/dist/esm/api/digitalAsset.mjs +1 -1
  36. package/dist/esm/api/event.d.mts +13 -8
  37. package/dist/esm/api/event.mjs +1 -1
  38. package/dist/esm/api/faucet.d.mts +3 -0
  39. package/dist/esm/api/faucet.mjs +1 -1
  40. package/dist/esm/api/fungibleAsset.d.mts +36 -13
  41. package/dist/esm/api/fungibleAsset.mjs +1 -1
  42. package/dist/esm/api/general.d.mts +55 -32
  43. package/dist/esm/api/general.mjs +1 -1
  44. package/dist/esm/api/index.d.mts +15 -9
  45. package/dist/esm/api/index.mjs +1 -1
  46. package/dist/esm/api/keyless.d.mts +75 -0
  47. package/dist/esm/api/keyless.mjs +2 -0
  48. package/dist/esm/api/staking.d.mts +9 -0
  49. package/dist/esm/api/staking.mjs +1 -1
  50. package/dist/esm/api/transaction.d.mts +59 -16
  51. package/dist/esm/api/transaction.mjs +1 -1
  52. package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
  53. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  54. package/dist/esm/api/transactionSubmission/management.d.mts +9 -9
  55. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  56. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  57. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  58. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  59. package/dist/esm/api/transactionSubmission/simulate.d.mts +7 -7
  60. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  61. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  62. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  63. package/dist/esm/api/utils.mjs +1 -1
  64. package/dist/esm/bcs/index.mjs +1 -1
  65. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  66. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  67. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  68. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  69. package/dist/esm/bcs/serializer.d.mts +2 -0
  70. package/dist/esm/bcs/serializer.mjs +1 -1
  71. package/dist/esm/chunk-2HXKDHMA.mjs +2 -0
  72. package/dist/esm/chunk-2HXKDHMA.mjs.map +1 -0
  73. package/dist/esm/{chunk-O3YFCZJ5.mjs → chunk-2I2XAOH7.mjs} +2 -2
  74. package/dist/esm/{chunk-NF5OUPPU.mjs → chunk-2PW2EHCH.mjs} +2 -2
  75. package/dist/esm/chunk-2PW2EHCH.mjs.map +1 -0
  76. package/dist/esm/{chunk-CP4QCRBZ.mjs → chunk-2XIT7I5L.mjs} +2 -2
  77. package/dist/esm/chunk-3FVRXELT.mjs +2 -0
  78. package/dist/esm/{chunk-U3YYSIIT.mjs → chunk-3VGX3TXH.mjs} +2 -2
  79. package/dist/esm/{chunk-FC5MU6ZN.mjs → chunk-45D3YXLT.mjs} +2 -2
  80. package/dist/esm/chunk-4FQ63Z6Y.mjs +2 -0
  81. package/dist/esm/chunk-4FQ63Z6Y.mjs.map +1 -0
  82. package/dist/esm/{chunk-M4SQNMCW.mjs → chunk-4QWFCYP2.mjs} +2 -2
  83. package/dist/esm/chunk-4QWFCYP2.mjs.map +1 -0
  84. package/dist/esm/{chunk-KQB7A4OX.mjs → chunk-5IM5TQN4.mjs} +2 -2
  85. package/dist/esm/{chunk-5NWTYUKC.mjs → chunk-67QYMEZE.mjs} +2 -2
  86. package/dist/esm/{chunk-GHYE26Q5.mjs → chunk-6FBKUTGF.mjs} +2 -2
  87. package/dist/esm/chunk-6Q2GNDKL.mjs +2 -0
  88. package/dist/esm/chunk-6RBUXB5I.mjs +2 -0
  89. package/dist/esm/{chunk-SRDIYE3M.mjs.map → chunk-6RBUXB5I.mjs.map} +1 -1
  90. package/dist/esm/{chunk-AIPKOP3K.mjs → chunk-77MI5DFB.mjs} +2 -2
  91. package/dist/esm/chunk-77MI5DFB.mjs.map +1 -0
  92. package/dist/esm/{chunk-5EN52MUT.mjs → chunk-7STYQ5ZE.mjs} +2 -2
  93. package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
  94. package/dist/esm/{chunk-YG6YYQRG.mjs → chunk-ABBKCXG4.mjs} +2 -2
  95. package/dist/esm/chunk-ABBKCXG4.mjs.map +1 -0
  96. package/dist/esm/chunk-ACOL3VVP.mjs +2 -0
  97. package/dist/esm/chunk-ACOL3VVP.mjs.map +1 -0
  98. package/dist/esm/chunk-AFPBV2BQ.mjs +2 -0
  99. package/dist/esm/{chunk-BCUSI3N6.mjs → chunk-AOCNYMMX.mjs} +2 -2
  100. package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
  101. package/dist/esm/{chunk-SUTBXHYU.mjs → chunk-AWMOLZCX.mjs} +2 -2
  102. package/dist/esm/chunk-AWMOLZCX.mjs.map +1 -0
  103. package/dist/esm/chunk-C3L4ETUF.mjs +2 -0
  104. package/dist/esm/chunk-CITY3EV2.mjs +2 -0
  105. package/dist/esm/chunk-CITY3EV2.mjs.map +1 -0
  106. package/dist/esm/chunk-COW5IGYC.mjs +2 -0
  107. package/dist/esm/chunk-CYA2GSRV.mjs +2 -0
  108. package/dist/esm/chunk-CYA2GSRV.mjs.map +1 -0
  109. package/dist/esm/{chunk-FNLRLSGJ.mjs → chunk-CYWA4AJF.mjs} +2 -2
  110. package/dist/esm/{chunk-FVMJDRHO.mjs → chunk-DANNIPX2.mjs} +2 -2
  111. package/dist/esm/chunk-DANNIPX2.mjs.map +1 -0
  112. package/dist/esm/{chunk-6O5ZR5ME.mjs → chunk-E3YEX3FR.mjs} +2 -2
  113. package/dist/esm/{chunk-G56GPLTB.mjs → chunk-EB7AI4B4.mjs} +2 -2
  114. package/dist/esm/chunk-EMFDNUP2.mjs +2 -0
  115. package/dist/esm/chunk-EMFDNUP2.mjs.map +1 -0
  116. package/dist/esm/chunk-FBPNHF54.mjs +2 -0
  117. package/dist/esm/chunk-FCVWPGXD.mjs +2 -0
  118. package/dist/esm/chunk-FCVWPGXD.mjs.map +1 -0
  119. package/dist/esm/chunk-FLYEALDB.mjs +2 -0
  120. package/dist/esm/chunk-FLYEALDB.mjs.map +1 -0
  121. package/dist/esm/chunk-G7S2ZX5A.mjs +2 -0
  122. package/dist/esm/chunk-G7S2ZX5A.mjs.map +1 -0
  123. package/dist/esm/{chunk-KAGLWBIJ.mjs → chunk-HGZGTBA4.mjs} +2 -2
  124. package/dist/esm/{chunk-T4C6BVXK.mjs → chunk-HJVGZBKN.mjs} +2 -2
  125. package/dist/esm/chunk-HJVGZBKN.mjs.map +1 -0
  126. package/dist/esm/{chunk-25UTAIJG.mjs → chunk-INYYKAXD.mjs} +2 -2
  127. package/dist/esm/chunk-J7YWDDUB.mjs +2 -0
  128. package/dist/esm/chunk-J7YWDDUB.mjs.map +1 -0
  129. package/dist/esm/chunk-JDD6TMHU.mjs +2 -0
  130. package/dist/esm/chunk-JDD6TMHU.mjs.map +1 -0
  131. package/dist/esm/chunk-JM3W7AQP.mjs +2 -0
  132. package/dist/esm/chunk-JM3W7AQP.mjs.map +1 -0
  133. package/dist/esm/{chunk-KXFMI7RM.mjs → chunk-JNAI5UFZ.mjs} +2 -2
  134. package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
  135. package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
  136. package/dist/esm/chunk-KDTQD56P.mjs +2 -0
  137. package/dist/esm/{chunk-QRVYLV76.mjs.map → chunk-KDTQD56P.mjs.map} +1 -1
  138. package/dist/esm/{chunk-A7XZTJ3D.mjs → chunk-KOWGEMJZ.mjs} +2 -2
  139. package/dist/esm/chunk-KOWGEMJZ.mjs.map +1 -0
  140. package/dist/esm/chunk-KPAKF3K7.mjs +2 -0
  141. package/dist/esm/chunk-KPAKF3K7.mjs.map +1 -0
  142. package/dist/esm/{chunk-UEKKYJGA.mjs → chunk-KR3NQRBA.mjs} +2 -2
  143. package/dist/esm/chunk-KR3NQRBA.mjs.map +1 -0
  144. package/dist/esm/chunk-L4CV3DRL.mjs +2 -0
  145. package/dist/esm/chunk-L4CV3DRL.mjs.map +1 -0
  146. package/dist/esm/{chunk-5ID6W7XL.mjs → chunk-LFTWUMLK.mjs} +2 -2
  147. package/dist/esm/chunk-LPFIDI6C.mjs +2 -0
  148. package/dist/esm/chunk-LPFIDI6C.mjs.map +1 -0
  149. package/dist/esm/chunk-LVYKZS54.mjs +2 -0
  150. package/dist/esm/{chunk-CXR7MOBW.mjs.map → chunk-LVYKZS54.mjs.map} +1 -1
  151. package/dist/esm/chunk-MGOHPDX4.mjs +2 -0
  152. package/dist/esm/chunk-MLPJOS5C.mjs +2 -0
  153. package/dist/esm/chunk-MWUJCP27.mjs +2 -0
  154. package/dist/esm/{chunk-VLNBGWGX.mjs → chunk-MZGNUGEY.mjs} +2 -2
  155. package/dist/esm/chunk-MZGNUGEY.mjs.map +1 -0
  156. package/dist/esm/chunk-NNT3XRRO.mjs +2 -0
  157. package/dist/esm/chunk-NNT3XRRO.mjs.map +1 -0
  158. package/dist/esm/chunk-NUDRQTYI.mjs +2 -0
  159. package/dist/esm/chunk-NUR3TCTI.mjs +2 -0
  160. package/dist/esm/chunk-OOSPASLD.mjs +2 -0
  161. package/dist/esm/chunk-OOSPASLD.mjs.map +1 -0
  162. package/dist/esm/chunk-OVXWFD2N.mjs +2 -0
  163. package/dist/esm/{chunk-CAGDOGXS.mjs.map → chunk-OVXWFD2N.mjs.map} +1 -1
  164. package/dist/esm/{chunk-MJPUASSD.mjs → chunk-PFFAQZHT.mjs} +2 -2
  165. package/dist/esm/chunk-PTIZKRON.mjs +2 -0
  166. package/dist/esm/chunk-PTIZKRON.mjs.map +1 -0
  167. package/dist/esm/chunk-QREYDZ5R.mjs +2 -0
  168. package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
  169. package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
  170. package/dist/esm/chunk-S5HG2QUD.mjs +2 -0
  171. package/dist/esm/chunk-S5HG2QUD.mjs.map +1 -0
  172. package/dist/esm/chunk-SHL6OAGA.mjs +2 -0
  173. package/dist/esm/chunk-SHL6OAGA.mjs.map +1 -0
  174. package/dist/esm/chunk-SKXGYGDX.mjs +2 -0
  175. package/dist/esm/chunk-SKXGYGDX.mjs.map +1 -0
  176. package/dist/esm/chunk-STYDBDYL.mjs +2 -0
  177. package/dist/esm/{chunk-QRS4DGP3.mjs → chunk-T23OVRNF.mjs} +2 -2
  178. package/dist/esm/{chunk-QRS4DGP3.mjs.map → chunk-T23OVRNF.mjs.map} +1 -1
  179. package/dist/esm/chunk-T47T7HX4.mjs +2 -0
  180. package/dist/esm/chunk-T47T7HX4.mjs.map +1 -0
  181. package/dist/esm/chunk-TB2KXA2B.mjs +2 -0
  182. package/dist/esm/chunk-TB2KXA2B.mjs.map +1 -0
  183. package/dist/esm/{chunk-VNIABDOT.mjs → chunk-THVGZXKD.mjs} +2 -2
  184. package/dist/esm/chunk-THVGZXKD.mjs.map +1 -0
  185. package/dist/esm/chunk-TJDC5PWD.mjs +2 -0
  186. package/dist/esm/chunk-TJTZVCPS.mjs +2 -0
  187. package/dist/esm/chunk-TJTZVCPS.mjs.map +1 -0
  188. package/dist/esm/chunk-TR6Q7RSZ.mjs +2 -0
  189. package/dist/esm/chunk-TR6Q7RSZ.mjs.map +1 -0
  190. package/dist/esm/{chunk-36QXVFR5.mjs → chunk-TVRJ3M7B.mjs} +2 -2
  191. package/dist/esm/{chunk-36QXVFR5.mjs.map → chunk-TVRJ3M7B.mjs.map} +1 -1
  192. package/dist/esm/chunk-U7AY6CMF.mjs +2 -0
  193. package/dist/esm/chunk-U7AY6CMF.mjs.map +1 -0
  194. package/dist/esm/{chunk-HJYT6LDB.mjs → chunk-UYMZF37A.mjs} +2 -2
  195. package/dist/esm/chunk-VHC2KC7B.mjs +2 -0
  196. package/dist/esm/chunk-VHC2KC7B.mjs.map +1 -0
  197. package/dist/esm/chunk-VHCJCXVZ.mjs +2 -0
  198. package/dist/esm/chunk-VHCJCXVZ.mjs.map +1 -0
  199. package/dist/esm/chunk-VVGV4S24.mjs +2 -0
  200. package/dist/esm/chunk-VVGV4S24.mjs.map +1 -0
  201. package/dist/esm/{chunk-3MFILHZT.mjs → chunk-W2R2FURG.mjs} +2 -2
  202. package/dist/esm/chunk-W2R2FURG.mjs.map +1 -0
  203. package/dist/esm/chunk-W57M6DIK.mjs +2 -0
  204. package/dist/esm/chunk-WRY7462X.mjs +2 -0
  205. package/dist/esm/chunk-WRY7462X.mjs.map +1 -0
  206. package/dist/esm/chunk-X5XBBEVT.mjs +2 -0
  207. package/dist/esm/chunk-X5XBBEVT.mjs.map +1 -0
  208. package/dist/esm/{chunk-XDXI3TRT.mjs → chunk-XBQEFZD7.mjs} +2 -2
  209. package/dist/esm/{chunk-5ZQJLHJA.mjs → chunk-Y5ZK4UII.mjs} +2 -2
  210. package/dist/esm/chunk-Y5ZK4UII.mjs.map +1 -0
  211. package/dist/esm/chunk-YP3RMVL3.mjs +2 -0
  212. package/dist/esm/chunk-YP3RMVL3.mjs.map +1 -0
  213. package/dist/esm/{chunk-35EWRSDK.mjs → chunk-ZNEBMSNC.mjs} +2 -2
  214. package/dist/esm/cli/index.mjs +1 -1
  215. package/dist/esm/client/core.mjs +1 -1
  216. package/dist/esm/client/get.d.mts +2 -1
  217. package/dist/esm/client/get.mjs +1 -1
  218. package/dist/esm/client/index.d.mts +2 -2
  219. package/dist/esm/client/index.mjs +1 -1
  220. package/dist/esm/client/post.d.mts +3 -1
  221. package/dist/esm/client/post.mjs +1 -1
  222. package/dist/esm/client/types.mjs +1 -1
  223. package/dist/esm/core/account/utils/address.mjs +1 -1
  224. package/dist/esm/core/account/utils/index.mjs +1 -1
  225. package/dist/esm/core/accountAddress.mjs +1 -1
  226. package/dist/esm/core/authenticationKey.d.mts +1 -1
  227. package/dist/esm/core/authenticationKey.mjs +1 -1
  228. package/dist/esm/core/common.mjs +1 -1
  229. package/dist/esm/core/crypto/ed25519.d.mts +9 -12
  230. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  231. package/dist/esm/core/crypto/ephemeral.d.mts +76 -0
  232. package/dist/esm/core/crypto/ephemeral.mjs +2 -0
  233. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
  234. package/dist/esm/core/crypto/hdKey.d.mts +15 -1
  235. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  236. package/dist/esm/core/crypto/index.d.mts +8 -6
  237. package/dist/esm/core/crypto/index.mjs +1 -1
  238. package/dist/esm/core/crypto/keyless.d.mts +217 -0
  239. package/dist/esm/core/crypto/keyless.mjs +2 -0
  240. package/dist/esm/core/crypto/keyless.mjs.map +1 -0
  241. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  242. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  243. package/dist/esm/core/crypto/multiKey.d.mts +5 -4
  244. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  245. package/dist/esm/core/crypto/poseidon.d.mts +7 -0
  246. package/dist/esm/core/crypto/poseidon.mjs +2 -0
  247. package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
  248. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  249. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  250. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  251. package/dist/esm/core/crypto/secp256k1.d.mts +8 -1
  252. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  253. package/dist/esm/core/crypto/signature.mjs +1 -1
  254. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  255. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  256. package/dist/esm/core/crypto/utils.mjs +1 -1
  257. package/dist/esm/core/hex.mjs +1 -1
  258. package/dist/esm/core/index.d.mts +7 -8
  259. package/dist/esm/core/index.mjs +1 -1
  260. package/dist/esm/index.d.mts +16 -12
  261. package/dist/esm/index.mjs +1 -1
  262. package/dist/esm/internal/account.d.mts +14 -2
  263. package/dist/esm/internal/account.mjs +1 -1
  264. package/dist/esm/internal/ans.d.mts +4 -4
  265. package/dist/esm/internal/ans.mjs +1 -1
  266. package/dist/esm/internal/coin.d.mts +8 -8
  267. package/dist/esm/internal/coin.mjs +1 -1
  268. package/dist/esm/internal/digitalAsset.d.mts +11 -11
  269. package/dist/esm/internal/digitalAsset.mjs +1 -1
  270. package/dist/esm/internal/event.d.mts +1 -1
  271. package/dist/esm/internal/event.mjs +1 -1
  272. package/dist/esm/internal/faucet.d.mts +1 -1
  273. package/dist/esm/internal/faucet.mjs +1 -1
  274. package/dist/esm/internal/fungibleAsset.d.mts +12 -12
  275. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  276. package/dist/esm/internal/general.mjs +1 -1
  277. package/dist/esm/internal/keyless.d.mts +68 -0
  278. package/dist/esm/internal/keyless.mjs +2 -0
  279. package/dist/esm/internal/keyless.mjs.map +1 -0
  280. package/dist/esm/internal/staking.d.mts +1 -1
  281. package/dist/esm/internal/staking.mjs +1 -1
  282. package/dist/esm/internal/transaction.d.mts +5 -1
  283. package/dist/esm/internal/transaction.mjs +1 -1
  284. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  285. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  286. package/dist/esm/internal/view.d.mts +7 -7
  287. package/dist/esm/internal/view.mjs +1 -1
  288. package/dist/esm/transactions/authenticator/account.d.mts +4 -5
  289. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  290. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  291. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  292. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  293. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  294. package/dist/esm/transactions/index.d.mts +3 -3
  295. package/dist/esm/transactions/index.mjs +1 -1
  296. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  297. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  298. package/dist/esm/transactions/instances/index.d.mts +1 -1
  299. package/dist/esm/transactions/instances/index.mjs +1 -1
  300. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  301. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  302. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  303. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  304. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  305. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  306. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  307. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  308. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  309. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  310. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  311. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +14 -2
  312. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  313. package/dist/esm/transactions/management/index.d.mts +3 -3
  314. package/dist/esm/transactions/management/index.mjs +1 -1
  315. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  316. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  317. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
  318. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  319. package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
  320. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  321. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
  322. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  323. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +47 -0
  324. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +2 -0
  325. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
  326. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +7 -29
  327. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  328. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  329. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  330. package/dist/esm/transactions/types.d.mts +7 -7
  331. package/dist/esm/types/index.d.mts +18 -3
  332. package/dist/esm/types/index.mjs +1 -1
  333. package/dist/esm/types/keyless.d.mts +14 -0
  334. package/dist/esm/types/keyless.mjs +1 -0
  335. package/dist/esm/types/keyless.mjs.map +1 -0
  336. package/dist/esm/utils/apiEndpoints.d.mts +3 -1
  337. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  338. package/dist/esm/utils/const.d.mts +5 -3
  339. package/dist/esm/utils/const.mjs +1 -1
  340. package/dist/esm/utils/index.d.mts +1 -1
  341. package/dist/esm/utils/index.mjs +1 -1
  342. package/dist/esm/version.d.mts +1 -1
  343. package/dist/esm/version.mjs +1 -1
  344. package/package.json +13 -7
  345. package/src/{core/account → account}/Account.ts +12 -16
  346. package/src/{core/account → account}/Ed25519Account.ts +13 -7
  347. package/src/account/EphemeralKeyPair.ts +78 -0
  348. package/src/account/KeylessAccount.ts +230 -0
  349. package/src/account/MultiKeyAccount.ts +121 -0
  350. package/src/{core/account → account}/SingleKeyAccount.ts +13 -7
  351. package/src/account/index.ts +6 -0
  352. package/src/api/account.ts +50 -8
  353. package/src/api/ans.ts +10 -17
  354. package/src/api/aptos.ts +10 -0
  355. package/src/api/aptosConfig.ts +50 -1
  356. package/src/api/coin.ts +7 -0
  357. package/src/api/digitalAsset.ts +142 -2
  358. package/src/api/event.ts +13 -8
  359. package/src/api/faucet.ts +3 -0
  360. package/src/api/fungibleAsset.ts +28 -4
  361. package/src/api/general.ts +48 -25
  362. package/src/api/keyless.ts +55 -0
  363. package/src/api/staking.ts +9 -0
  364. package/src/api/transaction.ts +59 -15
  365. package/src/api/transactionSubmission/management.ts +1 -1
  366. package/src/api/transactionSubmission/sign.ts +1 -1
  367. package/src/bcs/serializer.ts +18 -0
  368. package/src/client/core.ts +10 -1
  369. package/src/client/get.ts +6 -0
  370. package/src/client/post.ts +13 -0
  371. package/src/core/crypto/ed25519.ts +50 -34
  372. package/src/core/crypto/ephemeral.ts +147 -0
  373. package/src/core/crypto/hdKey.ts +31 -0
  374. package/src/core/crypto/index.ts +2 -0
  375. package/src/core/crypto/keyless.ts +502 -0
  376. package/src/core/crypto/multiKey.ts +23 -11
  377. package/src/core/crypto/poseidon.ts +134 -0
  378. package/src/core/crypto/secp256k1.ts +9 -3
  379. package/src/core/crypto/singleKey.ts +11 -0
  380. package/src/core/index.ts +0 -1
  381. package/src/index.ts +1 -1
  382. package/src/internal/account.ts +7 -10
  383. package/src/internal/ans.ts +2 -1
  384. package/src/internal/digitalAsset.ts +3 -2
  385. package/src/internal/fungibleAsset.ts +4 -3
  386. package/src/internal/keyless.ts +205 -0
  387. package/src/internal/transaction.ts +48 -10
  388. package/src/internal/transactionSubmission.ts +8 -7
  389. package/src/transactions/authenticator/account.ts +6 -11
  390. package/src/transactions/management/accountSequenceNumber.ts +1 -1
  391. package/src/transactions/management/transactionWorker.ts +8 -2
  392. package/src/transactions/transactionBuilder/index.ts +2 -0
  393. package/src/transactions/transactionBuilder/signingMessage.ts +75 -0
  394. package/src/transactions/transactionBuilder/transactionBuilder.ts +3 -80
  395. package/src/types/index.ts +21 -0
  396. package/src/types/keyless.ts +6 -0
  397. package/src/utils/apiEndpoints.ts +14 -0
  398. package/src/utils/const.ts +4 -2
  399. package/src/version.ts +1 -1
  400. package/dist/esm/chunk-3MFILHZT.mjs.map +0 -1
  401. package/dist/esm/chunk-3PMUIXFS.mjs +0 -2
  402. package/dist/esm/chunk-3PMUIXFS.mjs.map +0 -1
  403. package/dist/esm/chunk-3RQ5V3F3.mjs +0 -2
  404. package/dist/esm/chunk-4AVC2RCH.mjs +0 -2
  405. package/dist/esm/chunk-4AVC2RCH.mjs.map +0 -1
  406. package/dist/esm/chunk-4NHWV5AI.mjs +0 -2
  407. package/dist/esm/chunk-4QMXOWHP.mjs +0 -1
  408. package/dist/esm/chunk-527DYQ3X.mjs +0 -2
  409. package/dist/esm/chunk-527DYQ3X.mjs.map +0 -1
  410. package/dist/esm/chunk-5ZQJLHJA.mjs.map +0 -1
  411. package/dist/esm/chunk-A7XZTJ3D.mjs.map +0 -1
  412. package/dist/esm/chunk-AIPKOP3K.mjs.map +0 -1
  413. package/dist/esm/chunk-ARGODLTZ.mjs +0 -2
  414. package/dist/esm/chunk-ARGODLTZ.mjs.map +0 -1
  415. package/dist/esm/chunk-ASXXZH2D.mjs +0 -2
  416. package/dist/esm/chunk-ASXXZH2D.mjs.map +0 -1
  417. package/dist/esm/chunk-B4DWWHNL.mjs +0 -2
  418. package/dist/esm/chunk-B7X6PSE7.mjs +0 -2
  419. package/dist/esm/chunk-BAYKVJBZ.mjs +0 -2
  420. package/dist/esm/chunk-C67BKZND.mjs +0 -2
  421. package/dist/esm/chunk-C67BKZND.mjs.map +0 -1
  422. package/dist/esm/chunk-CAGDOGXS.mjs +0 -2
  423. package/dist/esm/chunk-CEHCDA3G.mjs +0 -2
  424. package/dist/esm/chunk-CQS6ZCJ7.mjs +0 -2
  425. package/dist/esm/chunk-CQS6ZCJ7.mjs.map +0 -1
  426. package/dist/esm/chunk-CXR7MOBW.mjs +0 -2
  427. package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
  428. package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
  429. package/dist/esm/chunk-DGLW7OBS.mjs +0 -2
  430. package/dist/esm/chunk-DGLW7OBS.mjs.map +0 -1
  431. package/dist/esm/chunk-DUP7XY5P.mjs +0 -2
  432. package/dist/esm/chunk-DUP7XY5P.mjs.map +0 -1
  433. package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
  434. package/dist/esm/chunk-EJBUUMWV.mjs +0 -2
  435. package/dist/esm/chunk-EV75CYGN.mjs +0 -2
  436. package/dist/esm/chunk-EV75CYGN.mjs.map +0 -1
  437. package/dist/esm/chunk-F7EMGK4M.mjs +0 -2
  438. package/dist/esm/chunk-FPD4JBPV.mjs +0 -2
  439. package/dist/esm/chunk-FPD4JBPV.mjs.map +0 -1
  440. package/dist/esm/chunk-FVMJDRHO.mjs.map +0 -1
  441. package/dist/esm/chunk-FXHXOVL4.mjs +0 -2
  442. package/dist/esm/chunk-FXHXOVL4.mjs.map +0 -1
  443. package/dist/esm/chunk-GJDGR3KQ.mjs +0 -2
  444. package/dist/esm/chunk-GJDGR3KQ.mjs.map +0 -1
  445. package/dist/esm/chunk-IZF6DFAL.mjs +0 -2
  446. package/dist/esm/chunk-JOLLCFQL.mjs +0 -2
  447. package/dist/esm/chunk-JOLLCFQL.mjs.map +0 -1
  448. package/dist/esm/chunk-LG7RJQ57.mjs +0 -2
  449. package/dist/esm/chunk-LR65XHSF.mjs +0 -2
  450. package/dist/esm/chunk-LR65XHSF.mjs.map +0 -1
  451. package/dist/esm/chunk-M4SQNMCW.mjs.map +0 -1
  452. package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
  453. package/dist/esm/chunk-N3U47Y6Y.mjs +0 -2
  454. package/dist/esm/chunk-NF5OUPPU.mjs.map +0 -1
  455. package/dist/esm/chunk-NJRNZEHX.mjs +0 -2
  456. package/dist/esm/chunk-NJRNZEHX.mjs.map +0 -1
  457. package/dist/esm/chunk-PF57EOJY.mjs +0 -2
  458. package/dist/esm/chunk-QJAI7DNA.mjs +0 -2
  459. package/dist/esm/chunk-QJAI7DNA.mjs.map +0 -1
  460. package/dist/esm/chunk-QRVYLV76.mjs +0 -2
  461. package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
  462. package/dist/esm/chunk-RIUFW2OG.mjs +0 -2
  463. package/dist/esm/chunk-RIUFW2OG.mjs.map +0 -1
  464. package/dist/esm/chunk-SRDIYE3M.mjs +0 -2
  465. package/dist/esm/chunk-SUTBXHYU.mjs.map +0 -1
  466. package/dist/esm/chunk-SWZOGZJ6.mjs +0 -2
  467. package/dist/esm/chunk-SWZOGZJ6.mjs.map +0 -1
  468. package/dist/esm/chunk-SZKJ3TC5.mjs +0 -1
  469. package/dist/esm/chunk-T4C6BVXK.mjs.map +0 -1
  470. package/dist/esm/chunk-UEKKYJGA.mjs.map +0 -1
  471. package/dist/esm/chunk-UGPALAPN.mjs +0 -2
  472. package/dist/esm/chunk-UQCSBLD5.mjs +0 -2
  473. package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
  474. package/dist/esm/chunk-VBDMQERT.mjs +0 -2
  475. package/dist/esm/chunk-VHANL47W.mjs +0 -2
  476. package/dist/esm/chunk-VHANL47W.mjs.map +0 -1
  477. package/dist/esm/chunk-VLNBGWGX.mjs.map +0 -1
  478. package/dist/esm/chunk-VNIABDOT.mjs.map +0 -1
  479. package/dist/esm/chunk-XX5J7KKC.mjs +0 -2
  480. package/dist/esm/chunk-XX5J7KKC.mjs.map +0 -1
  481. package/dist/esm/chunk-YG6YYQRG.mjs.map +0 -1
  482. package/dist/esm/chunk-YIGDWPGM.mjs +0 -2
  483. package/dist/esm/chunk-YIGDWPGM.mjs.map +0 -1
  484. package/dist/esm/core/account/Account.d.mts +0 -20
  485. package/dist/esm/core/account/Account.mjs +0 -2
  486. package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
  487. package/dist/esm/core/account/Ed25519Account.mjs +0 -2
  488. package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
  489. package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
  490. package/dist/esm/core/account/index.d.mts +0 -21
  491. package/dist/esm/core/account/index.mjs +0 -2
  492. package/src/core/account/index.ts +0 -4
  493. /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
  494. /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
  495. /package/dist/esm/{chunk-4QMXOWHP.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
  496. /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/KeylessAccount.mjs.map} +0 -0
  497. /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
  498. /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
  499. /package/dist/esm/{core/account → account}/index.mjs.map +0 -0
  500. /package/dist/esm/{chunk-R7G3CLRI.mjs.map → api/keyless.mjs.map} +0 -0
  501. /package/dist/esm/{chunk-O3YFCZJ5.mjs.map → chunk-2I2XAOH7.mjs.map} +0 -0
  502. /package/dist/esm/{chunk-CP4QCRBZ.mjs.map → chunk-2XIT7I5L.mjs.map} +0 -0
  503. /package/dist/esm/{chunk-CEHCDA3G.mjs.map → chunk-3FVRXELT.mjs.map} +0 -0
  504. /package/dist/esm/{chunk-U3YYSIIT.mjs.map → chunk-3VGX3TXH.mjs.map} +0 -0
  505. /package/dist/esm/{chunk-FC5MU6ZN.mjs.map → chunk-45D3YXLT.mjs.map} +0 -0
  506. /package/dist/esm/{chunk-KQB7A4OX.mjs.map → chunk-5IM5TQN4.mjs.map} +0 -0
  507. /package/dist/esm/{chunk-5NWTYUKC.mjs.map → chunk-67QYMEZE.mjs.map} +0 -0
  508. /package/dist/esm/{chunk-GHYE26Q5.mjs.map → chunk-6FBKUTGF.mjs.map} +0 -0
  509. /package/dist/esm/{chunk-UQCSBLD5.mjs.map → chunk-6Q2GNDKL.mjs.map} +0 -0
  510. /package/dist/esm/{chunk-5EN52MUT.mjs.map → chunk-7STYQ5ZE.mjs.map} +0 -0
  511. /package/dist/esm/{chunk-SZKJ3TC5.mjs.map → chunk-7Z6DYLCA.mjs.map} +0 -0
  512. /package/dist/esm/{chunk-EJBUUMWV.mjs.map → chunk-AFPBV2BQ.mjs.map} +0 -0
  513. /package/dist/esm/{chunk-BCUSI3N6.mjs.map → chunk-AOCNYMMX.mjs.map} +0 -0
  514. /package/dist/esm/{chunk-UVSRX4SV.mjs.map → chunk-AQ4I7VVB.mjs.map} +0 -0
  515. /package/dist/esm/{chunk-N3U47Y6Y.mjs.map → chunk-C3L4ETUF.mjs.map} +0 -0
  516. /package/dist/esm/{chunk-4NHWV5AI.mjs.map → chunk-COW5IGYC.mjs.map} +0 -0
  517. /package/dist/esm/{chunk-FNLRLSGJ.mjs.map → chunk-CYWA4AJF.mjs.map} +0 -0
  518. /package/dist/esm/{chunk-6O5ZR5ME.mjs.map → chunk-E3YEX3FR.mjs.map} +0 -0
  519. /package/dist/esm/{chunk-G56GPLTB.mjs.map → chunk-EB7AI4B4.mjs.map} +0 -0
  520. /package/dist/esm/{chunk-LG7RJQ57.mjs.map → chunk-FBPNHF54.mjs.map} +0 -0
  521. /package/dist/esm/{chunk-KAGLWBIJ.mjs.map → chunk-HGZGTBA4.mjs.map} +0 -0
  522. /package/dist/esm/{chunk-25UTAIJG.mjs.map → chunk-INYYKAXD.mjs.map} +0 -0
  523. /package/dist/esm/{chunk-KXFMI7RM.mjs.map → chunk-JNAI5UFZ.mjs.map} +0 -0
  524. /package/dist/esm/{chunk-5ID6W7XL.mjs.map → chunk-LFTWUMLK.mjs.map} +0 -0
  525. /package/dist/esm/{chunk-B7X6PSE7.mjs.map → chunk-MGOHPDX4.mjs.map} +0 -0
  526. /package/dist/esm/{chunk-BAYKVJBZ.mjs.map → chunk-MLPJOS5C.mjs.map} +0 -0
  527. /package/dist/esm/{chunk-PF57EOJY.mjs.map → chunk-MWUJCP27.mjs.map} +0 -0
  528. /package/dist/esm/{chunk-VBDMQERT.mjs.map → chunk-NUDRQTYI.mjs.map} +0 -0
  529. /package/dist/esm/{chunk-B4DWWHNL.mjs.map → chunk-NUR3TCTI.mjs.map} +0 -0
  530. /package/dist/esm/{chunk-MJPUASSD.mjs.map → chunk-PFFAQZHT.mjs.map} +0 -0
  531. /package/dist/esm/{chunk-IZF6DFAL.mjs.map → chunk-QREYDZ5R.mjs.map} +0 -0
  532. /package/dist/esm/{chunk-UGPALAPN.mjs.map → chunk-STYDBDYL.mjs.map} +0 -0
  533. /package/dist/esm/{chunk-F7EMGK4M.mjs.map → chunk-TJDC5PWD.mjs.map} +0 -0
  534. /package/dist/esm/{chunk-HJYT6LDB.mjs.map → chunk-UYMZF37A.mjs.map} +0 -0
  535. /package/dist/esm/{chunk-3RQ5V3F3.mjs.map → chunk-W57M6DIK.mjs.map} +0 -0
  536. /package/dist/esm/{chunk-XDXI3TRT.mjs.map → chunk-XBQEFZD7.mjs.map} +0 -0
  537. /package/dist/esm/{chunk-35EWRSDK.mjs.map → chunk-ZNEBMSNC.mjs.map} +0 -0
  538. /package/dist/esm/{publicKey-B3XRNhHO.d.mts → publicKey-lq5djCIY.d.mts} +0 -0
@@ -33,11 +33,12 @@ import {
33
33
  InputGenerateTransactionOptions,
34
34
  InputGenerateTransactionPayloadData,
35
35
  } from "../transactions";
36
- import { AccountAddressInput, Account, PrivateKey } from "../core";
36
+ import { AccountAddressInput, PrivateKey } from "../core";
37
37
  import { Build } from "./transactionSubmission/build";
38
38
  import { Simulate } from "./transactionSubmission/simulate";
39
39
  import { Submit } from "./transactionSubmission/submit";
40
40
  import { TransactionManagement } from "./transactionSubmission/management";
41
+ import { Account } from "../account/Account";
41
42
  import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
42
43
 
43
44
  export class Transaction {
@@ -63,6 +64,9 @@ export class Transaction {
63
64
  * Queries on-chain transactions. This function will not return pending
64
65
  * transactions. For that, use `getTransactionsByHash`.
65
66
  *
67
+ * @example
68
+ * const transactions = await aptos.getTransactions()
69
+ *
66
70
  * @param args.options.offset The number transaction to start with
67
71
  * @param args.options.limit Number of results to return
68
72
  *
@@ -78,6 +82,9 @@ export class Transaction {
78
82
  /**
79
83
  * Queries on-chain transaction by version. This function will not return pending transactions.
80
84
  *
85
+ * @example
86
+ * const transaction = await aptos.getTransactions({ledgerVersion:1})
87
+ *
81
88
  * @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.
82
89
  * @returns On-chain transaction. Only on-chain transactions have versions, so this
83
90
  * function cannot be used to query pending transactions.
@@ -91,6 +98,10 @@ export class Transaction {
91
98
 
92
99
  /**
93
100
  * Queries on-chain transaction by transaction hash. This function will return pending transactions.
101
+ *
102
+ * @example
103
+ * const transaction = await aptos.getTransactionByHash({transactionHash:"0x123"})
104
+ *
94
105
  * @param args.transactionHash - Transaction hash should be hex-encoded bytes string with 0x prefix.
95
106
  * @returns Transaction from mempool (pending) or on-chain (committed) transaction
96
107
  */
@@ -110,6 +121,9 @@ export class Transaction {
110
121
  * 2. Apply hash algorithm SHA3-256 to the hash message bytes.
111
122
  * 3. Hex-encode the hash bytes with 0x prefix.
112
123
  *
124
+ * @example
125
+ * const isPendingTransaction = await aptos.isPendingTransaction({transactionHash:"0x123"})
126
+ *
113
127
  * @param args.transactionHash A hash of transaction
114
128
  * @returns `true` if transaction is in pending state and `false` otherwise
115
129
  */
@@ -135,6 +149,8 @@ export class Transaction {
135
149
  * 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.
136
150
  * - The function will throw a WaitForTransactionError
137
151
  *
152
+ * @example
153
+ * const transaction = await aptos.waitForTransaction({transactionHash:"0x123"})
138
154
  *
139
155
  * @param args.transactionHash The hash of a transaction previously submitted to the blockchain.
140
156
  * @param args.options.timeoutSecs Timeout in seconds. Defaults to 20 seconds.
@@ -158,14 +174,9 @@ export class Transaction {
158
174
  * For more information {@link https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}
159
175
  *
160
176
  * @returns Object holding the outputs of the estimate gas API
177
+ *
161
178
  * @example
162
- * ```
163
- * {
164
- * gas_estimate: number;
165
- * deprioritized_gas_estimate?: number;
166
- * prioritized_gas_estimate?: number;
167
- * }
168
- * ```
179
+ * const gasPrice = await aptos.waitForTransaction()
169
180
  */
170
181
  async getGasPriceEstimation(): Promise<GasEstimation> {
171
182
  return getGasPriceEstimation({
@@ -178,6 +189,11 @@ export class Transaction {
178
189
  *
179
190
  * This allows a user to sign a transaction using their own preferred signing method, and
180
191
  * then submit it to the network.
192
+ *
193
+ * @example
194
+ * const transaction = await aptos.transaction.build.simple({...})
195
+ * const message = await aptos.getSigningMessage({transaction})
196
+ *
181
197
  * @param args.transaction A raw transaction for signing elsewhere
182
198
  */
183
199
  // eslint-disable-next-line class-methods-use-this
@@ -192,6 +208,13 @@ export class Transaction {
192
208
  * `aptos move compile --save-metadata ...`,
193
209
  * For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}
194
210
  *
211
+ * @example
212
+ * const transaction = await aptos.publishPackageTransaction({
213
+ * account: alice,
214
+ * metadataBytes,
215
+ * moduleBytecode: [byteCode],
216
+ * })
217
+ *
195
218
  * @param args.account The publisher account
196
219
  * @param args.metadataBytes The package metadata bytes
197
220
  * @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order
@@ -212,6 +235,13 @@ export class Transaction {
212
235
  * the account.
213
236
  * Note: Only legacy Ed25519 scheme is supported for now.
214
237
  * More info: {@link https://aptos.dev/guides/account-management/key-rotation/}
238
+ *
239
+ * @example
240
+ * const response = await aptos.rotateAuthKey({
241
+ * fromAccount: alice,
242
+ * toNewPrivateKey: new ED25519PublicKey("0x123"),
243
+ * })
244
+ *
215
245
  * @param args.fromAccount The account to rotate the auth key for
216
246
  * @param args.toNewPrivateKey The new private key to rotate to
217
247
  *
@@ -224,6 +254,13 @@ export class Transaction {
224
254
  /**
225
255
  * Sign a transaction that can later be submitted to chain
226
256
  *
257
+ * @example
258
+ * const transaction = await aptos.transaction.build.simple({...})
259
+ * const transaction = await aptos.transaction.sign({
260
+ * signer: alice,
261
+ * transaction
262
+ * })
263
+ *
227
264
  * @param args.signer The signer account
228
265
  * @param args.transaction A raw transaction to sign on
229
266
  *
@@ -239,6 +276,13 @@ export class Transaction {
239
276
  /**
240
277
  * Sign a transaction as a fee payer that can later be submitted to chain
241
278
  *
279
+ * @example
280
+ * const transaction = await aptos.transaction.build.simple({...})
281
+ * const transaction = await aptos.transaction.signAsFeePayer({
282
+ * signer: alice,
283
+ * transaction
284
+ * })
285
+ *
242
286
  * @param args.signer The fee payer signer account
243
287
  * @param args.transaction A raw transaction to sign on
244
288
  *
@@ -301,13 +345,13 @@ export class Transaction {
301
345
  *
302
346
  * @param args.signer The signer account to sign the transaction
303
347
  * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses
304
- * ```
305
- * {
306
- * rawTransaction: RawTransaction,
307
- * secondarySignerAddresses? : Array<AccountAddress>,
308
- * feePayerAddress?: AccountAddress
309
- * }
310
- * ```
348
+ *
349
+ * @example
350
+ * const transaction = await aptos.transaction.build.simple({...})
351
+ * const transaction = await aptos.signAndSubmitTransaction({
352
+ * signer: alice,
353
+ * transaction
354
+ * })
311
355
  *
312
356
  * @return PendingTransactionResponse
313
357
  */
@@ -2,7 +2,7 @@ import EventEmitter from "eventemitter3";
2
2
  import { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from "../../transactions/management";
3
3
  import { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from "../../transactions";
4
4
  import { AptosConfig } from "../aptosConfig";
5
- import { Account } from "../../core";
5
+ import { Account } from "../../account";
6
6
 
7
7
  export class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {
8
8
  account!: Account;
@@ -1,7 +1,7 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Account } from "../../core";
4
+ import { Account } from "../../account";
5
5
  import { signTransaction } from "../../internal/transactionSubmission";
6
6
  import { AccountAuthenticator, AnyRawTransaction } from "../../transactions";
7
7
  import { AptosConfig } from "../aptosConfig";
@@ -316,6 +316,24 @@ export class Serializer {
316
316
  item.serialize(this);
317
317
  });
318
318
  }
319
+
320
+ serializeOption<T extends Serializable>(value?: T): void {
321
+ if (value === undefined) {
322
+ this.serializeU32AsUleb128(0);
323
+ } else {
324
+ this.serializeU32AsUleb128(1);
325
+ value.serialize(this);
326
+ }
327
+ }
328
+
329
+ serializeOptionStr(value?: string): void {
330
+ if (value === undefined) {
331
+ this.serializeU32AsUleb128(0);
332
+ } else {
333
+ this.serializeU32AsUleb128(1);
334
+ this.serializeStr(value);
335
+ }
336
+ }
319
337
  }
320
338
 
321
339
  export function ensureBoolean(value: unknown): asserts value is boolean {
@@ -26,11 +26,12 @@ const errors: Record<number, string> = {
26
26
  * returns the response.
27
27
  */
28
28
  export async function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>> {
29
- const { url, method, body, contentType, params, overrides } = options;
29
+ const { url, method, body, contentType, params, overrides, originMethod } = options;
30
30
  const headers: Record<string, string | AnyNumber | boolean | undefined> = {
31
31
  ...overrides?.HEADERS,
32
32
  "x-aptos-client": `aptos-typescript-sdk/${VERSION}`,
33
33
  "content-type": contentType ?? MimeType.JSON,
34
+ "x-aptos-typescript-sdk-origin-method": originMethod,
34
35
  };
35
36
 
36
37
  if (overrides?.AUTH_TOKEN) {
@@ -105,6 +106,14 @@ export async function aptosRequest<Req extends {}, Res extends {}>(
105
106
  return result;
106
107
  }
107
108
 
109
+ if (result.status >= 500) {
110
+ throw new AptosApiError(options, result, `${response.data}`);
111
+ }
112
+
113
+ if (aptosConfig.isPepperServiceRequest(url)) {
114
+ throw new AptosApiError(options, result, `${response.data}`);
115
+ }
116
+
108
117
  let errorMessage: string;
109
118
 
110
119
  if (result && result.data && "message" in result.data && "error_code" in result.data) {
package/src/client/get.ts CHANGED
@@ -89,6 +89,12 @@ export async function getAptosFullNode<Req extends {}, Res extends {}>(
89
89
  });
90
90
  }
91
91
 
92
+ export async function getAptosPepperService<Req extends {}, Res extends {}>(
93
+ options: GetAptosRequestOptions,
94
+ ): Promise<AptosResponse<Req, Res>> {
95
+ return get<Req, Res>({ ...options, type: AptosApiType.PEPPER });
96
+ }
97
+
92
98
  /// This function is a helper for paginating using a function wrapping an API
93
99
  export async function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(
94
100
  options: GetAptosRequestOptions,
@@ -135,3 +135,16 @@ export async function postAptosFaucet<Req extends {}, Res extends {}>(
135
135
  },
136
136
  });
137
137
  }
138
+
139
+
140
+ export async function postAptosPepperService<Req extends {}, Res extends {}>(
141
+ options: PostAptosRequestOptions,
142
+ ): Promise<AptosResponse<Req, Res>> {
143
+ return post<Req, Res>({ ...options, type: AptosApiType.PEPPER });
144
+ }
145
+
146
+ export async function postAptosProvingService<Req extends {}, Res extends {}>(
147
+ options: PostAptosRequestOptions,
148
+ ): Promise<AptosResponse<Req, Res>> {
149
+ return post<Req, Res>({ ...options, type: AptosApiType.PROVER });
150
+ }
@@ -1,18 +1,30 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import nacl from "tweetnacl";
4
+ import { ed25519 } from "@noble/curves/ed25519";
5
5
  import { Deserializer } from "../../bcs/deserializer";
6
6
  import { Serializable, Serializer } from "../../bcs/serializer";
7
7
  import { AuthenticationKey } from "../authenticationKey";
8
8
  import { Hex } from "../hex";
9
9
  import { HexInput, SigningScheme as AuthenticationKeyScheme } from "../../types";
10
- import { CKDPriv, deriveKey, HARDENED_OFFSET, isValidHardenedPath, mnemonicToSeed, splitPath } from "./hdKey";
10
+ import {
11
+ isValidHardenedPath,
12
+ fromDerivationPath as fromDerivationPathInner,
13
+ mnemonicToSeed,
14
+ } from "./hdKey";
11
15
  import { PrivateKey } from "./privateKey";
12
16
  import { AccountPublicKey, VerifySignatureArgs } from "./publicKey";
13
17
  import { Signature } from "./signature";
14
18
  import { convertSigningMessage } from "./utils";
15
19
 
20
+ /**
21
+ * L is the value that greater than or equal to will produce a non-canonical signature, and must be rejected
22
+ */
23
+ const L: number[] = [
24
+ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00,
25
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
26
+ ];
27
+
16
28
  /**
17
29
  * Represents the public key of an Ed25519 key pair.
18
30
  *
@@ -65,7 +77,12 @@ export class Ed25519PublicKey extends AccountPublicKey {
65
77
  const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();
66
78
  const signatureBytes = signature.toUint8Array();
67
79
  const publicKeyBytes = this.key.toUint8Array();
68
- return nacl.sign.detached.verify(messageBytes, signatureBytes, publicKeyBytes);
80
+ // Also verify malleability
81
+ if (!signature.isCanonicalSignature()) {
82
+ return false;
83
+ }
84
+
85
+ return ed25519.verify(signatureBytes, messageBytes, publicKeyBytes);
69
86
  }
70
87
 
71
88
  authKey(): AuthenticationKey {
@@ -126,7 +143,7 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
126
143
  * The Ed25519 signing key
127
144
  * @private
128
145
  */
129
- private readonly signingKeyPair: nacl.SignKeyPair;
146
+ private readonly signingKey: Hex;
130
147
 
131
148
  // region Constructors
132
149
 
@@ -144,7 +161,7 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
144
161
  }
145
162
 
146
163
  // Create keyPair from Private key in Uint8Array format
147
- this.signingKeyPair = nacl.sign.keyPair.fromSeed(privateKeyHex.toUint8Array().slice(0, Ed25519PrivateKey.LENGTH));
164
+ this.signingKey = privateKeyHex;
148
165
  }
149
166
 
150
167
  /**
@@ -153,8 +170,8 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
153
170
  * @returns Ed25519PrivateKey
154
171
  */
155
172
  static generate(): Ed25519PrivateKey {
156
- const keyPair = nacl.sign.keyPair();
157
- return new Ed25519PrivateKey(keyPair.secretKey.slice(0, Ed25519PrivateKey.LENGTH));
173
+ const keyPair = ed25519.utils.randomPrivateKey();
174
+ return new Ed25519PrivateKey(keyPair);
158
175
  }
159
176
 
160
177
  /**
@@ -172,29 +189,7 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
172
189
  if (!isValidHardenedPath(path)) {
173
190
  throw new Error(`Invalid derivation path ${path}`);
174
191
  }
175
- return Ed25519PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));
176
- }
177
-
178
- /**
179
- * A private inner function so we can separate from the main fromDerivationPath() method
180
- * to add tests to verify we create the keys correctly.
181
- *
182
- * @param path the BIP44 path
183
- * @param seed the seed phrase created by the mnemonics
184
- * @param offset the offset used for key derivation, defaults to 0x80000000
185
- * @returns
186
- */
187
- private static fromDerivationPathInner(path: string, seed: Uint8Array, offset = HARDENED_OFFSET): Ed25519PrivateKey {
188
- const { key, chainCode } = deriveKey(Ed25519PrivateKey.SLIP_0010_SEED, seed);
189
-
190
- const segments = splitPath(path).map((el) => parseInt(el, 10));
191
-
192
- // Derive the child key based on the path
193
- const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {
194
- key,
195
- chainCode,
196
- });
197
- return new Ed25519PrivateKey(privateKey);
192
+ return new Ed25519PrivateKey(fromDerivationPathInner(path, Ed25519PrivateKey.SLIP_0010_SEED, mnemonicToSeed(mnemonics)));
198
193
  }
199
194
 
200
195
  // endregion
@@ -207,7 +202,7 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
207
202
  * @returns Ed25519PublicKey
208
203
  */
209
204
  publicKey(): Ed25519PublicKey {
210
- const bytes = this.signingKeyPair.publicKey;
205
+ const bytes = ed25519.getPublicKey(this.signingKey.toUint8Array());
211
206
  return new Ed25519PublicKey(bytes);
212
207
  }
213
208
 
@@ -220,7 +215,7 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
220
215
  sign(message: HexInput): Ed25519Signature {
221
216
  const messageToSign = convertSigningMessage(message);
222
217
  const messageBytes = Hex.fromHexInput(messageToSign).toUint8Array();
223
- const signatureBytes = nacl.sign.detached(messageBytes, this.signingKeyPair.secretKey);
218
+ const signatureBytes = ed25519.sign(messageBytes, this.signingKey.toUint8Array());
224
219
  return new Ed25519Signature(signatureBytes);
225
220
  }
226
221
 
@@ -230,7 +225,7 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
230
225
  * @returns Uint8Array representation of the private key
231
226
  */
232
227
  toUint8Array(): Uint8Array {
233
- return this.signingKeyPair.secretKey.slice(0, Ed25519PrivateKey.LENGTH);
228
+ return this.signingKey.toUint8Array();
234
229
  }
235
230
 
236
231
  /**
@@ -239,7 +234,7 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
239
234
  * @returns string representation of the private key
240
235
  */
241
236
  toString(): string {
242
- return Hex.fromHexInput(this.toUint8Array()).toString();
237
+ return this.signingKey.toString();
243
238
  }
244
239
 
245
240
  // endregion
@@ -312,5 +307,26 @@ export class Ed25519Signature extends Signature {
312
307
  return new Ed25519Signature(bytes);
313
308
  }
314
309
 
310
+ /**
311
+ * Checks if an ED25519 signature is non-canonical.
312
+ *
313
+ * Comes from Aptos Core
314
+ * https://github.com/aptos-labs/aptos-core/blob/main/crates/aptos-crypto/src/ed25519/ed25519_sigs.rs#L47-L85
315
+ */
316
+ isCanonicalSignature(): boolean {
317
+ const s = this.toUint8Array().slice(32);
318
+
319
+ for (let i = s.length - 1; i >= 0; i -= 1) {
320
+ if (s[i] < L[i]) {
321
+ return true;
322
+ }
323
+ if (s[i] > L[i]) {
324
+ return false;
325
+ }
326
+ }
327
+ // As this stage S == L which implies a non-canonical S.
328
+ return false;
329
+ }
330
+
315
331
  // endregion
316
332
  }
@@ -0,0 +1,147 @@
1
+ import { Serializer, Deserializer } from "../../bcs";
2
+ import { EphemeralPublicKeyVariant, EphemeralSignatureVariant, HexInput } from "../../types";
3
+ import { PublicKey } from "./publicKey";
4
+ import { Signature } from "./signature";
5
+ import { Ed25519PublicKey, Ed25519Signature } from "./ed25519";
6
+ import { Hex } from "../hex";
7
+
8
+ /**
9
+ * Represents ephemeral keys and signatures for Aptos Keyless accounts.
10
+ *
11
+ * TODO
12
+ */
13
+ export class EphemeralPublicKey extends PublicKey {
14
+ /**
15
+ * Reference to the inner public key
16
+ */
17
+ public readonly publicKey: PublicKey;
18
+
19
+ constructor(publicKey: PublicKey) {
20
+ super();
21
+ const publicKeyType = publicKey.constructor.name;
22
+ switch (publicKeyType) {
23
+ case Ed25519PublicKey.name:
24
+ this.publicKey = publicKey;
25
+ break;
26
+ default:
27
+ throw new Error(`Unsupported key for EphemeralPublicKey - ${publicKeyType}`);
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Get the public key in bytes (Uint8Array).
33
+ *
34
+ * @returns Uint8Array representation of the public key
35
+ */
36
+ toUint8Array(): Uint8Array {
37
+ return this.bcsToBytes();
38
+ }
39
+
40
+ /**
41
+ * Get the public key as a hex string with the 0x prefix.
42
+ *
43
+ * @returns string representation of the public key
44
+ */
45
+ toString(): string {
46
+ return this.bcsToHex().toString()
47
+ }
48
+
49
+ /**
50
+ * Verifies a signed data with a public key
51
+ *
52
+ * @param args.message message
53
+ * @param args.signature The signature
54
+ * @returns true if the signature is valid
55
+ */
56
+ verifySignature(args: { message: HexInput; signature: EphemeralSignature }): boolean {
57
+ const { message, signature } = args;
58
+ return this.publicKey.verifySignature({ message, signature });
59
+ }
60
+
61
+ serialize(serializer: Serializer): void {
62
+ if (this.publicKey instanceof Ed25519PublicKey) {
63
+ serializer.serializeU32AsUleb128(EphemeralPublicKeyVariant.Ed25519);
64
+ this.publicKey.serialize(serializer);
65
+ } else {
66
+ throw new Error("Unknown public key type");
67
+ }
68
+ }
69
+
70
+ static deserialize(deserializer: Deserializer): EphemeralPublicKey {
71
+ const index = deserializer.deserializeUleb128AsU32();
72
+ switch (index) {
73
+ case EphemeralPublicKeyVariant.Ed25519:
74
+ return new EphemeralPublicKey(Ed25519PublicKey.deserialize(deserializer));
75
+ default:
76
+ throw new Error(`Unknown variant index for EphemeralPublicKey: ${index}`);
77
+ }
78
+ }
79
+
80
+ static isPublicKey(publicKey: PublicKey): publicKey is EphemeralPublicKey {
81
+ return publicKey instanceof EphemeralPublicKey;
82
+ }
83
+
84
+ isEd25519(): this is Ed25519PublicKey {
85
+ return this.publicKey instanceof Ed25519PublicKey;
86
+ }
87
+ }
88
+
89
+
90
+ export class EphemeralSignature extends Signature {
91
+ public readonly signature: Signature;
92
+
93
+ constructor(signature: Signature) {
94
+ super();
95
+ const signatureType = signature.constructor.name;
96
+ switch (signatureType) {
97
+ case Ed25519Signature.name:
98
+ this.signature = signature;
99
+ break;
100
+ default:
101
+ throw new Error(`Unsupported signature for EphemeralSignature - ${signatureType}`);
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Get the public key in bytes (Uint8Array).
107
+ *
108
+ * @returns Uint8Array representation of the public key
109
+ */
110
+ toUint8Array(): Uint8Array {
111
+ return this.signature.toUint8Array();
112
+ }
113
+
114
+ /**
115
+ * Get the public key as a hex string with the 0x prefix.
116
+ *
117
+ * @returns string representation of the public key
118
+ */
119
+ toString(): string {
120
+ return this.signature.toString();
121
+ }
122
+
123
+ static fromHex(hexInput: HexInput): EphemeralSignature {
124
+ const data = Hex.fromHexInput(hexInput);
125
+ const deserializer = new Deserializer(data.toUint8Array());
126
+ return EphemeralSignature.deserialize(deserializer);
127
+ }
128
+
129
+ serialize(serializer: Serializer): void {
130
+ if (this.signature instanceof Ed25519Signature) {
131
+ serializer.serializeU32AsUleb128(EphemeralSignatureVariant.Ed25519);
132
+ this.signature.serialize(serializer);
133
+ } else {
134
+ throw new Error("Unknown signature type");
135
+ }
136
+ }
137
+
138
+ static deserialize(deserializer: Deserializer): EphemeralSignature {
139
+ const index = deserializer.deserializeUleb128AsU32();
140
+ switch (index) {
141
+ case EphemeralSignatureVariant.Ed25519:
142
+ return new EphemeralSignature(Ed25519Signature.deserialize(deserializer));
143
+ default:
144
+ throw new Error(`Unknown variant index for EphemeralSignature: ${index}`);
145
+ }
146
+ }
147
+ }
@@ -4,6 +4,7 @@
4
4
  import { hmac } from "@noble/hashes/hmac";
5
5
  import { sha512 } from "@noble/hashes/sha512";
6
6
  import * as bip39 from "@scure/bip39";
7
+ import { HexInput } from "../../types";
7
8
 
8
9
  export type DerivedKeys = {
9
10
  key: Uint8Array;
@@ -15,6 +16,7 @@ export type DerivedKeys = {
15
16
  */
16
17
  export const APTOS_HARDENED_REGEX = /^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/;
17
18
  export const APTOS_BIP44_REGEX = /^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/;
19
+ export const APTOS_BIP44_DEFAULT_DERIVATION_PATH = "m/44'/637'/0'/0'/0'";
18
20
 
19
21
  /**
20
22
  * A list of supported key types and associated seeds
@@ -91,6 +93,35 @@ const removeApostrophes = (val: string): string => val.replace("'", "");
91
93
  */
92
94
  export const splitPath = (path: string): Array<string> => path.split("/").slice(1).map(removeApostrophes);
93
95
 
96
+ /**
97
+ * @param path the BIP44 path
98
+ * @param seed the seed phrase created by the mnemonics
99
+ * @param offset the offset used for key derivation, defaults to 0x80000000
100
+ * @returns
101
+ */
102
+ export function fromDerivationPath(
103
+ path: string,
104
+ hashSeed: HexInput,
105
+ seed: Uint8Array,
106
+ offset = HARDENED_OFFSET,
107
+ ): Uint8Array {
108
+ if (offset === HARDENED_OFFSET && !isValidHardenedPath(path)) {
109
+ throw new Error(`Invalid hardened derivation path ${path}`);
110
+ } else if (offset !== HARDENED_OFFSET && !isValidBIP44Path(path)) {
111
+ throw new Error(`Invalid derivation path ${path}`);
112
+ }
113
+ const { key, chainCode } = deriveKey(hashSeed, seed);
114
+
115
+ const segments = splitPath(path).map((el) => parseInt(el, 10));
116
+
117
+ // Derive the child key based on the path
118
+ const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {
119
+ key,
120
+ chainCode,
121
+ });
122
+ return privateKey;
123
+ }
124
+
94
125
  /**
95
126
  * Normalizes the mnemonic by removing extra whitespace and making it lowercase
96
127
  * @param mnemonic the mnemonic seed phrase
@@ -5,6 +5,8 @@ export * from "./ed25519";
5
5
  export * from "./hdKey";
6
6
  export * from "./multiEd25519";
7
7
  export * from "./multiKey";
8
+ export * from "./ephemeral";
9
+ export * from "./keyless";
8
10
  export * from "./privateKey";
9
11
  export * from "./publicKey";
10
12
  export * from "./secp256k1";