@aptos-labs/ts-sdk 1.22.1 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/common/{accountAddress-NYtf3uZq.d.ts → accountAddress-D9blTwwp.d.ts} +57 -15
  2. package/dist/common/cli/index.d.ts +22 -8
  3. package/dist/common/cli/index.js +1 -1
  4. package/dist/common/cli/index.js.map +1 -1
  5. package/dist/common/index.d.ts +58 -9
  6. package/dist/common/index.js +28 -26
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/account/Account.mjs +1 -1
  9. package/dist/esm/account/Ed25519Account.mjs +1 -1
  10. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  11. package/dist/esm/account/KeylessAccount.d.mts +13 -2
  12. package/dist/esm/account/KeylessAccount.mjs +1 -1
  13. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  14. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  15. package/dist/esm/account/index.mjs +1 -1
  16. package/dist/esm/api/account.d.mts +4 -1
  17. package/dist/esm/api/account.mjs +1 -1
  18. package/dist/esm/api/ans.mjs +1 -1
  19. package/dist/esm/api/aptos.mjs +1 -1
  20. package/dist/esm/api/aptosConfig.mjs +1 -1
  21. package/dist/esm/api/coin.mjs +1 -1
  22. package/dist/esm/api/digitalAsset.mjs +1 -1
  23. package/dist/esm/api/event.mjs +1 -1
  24. package/dist/esm/api/faucet.mjs +1 -1
  25. package/dist/esm/api/fungibleAsset.mjs +1 -1
  26. package/dist/esm/api/general.mjs +1 -1
  27. package/dist/esm/api/index.mjs +1 -1
  28. package/dist/esm/api/keyless.mjs +1 -1
  29. package/dist/esm/api/object.mjs +1 -1
  30. package/dist/esm/api/staking.mjs +1 -1
  31. package/dist/esm/api/table.mjs +1 -1
  32. package/dist/esm/api/transaction.mjs +1 -1
  33. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  34. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  35. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  36. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  37. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  38. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  39. package/dist/esm/api/utils.mjs +1 -1
  40. package/dist/esm/bcs/index.mjs +1 -1
  41. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  42. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  43. package/dist/esm/{chunk-Z4CGG42L.mjs → chunk-243IMA3Y.mjs} +2 -2
  44. package/dist/esm/chunk-2BJ23DXY.mjs +2 -0
  45. package/dist/esm/chunk-2BJ23DXY.mjs.map +1 -0
  46. package/dist/esm/chunk-2M45ESQN.mjs +2 -0
  47. package/dist/esm/{chunk-4KYQ7N3N.mjs.map → chunk-2M45ESQN.mjs.map} +1 -1
  48. package/dist/esm/{chunk-H6CS3BD7.mjs → chunk-2SGICMXB.mjs} +2 -2
  49. package/dist/esm/{chunk-3DCHEXE3.mjs → chunk-3CB53WTP.mjs} +2 -2
  50. package/dist/esm/{chunk-IPGKZUSA.mjs → chunk-3JFX3XDA.mjs} +2 -2
  51. package/dist/esm/{chunk-P43CXEO4.mjs → chunk-4FMAPHUM.mjs} +2 -2
  52. package/dist/esm/{chunk-UYF7AQLE.mjs → chunk-4R7FL2G2.mjs} +2 -2
  53. package/dist/esm/{chunk-S6H5Q2IK.mjs → chunk-4ZDOOSRJ.mjs} +2 -2
  54. package/dist/esm/{chunk-4GNJJZ4R.mjs → chunk-5OR2POPO.mjs} +2 -2
  55. package/dist/esm/{chunk-F6REP536.mjs → chunk-6WAXFWLH.mjs} +2 -2
  56. package/dist/esm/{chunk-W26LO3CR.mjs → chunk-72QKG5N2.mjs} +2 -2
  57. package/dist/esm/{chunk-VEGT6ZPK.mjs → chunk-7F7AIMGB.mjs} +2 -2
  58. package/dist/esm/{chunk-VQPLSJEI.mjs → chunk-B4ROOQE3.mjs} +2 -2
  59. package/dist/esm/chunk-B4ROOQE3.mjs.map +1 -0
  60. package/dist/esm/{chunk-4ARX2MGY.mjs → chunk-BDD6OBUV.mjs} +2 -2
  61. package/dist/esm/{chunk-7X6HZUXX.mjs → chunk-BEXHZ5XT.mjs} +2 -2
  62. package/dist/esm/{chunk-TY4IEDJD.mjs → chunk-BFRFAX5I.mjs} +2 -2
  63. package/dist/esm/{chunk-KDIPFPMS.mjs → chunk-BQ7OOQRE.mjs} +2 -2
  64. package/dist/esm/{chunk-6TRGVQLA.mjs → chunk-BQIT7TKM.mjs} +2 -2
  65. package/dist/esm/{chunk-3NPBKAPF.mjs → chunk-D6DCZULX.mjs} +2 -2
  66. package/dist/esm/chunk-D6QSRB4J.mjs +2 -0
  67. package/dist/esm/chunk-D6QSRB4J.mjs.map +1 -0
  68. package/dist/esm/{chunk-O7XEE7QT.mjs → chunk-DAEUQBVZ.mjs} +2 -2
  69. package/dist/esm/chunk-E7FWVXGX.mjs +1 -0
  70. package/dist/esm/{chunk-7WFKAS7T.mjs → chunk-EMFVGL2Y.mjs} +2 -2
  71. package/dist/esm/{chunk-VN2CRWOI.mjs → chunk-ES5Z33UX.mjs} +2 -2
  72. package/dist/esm/{chunk-S7G6VBUB.mjs → chunk-F435LQUS.mjs} +2 -2
  73. package/dist/esm/{chunk-JB5R6RGF.mjs → chunk-FAFN34ZH.mjs} +2 -2
  74. package/dist/esm/{chunk-NAGFCYG6.mjs → chunk-FE6CYBDF.mjs} +2 -2
  75. package/dist/esm/{chunk-6DDSU7HN.mjs → chunk-FRUEQTCC.mjs} +2 -2
  76. package/dist/esm/{chunk-SQQ2424E.mjs → chunk-FSTRZMCK.mjs} +2 -2
  77. package/dist/esm/{chunk-OPGMT27G.mjs → chunk-FZ3HMVKE.mjs} +2 -2
  78. package/dist/esm/{chunk-RFA7BIDN.mjs → chunk-GBZOWPC6.mjs} +2 -2
  79. package/dist/esm/{chunk-PVEPP4HR.mjs → chunk-GP3RTNYN.mjs} +2 -2
  80. package/dist/esm/chunk-IR6L77JS.mjs +2 -0
  81. package/dist/esm/chunk-IR6L77JS.mjs.map +1 -0
  82. package/dist/esm/{chunk-Y2H7FG2P.mjs → chunk-IUAAMX5V.mjs} +2 -2
  83. package/dist/esm/{chunk-I2T6BJOA.mjs → chunk-IZ7OGJBY.mjs} +2 -2
  84. package/dist/esm/{chunk-IPTCWBFV.mjs → chunk-J26STL4T.mjs} +2 -2
  85. package/dist/esm/{chunk-3VUSIKCF.mjs → chunk-J4KAYDPB.mjs} +2 -2
  86. package/dist/esm/chunk-J6NLU6QX.mjs +2 -0
  87. package/dist/esm/chunk-J6NLU6QX.mjs.map +1 -0
  88. package/dist/esm/{chunk-NLJVP5RP.mjs → chunk-K7OBPPSF.mjs} +2 -2
  89. package/dist/esm/{chunk-7RVYF5OP.mjs → chunk-L7FA4ISG.mjs} +2 -2
  90. package/dist/esm/{chunk-7HS4UJGE.mjs → chunk-MA7TL5VN.mjs} +2 -2
  91. package/dist/esm/{chunk-IN2L5ZAT.mjs → chunk-ME2PENQD.mjs} +2 -2
  92. package/dist/esm/{chunk-463B3NF7.mjs → chunk-MG3T24A3.mjs} +2 -2
  93. package/dist/esm/{chunk-T4NXIMZL.mjs → chunk-NC3KKAAK.mjs} +2 -2
  94. package/dist/esm/chunk-NECL5FCQ.mjs +1 -0
  95. package/dist/esm/chunk-NECL5FCQ.mjs.map +1 -0
  96. package/dist/esm/{chunk-T7YRD4PM.mjs → chunk-NJ2IXXY2.mjs} +2 -2
  97. package/dist/esm/{chunk-43IKKJ2Y.mjs → chunk-OBKVMO7I.mjs} +2 -2
  98. package/dist/esm/{chunk-SK2HTEP7.mjs → chunk-ODYVU346.mjs} +2 -2
  99. package/dist/esm/{chunk-UJYWEIQ2.mjs → chunk-OID45FCB.mjs} +2 -2
  100. package/dist/esm/{chunk-GWH34VNI.mjs → chunk-OUAQKVIC.mjs} +2 -2
  101. package/dist/esm/{chunk-C2IJG37E.mjs → chunk-PDOQLTXA.mjs} +2 -2
  102. package/dist/esm/chunk-PF54PEHF.mjs +2 -0
  103. package/dist/esm/chunk-PF54PEHF.mjs.map +1 -0
  104. package/dist/esm/{chunk-GCPWPGCS.mjs → chunk-PIUICROW.mjs} +2 -2
  105. package/dist/esm/{chunk-TWRYY6DD.mjs → chunk-QLKTSSVC.mjs} +2 -2
  106. package/dist/esm/chunk-QUMSKIYX.mjs +2 -0
  107. package/dist/esm/{chunk-CUSKA6RZ.mjs.map → chunk-QUMSKIYX.mjs.map} +1 -1
  108. package/dist/esm/{chunk-LBU3LV7I.mjs → chunk-RBIJJSGB.mjs} +2 -2
  109. package/dist/esm/{chunk-7CMCN6LB.mjs → chunk-RZKLIZ2D.mjs} +2 -2
  110. package/dist/esm/chunk-T52HPGL5.mjs +2 -0
  111. package/dist/esm/chunk-T52HPGL5.mjs.map +1 -0
  112. package/dist/esm/{chunk-OVG4SGPI.mjs → chunk-T7MGIHWV.mjs} +2 -2
  113. package/dist/esm/{chunk-LTMOMXPN.mjs → chunk-T7WBGP37.mjs} +2 -2
  114. package/dist/esm/{chunk-LTMOMXPN.mjs.map → chunk-T7WBGP37.mjs.map} +1 -1
  115. package/dist/esm/chunk-TDGQGILY.mjs +2 -0
  116. package/dist/esm/chunk-TDGQGILY.mjs.map +1 -0
  117. package/dist/esm/{chunk-CPCS5KIA.mjs → chunk-UY4EIN3P.mjs} +2 -2
  118. package/dist/esm/{chunk-H6QWMF3Q.mjs → chunk-V3NKDUY5.mjs} +2 -2
  119. package/dist/esm/{chunk-L6RINMT6.mjs → chunk-VA4HKHNV.mjs} +2 -2
  120. package/dist/esm/{chunk-YMFEA2TJ.mjs → chunk-VHNX2NUR.mjs} +3 -1
  121. package/dist/esm/chunk-VHNX2NUR.mjs.map +1 -0
  122. package/dist/esm/{chunk-77NXCSLY.mjs → chunk-WPYVWZQS.mjs} +2 -2
  123. package/dist/esm/{chunk-BF46IXHH.mjs → chunk-WSE653RS.mjs} +2 -2
  124. package/dist/esm/chunk-WSE653RS.mjs.map +1 -0
  125. package/dist/esm/{chunk-TCEOTADF.mjs → chunk-X2QSDREG.mjs} +2 -2
  126. package/dist/esm/{chunk-J5KAD2RM.mjs → chunk-Y5AY3QBY.mjs} +2 -2
  127. package/dist/esm/chunk-Y5VJSCVY.mjs +2 -0
  128. package/dist/esm/chunk-Y5VJSCVY.mjs.map +1 -0
  129. package/dist/esm/{chunk-J5YHMYHB.mjs → chunk-YEISKUKC.mjs} +2 -2
  130. package/dist/esm/{chunk-ZL4JYTID.mjs → chunk-ZE2TCKUL.mjs} +2 -2
  131. package/dist/esm/{chunk-LBKYNX5K.mjs → chunk-ZHNCJSXO.mjs} +2 -2
  132. package/dist/esm/{chunk-V5COHBA4.mjs → chunk-ZKCSQAGW.mjs} +2 -2
  133. package/dist/esm/{chunk-YDXU6ALO.mjs → chunk-ZMFVKUFD.mjs} +2 -2
  134. package/dist/esm/cli/index.mjs +1 -1
  135. package/dist/esm/cli/move.d.mts +21 -7
  136. package/dist/esm/cli/move.mjs +1 -1
  137. package/dist/esm/client/core.d.mts +2 -2
  138. package/dist/esm/client/core.mjs +1 -1
  139. package/dist/esm/client/get.mjs +1 -1
  140. package/dist/esm/client/index.mjs +1 -1
  141. package/dist/esm/client/post.mjs +1 -1
  142. package/dist/esm/client/types.d.mts +8 -1
  143. package/dist/esm/client/types.mjs +1 -1
  144. package/dist/esm/core/account/index.mjs +1 -1
  145. package/dist/esm/core/account/utils/address.mjs +1 -1
  146. package/dist/esm/core/account/utils/index.mjs +1 -1
  147. package/dist/esm/core/accountAddress.d.mts +1 -0
  148. package/dist/esm/core/accountAddress.mjs +1 -1
  149. package/dist/esm/core/authenticationKey.mjs +1 -1
  150. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  151. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  152. package/dist/esm/core/crypto/index.d.mts +3 -3
  153. package/dist/esm/core/crypto/index.mjs +1 -1
  154. package/dist/esm/core/crypto/keyless.mjs +1 -1
  155. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  156. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  157. package/dist/esm/core/crypto/proof.mjs +1 -1
  158. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  159. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  160. package/dist/esm/core/crypto/signature.mjs +1 -1
  161. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  162. package/dist/esm/core/index.d.mts +1 -0
  163. package/dist/esm/core/index.mjs +1 -1
  164. package/dist/esm/index.d.mts +2 -1
  165. package/dist/esm/index.mjs +1 -1
  166. package/dist/esm/internal/account.d.mts +2 -1
  167. package/dist/esm/internal/account.mjs +1 -1
  168. package/dist/esm/internal/ans.d.mts +17 -1
  169. package/dist/esm/internal/ans.mjs +1 -1
  170. package/dist/esm/internal/coin.mjs +1 -1
  171. package/dist/esm/internal/digitalAsset.mjs +1 -1
  172. package/dist/esm/internal/event.mjs +1 -1
  173. package/dist/esm/internal/faucet.mjs +1 -1
  174. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  175. package/dist/esm/internal/general.mjs +1 -1
  176. package/dist/esm/internal/keyless.mjs +1 -1
  177. package/dist/esm/internal/object.mjs +1 -1
  178. package/dist/esm/internal/staking.mjs +1 -1
  179. package/dist/esm/internal/table.mjs +1 -1
  180. package/dist/esm/internal/transaction.mjs +1 -1
  181. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  182. package/dist/esm/internal/view.mjs +1 -1
  183. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  184. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  185. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  186. package/dist/esm/transactions/index.mjs +1 -1
  187. package/dist/esm/transactions/instances/index.mjs +1 -1
  188. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  189. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  190. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  191. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  192. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  193. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  194. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  195. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  196. package/dist/esm/transactions/management/index.mjs +1 -1
  197. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  198. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  199. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  200. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  201. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  202. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  203. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  204. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  205. package/dist/esm/types/generated/operations.d.mts +16 -12
  206. package/dist/esm/types/generated/queries.d.mts +2 -2
  207. package/dist/esm/types/generated/queries.mjs +1 -1
  208. package/dist/esm/types/generated/types.d.mts +365 -761
  209. package/dist/esm/types/generated/types.mjs +1 -1
  210. package/dist/esm/types/generated/types.mjs.map +1 -1
  211. package/dist/esm/types/index.d.mts +42 -3
  212. package/dist/esm/types/index.mjs +1 -1
  213. package/dist/esm/utils/index.mjs +1 -1
  214. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  215. package/dist/esm/version.d.mts +1 -1
  216. package/dist/esm/version.mjs +1 -1
  217. package/package.json +2 -1
  218. package/src/account/KeylessAccount.ts +20 -4
  219. package/src/api/account.ts +4 -1
  220. package/src/client/core.ts +25 -52
  221. package/src/client/types.ts +60 -7
  222. package/src/core/accountAddress.ts +2 -0
  223. package/src/core/crypto/ephemeral.ts +1 -1
  224. package/src/internal/account.ts +35 -4
  225. package/src/internal/ans.ts +36 -4
  226. package/src/internal/queries/ansTokenFragment.graphql +2 -0
  227. package/src/types/generated/operations.ts +16 -12
  228. package/src/types/generated/queries.ts +2 -0
  229. package/src/types/generated/types.ts +387 -835
  230. package/src/types/index.ts +48 -1
  231. package/src/version.ts +1 -1
  232. package/dist/esm/chunk-4KYQ7N3N.mjs +0 -2
  233. package/dist/esm/chunk-5M235PLS.mjs +0 -2
  234. package/dist/esm/chunk-5M235PLS.mjs.map +0 -1
  235. package/dist/esm/chunk-67BD7B6N.mjs +0 -2
  236. package/dist/esm/chunk-67BD7B6N.mjs.map +0 -1
  237. package/dist/esm/chunk-BF46IXHH.mjs.map +0 -1
  238. package/dist/esm/chunk-CUSKA6RZ.mjs +0 -2
  239. package/dist/esm/chunk-GHYE26Q5.mjs +0 -2
  240. package/dist/esm/chunk-GHYE26Q5.mjs.map +0 -1
  241. package/dist/esm/chunk-PY23BQ2H.mjs +0 -2
  242. package/dist/esm/chunk-PY23BQ2H.mjs.map +0 -1
  243. package/dist/esm/chunk-Q6LFIZ3L.mjs +0 -2
  244. package/dist/esm/chunk-Q6LFIZ3L.mjs.map +0 -1
  245. package/dist/esm/chunk-Q7ZP25NJ.mjs +0 -2
  246. package/dist/esm/chunk-Q7ZP25NJ.mjs.map +0 -1
  247. package/dist/esm/chunk-RFSO3JRG.mjs +0 -1
  248. package/dist/esm/chunk-TZOKV22Z.mjs +0 -2
  249. package/dist/esm/chunk-TZOKV22Z.mjs.map +0 -1
  250. package/dist/esm/chunk-VQPLSJEI.mjs.map +0 -1
  251. package/dist/esm/chunk-XVWNPR4T.mjs +0 -2
  252. package/dist/esm/chunk-XVWNPR4T.mjs.map +0 -1
  253. package/dist/esm/chunk-YMFEA2TJ.mjs.map +0 -1
  254. /package/dist/esm/{chunk-Z4CGG42L.mjs.map → chunk-243IMA3Y.mjs.map} +0 -0
  255. /package/dist/esm/{chunk-H6CS3BD7.mjs.map → chunk-2SGICMXB.mjs.map} +0 -0
  256. /package/dist/esm/{chunk-3DCHEXE3.mjs.map → chunk-3CB53WTP.mjs.map} +0 -0
  257. /package/dist/esm/{chunk-IPGKZUSA.mjs.map → chunk-3JFX3XDA.mjs.map} +0 -0
  258. /package/dist/esm/{chunk-P43CXEO4.mjs.map → chunk-4FMAPHUM.mjs.map} +0 -0
  259. /package/dist/esm/{chunk-UYF7AQLE.mjs.map → chunk-4R7FL2G2.mjs.map} +0 -0
  260. /package/dist/esm/{chunk-S6H5Q2IK.mjs.map → chunk-4ZDOOSRJ.mjs.map} +0 -0
  261. /package/dist/esm/{chunk-4GNJJZ4R.mjs.map → chunk-5OR2POPO.mjs.map} +0 -0
  262. /package/dist/esm/{chunk-F6REP536.mjs.map → chunk-6WAXFWLH.mjs.map} +0 -0
  263. /package/dist/esm/{chunk-W26LO3CR.mjs.map → chunk-72QKG5N2.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-VEGT6ZPK.mjs.map → chunk-7F7AIMGB.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-4ARX2MGY.mjs.map → chunk-BDD6OBUV.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-7X6HZUXX.mjs.map → chunk-BEXHZ5XT.mjs.map} +0 -0
  267. /package/dist/esm/{chunk-TY4IEDJD.mjs.map → chunk-BFRFAX5I.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-KDIPFPMS.mjs.map → chunk-BQ7OOQRE.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-6TRGVQLA.mjs.map → chunk-BQIT7TKM.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-3NPBKAPF.mjs.map → chunk-D6DCZULX.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-O7XEE7QT.mjs.map → chunk-DAEUQBVZ.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-RFSO3JRG.mjs.map → chunk-E7FWVXGX.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-7WFKAS7T.mjs.map → chunk-EMFVGL2Y.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-VN2CRWOI.mjs.map → chunk-ES5Z33UX.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-S7G6VBUB.mjs.map → chunk-F435LQUS.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-JB5R6RGF.mjs.map → chunk-FAFN34ZH.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-NAGFCYG6.mjs.map → chunk-FE6CYBDF.mjs.map} +0 -0
  278. /package/dist/esm/{chunk-6DDSU7HN.mjs.map → chunk-FRUEQTCC.mjs.map} +0 -0
  279. /package/dist/esm/{chunk-SQQ2424E.mjs.map → chunk-FSTRZMCK.mjs.map} +0 -0
  280. /package/dist/esm/{chunk-OPGMT27G.mjs.map → chunk-FZ3HMVKE.mjs.map} +0 -0
  281. /package/dist/esm/{chunk-RFA7BIDN.mjs.map → chunk-GBZOWPC6.mjs.map} +0 -0
  282. /package/dist/esm/{chunk-PVEPP4HR.mjs.map → chunk-GP3RTNYN.mjs.map} +0 -0
  283. /package/dist/esm/{chunk-Y2H7FG2P.mjs.map → chunk-IUAAMX5V.mjs.map} +0 -0
  284. /package/dist/esm/{chunk-I2T6BJOA.mjs.map → chunk-IZ7OGJBY.mjs.map} +0 -0
  285. /package/dist/esm/{chunk-IPTCWBFV.mjs.map → chunk-J26STL4T.mjs.map} +0 -0
  286. /package/dist/esm/{chunk-3VUSIKCF.mjs.map → chunk-J4KAYDPB.mjs.map} +0 -0
  287. /package/dist/esm/{chunk-NLJVP5RP.mjs.map → chunk-K7OBPPSF.mjs.map} +0 -0
  288. /package/dist/esm/{chunk-7RVYF5OP.mjs.map → chunk-L7FA4ISG.mjs.map} +0 -0
  289. /package/dist/esm/{chunk-7HS4UJGE.mjs.map → chunk-MA7TL5VN.mjs.map} +0 -0
  290. /package/dist/esm/{chunk-IN2L5ZAT.mjs.map → chunk-ME2PENQD.mjs.map} +0 -0
  291. /package/dist/esm/{chunk-463B3NF7.mjs.map → chunk-MG3T24A3.mjs.map} +0 -0
  292. /package/dist/esm/{chunk-T4NXIMZL.mjs.map → chunk-NC3KKAAK.mjs.map} +0 -0
  293. /package/dist/esm/{chunk-T7YRD4PM.mjs.map → chunk-NJ2IXXY2.mjs.map} +0 -0
  294. /package/dist/esm/{chunk-43IKKJ2Y.mjs.map → chunk-OBKVMO7I.mjs.map} +0 -0
  295. /package/dist/esm/{chunk-SK2HTEP7.mjs.map → chunk-ODYVU346.mjs.map} +0 -0
  296. /package/dist/esm/{chunk-UJYWEIQ2.mjs.map → chunk-OID45FCB.mjs.map} +0 -0
  297. /package/dist/esm/{chunk-GWH34VNI.mjs.map → chunk-OUAQKVIC.mjs.map} +0 -0
  298. /package/dist/esm/{chunk-C2IJG37E.mjs.map → chunk-PDOQLTXA.mjs.map} +0 -0
  299. /package/dist/esm/{chunk-GCPWPGCS.mjs.map → chunk-PIUICROW.mjs.map} +0 -0
  300. /package/dist/esm/{chunk-TWRYY6DD.mjs.map → chunk-QLKTSSVC.mjs.map} +0 -0
  301. /package/dist/esm/{chunk-LBU3LV7I.mjs.map → chunk-RBIJJSGB.mjs.map} +0 -0
  302. /package/dist/esm/{chunk-7CMCN6LB.mjs.map → chunk-RZKLIZ2D.mjs.map} +0 -0
  303. /package/dist/esm/{chunk-OVG4SGPI.mjs.map → chunk-T7MGIHWV.mjs.map} +0 -0
  304. /package/dist/esm/{chunk-CPCS5KIA.mjs.map → chunk-UY4EIN3P.mjs.map} +0 -0
  305. /package/dist/esm/{chunk-H6QWMF3Q.mjs.map → chunk-V3NKDUY5.mjs.map} +0 -0
  306. /package/dist/esm/{chunk-L6RINMT6.mjs.map → chunk-VA4HKHNV.mjs.map} +0 -0
  307. /package/dist/esm/{chunk-77NXCSLY.mjs.map → chunk-WPYVWZQS.mjs.map} +0 -0
  308. /package/dist/esm/{chunk-TCEOTADF.mjs.map → chunk-X2QSDREG.mjs.map} +0 -0
  309. /package/dist/esm/{chunk-J5KAD2RM.mjs.map → chunk-Y5AY3QBY.mjs.map} +0 -0
  310. /package/dist/esm/{chunk-J5YHMYHB.mjs.map → chunk-YEISKUKC.mjs.map} +0 -0
  311. /package/dist/esm/{chunk-ZL4JYTID.mjs.map → chunk-ZE2TCKUL.mjs.map} +0 -0
  312. /package/dist/esm/{chunk-LBKYNX5K.mjs.map → chunk-ZHNCJSXO.mjs.map} +0 -0
  313. /package/dist/esm/{chunk-V5COHBA4.mjs.map → chunk-ZKCSQAGW.mjs.map} +0 -0
  314. /package/dist/esm/{chunk-YDXU6ALO.mjs.map → chunk-ZMFVKUFD.mjs.map} +0 -0
