@aptos-labs/ts-sdk 1.13.3 → 1.14.0-zeta.1

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 (601) hide show
  1. package/dist/common/accountAddress-u9wEan9p.d.ts +2149 -0
  2. package/dist/common/chunk-QRI7EC4T.js +24 -0
  3. package/dist/common/chunk-QRI7EC4T.js.map +1 -0
  4. package/dist/common/cli/index.d.ts +94 -1
  5. package/dist/common/cli/index.js +245 -1
  6. package/dist/common/cli/index.js.map +1 -1
  7. package/dist/common/index.d.ts +2699 -4119
  8. package/dist/common/index.js +11786 -374
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-9zBaZEnp.d.mts} +76 -9
  11. package/dist/esm/account/Account.d.mts +34 -0
  12. package/dist/esm/account/Account.mjs +56 -0
  13. package/dist/esm/account/Ed25519Account.d.mts +34 -0
  14. package/dist/esm/account/Ed25519Account.mjs +54 -0
  15. package/dist/esm/account/EphemeralKeyPair.d.mts +80 -0
  16. package/dist/esm/account/EphemeralKeyPair.mjs +37 -0
  17. package/dist/esm/account/KeylessAccount.d.mts +145 -0
  18. package/dist/esm/account/KeylessAccount.mjs +57 -0
  19. package/dist/esm/account/MultiKeyAccount.d.mts +138 -0
  20. package/dist/esm/account/MultiKeyAccount.mjs +56 -0
  21. package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
  22. package/dist/esm/account/SingleKeyAccount.mjs +54 -0
  23. package/dist/esm/account/index.d.mts +41 -0
  24. package/dist/esm/account/index.mjs +77 -0
  25. package/dist/esm/api/account.d.mts +13 -1
  26. package/dist/esm/api/account.mjs +76 -1
  27. package/dist/esm/api/ans.d.mts +2 -2
  28. package/dist/esm/api/ans.mjs +87 -1
  29. package/dist/esm/api/aptos.d.mts +15 -8
  30. package/dist/esm/api/aptos.mjs +116 -1
  31. package/dist/esm/api/aptosConfig.d.mts +20 -0
  32. package/dist/esm/api/aptosConfig.mjs +9 -1
  33. package/dist/esm/api/coin.d.mts +7 -7
  34. package/dist/esm/api/coin.mjs +86 -1
  35. package/dist/esm/api/digitalAsset.d.mts +1 -1
  36. package/dist/esm/api/digitalAsset.mjs +87 -1
  37. package/dist/esm/api/event.mjs +54 -1
  38. package/dist/esm/api/faucet.mjs +53 -1
  39. package/dist/esm/api/fungibleAsset.d.mts +5 -5
  40. package/dist/esm/api/fungibleAsset.mjs +87 -1
  41. package/dist/esm/api/general.d.mts +7 -7
  42. package/dist/esm/api/general.mjs +84 -1
  43. package/dist/esm/api/index.d.mts +14 -8
  44. package/dist/esm/api/index.mjs +120 -1
  45. package/dist/esm/api/keyless.d.mts +81 -0
  46. package/dist/esm/api/keyless.mjs +71 -0
  47. package/dist/esm/api/staking.mjs +54 -1
  48. package/dist/esm/api/transaction.d.mts +1 -1
  49. package/dist/esm/api/transaction.mjs +94 -1
  50. package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
  51. package/dist/esm/api/transactionSubmission/build.mjs +85 -1
  52. package/dist/esm/api/transactionSubmission/helpers.mjs +9 -1
  53. package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
  54. package/dist/esm/api/transactionSubmission/management.mjs +89 -1
  55. package/dist/esm/api/transactionSubmission/sign.d.mts +1 -1
  56. package/dist/esm/api/transactionSubmission/sign.mjs +109 -1
  57. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  58. package/dist/esm/api/transactionSubmission/simulate.d.mts +6 -6
  59. package/dist/esm/api/transactionSubmission/simulate.mjs +86 -1
  60. package/dist/esm/api/transactionSubmission/submit.mjs +86 -1
  61. package/dist/esm/api/utils.mjs +34 -1
  62. package/dist/esm/bcs/consts.mjs +17 -1
  63. package/dist/esm/bcs/deserializer.d.mts +26 -0
  64. package/dist/esm/bcs/deserializer.mjs +8 -1
  65. package/dist/esm/bcs/index.mjs +57 -1
  66. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +12 -1
  67. package/dist/esm/bcs/serializable/fixedBytes.mjs +11 -1
  68. package/dist/esm/bcs/serializable/movePrimitives.mjs +25 -1
  69. package/dist/esm/bcs/serializable/moveStructs.mjs +18 -1
  70. package/dist/esm/bcs/serializer.d.mts +2 -0
  71. package/dist/esm/bcs/serializer.mjs +18 -1
  72. package/dist/esm/chunk-2JOCR2VL.mjs +32 -0
  73. package/dist/esm/chunk-2JOCR2VL.mjs.map +1 -0
  74. package/dist/esm/chunk-2OQW7BMN.mjs +129 -0
  75. package/dist/esm/{chunk-PZGLV5UQ.mjs.map → chunk-2OQW7BMN.mjs.map} +1 -1
  76. package/dist/esm/chunk-2TJJWII2.mjs +23 -0
  77. package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-2TJJWII2.mjs.map} +1 -1
  78. package/dist/esm/chunk-2ZEGJU43.mjs +252 -0
  79. package/dist/esm/chunk-2ZEGJU43.mjs.map +1 -0
  80. package/dist/esm/chunk-4OYYOYSO.mjs +336 -0
  81. package/dist/esm/chunk-4OYYOYSO.mjs.map +1 -0
  82. package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-4PJ5FYGQ.mjs} +302 -27
  83. package/dist/esm/{chunk-S4SEFF4K.mjs.map → chunk-4PJ5FYGQ.mjs.map} +1 -1
  84. package/dist/esm/chunk-55NODGHC.mjs +135 -0
  85. package/dist/esm/chunk-55NODGHC.mjs.map +1 -0
  86. package/dist/esm/chunk-6LRQSBRH.mjs +130 -0
  87. package/dist/esm/chunk-6LRQSBRH.mjs.map +1 -0
  88. package/dist/esm/chunk-6MSZMIFW.mjs +23 -0
  89. package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-6MSZMIFW.mjs.map} +1 -1
  90. package/dist/esm/chunk-76TSTAU4.mjs +120 -0
  91. package/dist/esm/chunk-76TSTAU4.mjs.map +1 -0
  92. package/dist/esm/chunk-7FO3S6IZ.mjs +324 -0
  93. package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-7FO3S6IZ.mjs.map} +1 -1
  94. package/dist/esm/chunk-7FUHWL6A.mjs +42 -0
  95. package/dist/esm/{chunk-V3Q2KXJU.mjs.map → chunk-7FUHWL6A.mjs.map} +1 -1
  96. package/dist/esm/chunk-7IDBB4J4.mjs +33 -0
  97. package/dist/esm/{chunk-ZZZZVONX.mjs.map → chunk-7IDBB4J4.mjs.map} +1 -1
  98. package/dist/esm/chunk-7JRMOHBP.mjs +247 -0
  99. package/dist/esm/chunk-7JRMOHBP.mjs.map +1 -0
  100. package/dist/esm/chunk-7REUIYF4.mjs +63 -0
  101. package/dist/esm/chunk-7REUIYF4.mjs.map +1 -0
  102. package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
  103. package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
  104. package/dist/esm/chunk-AC3OGAL6.mjs +87 -0
  105. package/dist/esm/{chunk-U6Z4FNB7.mjs.map → chunk-AC3OGAL6.mjs.map} +1 -1
  106. package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
  107. package/dist/esm/chunk-AQ4I7VVB.mjs.map +1 -0
  108. package/dist/esm/chunk-AR7X6GWQ.mjs +356 -0
  109. package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-AR7X6GWQ.mjs.map} +1 -1
  110. package/dist/esm/chunk-ASF2VWOX.mjs +142 -0
  111. package/dist/esm/{chunk-G2O323HP.mjs.map → chunk-ASF2VWOX.mjs.map} +1 -1
  112. package/dist/esm/chunk-ATVFVXR6.mjs +43 -0
  113. package/dist/esm/{chunk-VVIG4E7Q.mjs.map → chunk-ATVFVXR6.mjs.map} +1 -1
  114. package/dist/esm/chunk-B5S6DDUD.mjs +120 -0
  115. package/dist/esm/chunk-B5S6DDUD.mjs.map +1 -0
  116. package/dist/esm/chunk-BXMHDQHW.mjs +512 -0
  117. package/dist/esm/chunk-BXMHDQHW.mjs.map +1 -0
  118. package/dist/esm/chunk-CC4DQ6NH.mjs +19 -0
  119. package/dist/esm/{chunk-MACC2BLE.mjs.map → chunk-CC4DQ6NH.mjs.map} +1 -1
  120. package/dist/esm/chunk-CMNJG4NN.mjs +345 -0
  121. package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-CMNJG4NN.mjs.map} +1 -1
  122. package/dist/esm/chunk-CTJSZT5V.mjs +87 -0
  123. package/dist/esm/{chunk-UFT7US42.mjs.map → chunk-CTJSZT5V.mjs.map} +1 -1
  124. package/dist/esm/chunk-CX3NAVRD.mjs +205 -0
  125. package/dist/esm/chunk-CX3NAVRD.mjs.map +1 -0
  126. package/dist/esm/chunk-CXUGZXED.mjs +307 -0
  127. package/dist/esm/{chunk-YU3KB3UV.mjs.map → chunk-CXUGZXED.mjs.map} +1 -1
  128. package/dist/esm/chunk-D2BVBXWO.mjs +7 -0
  129. package/dist/esm/{chunk-B7TQGVGL.mjs.map → chunk-D2BVBXWO.mjs.map} +1 -1
  130. package/dist/esm/chunk-DGV7DYU4.mjs +413 -0
  131. package/dist/esm/chunk-DGV7DYU4.mjs.map +1 -0
  132. package/dist/esm/chunk-DIYZRGR6.mjs +242 -0
  133. package/dist/esm/{chunk-O4JRPZZM.mjs.map → chunk-DIYZRGR6.mjs.map} +1 -1
  134. package/dist/esm/chunk-DNPMS2OF.mjs +236 -0
  135. package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-DNPMS2OF.mjs.map} +1 -1
  136. package/dist/esm/chunk-DVPQGCFT.mjs +74 -0
  137. package/dist/esm/{chunk-O2F53NKI.mjs.map → chunk-DVPQGCFT.mjs.map} +1 -1
  138. package/dist/esm/chunk-EYHRMZPO.mjs +34 -0
  139. package/dist/esm/{chunk-AH44UPM4.mjs.map → chunk-EYHRMZPO.mjs.map} +1 -1
  140. package/dist/esm/chunk-F2ZWA7B7.mjs +412 -0
  141. package/dist/esm/chunk-F2ZWA7B7.mjs.map +1 -0
  142. package/dist/esm/chunk-FDWJNY4U.mjs +22 -0
  143. package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-FDWJNY4U.mjs.map} +1 -1
  144. package/dist/esm/chunk-FF4JPDKD.mjs +315 -0
  145. package/dist/esm/chunk-FF4JPDKD.mjs.map +1 -0
  146. package/dist/esm/chunk-FQQW55X7.mjs +288 -0
  147. package/dist/esm/{chunk-52C73T26.mjs.map → chunk-FQQW55X7.mjs.map} +1 -1
  148. package/dist/esm/chunk-FXKSE3ZP.mjs +25 -0
  149. package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-FXKSE3ZP.mjs.map} +1 -1
  150. package/dist/esm/chunk-GBEVD2VM.mjs +99 -0
  151. package/dist/esm/chunk-GBEVD2VM.mjs.map +1 -0
  152. package/dist/esm/chunk-GGMTQAQP.mjs +11 -0
  153. package/dist/esm/{chunk-3JPVQHOR.mjs.map → chunk-GGMTQAQP.mjs.map} +1 -1
  154. package/dist/esm/chunk-GSVQ6EUD.mjs +649 -0
  155. package/dist/esm/chunk-GSVQ6EUD.mjs.map +1 -0
  156. package/dist/esm/chunk-HBNSRCZN.mjs +100 -0
  157. package/dist/esm/{chunk-SG4MAOCF.mjs.map → chunk-HBNSRCZN.mjs.map} +1 -1
  158. package/dist/esm/chunk-IC56GQFJ.mjs +127 -0
  159. package/dist/esm/chunk-IC56GQFJ.mjs.map +1 -0
  160. package/dist/esm/chunk-IHNPN5CQ.mjs +256 -0
  161. package/dist/esm/chunk-IHNPN5CQ.mjs.map +1 -0
  162. package/dist/esm/chunk-JHDHNGJ3.mjs +126 -0
  163. package/dist/esm/chunk-JHDHNGJ3.mjs.map +1 -0
  164. package/dist/esm/chunk-JL2JHVS4.mjs +49 -0
  165. package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-JL2JHVS4.mjs.map} +1 -1
  166. package/dist/esm/chunk-JV3GSIJW.mjs +268 -0
  167. package/dist/esm/chunk-JV3GSIJW.mjs.map +1 -0
  168. package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
  169. package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
  170. package/dist/esm/chunk-KK2BSALW.mjs +32 -0
  171. package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-KK2BSALW.mjs.map} +1 -1
  172. package/dist/esm/chunk-KMXSRHJ6.mjs +93 -0
  173. package/dist/esm/chunk-KMXSRHJ6.mjs.map +1 -0
  174. package/dist/esm/chunk-KVSQ57HU.mjs +45 -0
  175. package/dist/esm/{chunk-NNQJBFRB.mjs.map → chunk-KVSQ57HU.mjs.map} +1 -1
  176. package/dist/esm/chunk-LI2QV6RU.mjs +129 -0
  177. package/dist/esm/chunk-LI2QV6RU.mjs.map +1 -0
  178. package/dist/esm/chunk-LLLQJWRZ.mjs +35 -0
  179. package/dist/esm/{chunk-DPV25ZKR.mjs.map → chunk-LLLQJWRZ.mjs.map} +1 -1
  180. package/dist/esm/chunk-LYK4TQZO.mjs +70 -0
  181. package/dist/esm/chunk-LYK4TQZO.mjs.map +1 -0
  182. package/dist/esm/chunk-LYMY63SO.mjs +124 -0
  183. package/dist/esm/{chunk-W4ZW7QHA.mjs.map → chunk-LYMY63SO.mjs.map} +1 -1
  184. package/dist/esm/chunk-MZZLEY6O.mjs +92 -0
  185. package/dist/esm/chunk-MZZLEY6O.mjs.map +1 -0
  186. package/dist/esm/chunk-N4WKFNQ6.mjs +156 -0
  187. package/dist/esm/chunk-N4WKFNQ6.mjs.map +1 -0
  188. package/dist/esm/chunk-NFJCQRVK.mjs +37 -0
  189. package/dist/esm/chunk-NFJCQRVK.mjs.map +1 -0
  190. package/dist/esm/chunk-NMKCJNQM.mjs +20 -0
  191. package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-NMKCJNQM.mjs.map} +1 -1
  192. package/dist/esm/chunk-NW45SCPY.mjs +36 -0
  193. package/dist/esm/{chunk-GSD4OOM3.mjs.map → chunk-NW45SCPY.mjs.map} +1 -1
  194. package/dist/esm/chunk-NXFO2W4G.mjs +84 -0
  195. package/dist/esm/{chunk-QMURTXFM.mjs.map → chunk-NXFO2W4G.mjs.map} +1 -1
  196. package/dist/esm/chunk-NYL77J4X.mjs +97 -0
  197. package/dist/esm/chunk-NYL77J4X.mjs.map +1 -0
  198. package/dist/esm/chunk-O6PSHSN3.mjs +53 -0
  199. package/dist/esm/{chunk-MFKMAAWA.mjs.map → chunk-O6PSHSN3.mjs.map} +1 -1
  200. package/dist/esm/chunk-OR7TEZ25.mjs +16 -0
  201. package/dist/esm/chunk-OR7TEZ25.mjs.map +1 -0
  202. package/dist/esm/chunk-PCLNX6FS.mjs +17 -0
  203. package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-PCLNX6FS.mjs.map} +1 -1
  204. package/dist/esm/chunk-PIMQHG2J.mjs +49 -0
  205. package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-PIMQHG2J.mjs.map} +1 -1
  206. package/dist/esm/chunk-PU5AFUX3.mjs +52 -0
  207. package/dist/esm/{chunk-LR65XHSF.mjs.map → chunk-PU5AFUX3.mjs.map} +1 -1
  208. package/dist/esm/chunk-PYLOAMR2.mjs +29 -0
  209. package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-PYLOAMR2.mjs.map} +1 -1
  210. package/dist/esm/chunk-QBBTUC66.mjs +15 -0
  211. package/dist/esm/{chunk-ROXFCLDT.mjs.map → chunk-QBBTUC66.mjs.map} +1 -1
  212. package/dist/esm/chunk-QFOG4LIN.mjs +319 -0
  213. package/dist/esm/{chunk-DM44OGQH.mjs.map → chunk-QFOG4LIN.mjs.map} +1 -1
  214. package/dist/esm/chunk-QMM2KL6C.mjs +12 -0
  215. package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-QMM2KL6C.mjs.map} +1 -1
  216. package/dist/esm/chunk-RCQMWXEW.mjs +35 -0
  217. package/dist/esm/{chunk-3WUGR46O.mjs.map → chunk-RCQMWXEW.mjs.map} +1 -1
  218. package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
  219. package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
  220. package/dist/esm/chunk-RX4VG2AT.mjs +314 -0
  221. package/dist/esm/{chunk-CNMQNPNV.mjs.map → chunk-RX4VG2AT.mjs.map} +1 -1
  222. package/dist/esm/chunk-SBB4YEPT.mjs +17 -0
  223. package/dist/esm/{chunk-56CNRT2K.mjs.map → chunk-SBB4YEPT.mjs.map} +1 -1
  224. package/dist/esm/chunk-SIJELMDP.mjs +29 -0
  225. package/dist/esm/{chunk-6EMN3BOV.mjs.map → chunk-SIJELMDP.mjs.map} +1 -1
  226. package/dist/esm/chunk-SS3NUM5L.mjs +94 -0
  227. package/dist/esm/{chunk-L54P6EGN.mjs.map → chunk-SS3NUM5L.mjs.map} +1 -1
  228. package/dist/esm/chunk-ST4QXIMI.mjs +37 -0
  229. package/dist/esm/{chunk-5P2S2SZZ.mjs.map → chunk-ST4QXIMI.mjs.map} +1 -1
  230. package/dist/esm/chunk-TBHU6ZW6.mjs +215 -0
  231. package/dist/esm/{chunk-7QJ6YJXP.mjs.map → chunk-TBHU6ZW6.mjs.map} +1 -1
  232. package/dist/esm/chunk-TLNHRJB2.mjs +155 -0
  233. package/dist/esm/chunk-TLNHRJB2.mjs.map +1 -0
  234. package/dist/esm/chunk-U3IUCR2G.mjs +54 -0
  235. package/dist/esm/{chunk-CU67XZNB.mjs.map → chunk-U3IUCR2G.mjs.map} +1 -1
  236. package/dist/esm/chunk-U7QBZ6PP.mjs +400 -0
  237. package/dist/esm/chunk-U7QBZ6PP.mjs.map +1 -0
  238. package/dist/esm/chunk-UEBBLQJ5.mjs +94 -0
  239. package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-UEBBLQJ5.mjs.map} +1 -1
  240. package/dist/esm/chunk-UKU6A2W2.mjs +232 -0
  241. package/dist/esm/{chunk-XO3HHRJV.mjs.map → chunk-UKU6A2W2.mjs.map} +1 -1
  242. package/dist/esm/chunk-UX5NSZEN.mjs +134 -0
  243. package/dist/esm/chunk-UX5NSZEN.mjs.map +1 -0
  244. package/dist/esm/chunk-VDJBDX3A.mjs +79 -0
  245. package/dist/esm/chunk-VDJBDX3A.mjs.map +1 -0
  246. package/dist/esm/chunk-VJP2VWMF.mjs +58 -0
  247. package/dist/esm/chunk-VJP2VWMF.mjs.map +1 -0
  248. package/dist/esm/chunk-VKJQORON.mjs +93 -0
  249. package/dist/esm/{chunk-734YX27W.mjs.map → chunk-VKJQORON.mjs.map} +1 -1
  250. package/dist/esm/chunk-VPWUODU4.mjs +51 -0
  251. package/dist/esm/{chunk-AU6W5OIH.mjs.map → chunk-VPWUODU4.mjs.map} +1 -1
  252. package/dist/esm/chunk-VZQXLVEP.mjs +197 -0
  253. package/dist/esm/{chunk-V6OS74OS.mjs.map → chunk-VZQXLVEP.mjs.map} +1 -1
  254. package/dist/esm/chunk-W76MGKZB.mjs +33 -0
  255. package/dist/esm/{chunk-CTIN3GTP.mjs.map → chunk-W76MGKZB.mjs.map} +1 -1
  256. package/dist/esm/chunk-WDRH2URB.mjs +91 -0
  257. package/dist/esm/chunk-WDRH2URB.mjs.map +1 -0
  258. package/dist/esm/chunk-WHBWEN6N.mjs +206 -0
  259. package/dist/esm/chunk-WHBWEN6N.mjs.map +1 -0
  260. package/dist/esm/chunk-WK5ZSNE2.mjs +173 -0
  261. package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-WK5ZSNE2.mjs.map} +1 -1
  262. package/dist/esm/chunk-WLTBF4DF.mjs +22 -0
  263. package/dist/esm/chunk-WLTBF4DF.mjs.map +1 -0
  264. package/dist/esm/chunk-WVGO4D7K.mjs +254 -0
  265. package/dist/esm/chunk-WVGO4D7K.mjs.map +1 -0
  266. package/dist/esm/chunk-XANFAUBD.mjs +44 -0
  267. package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-XANFAUBD.mjs.map} +1 -1
  268. package/dist/esm/chunk-Y2LV3S5W.mjs +410 -0
  269. package/dist/esm/chunk-Y2LV3S5W.mjs.map +1 -0
  270. package/dist/esm/chunk-YV7M4CFP.mjs +137 -0
  271. package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-YV7M4CFP.mjs.map} +1 -1
  272. package/dist/esm/chunk-YYOPNUX5.mjs +41 -0
  273. package/dist/esm/chunk-YYOPNUX5.mjs.map +1 -0
  274. package/dist/esm/chunk-ZAHJ7KXB.mjs +81 -0
  275. package/dist/esm/chunk-ZAHJ7KXB.mjs.map +1 -0
  276. package/dist/esm/chunk-ZMFKQUHL.mjs +117 -0
  277. package/dist/esm/{chunk-RIUZPGI5.mjs.map → chunk-ZMFKQUHL.mjs.map} +1 -1
  278. package/dist/esm/cli/index.d.mts +12 -0
  279. package/dist/esm/cli/index.mjs +12 -1
  280. package/dist/esm/cli/localNode.mjs +8 -1
  281. package/dist/esm/cli/move.d.mts +105 -0
  282. package/dist/esm/cli/move.mjs +8 -0
  283. package/dist/esm/cli/move.mjs.map +1 -0
  284. package/dist/esm/client/core.mjs +27 -1
  285. package/dist/esm/client/get.d.mts +2 -1
  286. package/dist/esm/client/get.mjs +32 -1
  287. package/dist/esm/client/index.d.mts +2 -2
  288. package/dist/esm/client/index.mjs +55 -1
  289. package/dist/esm/client/post.d.mts +3 -1
  290. package/dist/esm/client/post.mjs +36 -1
  291. package/dist/esm/client/types.d.mts +5 -1
  292. package/dist/esm/client/types.mjs +7 -1
  293. package/dist/esm/core/account/index.d.mts +5 -14
  294. package/dist/esm/core/account/index.mjs +19 -1
  295. package/dist/esm/core/account/utils/address.mjs +18 -1
  296. package/dist/esm/core/account/utils/index.mjs +19 -1
  297. package/dist/esm/core/accountAddress.mjs +15 -1
  298. package/dist/esm/core/authenticationKey.mjs +14 -1
  299. package/dist/esm/core/common.mjs +7 -1
  300. package/dist/esm/core/crypto/ed25519.mjs +29 -1
  301. package/dist/esm/core/crypto/ephemeral.d.mts +73 -0
  302. package/dist/esm/core/crypto/ephemeral.mjs +29 -0
  303. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
  304. package/dist/esm/core/crypto/hdKey.mjs +25 -1
  305. package/dist/esm/core/crypto/index.d.mts +6 -3
  306. package/dist/esm/core/crypto/index.mjs +124 -1
  307. package/dist/esm/core/crypto/keyless.d.mts +232 -0
  308. package/dist/esm/core/crypto/keyless.mjs +56 -0
  309. package/dist/esm/core/crypto/keyless.mjs.map +1 -0
  310. package/dist/esm/core/crypto/multiEd25519.mjs +28 -1
  311. package/dist/esm/core/crypto/multiKey.d.mts +7 -0
  312. package/dist/esm/core/crypto/multiKey.mjs +34 -1
  313. package/dist/esm/core/crypto/poseidon.d.mts +7 -0
  314. package/dist/esm/core/crypto/poseidon.mjs +16 -0
  315. package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
  316. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  317. package/dist/esm/core/crypto/proof.d.mts +21 -0
  318. package/dist/esm/core/crypto/proof.mjs +20 -0
  319. package/dist/esm/core/crypto/proof.mjs.map +1 -0
  320. package/dist/esm/core/crypto/publicKey.mjs +21 -1
  321. package/dist/esm/core/crypto/secp256k1.mjs +27 -1
  322. package/dist/esm/core/crypto/signature.mjs +19 -1
  323. package/dist/esm/core/crypto/singleKey.mjs +33 -1
  324. package/dist/esm/core/crypto/utils.mjs +9 -1
  325. package/dist/esm/core/hex.mjs +10 -1
  326. package/dist/esm/core/index.d.mts +5 -5
  327. package/dist/esm/core/index.mjs +141 -1
  328. package/dist/esm/index.d.mts +15 -8
  329. package/dist/esm/index.mjs +635 -1
  330. package/dist/esm/internal/account.d.mts +13 -1
  331. package/dist/esm/internal/account.mjs +106 -1
  332. package/dist/esm/internal/ans.d.mts +1 -1
  333. package/dist/esm/internal/ans.mjs +120 -1
  334. package/dist/esm/internal/coin.d.mts +7 -7
  335. package/dist/esm/internal/coin.mjs +85 -1
  336. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  337. package/dist/esm/internal/digitalAsset.mjs +127 -1
  338. package/dist/esm/internal/event.d.mts +1 -1
  339. package/dist/esm/internal/event.mjs +55 -1
  340. package/dist/esm/internal/faucet.d.mts +1 -1
  341. package/dist/esm/internal/faucet.mjs +52 -1
  342. package/dist/esm/internal/fungibleAsset.d.mts +5 -5
  343. package/dist/esm/internal/fungibleAsset.mjs +91 -1
  344. package/dist/esm/internal/general.mjs +46 -1
  345. package/dist/esm/internal/keyless.d.mts +68 -0
  346. package/dist/esm/internal/keyless.mjs +74 -0
  347. package/dist/esm/internal/keyless.mjs.map +1 -0
  348. package/dist/esm/internal/staking.d.mts +1 -1
  349. package/dist/esm/internal/staking.mjs +53 -1
  350. package/dist/esm/internal/transaction.mjs +51 -1
  351. package/dist/esm/internal/transactionSubmission.d.mts +1 -1
  352. package/dist/esm/internal/transactionSubmission.mjs +102 -1
  353. package/dist/esm/internal/view.d.mts +7 -7
  354. package/dist/esm/internal/view.mjs +83 -1
  355. package/dist/esm/transactions/authenticator/account.d.mts +3 -4
  356. package/dist/esm/transactions/authenticator/account.mjs +44 -1
  357. package/dist/esm/transactions/authenticator/index.mjs +60 -1
  358. package/dist/esm/transactions/authenticator/transaction.mjs +48 -1
  359. package/dist/esm/transactions/index.d.mts +2 -2
  360. package/dist/esm/transactions/index.mjs +284 -1
  361. package/dist/esm/transactions/instances/chainId.mjs +11 -1
  362. package/dist/esm/transactions/instances/identifier.mjs +11 -1
  363. package/dist/esm/transactions/instances/index.mjs +96 -1
  364. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  365. package/dist/esm/transactions/instances/moduleId.mjs +38 -1
  366. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +43 -1
  367. package/dist/esm/transactions/instances/rawTransaction.mjs +48 -1
  368. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +20 -1
  369. package/dist/esm/transactions/instances/signedTransaction.mjs +45 -1
  370. package/dist/esm/transactions/instances/simpleTransaction.mjs +43 -1
  371. package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
  372. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  373. package/dist/esm/transactions/instances/transactionPayload.mjs +56 -1
  374. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +13 -1
  375. package/dist/esm/transactions/management/accountSequenceNumber.mjs +74 -1
  376. package/dist/esm/transactions/management/asyncQueue.mjs +9 -1
  377. package/dist/esm/transactions/management/index.d.mts +2 -2
  378. package/dist/esm/transactions/management/index.mjs +95 -1
  379. package/dist/esm/transactions/management/transactionWorker.d.mts +1 -1
  380. package/dist/esm/transactions/management/transactionWorker.mjs +91 -1
  381. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
  382. package/dist/esm/transactions/transactionBuilder/helpers.mjs +75 -1
  383. package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
  384. package/dist/esm/transactions/transactionBuilder/index.mjs +162 -1
  385. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
  386. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +85 -1
  387. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +72 -0
  388. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +59 -0
  389. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
  390. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +6 -28
  391. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +98 -1
  392. package/dist/esm/transactions/typeTag/index.mjs +74 -1
  393. package/dist/esm/transactions/typeTag/parser.mjs +43 -1
  394. package/dist/esm/transactions/types.d.mts +6 -6
  395. package/dist/esm/transactions/types.mjs +1 -1
  396. package/dist/esm/types/generated/queries.mjs +57 -1
  397. package/dist/esm/types/generated/types.mjs +809 -1
  398. package/dist/esm/types/generated/types.mjs.map +1 -1
  399. package/dist/esm/types/index.d.mts +19 -3
  400. package/dist/esm/types/index.mjs +68 -1
  401. package/dist/esm/types/indexer.mjs +1 -1
  402. package/dist/esm/types/keyless.d.mts +69 -0
  403. package/dist/esm/types/keyless.mjs +10 -0
  404. package/dist/esm/types/keyless.mjs.map +1 -0
  405. package/dist/esm/utils/apiEndpoints.d.mts +3 -2
  406. package/dist/esm/utils/apiEndpoints.mjs +21 -1
  407. package/dist/esm/utils/const.d.mts +3 -1
  408. package/dist/esm/utils/const.mjs +21 -1
  409. package/dist/esm/utils/helpers.mjs +7 -1
  410. package/dist/esm/utils/index.d.mts +1 -1
  411. package/dist/esm/utils/index.mjs +56 -1
  412. package/dist/esm/utils/memoize.mjs +9 -1
  413. package/dist/esm/utils/normalizeBundle.mjs +19 -1
  414. package/dist/esm/version.d.mts +1 -1
  415. package/dist/esm/version.mjs +7 -1
  416. package/package.json +11 -3
  417. package/src/{core/account → account}/Account.ts +25 -15
  418. package/src/{core/account → account}/Ed25519Account.ts +45 -9
  419. package/src/account/EphemeralKeyPair.ts +161 -0
  420. package/src/account/KeylessAccount.ts +342 -0
  421. package/src/account/MultiKeyAccount.ts +186 -0
  422. package/src/{core/account → account}/SingleKeyAccount.ts +45 -10
  423. package/src/account/index.ts +6 -0
  424. package/src/api/account.ts +2 -1
  425. package/src/api/ans.ts +2 -1
  426. package/src/api/aptos.ts +6 -0
  427. package/src/api/aptosConfig.ts +46 -1
  428. package/src/api/digitalAsset.ts +2 -1
  429. package/src/api/fungibleAsset.ts +2 -1
  430. package/src/api/keyless.ts +48 -0
  431. package/src/api/transaction.ts +2 -1
  432. package/src/api/transactionSubmission/management.ts +1 -1
  433. package/src/api/transactionSubmission/sign.ts +1 -1
  434. package/src/bcs/deserializer.ts +40 -0
  435. package/src/bcs/serializer.ts +18 -0
  436. package/src/cli/index.ts +1 -0
  437. package/src/cli/move.ts +183 -0
  438. package/src/client/core.ts +8 -0
  439. package/src/client/get.ts +6 -0
  440. package/src/client/post.ts +12 -0
  441. package/src/client/types.ts +1 -1
  442. package/src/core/account/index.ts +0 -3
  443. package/src/core/crypto/ephemeral.ts +138 -0
  444. package/src/core/crypto/index.ts +2 -0
  445. package/src/core/crypto/keyless.ts +453 -0
  446. package/src/core/crypto/multiKey.ts +17 -6
  447. package/src/core/crypto/poseidon.ts +134 -0
  448. package/src/core/crypto/proof.ts +16 -0
  449. package/src/core/crypto/singleKey.ts +11 -0
  450. package/src/core/index.ts +0 -1
  451. package/src/index.ts +1 -0
  452. package/src/internal/account.ts +1 -1
  453. package/src/internal/ans.ts +2 -2
  454. package/src/internal/digitalAsset.ts +2 -1
  455. package/src/internal/fungibleAsset.ts +3 -2
  456. package/src/internal/keyless.ts +119 -0
  457. package/src/internal/transactionSubmission.ts +24 -13
  458. package/src/transactions/authenticator/account.ts +6 -11
  459. package/src/transactions/management/accountSequenceNumber.ts +1 -1
  460. package/src/transactions/management/transactionWorker.ts +1 -1
  461. package/src/transactions/transactionBuilder/index.ts +1 -0
  462. package/src/transactions/transactionBuilder/signingMessage.ts +93 -0
  463. package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -75
  464. package/src/types/index.ts +22 -0
  465. package/src/types/keyless.ts +37 -0
  466. package/src/utils/apiEndpoints.ts +14 -6
  467. package/src/utils/const.ts +2 -0
  468. package/src/version.ts +1 -1
  469. package/dist/common/chunk-KSEUZTKY.js +0 -2
  470. package/dist/common/chunk-KSEUZTKY.js.map +0 -1
  471. package/dist/esm/chunk-24IKVZBK.mjs +0 -2
  472. package/dist/esm/chunk-24IKVZBK.mjs.map +0 -1
  473. package/dist/esm/chunk-2HISPUZZ.mjs +0 -2
  474. package/dist/esm/chunk-2HISPUZZ.mjs.map +0 -1
  475. package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
  476. package/dist/esm/chunk-3WUGR46O.mjs +0 -2
  477. package/dist/esm/chunk-52C73T26.mjs +0 -2
  478. package/dist/esm/chunk-56CNRT2K.mjs +0 -2
  479. package/dist/esm/chunk-5P2S2SZZ.mjs +0 -2
  480. package/dist/esm/chunk-6CFRW26C.mjs +0 -2
  481. package/dist/esm/chunk-6CFRW26C.mjs.map +0 -1
  482. package/dist/esm/chunk-6EMN3BOV.mjs +0 -2
  483. package/dist/esm/chunk-6FBKUTGF.mjs +0 -2
  484. package/dist/esm/chunk-6IFMQ5AS.mjs +0 -2
  485. package/dist/esm/chunk-6IFMQ5AS.mjs.map +0 -1
  486. package/dist/esm/chunk-734YX27W.mjs +0 -2
  487. package/dist/esm/chunk-7QJ6YJXP.mjs +0 -2
  488. package/dist/esm/chunk-AD3VLZ7I.mjs +0 -2
  489. package/dist/esm/chunk-AD3VLZ7I.mjs.map +0 -1
  490. package/dist/esm/chunk-AH44UPM4.mjs +0 -2
  491. package/dist/esm/chunk-AOCNYMMX.mjs +0 -2
  492. package/dist/esm/chunk-AU6W5OIH.mjs +0 -2
  493. package/dist/esm/chunk-B3R6G6QP.mjs +0 -2
  494. package/dist/esm/chunk-B3R6G6QP.mjs.map +0 -1
  495. package/dist/esm/chunk-B7TQGVGL.mjs +0 -2
  496. package/dist/esm/chunk-BWFJHFBQ.mjs +0 -2
  497. package/dist/esm/chunk-CNMQNPNV.mjs +0 -2
  498. package/dist/esm/chunk-CTIN3GTP.mjs +0 -2
  499. package/dist/esm/chunk-CU67XZNB.mjs +0 -2
  500. package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
  501. package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
  502. package/dist/esm/chunk-DM44OGQH.mjs +0 -2
  503. package/dist/esm/chunk-DMKUAQB7.mjs +0 -2
  504. package/dist/esm/chunk-DPV25ZKR.mjs +0 -2
  505. package/dist/esm/chunk-DSTKXJMA.mjs +0 -2
  506. package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
  507. package/dist/esm/chunk-EOFJFE4T.mjs +0 -2
  508. package/dist/esm/chunk-EOFJFE4T.mjs.map +0 -1
  509. package/dist/esm/chunk-FATWMUXK.mjs +0 -2
  510. package/dist/esm/chunk-FATWMUXK.mjs.map +0 -1
  511. package/dist/esm/chunk-FBPNHF54.mjs +0 -2
  512. package/dist/esm/chunk-FS3NSGBF.mjs +0 -2
  513. package/dist/esm/chunk-FVA2OPG4.mjs +0 -2
  514. package/dist/esm/chunk-G2O323HP.mjs +0 -2
  515. package/dist/esm/chunk-GSD4OOM3.mjs +0 -2
  516. package/dist/esm/chunk-HQ5I4Q3H.mjs +0 -2
  517. package/dist/esm/chunk-HQ5I4Q3H.mjs.map +0 -1
  518. package/dist/esm/chunk-IIPYR7PF.mjs +0 -2
  519. package/dist/esm/chunk-IIPYR7PF.mjs.map +0 -1
  520. package/dist/esm/chunk-IKYIJYBY.mjs +0 -2
  521. package/dist/esm/chunk-IKYIJYBY.mjs.map +0 -1
  522. package/dist/esm/chunk-IOSQVDZI.mjs +0 -2
  523. package/dist/esm/chunk-KVZ4XMZS.mjs +0 -2
  524. package/dist/esm/chunk-KVZ4XMZS.mjs.map +0 -1
  525. package/dist/esm/chunk-L54P6EGN.mjs +0 -2
  526. package/dist/esm/chunk-LR65XHSF.mjs +0 -2
  527. package/dist/esm/chunk-MACC2BLE.mjs +0 -2
  528. package/dist/esm/chunk-MC6G725U.mjs +0 -2
  529. package/dist/esm/chunk-MC6G725U.mjs.map +0 -1
  530. package/dist/esm/chunk-MFKMAAWA.mjs +0 -2
  531. package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
  532. package/dist/esm/chunk-NNQJBFRB.mjs +0 -2
  533. package/dist/esm/chunk-NPFNYP75.mjs +0 -2
  534. package/dist/esm/chunk-O2F53NKI.mjs +0 -2
  535. package/dist/esm/chunk-O4JRPZZM.mjs +0 -2
  536. package/dist/esm/chunk-ODRO4CSA.mjs +0 -2
  537. package/dist/esm/chunk-ODRO4CSA.mjs.map +0 -1
  538. package/dist/esm/chunk-OVJQWQ2N.mjs +0 -2
  539. package/dist/esm/chunk-OVJQWQ2N.mjs.map +0 -1
  540. package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
  541. package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
  542. package/dist/esm/chunk-PFIMEXNN.mjs +0 -2
  543. package/dist/esm/chunk-PFIMEXNN.mjs.map +0 -1
  544. package/dist/esm/chunk-PZGLV5UQ.mjs +0 -2
  545. package/dist/esm/chunk-Q3TZGQVC.mjs +0 -2
  546. package/dist/esm/chunk-Q3TZGQVC.mjs.map +0 -1
  547. package/dist/esm/chunk-QIAHBEEW.mjs +0 -2
  548. package/dist/esm/chunk-QMURTXFM.mjs +0 -2
  549. package/dist/esm/chunk-QTRYMRYK.mjs +0 -2
  550. package/dist/esm/chunk-R5QUBEH6.mjs +0 -2
  551. package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
  552. package/dist/esm/chunk-RHBCVCOS.mjs +0 -2
  553. package/dist/esm/chunk-RIUZPGI5.mjs +0 -2
  554. package/dist/esm/chunk-ROXFCLDT.mjs +0 -2
  555. package/dist/esm/chunk-SG4MAOCF.mjs +0 -2
  556. package/dist/esm/chunk-SUAKPNKQ.mjs +0 -2
  557. package/dist/esm/chunk-SUAKPNKQ.mjs.map +0 -1
  558. package/dist/esm/chunk-TBMAJ6AW.mjs +0 -2
  559. package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
  560. package/dist/esm/chunk-TLOPIURC.mjs +0 -2
  561. package/dist/esm/chunk-TLOPIURC.mjs.map +0 -1
  562. package/dist/esm/chunk-U43IJHQN.mjs +0 -2
  563. package/dist/esm/chunk-U6Z4FNB7.mjs +0 -2
  564. package/dist/esm/chunk-UFT7US42.mjs +0 -2
  565. package/dist/esm/chunk-UML2VQZT.mjs +0 -2
  566. package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
  567. package/dist/esm/chunk-V3Q2KXJU.mjs +0 -2
  568. package/dist/esm/chunk-V4SRNEV3.mjs +0 -2
  569. package/dist/esm/chunk-V4SRNEV3.mjs.map +0 -1
  570. package/dist/esm/chunk-V6OS74OS.mjs +0 -2
  571. package/dist/esm/chunk-VVIG4E7Q.mjs +0 -2
  572. package/dist/esm/chunk-W4ZW7QHA.mjs +0 -2
  573. package/dist/esm/chunk-WFZDFFBM.mjs +0 -2
  574. package/dist/esm/chunk-WLF5YQM4.mjs +0 -2
  575. package/dist/esm/chunk-WLF5YQM4.mjs.map +0 -1
  576. package/dist/esm/chunk-XDGQTMDV.mjs +0 -2
  577. package/dist/esm/chunk-XDGQTMDV.mjs.map +0 -1
  578. package/dist/esm/chunk-XO3HHRJV.mjs +0 -2
  579. package/dist/esm/chunk-YFRXBEOC.mjs +0 -2
  580. package/dist/esm/chunk-YFRXBEOC.mjs.map +0 -1
  581. package/dist/esm/chunk-YPTF6MLX.mjs +0 -2
  582. package/dist/esm/chunk-YPTF6MLX.mjs.map +0 -1
  583. package/dist/esm/chunk-YU3KB3UV.mjs +0 -2
  584. package/dist/esm/chunk-Z5YFM2AW.mjs +0 -2
  585. package/dist/esm/chunk-Z5YFM2AW.mjs.map +0 -1
  586. package/dist/esm/chunk-ZYYK3UXP.mjs +0 -2
  587. package/dist/esm/chunk-ZZZZVONX.mjs +0 -2
  588. package/dist/esm/core/account/Account.d.mts +0 -20
  589. package/dist/esm/core/account/Account.mjs +0 -2
  590. package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
  591. package/dist/esm/core/account/Ed25519Account.mjs +0 -2
  592. package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
  593. package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
  594. /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
  595. /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
  596. /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
  597. /package/dist/esm/{chunk-FVA2OPG4.mjs.map → account/KeylessAccount.mjs.map} +0 -0
  598. /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
  599. /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
  600. /package/dist/esm/{chunk-R7G3CLRI.mjs.map → account/index.mjs.map} +0 -0
  601. /package/dist/esm/{chunk-UVSRX4SV.mjs.map → api/keyless.mjs.map} +0 -0
