@aptos-labs/ts-sdk 1.30.0 → 1.32.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 (549) hide show
  1. package/README.md +1 -1
  2. package/dist/common/{accountAddress-DnSqjhSl.d.ts → accountAddress-6RqI8Aam.d.ts} +144 -63
  3. package/dist/common/chunk-F43XVDYJ.js +2 -0
  4. package/dist/common/chunk-F43XVDYJ.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +1 -1
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +546 -112
  9. package/dist/common/index.js +37 -28
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/{Ed25519Account-DpH9qAcg.d.mts → Ed25519Account-B3xHXAQe.d.mts} +2 -2
  12. package/dist/esm/account/AbstractKeylessAccount.d.mts +86 -14
  13. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  14. package/dist/esm/account/Account.d.mts +5 -4
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/Ed25519Account.d.mts +5 -4
  17. package/dist/esm/account/Ed25519Account.mjs +1 -1
  18. package/dist/esm/account/EphemeralKeyPair.d.mts +4 -3
  19. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  20. package/dist/esm/account/FederatedKeylessAccount.d.mts +57 -8
  21. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  22. package/dist/esm/account/KeylessAccount.d.mts +29 -11
  23. package/dist/esm/account/KeylessAccount.mjs +1 -1
  24. package/dist/esm/account/MultiKeyAccount.d.mts +23 -10
  25. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  26. package/dist/esm/account/SingleKeyAccount.d.mts +5 -4
  27. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  28. package/dist/esm/account/index.d.mts +6 -5
  29. package/dist/esm/account/index.mjs +1 -1
  30. package/dist/esm/api/account.d.mts +9 -6
  31. package/dist/esm/api/account.mjs +1 -1
  32. package/dist/esm/api/ans.d.mts +4 -3
  33. package/dist/esm/api/ans.mjs +1 -1
  34. package/dist/esm/api/aptos.d.mts +6 -4
  35. package/dist/esm/api/aptos.mjs +1 -1
  36. package/dist/esm/api/aptosConfig.d.mts +2 -1
  37. package/dist/esm/api/coin.d.mts +6 -5
  38. package/dist/esm/api/coin.mjs +1 -1
  39. package/dist/esm/api/digitalAsset.d.mts +7 -6
  40. package/dist/esm/api/digitalAsset.mjs +1 -1
  41. package/dist/esm/api/event.d.mts +4 -3
  42. package/dist/esm/api/event.mjs +1 -1
  43. package/dist/esm/api/faucet.d.mts +3 -2
  44. package/dist/esm/api/faucet.mjs +1 -1
  45. package/dist/esm/api/fungibleAsset.d.mts +6 -5
  46. package/dist/esm/api/fungibleAsset.mjs +1 -1
  47. package/dist/esm/api/general.d.mts +6 -5
  48. package/dist/esm/api/general.mjs +1 -1
  49. package/dist/esm/api/index.d.mts +6 -4
  50. package/dist/esm/api/index.mjs +1 -1
  51. package/dist/esm/api/keyless.d.mts +11 -9
  52. package/dist/esm/api/keyless.mjs +1 -1
  53. package/dist/esm/api/object.d.mts +5 -4
  54. package/dist/esm/api/object.mjs +1 -1
  55. package/dist/esm/api/staking.d.mts +5 -4
  56. package/dist/esm/api/staking.mjs +1 -1
  57. package/dist/esm/api/table.d.mts +4 -3
  58. package/dist/esm/api/table.mjs +1 -1
  59. package/dist/esm/api/transaction.d.mts +5 -3
  60. package/dist/esm/api/transaction.mjs +1 -1
  61. package/dist/esm/api/transactionSubmission/build.d.mts +69 -3
  62. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  63. package/dist/esm/api/transactionSubmission/management.d.mts +5 -4
  64. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  65. package/dist/esm/api/transactionSubmission/sign.d.mts +5 -4
  66. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  67. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  68. package/dist/esm/api/transactionSubmission/simulate.d.mts +4 -3
  69. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  70. package/dist/esm/api/transactionSubmission/submit.d.mts +4 -3
  71. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  72. package/dist/esm/api/utils.d.mts +3 -2
  73. package/dist/esm/api/utils.mjs +1 -1
  74. package/dist/esm/bcs/consts.d.mts +3 -2
  75. package/dist/esm/bcs/deserializer.d.mts +36 -27
  76. package/dist/esm/bcs/deserializer.mjs +1 -1
  77. package/dist/esm/bcs/index.d.mts +3 -2
  78. package/dist/esm/bcs/index.mjs +1 -1
  79. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +3 -2
  80. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  81. package/dist/esm/bcs/serializable/fixedBytes.d.mts +3 -2
  82. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  83. package/dist/esm/bcs/serializable/movePrimitives.d.mts +3 -2
  84. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  85. package/dist/esm/bcs/serializable/moveStructs.d.mts +12 -12
  86. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  87. package/dist/esm/bcs/serializer.d.mts +14 -13
  88. package/dist/esm/bcs/serializer.mjs +1 -1
  89. package/dist/esm/{chunk-OV5UQ75K.mjs → chunk-2NHQQQZK.mjs} +2 -2
  90. package/dist/esm/{chunk-EF2PUPUH.mjs → chunk-2QBCTW67.mjs} +2 -2
  91. package/dist/esm/chunk-2QBCTW67.mjs.map +1 -0
  92. package/dist/esm/{chunk-JY3JJ55D.mjs → chunk-37Y54PJ5.mjs} +2 -2
  93. package/dist/esm/chunk-3DQVGPFE.mjs +2 -0
  94. package/dist/esm/chunk-3DQVGPFE.mjs.map +1 -0
  95. package/dist/esm/{chunk-XHCALZ7X.mjs → chunk-3XCYCFYI.mjs} +2 -2
  96. package/dist/esm/{chunk-6FLHGOKP.mjs → chunk-42H7WETG.mjs} +2 -2
  97. package/dist/esm/{chunk-RNAKZVRN.mjs → chunk-46L6BAJG.mjs} +2 -2
  98. package/dist/esm/{chunk-EN2HDNFE.mjs → chunk-4DNCQM3S.mjs} +2 -2
  99. package/dist/esm/chunk-4O5XDQDO.mjs +2 -0
  100. package/dist/esm/chunk-4PBXTMN3.mjs +2 -0
  101. package/dist/esm/chunk-4PBXTMN3.mjs.map +1 -0
  102. package/dist/esm/chunk-4YEOOZ2N.mjs +4 -0
  103. package/dist/esm/{chunk-KFSVKIFO.mjs.map → chunk-4YEOOZ2N.mjs.map} +1 -1
  104. package/dist/esm/{chunk-D3KBNFZR.mjs → chunk-5AKSORBJ.mjs} +2 -2
  105. package/dist/esm/chunk-5B3SMBXQ.mjs +2 -0
  106. package/dist/esm/{chunk-EKZQ3EYX.mjs → chunk-5NJWJXSS.mjs} +2 -2
  107. package/dist/esm/{chunk-2QRWGJJA.mjs → chunk-6K4TOFCO.mjs} +2 -2
  108. package/dist/esm/{chunk-OLPI7QAH.mjs → chunk-6LLGRGCN.mjs} +2 -2
  109. package/dist/esm/chunk-6LLGRGCN.mjs.map +1 -0
  110. package/dist/esm/{chunk-R3Y6WH2U.mjs → chunk-6PJH53CK.mjs} +2 -2
  111. package/dist/esm/{chunk-PCLU4KLY.mjs → chunk-6ZOVTYLJ.mjs} +2 -2
  112. package/dist/esm/chunk-7ECCT6PK.mjs +1 -0
  113. package/dist/esm/chunk-7WXDXBXK.mjs +2 -0
  114. package/dist/esm/{chunk-UKAXCARD.mjs.map → chunk-7WXDXBXK.mjs.map} +1 -1
  115. package/dist/esm/{chunk-JNHFQTFC.mjs → chunk-AAATWCJT.mjs} +2 -2
  116. package/dist/esm/{chunk-NODYW7DM.mjs → chunk-ACVIE7IE.mjs} +2 -2
  117. package/dist/esm/chunk-AHWZA3GD.mjs +2 -0
  118. package/dist/esm/chunk-AHWZA3GD.mjs.map +1 -0
  119. package/dist/esm/chunk-AITN3DO4.mjs +2 -0
  120. package/dist/esm/chunk-AITN3DO4.mjs.map +1 -0
  121. package/dist/esm/{chunk-QQIVWB6G.mjs → chunk-AJ5JHBAE.mjs} +2 -2
  122. package/dist/esm/{chunk-QQIVWB6G.mjs.map → chunk-AJ5JHBAE.mjs.map} +1 -1
  123. package/dist/esm/{chunk-PRZ7AIGA.mjs → chunk-AKIO3OIT.mjs} +2 -2
  124. package/dist/esm/chunk-AMCJQIOT.mjs +2 -0
  125. package/dist/esm/{chunk-UI3AKMZX.mjs.map → chunk-AMCJQIOT.mjs.map} +1 -1
  126. package/dist/esm/{chunk-KRVLR3L4.mjs → chunk-AOROYJ74.mjs} +2 -2
  127. package/dist/esm/chunk-AVPQOD67.mjs +2 -0
  128. package/dist/esm/chunk-AVPQOD67.mjs.map +1 -0
  129. package/dist/esm/chunk-AVZYJAXR.mjs +2 -0
  130. package/dist/esm/chunk-AVZYJAXR.mjs.map +1 -0
  131. package/dist/esm/{chunk-6AGTDRNM.mjs → chunk-BLLHTGAP.mjs} +2 -2
  132. package/dist/esm/{chunk-JGNMNCQB.mjs → chunk-BRV3RLKW.mjs} +2 -2
  133. package/dist/esm/{chunk-GIQQF2PD.mjs → chunk-CA3Q2X6B.mjs} +2 -2
  134. package/dist/esm/chunk-D52UKPQF.mjs +2 -0
  135. package/dist/esm/chunk-D52UKPQF.mjs.map +1 -0
  136. package/dist/esm/{chunk-FPF4KZ5M.mjs → chunk-DDVOBEJA.mjs} +2 -2
  137. package/dist/esm/chunk-DDVOBEJA.mjs.map +1 -0
  138. package/dist/esm/{chunk-QRTZYRH2.mjs → chunk-DP3YPGIK.mjs} +2 -2
  139. package/dist/esm/{chunk-DXQT55L3.mjs → chunk-DSKAMBBL.mjs} +2 -2
  140. package/dist/esm/{chunk-RAXP3STS.mjs → chunk-E2NYQVP3.mjs} +2 -2
  141. package/dist/esm/chunk-EEB7EZFO.mjs +2 -0
  142. package/dist/esm/chunk-EEB7EZFO.mjs.map +1 -0
  143. package/dist/esm/{chunk-WUCPTRXU.mjs → chunk-F2AIWA7L.mjs} +2 -2
  144. package/dist/esm/chunk-F45G3GP3.mjs +7 -0
  145. package/dist/esm/chunk-F45G3GP3.mjs.map +1 -0
  146. package/dist/esm/{chunk-VQTEGTUQ.mjs → chunk-FXUI3SSD.mjs} +2 -2
  147. package/dist/esm/chunk-G2GN4LH5.mjs +2 -0
  148. package/dist/esm/chunk-G2GN4LH5.mjs.map +1 -0
  149. package/dist/esm/chunk-GBVRCWCD.mjs +2 -0
  150. package/dist/esm/chunk-GBVRCWCD.mjs.map +1 -0
  151. package/dist/esm/chunk-H457BI3I.mjs +2 -0
  152. package/dist/esm/chunk-H457BI3I.mjs.map +1 -0
  153. package/dist/esm/{chunk-5AAFF2PV.mjs → chunk-HEHVWRMO.mjs} +2 -2
  154. package/dist/esm/{chunk-ZUTOMGB7.mjs → chunk-HFWFDS6Y.mjs} +2 -2
  155. package/dist/esm/{chunk-QBWGWHJK.mjs → chunk-HXXELLHN.mjs} +2 -2
  156. package/dist/esm/{chunk-LD5MUWGW.mjs → chunk-IBMZYDAR.mjs} +2 -2
  157. package/dist/esm/{chunk-QBP4XJT5.mjs → chunk-IDNDUJOK.mjs} +2 -2
  158. package/dist/esm/{chunk-HCV3NGLS.mjs → chunk-II654QZU.mjs} +2 -2
  159. package/dist/esm/{chunk-XIY2VORC.mjs → chunk-JDNI5VIJ.mjs} +2 -2
  160. package/dist/esm/{chunk-HAMXSLWF.mjs → chunk-JJUINAQE.mjs} +2 -2
  161. package/dist/esm/{chunk-K6MZXKVV.mjs → chunk-JLD7DLKM.mjs} +2 -2
  162. package/dist/esm/chunk-JNO7KPMG.mjs +4 -0
  163. package/dist/esm/chunk-JNO7KPMG.mjs.map +1 -0
  164. package/dist/esm/chunk-K4TJRYGQ.mjs +2 -0
  165. package/dist/esm/chunk-K4TJRYGQ.mjs.map +1 -0
  166. package/dist/esm/{chunk-NV6DHDM3.mjs → chunk-KA5FX53Q.mjs} +2 -2
  167. package/dist/esm/{chunk-CRL4WGOH.mjs → chunk-KT3DT5GV.mjs} +2 -2
  168. package/dist/esm/chunk-KT3DT5GV.mjs.map +1 -0
  169. package/dist/esm/chunk-KUL55M2H.mjs +2 -0
  170. package/dist/esm/chunk-KUL55M2H.mjs.map +1 -0
  171. package/dist/esm/{chunk-JDYASF3E.mjs → chunk-L2QVUMBV.mjs} +2 -2
  172. package/dist/esm/chunk-L2SDI7PI.mjs +2 -0
  173. package/dist/esm/chunk-L2SDI7PI.mjs.map +1 -0
  174. package/dist/esm/chunk-L56DQ4N3.mjs +2 -0
  175. package/dist/esm/chunk-L56DQ4N3.mjs.map +1 -0
  176. package/dist/esm/{chunk-S3FVA55H.mjs → chunk-LAAFLCDM.mjs} +2 -2
  177. package/dist/esm/{chunk-AGBA3Y7A.mjs → chunk-LGTOOAQI.mjs} +2 -2
  178. package/dist/esm/chunk-MHN6XY4Z.mjs +2 -0
  179. package/dist/esm/{chunk-PHG2IWZW.mjs → chunk-MOGPSSTD.mjs} +2 -2
  180. package/dist/esm/{chunk-KSKQVOBA.mjs → chunk-NARS3JDH.mjs} +2 -2
  181. package/dist/esm/{chunk-KSUZS6EL.mjs → chunk-NHKAQRJB.mjs} +2 -2
  182. package/dist/esm/{chunk-PHP47DI4.mjs → chunk-OIOGOW6I.mjs} +1 -1
  183. package/dist/esm/{chunk-PHP47DI4.mjs.map → chunk-OIOGOW6I.mjs.map} +1 -1
  184. package/dist/esm/{chunk-DCUVV3VY.mjs → chunk-OJBMR5CT.mjs} +2 -2
  185. package/dist/esm/chunk-OJBMR5CT.mjs.map +1 -0
  186. package/dist/esm/{chunk-TIZL5YVP.mjs → chunk-OKE3FXIP.mjs} +2 -2
  187. package/dist/esm/chunk-ONFKJ57C.mjs +2 -0
  188. package/dist/esm/chunk-ONFKJ57C.mjs.map +1 -0
  189. package/dist/esm/{chunk-ZINOJTLU.mjs → chunk-OPO5EYF7.mjs} +2 -2
  190. package/dist/esm/{chunk-HDTKBFRX.mjs → chunk-PW3ISXPN.mjs} +2 -2
  191. package/dist/esm/{chunk-WIXNX7HY.mjs → chunk-QQM47PHZ.mjs} +2 -2
  192. package/dist/esm/{chunk-5XXIIWG7.mjs → chunk-SBCLBDCP.mjs} +2 -2
  193. package/dist/esm/chunk-SPRNSFUV.mjs +2 -0
  194. package/dist/esm/chunk-SPRNSFUV.mjs.map +1 -0
  195. package/dist/esm/{chunk-Z36WHOZV.mjs → chunk-SU2WB34N.mjs} +2 -2
  196. package/dist/esm/{chunk-OTY3NO7Q.mjs → chunk-T6ADNZE5.mjs} +2 -2
  197. package/dist/esm/{chunk-IECDO22V.mjs → chunk-TM7OZT3W.mjs} +2 -2
  198. package/dist/esm/chunk-TM7OZT3W.mjs.map +1 -0
  199. package/dist/esm/chunk-UGTIALNW.mjs +2 -0
  200. package/dist/esm/chunk-UIRAXHDH.mjs +1 -0
  201. package/dist/esm/chunk-UZTJWOLS.mjs +2 -0
  202. package/dist/esm/chunk-V4FKFCBL.mjs +2 -0
  203. package/dist/esm/chunk-V4FKFCBL.mjs.map +1 -0
  204. package/dist/esm/{chunk-7V6RL27I.mjs → chunk-VCY3JGZM.mjs} +2 -2
  205. package/dist/esm/{chunk-XOCRDV2V.mjs → chunk-VQZMI3EZ.mjs} +2 -2
  206. package/dist/esm/chunk-WGIYSLH6.mjs +2 -0
  207. package/dist/esm/chunk-WGIYSLH6.mjs.map +1 -0
  208. package/dist/esm/{chunk-WOOH5MMX.mjs → chunk-WKNX43KN.mjs} +2 -2
  209. package/dist/esm/chunk-WKNX43KN.mjs.map +1 -0
  210. package/dist/esm/chunk-WQF3IOXC.mjs +2 -0
  211. package/dist/esm/chunk-WQF3IOXC.mjs.map +1 -0
  212. package/dist/esm/{chunk-N3OYD6VZ.mjs → chunk-WSFHH3BK.mjs} +2 -2
  213. package/dist/esm/{chunk-7PVIWKGT.mjs → chunk-X3JPX7T6.mjs} +2 -2
  214. package/dist/esm/{chunk-HGVZ7ULA.mjs → chunk-XKOSS5KC.mjs} +2 -2
  215. package/dist/esm/{chunk-TRU3EK64.mjs → chunk-XT5T5LAP.mjs} +2 -2
  216. package/dist/esm/chunk-XUP6VABV.mjs +2 -0
  217. package/dist/esm/chunk-XUP6VABV.mjs.map +1 -0
  218. package/dist/esm/{chunk-FO4F3OJJ.mjs → chunk-YNT7JHMS.mjs} +2 -2
  219. package/dist/esm/{chunk-37UZKMJI.mjs → chunk-YPBNYKOD.mjs} +2 -2
  220. package/dist/esm/{chunk-IFHQSZLK.mjs → chunk-YZ3YPLEU.mjs} +2 -2
  221. package/dist/esm/{chunk-OZN3OOJV.mjs → chunk-ZMBXHMVQ.mjs} +2 -2
  222. package/dist/esm/{chunk-BQXVHY7J.mjs → chunk-ZRWZIAF5.mjs} +2 -2
  223. package/dist/esm/cli/index.d.mts +3 -2
  224. package/dist/esm/cli/index.mjs +1 -1
  225. package/dist/esm/cli/localNode.mjs +1 -1
  226. package/dist/esm/cli/move.d.mts +2 -1
  227. package/dist/esm/cli/move.mjs +1 -1
  228. package/dist/esm/client/core.d.mts +2 -2
  229. package/dist/esm/client/core.mjs +1 -1
  230. package/dist/esm/client/get.d.mts +2 -2
  231. package/dist/esm/client/get.mjs +1 -1
  232. package/dist/esm/client/index.d.mts +3 -3
  233. package/dist/esm/client/index.mjs +1 -1
  234. package/dist/esm/client/post.d.mts +2 -2
  235. package/dist/esm/client/post.mjs +1 -1
  236. package/dist/esm/core/account/index.d.mts +3 -2
  237. package/dist/esm/core/account/index.mjs +1 -1
  238. package/dist/esm/core/account/utils/address.d.mts +3 -2
  239. package/dist/esm/core/account/utils/address.mjs +1 -1
  240. package/dist/esm/core/account/utils/index.d.mts +3 -2
  241. package/dist/esm/core/account/utils/index.mjs +1 -1
  242. package/dist/esm/core/accountAddress.d.mts +20 -10
  243. package/dist/esm/core/accountAddress.mjs +1 -1
  244. package/dist/esm/core/authenticationKey.d.mts +4 -3
  245. package/dist/esm/core/authenticationKey.mjs +1 -1
  246. package/dist/esm/core/crypto/ed25519.d.mts +27 -12
  247. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  248. package/dist/esm/core/crypto/ephemeral.d.mts +4 -3
  249. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  250. package/dist/esm/core/crypto/federatedKeyless.d.mts +5 -4
  251. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  252. package/dist/esm/core/crypto/hdKey.d.mts +0 -1
  253. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  254. package/dist/esm/core/crypto/index.d.mts +5 -4
  255. package/dist/esm/core/crypto/index.mjs +1 -1
  256. package/dist/esm/core/crypto/keyless.d.mts +73 -11
  257. package/dist/esm/core/crypto/keyless.mjs +1 -1
  258. package/dist/esm/core/crypto/multiEd25519.d.mts +4 -3
  259. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  260. package/dist/esm/core/crypto/multiKey.d.mts +4 -3
  261. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  262. package/dist/esm/core/crypto/privateKey.d.mts +38 -10
  263. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  264. package/dist/esm/core/crypto/proof.d.mts +3 -2
  265. package/dist/esm/core/crypto/proof.mjs +1 -1
  266. package/dist/esm/core/crypto/publicKey.d.mts +4 -3
  267. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  268. package/dist/esm/core/crypto/secp256k1.d.mts +24 -9
  269. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  270. package/dist/esm/core/crypto/signature.d.mts +3 -2
  271. package/dist/esm/core/crypto/signature.mjs +1 -1
  272. package/dist/esm/core/crypto/singleKey.d.mts +4 -3
  273. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  274. package/dist/esm/core/crypto/utils.d.mts +3 -2
  275. package/dist/esm/core/crypto/utils.mjs +1 -1
  276. package/dist/esm/core/hex.d.mts +40 -3
  277. package/dist/esm/core/hex.mjs +1 -1
  278. package/dist/esm/core/index.d.mts +6 -5
  279. package/dist/esm/core/index.mjs +1 -1
  280. package/dist/esm/errors/index.d.mts +123 -0
  281. package/dist/esm/errors/index.mjs +2 -0
  282. package/dist/esm/index.d.mts +13 -11
  283. package/dist/esm/index.mjs +1 -1
  284. package/dist/esm/internal/account.d.mts +5 -4
  285. package/dist/esm/internal/account.mjs +1 -1
  286. package/dist/esm/internal/ans.d.mts +5 -4
  287. package/dist/esm/internal/ans.mjs +1 -1
  288. package/dist/esm/internal/coin.d.mts +3 -2
  289. package/dist/esm/internal/coin.mjs +1 -1
  290. package/dist/esm/internal/digitalAsset.d.mts +5 -4
  291. package/dist/esm/internal/digitalAsset.mjs +1 -1
  292. package/dist/esm/internal/event.d.mts +3 -2
  293. package/dist/esm/internal/event.mjs +1 -1
  294. package/dist/esm/internal/faucet.d.mts +2 -1
  295. package/dist/esm/internal/faucet.mjs +1 -1
  296. package/dist/esm/internal/fungibleAsset.d.mts +5 -4
  297. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  298. package/dist/esm/internal/general.d.mts +3 -2
  299. package/dist/esm/internal/general.mjs +1 -1
  300. package/dist/esm/internal/keyless.d.mts +13 -7
  301. package/dist/esm/internal/keyless.mjs +1 -1
  302. package/dist/esm/internal/object.d.mts +3 -2
  303. package/dist/esm/internal/object.mjs +1 -1
  304. package/dist/esm/internal/staking.d.mts +2 -1
  305. package/dist/esm/internal/staking.mjs +1 -1
  306. package/dist/esm/internal/table.d.mts +3 -2
  307. package/dist/esm/internal/table.mjs +1 -1
  308. package/dist/esm/internal/transaction.d.mts +2 -1
  309. package/dist/esm/internal/transaction.mjs +1 -1
  310. package/dist/esm/internal/transactionSubmission.d.mts +4 -3
  311. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  312. package/dist/esm/internal/view.d.mts +4 -3
  313. package/dist/esm/internal/view.mjs +1 -1
  314. package/dist/esm/{publicKey-_tPa99ea.d.mts → publicKey-BVXX1nVl.d.mts} +2 -2
  315. package/dist/esm/transactions/authenticator/account.d.mts +4 -3
  316. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  317. package/dist/esm/transactions/authenticator/index.d.mts +4 -3
  318. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  319. package/dist/esm/transactions/authenticator/transaction.d.mts +10 -4
  320. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  321. package/dist/esm/transactions/index.d.mts +7 -5
  322. package/dist/esm/transactions/index.mjs +1 -1
  323. package/dist/esm/transactions/instances/chainId.d.mts +3 -2
  324. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  325. package/dist/esm/transactions/instances/identifier.d.mts +3 -2
  326. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  327. package/dist/esm/transactions/instances/index.d.mts +4 -3
  328. package/dist/esm/transactions/instances/index.mjs +1 -1
  329. package/dist/esm/transactions/instances/moduleId.d.mts +3 -2
  330. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  331. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +3 -2
  332. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  333. package/dist/esm/transactions/instances/rawTransaction.d.mts +3 -2
  334. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  335. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +4 -3
  336. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  337. package/dist/esm/transactions/instances/signedTransaction.d.mts +4 -3
  338. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  339. package/dist/esm/transactions/instances/simpleTransaction.d.mts +3 -2
  340. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  341. package/dist/esm/transactions/instances/transactionArgument.d.mts +3 -2
  342. package/dist/esm/transactions/instances/transactionPayload.d.mts +3 -2
  343. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  344. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +5 -4
  345. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  346. package/dist/esm/transactions/management/index.d.mts +5 -4
  347. package/dist/esm/transactions/management/index.mjs +1 -1
  348. package/dist/esm/transactions/management/transactionWorker.d.mts +5 -4
  349. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  350. package/dist/esm/transactions/script-composer/index.d.mts +44 -0
  351. package/dist/esm/transactions/script-composer/index.mjs +2 -0
  352. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -2
  353. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  354. package/dist/esm/transactions/transactionBuilder/index.d.mts +5 -4
  355. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  356. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +26 -5
  357. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  358. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +4 -3
  359. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  360. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +4 -3
  361. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  362. package/dist/esm/transactions/typeTag/index.d.mts +3 -2
  363. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  364. package/dist/esm/transactions/typeTag/parser.d.mts +3 -2
  365. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  366. package/dist/esm/transactions/types.d.mts +12 -3
  367. package/dist/esm/types/index.d.mts +4 -1260
  368. package/dist/esm/types/index.mjs +1 -1
  369. package/dist/esm/types/keyless.d.mts +22 -1
  370. package/dist/esm/types/types.d.mts +1290 -0
  371. package/dist/esm/types/types.mjs +2 -0
  372. package/dist/esm/types/types.mjs.map +1 -0
  373. package/dist/esm/utils/helpers.d.mts +11 -3
  374. package/dist/esm/utils/helpers.mjs +1 -1
  375. package/dist/esm/utils/index.d.mts +3 -2
  376. package/dist/esm/utils/index.mjs +1 -1
  377. package/dist/esm/utils/normalizeBundle.d.mts +3 -2
  378. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  379. package/dist/esm/version.d.mts +1 -1
  380. package/dist/esm/version.mjs +1 -1
  381. package/package.json +3 -2
  382. package/src/account/AbstractKeylessAccount.ts +203 -10
  383. package/src/account/FederatedKeylessAccount.ts +83 -35
  384. package/src/account/KeylessAccount.ts +44 -37
  385. package/src/account/MultiKeyAccount.ts +18 -5
  386. package/src/api/account.ts +12 -2
  387. package/src/api/keyless.ts +4 -3
  388. package/src/api/transactionSubmission/build.ts +82 -1
  389. package/src/bcs/deserializer.ts +53 -30
  390. package/src/bcs/serializable/moveStructs.ts +16 -17
  391. package/src/bcs/serializer.ts +22 -12
  392. package/src/cli/move.ts +20 -5
  393. package/src/client/core.ts +2 -2
  394. package/src/client/get.ts +1 -2
  395. package/src/client/index.ts +0 -1
  396. package/src/client/post.ts +1 -2
  397. package/src/core/accountAddress.ts +36 -9
  398. package/src/core/crypto/ed25519.ts +34 -14
  399. package/src/core/crypto/hdKey.ts +0 -1
  400. package/src/core/crypto/keyless.ts +245 -38
  401. package/src/core/crypto/privateKey.ts +81 -5
  402. package/src/core/crypto/secp256k1.ts +31 -11
  403. package/src/core/hex.ts +47 -0
  404. package/src/errors/index.ts +406 -0
  405. package/src/index.ts +1 -0
  406. package/src/internal/account.ts +6 -6
  407. package/src/internal/ans.ts +2 -1
  408. package/src/internal/keyless.ts +50 -20
  409. package/src/internal/transaction.ts +2 -1
  410. package/src/internal/transactionSubmission.ts +36 -18
  411. package/src/transactions/authenticator/transaction.ts +20 -0
  412. package/src/transactions/index.ts +1 -0
  413. package/src/transactions/script-composer/index.ts +76 -0
  414. package/src/transactions/transactionBuilder/remoteAbi.ts +55 -1
  415. package/src/transactions/types.ts +11 -0
  416. package/src/types/index.ts +2 -1483
  417. package/src/types/keyless.ts +19 -0
  418. package/src/types/types.ts +1512 -0
  419. package/src/utils/helpers.ts +10 -0
  420. package/src/version.ts +1 -1
  421. package/dist/common/chunk-7IYTZDXV.js +0 -2
  422. package/dist/common/chunk-7IYTZDXV.js.map +0 -1
  423. package/dist/esm/chunk-2I56E4T2.mjs +0 -2
  424. package/dist/esm/chunk-2I56E4T2.mjs.map +0 -1
  425. package/dist/esm/chunk-4CDDWSKZ.mjs +0 -2
  426. package/dist/esm/chunk-4OV7QU2U.mjs +0 -2
  427. package/dist/esm/chunk-5CCHECTE.mjs +0 -2
  428. package/dist/esm/chunk-5CCHECTE.mjs.map +0 -1
  429. package/dist/esm/chunk-5ZBHIUWG.mjs +0 -2
  430. package/dist/esm/chunk-5ZBHIUWG.mjs.map +0 -1
  431. package/dist/esm/chunk-7D3RY73L.mjs +0 -2
  432. package/dist/esm/chunk-7D3RY73L.mjs.map +0 -1
  433. package/dist/esm/chunk-7XS45O6M.mjs +0 -2
  434. package/dist/esm/chunk-7XS45O6M.mjs.map +0 -1
  435. package/dist/esm/chunk-CRL4WGOH.mjs.map +0 -1
  436. package/dist/esm/chunk-DCUVV3VY.mjs.map +0 -1
  437. package/dist/esm/chunk-DZJXOL64.mjs +0 -2
  438. package/dist/esm/chunk-DZJXOL64.mjs.map +0 -1
  439. package/dist/esm/chunk-EF2PUPUH.mjs.map +0 -1
  440. package/dist/esm/chunk-FPF4KZ5M.mjs.map +0 -1
  441. package/dist/esm/chunk-FY7TSOUU.mjs +0 -2
  442. package/dist/esm/chunk-FY7TSOUU.mjs.map +0 -1
  443. package/dist/esm/chunk-GPZRGLU2.mjs +0 -2
  444. package/dist/esm/chunk-GPZRGLU2.mjs.map +0 -1
  445. package/dist/esm/chunk-GQABU3RQ.mjs +0 -2
  446. package/dist/esm/chunk-GQABU3RQ.mjs.map +0 -1
  447. package/dist/esm/chunk-I5OYNCZS.mjs +0 -1
  448. package/dist/esm/chunk-IBLZ6MZU.mjs +0 -2
  449. package/dist/esm/chunk-IECDO22V.mjs.map +0 -1
  450. package/dist/esm/chunk-KFNDDPOW.mjs +0 -2
  451. package/dist/esm/chunk-KFNDDPOW.mjs.map +0 -1
  452. package/dist/esm/chunk-KFSVKIFO.mjs +0 -2
  453. package/dist/esm/chunk-KIW54KWR.mjs +0 -2
  454. package/dist/esm/chunk-KM6UXNC7.mjs +0 -2
  455. package/dist/esm/chunk-KM6UXNC7.mjs.map +0 -1
  456. package/dist/esm/chunk-KUX6GQ2E.mjs +0 -1
  457. package/dist/esm/chunk-L5I7F3NZ.mjs +0 -2
  458. package/dist/esm/chunk-L5I7F3NZ.mjs.map +0 -1
  459. package/dist/esm/chunk-LEKBJ2EG.mjs +0 -2
  460. package/dist/esm/chunk-LEKBJ2EG.mjs.map +0 -1
  461. package/dist/esm/chunk-LZS7BQ2B.mjs +0 -2
  462. package/dist/esm/chunk-LZS7BQ2B.mjs.map +0 -1
  463. package/dist/esm/chunk-N2FKVZ4D.mjs +0 -1
  464. package/dist/esm/chunk-N47FTRYO.mjs +0 -2
  465. package/dist/esm/chunk-N47FTRYO.mjs.map +0 -1
  466. package/dist/esm/chunk-OLPI7QAH.mjs.map +0 -1
  467. package/dist/esm/chunk-ONBFUPEC.mjs +0 -2
  468. package/dist/esm/chunk-OS2EG6AE.mjs +0 -2
  469. package/dist/esm/chunk-OS2EG6AE.mjs.map +0 -1
  470. package/dist/esm/chunk-PGZWRY7A.mjs +0 -2
  471. package/dist/esm/chunk-PGZWRY7A.mjs.map +0 -1
  472. package/dist/esm/chunk-RUDS7RSB.mjs +0 -2
  473. package/dist/esm/chunk-RUDS7RSB.mjs.map +0 -1
  474. package/dist/esm/chunk-UI3AKMZX.mjs +0 -2
  475. package/dist/esm/chunk-UKAXCARD.mjs +0 -2
  476. package/dist/esm/chunk-WOOH5MMX.mjs.map +0 -1
  477. package/dist/esm/chunk-WSVOJSAC.mjs +0 -2
  478. package/dist/esm/chunk-WSVOJSAC.mjs.map +0 -1
  479. package/dist/esm/chunk-ZS3EWM5A.mjs +0 -2
  480. package/dist/esm/chunk-ZS3EWM5A.mjs.map +0 -1
  481. package/dist/esm/client/types.d.mts +0 -66
  482. package/dist/esm/client/types.mjs +0 -2
  483. package/src/client/types.ts +0 -138
  484. /package/dist/esm/{chunk-OV5UQ75K.mjs.map → chunk-2NHQQQZK.mjs.map} +0 -0
  485. /package/dist/esm/{chunk-JY3JJ55D.mjs.map → chunk-37Y54PJ5.mjs.map} +0 -0
  486. /package/dist/esm/{chunk-XHCALZ7X.mjs.map → chunk-3XCYCFYI.mjs.map} +0 -0
  487. /package/dist/esm/{chunk-6FLHGOKP.mjs.map → chunk-42H7WETG.mjs.map} +0 -0
  488. /package/dist/esm/{chunk-RNAKZVRN.mjs.map → chunk-46L6BAJG.mjs.map} +0 -0
  489. /package/dist/esm/{chunk-EN2HDNFE.mjs.map → chunk-4DNCQM3S.mjs.map} +0 -0
  490. /package/dist/esm/{chunk-IBLZ6MZU.mjs.map → chunk-4O5XDQDO.mjs.map} +0 -0
  491. /package/dist/esm/{chunk-D3KBNFZR.mjs.map → chunk-5AKSORBJ.mjs.map} +0 -0
  492. /package/dist/esm/{chunk-KIW54KWR.mjs.map → chunk-5B3SMBXQ.mjs.map} +0 -0
  493. /package/dist/esm/{chunk-EKZQ3EYX.mjs.map → chunk-5NJWJXSS.mjs.map} +0 -0
  494. /package/dist/esm/{chunk-2QRWGJJA.mjs.map → chunk-6K4TOFCO.mjs.map} +0 -0
  495. /package/dist/esm/{chunk-R3Y6WH2U.mjs.map → chunk-6PJH53CK.mjs.map} +0 -0
  496. /package/dist/esm/{chunk-PCLU4KLY.mjs.map → chunk-6ZOVTYLJ.mjs.map} +0 -0
  497. /package/dist/esm/{chunk-I5OYNCZS.mjs.map → chunk-7ECCT6PK.mjs.map} +0 -0
  498. /package/dist/esm/{chunk-JNHFQTFC.mjs.map → chunk-AAATWCJT.mjs.map} +0 -0
  499. /package/dist/esm/{chunk-NODYW7DM.mjs.map → chunk-ACVIE7IE.mjs.map} +0 -0
  500. /package/dist/esm/{chunk-PRZ7AIGA.mjs.map → chunk-AKIO3OIT.mjs.map} +0 -0
  501. /package/dist/esm/{chunk-KRVLR3L4.mjs.map → chunk-AOROYJ74.mjs.map} +0 -0
  502. /package/dist/esm/{chunk-6AGTDRNM.mjs.map → chunk-BLLHTGAP.mjs.map} +0 -0
  503. /package/dist/esm/{chunk-JGNMNCQB.mjs.map → chunk-BRV3RLKW.mjs.map} +0 -0
  504. /package/dist/esm/{chunk-GIQQF2PD.mjs.map → chunk-CA3Q2X6B.mjs.map} +0 -0
  505. /package/dist/esm/{chunk-QRTZYRH2.mjs.map → chunk-DP3YPGIK.mjs.map} +0 -0
  506. /package/dist/esm/{chunk-DXQT55L3.mjs.map → chunk-DSKAMBBL.mjs.map} +0 -0
  507. /package/dist/esm/{chunk-RAXP3STS.mjs.map → chunk-E2NYQVP3.mjs.map} +0 -0
  508. /package/dist/esm/{chunk-WUCPTRXU.mjs.map → chunk-F2AIWA7L.mjs.map} +0 -0
  509. /package/dist/esm/{chunk-VQTEGTUQ.mjs.map → chunk-FXUI3SSD.mjs.map} +0 -0
  510. /package/dist/esm/{chunk-5AAFF2PV.mjs.map → chunk-HEHVWRMO.mjs.map} +0 -0
  511. /package/dist/esm/{chunk-ZUTOMGB7.mjs.map → chunk-HFWFDS6Y.mjs.map} +0 -0
  512. /package/dist/esm/{chunk-QBWGWHJK.mjs.map → chunk-HXXELLHN.mjs.map} +0 -0
  513. /package/dist/esm/{chunk-LD5MUWGW.mjs.map → chunk-IBMZYDAR.mjs.map} +0 -0
  514. /package/dist/esm/{chunk-QBP4XJT5.mjs.map → chunk-IDNDUJOK.mjs.map} +0 -0
  515. /package/dist/esm/{chunk-HCV3NGLS.mjs.map → chunk-II654QZU.mjs.map} +0 -0
  516. /package/dist/esm/{chunk-XIY2VORC.mjs.map → chunk-JDNI5VIJ.mjs.map} +0 -0
  517. /package/dist/esm/{chunk-HAMXSLWF.mjs.map → chunk-JJUINAQE.mjs.map} +0 -0
  518. /package/dist/esm/{chunk-K6MZXKVV.mjs.map → chunk-JLD7DLKM.mjs.map} +0 -0
  519. /package/dist/esm/{chunk-NV6DHDM3.mjs.map → chunk-KA5FX53Q.mjs.map} +0 -0
  520. /package/dist/esm/{chunk-JDYASF3E.mjs.map → chunk-L2QVUMBV.mjs.map} +0 -0
  521. /package/dist/esm/{chunk-S3FVA55H.mjs.map → chunk-LAAFLCDM.mjs.map} +0 -0
  522. /package/dist/esm/{chunk-AGBA3Y7A.mjs.map → chunk-LGTOOAQI.mjs.map} +0 -0
  523. /package/dist/esm/{chunk-4OV7QU2U.mjs.map → chunk-MHN6XY4Z.mjs.map} +0 -0
  524. /package/dist/esm/{chunk-PHG2IWZW.mjs.map → chunk-MOGPSSTD.mjs.map} +0 -0
  525. /package/dist/esm/{chunk-KSKQVOBA.mjs.map → chunk-NARS3JDH.mjs.map} +0 -0
  526. /package/dist/esm/{chunk-KSUZS6EL.mjs.map → chunk-NHKAQRJB.mjs.map} +0 -0
  527. /package/dist/esm/{chunk-TIZL5YVP.mjs.map → chunk-OKE3FXIP.mjs.map} +0 -0
  528. /package/dist/esm/{chunk-ZINOJTLU.mjs.map → chunk-OPO5EYF7.mjs.map} +0 -0
  529. /package/dist/esm/{chunk-HDTKBFRX.mjs.map → chunk-PW3ISXPN.mjs.map} +0 -0
  530. /package/dist/esm/{chunk-WIXNX7HY.mjs.map → chunk-QQM47PHZ.mjs.map} +0 -0
  531. /package/dist/esm/{chunk-5XXIIWG7.mjs.map → chunk-SBCLBDCP.mjs.map} +0 -0
  532. /package/dist/esm/{chunk-Z36WHOZV.mjs.map → chunk-SU2WB34N.mjs.map} +0 -0
  533. /package/dist/esm/{chunk-OTY3NO7Q.mjs.map → chunk-T6ADNZE5.mjs.map} +0 -0
  534. /package/dist/esm/{chunk-ONBFUPEC.mjs.map → chunk-UGTIALNW.mjs.map} +0 -0
  535. /package/dist/esm/{chunk-KUX6GQ2E.mjs.map → chunk-UIRAXHDH.mjs.map} +0 -0
  536. /package/dist/esm/{chunk-4CDDWSKZ.mjs.map → chunk-UZTJWOLS.mjs.map} +0 -0
  537. /package/dist/esm/{chunk-7V6RL27I.mjs.map → chunk-VCY3JGZM.mjs.map} +0 -0
  538. /package/dist/esm/{chunk-XOCRDV2V.mjs.map → chunk-VQZMI3EZ.mjs.map} +0 -0
  539. /package/dist/esm/{chunk-N3OYD6VZ.mjs.map → chunk-WSFHH3BK.mjs.map} +0 -0
  540. /package/dist/esm/{chunk-7PVIWKGT.mjs.map → chunk-X3JPX7T6.mjs.map} +0 -0
  541. /package/dist/esm/{chunk-HGVZ7ULA.mjs.map → chunk-XKOSS5KC.mjs.map} +0 -0
  542. /package/dist/esm/{chunk-TRU3EK64.mjs.map → chunk-XT5T5LAP.mjs.map} +0 -0
  543. /package/dist/esm/{chunk-FO4F3OJJ.mjs.map → chunk-YNT7JHMS.mjs.map} +0 -0
  544. /package/dist/esm/{chunk-37UZKMJI.mjs.map → chunk-YPBNYKOD.mjs.map} +0 -0
  545. /package/dist/esm/{chunk-IFHQSZLK.mjs.map → chunk-YZ3YPLEU.mjs.map} +0 -0
  546. /package/dist/esm/{chunk-OZN3OOJV.mjs.map → chunk-ZMBXHMVQ.mjs.map} +0 -0
  547. /package/dist/esm/{chunk-BQXVHY7J.mjs.map → chunk-ZRWZIAF5.mjs.map} +0 -0
  548. /package/dist/esm/{chunk-N2FKVZ4D.mjs.map → errors/index.mjs.map} +0 -0
  549. /package/dist/esm/{client/types.mjs.map → transactions/script-composer/index.mjs.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { JwtPayload, jwtDecode } from "jwt-decode";
5
4
  import { HexInput } from "../types";
6
5
  import { AccountAddress } from "../core/accountAddress";
7
- import { KeylessPublicKey, ZeroKnowledgeSig } from "../core/crypto";
6
+ import { getIssAudAndUidVal, Groth16VerificationKey, KeylessPublicKey, ZeroKnowledgeSig } from "../core/crypto";
8
7
 
9
8
  import { EphemeralKeyPair } from "./EphemeralKeyPair";
10
9
  import { Deserializer, Serializer } from "../bcs";
11
10
  import { AbstractKeylessAccount, ProofFetchCallback } from "./AbstractKeylessAccount";
11
+ import { Hex } from "../core/hex";
12
12
 
13
13
  /**
14
14
  * Account implementation for the Keyless authentication scheme.
@@ -19,9 +19,6 @@ import { AbstractKeylessAccount, ProofFetchCallback } from "./AbstractKeylessAcc
19
19
  *
20
20
  * When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT,
21
21
  * EphemeralKeyPair, and corresponding proof.
22
- *
23
- * @static
24
- * @readonly PEPPER_LENGTH - The length of the pepper used for privacy preservation.
25
22
  */
26
23
  export class KeylessAccount extends AbstractKeylessAccount {
27
24
  /**
@@ -32,11 +29,22 @@ export class KeylessAccount extends AbstractKeylessAccount {
32
29
  // Use the static constructor 'create' instead.
33
30
 
34
31
  /**
35
- * Creates an instance of the transaction with an optional proof.
32
+ * Use the static generator `create(...)` instead.
33
+ * Creates an instance of the KeylessAccount with an optional proof.
36
34
  *
37
- * @param args.proof - An optional ZkProof associated with the transaction.
35
+ * @param args - The parameters for creating a KeylessAccount.
36
+ * @param args.address - Optional account address associated with the KeylessAccount.
37
+ * @param args.ephemeralKeyPair - The ephemeral key pair used in the account creation.
38
+ * @param args.iss - A JWT issuer.
39
+ * @param args.uidKey - The claim on the JWT to identify a user. This is typically 'sub' or 'email'.
40
+ * @param args.uidVal - The unique id for this user, intended to be a stable user identifier.
41
+ * @param args.aud - The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's
42
+ * OIDC registration with the identity provider.
43
+ * @param args.pepper - A hexadecimal input used for additional security.
44
+ * @param args.proof - A Zero Knowledge Signature or a promise that resolves to one.
45
+ * @param args.proofFetchCallback - Optional callback function for fetching proof.
46
+ * @param args.jwt - A JSON Web Token used for authentication.
38
47
  */
39
- // TODO: Document rest of parameters
40
48
  private constructor(args: {
41
49
  address?: AccountAddress;
42
50
  ephemeralKeyPair: EphemeralKeyPair;
@@ -48,6 +56,7 @@ export class KeylessAccount extends AbstractKeylessAccount {
48
56
  proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
49
57
  proofFetchCallback?: ProofFetchCallback;
50
58
  jwt: string;
59
+ verificationKeyHash?: HexInput;
51
60
  }) {
52
61
  const publicKey = KeylessPublicKey.create(args);
53
62
  super({ publicKey, ...args });
@@ -61,14 +70,7 @@ export class KeylessAccount extends AbstractKeylessAccount {
61
70
  * @param serializer - The serializer instance used to convert the transaction data into bytes.
62
71
  */
63
72
  serialize(serializer: Serializer): void {
64
- serializer.serializeStr(this.jwt);
65
- serializer.serializeStr(this.uidKey);
66
- serializer.serializeFixedBytes(this.pepper);
67
- this.ephemeralKeyPair.serialize(serializer);
68
- if (this.proof === undefined) {
69
- throw new Error("Cannot serialize - proof undefined");
70
- }
71
- this.proof.serialize(serializer);
73
+ super.serialize(serializer);
72
74
  }
73
75
 
74
76
  /**
@@ -79,27 +81,37 @@ export class KeylessAccount extends AbstractKeylessAccount {
79
81
  * @returns A KeylessAccount instance created from the deserialized data.
80
82
  */
81
83
  static deserialize(deserializer: Deserializer): KeylessAccount {
82
- const jwt = deserializer.deserializeStr();
83
- const uidKey = deserializer.deserializeStr();
84
- const pepper = deserializer.deserializeFixedBytes(31);
85
- const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);
86
- const proof = ZeroKnowledgeSig.deserialize(deserializer);
87
- return KeylessAccount.create({
84
+ const { address, proof, ephemeralKeyPair, jwt, uidKey, pepper, verificationKeyHash } =
85
+ AbstractKeylessAccount.partialDeserialize(deserializer);
86
+ const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });
87
+ return new KeylessAccount({
88
+ address,
88
89
  proof,
89
- pepper,
90
+ ephemeralKeyPair,
91
+ iss,
90
92
  uidKey,
93
+ uidVal,
94
+ aud,
95
+ pepper,
91
96
  jwt,
92
- ephemeralKeyPair,
97
+ verificationKeyHash,
93
98
  });
94
99
  }
95
100
 
96
- static fromBytes(bytes: Uint8Array): KeylessAccount {
97
- return KeylessAccount.deserialize(new Deserializer(bytes));
101
+ /**
102
+ * Deserialize bytes using this account's information.
103
+ *
104
+ * @param bytes The bytes being interpreted.
105
+ * @returns
106
+ */
107
+ static fromBytes(bytes: HexInput): KeylessAccount {
108
+ return KeylessAccount.deserialize(new Deserializer(Hex.hexInputToUint8Array(bytes)));
98
109
  }
99
110
 
100
111
  /**
101
112
  * Creates a KeylessAccount instance using the provided parameters.
102
113
  * This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT.
114
+ * This is used instead of the KeylessAccount constructor.
103
115
  *
104
116
  * @param args - The parameters for creating a KeylessAccount.
105
117
  * @param args.address - Optional account address associated with the KeylessAccount.
@@ -118,28 +130,23 @@ export class KeylessAccount extends AbstractKeylessAccount {
118
130
  pepper: HexInput;
119
131
  uidKey?: string;
120
132
  proofFetchCallback?: ProofFetchCallback;
133
+ verificationKey?: Groth16VerificationKey;
121
134
  }): KeylessAccount {
122
- const { address, proof, jwt, ephemeralKeyPair, pepper, uidKey = "sub", proofFetchCallback } = args;
135
+ const { address, proof, jwt, ephemeralKeyPair, pepper, uidKey = "sub", proofFetchCallback, verificationKey } = args;
123
136
 
124
- const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);
125
- if (typeof jwtPayload.iss !== "string") {
126
- throw new Error("iss was not found");
127
- }
128
- if (typeof jwtPayload.aud !== "string") {
129
- throw new Error("aud was not found or an array of values");
130
- }
131
- const uidVal = jwtPayload[uidKey];
137
+ const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });
132
138
  return new KeylessAccount({
133
139
  address,
134
140
  proof,
135
141
  ephemeralKeyPair,
136
- iss: jwtPayload.iss,
142
+ iss,
137
143
  uidKey,
138
144
  uidVal,
139
- aud: jwtPayload.aud,
145
+ aud,
140
146
  pepper,
141
147
  jwt,
142
148
  proofFetchCallback,
149
+ verificationKeyHash: verificationKey ? verificationKey.hash() : undefined,
143
150
  });
144
151
  }
145
152
  }
@@ -7,7 +7,8 @@ import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
7
7
  import { HexInput, SigningScheme } from "../types";
8
8
  import { AccountAuthenticatorMultiKey } from "../transactions/authenticator/account";
9
9
  import { AnyRawTransaction } from "../transactions/types";
10
- import { AbstractKeylessAccount } from "./AbstractKeylessAccount";
10
+ import { AbstractKeylessAccount, KeylessSigner } from "./AbstractKeylessAccount";
11
+ import { AptosConfig } from "../api/aptosConfig";
11
12
 
12
13
  /**
13
14
  * Arguments required to verify a multi-key signature against a given message.
@@ -28,7 +29,7 @@ export interface VerifyMultiKeySignatureArgs {
28
29
  *
29
30
  * Note: Generating a signer instance does not create the account on-chain.
30
31
  */
31
- export class MultiKeyAccount implements Account {
32
+ export class MultiKeyAccount implements Account, KeylessSigner {
32
33
  /**
33
34
  * Public key associated with the account
34
35
  */
@@ -154,9 +155,21 @@ export class MultiKeyAccount implements Account {
154
155
  }
155
156
 
156
157
  /**
157
- * Sign the given data using the MultiKeyAccount's signers.
158
- * @param data - The data to be signed in HexInput format.
159
- * @returns MultiKeySignature - The resulting multi-key signature.
158
+ * Validates that the Keyless Account can be used to sign transactions.
159
+ * @return
160
+ */
161
+ async checkKeylessAccountValidity(aptosConfig: AptosConfig): Promise<void> {
162
+ const keylessSigners = this.signers.filter(
163
+ (signer) => signer instanceof AbstractKeylessAccount,
164
+ ) as AbstractKeylessAccount[];
165
+ const promises = keylessSigners.map((signer) => signer.checkKeylessAccountValidity(aptosConfig));
166
+ await Promise.all(promises);
167
+ }
168
+
169
+ /**
170
+ * Sign the given message using the MultiKeyAccount's signers
171
+ * @param message in HexInput format
172
+ * @returns MultiKeySignature
160
173
  */
161
174
  sign(data: HexInput): MultiKeySignature {
162
175
  const signatures = [];
@@ -675,7 +675,9 @@ export class Account {
675
675
  * is specified.
676
676
  * @param args.faMetadataAddress The fungible asset metadata address to query. Note: If not provided, it may be automatically
677
677
  * populated if `coinType` is specified.
678
- * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
678
+ * @param args.minimumLedgerVersion Not used anymore, here for backward compatibility
679
+ * see https://github.com/aptos-labs/aptos-ts-sdk/pull/519, will be removed in the near future.
680
+ * Optional ledger version to sync up to before querying.
679
681
  * @returns The current amount of the specified coin held by the account.
680
682
  *
681
683
  * @example
@@ -703,8 +705,16 @@ export class Account {
703
705
  faMetadataAddress?: AccountAddressInput;
704
706
  minimumLedgerVersion?: AnyNumber;
705
707
  }): Promise<number> {
706
- const { accountAddress, coinType, faMetadataAddress } = args;
708
+ const { accountAddress, coinType, faMetadataAddress, minimumLedgerVersion } = args;
707
709
 
710
+ if (minimumLedgerVersion) {
711
+ // eslint-disable-next-line no-console
712
+ console.warn(
713
+ `minimumLedgerVersion is not used anymore, here for backward
714
+ compatibility see https://github.com/aptos-labs/aptos-ts-sdk/pull/519,
715
+ will be removed in the near future`,
716
+ );
717
+ }
708
718
  // Attempt to populate the CoinType field if the FA address is provided.
709
719
  // We cannot do this internally due to dependency cycles issue.
710
720
  let coinAssetType: MoveStructId | undefined = coinType;
@@ -10,7 +10,7 @@ import {
10
10
  getProof,
11
11
  updateFederatedKeylessJwkSetTransaction,
12
12
  } from "../internal/keyless";
13
- import { SimpleTransaction } from "../transactions";
13
+ import { InputGenerateTransactionOptions, SimpleTransaction } from "../transactions";
14
14
  import { HexInput } from "../types";
15
15
  import { AptosConfig } from "./aptosConfig";
16
16
 
@@ -155,7 +155,7 @@ export class Keyless {
155
155
  * @param args.jwt - The JWT token used for deriving the account.
156
156
  * @param args.ephemeralKeyPair - The EphemeralKeyPair used to generate the nonce in the JWT token.
157
157
  * @param args.jwkAddress - The address the where the JWKs used to verify signatures are found. Setting the value derives a
158
- * FederatedKeylessAccount
158
+ * FederatedKeylessAccount.
159
159
  * @param args.uidKey - An optional key in the JWT token to set the uidVal in the IdCommitment.
160
160
  * @param args.pepper - An optional pepper value.
161
161
  * @param args.proofFetchCallback - An optional callback function for fetching the proof in the background, allowing for a more
@@ -201,7 +201,7 @@ export class Keyless {
201
201
  /**
202
202
  * This installs a set of FederatedJWKs at an address for a given iss.
203
203
  *
204
- * It will fetch the JWK set from the well-known endpoint and update the FederatedJWKs at the sender's address
204
+ * It will fetch the JSON Web Keyset (JWK) set from the well-known endpoint and update the FederatedJWKs at the sender's address
205
205
  * to reflect it.
206
206
  *
207
207
  * @param args.sender The account that will install the JWKs
@@ -214,6 +214,7 @@ export class Keyless {
214
214
  sender: Account;
215
215
  iss: string;
216
216
  jwksUrl?: string;
217
+ options?: InputGenerateTransactionOptions;
217
218
  }): Promise<SimpleTransaction> {
218
219
  return updateFederatedKeylessJwkSetTransaction({ aptosConfig: this.config, ...args });
219
220
  }
@@ -3,10 +3,17 @@
3
3
 
4
4
  import { AccountAddressInput } from "../../core";
5
5
  import { generateTransaction } from "../../internal/transactionSubmission";
6
- import { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from "../../transactions";
6
+ import {
7
+ InputGenerateTransactionPayloadData,
8
+ InputGenerateTransactionOptions,
9
+ AptosScriptComposer,
10
+ TransactionPayloadScript,
11
+ generateRawTransaction,
12
+ } from "../../transactions";
7
13
  import { MultiAgentTransaction } from "../../transactions/instances/multiAgentTransaction";
8
14
  import { SimpleTransaction } from "../../transactions/instances/simpleTransaction";
9
15
  import { AptosConfig } from "../aptosConfig";
16
+ import { Deserializer } from "../../bcs";
10
17
 
11
18
  /**
12
19
  * A class to handle all `Build` transaction operations.
@@ -93,6 +100,80 @@ export class Build {
93
100
  return generateTransaction({ aptosConfig: this.config, ...args });
94
101
  }
95
102
 
103
+ /**
104
+ * Build a transaction from a series of Move calls.
105
+ *
106
+ * This function allows you to create a transaction with a list of Move calls.
107
+ *
108
+ * Right now we only tested this logic with single signer and we will add support
109
+ * for mutli agent transactions if needed.
110
+ *
111
+ * @param args.sender - The sender account address.
112
+ * @param args.builder - The closure to construct the list of calls.
113
+ * @param args.options - Optional transaction configurations.
114
+ * @param args.withFeePayer - Whether there is a fee payer for the transaction.
115
+ *
116
+ * @returns SimpleTransaction
117
+ *
118
+ * @example
119
+ * ```typescript
120
+ * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
121
+ *
122
+ * const config = new AptosConfig({ network: Network.TESTNET });
123
+ * const aptos = new Aptos(config);
124
+ *
125
+ * async function runExample() {
126
+ * // Build a transaction from a chained series of Move calls.
127
+ * const transaction = await aptos.transaction.script_composer({
128
+ * sender: "0x1", // replace with a real sender account address
129
+ * builder: builder: async (builder) => {
130
+ * const coin = await builder.addBatchedCalls({
131
+ * function: "0x1::coin::withdraw",
132
+ * functionArguments: [CallArgument.new_signer(0), 1],
133
+ * typeArguments: ["0x1::aptos_coin::AptosCoin"],
134
+ * });
135
+ *
136
+ * // Pass the returned value from the first function call to the second call
137
+ * const fungibleAsset = await builder.addBatchedCalls({
138
+ * function: "0x1::coin::coin_to_fungible_asset",
139
+ * functionArguments: [coin[0]],
140
+ * typeArguments: ["0x1::aptos_coin::AptosCoin"],
141
+ * });
142
+ *
143
+ * await builder.addBatchedCalls({
144
+ * function: "0x1::primary_fungible_store::deposit",
145
+ * functionArguments: [singleSignerED25519SenderAccount.accountAddress, fungibleAsset[0]],
146
+ * typeArguments: [],
147
+ * });
148
+ * return builder;
149
+ * },
150
+ * options: {
151
+ * gasUnitPrice: 100, // specify your own gas unit price if needed
152
+ * maxGasAmount: 1000, // specify your own max gas amount if needed
153
+ * },
154
+ * });
155
+ *
156
+ * console.log(transaction);
157
+ * }
158
+ * runExample().catch(console.error);
159
+ * ```
160
+ */
161
+ async scriptComposer(args: {
162
+ sender: AccountAddressInput;
163
+ builder: (builder: AptosScriptComposer) => Promise<AptosScriptComposer>;
164
+ options?: InputGenerateTransactionOptions;
165
+ withFeePayer?: boolean;
166
+ }): Promise<SimpleTransaction> {
167
+ const builder = await args.builder(new AptosScriptComposer(this.config));
168
+ const bytes = builder.build();
169
+ const rawTxn = await generateRawTransaction({
170
+ aptosConfig: this.config,
171
+ payload: TransactionPayloadScript.load(new Deserializer(bytes)),
172
+ ...args,
173
+ });
174
+ return new SimpleTransaction(rawTxn);
175
+ }
176
+
96
177
  /**
97
178
  * Build a multi-agent transaction that allows multiple signers to authorize a transaction.
98
179
  *
@@ -82,6 +82,7 @@ export class Deserializer {
82
82
  }
83
83
 
84
84
  /**
85
+ * @deprecated use `deserializeOption` instead.
85
86
  * Deserializes a UTF-8 encoded string from a byte array. It first reads the length of the string in bytes,
86
87
  * followed by the actual byte content, and decodes it into a string.
87
88
  *
@@ -101,44 +102,66 @@ export class Deserializer {
101
102
  }
102
103
 
103
104
  /**
104
- * Deserializes an optional string.
105
+ * Deserializes an optional value from the buffer.
105
106
  *
106
- * The BCS layout for Optional<String> is 0 if none, else 1 followed by the string length and string content.
107
- * @returns The deserialized string if it exists, otherwise undefined.
108
- * @example
109
- * ```typescript
110
- * const deserializer = new Deserializer(new Uint8Array([0x00]));
111
- * assert(deserializer.deserializeOptionStr() === undefined);
112
- * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
113
- * assert(deserializer.deserializeOptionStr() === "1234abcd");
114
- * ```
115
- */
116
- deserializeOptionStr(): string | undefined {
117
- const exists = this.deserializeBool();
118
- return exists ? this.deserializeStr() : undefined;
119
- }
120
-
121
- /**
122
- * Deserializes an optional deserializable class.
107
+ * The BCS layout for Optional<T> starts with a boolean byte (0 if none, 1 if some),
108
+ * followed by the value if present.
109
+ *
110
+ * @template T - The type of the value to deserialize
111
+ * @param type - Either a Deserializable class or one of the string literals: "string", "bytes", or "fixedBytes"
112
+ * @param len - Required length when type is "fixedBytes", ignored otherwise
113
+ * @returns The deserialized value if present, undefined otherwise
123
114
  *
124
- * BCS layout for Optional<T>: 0 if none, else 1 | BCS representation of class.
115
+ * @throws {Error} When "fixedBytes" is specified without a length
125
116
  *
126
117
  * @example
127
- * const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
128
- * const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
129
- * // value is now an instance of MyClass
118
+ * ```typescript
119
+ * // Deserialize an optional string
120
+ * const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));
121
+ * const optStr = deserializer.deserializeOption("string");
122
+ * // optStr === "abc"
130
123
  *
124
+ * // Deserialize an optional custom type
131
125
  * const deserializer = new Deserializer(new Uint8Array([0]));
132
- * const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
133
- * // value is undefined
134
- *
135
- * @param cls The BCS-deserializable class to deserialize the buffered bytes into.
136
- *
137
- * @returns The deserialized value of class type T or undefined if no value exists.
126
+ * const optValue = deserializer.deserializeOption(MyClass);
127
+ * // optValue === undefined
128
+ *
129
+ * // Deserialize optional bytes
130
+ * const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));
131
+ * const optBytes = deserializer.deserializeOption("bytes");
132
+ * // optBytes === Uint8Array[1, 2, 3]
133
+ *
134
+ * // Deserialize optional fixed bytes
135
+ * const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));
136
+ * const optBytes = deserializer.deserializeOption("fixedBytes", 4);
137
+ * // optBytes === Uint8Array[1, 2, 3, 4]
138
+ * ```
138
139
  */
139
- deserializeOption<T>(cls: Deserializable<T>): T | undefined {
140
+ deserializeOption(type: "string"): string | undefined;
141
+ deserializeOption(type: "bytes"): Uint8Array | undefined;
142
+ deserializeOption(type: "fixedBytes", len: number): Uint8Array | undefined;
143
+ deserializeOption<T>(type: Deserializable<T>): T | undefined;
144
+ deserializeOption<T>(
145
+ type: Deserializable<T> | "string" | "bytes" | "fixedBytes",
146
+ len?: number,
147
+ ): T | string | Uint8Array | undefined {
140
148
  const exists = this.deserializeBool();
141
- return exists ? this.deserialize(cls) : undefined;
149
+ if (!exists) return undefined;
150
+
151
+ if (type === "string") {
152
+ return this.deserializeStr();
153
+ }
154
+ if (type === "bytes") {
155
+ return this.deserializeBytes();
156
+ }
157
+ if (type === "fixedBytes") {
158
+ if (len === undefined) {
159
+ throw new Error("Fixed bytes length not provided");
160
+ }
161
+ return this.deserializeFixedBytes(len);
162
+ }
163
+
164
+ return this.deserialize(type);
142
165
  }
143
166
 
144
167
  /**
@@ -42,8 +42,7 @@ import { EntryFunctionArgument, TransactionArgument } from "../../transactions/i
42
42
  * const vecOfStrings = new MoveVector([new MoveString("hello"), new MoveString("world")]);
43
43
  * const vecOfStrings2 = MoveVector.MoveString(["hello", "world"]);
44
44
  *
45
- * @params
46
- * values: an Array<T> of values where T is a class that implements Serializable
45
+ * @param values an Array<T> of values where T is a class that implements Serializable
47
46
  * @returns a `MoveVector<T>` with the values `values`
48
47
  */
49
48
  export class MoveVector<T extends Serializable & EntryFunctionArgument>
@@ -132,9 +131,9 @@ export class MoveVector<T extends Serializable & EntryFunctionArgument>
132
131
 
133
132
  /**
134
133
  * Factory method to generate a MoveOption<U16> from a `number` or `null`.
135
- *
136
- * This method allows you to create a MoveVector that can either hold a U16 value or be empty.
137
- *
134
+ *
135
+ * This method allows you to create a MoveVector that can either hold a U16 value or be empty.
136
+ *
138
137
  * @param values - The value used to fill the MoveVector. If `value` is null or undefined, the resulting MoveVector's
139
138
  * `.isSome()` method will return false.
140
139
  * @returns A MoveVector<U16> with an inner value `value`.
@@ -150,13 +149,13 @@ export class MoveVector<T extends Serializable & EntryFunctionArgument>
150
149
 
151
150
  /**
152
151
  * Factory method to generate a MoveVector<U32> from a `number` or `null`.
153
- *
154
- * This method allows you to create a MoveVector that can either hold a U32 value or be empty.
155
- *
152
+ *
153
+ * This method allows you to create a MoveVector that can either hold a U32 value or be empty.
154
+ *
156
155
  * @param values - The value used to fill the MoveVector. If `value` is null or undefined,
157
156
  * the resulting MoveVector's .isSome() method will return false.
158
157
  * @returns A MoveVector<U32> with an inner value `value`.
159
- *
158
+ *
160
159
  * @example
161
160
  * ```
162
161
  * const v = MoveVector.U32([1, 2, 3, 4]);
@@ -442,7 +441,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
442
441
  * MoveOption.U8(1).isSome() === true;
443
442
  * MoveOption.U8().isSome() === false;
444
443
  * MoveOption.U8(undefined).isSome() === false;
445
- * @params value: the value used to fill the MoveOption. If `value` is undefined
444
+ * @param value the value used to fill the MoveOption. If `value` is undefined
446
445
  * the resulting MoveOption's .isSome() method will return false.
447
446
  * @returns a MoveOption<U8> with an inner value `value`
448
447
  */
@@ -457,7 +456,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
457
456
  * MoveOption.U16(1).isSome() === true;
458
457
  * MoveOption.U16().isSome() === false;
459
458
  * MoveOption.U16(undefined).isSome() === false;
460
- * @params value: the value used to fill the MoveOption. If `value` is undefined
459
+ * @param value the value used to fill the MoveOption. If `value` is undefined
461
460
  * the resulting MoveOption's .isSome() method will return false.
462
461
  * @returns a MoveOption<U16> with an inner value `value`
463
462
  */
@@ -472,7 +471,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
472
471
  * MoveOption.U32(1).isSome() === true;
473
472
  * MoveOption.U32().isSome() === false;
474
473
  * MoveOption.U32(undefined).isSome() === false;
475
- * @params value: the value used to fill the MoveOption. If `value` is undefined
474
+ * @param value the value used to fill the MoveOption. If `value` is undefined
476
475
  * the resulting MoveOption's .isSome() method will return false.
477
476
  * @returns a MoveOption<U32> with an inner value `value`
478
477
  */
@@ -487,7 +486,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
487
486
  * MoveOption.U64(1).isSome() === true;
488
487
  * MoveOption.U64().isSome() === false;
489
488
  * MoveOption.U64(undefined).isSome() === false;
490
- * @params value: the value used to fill the MoveOption. If `value` is undefined
489
+ * @param value the value used to fill the MoveOption. If `value` is undefined
491
490
  * the resulting MoveOption's .isSome() method will return false.
492
491
  * @returns a MoveOption<U64> with an inner value `value`
493
492
  */
@@ -502,7 +501,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
502
501
  * MoveOption.U128(1).isSome() === true;
503
502
  * MoveOption.U128().isSome() === false;
504
503
  * MoveOption.U128(undefined).isSome() === false;
505
- * @params value: the value used to fill the MoveOption. If `value` is undefined
504
+ * @param value the value used to fill the MoveOption. If `value` is undefined
506
505
  * the resulting MoveOption's .isSome() method will return false.
507
506
  * @returns a MoveOption<U128> with an inner value `value`
508
507
  */
@@ -517,7 +516,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
517
516
  * MoveOption.U256(1).isSome() === true;
518
517
  * MoveOption.U256().isSome() === false;
519
518
  * MoveOption.U256(undefined).isSome() === false;
520
- * @params value: the value used to fill the MoveOption. If `value` is undefined
519
+ * @param value the value used to fill the MoveOption. If `value` is undefined
521
520
  * the resulting MoveOption's .isSome() method will return false.
522
521
  * @returns a MoveOption<U256> with an inner value `value`
523
522
  */
@@ -532,7 +531,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
532
531
  * MoveOption.Bool(true).isSome() === true;
533
532
  * MoveOption.Bool().isSome() === false;
534
533
  * MoveOption.Bool(undefined).isSome() === false;
535
- * @params value: the value used to fill the MoveOption. If `value` is undefined
534
+ * @param value the value used to fill the MoveOption. If `value` is undefined
536
535
  * the resulting MoveOption's .isSome() method will return false.
537
536
  * @returns a MoveOption<Bool> with an inner value `value`
538
537
  */
@@ -548,7 +547,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
548
547
  * MoveOption.MoveString("").isSome() === true;
549
548
  * MoveOption.MoveString().isSome() === false;
550
549
  * MoveOption.MoveString(undefined).isSome() === false;
551
- * @params value: the value used to fill the MoveOption. If `value` is undefined
550
+ * @param value the value used to fill the MoveOption. If `value` is undefined
552
551
  * the resulting MoveOption's .isSome() method will return false.
553
552
  * @returns a MoveOption<MoveString> with an inner value `value`
554
553
  */
@@ -367,32 +367,42 @@ export class Serializer {
367
367
  }
368
368
 
369
369
  /**
370
- * Serializes a BCS Serializable value into a serializer instance or handles the case when the value is undefined.
371
- * This function allows you to efficiently add serialized data to the serializer's byte buffer.
370
+ * Serializes an optional value which can be a Serializable, string, or Uint8Array.
371
+ * For strings and Uint8Arrays, it uses the appropriate serialization method.
372
372
  *
373
- * @param value The BCS Serializable value to serialize, or undefined if there is no value.
373
+ * @param value The value to serialize (Serializable, string, Uint8Array, or undefined)
374
+ * @param len Optional fixed length for Uint8Array serialization. If provided, uses serializeFixedBytes instead of serializeBytes
374
375
  *
375
376
  * @example
376
377
  * ```typescript
377
378
  * const serializer = new Serializer();
378
- * serializer.serializeOption(new AccountAddress(...));
379
- * const serializedBytes = serializer.toUint8Array();
380
- * // serializedBytes is now the BCS-serialized byte representation of AccountAddress
381
- *
382
- * const serializer = new Serializer();
383
- * serializer.serializeOption(undefined);
384
- * assert(serializer.toUint8Array() === new Uint8Array([0x00]));
379
+ * serializer.serializeOption("hello"); // Serializes optional string
380
+ * serializer.serializeOption(new Uint8Array([1, 2, 3])); // Serializes optional bytes
381
+ * serializer.serializeOption(new Uint8Array([1, 2, 3]), 3); // Serializes optional fixed-length bytes
382
+ * serializer.serializeOption(new AccountAddress(...)); // Serializes optional Serializable
383
+ * serializer.serializeOption(undefined); // Serializes none case
385
384
  * ```
386
385
  */
387
- serializeOption<T extends Serializable>(value?: T): void {
386
+ serializeOption<T extends Serializable | string | Uint8Array>(value?: T, len?: number): void {
388
387
  const hasValue = value !== undefined;
389
388
  this.serializeBool(hasValue);
390
389
  if (hasValue) {
391
- value.serialize(this);
390
+ if (typeof value === "string") {
391
+ this.serializeStr(value);
392
+ } else if (value instanceof Uint8Array) {
393
+ if (len !== undefined) {
394
+ this.serializeFixedBytes(value);
395
+ } else {
396
+ this.serializeBytes(value);
397
+ }
398
+ } else {
399
+ value.serialize(this);
400
+ }
392
401
  }
393
402
  }
394
403
 
395
404
  /**
405
+ * @deprecated use `serializeOption` instead.
396
406
  * Serializes an optional string, supporting UTF8 encoding.
397
407
  * The function encodes the existence of the string first, followed by the length and content if it exists.
398
408
  *