@@ -298,16 +298,18 @@ declare enum TransactionResponseType {
298
298
  Genesis = "genesis_transaction",
299
299
  BlockMetadata = "block_metadata_transaction",
300
300
  StateCheckpoint = "state_checkpoint_transaction",
301
- Validator = "validator_transaction"
301
+ Validator = "validator_transaction",
302
+ BlockEpilogue = "block_epilogue_transaction"
302
303
  }
303
304
  type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;
304
- type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse | ValidatorTransactionResponse;
305
+ type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse | ValidatorTransactionResponse | BlockEpilogueTransactionResponse;
305
306
  declare function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse;
306
307
  declare function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse;
307
308
  declare function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse;
308
309
  declare function isBlockMetadataTransactionResponse(response: TransactionResponse): response is BlockMetadataTransactionResponse;
309
310
  declare function isStateCheckpointTransactionResponse(response: TransactionResponse): response is StateCheckpointTransactionResponse;
310
311
  declare function isValidatorTransactionResponse(response: TransactionResponse): response is ValidatorTransactionResponse;
312
+ declare function isBlockEpilogueTransactionResponse(response: TransactionResponse): response is BlockEpilogueTransactionResponse;
311
313
  type PendingTransactionResponse = {
312
314
  type: TransactionResponseType.Pending;
313
315
  hash: string;
@@ -469,6 +471,43 @@ type ValidatorTransactionResponse = {
469
471
  events: Array<Event>;
470
472
  timestamp: string;
471
473
  };
474
+ /**
475
+ * BlockEndInfo describes the gas state of the block
476
+ */
477
+ type BlockEndInfo = {
478
+ block_gas_limit_reached: boolean;
479
+ block_output_limit_reached: boolean;
480
+ block_effective_block_gas_units: number;
481
+ block_approx_output_size: number;
482
+ };
483
+ /**
484
+ * BlockEpilogueTransactionResponse is a transaction that is executed at the end of a block keeping track of data from
485
+ * the whole block
486
+ */
487
+ type BlockEpilogueTransactionResponse = {
488
+ type: TransactionResponseType.BlockEpilogue;
489
+ version: string;
490
+ hash: string;
491
+ state_change_hash: string;
492
+ event_root_hash: string;
493
+ state_checkpoint_hash: string | null;
494
+ gas_used: string;
495
+ /**
496
+ * Whether the transaction was successful
497
+ */
498
+ success: boolean;
499
+ /**
500
+ * The VM status of the transaction, can tell useful information in a failure
501
+ */
502
+ vm_status: string;
503
+ accumulator_root_hash: string;
504
+ /**
505
+ * Final state of resources changed by the transaction
506
+ */
507
+ changes: Array<WriteSetChange>;
508
+ timestamp: string;
509
+ block_end_info: BlockEndInfo | null;
510
+ };
472
511
  /**
473
512
  * WRITESET CHANGE TYPES
474
513
  */
@@ -951,4 +990,4 @@ type GenerateAccountWithSingleSignerSecp256k1Key = {
951
990
  };
952
991
  type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
953
992
 
954
- export { AccountAuthenticatorVariant, type AccountData, type AccountSignature, type AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, type AptosRequest, type AptosSettings, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, type Client, type ClientConfig, type ClientHeadersType, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, type DecodedTableData, type DeletedTableData, DeriveScheme, type DirectWriteSet, type EntryFunctionPayloadResponse, EphemeralCertificateVariant, EphemeralPublicKeyVariant, EphemeralSignatureVariant, type Event, type EventGuid, type FaucetConfig, type FullNodeConfig, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type HexInput, type IndexerConfig, type LedgerInfo, type LedgerVersionArg, MimeType, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, type MoveOptionType, type MoveResource, type MoveScriptBytecode, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, type MultisigPayloadResponse, OrderBy, type OrderByArg, type PaginationArgs, type PendingTransactionResponse, RoleType, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, SigningScheme, SigningSchemeInput, type StateCheckpointTransactionResponse, type TableItemRequest, TokenStandard, type TokenStandardArg, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, type TransactionPayloadResponse, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TypeTagVariants, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ValidatorTransactionResponse, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, ZkpVariant, isBlockMetadataTransactionResponse, isEd25519Signature, isFeePayerSignature, isGenesisTransactionResponse, isMultiAgentSignature, isMultiEd25519Signature, isPendingTransactionResponse, isSecp256k1Signature, isStateCheckpointTransactionResponse, isUserTransactionResponse, isValidatorTransactionResponse };
993
+ export { AccountAuthenticatorVariant, type AccountData, type AccountSignature, type AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, type AptosRequest, type AptosSettings, type AuthenticationKeyScheme, type Block, type BlockEndInfo, type BlockEpilogueTransactionResponse, type BlockMetadataTransactionResponse, type Client, type ClientConfig, type ClientHeadersType, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, type DecodedTableData, type DeletedTableData, DeriveScheme, type DirectWriteSet, type EntryFunctionPayloadResponse, EphemeralCertificateVariant, EphemeralPublicKeyVariant, EphemeralSignatureVariant, type Event, type EventGuid, type FaucetConfig, type FullNodeConfig, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type HexInput, type IndexerConfig, type LedgerInfo, type LedgerVersionArg, MimeType, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, type MoveOptionType, type MoveResource, type MoveScriptBytecode, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, type MultisigPayloadResponse, OrderBy, type OrderByArg, type PaginationArgs, type PendingTransactionResponse, RoleType, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, SigningScheme, SigningSchemeInput, type StateCheckpointTransactionResponse, type TableItemRequest, TokenStandard, type TokenStandardArg, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, type TransactionPayloadResponse, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TypeTagVariants, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ValidatorTransactionResponse, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, ZkpVariant, isBlockEpilogueTransactionResponse, isBlockMetadataTransactionResponse, isEd25519Signature, isFeePayerSignature, isGenesisTransactionResponse, isMultiAgentSignature, isMultiEd25519Signature, isPendingTransactionResponse, isSecp256k1Signature, isStateCheckpointTransactionResponse, isUserTransactionResponse, isValidatorTransactionResponse };
@@ -1,2 +1,2 @@
1
- import{A,B,C,D,E,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{g as AccountAuthenticatorVariant,h as AnyPublicKeyVariant,i as AnySignatureVariant,E as DeriveScheme,l as EphemeralCertificateVariant,j as EphemeralPublicKeyVariant,k as EphemeralSignatureVariant,a as MimeType,A as MoveAbility,z as MoveFunctionVisibility,B as RoleType,c as ScriptTransactionArgumentVariants,C as SigningScheme,D as SigningSchemeInput,f as TransactionAuthenticatorVariant,d as TransactionPayloadVariants,n as TransactionResponseType,e as TransactionVariants,b as TypeTagVariants,m as ZkpVariant,r as isBlockMetadataTransactionResponse,u as isEd25519Signature,x as isFeePayerSignature,q as isGenesisTransactionResponse,w as isMultiAgentSignature,y as isMultiEd25519Signature,o as isPendingTransactionResponse,v as isSecp256k1Signature,s as isStateCheckpointTransactionResponse,p as isUserTransactionResponse,t as isValidatorTransactionResponse};
1
+ import{A,B,C,D,E,F,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{g as AccountAuthenticatorVariant,h as AnyPublicKeyVariant,i as AnySignatureVariant,F as DeriveScheme,l as EphemeralCertificateVariant,j as EphemeralPublicKeyVariant,k as EphemeralSignatureVariant,a as MimeType,B as MoveAbility,A as MoveFunctionVisibility,C as RoleType,c as ScriptTransactionArgumentVariants,D as SigningScheme,E as SigningSchemeInput,f as TransactionAuthenticatorVariant,d as TransactionPayloadVariants,n as TransactionResponseType,e as TransactionVariants,b as TypeTagVariants,m as ZkpVariant,u as isBlockEpilogueTransactionResponse,r as isBlockMetadataTransactionResponse,v as isEd25519Signature,y as isFeePayerSignature,q as isGenesisTransactionResponse,x as isMultiAgentSignature,z as isMultiEd25519Signature,o as isPendingTransactionResponse,w as isSecp256k1Signature,s as isStateCheckpointTransactionResponse,p as isUserTransactionResponse,t as isValidatorTransactionResponse};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o,h as p}from"../chunk-L36ZHC7J.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-SCHZ67F3.mjs";import"../chunk-FVA2OPG4.mjs";export{m as APTOS_COIN,i as AptosApiType,j as DEFAULT_MAX_GAS_AMOUNT,k as DEFAULT_TXN_EXP_SEC_FROM_NOW,l as DEFAULT_TXN_TIMEOUT_SEC,f as Network,g as NetworkToChainId,c as NetworkToFaucetAPI,a as NetworkToIndexerAPI,h as NetworkToNetworkName,b as NetworkToNodeAPI,d as NetworkToPepperAPI,e as NetworkToProverAPI,p as ProcessorType,n as RAW_TRANSACTION_SALT,o as RAW_TRANSACTION_WITH_DATA_SALT,q as normalizeBundle};
1
+ import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o,h as p}from"../chunk-SCHZ67F3.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-L36ZHC7J.mjs";import"../chunk-FVA2OPG4.mjs";export{e as APTOS_COIN,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,n as Network,o as NetworkToChainId,k as NetworkToFaucetAPI,i as NetworkToIndexerAPI,p as NetworkToNetworkName,j as NetworkToNodeAPI,l as NetworkToPepperAPI,m as NetworkToProverAPI,h as ProcessorType,f as RAW_TRANSACTION_SALT,g as RAW_TRANSACTION_WITH_DATA_SALT,q as normalizeBundle};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as normalizeBundle};
1
+ import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-2BJ23DXY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as normalizeBundle};
2
2
  //# sourceMappingURL=normalizeBundle.mjs.map
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * hardcoded for now, we would want to have it injected dynamically
5
5
  */