@@ -0,0 +1,2149 @@
1
+ declare const NetworkToIndexerAPI: Record<string, string>;
2
+ declare const NetworkToNodeAPI: Record<string, string>;
3
+ declare const NetworkToFaucetAPI: Record<string, string>;
4
+ declare const NetworkToPepperAPI: Record<string, string>;
5
+ declare const NetworkToProverAPI: Record<string, string>;
6
+ declare enum Network {
7
+ MAINNET = "mainnet",
8
+ TESTNET = "testnet",
9
+ DEVNET = "devnet",
10
+ LOCAL = "local",
11
+ CUSTOM = "custom"
12
+ }
13
+ declare const NetworkToChainId: Record<string, number>;
14
+ declare const NetworkToNetworkName: Record<string, Network>;
15
+
16
+ type GetAccountCoinsDataQuery = {
17
+ current_fungible_asset_balances: Array<{
18
+ amount: any;
19
+ asset_type: string;
20
+ is_frozen: boolean;
21
+ is_primary: boolean;
22
+ last_transaction_timestamp: any;
23
+ last_transaction_version: any;
24
+ owner_address: string;
25
+ storage_id: string;
26
+ token_standard: string;
27
+ metadata?: {
28
+ token_standard: string;
29
+ symbol: string;
30
+ supply_aggregator_table_key_v1?: string | null;
31
+ supply_aggregator_table_handle_v1?: string | null;
32
+ project_uri?: string | null;
33
+ name: string;
34
+ last_transaction_version: any;
35
+ last_transaction_timestamp: any;
36
+ icon_uri?: string | null;
37
+ decimals: number;
38
+ creator_address: string;
39
+ asset_type: string;
40
+ } | null;
41
+ }>;
42
+ };
43
+ type GetAccountCollectionsWithOwnedTokensQuery = {
44
+ current_collection_ownership_v2_view: Array<{
45
+ collection_id?: string | null;
46
+ collection_name?: string | null;
47
+ collection_uri?: string | null;
48
+ creator_address?: string | null;
49
+ distinct_tokens?: any | null;
50
+ last_transaction_version?: any | null;
51
+ owner_address?: string | null;
52
+ single_token_uri?: string | null;
53
+ current_collection?: {
54
+ collection_id: string;
55
+ collection_name: string;
56
+ creator_address: string;
57
+ current_supply: any;
58
+ description: string;
59
+ last_transaction_timestamp: any;
60
+ last_transaction_version: any;
61
+ mutable_description?: boolean | null;
62
+ max_supply?: any | null;
63
+ mutable_uri?: boolean | null;
64
+ table_handle_v1?: string | null;
65
+ token_standard: string;
66
+ total_minted_v2?: any | null;
67
+ uri: string;
68
+ } | null;
69
+ }>;
70
+ };
71
+ type GetAccountOwnedObjectsQuery = {
72
+ current_objects: Array<{
73
+ allow_ungated_transfer: boolean;
74
+ state_key_hash: string;
75
+ owner_address: string;
76
+ object_address: string;
77
+ last_transaction_version: any;
78
+ last_guid_creation_num: any;
79
+ is_deleted: boolean;
80
+ }>;
81
+ };
82
+ type GetAccountOwnedTokensQuery = {
83
+ current_token_ownerships_v2: Array<{
84
+ token_standard: string;
85
+ token_properties_mutated_v1?: any | null;
86
+ token_data_id: string;
87
+ table_type_v1?: string | null;
88
+ storage_id: string;
89
+ property_version_v1: any;
90
+ owner_address: string;
91
+ last_transaction_version: any;
92
+ last_transaction_timestamp: any;
93
+ is_soulbound_v2?: boolean | null;
94
+ is_fungible_v2?: boolean | null;
95
+ amount: any;
96
+ current_token_data?: {
97
+ collection_id: string;
98
+ description: string;
99
+ is_fungible_v2?: boolean | null;
100
+ largest_property_version_v1?: any | null;
101
+ last_transaction_timestamp: any;
102
+ last_transaction_version: any;
103
+ maximum?: any | null;
104
+ supply: any;
105
+ token_data_id: string;
106
+ token_name: string;
107
+ token_properties: any;
108
+ token_standard: string;
109
+ token_uri: string;
110
+ decimals: any;
111
+ current_collection?: {
112
+ collection_id: string;
113
+ collection_name: string;
114
+ creator_address: string;
115
+ current_supply: any;
116
+ description: string;
117
+ last_transaction_timestamp: any;
118
+ last_transaction_version: any;
119
+ max_supply?: any | null;
120
+ mutable_description?: boolean | null;
121
+ mutable_uri?: boolean | null;
122
+ table_handle_v1?: string | null;
123
+ token_standard: string;
124
+ total_minted_v2?: any | null;
125
+ uri: string;
126
+ } | null;
127
+ } | null;
128
+ }>;
129
+ };
130
+ type GetAccountOwnedTokensFromCollectionQuery = {
131
+ current_token_ownerships_v2: Array<{
132
+ token_standard: string;
133
+ token_properties_mutated_v1?: any | null;
134
+ token_data_id: string;
135
+ table_type_v1?: string | null;
136
+ storage_id: string;
137
+ property_version_v1: any;
138
+ owner_address: string;
139
+ last_transaction_version: any;
140
+ last_transaction_timestamp: any;
141
+ is_soulbound_v2?: boolean | null;
142
+ is_fungible_v2?: boolean | null;
143
+ amount: any;
144
+ current_token_data?: {
145
+ collection_id: string;
146
+ description: string;
147
+ is_fungible_v2?: boolean | null;
148
+ largest_property_version_v1?: any | null;
149
+ last_transaction_timestamp: any;
150
+ last_transaction_version: any;
151
+ maximum?: any | null;
152
+ supply: any;
153
+ token_data_id: string;
154
+ token_name: string;
155
+ token_properties: any;
156
+ token_standard: string;
157
+ token_uri: string;
158
+ decimals: any;
159
+ current_collection?: {
160
+ collection_id: string;
161
+ collection_name: string;
162
+ creator_address: string;
163
+ current_supply: any;
164
+ description: string;
165
+ last_transaction_timestamp: any;
166
+ last_transaction_version: any;
167
+ max_supply?: any | null;
168
+ mutable_description?: boolean | null;
169
+ mutable_uri?: boolean | null;
170
+ table_handle_v1?: string | null;
171
+ token_standard: string;
172
+ total_minted_v2?: any | null;
173
+ uri: string;
174
+ } | null;
175
+ } | null;
176
+ }>;
177
+ };
178
+ type GetChainTopUserTransactionsQuery = {
179
+ user_transactions: Array<{
180
+ version: any;
181
+ }>;
182
+ };
183
+ type GetCollectionDataQuery = {
184
+ current_collections_v2: Array<{
185
+ collection_id: string;
186
+ collection_name: string;
187
+ creator_address: string;
188
+ current_supply: any;
189
+ description: string;
190
+ last_transaction_timestamp: any;
191
+ last_transaction_version: any;
192
+ max_supply?: any | null;
193
+ mutable_description?: boolean | null;
194
+ mutable_uri?: boolean | null;
195
+ table_handle_v1?: string | null;
196
+ token_standard: string;
197
+ total_minted_v2?: any | null;
198
+ uri: string;
199
+ }>;
200
+ };
201
+ type GetCurrentFungibleAssetBalancesQuery = {
202
+ current_fungible_asset_balances: Array<{
203
+ amount: any;
204
+ asset_type: string;
205
+ is_frozen: boolean;
206
+ is_primary: boolean;
207
+ last_transaction_timestamp: any;
208
+ last_transaction_version: any;
209
+ owner_address: string;
210
+ storage_id: string;
211
+ token_standard: string;
212
+ }>;
213
+ };
214
+ type GetDelegatedStakingActivitiesQuery = {
215
+ delegated_staking_activities: Array<{
216
+ amount: any;
217
+ delegator_address: string;
218
+ event_index: any;
219
+ event_type: string;
220
+ pool_address: string;
221
+ transaction_version: any;
222
+ }>;
223
+ };
224
+ type GetEventsQuery = {
225
+ events: Array<{
226
+ account_address: string;
227
+ creation_number: any;
228
+ data: any;
229
+ event_index: any;
230
+ sequence_number: any;
231
+ transaction_block_height: any;
232
+ transaction_version: any;
233
+ type: string;
234
+ indexed_type: string;
235
+ }>;
236
+ };
237
+ type GetFungibleAssetActivitiesQuery = {
238
+ fungible_asset_activities: Array<{
239
+ amount?: any | null;
240
+ asset_type: string;
241
+ block_height: any;
242
+ entry_function_id_str?: string | null;
243
+ event_index: any;
244
+ gas_fee_payer_address?: string | null;
245
+ is_frozen?: boolean | null;
246
+ is_gas_fee: boolean;
247
+ is_transaction_success: boolean;
248
+ owner_address: string;
249
+ storage_id: string;
250
+ storage_refund_amount: any;
251
+ token_standard: string;
252
+ transaction_timestamp: any;
253
+ transaction_version: any;
254
+ type: string;
255
+ }>;
256
+ };
257
+ type GetFungibleAssetMetadataQuery = {
258
+ fungible_asset_metadata: Array<{
259
+ icon_uri?: string | null;
260
+ project_uri?: string | null;
261
+ supply_aggregator_table_handle_v1?: string | null;
262
+ supply_aggregator_table_key_v1?: string | null;
263
+ creator_address: string;
264
+ asset_type: string;
265
+ decimals: number;
266
+ last_transaction_timestamp: any;
267
+ last_transaction_version: any;
268
+ name: string;
269
+ symbol: string;
270
+ token_standard: string;
271
+ }>;
272
+ };
273
+ type GetNamesQuery = {
274
+ current_aptos_names: Array<{
275
+ domain?: string | null;
276
+ expiration_timestamp?: any | null;
277
+ registered_address?: string | null;
278
+ subdomain?: string | null;
279
+ token_standard?: string | null;
280
+ is_primary?: boolean | null;
281
+ owner_address?: string | null;
282
+ }>;
283
+ };
284
+ type GetNumberOfDelegatorsQuery = {
285
+ num_active_delegator_per_pool: Array<{
286
+ num_active_delegator?: any | null;
287
+ pool_address?: string | null;
288
+ }>;
289
+ };
290
+ type GetProcessorStatusQuery = {
291
+ processor_status: Array<{
292
+ last_success_version: any;
293
+ processor: string;
294
+ last_updated: any;
295
+ }>;
296
+ };
297
+ type GetTokenActivityQuery = {
298
+ token_activities_v2: Array<{
299
+ after_value?: string | null;
300
+ before_value?: string | null;
301
+ entry_function_id_str?: string | null;
302
+ event_account_address: string;
303
+ event_index: any;
304
+ from_address?: string | null;
305
+ is_fungible_v2?: boolean | null;
306
+ property_version_v1: any;
307
+ to_address?: string | null;
308
+ token_amount: any;
309
+ token_data_id: string;
310
+ token_standard: string;
311
+ transaction_timestamp: any;
312
+ transaction_version: any;
313
+ type: string;
314
+ }>;
315
+ };
316
+ type GetCurrentTokenOwnershipQuery = {
317
+ current_token_ownerships_v2: Array<{
318
+ token_standard: string;
319
+ token_properties_mutated_v1?: any | null;
320
+ token_data_id: string;
321
+ table_type_v1?: string | null;
322
+ storage_id: string;
323
+ property_version_v1: any;
324
+ owner_address: string;
325
+ last_transaction_version: any;
326
+ last_transaction_timestamp: any;
327
+ is_soulbound_v2?: boolean | null;
328
+ is_fungible_v2?: boolean | null;
329
+ amount: any;
330
+ current_token_data?: {
331
+ collection_id: string;
332
+ description: string;
333
+ is_fungible_v2?: boolean | null;
334
+ largest_property_version_v1?: any | null;
335
+ last_transaction_timestamp: any;
336
+ last_transaction_version: any;
337
+ maximum?: any | null;
338
+ supply: any;
339
+ token_data_id: string;
340
+ token_name: string;
341
+ token_properties: any;
342
+ token_standard: string;
343
+ token_uri: string;
344
+ decimals: any;
345
+ current_collection?: {
346
+ collection_id: string;
347
+ collection_name: string;
348
+ creator_address: string;
349
+ current_supply: any;
350
+ description: string;
351
+ last_transaction_timestamp: any;
352
+ last_transaction_version: any;
353
+ max_supply?: any | null;
354
+ mutable_description?: boolean | null;
355
+ mutable_uri?: boolean | null;
356
+ table_handle_v1?: string | null;
357
+ token_standard: string;
358
+ total_minted_v2?: any | null;
359
+ uri: string;
360
+ } | null;
361
+ } | null;
362
+ }>;
363
+ };
364
+ type GetTokenDataQuery = {
365
+ current_token_datas_v2: Array<{
366
+ collection_id: string;
367
+ description: string;
368
+ is_fungible_v2?: boolean | null;
369
+ largest_property_version_v1?: any | null;
370
+ last_transaction_timestamp: any;
371
+ last_transaction_version: any;
372
+ maximum?: any | null;
373
+ supply: any;
374
+ token_data_id: string;
375
+ token_name: string;
376
+ token_properties: any;
377
+ token_standard: string;
378
+ token_uri: string;
379
+ decimals: any;
380
+ current_collection?: {
381
+ collection_id: string;
382
+ collection_name: string;
383
+ creator_address: string;
384
+ current_supply: any;
385
+ description: string;
386
+ last_transaction_timestamp: any;
387
+ last_transaction_version: any;
388
+ max_supply?: any | null;
389
+ mutable_description?: boolean | null;
390
+ mutable_uri?: boolean | null;
391
+ table_handle_v1?: string | null;
392
+ token_standard: string;
393
+ total_minted_v2?: any | null;
394
+ uri: string;
395
+ } | null;
396
+ }>;
397
+ };
398
+
399
+ /**
400
+ * GENERATED QUERY TYPES FROM GRAPHQL SCHEMA
401
+ *
402
+ * generated types we generate from graphql schema that match the structure of the
403
+ * response type when querying from Hasura schema.
404
+ *
405
+ * These types are used as the return type when making the actual request (usually
406
+ * under the /internal/ folder)
407
+ */
408
+
409
+ /**
410
+ * CUSTOM RESPONSE TYPES FOR THE END USER
411
+ *
412
+ * To provide a good dev exp, we build custom types derived from the
413
+ * query types to be the response type the end developer/user will
414
+ * work with.
415
+ *
416
+ * These types are used as the return type when calling a sdk api function
417
+ * that calls the function that queries the server (usually under the /api/ folder)
418
+ */
419
+ type GetAccountOwnedObjectsResponse = GetAccountOwnedObjectsQuery["current_objects"];
420
+ type GetAccountOwnedTokensQueryResponse = GetAccountOwnedTokensQuery["current_token_ownerships_v2"];
421
+ type GetAccountOwnedTokensFromCollectionResponse = GetAccountOwnedTokensFromCollectionQuery["current_token_ownerships_v2"];
422
+ type GetAccountCollectionsWithOwnedTokenResponse = GetAccountCollectionsWithOwnedTokensQuery["current_collection_ownership_v2_view"];
423
+ type GetAccountCoinsDataResponse = GetAccountCoinsDataQuery["current_fungible_asset_balances"];
424
+ type GetChainTopUserTransactionsResponse = GetChainTopUserTransactionsQuery["user_transactions"];
425
+ type GetEventsResponse = GetEventsQuery["events"];
426
+ type GetNumberOfDelegatorsResponse = GetNumberOfDelegatorsQuery["num_active_delegator_per_pool"];
427
+ type GetDelegatedStakingActivitiesResponse = GetDelegatedStakingActivitiesQuery["delegated_staking_activities"];
428
+ type GetCollectionDataResponse = GetCollectionDataQuery["current_collections_v2"][0];
429
+ type GetTokenDataResponse = GetTokenDataQuery["current_token_datas_v2"][0];
430
+ type GetProcessorStatusResponse = GetProcessorStatusQuery["processor_status"];
431
+ type GetFungibleAssetMetadataResponse = GetFungibleAssetMetadataQuery["fungible_asset_metadata"];
432
+ type GetFungibleAssetActivitiesResponse = GetFungibleAssetActivitiesQuery["fungible_asset_activities"];
433
+ type GetCurrentFungibleAssetBalancesResponse = GetCurrentFungibleAssetBalancesQuery["current_fungible_asset_balances"];
434
+ type GetTokenActivityResponse = GetTokenActivityQuery["token_activities_v2"];
435
+ type GetCurrentTokenOwnershipResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"][0];
436
+ type GetOwnedTokensResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"];
437
+ type GetANSNameResponse = GetNamesQuery["current_aptos_names"];
438
+ /**
439
+ * A generic type that being passed by each function and holds an
440
+ * array of properties we can sort the query by
441
+ */
442
+ type OrderBy<T> = Array<{
443
+ [K in keyof T]?: OrderByValue;
444
+ }>;
445
+ type OrderByValue = "asc" | "asc_nulls_first" | "asc_nulls_last" | "desc" | "desc_nulls_first" | "desc_nulls_last";
446
+ /**
447
+ * Refers to the token standard we want to query for
448
+ */
449
+ type TokenStandard = "v1" | "v2";
450
+ /**
451
+ * The graphql query type to pass into the `queryIndexer` function
452
+ */
453
+ type GraphqlQuery = {
454
+ query: string;
455
+ variables?: {};
456
+ };
457
+
458
+ declare enum MimeType {
459
+ /**
460
+ * JSON representation, used for transaction submission and accept type JSON output
461
+ */
462
+ JSON = "application/json",
463
+ /**
464
+ * BCS representation, used for accept type BCS output
465
+ */
466
+ BCS = "application/x-bcs",
467
+ /**
468
+ * BCS representation, used for transaction submission in BCS input
469
+ */
470
+ BCS_SIGNED_TRANSACTION = "application/x.aptos.signed_transaction+bcs",
471
+ BCS_VIEW_FUNCTION = "application/x.aptos.view_function+bcs"
472
+ }
473
+ /**
474
+ * Hex data as input to a function
475
+ */
476
+ type HexInput = string | Uint8Array;
477
+ /**
478
+ * TypeTag enum as they are represented in Rust
479
+ * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}
480
+ */
481
+ declare enum TypeTagVariants {
482
+ Bool = 0,
483
+ U8 = 1,
484
+ U64 = 2,
485
+ U128 = 3,
486
+ Address = 4,
487
+ Signer = 5,
488
+ Vector = 6,
489
+ Struct = 7,
490
+ U16 = 8,
491
+ U32 = 9,
492
+ U256 = 10,
493
+ Reference = 254,// This is specifically a placeholder and does not represent a real type
494
+ Generic = 255
495
+ }
496
+ /**
497
+ * Script transaction arguments enum as they are represented in Rust
498
+ * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}
499
+ */
500
+ declare enum ScriptTransactionArgumentVariants {
501
+ U8 = 0,
502
+ U64 = 1,
503
+ U128 = 2,
504
+ Address = 3,
505
+ U8Vector = 4,
506
+ Bool = 5,
507
+ U16 = 6,
508
+ U32 = 7,
509
+ U256 = 8
510
+ }
511
+ /**
512
+ * Transaction payload enum as they are represented in Rust
513
+ * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}
514
+ */
515
+ declare enum TransactionPayloadVariants {
516
+ Script = 0,
517
+ EntryFunction = 2,
518
+ Multisig = 3
519
+ }
520
+ /**
521
+ * Transaction variants enum as they are represented in Rust
522
+ * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}
523
+ */
524
+ declare enum TransactionVariants {
525
+ MultiAgentTransaction = 0,
526
+ FeePayerTransaction = 1
527
+ }
528
+ /**
529
+ * Transaction Authenticator enum as they are represented in Rust
530
+ * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}
531
+ */
532
+ declare enum TransactionAuthenticatorVariant {
533
+ Ed25519 = 0,
534
+ MultiEd25519 = 1,
535
+ MultiAgent = 2,
536
+ FeePayer = 3,
537
+ SingleSender = 4
538
+ }
539
+ /**
540
+ * Transaction Authenticator enum as they are represented in Rust
541
+ * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}
542
+ */
543
+ declare enum AccountAuthenticatorVariant {
544
+ Ed25519 = 0,
545
+ MultiEd25519 = 1,
546
+ SingleKey = 2,
547
+ MultiKey = 3
548
+ }
549
+ declare enum AnyPublicKeyVariant {
550
+ Ed25519 = 0,
551
+ Secp256k1 = 1,
552
+ Keyless = 3
553
+ }
554
+ declare enum AnySignatureVariant {
555
+ Ed25519 = 0,
556
+ Secp256k1 = 1,
557
+ Keyless = 3
558
+ }
559
+ declare enum EphemeralPublicKeyVariant {
560
+ Ed25519 = 0
561
+ }
562
+ declare enum EphemeralSignatureVariant {
563
+ Ed25519 = 0
564
+ }
565
+ declare enum EphemeralCertificateVariant {
566
+ ZkProof = 0
567
+ }
568
+ declare enum ZkpVariant {
569
+ Groth16 = 0
570
+ }
571
+ /**
572
+ * BCS types
573
+ */
574
+ type Uint8 = number;
575
+ type Uint16 = number;
576
+ type Uint32 = number;
577
+ type Uint64 = bigint;
578
+ type Uint128 = bigint;
579
+ type Uint256 = bigint;
580
+ type AnyNumber = number | bigint;
581
+ /**
582
+ * Set of configuration options that can be provided when initializing the SDK.
583
+ * The purpose of these options is to configure various aspects of the SDK's
584
+ * behavior and interaction with the Aptos network
585
+ */
586
+ type AptosSettings = {
587
+ readonly network?: Network;
588
+ readonly fullnode?: string;
589
+ readonly faucet?: string;
590
+ readonly indexer?: string;
591
+ readonly pepper?: string;
592
+ readonly prover?: string;
593
+ readonly clientConfig?: ClientConfig;
594
+ readonly client?: Client;
595
+ readonly fullnodeConfig?: FullNodeConfig;
596
+ readonly indexerConfig?: IndexerConfig;
597
+ readonly faucetConfig?: FaucetConfig;
598
+ };
599
+ /**
600
+ *
601
+ * Controls the number of results that are returned and the starting position of those results.
602
+ * @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.
603
+ * @param limit specifies the maximum number of items or records to return in a query result. Default is 25.
604
+ */
605
+ interface PaginationArgs {
606
+ offset?: AnyNumber;
607
+ limit?: number;
608
+ }
609
+ interface TokenStandardArg {
610
+ tokenStandard?: TokenStandard;
611
+ }
612
+ interface OrderByArg<T extends {}> {
613
+ orderBy?: OrderBy<T>;
614
+ }
615
+ interface WhereArg<T extends {}> {
616
+ where?: T;
617
+ }
618
+ /**
619
+ * QUERY TYPES
620
+ */
621
+ /**
622
+ * A configuration object we can pass with the request to the server.
623
+ *
624
+ * @param API_KEY - api key generated from developer portal {@link https://developers.aptoslabs.com/manage/api-keys}}
625
+ * @param HEADERS - extra headers we want to send with the request
626
+ * @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent
627
+ */
628
+ type ClientConfig = ClientHeadersType & {
629
+ WITH_CREDENTIALS?: boolean;
630
+ API_KEY?: string;
631
+ };
632
+ /**
633
+ * A Fullnode only configuration object
634
+ *
635
+ * @param HEADERS - extra headers we want to send with the request
636
+ */
637
+ type FullNodeConfig = ClientHeadersType;
638
+ /**
639
+ * An Indexer only configuration object
640
+ *
641
+ * @param HEADERS - extra headers we want to send with the request
642
+ */
643
+ type IndexerConfig = ClientHeadersType;
644
+ /**
645
+ * A Faucet only configuration object
646
+ *
647
+ * @param HEADERS - extra headers we want to send with the request
648
+ * @param AUTH_TOKEN - an auth token to send with a faucet request
649
+ */
650
+ type FaucetConfig = ClientHeadersType & {
651
+ AUTH_TOKEN?: string;
652
+ };
653
+ /**
654
+ * General type definition for client HEADERS
655
+ */
656
+ type ClientHeadersType = {
657
+ HEADERS?: Record<string, string | number | boolean>;
658
+ };
659
+ interface ClientRequest<Req> {
660
+ url: string;
661
+ method: "GET" | "POST";
662
+ originMethod?: string;
663
+ body?: Req;
664
+ contentType?: string;
665
+ params?: any;
666
+ overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;
667
+ headers?: Record<string, any>;
668
+ }
669
+ interface ClientResponse<Res> {
670
+ status: number;
671
+ statusText: string;
672
+ data: Res;
673
+ config?: any;
674
+ request?: any;
675
+ response?: any;
676
+ headers?: any;
677
+ }
678
+ interface Client {
679
+ provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;
680
+ }
681
+ /**
682
+ * The API request type
683
+ *
684
+ * @param url - the url to make the request to, i.e https://fullnode.devnet.aptoslabs.com/v1
685
+ * @param method - the request method "GET" | "POST"
686
+ * @param endpoint (optional) - the endpoint to make the request to, i.e transactions
687
+ * @param body (optional) - the body of the request
688
+ * @param contentType (optional) - the content type to set the `content-type` header to,
689
+ * by default is set to `application/json`
690
+ * @param params (optional) - query params to add to the request
691
+ * @param originMethod (optional) - the local method the request came from
692
+ * @param overrides (optional) - a `ClientConfig` object type to override request data
693
+ */
694
+ type AptosRequest = {
695
+ url: string;
696
+ method: "GET" | "POST";
697
+ path?: string;
698
+ body?: any;
699
+ contentType?: string;
700
+ acceptType?: string;
701
+ params?: Record<string, string | AnyNumber | boolean | undefined>;
702
+ originMethod?: string;
703
+ overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;
704
+ };
705
+ /**
706
+ * Specifies ledger version of transactions. By default latest version will be used
707
+ */
708
+ type LedgerVersionArg = {
709
+ ledgerVersion?: AnyNumber;
710
+ };
711
+ /**
712
+ * RESPONSE TYPES
713
+ */
714
+ /**
715
+ * Type holding the outputs of the estimate gas API
716
+ */
717
+ type GasEstimation = {
718
+ /**
719
+ * The deprioritized estimate for the gas unit price
720
+ */
721
+ deprioritized_gas_estimate?: number;
722
+ /**
723
+ * The current estimate for the gas unit price
724
+ */
725
+ gas_estimate: number;
726
+ /**
727
+ * The prioritized estimate for the gas unit price
728
+ */
729
+ prioritized_gas_estimate?: number;
730
+ };
731
+ type MoveResource = {
732
+ type: MoveStructId;
733
+ data: {};
734
+ };
735
+ type AccountData = {
736
+ sequence_number: string;
737
+ authentication_key: string;
738
+ };
739
+ type MoveModuleBytecode = {
740
+ bytecode: string;
741
+ abi?: MoveModule;
742
+ };
743
+ /**
744
+ * TRANSACTION TYPES
745
+ */
746
+ declare enum TransactionResponseType {
747
+ Pending = "pending_transaction",
748
+ User = "user_transaction",
749
+ Genesis = "genesis_transaction",
750
+ BlockMetadata = "block_metadata_transaction",
751
+ StateCheckpoint = "state_checkpoint_transaction",
752
+ Validator = "validator_transaction"
753
+ }
754
+ type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;
755
+ type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse | ValidatorTransactionResponse;
756
+ declare function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse;
757
+ declare function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse;
758
+ declare function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse;
759
+ declare function isBlockMetadataTransactionResponse(response: TransactionResponse): response is BlockMetadataTransactionResponse;
760
+ declare function isStateCheckpointTransactionResponse(response: TransactionResponse): response is StateCheckpointTransactionResponse;
761
+ declare function isValidatorTransactionResponse(response: TransactionResponse): response is ValidatorTransactionResponse;
762
+ type PendingTransactionResponse = {
763
+ type: TransactionResponseType.Pending;
764
+ hash: string;
765
+ sender: string;
766
+ sequence_number: string;
767
+ max_gas_amount: string;
768
+ gas_unit_price: string;
769
+ expiration_timestamp_secs: string;
770
+ payload: TransactionPayloadResponse;
771
+ signature?: TransactionSignature;
772
+ };
773
+ type UserTransactionResponse = {
774
+ type: TransactionResponseType.User;
775
+ version: string;
776
+ hash: string;
777
+ state_change_hash: string;
778
+ event_root_hash: string;
779
+ state_checkpoint_hash: string | null;
780
+ gas_used: string;
781
+ /**
782
+ * Whether the transaction was successful
783
+ */
784
+ success: boolean;
785
+ /**
786
+ * The VM status of the transaction, can tell useful information in a failure
787
+ */
788
+ vm_status: string;
789
+ accumulator_root_hash: string;
790
+ /**
791
+ * Final state of resources changed by the transaction
792
+ */
793
+ changes: Array<WriteSetChange>;
794
+ sender: string;
795
+ sequence_number: string;
796
+ max_gas_amount: string;
797
+ gas_unit_price: string;
798
+ expiration_timestamp_secs: string;
799
+ payload: TransactionPayloadResponse;
800
+ signature?: TransactionSignature;
801
+ /**
802
+ * Events generated by the transaction
803
+ */
804
+ events: Array<Event>;
805
+ timestamp: string;
806
+ };
807
+ type GenesisTransactionResponse = {
808
+ type: TransactionResponseType.Genesis;
809
+ version: string;
810
+ hash: string;
811
+ state_change_hash: string;
812
+ event_root_hash: string;
813
+ state_checkpoint_hash?: string;
814
+ gas_used: string;
815
+ /**
816
+ * Whether the transaction was successful
817
+ */
818
+ success: boolean;
819
+ /**
820
+ * The VM status of the transaction, can tell useful information in a failure
821
+ */
822
+ vm_status: string;
823
+ accumulator_root_hash: string;
824
+ /**
825
+ * Final state of resources changed by the transaction
826
+ */
827
+ changes: Array<WriteSetChange>;
828
+ payload: GenesisPayload;
829
+ /**
830
+ * Events emitted during genesis
831
+ */
832
+ events: Array<Event>;
833
+ };
834
+ type BlockMetadataTransactionResponse = {
835
+ type: TransactionResponseType.BlockMetadata;
836
+ version: string;
837
+ hash: string;
838
+ state_change_hash: string;
839
+ event_root_hash: string;
840
+ state_checkpoint_hash: string | null;
841
+ gas_used: string;
842
+ /**
843
+ * Whether the transaction was successful
844
+ */
845
+ success: boolean;
846
+ /**
847
+ * The VM status of the transaction, can tell useful information in a failure
848
+ */
849
+ vm_status: string;
850
+ accumulator_root_hash: string;
851
+ /**
852
+ * Final state of resources changed by the transaction
853
+ */
854
+ changes: Array<WriteSetChange>;
855
+ id: string;
856
+ epoch: string;
857
+ round: string;
858
+ /**
859
+ * The events emitted at the block creation
860
+ */
861
+ events: Array<Event>;
862
+ /**
863
+ * Previous block votes
864
+ */
865
+ previous_block_votes_bitvec: Array<number>;
866
+ proposer: string;
867
+ /**
868
+ * The indices of the proposers who failed to propose
869
+ */
870
+ failed_proposer_indices: Array<number>;
871
+ timestamp: string;
872
+ };
873
+ type StateCheckpointTransactionResponse = {
874
+ type: TransactionResponseType.StateCheckpoint;
875
+ version: string;
876
+ hash: string;
877
+ state_change_hash: string;
878
+ event_root_hash: string;
879
+ state_checkpoint_hash: string | null;
880
+ gas_used: string;
881
+ /**
882
+ * Whether the transaction was successful
883
+ */
884
+ success: boolean;
885
+ /**
886
+ * The VM status of the transaction, can tell useful information in a failure
887
+ */
888
+ vm_status: string;
889
+ accumulator_root_hash: string;
890
+ /**
891
+ * Final state of resources changed by the transaction
892
+ */
893
+ changes: Array<WriteSetChange>;
894
+ timestamp: string;
895
+ };
896
+ type ValidatorTransactionResponse = {
897
+ type: TransactionResponseType.Validator;
898
+ version: string;
899
+ hash: string;
900
+ state_change_hash: string;
901
+ event_root_hash: string;
902
+ state_checkpoint_hash: string | null;
903
+ gas_used: string;
904
+ /**
905
+ * Whether the transaction was successful
906
+ */
907
+ success: boolean;
908
+ /**
909
+ * The VM status of the transaction, can tell useful information in a failure
910
+ */
911
+ vm_status: string;
912
+ accumulator_root_hash: string;
913
+ /**
914
+ * Final state of resources changed by the transaction
915
+ */
916
+ changes: Array<WriteSetChange>;
917
+ /**
918
+ * The events emitted by the validator transaction
919
+ */
920
+ events: Array<Event>;
921
+ timestamp: string;
922
+ };
923
+ /**
924
+ * WRITESET CHANGE TYPES
925
+ */
926
+ type WriteSetChange = WriteSetChangeDeleteModule | WriteSetChangeDeleteResource | WriteSetChangeDeleteTableItem | WriteSetChangeWriteModule | WriteSetChangeWriteResource | WriteSetChangeWriteTableItem;
927
+ type WriteSetChangeDeleteModule = {
928
+ type: string;
929
+ address: string;
930
+ /**
931
+ * State key hash
932
+ */
933
+ state_key_hash: string;
934
+ module: MoveModuleId;
935
+ };
936
+ type WriteSetChangeDeleteResource = {
937
+ type: string;
938
+ address: string;
939
+ state_key_hash: string;
940
+ resource: string;
941
+ };
942
+ type WriteSetChangeDeleteTableItem = {
943
+ type: string;
944
+ state_key_hash: string;
945
+ handle: string;
946
+ key: string;
947
+ data?: DeletedTableData;
948
+ };
949
+ type WriteSetChangeWriteModule = {
950
+ type: string;
951
+ address: string;
952
+ state_key_hash: string;
953
+ data: MoveModuleBytecode;
954
+ };
955
+ type WriteSetChangeWriteResource = {
956
+ type: string;
957
+ address: string;
958
+ state_key_hash: string;
959
+ data: MoveResource;
960
+ };
961
+ type WriteSetChangeWriteTableItem = {
962
+ type: string;
963
+ state_key_hash: string;
964
+ handle: string;
965
+ key: string;
966
+ value: string;
967
+ data?: DecodedTableData;
968
+ };
969
+ type DecodedTableData = {
970
+ /**
971
+ * Key of table in JSON
972
+ */
973
+ key: any;
974
+ /**
975
+ * Type of key
976
+ */
977
+ key_type: string;
978
+ /**
979
+ * Value of table in JSON
980
+ */
981
+ value: any;
982
+ /**
983
+ * Type of value
984
+ */
985
+ value_type: string;
986
+ };
987
+ /**
988
+ * Deleted table data
989
+ */
990
+ type DeletedTableData = {
991
+ /**
992
+ * Deleted key
993
+ */
994
+ key: any;
995
+ /**
996
+ * Deleted key type
997
+ */
998
+ key_type: string;
999
+ };
1000
+ type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;
1001
+ type EntryFunctionPayloadResponse = {
1002
+ type: string;
1003
+ function: MoveFunctionId;
1004
+ /**
1005
+ * Type arguments of the function
1006
+ */
1007
+ type_arguments: Array<string>;
1008
+ /**
1009
+ * Arguments of the function
1010
+ */
1011
+ arguments: Array<any>;
1012
+ };
1013
+ type ScriptPayloadResponse = {
1014
+ type: string;
1015
+ code: MoveScriptBytecode;
1016
+ /**
1017
+ * Type arguments of the function
1018
+ */
1019
+ type_arguments: Array<string>;
1020
+ /**
1021
+ * Arguments of the function
1022
+ */
1023
+ arguments: Array<any>;
1024
+ };
1025
+ type MultisigPayloadResponse = {
1026
+ type: string;
1027
+ multisig_address: string;
1028
+ transaction_payload?: EntryFunctionPayloadResponse;
1029
+ };
1030
+ type GenesisPayload = {
1031
+ type: string;
1032
+ write_set: WriteSet;
1033
+ };
1034
+ /**
1035
+ * Move script bytecode
1036
+ */
1037
+ type MoveScriptBytecode = {
1038
+ bytecode: string;
1039
+ abi?: MoveFunction;
1040
+ };
1041
+ /**
1042
+ * These are the JSON representations of transaction signatures returned from the node API.
1043
+ */
1044
+ type TransactionSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature | TransactionMultiAgentSignature | TransactionFeePayerSignature;
1045
+ declare function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
1046
+ declare function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
1047
+ declare function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature;
1048
+ declare function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
1049
+ declare function isMultiEd25519Signature(signature: TransactionSignature): signature is TransactionMultiEd25519Signature;
1050
+ type TransactionEd25519Signature = {
1051
+ type: string;
1052
+ public_key: string;
1053
+ signature: "ed25519_signature";
1054
+ };
1055
+ type TransactionSecp256k1Signature = {
1056
+ type: string;
1057
+ public_key: string;
1058
+ signature: "secp256k1_ecdsa_signature";
1059
+ };
1060
+ type TransactionMultiEd25519Signature = {
1061
+ type: "multi_ed25519_signature";
1062
+ /**
1063
+ * The public keys for the Ed25519 signature
1064
+ */
1065
+ public_keys: Array<string>;
1066
+ /**
1067
+ * Signature associated with the public keys in the same order
1068
+ */
1069
+ signatures: Array<string>;
1070
+ /**
1071
+ * The number of signatures required for a successful transaction
1072
+ */
1073
+ threshold: number;
1074
+ bitmap: string;
1075
+ };
1076
+ type TransactionMultiAgentSignature = {
1077
+ type: "multi_agent_signature";
1078
+ sender: AccountSignature;
1079
+ /**
1080
+ * The other involved parties' addresses
1081
+ */
1082
+ secondary_signer_addresses: Array<string>;
1083
+ /**
1084
+ * The associated signatures, in the same order as the secondary addresses
1085
+ */
1086
+ secondary_signers: Array<AccountSignature>;
1087
+ };
1088
+ type TransactionFeePayerSignature = {
1089
+ type: "fee_payer_signature";
1090
+ sender: AccountSignature;
1091
+ /**
1092
+ * The other involved parties' addresses
1093
+ */
1094
+ secondary_signer_addresses: Array<string>;
1095
+ /**
1096
+ * The associated signatures, in the same order as the secondary addresses
1097
+ */
1098
+ secondary_signers: Array<AccountSignature>;
1099
+ fee_payer_address: string;
1100
+ fee_payer_signer: AccountSignature;
1101
+ };
1102
+ /**
1103
+ * The union of all single account signatures.
1104
+ */
1105
+ type AccountSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature;
1106
+ type WriteSet = ScriptWriteSet | DirectWriteSet;
1107
+ type ScriptWriteSet = {
1108
+ type: string;
1109
+ execute_as: string;
1110
+ script: ScriptPayloadResponse;
1111
+ };
1112
+ type DirectWriteSet = {
1113
+ type: string;
1114
+ changes: Array<WriteSetChange>;
1115
+ events: Array<Event>;
1116
+ };
1117
+ type EventGuid = {
1118
+ creation_number: string;
1119
+ account_address: string;
1120
+ };
1121
+ type Event = {
1122
+ guid: EventGuid;
1123
+ sequence_number: string;
1124
+ type: string;
1125
+ /**
1126
+ * The JSON representation of the event
1127
+ */
1128
+ data: any;
1129
+ };
1130
+ /**
1131
+ * Map of Move types to local TypeScript types
1132
+ */
1133
+ type MoveUint8Type = number;
1134
+ type MoveUint16Type = number;
1135
+ type MoveUint32Type = number;
1136
+ type MoveUint64Type = string;
1137
+ type MoveUint128Type = string;
1138
+ type MoveUint256Type = string;
1139
+ type MoveAddressType = string;
1140
+ type MoveObjectType = string;
1141
+ type MoveOptionType = MoveType | null | undefined;
1142
+ /**
1143
+ * This is the format for a fully qualified struct, resource, or entry function in Move.
1144
+ */
1145
+ type MoveStructId = `${string}::${string}::${string}`;
1146
+ type MoveFunctionId = MoveStructId;
1147
+ type MoveStructType = {};
1148
+ type MoveType = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructType | Array<MoveType>;
1149
+ /**
1150
+ * Possible Move values acceptable by move functions (entry, view)
1151
+ *
1152
+ * Map of a Move value to the corresponding TypeScript value
1153
+ *
1154
+ * `Bool -> boolean`
1155
+ *
1156
+ * `u8, u16, u32 -> number`
1157
+ *
1158
+ * `u64, u128, u256 -> string`
1159
+ *
1160
+ * `String -> string`
1161
+ *
1162
+ * `Address -> 0x${string}`
1163
+ *
1164
+ * `Struct - 0x${string}::${string}::${string}`
1165
+ *
1166
+ * `Object -> 0x${string}`
1167
+ *
1168
+ * `Vector -> Array<MoveValue>`
1169
+ *
1170
+ * `Option -> MoveValue | null | undefined`
1171
+ */
1172
+ type MoveValue = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructId | MoveOptionType | Array<MoveValue>;
1173
+ /**
1174
+ * Move module id is a string representation of Move module.
1175
+ * Module name is case-sensitive.
1176
+ */
1177
+ type MoveModuleId = `${string}::${string}`;
1178
+ /**
1179
+ * Move function visibility
1180
+ */
1181
+ declare enum MoveFunctionVisibility {
1182
+ PRIVATE = "private",
1183
+ PUBLIC = "public",
1184
+ FRIEND = "friend"
1185
+ }
1186
+ /**
1187
+ * Move function ability
1188
+ */
1189
+ declare enum MoveAbility {
1190
+ STORE = "store",
1191
+ DROP = "drop",
1192
+ KEY = "key",
1193
+ COPY = "copy"
1194
+ }
1195
+ /**
1196
+ * Move abilities tied to the generic type param and associated with the function that uses it
1197
+ */
1198
+ type MoveFunctionGenericTypeParam = {
1199
+ constraints: Array<MoveAbility>;
1200
+ };
1201
+ /**
1202
+ * Move struct field
1203
+ */
1204
+ type MoveStructField = {
1205
+ name: string;
1206
+ type: string;
1207
+ };
1208
+ /**
1209
+ * A Move module
1210
+ */
1211
+ type MoveModule = {
1212
+ address: string;
1213
+ name: string;
1214
+ /**
1215
+ * Friends of the module
1216
+ */
1217
+ friends: Array<MoveModuleId>;
1218
+ /**
1219
+ * Public functions of the module
1220
+ */
1221
+ exposed_functions: Array<MoveFunction>;
1222
+ /**
1223
+ * Structs of the module
1224
+ */
1225
+ structs: Array<MoveStruct>;
1226
+ };
1227
+ /**
1228
+ * A move struct
1229
+ */
1230
+ type MoveStruct = {
1231
+ name: string;
1232
+ /**
1233
+ * Whether the struct is a native struct of Move
1234
+ */
1235
+ is_native: boolean;
1236
+ /**
1237
+ * Abilities associated with the struct
1238
+ */
1239
+ abilities: Array<MoveAbility>;
1240
+ /**
1241
+ * Generic types associated with the struct
1242
+ */
1243
+ generic_type_params: Array<MoveFunctionGenericTypeParam>;
1244
+ /**
1245
+ * Fields associated with the struct
1246
+ */
1247
+ fields: Array<MoveStructField>;
1248
+ };
1249
+ /**
1250
+ * Move function
1251
+ */
1252
+ type MoveFunction = {
1253
+ name: string;
1254
+ visibility: MoveFunctionVisibility;
1255
+ /**
1256
+ * Whether the function can be called as an entry function directly in a transaction
1257
+ */
1258
+ is_entry: boolean;
1259
+ /**
1260
+ * Whether the function is a view function or not
1261
+ */
1262
+ is_view: boolean;
1263
+ /**
1264
+ * Generic type params associated with the Move function
1265
+ */
1266
+ generic_type_params: Array<MoveFunctionGenericTypeParam>;
1267
+ /**
1268
+ * Parameters associated with the move function
1269
+ */
1270
+ params: Array<string>;
1271
+ /**
1272
+ * Return type of the function
1273
+ */
1274
+ return: Array<string>;
1275
+ };
1276
+ declare enum RoleType {
1277
+ VALIDATOR = "validator",
1278
+ FULL_NODE = "full_node"
1279
+ }
1280
+ type LedgerInfo = {
1281
+ /**
1282
+ * Chain ID of the current chain
1283
+ */
1284
+ chain_id: number;
1285
+ epoch: string;
1286
+ ledger_version: string;
1287
+ oldest_ledger_version: string;
1288
+ ledger_timestamp: string;
1289
+ node_role: RoleType;
1290
+ oldest_block_height: string;
1291
+ block_height: string;
1292
+ /**
1293
+ * Git hash of the build of the API endpoint. Can be used to determine the exact
1294
+ * software version used by the API endpoint.
1295
+ */
1296
+ git_hash?: string;
1297
+ };
1298
+ /**
1299
+ * A Block type
1300
+ */
1301
+ type Block = {
1302
+ block_height: string;
1303
+ block_hash: string;
1304
+ block_timestamp: string;
1305
+ first_version: string;
1306
+ last_version: string;
1307
+ /**
1308
+ * The transactions in the block in sequential order
1309
+ */
1310
+ transactions?: Array<TransactionResponse>;
1311
+ };
1312
+ /**
1313
+ * Table Item request for the GetTableItem API
1314
+ */
1315
+ type TableItemRequest = {
1316
+ key_type: MoveValue;
1317
+ value_type: MoveValue;
1318
+ /**
1319
+ * The value of the table item's key
1320
+ */
1321
+ key: any;
1322
+ };
1323
+ /**
1324
+ * A list of Authentication Key schemes that are supported by Aptos.
1325
+ *
1326
+ * They are combinations of signing schemes and derive schemes.
1327
+ */
1328
+ type AuthenticationKeyScheme = SigningScheme | DeriveScheme;
1329
+ declare enum SigningScheme {
1330
+ /**
1331
+ * For Ed25519PublicKey
1332
+ */
1333
+ Ed25519 = 0,
1334
+ /**
1335
+ * For MultiEd25519PublicKey
1336
+ */
1337
+ MultiEd25519 = 1,
1338
+ /**
1339
+ * For SingleKey ecdsa
1340
+ */
1341
+ SingleKey = 2,
1342
+ MultiKey = 3
1343
+ }
1344
+ declare enum SigningSchemeInput {
1345
+ /**
1346
+ * For Ed25519PublicKey
1347
+ */
1348
+ Ed25519 = 0,
1349
+ /**
1350
+ * For Secp256k1Ecdsa
1351
+ */
1352
+ Secp256k1Ecdsa = 2
1353
+ }
1354
+ /**
1355
+ * Scheme used for deriving account addresses from other data
1356
+ */
1357
+ declare enum DeriveScheme {
1358
+ /**
1359
+ * Derives an address using an AUID, used for objects
1360
+ */
1361
+ DeriveAuid = 251,
1362
+ /**
1363
+ * Derives an address from another object address
1364
+ */
1365
+ DeriveObjectAddressFromObject = 252,
1366
+ /**
1367
+ * Derives an address from a GUID, used for objects
1368
+ */
1369
+ DeriveObjectAddressFromGuid = 253,
1370
+ /**
1371
+ * Derives an address from seed bytes, used for named objects
1372
+ */
1373
+ DeriveObjectAddressFromSeed = 254,
1374
+ /**
1375
+ * Derives an address from seed bytes, used for resource accounts
1376
+ */
1377
+ DeriveResourceAccountAddress = 255
1378
+ }
1379
+ /**
1380
+ * Option properties to pass for waitForTransaction() function
1381
+ */
1382
+ type WaitForTransactionOptions = {
1383
+ timeoutSecs?: number;
1384
+ checkSuccess?: boolean;
1385
+ waitForIndexer?: boolean;
1386
+ };
1387
+ /**
1388
+ * Input type to generate an account using Single Signer
1389
+ * Ed25519 or Legacy Ed25519
1390
+ */
1391
+ type GenerateAccountWithEd25519 = {
1392
+ scheme: SigningSchemeInput.Ed25519;
1393
+ legacy: boolean;
1394
+ };
1395
+ /**
1396
+ * Input type to generate an account using Single Signer
1397
+ * Secp256k1
1398
+ */
1399
+ type GenerateAccountWithSingleSignerSecp256k1Key = {
1400
+ scheme: SigningSchemeInput.Secp256k1Ecdsa;
1401
+ legacy?: false;
1402
+ };
1403
+ type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
1404
+
1405
+ /**
1406
+ * This interface exists to define Deserializable<T> inputs for functions that
1407
+ * deserialize a byte buffer into a type T.
1408
+ * It is not intended to be implemented or extended, because Typescript has no support
1409
+ * for static methods in interfaces.
1410
+ */
1411
+ interface Deserializable<T> {
1412
+ deserialize(deserializer: Deserializer): T;
1413
+ }
1414
+ declare class Deserializer {
1415
+ private buffer;
1416
+ private offset;
1417
+ constructor(data: Uint8Array);
1418
+ private read;
1419
+ /**
1420
+ * Deserializes a string. UTF8 string is supported. Reads the string's bytes length "l" first,
1421
+ * and then reads "l" bytes of content. Decodes the byte array into a string.
1422
+ *
1423
+ * BCS layout for "string": string_length | string_content
1424
+ * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
1425
+ *
1426
+ * @example
1427
+ * ```ts
1428
+ * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
1429
+ * assert(deserializer.deserializeStr() === "1234abcd");
1430
+ * ```
1431
+ */
1432
+ deserializeStr(): string;
1433
+ /**
1434
+ * Deserializes a an optional string.
1435
+ *
1436
+ * BCS layout for Optional<String>: 0 if none, else 1 | string_length | string_content
1437
+ * @example
1438
+ * ```ts
1439
+ * const deserializer = new Deserializer(new Uint8Array([0x00]));
1440
+ * assert(deserializer.deserializeOptionStr() === undefined);
1441
+ * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
1442
+ * assert(deserializer.deserializeOptionStr() === "1234abcd");
1443
+ * ```
1444
+ */
1445
+ deserializeOptionStr(): string | undefined;
1446
+ /**
1447
+ * Deserializes a an optional string.
1448
+ *
1449
+ * BCS layout for Optional<String>: 0 if none, else 1 | string_length | string_content
1450
+ * @example
1451
+ * ```ts
1452
+ * const deserializer = new Deserializer(new Uint8Array([0x00]));
1453
+ * assert(deserializer.deserializeOptionStr() === undefined);
1454
+ * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
1455
+ * assert(deserializer.deserializeOptionStr() === "1234abcd");
1456
+ * ```
1457
+ */
1458
+ deserializeOption<T>(cls: Deserializable<T>): T | undefined;
1459
+ /**
1460
+ * Deserializes an array of bytes.
1461
+ *
1462
+ * BCS layout for "bytes": bytes_length | bytes
1463
+ * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
1464
+ */
1465
+ deserializeBytes(): Uint8Array;
1466
+ /**
1467
+ * Deserializes an array of bytes. The number of bytes to read is already known.
1468
+ *
1469
+ */
1470
+ deserializeFixedBytes(len: number): Uint8Array;
1471
+ /**
1472
+ * Deserializes a boolean value.
1473
+ *
1474
+ * BCS layout for "boolean": One byte. "0x01" for true and "0x00" for false.
1475
+ */
1476
+ deserializeBool(): boolean;
1477
+ /**
1478
+ * Deserializes a uint8 number.
1479
+ *
1480
+ * BCS layout for "uint8": One byte. Binary format in little-endian representation.
1481
+ */
1482
+ deserializeU8(): Uint8;
1483
+ /**
1484
+ * Deserializes a uint16 number.
1485
+ *
1486
+ * BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
1487
+ * @example
1488
+ * ```ts
1489
+ * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));
1490
+ * assert(deserializer.deserializeU16() === 4660);
1491
+ * ```
1492
+ */
1493
+ deserializeU16(): Uint16;
1494
+ /**
1495
+ * Deserializes a uint32 number.
1496
+ *
1497
+ * BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
1498
+ * @example
1499
+ * ```ts
1500
+ * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));
1501
+ * assert(deserializer.deserializeU32() === 305419896);
1502
+ * ```
1503
+ */
1504
+ deserializeU32(): Uint32;
1505
+ /**
1506
+ * Deserializes a uint64 number.
1507
+ *
1508
+ * BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
1509
+ * @example
1510
+ * ```ts
1511
+ * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
1512
+ * assert(deserializer.deserializeU64() === 1311768467750121216);
1513
+ * ```
1514
+ */
1515
+ deserializeU64(): Uint64;
1516
+ /**
1517
+ * Deserializes a uint128 number.
1518
+ *
1519
+ * BCS layout for "uint128": Sixteen bytes. Binary format in little-endian representation.
1520
+ */
1521
+ deserializeU128(): Uint128;
1522
+ /**
1523
+ * Deserializes a uint256 number.
1524
+ *
1525
+ * BCS layout for "uint256": Thirty-two bytes. Binary format in little-endian representation.
1526
+ */
1527
+ deserializeU256(): Uint256;
1528
+ /**
1529
+ * Deserializes a uleb128 encoded uint32 number.
1530
+ *
1531
+ * BCS use uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
1532
+ */
1533
+ deserializeUleb128AsU32(): Uint32;
1534
+ /**
1535
+ * Helper function that primarily exists to support alternative syntax for deserialization.
1536
+ * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use
1537
+ * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.
1538
+ *
1539
+ * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
1540
+ * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function
1541
+ * // value is now an instance of MyClass
1542
+ * // equivalent to `const value = MyClass.deserialize(deserializer)`
1543
+ * @param cls The BCS-deserializable class to deserialize the buffered bytes into.
1544
+ *
1545
+ * @returns the deserialized value of class type T
1546
+ */
1547
+ deserialize<T>(cls: Deserializable<T>): T;
1548
+ /**
1549
+ * Deserializes an array of BCS Deserializable values given an existing Deserializer
1550
+ * instance with a loaded byte buffer.
1551
+ *
1552
+ * @param cls The BCS-deserializable class to deserialize the buffered bytes into.
1553
+ * @example
1554
+ * // serialize a vector of addresses
1555
+ * const addresses = new Array<AccountAddress>(
1556
+ * AccountAddress.from("0x1"),
1557
+ * AccountAddress.from("0x2"),
1558
+ * AccountAddress.from("0xa"),
1559
+ * AccountAddress.from("0xb"),
1560
+ * );
1561
+ * const serializer = new Serializer();
1562
+ * serializer.serializeVector(addresses);
1563
+ * const serializedBytes = serializer.toUint8Array();
1564
+ *
1565
+ * // deserialize the bytes into an array of addresses
1566
+ * const deserializer = new Deserializer(serializedBytes);
1567
+ * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);
1568
+ * // deserializedAddresses is now an array of AccountAddress instances
1569
+ * @returns an array of deserialized values of type T
1570
+ */
1571
+ deserializeVector<T>(cls: Deserializable<T>): Array<T>;
1572
+ }
1573
+
1574
+ /**
1575
+ * This error is used to explain why parsing failed.
1576
+ */
1577
+ declare class ParsingError<T> extends Error {
1578
+ /**
1579
+ * This provides a programmatic way to access why parsing failed. Downstream devs
1580
+ * might want to use this to build their own error messages if the default error
1581
+ * messages are not suitable for their use case. This should be an enum.
1582
+ */
1583
+ invalidReason: T;
1584
+ constructor(message: string, invalidReason: T);
1585
+ }
1586
+ /**
1587
+ * Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,
1588
+ * this type is returned from "defensive" functions like isValid.
1589
+ */
1590
+ type ParsingResult<T> = {
1591
+ /**
1592
+ * True if valid, false otherwise.
1593
+ */
1594
+ valid: boolean;
1595
+ /**
1596
+ * If valid is false, this will be a code explaining why parsing failed.
1597
+ */
1598
+ invalidReason?: T;
1599
+ /**
1600
+ * If valid is false, this will be a string explaining why parsing failed.
1601
+ */
1602
+ invalidReasonMessage?: string;
1603
+ };
1604
+
1605
+ /**
1606
+ * This enum is used to explain why parsing might have failed.
1607
+ */
1608
+ declare enum HexInvalidReason {
1609
+ TOO_SHORT = "too_short",
1610
+ INVALID_LENGTH = "invalid_length",
1611
+ INVALID_HEX_CHARS = "invalid_hex_chars"
1612
+ }
1613
+ /**
1614
+ * NOTE: Do not use this class when working with account addresses, use AccountAddress.
1615
+ *
1616
+ * NOTE: When accepting hex data as input to a function, prefer to accept HexInput and
1617
+ * then use the static helper methods of this class to convert it into the desired
1618
+ * format. This enables the greatest flexibility for the developer.
1619
+ *
1620
+ * Hex is a helper class for working with hex data. Hex data, when represented as a
1621
+ * string, generally looks like this, for example: 0xaabbcc, 45cd32, etc.
1622
+ *
1623
+ * You might use this class like this:
1624
+ *
1625
+ * ```ts
1626
+ * getTransactionByHash(txnHash: HexInput): Promise<Transaction> {
1627
+ * const txnHashString = Hex.fromHexInput(txnHash).toString();
1628
+ * return await getTransactionByHashInner(txnHashString);
1629
+ * }
1630
+ * ```
1631
+ *
1632
+ * This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string
1633
+ * with a leading 0x prefix, regardless of what the input format was.
1634
+ *
1635
+ * These are some other ways to chain the functions together:
1636
+ * - `Hex.fromHexString({ hexInput: "0x1f" }).toUint8Array()`
1637
+ * - `new Hex([1, 3]).toStringWithoutPrefix()`
1638
+ */
1639
+ declare class Hex {
1640
+ private readonly data;
1641
+ /**
1642
+ * Create a new Hex instance from a Uint8Array.
1643
+ *
1644
+ * @param data Uint8Array
1645
+ */
1646
+ constructor(data: Uint8Array);
1647
+ /**
1648
+ * Get the inner hex data. The inner data is already a Uint8Array so no conversion
1649
+ * is taking place here, it just returns the inner data.
1650
+ *
1651
+ * @returns Hex data as Uint8Array
1652
+ */
1653
+ toUint8Array(): Uint8Array;
1654
+ /**
1655
+ * Get the hex data as a string without the 0x prefix.
1656
+ *
1657
+ * @returns Hex string without 0x prefix
1658
+ */
1659
+ toStringWithoutPrefix(): string;
1660
+ /**
1661
+ * Get the hex data as a string with the 0x prefix.
1662
+ *
1663
+ * @returns Hex string with 0x prefix
1664
+ */
1665
+ toString(): string;
1666
+ /**
1667
+ * Static method to convert a hex string to Hex
1668
+ *
1669
+ * @param str A hex string, with or without the 0x prefix
1670
+ *
1671
+ * @returns Hex
1672
+ */
1673
+ static fromHexString(str: string): Hex;
1674
+ /**
1675
+ * Static method to convert an instance of HexInput to Hex
1676
+ *
1677
+ * @param hexInput A HexInput (string or Uint8Array)
1678
+ *
1679
+ * @returns Hex
1680
+ */
1681
+ static fromHexInput(hexInput: HexInput): Hex;
1682
+ /**
1683
+ * Check if the string is valid hex.
1684
+ *
1685
+ * @param str A hex string representing byte data.
1686
+ *
1687
+ * @returns valid = true if the string is valid, false if not. If the string is not
1688
+ * valid, invalidReason and invalidReasonMessage will be set explaining why it is
1689
+ * invalid.
1690
+ */
1691
+ static isValid(str: string): ParsingResult<HexInvalidReason>;
1692
+ /**
1693
+ * Return whether Hex instances are equal. Hex instances are considered equal if
1694
+ * their underlying byte data is identical.
1695
+ *
1696
+ * @param other The Hex instance to compare to.
1697
+ * @returns true if the Hex instances are equal, false if not.
1698
+ */
1699
+ equals(other: Hex): boolean;
1700
+ }
1701
+
1702
+ declare abstract class Serializable {
1703
+ abstract serialize(serializer: Serializer): void;
1704
+ /**
1705
+ * Serializes a `Serializable` value to its BCS representation.
1706
+ * This function is the Typescript SDK equivalent of `bcs::to_bytes` in Move.
1707
+ * @returns the BCS representation of the Serializable instance as a byte buffer
1708
+ */
1709
+ bcsToBytes(): Uint8Array;
1710
+ /**
1711
+ * Helper function to get a value's BCS-serialized bytes as a Hex instance.
1712
+ * @returns a Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array
1713
+ */
1714
+ bcsToHex(): Hex;
1715
+ }
1716
+ declare class Serializer {
1717
+ private buffer;
1718
+ private offset;
1719
+ constructor(length?: number);
1720
+ private ensureBufferWillHandleSize;
1721
+ protected appendToBuffer(values: Uint8Array): void;
1722
+ private serializeWithFunction;
1723
+ /**
1724
+ * Serializes a string. UTF8 string is supported.
1725
+ *
1726
+ * The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer.
1727
+ * Then the string content is serialized as UTF8 encoded bytes.
1728
+ *
1729
+ * BCS layout for "string": string_length | string_content
1730
+ * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
1731
+ *
1732
+ * @example
1733
+ * ```ts
1734
+ * const serializer = new Serializer();
1735
+ * serializer.serializeStr("1234abcd");
1736
+ * assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
1737
+ * ```
1738
+ */
1739
+ serializeStr(value: string): void;
1740
+ /**
1741
+ * Serializes an array of bytes.
1742
+ *
1743
+ * BCS layout for "bytes": bytes_length | bytes
1744
+ * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
1745
+ */
1746
+ serializeBytes(value: Uint8Array): void;
1747
+ /**
1748
+ * Serializes an array of bytes with known length. Therefore, length doesn't need to be
1749
+ * serialized to help deserialization.
1750
+ *
1751
+ * When deserializing, the number of bytes to deserialize needs to be passed in.
1752
+ */
1753
+ serializeFixedBytes(value: Uint8Array): void;
1754
+ /**
1755
+ * Serializes a boolean value.
1756
+ *
1757
+ * BCS layout for "boolean": One byte. "0x01" for true and "0x00" for false.
1758
+ */
1759
+ serializeBool(value: boolean): void;
1760
+ /**
1761
+ * Serializes a uint8 number.
1762
+ *
1763
+ * BCS layout for "uint8": One byte. Binary format in little-endian representation.
1764
+ */
1765
+ serializeU8(value: Uint8): void;
1766
+ /**
1767
+ * Serializes a uint16 number.
1768
+ *
1769
+ * BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
1770
+ * @example
1771
+ * ```ts
1772
+ * const serializer = new Serializer();
1773
+ * serializer.serializeU16(4660);
1774
+ * assert(serializer.toUint8Array() === new Uint8Array([0x34, 0x12]));
1775
+ * ```
1776
+ */
1777
+ serializeU16(value: Uint16): void;
1778
+ /**
1779
+ * Serializes a uint32 number.
1780
+ *
1781
+ * BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
1782
+ * @example
1783
+ * ```ts
1784
+ * const serializer = new Serializer();
1785
+ * serializer.serializeU32(305419896);
1786
+ * assert(serializer.toUint8Array() === new Uint8Array([0x78, 0x56, 0x34, 0x12]));
1787
+ * ```
1788
+ */
1789
+ serializeU32(value: Uint32): void;
1790
+ /**
1791
+ * Serializes a uint64 number.
1792
+ *
1793
+ * BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
1794
+ * @example
1795
+ * ```ts
1796
+ * const serializer = new Serializer();
1797
+ * serializer.serializeU64(1311768467750121216);
1798
+ * assert(serializer.toUint8Array() === new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
1799
+ * ```
1800
+ */
1801
+ serializeU64(value: AnyNumber): void;
1802
+ /**
1803
+ * Serializes a uint128 number.
1804
+ *
1805
+ * BCS layout for "uint128": Sixteen bytes. Binary format in little-endian representation.
1806
+ */
1807
+ serializeU128(value: AnyNumber): void;
1808
+ /**
1809
+ * Serializes a uint256 number.
1810
+ *
1811
+ * BCS layout for "uint256": Sixteen bytes. Binary format in little-endian representation.
1812
+ */
1813
+ serializeU256(value: AnyNumber): void;
1814
+ /**
1815
+ * Serializes a uint32 number with uleb128.
1816
+ *
1817
+ * BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
1818
+ */
1819
+ serializeU32AsUleb128(val: Uint32): void;
1820
+ /**
1821
+ * Returns the buffered bytes
1822
+ */
1823
+ toUint8Array(): Uint8Array;
1824
+ /**
1825
+ * Serializes a `Serializable` value, facilitating composable serialization.
1826
+ *
1827
+ * @param value The Serializable value to serialize
1828
+ *
1829
+ * @example
1830
+ * // Define the MoveStruct class that implements the Serializable interface
1831
+ * class MoveStruct extends Serializable {
1832
+ * constructor(
1833
+ * public creatorAddress: AccountAddress, // where AccountAddress extends Serializable
1834
+ * public collectionName: string,
1835
+ * public tokenName: string
1836
+ * ) {}
1837
+ *
1838
+ * serialize(serializer: Serializer): void {
1839
+ * serializer.serialize(this.creatorAddress); // Composable serialization of another Serializable object
1840
+ * serializer.serializeStr(this.collectionName);
1841
+ * serializer.serializeStr(this.tokenName);
1842
+ * }
1843
+ * }
1844
+ *
1845
+ * // Construct a MoveStruct
1846
+ * const moveStruct = new MoveStruct(new AccountAddress(...), "MyCollection", "TokenA");
1847
+ *
1848
+ * // Serialize a string, a u64 number, and a MoveStruct instance.
1849
+ * const serializer = new Serializer();
1850
+ * serializer.serializeStr("ExampleString");
1851
+ * serializer.serializeU64(12345678);
1852
+ * serializer.serialize(moveStruct);
1853
+ *
1854
+ * // Get the bytes from the Serializer instance
1855
+ * const serializedBytes = serializer.toUint8Array();
1856
+ *
1857
+ * @returns the serializer instance
1858
+ */
1859
+ serialize<T extends Serializable>(value: T): void;
1860
+ /**
1861
+ * Serializes an array of BCS Serializable values to a serializer instance.
1862
+ * Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
1863
+ *
1864
+ * @param values The array of BCS Serializable values
1865
+ * @example
1866
+ * const addresses = new Array<AccountAddress>(
1867
+ * AccountAddress.from("0x1"),
1868
+ * AccountAddress.from("0x2"),
1869
+ * AccountAddress.from("0xa"),
1870
+ * AccountAddress.from("0xb"),
1871
+ * );
1872
+ * const serializer = new Serializer();
1873
+ * serializer.serializeVector(addresses);
1874
+ * const serializedBytes = serializer.toUint8Array();
1875
+ * // serializedBytes is now the BCS-serialized bytes
1876
+ * // The equivalent value in Move would be:
1877
+ * // `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;
1878
+ */
1879
+ serializeVector<T extends Serializable>(values: Array<T>): void;
1880
+ serializeOption<T extends Serializable>(value?: T): void;
1881
+ serializeOptionStr(value?: string): void;
1882
+ }
1883
+ declare function ensureBoolean(value: unknown): asserts value is boolean;
1884
+ declare const outOfRangeErrorMessage: (value: AnyNumber, min: AnyNumber, max: AnyNumber) => string;
1885
+ declare function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T, maxValue: T): void;
1886
+
1887
+ interface TransactionArgument extends EntryFunctionArgument, ScriptFunctionArgument {
1888
+ }
1889
+ interface EntryFunctionArgument {
1890
+ /**
1891
+ * Serialize an argument to BCS-serialized bytes.
1892
+ */
1893
+ serialize(serializer: Serializer): void;
1894
+ /**
1895
+ * Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains
1896
+ * the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
1897
+ */
1898
+ serializeForEntryFunction(serializer: Serializer): void;
1899
+ bcsToBytes(): Uint8Array;
1900
+ bcsToHex(): Hex;
1901
+ }
1902
+ interface ScriptFunctionArgument {
1903
+ /**
1904
+ * Serialize an argument to BCS-serialized bytes.
1905
+ */
1906
+ serialize(serializer: Serializer): void;
1907
+ /**
1908
+ * Serialize an argument to BCS-serialized bytes as a type aware byte sequence.
1909
+ * The byte sequence contains an enum variant index followed by the BCS-serialized
1910
+ * bytes for a typed argument.
1911
+ */
1912
+ serializeForScriptFunction(serializer: Serializer): void;
1913
+ bcsToBytes(): Uint8Array;
1914
+ bcsToHex(): Hex;
1915
+ }
1916
+
1917
+ /**
1918
+ * This enum is used to explain why an address was invalid.
1919
+ */
1920
+ declare enum AddressInvalidReason {
1921
+ INCORRECT_NUMBER_OF_BYTES = "incorrect_number_of_bytes",
1922
+ INVALID_HEX_CHARS = "invalid_hex_chars",
1923
+ TOO_SHORT = "too_short",
1924
+ TOO_LONG = "too_long",
1925
+ LEADING_ZERO_X_REQUIRED = "leading_zero_x_required",
1926
+ LONG_FORM_REQUIRED_UNLESS_SPECIAL = "long_form_required_unless_special",
1927
+ INVALID_PADDING_ZEROES = "INVALID_PADDING_ZEROES"
1928
+ }
1929
+ type AccountAddressInput = HexInput | AccountAddress;
1930
+ /**
1931
+ * NOTE: Only use this class for account addresses. For other hex data, e.g. transaction
1932
+ * hashes, use the Hex class.
1933
+ *
1934
+ * AccountAddress is used for working with account addresses. Account addresses, when
1935
+ * represented as a string, generally look like these examples:
1936
+ * - 0x1
1937
+ * - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c
1938
+ *
1939
+ * Proper formatting and parsing of account addresses is defined by AIP-40.
1940
+ * To learn more about the standard, read the AIP here:
1941
+ * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
1942
+ *
1943
+ * The comments in this class make frequent reference to the LONG and SHORT formats,
1944
+ * as well as "special" addresses. To learn what these refer to see AIP-40.
1945
+ */
1946
+ declare class AccountAddress extends Serializable implements TransactionArgument {
1947
+ /**
1948
+ * This is the internal representation of an account address.
1949
+ */
1950
+ readonly data: Uint8Array;
1951
+ /**
1952
+ * The number of bytes that make up an account address.
1953
+ */
1954
+ static readonly LENGTH: number;
1955
+ /**
1956
+ * The length of an address string in LONG form without a leading 0x.
1957
+ */
1958
+ static readonly LONG_STRING_LENGTH: number;
1959
+ static ZERO: AccountAddress;
1960
+ static ONE: AccountAddress;
1961
+ static TWO: AccountAddress;
1962
+ static THREE: AccountAddress;
1963
+ static FOUR: AccountAddress;
1964
+ /**
1965
+ * Creates an instance of AccountAddress from a Uint8Array.
1966
+ *
1967
+ * @param args.data A Uint8Array representing an account address.
1968
+ */
1969
+ constructor(input: Uint8Array);
1970
+ /**
1971
+ * Returns whether an address is special, where special is defined as 0x0 to 0xf
1972
+ * inclusive. In other words, the last byte of the address must be < 0b10000 (16)
1973
+ * and every other byte must be zero.
1974
+ *
1975
+ * For more information on how special addresses are defined see AIP-40:
1976
+ * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
1977
+ *
1978
+ * @returns true if the address is special, false if not.
1979
+ */
1980
+ isSpecial(): boolean;
1981
+ /**
1982
+ * Return the AccountAddress as a string as per AIP-40.
1983
+ * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
1984
+ *
1985
+ * In short, it means that special addresses are represented in SHORT form, meaning
1986
+ * 0x0 through to 0xf inclusive, and every other address is represented in LONG form,
1987
+ * meaning 0x + 64 hex characters.
1988
+ *
1989
+ * @returns AccountAddress as a string conforming to AIP-40.
1990
+ */
1991
+ toString(): `0x${string}`;
1992
+ /**
1993
+ * NOTE: Prefer to use `toString` where possible.
1994
+ *
1995
+ * Return the AccountAddress as a string as per AIP-40 but without the leading 0x.
1996
+ *
1997
+ * Learn more by reading the docstring of `toString`.
1998
+ *
1999
+ * @returns AccountAddress as a string conforming to AIP-40 but without the leading 0x.
2000
+ */
2001
+ toStringWithoutPrefix(): string;
2002
+ /**
2003
+ * NOTE: Prefer to use `toString` where possible.
2004
+ *
2005
+ * Whereas toString will format special addresses (as defined by isSpecial) using the
2006
+ * SHORT form (no leading 0s), this format the address in the LONG format
2007
+ * unconditionally.
2008
+ *
2009
+ * This means it will be 0x + 64 hex characters.
2010
+ *
2011
+ * @returns AccountAddress as a string in LONG form.
2012
+ */
2013
+ toStringLong(): `0x${string}`;
2014
+ /**
2015
+ * NOTE: Prefer to use `toString` where possible.
2016
+ *
2017
+ * Whereas toString will format special addresses (as defined by isSpecial) using the
2018
+ * SHORT form (no leading 0s), this function will include leading zeroes. The string
2019
+ * will not have a leading zero.
2020
+ *
2021
+ * This means it will be 64 hex characters without a leading 0x.
2022
+ *
2023
+ * @returns AccountAddress as a string in LONG form without a leading 0x.
2024
+ */
2025
+ toStringLongWithoutPrefix(): string;
2026
+ /**
2027
+ * Get the inner hex data. The inner data is already a Uint8Array so no conversion
2028
+ * is taking place here, it just returns the inner data.
2029
+ *
2030
+ * @returns Hex data as Uint8Array
2031
+ */
2032
+ toUint8Array(): Uint8Array;
2033
+ /**
2034
+ * Serialize the AccountAddress to a Serializer instance's data buffer.
2035
+ * @param serializer The serializer to serialize the AccountAddress to.
2036
+ * @returns void
2037
+ * @example
2038
+ * const serializer = new Serializer();
2039
+ * const address = AccountAddress.fromString("0x1");
2040
+ * address.serialize(serializer);
2041
+ * const bytes = serializer.toUint8Array();
2042
+ * // `bytes` is now the BCS-serialized address.
2043
+ */
2044
+ serialize(serializer: Serializer): void;
2045
+ serializeForEntryFunction(serializer: Serializer): void;
2046
+ serializeForScriptFunction(serializer: Serializer): void;
2047
+ /**
2048
+ * Deserialize an AccountAddress from the byte buffer in a Deserializer instance.
2049
+ * @param deserializer The deserializer to deserialize the AccountAddress from.
2050
+ * @returns An instance of AccountAddress.
2051
+ * @example
2052
+ * const bytes = hexToBytes("0x0102030405060708091011121314151617181920212223242526272829303132");
2053
+ * const deserializer = new Deserializer(bytes);
2054
+ * const address = AccountAddress.deserialize(deserializer);
2055
+ * // `address` is now an instance of AccountAddress.
2056
+ */
2057
+ static deserialize(deserializer: Deserializer): AccountAddress;
2058
+ /**
2059
+ * NOTE: This function has strict parsing behavior. For relaxed behavior, please use
2060
+ * the `fromString` function.
2061
+ *
2062
+ * Creates an instance of AccountAddress from a hex string.
2063
+ *
2064
+ * This function allows only the strictest formats defined by AIP-40. In short this
2065
+ * means only the following formats are accepted:
2066
+ *
2067
+ * - LONG
2068
+ * - SHORT for special addresses
2069
+ *
2070
+ * Where:
2071
+ * - LONG is defined as 0x + 64 hex characters.
2072
+ * - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.
2073
+ *
2074
+ * This means the following are not accepted:
2075
+ * - SHORT for non-special addresses.
2076
+ * - Any address without a leading 0x.
2077
+ *
2078
+ * Learn more about the different address formats by reading AIP-40:
2079
+ * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
2080
+ *
2081
+ * @param input A hex string representing an account address.
2082
+ *
2083
+ * @returns An instance of AccountAddress.
2084
+ */
2085
+ static fromStringStrict(input: string): AccountAddress;
2086
+ /**
2087
+ * NOTE: This function has relaxed parsing behavior. For strict behavior, please use
2088
+ * the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this
2089
+ * function, `fromString` is only provided for backwards compatibility.
2090
+ *
2091
+ * Creates an instance of AccountAddress from a hex string.
2092
+ *
2093
+ * This function allows all formats defined by AIP-40. In short this means the
2094
+ * following formats are accepted:
2095
+ *
2096
+ * - LONG, with or without leading 0x
2097
+ * - SHORT, with or without leading 0x
2098
+ *
2099
+ * Where:
2100
+ * - LONG is 64 hex characters.
2101
+ * - SHORT is 1 to 63 hex characters inclusive.
2102
+ * - Padding zeroes are allowed, e.g. 0x0123 is valid.
2103
+ *
2104
+ * Learn more about the different address formats by reading AIP-40:
2105
+ * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
2106
+ *
2107
+ * @param input A hex string representing an account address.
2108
+ *
2109
+ * @returns An instance of AccountAddress.
2110
+ */
2111
+ static fromString(input: string): AccountAddress;
2112
+ /**
2113
+ * Convenience method for creating an AccountAddress from all known inputs.
2114
+ *
2115
+ * This handles, Uint8array, string, and AccountAddress itself
2116
+ * @param input
2117
+ */
2118
+ static from(input: AccountAddressInput): AccountAddress;
2119
+ /**
2120
+ * Convenience method for creating an AccountAddress from all known inputs.
2121
+ *
2122
+ * This handles, Uint8array, string, and AccountAddress itself
2123
+ * @param input
2124
+ */
2125
+ static fromStrict(input: AccountAddressInput): AccountAddress;
2126
+ /**
2127
+ * Check if the string is a valid AccountAddress.
2128
+ *
2129
+ * @param args.input A hex string representing an account address.
2130
+ * @param args.strict If true, use strict parsing behavior. If false, use relaxed parsing behavior.
2131
+ *
2132
+ * @returns valid = true if the string is valid, valid = false if not. If the string
2133
+ * is not valid, invalidReason will be set explaining why it is invalid.
2134
+ */
2135
+ static isValid(args: {
2136
+ input: AccountAddressInput;
2137
+ strict?: boolean;
2138
+ }): ParsingResult<AddressInvalidReason>;
2139
+ /**
2140
+ * Return whether AccountAddresses are equal. AccountAddresses are considered equal
2141
+ * if their underlying byte data is identical.
2142
+ *
2143
+ * @param other The AccountAddress to compare to.
2144
+ * @returns true if the AccountAddresses are equal, false if not.
2145
+ */
2146
+ equals(other: AccountAddress): boolean;
2147
+ }
2148
+
2149
+ export { type WaitForTransactionOptions as $, type AnyNumber as A, type GetAccountCollectionsWithOwnedTokenResponse as B, type Client as C, Deserializer as D, type EntryFunctionArgument as E, type FullNodeConfig as F, type GetAccountOwnedTokensQueryResponse as G, type HexInput as H, type IndexerConfig as I, type GetAccountCoinsDataResponse as J, type GetAccountOwnedObjectsResponse as K, type LedgerVersionArg as L, type MoveModuleId as M, Network as N, type OrderByArg as O, type PaginationArgs as P, type GetCollectionDataResponse as Q, type GetTokenDataResponse as R, Serializable as S, type TransactionArgument as T, type Uint8 as U, type GetCurrentTokenOwnershipResponse as V, type WhereArg as W, type GetOwnedTokensResponse as X, type GetTokenActivityResponse as Y, ZkpVariant as Z, type GetEventsResponse as _, Serializer as a, type ScriptPayloadResponse as a$, type UserTransactionResponse as a0, type MoveFunction as a1, type GetFungibleAssetMetadataResponse as a2, type GetFungibleAssetActivitiesResponse as a3, type GetCurrentFungibleAssetBalancesResponse as a4, type LedgerInfo as a5, type Block as a6, type TableItemRequest as a7, type MoveValue as a8, type GetChainTopUserTransactionsResponse as a9, EphemeralSignatureVariant as aA, type Uint64 as aB, type Uint128 as aC, type Uint256 as aD, type ClientHeadersType as aE, TransactionResponseType as aF, isPendingTransactionResponse as aG, isUserTransactionResponse as aH, isGenesisTransactionResponse as aI, isBlockMetadataTransactionResponse as aJ, isStateCheckpointTransactionResponse as aK, isValidatorTransactionResponse as aL, type GenesisTransactionResponse as aM, type BlockMetadataTransactionResponse as aN, type StateCheckpointTransactionResponse as aO, type ValidatorTransactionResponse as aP, type WriteSetChange as aQ, type WriteSetChangeDeleteModule as aR, type WriteSetChangeDeleteResource as aS, type WriteSetChangeDeleteTableItem as aT, type WriteSetChangeWriteModule as aU, type WriteSetChangeWriteResource as aV, type WriteSetChangeWriteTableItem as aW, type DecodedTableData as aX, type DeletedTableData as aY, type TransactionPayloadResponse as aZ, type EntryFunctionPayloadResponse as a_, type GraphqlQuery as aa, type GetProcessorStatusResponse as ab, type GetANSNameResponse as ac, type GetNumberOfDelegatorsResponse as ad, type GetDelegatedStakingActivitiesResponse as ae, type PendingTransactionResponse as af, type CommittedTransactionResponse as ag, type GasEstimation as ah, type AptosRequest as ai, type ClientRequest as aj, type ClientResponse as ak, MimeType as al, ensureBoolean as am, outOfRangeErrorMessage as an, validateNumberInRange as ao, AddressInvalidReason as ap, ParsingError as aq, type ParsingResult as ar, HexInvalidReason as as, TypeTagVariants as at, ScriptTransactionArgumentVariants as au, TransactionPayloadVariants as av, TransactionVariants as aw, TransactionAuthenticatorVariant as ax, AccountAuthenticatorVariant as ay, AnySignatureVariant as az, type Uint16 as b, type MultisigPayloadResponse as b0, type GenesisPayload as b1, type MoveScriptBytecode as b2, type TransactionSignature as b3, isEd25519Signature as b4, isSecp256k1Signature as b5, isMultiAgentSignature as b6, isFeePayerSignature as b7, isMultiEd25519Signature as b8, type TransactionEd25519Signature as b9, RoleType as bA, DeriveScheme as bB, type GenerateAccountWithEd25519 as bC, type GenerateAccountWithSingleSignerSecp256k1Key as bD, type GenerateAccount as bE, type OrderBy as bF, type OrderByValue as bG, type TokenStandard as bH, NetworkToIndexerAPI as bI, NetworkToNodeAPI as bJ, NetworkToFaucetAPI as bK, NetworkToPepperAPI as bL, NetworkToProverAPI as bM, NetworkToChainId as bN, NetworkToNetworkName as bO, type TransactionSecp256k1Signature as ba, type TransactionMultiEd25519Signature as bb, type TransactionMultiAgentSignature as bc, type TransactionFeePayerSignature as bd, type AccountSignature as be, type WriteSet as bf, type ScriptWriteSet as bg, type DirectWriteSet as bh, type EventGuid as bi, type Event as bj, type MoveUint8Type as bk, type MoveUint16Type as bl, type MoveUint32Type as bm, type MoveUint64Type as bn, type MoveUint128Type as bo, type MoveUint256Type as bp, type MoveAddressType as bq, type MoveObjectType as br, type MoveOptionType as bs, type MoveStructType as bt, type MoveType as bu, MoveFunctionVisibility as bv, MoveAbility as bw, type MoveStructField as bx, type MoveModule as by, type MoveStruct as bz, type Uint32 as c, type Deserializable as d, Hex as e, type AuthenticationKeyScheme as f, AccountAddress as g, AnyPublicKeyVariant as h, EphemeralPublicKeyVariant as i, EphemeralCertificateVariant as j, type ClientConfig as k, type FaucetConfig as l, type AptosSettings as m, type ScriptFunctionArgument as n, type MoveFunctionId as o, type AccountAddressInput as p, type MoveFunctionGenericTypeParam as q, SigningSchemeInput as r, SigningScheme as s, type AccountData as t, type MoveModuleBytecode as u, type TransactionResponse as v, type MoveResource as w, type MoveStructId as x, type TokenStandardArg as y, type GetAccountOwnedTokensFromCollectionResponse as z };