6
- declare const VERSION = "1.20.0";
6
+ declare const VERSION = "1.23.0";
7
7
 
8
8
  export { VERSION };
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-4KYQ7N3N.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
1
+ import{a}from"./chunk-2M45ESQN.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
2
2
  //# sourceMappingURL=version.mjs.map
package/package.json CHANGED
@@ -35,6 +35,7 @@
35
35
  "scripts": {
36
36
  "build:clean": "rm -rf dist",
37
37
  "build": "pnpm build:clean && tsup",
38
+ "prepublishOnly": "pnpm run build",
38
39
  "_fmt": "prettier 'src/**/*.ts' 'tests/**/*.ts' 'examples/**/*.js' 'examples/**/*.ts' '.eslintrc.js'",
39
40
  "fmt": "pnpm _fmt --write",
40
41
  "lint": "eslint 'src/**/*.ts' 'tests/**/*.ts' 'examples/**/*.ts'",
@@ -91,5 +92,5 @@
91
92
  "typedoc": "^0.25.4",
92
93
  "typescript": "^5.3.3"
93
94
  },
94
- "version": "1.22.1"
95
+ "version": "1.23.0"
95
96
  }
@@ -11,7 +11,6 @@ import {
11
11
  KeylessPublicKey,
12
12
  KeylessSignature,
13
13
  EphemeralCertificate,
14
- Signature,
15
14
  ZeroKnowledgeSig,
16
15
  ZkProof,
17
16
  } from "../core/crypto";
@@ -269,9 +268,26 @@ export class KeylessAccount extends Serializable implements Account {
269
268
  return this.sign(signMess);
270
269
  }
271
270
 
272
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this
273
- verifySignature(args: { message: HexInput; signature: Signature }): boolean {
274
- throw new Error("Not implemented");
271
+ /**
272
+ * Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount
273
+ *
274
+ * Verifies a signature given the message.
275
+ *
276
+ * TODO: Groth16 proof verification
277
+ *
278
+ * @param args.message the message that was signed.
279
+ * @param args.signature the KeylessSignature to verify
280
+ * @returns boolean
281
+ */
282
+ verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {
283
+ const { message, signature } = args;
284
+ if (this.isExpired()) {
285
+ return false;
286
+ }
287
+ if (!this.ephemeralKeyPair.getPublicKey().verifySignature({ message, signature: signature.ephemeralSignature })) {
288
+ return false;
289
+ }
290
+ return true;
275
291
  }
276
292
 
277
293
  static fromBytes(bytes: Uint8Array): KeylessAccount {
@@ -439,12 +439,15 @@ export class Account {
439
439
  *
440
440
  * @param args.accountAddress The account address we want to get the total count for
441
441
  * @param args.coinType The coin type to query
442
+ * @param args.faMetadataAddress The fungible asset metadata address to query.
443
+ * Note: coinType will automatically fill this in if not provided when migrated to fungible assets
442
444
  * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
443
445
  * @returns Current amount of account's coin
444
446
  */
445
447
  async getAccountCoinAmount(args: {
446
448
  accountAddress: AccountAddressInput;
447
- coinType: MoveStructId;
449
+ coinType?: MoveStructId;
450
+ faMetadataAddress?: AccountAddressInput;
448
451
  minimumLedgerVersion?: AnyNumber;
449
452
  }): Promise<number> {
450
453
  await waitForIndexerOnVersion({
@@ -7,20 +7,6 @@ import { VERSION } from "../version";
7
7
  import { AnyNumber, AptosRequest, Client, ClientRequest, ClientResponse, MimeType } from "../types";
8
8
  import { AptosApiType } from "../utils";
9
9
 
10
- /**
11
- * Meaningful errors map
12
- */
13
- const errors: Record<number, string> = {
14
- 400: "Bad Request",
15
- 401: "Unauthorized",
16
- 403: "Forbidden",
17
- 404: "Not Found",
18
- 429: "Too Many Requests",
19
- 500: "Internal Server Error",
20
- 502: "Bad Gateway",
21
- 503: "Service Unavailable",
22
- };
23
-
24
10
  /**
25
11
  * Given a url and method, sends the request with axios and
26
12
  * returns the response.
@@ -58,71 +44,58 @@ export async function request<Req, Res>(options: ClientRequest<Req>, client: Cli
58
44
  /**
59
45
  * The main function to use when doing an API request.
60
46
  *
61
- * @param options AptosRequest
47
+ * @param aptosRequestOpts AptosRequest
62
48
  * @param aptosConfig The config information for the SDK client instance
63
49
  * @returns the response or AptosApiError
64
50
  */
65
51
  export async function aptosRequest<Req extends {}, Res extends {}>(
66
- options: AptosRequest,
52
+ aptosRequestOpts: AptosRequest,
67
53
  aptosConfig: AptosConfig,
68
54
  apiType: AptosApiType,
69
55
  ): Promise<AptosResponse<Req, Res>> {
70
- const { url, path } = options;
56
+ const { url, path } = aptosRequestOpts;
71
57
  const fullUrl = path ? `${url}/${path}` : url;
72
- const response = await request<Req, Res>({ ...options, url: fullUrl }, aptosConfig.client);
58
+ const clientResponse = await request<Req, Res>({ ...aptosRequestOpts, url: fullUrl }, aptosConfig.client);
73
59
 
74
- const result: AptosResponse<Req, Res> = {
75
- status: response.status,
76
- statusText: response.statusText!,
77
- data: response.data,
78
- headers: response.headers,
79
- config: response.config,
80
- request: response.request,
60
+ const aptosResponse: AptosResponse<Req, Res> = {
61
+ status: clientResponse.status,
62
+ statusText: clientResponse.statusText!,
63
+ data: clientResponse.data,
64
+ headers: clientResponse.headers,
65
+ config: clientResponse.config,
66
+ request: clientResponse.request,
81
67
  url: fullUrl,
82
68
  };
83
69
 
84
70
  // Handle case for `Unauthorized` error (i.e API_KEY error)
85
- if (result.status === 401) {
86
- throw new AptosApiError(options, result, `Error: ${result.data}`);
71
+ if (aptosResponse.status === 401) {
72
+ throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });
87
73
  }
88
74
 
89
75
  // to support both fullnode and indexer responses,
90
76
  // check if it is an indexer query, and adjust response.data
91
77
  if (apiType === AptosApiType.INDEXER) {
92
- const indexerResponse = result.data as any;
78
+ const indexerResponse = aptosResponse.data as any;
93
79
  // Handle Indexer general errors
94
80
  if (indexerResponse.errors) {
95
- throw new AptosApiError(
96
- options,
97
- result,
98
- `Indexer error: ${indexerResponse.errors[0].message}` ??
99
- `Indexer unhandled Error ${response.status} : ${response.statusText}`,
100
- );
81
+ throw new AptosApiError({
82
+ apiType,
83
+ aptosRequest: aptosRequestOpts,
84
+ aptosResponse,
85
+ });
101
86
  }
102
- result.data = indexerResponse.data as Res;
87
+ aptosResponse.data = indexerResponse.data as Res;
103
88
  } else if (apiType === AptosApiType.PEPPER || apiType === AptosApiType.PROVER) {
104
- if (result.status >= 400) {
105
- throw new AptosApiError(options, result, `${response.data}`);
89
+ if (aptosResponse.status >= 400) {
90
+ throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });
106
91
  }
107
92
  }
108
93
 
109
- if (result.status >= 200 && result.status < 300) {
110
- return result;
111
- }
112
-
113
- let errorMessage: string;
114
-
115
- if (result && result.data && "message" in result.data && "error_code" in result.data) {
116
- errorMessage = JSON.stringify(result.data);
117
- } else if (result.status in errors) {
118
- // If it's not an API type, it must come form infra, these are prehandled
119
- errorMessage = errors[result.status];
120
- } else {
121
- // Everything else is unhandled
122
- errorMessage = `Unhandled Error ${result.status} : ${result.statusText}`;
94
+ if (aptosResponse.status >= 200 && aptosResponse.status < 300) {
95
+ return aptosResponse;
123
96
  }
124
97
 
125
98
  // We have to explicitly check for all request types, because if the error is a non-indexer error, but
126
99
  // comes from an indexer request (e.g. 404), we'll need to mention it appropriately
127
- throw new AptosApiError(options, result, `${apiType} error: ${errorMessage}`);
100
+ throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });
128
101
  }
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { AptosRequest } from "../types";
5
+ import { AptosApiType } from "../utils/const.js";
5
6
 
6
7
  /**
7
8
  * The API response type
@@ -24,6 +25,12 @@ export interface AptosResponse<Req, Res> {
24
25
  request?: Req;
25
26
  }
26
27
 
28
+ type AptosApiErrorOpts = {
29
+ apiType: AptosApiType;
30
+ aptosRequest: AptosRequest;
31
+ aptosResponse: AptosResponse<any, any>;
32
+ };
33
+
27
34
  /**
28
35
  * The type returned from an API error
29
36
  *
@@ -45,14 +52,60 @@ export class AptosApiError extends Error {
45
52
 
46
53
  readonly request: AptosRequest;
47
54
 
48
- constructor(request: AptosRequest, response: AptosResponse<any, any>, message: string) {
49
- super(message);
55
+ /** @internal this constructor is for sdk internal use - do not instantiate outside of the SDK codebase */
56
+ constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts) {
57
+ super(deriveErrorMessage({ apiType, aptosRequest, aptosResponse }));
50
58
 
51
59
  this.name = "AptosApiError";
52
- this.url = response.url;
53
- this.status = response.status;
54
- this.statusText = response.statusText;
55
- this.data = response.data;
56
- this.request = request;
60
+ this.url = aptosResponse.url;
61
+ this.status = aptosResponse.status;
62
+ this.statusText = aptosResponse.statusText;
63
+ this.data = aptosResponse.data;
64
+ this.request = aptosRequest;
65
+ }
66
+ }
67
+
68
+ function deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts): string {
69
+ // extract the W3C trace_id from the response headers if it exists. Some services set this in the response and it's useful for debugging.
70
+ // See https://www.w3.org/TR/trace-context/#relationship-between-the-headers .
71
+ const traceId = aptosResponse.headers?.traceparent?.split("-")[1];
72
+ const traceIdString = traceId ? `(trace_id:${traceId}) ` : "";
73
+
74
+ const errorPrelude: string = `Request to [${apiType}]: ${aptosRequest.method} ${
75
+ aptosResponse.url ?? aptosRequest.url
76
+ } ${traceIdString}failed with`;
77
+
78
+ // handle graphql responses from indexer api and extract the error message of the first error
79
+ if (apiType === AptosApiType.INDEXER && aptosResponse.data?.errors?.[0]?.message != null) {
80
+ return `${errorPrelude}: ${aptosResponse.data.errors[0].message}`;
81
+ }
82
+
83
+ // Received well-known structured error response body - simply serialize and return it.
84
+ // We don't need http status codes etc. in this case.
85
+ if (aptosResponse.data?.message != null && aptosResponse.data?.error_code != null) {
86
+ return `${errorPrelude}: ${JSON.stringify(aptosResponse.data)}`;
87
+ }
88
+
89
+ // This is the generic/catch-all case. We received some response from the API but it doesn't appear to be a well-known structure.
90
+ // We print http status codes and the response body (after some trimming),
91
+ // in the hope that this gives enough context what went wrong without printing overly huge messages.
92
+ return `${errorPrelude} status: ${aptosResponse.statusText}(code:${
93
+ aptosResponse.status
94
+ }) and response body: ${serializeAnyPayloadForErrorMessage(aptosResponse.data)}`;
95
+ }
96
+
97
+ const SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH = 400;
98
+
99
+ // this function accepts a payload of any type (probably an object) and serializes it to a string
100
+ // Since we don't know the type or size of the payload and we don't want to add a huge object in full to the error message
101
+ // we limit the to the first 200 and last 200 characters of the serialized payload and put a "..." in the middle.
102
+ function serializeAnyPayloadForErrorMessage(payload: any): string {
103
+ const serializedPayload = JSON.stringify(payload);
104
+ if (serializedPayload.length <= SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH) {
105
+ return serializedPayload;
57
106
  }
107
+ return `truncated(original_size:${serializedPayload.length}): ${serializedPayload.slice(
108
+ 0,
109
+ SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2,
110
+ )}...${serializedPayload.slice(-SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2)}`;
58
111
  }
@@ -65,6 +65,8 @@ export class AccountAddress extends Serializable implements TransactionArgument
65
65
 
66
66
  static FOUR: AccountAddress = AccountAddress.from("0x4");
67
67
 
68
+ static A: AccountAddress = AccountAddress.from("0xA");
69
+
68
70
  /**
69
71
  * Creates an instance of AccountAddress from a Uint8Array.
70
72
  *
@@ -52,7 +52,7 @@ export class EphemeralPublicKey extends PublicKey {
52
52
  */
53
53
  verifySignature(args: { message: HexInput; signature: EphemeralSignature }): boolean {
54
54
  const { message, signature } = args;
55
- return this.publicKey.verifySignature({ message, signature });
55
+ return this.publicKey.verifySignature({ message, signature: signature.signature });
56
56
  }
57
57
 
58
58
  serialize(serializer: Serializer): void {
@@ -52,9 +52,10 @@ import {
52
52
  GetAccountTransactionsCount,
53
53
  } from "../types/generated/queries";
54
54
  import { memoizeAsync } from "../utils/memoize";
55
- import { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey } from "../core";
55
+ import { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey, createObjectAddress } from "../core";
56
56
  import { CurrentFungibleAssetBalancesBoolExp } from "../types/generated/types";
57
57
  import { getTableItem } from "./table";
58
+ import { APTOS_COIN } from "../utils";
58
59
 
59
60
  export async function getInfo(args: {
60
61
  aptosConfig: AptosConfig;
@@ -404,16 +405,46 @@ export async function getAccountTransactionsCount(args: {
404
405
  export async function getAccountCoinAmount(args: {
405
406
  aptosConfig: AptosConfig;
406
407
  accountAddress: AccountAddressInput;
407
- coinType: MoveStructId;
408
+ coinType?: MoveStructId;
409
+ faMetadataAddress?: AccountAddressInput;
408
410
  }): Promise<number> {
409
- const { aptosConfig, accountAddress, coinType } = args;
411
+ const { aptosConfig, accountAddress, coinType, faMetadataAddress } = args;
412
+ let coinAssetType: string | undefined;
413
+ let faAddress: string;
414
+
415
+ if (coinType !== undefined && faMetadataAddress !== undefined) {
416
+ faAddress = AccountAddress.from(faMetadataAddress).toStringLong();
417
+ } else if (coinType !== undefined && faMetadataAddress === undefined) {
418
+ coinAssetType = coinType;
419
+ // TODO Move to a separate function as defined in the AIP for coin migration
420
+ if (args.coinType === APTOS_COIN) {
421
+ faAddress = AccountAddress.A.toStringLong();
422
+ } else {
423
+ faAddress = createObjectAddress(AccountAddress.A, coinType).toStringLong();
424
+ }
425
+ } else if (coinType === undefined && faMetadataAddress !== undefined) {
426
+ // TODO: add a view function lookup for non-APT migrated coins
427
+ const addr = AccountAddress.from(faMetadataAddress);
428
+ faAddress = addr.toStringLong();
429
+ if (addr === AccountAddress.A) {
430
+ coinAssetType = APTOS_COIN;
431
+ }
432
+ } else {
433
+ throw new Error("Either coinType, fungibleAssetAddress, or both must be provided");
434
+ }
410
435
  const address = AccountAddress.from(accountAddress).toStringLong();
411
436
 
437
+ // Search by fungible asset address, unless it has a coin it migrated from
438
+ let where: any = { asset_type: { _eq: faAddress } };
439
+ if (coinType !== undefined) {
440
+ where = { asset_type: { _in: [coinAssetType, faAddress] } };
441
+ }
442
+
412
443
  const data = await getAccountCoinsData({
413
444
  aptosConfig,
414
445
  accountAddress: address,
415
446
  options: {
416
- where: { asset_type: { _eq: coinType } },
447
+ where,
417
448
  },
418
449
  });
419
450
 
@@ -68,6 +68,40 @@ export function isValidANSName(name: string): { domainName: string; subdomainNam
68
68
  };
69
69
  }
70
70
 
71
+ export enum SubdomainExpirationPolicy {
72
+ Independent = 0,
73
+ FollowsDomain = 1,
74
+ }
75
+
76
+ /**
77
+ * A helper function to determine if a given ANS name is considered active or
78
+ * not. Domains are considered active if their expiration date is in the
79
+ * future. Subdomains have two policies which modify their behavior. They can
80
+ * follow their parent's expiration (1) in which they ignore their own
81
+ * expiration timestamp or they can expire independently (0) in which they can
82
+ * expire before their parent but not afterwards.
83
+ *
84
+ * @param name - An ANS name returned from one of the functions of the SDK
85
+ * @returns A boolean representing if the contract considers the name active or not
86
+ */
87
+ export function isActiveANSName(name: GetANSNameResponse[0]): boolean {
88
+ if (!name) return false;
89
+
90
+ const isTLDExpired = new Date(name.domain_expiration_timestamp).getTime() < Date.now();
91
+ const isExpired = new Date(name.expiration_timestamp).getTime() < Date.now();
92
+
93
+ // If we are a subdomain, if our parent is expired we are always expired
94
+ if (name.subdomain && isTLDExpired) return false;
95
+
96
+ // If we are a subdomain and our expiration policy is to follow the domain, we
97
+ // are active (since we know our parent is not expired by this point)
98
+ if (name.subdomain && name.subdomain_expiration_policy === SubdomainExpirationPolicy.FollowsDomain) return true;
99
+
100
+ // At this point, we are either a TLD or a subdomain with an independent
101
+ // expiration policy, we are active as long as we the expiration timestamp
102
+ return !isExpired;
103
+ }
104
+
71
105
  export const LOCAL_ANS_ACCOUNT_PK =
72
106
  process.env.ANS_TEST_ACCOUNT_PRIVATE_KEY ?? "0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221";
73
107
  export const LOCAL_ANS_ACCOUNT_ADDRESS =
@@ -344,7 +378,6 @@ export async function getName(args: {
344
378
  const where: CurrentAptosNamesBoolExp = {
345
379
  domain: { _eq: domainName },
346
380
  subdomain: { _eq: subdomainName },
347
- is_active: { _eq: true },
348
381
  };
349
382
 
350
383
  const data = await queryIndexer<GetNamesQuery>({
@@ -365,7 +398,7 @@ export async function getName(args: {
365
398
  res = sanitizeANSName(res);
366
399
  }
367
400
 
368
- return res;
401
+ return isActiveANSName(res) ? res : undefined;
369
402
  }
370
403
 
371
404
  interface QueryNamesOptions {
@@ -492,13 +525,12 @@ export async function getDomainSubdomains(
492
525
  ...(args.options?.where ?? {}),
493
526
  domain: { _eq: domain },
494
527
  subdomain: { _neq: "" },
495
- is_active: { _eq: true },
496
528
  },
497
529
  },
498
530
  },
499
531
  });
500
532
 
501
- return data.current_aptos_names.map(sanitizeANSName);
533
+ return data.current_aptos_names.map(sanitizeANSName).filter(isActiveANSName);
502
534
  }
503
535
 
504
536
  /**
@@ -6,4 +6,6 @@ fragment AnsTokenFragment on current_aptos_names {
6
6
  token_standard
7
7
  is_primary
8
8
  owner_address
9
+ subdomain_expiration_policy
10
+ domain_expiration_timestamp
9
11
  }
@@ -26,6 +26,8 @@ export type AnsTokenFragmentFragment = {
26
26
  token_standard?: string | null;
27
27
  is_primary?: boolean | null;
28
28
  owner_address?: string | null;
29
+ subdomain_expiration_policy?: any | null;
30
+ domain_expiration_timestamp?: any | null;
29
31
  };
30
32
 
31
33
  export type CurrentTokenOwnershipFieldsFragment = {
@@ -94,15 +96,15 @@ export type GetAccountCoinsDataQueryVariables = Types.Exact<{
94
96
 
95
97
  export type GetAccountCoinsDataQuery = {
96
98
  current_fungible_asset_balances: Array<{
97
- amount: any;
98
- asset_type: string;
99
+ amount?: any | null;
100
+ asset_type?: string | null;
99
101
  is_frozen: boolean;
100
- is_primary: boolean;
101
- last_transaction_timestamp: any;
102
- last_transaction_version: any;
102
+ is_primary?: boolean | null;
103
+ last_transaction_timestamp?: any | null;
104
+ last_transaction_version?: any | null;
103
105
  owner_address: string;
104
106
  storage_id: string;
105
- token_standard: string;
107
+ token_standard?: string | null;
106
108
  metadata?: {
107
109
  token_standard: string;
108
110
  symbol: string;
@@ -392,15 +394,15 @@ export type GetCurrentFungibleAssetBalancesQueryVariables = Types.Exact<{
392
394
 
393
395
  export type GetCurrentFungibleAssetBalancesQuery = {
394
396
  current_fungible_asset_balances: Array<{
395
- amount: any;
396
- asset_type: string;
397
+ amount?: any | null;
398
+ asset_type?: string | null;
397
399
  is_frozen: boolean;
398
- is_primary: boolean;
399
- last_transaction_timestamp: any;
400
- last_transaction_version: any;
400
+ is_primary?: boolean | null;
401
+ last_transaction_timestamp?: any | null;
402
+ last_transaction_version?: any | null;
401
403
  owner_address: string;
402
404
  storage_id: string;
403
- token_standard: string;
405
+ token_standard?: string | null;
404
406
  }>;
405
407
  };
406
408
 
@@ -509,6 +511,8 @@ export type GetNamesQuery = {
509
511
  token_standard?: string | null;
510
512
  is_primary?: boolean | null;
511
513
  owner_address?: string | null;
514
+ subdomain_expiration_policy?: any | null;
515
+ domain_expiration_timestamp?: any | null;
512
516
  }>;
513
517
  };
514
518
 
@@ -30,6 +30,8 @@ export const AnsTokenFragmentFragmentDoc = `
30
30
  token_standard
31
31
  is_primary
32
32
  owner_address
33
+ subdomain_expiration_policy
34
+ domain_expiration_timestamp
33
35
  }
34
36
  `;
35
37
  export const CurrentTokenOwnershipFieldsFragmentDoc = `