@mysten/sui 2.39.1 → 3.0.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 (427) hide show
  1. package/CHANGELOG.md +160 -0
  2. package/README.md +5 -188
  3. package/dist/bcs/bcs.d.mts +6 -6
  4. package/dist/bcs/bcs.d.mts.map +1 -1
  5. package/dist/bcs/bcs.mjs +49 -22
  6. package/dist/bcs/bcs.mjs.map +1 -1
  7. package/dist/bcs/effects.mjs +49 -20
  8. package/dist/bcs/effects.mjs.map +1 -1
  9. package/dist/bcs/index.d.mts +1441 -624
  10. package/dist/bcs/index.d.mts.map +1 -1
  11. package/dist/bcs/index.mjs +2 -1
  12. package/dist/bcs/index.mjs.map +1 -1
  13. package/dist/bcs/transactions.d.mts +1059 -0
  14. package/dist/bcs/transactions.d.mts.map +1 -0
  15. package/dist/bcs/transactions.mjs +33 -14
  16. package/dist/bcs/transactions.mjs.map +1 -1
  17. package/dist/bcs/types.d.mts +6 -1
  18. package/dist/bcs/types.d.mts.map +1 -1
  19. package/dist/client/core-resolver.mjs +4 -4
  20. package/dist/client/core-resolver.mjs.map +1 -1
  21. package/dist/client/core.d.mts +55 -4
  22. package/dist/client/core.d.mts.map +1 -1
  23. package/dist/client/core.mjs +98 -1
  24. package/dist/client/core.mjs.map +1 -1
  25. package/dist/client/errors.mjs +11 -1
  26. package/dist/client/errors.mjs.map +1 -1
  27. package/dist/client/index.d.mts +4 -2
  28. package/dist/client/index.mjs +5 -2
  29. package/dist/client/mvr.d.mts +12 -2
  30. package/dist/client/mvr.d.mts.map +1 -1
  31. package/dist/client/mvr.mjs +34 -13
  32. package/dist/client/mvr.mjs.map +1 -1
  33. package/dist/client/query-filters.mjs +80 -76
  34. package/dist/client/query-filters.mjs.map +1 -1
  35. package/dist/client/stream/adapter.d.mts +102 -0
  36. package/dist/client/stream/adapter.d.mts.map +1 -0
  37. package/dist/client/stream/errors.d.mts +14 -0
  38. package/dist/client/stream/errors.d.mts.map +1 -0
  39. package/dist/client/stream/errors.mjs +25 -0
  40. package/dist/client/stream/errors.mjs.map +1 -0
  41. package/dist/client/stream/filter.mjs +18 -0
  42. package/dist/client/stream/filter.mjs.map +1 -0
  43. package/dist/client/stream/follow.mjs +48 -0
  44. package/dist/client/stream/follow.mjs.map +1 -0
  45. package/dist/client/stream/index.d.mts +4 -0
  46. package/dist/client/stream/pager.mjs +123 -0
  47. package/dist/client/stream/pager.mjs.map +1 -0
  48. package/dist/client/stream/plan.mjs +79 -0
  49. package/dist/client/stream/plan.mjs.map +1 -0
  50. package/dist/client/stream/position.d.mts +30 -0
  51. package/dist/client/stream/position.d.mts.map +1 -0
  52. package/dist/client/stream/position.mjs +121 -0
  53. package/dist/client/stream/position.mjs.map +1 -0
  54. package/dist/client/stream/run.d.mts +2 -0
  55. package/dist/client/stream/run.mjs +99 -0
  56. package/dist/client/stream/run.mjs.map +1 -0
  57. package/dist/client/stream/session.mjs +205 -0
  58. package/dist/client/stream/session.mjs.map +1 -0
  59. package/dist/client/stream/status.mjs +47 -0
  60. package/dist/client/stream/status.mjs.map +1 -0
  61. package/dist/client/stream/token.mjs +80 -0
  62. package/dist/client/stream/token.mjs.map +1 -0
  63. package/dist/client/transaction-data.d.mts +12 -0
  64. package/dist/client/transaction-data.d.mts.map +1 -0
  65. package/dist/client/transaction-data.mjs +469 -0
  66. package/dist/client/transaction-data.mjs.map +1 -0
  67. package/dist/client/transaction-resolver.mjs +102 -58
  68. package/dist/client/transaction-resolver.mjs.map +1 -1
  69. package/dist/client/types.d.mts +560 -240
  70. package/dist/client/types.d.mts.map +1 -1
  71. package/dist/client/utils.d.mts +3 -1
  72. package/dist/client/utils.d.mts.map +1 -1
  73. package/dist/client/utils.mjs +91 -26
  74. package/dist/client/utils.mjs.map +1 -1
  75. package/dist/cryptography/index.d.mts +1 -1
  76. package/dist/cryptography/keypair.d.mts +1 -1
  77. package/dist/cryptography/publickey.d.mts +11 -0
  78. package/dist/cryptography/publickey.d.mts.map +1 -1
  79. package/dist/cryptography/publickey.mjs +12 -1
  80. package/dist/cryptography/publickey.mjs.map +1 -1
  81. package/dist/cryptography/signature.d.mts +2 -2
  82. package/dist/cryptography/signature.mjs +18 -7
  83. package/dist/cryptography/signature.mjs.map +1 -1
  84. package/dist/graphql/client.d.mts +51 -35
  85. package/dist/graphql/client.d.mts.map +1 -1
  86. package/dist/graphql/client.mjs +125 -69
  87. package/dist/graphql/client.mjs.map +1 -1
  88. package/dist/graphql/core.d.mts +14 -9
  89. package/dist/graphql/core.d.mts.map +1 -1
  90. package/dist/graphql/core.mjs +293 -117
  91. package/dist/graphql/core.mjs.map +1 -1
  92. package/dist/graphql/errors.d.mts +20 -0
  93. package/dist/graphql/errors.d.mts.map +1 -0
  94. package/dist/graphql/errors.mjs +19 -0
  95. package/dist/graphql/errors.mjs.map +1 -0
  96. package/dist/graphql/filters.mjs +32 -0
  97. package/dist/graphql/filters.mjs.map +1 -0
  98. package/dist/graphql/generated/queries.d.mts.map +1 -1
  99. package/dist/graphql/generated/queries.mjs +1216 -208
  100. package/dist/graphql/generated/queries.mjs.map +1 -1
  101. package/dist/graphql/generated/tada-env.d.mts +820 -11
  102. package/dist/graphql/index.d.mts +2 -1
  103. package/dist/graphql/index.mjs +2 -1
  104. package/dist/graphql/sse-parser.mjs +82 -0
  105. package/dist/graphql/sse-parser.mjs.map +1 -0
  106. package/dist/graphql/stream/families.mjs +306 -0
  107. package/dist/graphql/stream/families.mjs.map +1 -0
  108. package/dist/graphql/stream/index.mjs +38 -0
  109. package/dist/graphql/stream/index.mjs.map +1 -0
  110. package/dist/graphql/stream/live.mjs +60 -0
  111. package/dist/graphql/stream/live.mjs.map +1 -0
  112. package/dist/graphql/stream/page.mjs +38 -0
  113. package/dist/graphql/stream/page.mjs.map +1 -0
  114. package/dist/graphql/stream/query.mjs +47 -0
  115. package/dist/graphql/stream/query.mjs.map +1 -0
  116. package/dist/graphql/subscribe.mjs +70 -0
  117. package/dist/graphql/subscribe.mjs.map +1 -0
  118. package/dist/grpc/client.d.mts +31 -27
  119. package/dist/grpc/client.d.mts.map +1 -1
  120. package/dist/grpc/client.mjs +42 -46
  121. package/dist/grpc/client.mjs.map +1 -1
  122. package/dist/grpc/core.d.mts +13 -6
  123. package/dist/grpc/core.d.mts.map +1 -1
  124. package/dist/grpc/core.mjs +254 -166
  125. package/dist/grpc/core.mjs.map +1 -1
  126. package/dist/grpc/filters.mjs +44 -34
  127. package/dist/grpc/filters.mjs.map +1 -1
  128. package/dist/grpc/grpc-web-pull.mjs +245 -0
  129. package/dist/grpc/grpc-web-pull.mjs.map +1 -0
  130. package/dist/grpc/index.d.mts +2 -1
  131. package/dist/grpc/index.mjs +1 -1
  132. package/dist/grpc/network-error.mjs +31 -0
  133. package/dist/grpc/network-error.mjs.map +1 -0
  134. package/dist/grpc/proto/google/rpc/error_details.mjs +306 -0
  135. package/dist/grpc/proto/google/rpc/error_details.mjs.map +1 -0
  136. package/dist/grpc/proto/sui/rpc/v2/error_reason.d.mts +176 -1
  137. package/dist/grpc/proto/sui/rpc/v2/error_reason.d.mts.map +1 -1
  138. package/dist/grpc/proto/sui/rpc/v2/error_reason.mjs +175 -0
  139. package/dist/grpc/proto/sui/rpc/v2/error_reason.mjs.map +1 -1
  140. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.d.mts +2 -2
  141. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
  142. package/dist/grpc/proto/sui/rpc/v2/ledger_service.d.mts +111 -0
  143. package/dist/grpc/proto/sui/rpc/v2/ledger_service.d.mts.map +1 -1
  144. package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs +46 -0
  145. package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs.map +1 -1
  146. package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
  147. package/dist/grpc/proto/sui/rpc/v2/move_package_service.d.mts +24 -1
  148. package/dist/grpc/proto/sui/rpc/v2/move_package_service.d.mts.map +1 -1
  149. package/dist/grpc/proto/sui/rpc/v2/move_package_service.mjs +25 -7
  150. package/dist/grpc/proto/sui/rpc/v2/move_package_service.mjs.map +1 -1
  151. package/dist/grpc/proto/sui/rpc/v2/object.mjs +1 -1
  152. package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts +111 -9
  153. package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts.map +1 -1
  154. package/dist/grpc/proto/sui/rpc/v2/query_options.mjs +63 -19
  155. package/dist/grpc/proto/sui/rpc/v2/query_options.mjs.map +1 -1
  156. package/dist/grpc/proto/sui/rpc/v2/signature.d.mts +5 -5
  157. package/dist/grpc/proto/sui/rpc/v2/signature.mjs.map +1 -1
  158. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.d.mts +5 -1
  159. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.d.mts.map +1 -1
  160. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.mjs +4 -0
  161. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.mjs.map +1 -1
  162. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
  163. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.d.mts +20 -1
  164. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.d.mts.map +1 -1
  165. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs +30 -13
  166. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs.map +1 -1
  167. package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
  168. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +16 -10
  169. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts.map +1 -1
  170. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.mjs +8 -5
  171. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.mjs.map +1 -1
  172. package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts +11 -5
  173. package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts.map +1 -1
  174. package/dist/grpc/proto/sui/rpc/v2/transaction.mjs +6 -0
  175. package/dist/grpc/proto/sui/rpc/v2/transaction.mjs.map +1 -1
  176. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts +6 -2
  177. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts.map +1 -1
  178. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs.map +1 -1
  179. package/dist/grpc/proto/types.d.mts +7 -7
  180. package/dist/grpc/proto/types.mjs +3 -2
  181. package/dist/grpc/pull-call.d.mts +20 -0
  182. package/dist/grpc/pull-call.d.mts.map +1 -0
  183. package/dist/grpc/pull-call.mjs +28 -0
  184. package/dist/grpc/pull-call.mjs.map +1 -0
  185. package/dist/grpc/stream/call.mjs +238 -0
  186. package/dist/grpc/stream/call.mjs.map +1 -0
  187. package/dist/grpc/stream/families.d.mts +26 -0
  188. package/dist/grpc/stream/families.d.mts.map +1 -0
  189. package/dist/grpc/stream/families.mjs +145 -0
  190. package/dist/grpc/stream/families.mjs.map +1 -0
  191. package/dist/grpc/stream/index.d.mts +41 -0
  192. package/dist/grpc/stream/index.d.mts.map +1 -0
  193. package/dist/grpc/stream/index.mjs +127 -0
  194. package/dist/grpc/stream/index.mjs.map +1 -0
  195. package/dist/grpc/stream/live.mjs +31 -0
  196. package/dist/grpc/stream/live.mjs.map +1 -0
  197. package/dist/grpc/stream/page.mjs +120 -0
  198. package/dist/grpc/stream/page.mjs.map +1 -0
  199. package/dist/grpc/stream-types.d.mts +28 -0
  200. package/dist/grpc/stream-types.d.mts.map +1 -0
  201. package/dist/grpc/transport.d.mts +8 -3
  202. package/dist/grpc/transport.d.mts.map +1 -1
  203. package/dist/grpc/transport.mjs +88 -45
  204. package/dist/grpc/transport.mjs.map +1 -1
  205. package/dist/jsonRpc/index.d.mts +34 -12
  206. package/dist/jsonRpc/index.d.mts.map +1 -0
  207. package/dist/jsonRpc/index.mjs +39 -5
  208. package/dist/jsonRpc/index.mjs.map +1 -0
  209. package/dist/jsonRpc/types.d.mts +420 -0
  210. package/dist/jsonRpc/types.d.mts.map +1 -0
  211. package/dist/keypairs/passkey/keypair.d.mts +1 -1
  212. package/dist/multisig/publickey.d.mts +12 -4
  213. package/dist/multisig/publickey.d.mts.map +1 -1
  214. package/dist/multisig/publickey.mjs +5 -5
  215. package/dist/multisig/publickey.mjs.map +1 -1
  216. package/dist/multisig/signer.d.mts +1 -1
  217. package/dist/transactions/ObjectCache.d.mts +1 -1
  218. package/dist/transactions/ObjectCache.mjs +5 -5
  219. package/dist/transactions/ObjectCache.mjs.map +1 -1
  220. package/dist/transactions/Transaction.d.mts +11 -10
  221. package/dist/transactions/Transaction.d.mts.map +1 -1
  222. package/dist/transactions/Transaction.mjs +17 -6
  223. package/dist/transactions/Transaction.mjs.map +1 -1
  224. package/dist/transactions/data/internal.d.mts +135 -133
  225. package/dist/transactions/data/internal.d.mts.map +1 -1
  226. package/dist/transactions/data/internal.mjs +2 -1
  227. package/dist/transactions/data/internal.mjs.map +1 -1
  228. package/dist/transactions/data/v1.d.mts +239 -239
  229. package/dist/transactions/data/v1.d.mts.map +1 -1
  230. package/dist/transactions/data/v2.d.mts +16 -16
  231. package/dist/transactions/data/v2.d.mts.map +1 -1
  232. package/dist/transactions/executor/parallel.d.mts +2 -2
  233. package/dist/transactions/executor/serial.d.mts +1 -1
  234. package/dist/transactions/executor/serial.mjs +2 -2
  235. package/dist/transactions/executor/serial.mjs.map +1 -1
  236. package/dist/transactions/index.d.mts +3 -2
  237. package/dist/transactions/index.mjs +4 -3
  238. package/dist/transactions/intents/AllowanceBalance.mjs +1 -1
  239. package/dist/transactions/intents/CoinWithBalance.mjs +1 -1
  240. package/dist/transactions/resolve.d.mts +6 -0
  241. package/dist/transactions/resolve.d.mts.map +1 -1
  242. package/dist/transactions/resolve.mjs.map +1 -1
  243. package/dist/transactions/restricted-move-calls.d.mts +25 -0
  244. package/dist/transactions/restricted-move-calls.d.mts.map +1 -0
  245. package/dist/transactions/restricted-move-calls.mjs +47 -0
  246. package/dist/transactions/restricted-move-calls.mjs.map +1 -0
  247. package/dist/transactions/serializer.d.mts +1 -4
  248. package/dist/transactions/serializer.d.mts.map +1 -1
  249. package/dist/transactions/serializer.mjs +1 -44
  250. package/dist/transactions/serializer.mjs.map +1 -1
  251. package/dist/transactions/utils.d.mts +0 -1
  252. package/dist/transactions/utils.d.mts.map +1 -1
  253. package/dist/transactions/utils.mjs.map +1 -1
  254. package/dist/utils/abort.mjs +89 -0
  255. package/dist/utils/abort.mjs.map +1 -0
  256. package/dist/utils/coin-reservation.mjs +1 -4
  257. package/dist/utils/coin-reservation.mjs.map +1 -1
  258. package/dist/utils/index.mjs +1 -1
  259. package/dist/utils/sui-types.mjs +1 -1
  260. package/dist/verify/index.d.mts +2 -2
  261. package/dist/verify/verify.d.mts +74 -24
  262. package/dist/verify/verify.d.mts.map +1 -1
  263. package/dist/verify/verify.mjs +128 -42
  264. package/dist/verify/verify.mjs.map +1 -1
  265. package/dist/version.mjs +1 -1
  266. package/dist/version.mjs.map +1 -1
  267. package/dist/zklogin/bcs.d.mts +14 -14
  268. package/dist/zklogin/publickey.d.mts.map +1 -1
  269. package/dist/zklogin/publickey.mjs +15 -20
  270. package/dist/zklogin/publickey.mjs.map +1 -1
  271. package/docs/bcs.md +2 -2
  272. package/docs/clients/core.md +19 -18
  273. package/docs/clients/executing.md +53 -8
  274. package/docs/clients/graphql.md +81 -11
  275. package/docs/clients/grpc.md +31 -15
  276. package/docs/clients/index.md +8 -7
  277. package/docs/clients/querying.md +134 -30
  278. package/docs/clients/streaming.md +324 -0
  279. package/docs/cryptography/index.md +85 -58
  280. package/docs/llms-index.md +4 -2
  281. package/docs/migrations/sui-2.0/dapp-kit.md +3 -2
  282. package/docs/migrations/sui-2.0/json-rpc-migration.md +106 -79
  283. package/docs/migrations/sui-3.0/index.md +250 -0
  284. package/docs/plugins.md +10 -10
  285. package/docs/sdk-building.md +3 -4
  286. package/docs/transactions/coins-and-balances.md +6 -11
  287. package/docs/transactions/reference.md +36 -1
  288. package/package.json +2 -3
  289. package/src/bcs/bcs.ts +80 -41
  290. package/src/bcs/effects.ts +61 -25
  291. package/src/bcs/index.ts +2 -0
  292. package/src/bcs/transactions.ts +36 -17
  293. package/src/bcs/types.ts +10 -4
  294. package/src/client/core-resolver.ts +3 -5
  295. package/src/client/core.ts +180 -8
  296. package/src/client/errors.ts +12 -0
  297. package/src/client/index.ts +4 -1
  298. package/src/client/mvr.ts +37 -10
  299. package/src/client/query-filters.ts +151 -97
  300. package/src/client/stream/adapter.ts +110 -0
  301. package/src/client/stream/errors.ts +40 -0
  302. package/src/client/stream/filter.ts +17 -0
  303. package/src/client/stream/follow.ts +63 -0
  304. package/src/client/stream/index.ts +9 -0
  305. package/src/client/stream/pager.ts +158 -0
  306. package/src/client/stream/plan.ts +147 -0
  307. package/src/client/stream/position.ts +143 -0
  308. package/src/client/stream/run.ts +147 -0
  309. package/src/client/stream/session.ts +259 -0
  310. package/src/client/stream/status.ts +44 -0
  311. package/src/client/stream/token.ts +104 -0
  312. package/src/client/transaction-data.ts +587 -0
  313. package/src/client/transaction-resolver.ts +158 -69
  314. package/src/client/types.ts +530 -115
  315. package/src/client/utils.ts +147 -50
  316. package/src/cryptography/publickey.ts +12 -1
  317. package/src/cryptography/signature.ts +6 -3
  318. package/src/graphql/client.ts +204 -135
  319. package/src/graphql/core.ts +446 -139
  320. package/src/graphql/errors.ts +24 -0
  321. package/src/graphql/filters.ts +48 -0
  322. package/src/graphql/generated/queries.ts +1455 -277
  323. package/src/graphql/generated/schema.graphql +282 -9
  324. package/src/graphql/generated/tada-env.ts +933 -4
  325. package/src/graphql/queries/checkpoints.graphql +34 -0
  326. package/src/graphql/queries/getDynamicFields.graphql +1 -0
  327. package/src/graphql/queries/listEvents.graphql +16 -24
  328. package/src/graphql/queries/streams.graphql +212 -0
  329. package/src/graphql/queries/transactions.graphql +71 -28
  330. package/src/graphql/queries/verifySignature.graphql +17 -0
  331. package/src/graphql/sse-parser.ts +99 -0
  332. package/src/graphql/stream/families.ts +515 -0
  333. package/src/graphql/stream/index.ts +55 -0
  334. package/src/graphql/stream/live.ts +70 -0
  335. package/src/graphql/stream/page.ts +47 -0
  336. package/src/graphql/stream/query.ts +52 -0
  337. package/src/graphql/subscribe.ts +83 -0
  338. package/src/grpc/client.ts +81 -79
  339. package/src/grpc/core.ts +388 -274
  340. package/src/grpc/filters.ts +59 -60
  341. package/src/grpc/grpc-web-pull.ts +360 -0
  342. package/src/grpc/index.ts +5 -0
  343. package/src/grpc/network-error.ts +33 -0
  344. package/src/grpc/proto/sui/rpc/v2/error_reason.ts +175 -0
  345. package/src/grpc/proto/sui/rpc/v2/ledger_service.ts +145 -0
  346. package/src/grpc/proto/sui/rpc/v2/move_package_service.ts +43 -1
  347. package/src/grpc/proto/sui/rpc/v2/query_options.ts +132 -8
  348. package/src/grpc/proto/sui/rpc/v2/signature.ts +4 -4
  349. package/src/grpc/proto/sui/rpc/v2/signature_scheme.ts +4 -0
  350. package/src/grpc/proto/sui/rpc/v2/signature_verification_service.ts +30 -0
  351. package/src/grpc/proto/sui/rpc/v2/subscription_service.client.ts +16 -10
  352. package/src/grpc/proto/sui/rpc/v2/transaction.ts +6 -0
  353. package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts +5 -1
  354. package/src/grpc/pull-call.ts +54 -0
  355. package/src/grpc/stream/call.ts +317 -0
  356. package/src/grpc/stream/families.ts +228 -0
  357. package/src/grpc/stream/index.ts +182 -0
  358. package/src/grpc/stream/live.ts +33 -0
  359. package/src/grpc/stream/page.ts +161 -0
  360. package/src/grpc/stream-types.ts +33 -0
  361. package/src/grpc/transport.ts +116 -59
  362. package/src/jsonRpc/index.ts +60 -17
  363. package/src/jsonRpc/types.ts +421 -0
  364. package/src/multisig/publickey.ts +19 -7
  365. package/src/transactions/ObjectCache.ts +6 -6
  366. package/src/transactions/Transaction.ts +30 -6
  367. package/src/transactions/data/internal.ts +2 -0
  368. package/src/transactions/executor/serial.ts +2 -2
  369. package/src/transactions/index.ts +8 -1
  370. package/src/transactions/resolve.ts +6 -0
  371. package/src/transactions/restricted-move-calls.ts +87 -0
  372. package/src/transactions/serializer.ts +0 -70
  373. package/src/transactions/utils.ts +0 -37
  374. package/src/utils/abort.ts +101 -0
  375. package/src/verify/index.ts +1 -0
  376. package/src/verify/verify.ts +190 -62
  377. package/src/version.ts +1 -1
  378. package/src/zklogin/publickey.ts +18 -34
  379. package/dist/client/core-resolver.d.mts +0 -9
  380. package/dist/client/core-resolver.d.mts.map +0 -1
  381. package/dist/jsonRpc/client.d.mts +0 -507
  382. package/dist/jsonRpc/client.d.mts.map +0 -1
  383. package/dist/jsonRpc/client.mjs +0 -868
  384. package/dist/jsonRpc/client.mjs.map +0 -1
  385. package/dist/jsonRpc/core.d.mts +0 -168
  386. package/dist/jsonRpc/core.d.mts.map +0 -1
  387. package/dist/jsonRpc/core.mjs +0 -1054
  388. package/dist/jsonRpc/core.mjs.map +0 -1
  389. package/dist/jsonRpc/errors.d.mts +0 -27
  390. package/dist/jsonRpc/errors.d.mts.map +0 -1
  391. package/dist/jsonRpc/errors.mjs +0 -50
  392. package/dist/jsonRpc/errors.mjs.map +0 -1
  393. package/dist/jsonRpc/http-transport.d.mts +0 -62
  394. package/dist/jsonRpc/http-transport.d.mts.map +0 -1
  395. package/dist/jsonRpc/http-transport.mjs +0 -60
  396. package/dist/jsonRpc/http-transport.mjs.map +0 -1
  397. package/dist/jsonRpc/network.d.mts +0 -9
  398. package/dist/jsonRpc/network.d.mts.map +0 -1
  399. package/dist/jsonRpc/network.mjs +0 -18
  400. package/dist/jsonRpc/network.mjs.map +0 -1
  401. package/dist/jsonRpc/types/chain.d.mts +0 -169
  402. package/dist/jsonRpc/types/chain.d.mts.map +0 -1
  403. package/dist/jsonRpc/types/changes.d.mts +0 -48
  404. package/dist/jsonRpc/types/changes.d.mts.map +0 -1
  405. package/dist/jsonRpc/types/coins.d.mts +0 -15
  406. package/dist/jsonRpc/types/coins.d.mts.map +0 -1
  407. package/dist/jsonRpc/types/common.d.mts +0 -9
  408. package/dist/jsonRpc/types/common.d.mts.map +0 -1
  409. package/dist/jsonRpc/types/generated.d.mts +0 -1976
  410. package/dist/jsonRpc/types/generated.d.mts.map +0 -1
  411. package/dist/jsonRpc/types/index.d.mts +0 -6
  412. package/dist/jsonRpc/types/params.d.mts +0 -898
  413. package/dist/jsonRpc/types/params.d.mts.map +0 -1
  414. package/src/graphql/generated/tsconfig.tada.json +0 -11
  415. package/src/graphql/queries/verifyZkLoginSignature.graphql +0 -15
  416. package/src/jsonRpc/client.ts +0 -1252
  417. package/src/jsonRpc/core.ts +0 -1557
  418. package/src/jsonRpc/errors.ts +0 -57
  419. package/src/jsonRpc/http-transport.ts +0 -118
  420. package/src/jsonRpc/network.ts +0 -21
  421. package/src/jsonRpc/types/chain.ts +0 -190
  422. package/src/jsonRpc/types/changes.ts +0 -35
  423. package/src/jsonRpc/types/coins.ts +0 -14
  424. package/src/jsonRpc/types/common.ts +0 -8
  425. package/src/jsonRpc/types/generated.ts +0 -2165
  426. package/src/jsonRpc/types/index.ts +0 -9
  427. package/src/jsonRpc/types/params.ts +0 -908
@@ -1,5 +1,6 @@
1
1
  import { ClientCache } from "./cache.mjs";
2
- import { SerializedTransactionDataV2 } from "../transactions/data/v2.mjs";
2
+ import { EndOfEpochTransactionKind as EndOfEpochTransactionKind$1, TransactionKind as TransactionKind$1 } from "../bcs/transactions.mjs";
3
+ import { CallArg, Command, TransactionData as TransactionData$1 } from "../transactions/data/internal.mjs";
3
4
  import { TransactionPlugin } from "../transactions/resolve.mjs";
4
5
  import { Transaction as Transaction$1 } from "../transactions/Transaction.mjs";
5
6
  import { Signer } from "../cryptography/keypair.mjs";
@@ -13,14 +14,16 @@ type SuiClientRegistration<T extends BaseClient = BaseClient, Name extends strin
13
14
  readonly register: (client: T) => Extension;
14
15
  };
15
16
  type ClientWithExtensions<T, Base extends BaseClient = BaseClient> = Base & T;
17
+ type BcsTransactionKind = typeof TransactionKind$1.$inferType;
18
+ type BcsEndOfEpochTransactionKind = typeof EndOfEpochTransactionKind$1.$inferType;
16
19
  declare namespace SuiClientTypes {
17
- type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {});
18
- interface SuiClientOptions {
20
+ export type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {});
21
+ export interface SuiClientOptions {
19
22
  network: Network;
20
23
  base?: BaseClient;
21
24
  cache?: ClientCache;
22
25
  }
23
- interface MvrOptions {
26
+ export interface MvrOptions {
24
27
  url?: string;
25
28
  pageSize?: number;
26
29
  overrides?: {
@@ -28,18 +31,178 @@ declare namespace SuiClientTypes {
28
31
  types?: Record<string, string>;
29
32
  };
30
33
  }
31
- interface CoreClientMethodOptions {
34
+ export interface CoreClientMethodOptions {
32
35
  signal?: AbortSignal;
33
36
  }
37
+ export type Order = 'ascending' | 'descending';
38
+ /** Opaque resume position, valid only for the stream that produced it. */
39
+ export type StreamResumeToken = string;
40
+ /**
41
+ * Where a stream starts: at a checkpoint (inclusive), or after the frame that carried a resume
42
+ * token, so save a token only once its frame is processed.
43
+ */
44
+ export type StreamStart = {
45
+ checkpoint: CheckpointNumber;
46
+ resumeToken?: never;
47
+ } | {
48
+ resumeToken: StreamResumeToken;
49
+ checkpoint?: never;
50
+ };
51
+ /** Where a finite stream stops: before this checkpoint (exclusive). */
52
+ export interface StreamEnd {
53
+ checkpoint: CheckpointNumber;
54
+ }
55
+ export interface StreamRetryOptions {
56
+ /**
57
+ * First retry delay in milliseconds; each further failure doubles it.
58
+ * @default 250
59
+ */
60
+ initialDelay?: number;
61
+ /**
62
+ * Cap on the retry delay in milliseconds.
63
+ * @default 30_000
64
+ */
65
+ maxDelay?: number;
66
+ /**
67
+ * Consecutive failures without progress before the stream throws. 0 disables retries.
68
+ * @default 10
69
+ */
70
+ maxAttempts?: number;
71
+ }
72
+ /**
73
+ * Why a failed request may succeed on retry.
74
+ * - `Unavailable`: the server could not be reached, the connection dropped, or a live feed ended.
75
+ * - `RateLimited`: the server or a proxy is limiting requests.
76
+ * - `ServerError`: any other failure that may clear on retry.
77
+ */
78
+ export type RetryReason = 'Unavailable' | 'RateLimited' | 'ServerError';
79
+ /** Connection state reported to `onStatus`, for diagnostics only. Use frame tokens to resume. */
80
+ export type StreamStatus = /** An attempt is starting; `attempt` counts consecutive failures without progress. */{
81
+ $kind: 'Connecting';
82
+ attempt: number;
83
+ } /** This attempt received its first page or live frame, or its GraphQL subscription opened. */ | {
84
+ $kind: 'Connected';
85
+ } /** Waiting `delay` ms before the next attempt after `error`. */ | {
86
+ $kind: 'Retrying';
87
+ attempt: number;
88
+ delay: number;
89
+ reason: RetryReason;
90
+ error: unknown;
91
+ };
92
+ /** Control frames to emit in addition to items. */
93
+ export interface StreamFrameOptions {
94
+ /** Emit a final Complete frame after a finite stream finishes. */
95
+ completion?: boolean;
96
+ /** Emit Progress frames carrying resumable positions that no item reported. */
97
+ progress?: boolean;
98
+ }
99
+ export interface StreamOptions<Frames extends StreamFrameOptions = {}> extends CoreClientMethodOptions {
100
+ /**
101
+ * Where to start: at a checkpoint, or after the frame that carried a resume token. Required
102
+ * for a finite ascending read.
103
+ */
104
+ start?: StreamStart;
105
+ /** Where a finite stream stops (exclusive). */
106
+ end?: StreamEnd;
107
+ /** Defaults to the resume token's order, else `'ascending'`. */
108
+ order?: Order;
109
+ /**
110
+ * Keep following new checkpoints after the history.
111
+ * @default true for an ascending stream without an `end`
112
+ */
113
+ follow?: boolean;
114
+ /**
115
+ * How a followed stream receives new data: a live subscription, or polling every
116
+ * `pollInterval`.
117
+ * @default 'subscribe'
118
+ */
119
+ delivery?: 'subscribe' | 'poll';
120
+ /**
121
+ * Milliseconds between polls, and between reads while waiting for the server to index.
122
+ * @default 1000
123
+ */
124
+ pollInterval?: number;
125
+ retry?: StreamRetryOptions;
126
+ /** Called synchronously with each status. Throwing ends the stream with that error. */
127
+ onStatus?: (status: StreamStatus) => void;
128
+ /** Control frames to emit alongside items. */
129
+ frames?: Frames;
130
+ }
131
+ /** Data to deliver with each streamed checkpoint. */
132
+ export interface StreamCheckpointInclude {
133
+ /**
134
+ * Deliver every transaction of the checkpoint, in execution order, with these fields. Each
135
+ * checkpoint is yielded once all of its transactions have been read.
136
+ */
137
+ transactions?: TransactionInclude;
138
+ }
139
+ export interface StreamCheckpointsOptions<Include extends StreamCheckpointInclude = {}, Frames extends StreamFrameOptions = {}> extends StreamOptions<Frames> {
140
+ include?: Include;
141
+ }
142
+ export interface StreamTransactionsOptions<Include extends TransactionInclude = {}, Frames extends StreamFrameOptions = {}> extends StreamOptions<Frames> {
143
+ filter?: TransactionFilter;
144
+ include?: Include;
145
+ }
146
+ export interface StreamEventsOptions<Frames extends StreamFrameOptions = {}> extends StreamOptions<Frames> {
147
+ filter?: EventFilter;
148
+ }
149
+ export interface StreamCheckpoint<Include extends StreamCheckpointInclude = {}> {
150
+ $kind: 'Checkpoint';
151
+ /** Includes `transactions` when `include.transactions` is set. */
152
+ checkpoint: Checkpoint & (Include extends {
153
+ transactions: infer TransactionFields extends TransactionInclude;
154
+ } ? {
155
+ transactions: TransactionResult<TransactionFields>[];
156
+ } : {});
157
+ resumeToken: StreamResumeToken;
158
+ }
159
+ export interface StreamTransaction<Include extends TransactionInclude = {}> {
160
+ $kind: 'Transaction';
161
+ transaction: TransactionResult<Include>;
162
+ resumeToken: StreamResumeToken;
163
+ }
164
+ export interface StreamEvent {
165
+ $kind: 'Event';
166
+ event: EventEntry;
167
+ resumeToken: StreamResumeToken;
168
+ }
169
+ /** A resumable position that no item reported, such as the end of an empty range. */
170
+ export interface StreamProgressFrame {
171
+ $kind: 'Progress';
172
+ resumeToken: StreamResumeToken;
173
+ }
174
+ /**
175
+ * Sent once after a finite stream finishes, even an empty one.
176
+ * - `checkpointBound`: reached `end`.
177
+ * - `indexedTip`: reached the indexed tip read when the stream started (`follow: false`).
178
+ * - `genesis`: a descending read reached checkpoint 0.
179
+ * - `retentionLimit`: a descending read reached the oldest checkpoint the server retains.
180
+ */
181
+ export interface StreamCompletionFrame {
182
+ $kind: 'Complete';
183
+ reason: 'checkpointBound' | 'indexedTip' | 'genesis' | 'retentionLimit';
184
+ /** Last delivered position, if there is one. */
185
+ resumeToken?: StreamResumeToken;
186
+ }
187
+ /**
188
+ * `T` when `Frames[Key]` may be true; includes non-literal booleans. Distributes over a union of
189
+ * option objects, so a frame that any member enables is included.
190
+ */
191
+ type EnabledFrame<Frames extends StreamFrameOptions, Key extends keyof StreamFrameOptions, T> = Frames extends unknown ? Key extends keyof Frames ? true extends Frames[Key] ? T : never : never : never;
192
+ export type StreamResult<Item, Frames extends StreamFrameOptions = {}> = Item | EnabledFrame<Frames, 'completion', StreamCompletionFrame> | EnabledFrame<Frames, 'progress', StreamProgressFrame>;
193
+ export type StreamCheckpointFrame<Include extends StreamCheckpointInclude = {}, Frames extends StreamFrameOptions = {}> = StreamResult<StreamCheckpoint<Include>, Frames>;
194
+ export type StreamTransactionFrame<Include extends TransactionInclude = {}, Frames extends StreamFrameOptions = {}> = StreamResult<StreamTransaction<Include>, Frames>;
195
+ export type StreamEventFrame<Frames extends StreamFrameOptions = {}> = StreamResult<StreamEvent, Frames>;
34
196
  /** Object methods */
35
- interface TransportMethods {
197
+ export interface TransportMethods {
36
198
  getObjects: <Include extends ObjectInclude = {}>(options: GetObjectsOptions<Include>) => Promise<GetObjectsResponse<Include>>;
37
199
  listOwnedObjects: <Include extends ObjectInclude = {}>(options: ListOwnedObjectsOptions<Include>) => Promise<ListOwnedObjectsResponse<Include>>;
38
200
  listCoins: (options: ListCoinsOptions) => Promise<ListCoinsResponse>;
39
- listDynamicFields: (options: ListDynamicFieldsOptions) => Promise<ListDynamicFieldsResponse>;
201
+ listDynamicFields: <Include extends DynamicFieldInclude = {}>(options: ListDynamicFieldsOptions<Include>) => Promise<ListDynamicFieldsResponse<Include>>;
40
202
  getDynamicField: (options: GetDynamicFieldOptions) => Promise<GetDynamicFieldResponse>;
203
+ getAddressAliases: (options: GetAddressAliasesOptions) => Promise<GetAddressAliasesResponse>;
41
204
  }
42
- interface ObjectInclude {
205
+ export interface ObjectInclude {
43
206
  /**
44
207
  * Include the BCS-encoded Move struct content of the object.
45
208
  *
@@ -63,7 +226,7 @@ declare namespace SuiClientTypes {
63
226
  * Include the JSON representation of the object's Move struct content.
64
227
  *
65
228
  * **Warning:** The exact shape and field names of this data may vary between different
66
- * API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs,
229
+ * API implementations (gRPC or GraphQL). For consistent data across APIs,
67
230
  * use the `content` field and parse the BCS data directly.
68
231
  */
69
232
  json?: boolean;
@@ -78,54 +241,78 @@ declare namespace SuiClientTypes {
78
241
  */
79
242
  display?: boolean;
80
243
  }
81
- interface GetObjectsOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
244
+ export interface GetObjectsOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
82
245
  objectIds: string[];
83
246
  include?: Include & ObjectInclude;
84
247
  }
85
- interface GetObjectOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
248
+ export interface GetObjectOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
86
249
  objectId: string;
87
250
  include?: Include & ObjectInclude;
88
251
  }
89
- interface ListOwnedObjectsOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
252
+ export interface ListOwnedObjectsOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
90
253
  owner: string;
91
254
  limit?: number;
92
255
  cursor?: string | null;
93
256
  type?: string;
94
257
  include?: Include & ObjectInclude;
95
258
  }
96
- interface ListCoinsOptions extends CoreClientMethodOptions {
259
+ export interface ListCoinsOptions extends CoreClientMethodOptions {
97
260
  owner: string;
98
261
  /** Defaults to `0x2::sui::SUI` */
99
262
  coinType?: string;
100
263
  limit?: number;
101
264
  cursor?: string | null;
102
265
  }
103
- interface ListDynamicFieldsOptions extends CoreClientMethodOptions {
266
+ export interface DynamicFieldInclude {
267
+ /** Include each field's `value`. */
268
+ value?: boolean;
269
+ }
270
+ export interface ListDynamicFieldsOptions<Include extends DynamicFieldInclude = {}> extends CoreClientMethodOptions {
104
271
  parentId: string;
105
272
  limit?: number;
106
273
  cursor?: string | null;
274
+ include?: Include & DynamicFieldInclude;
107
275
  }
108
- interface GetDynamicFieldOptions extends CoreClientMethodOptions {
276
+ export interface GetDynamicFieldOptions extends CoreClientMethodOptions {
109
277
  parentId: string;
110
278
  name: DynamicFieldName;
111
279
  }
112
- interface GetObjectsResponse<out Include extends ObjectInclude = {}> {
280
+ export interface GetAddressAliasesOptions extends CoreClientMethodOptions {
281
+ address: string;
282
+ }
283
+ /**
284
+ * The addresses whose signatures are accepted for `address`. An address that never enabled
285
+ * aliases is only its own alias.
286
+ */
287
+ export interface AddressAliases {
288
+ address: string;
289
+ /** Whether `address` has enabled aliases, so its alias set is an object on chain. */
290
+ enabled: boolean;
291
+ /** The current alias set; `[address]` when aliases are not enabled. */
292
+ aliases: string[];
293
+ /** The ID of the alias set object, derived from `address` whether or not it exists. */
294
+ objectId: string;
295
+ }
296
+ export interface GetAddressAliasesResponse {
297
+ addressAliases: AddressAliases;
298
+ }
299
+ export interface GetObjectsResponse<out Include extends ObjectInclude = {}> {
113
300
  objects: (Object<Include> | Error)[];
114
301
  }
115
- interface GetObjectResponse<out Include extends ObjectInclude = {}> {
302
+ export interface GetObjectResponse<out Include extends ObjectInclude = {}> {
116
303
  object: Object<Include>;
117
304
  }
118
- interface ListOwnedObjectsResponse<out Include extends ObjectInclude = {}> {
305
+ export interface ListOwnedObjectsResponse<out Include extends ObjectInclude = {}> {
119
306
  objects: Object<Include>[];
120
307
  hasNextPage: boolean;
121
308
  cursor: string | null;
122
309
  }
123
- interface ListCoinsResponse {
310
+ export interface ListCoinsResponse {
124
311
  objects: Coin[];
125
312
  hasNextPage: boolean;
126
313
  cursor: string | null;
127
314
  }
128
- interface Object<Include extends ObjectInclude = {}> {
315
+ export interface Object<Include extends ObjectInclude = {}> {
129
316
  objectId: string;
130
317
  version: string;
131
318
  digest: string;
@@ -146,7 +333,7 @@ declare namespace SuiClientTypes {
146
333
  * The JSON representation of the object's Move struct content.
147
334
  *
148
335
  * **Warning:** The exact shape and field names of this data may vary between different
149
- * API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs use
336
+ * API implementations (gRPC or GraphQL). For consistent data across APIs use
150
337
  * the `content` field and parse the BCS data directly.
151
338
  */
152
339
  json: Include extends {
@@ -157,7 +344,7 @@ declare namespace SuiClientTypes {
157
344
  display: true;
158
345
  } ? Display | null : undefined;
159
346
  }
160
- interface Display {
347
+ export interface Display {
161
348
  /**
162
349
  * Successfully rendered display field values, keyed by field name.
163
350
  *
@@ -169,7 +356,7 @@ declare namespace SuiClientTypes {
169
356
  /** Per-field rendering errors, keyed by field name. `null` if all fields succeeded. */
170
357
  errors: Record<string, string> | null;
171
358
  }
172
- interface Coin {
359
+ export interface Coin {
173
360
  objectId: string;
174
361
  version: string;
175
362
  digest: string;
@@ -177,11 +364,23 @@ declare namespace SuiClientTypes {
177
364
  type: string;
178
365
  balance: string;
179
366
  }
180
- type DynamicFieldEntry = {
181
- fieldId: string;
367
+ export type DynamicFieldEntry<Include extends DynamicFieldInclude = {}> = {
368
+ /** ID of the `0x2::dynamic_field::Field` object. */fieldId: string; /** Type of the `0x2::dynamic_field::Field` object. */
182
369
  type: string;
183
370
  name: DynamicFieldName;
371
+ /**
372
+ * Type of the value. For dynamic object fields, `listDynamicFields` reports the child object's
373
+ * type and `getDynamicField` reports `0x2::object::ID`.
374
+ */
184
375
  valueType: string;
376
+ /**
377
+ * The field's value; `value.type` always equals `valueType`. For dynamic object fields,
378
+ * `listDynamicFields` returns the child object's BCS-encoded content and `getDynamicField`
379
+ * the child's ID.
380
+ */
381
+ value: Include extends {
382
+ value: true;
383
+ } ? DynamicFieldValue : undefined;
185
384
  } & ({
186
385
  $kind: 'DynamicField';
187
386
  childId?: never;
@@ -189,73 +388,74 @@ declare namespace SuiClientTypes {
189
388
  $kind: 'DynamicObject';
190
389
  childId: string;
191
390
  });
192
- type DynamicField = DynamicFieldEntry & {
193
- value: DynamicFieldValue;
391
+ export type DynamicField = DynamicFieldEntry<{
392
+ value: true;
393
+ }> & {
194
394
  version: string;
195
395
  digest: string;
196
396
  previousTransaction: string | null;
197
397
  };
198
- interface ListDynamicFieldsResponse {
398
+ export interface ListDynamicFieldsResponse<out Include extends DynamicFieldInclude = {}> {
199
399
  hasNextPage: boolean;
200
400
  cursor: string | null;
201
- dynamicFields: DynamicFieldEntry[];
401
+ dynamicFields: DynamicFieldEntry<Include>[];
202
402
  }
203
- interface GetDynamicFieldResponse {
403
+ export interface GetDynamicFieldResponse {
204
404
  dynamicField: DynamicField;
205
405
  }
206
- interface GetDynamicObjectFieldOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
406
+ export interface GetDynamicObjectFieldOptions<Include extends ObjectInclude = {}> extends CoreClientMethodOptions {
207
407
  parentId: string;
208
408
  name: DynamicFieldName;
209
409
  include?: Include & ObjectInclude;
210
410
  }
211
- interface GetDynamicObjectFieldResponse<out Include extends ObjectInclude = {}> {
411
+ export interface GetDynamicObjectFieldResponse<out Include extends ObjectInclude = {}> {
212
412
  object: Object<Include>;
213
413
  }
214
- interface DynamicFieldName {
414
+ export interface DynamicFieldName {
215
415
  type: string;
216
416
  bcs: Uint8Array;
217
417
  }
218
- interface DynamicFieldValue {
418
+ export interface DynamicFieldValue {
219
419
  type: string;
220
420
  bcs: Uint8Array;
221
421
  }
222
422
  /** Balance methods */
223
- interface TransportMethods {
423
+ export interface TransportMethods {
224
424
  getBalance: (options: GetBalanceOptions) => Promise<GetBalanceResponse>;
225
425
  listBalances: (options: ListBalancesOptions) => Promise<ListBalancesResponse>;
226
426
  }
227
- interface GetBalanceOptions extends CoreClientMethodOptions {
427
+ export interface GetBalanceOptions extends CoreClientMethodOptions {
228
428
  owner: string;
229
429
  /** Defaults to `0x2::sui::SUI` */
230
430
  coinType?: string;
231
431
  }
232
- interface Balance {
432
+ export interface Balance {
233
433
  coinType: string;
234
434
  balance: string;
235
435
  coinBalance: string;
236
436
  addressBalance: string;
237
437
  }
238
- interface GetBalanceResponse {
438
+ export interface GetBalanceResponse {
239
439
  balance: Balance;
240
440
  }
241
- interface ListBalancesOptions extends CoreClientMethodOptions {
441
+ export interface ListBalancesOptions extends CoreClientMethodOptions {
242
442
  owner: string;
243
443
  limit?: number;
244
444
  cursor?: string | null;
245
445
  }
246
- interface ListBalancesResponse {
446
+ export interface ListBalancesResponse {
247
447
  balances: Balance[];
248
448
  hasNextPage: boolean;
249
449
  cursor: string | null;
250
450
  }
251
451
  /** Coin metadata methods */
252
- interface TransportMethods {
452
+ export interface TransportMethods {
253
453
  getCoinMetadata: (options: GetCoinMetadataOptions) => Promise<GetCoinMetadataResponse>;
254
454
  }
255
- interface GetCoinMetadataOptions extends CoreClientMethodOptions {
455
+ export interface GetCoinMetadataOptions extends CoreClientMethodOptions {
256
456
  coinType: string;
257
457
  }
258
- interface CoinMetadata {
458
+ export interface CoinMetadata {
259
459
  id: string | null;
260
460
  decimals: number;
261
461
  name: string;
@@ -263,18 +463,20 @@ declare namespace SuiClientTypes {
263
463
  description: string;
264
464
  iconUrl: string | null;
265
465
  }
266
- interface GetCoinMetadataResponse {
466
+ export interface GetCoinMetadataResponse {
267
467
  coinMetadata: CoinMetadata | null;
268
468
  }
269
469
  /** Transaction methods */
270
- interface TransportMethods {
470
+ export interface TransportMethods {
271
471
  getTransaction: <Include extends TransactionInclude = {}>(options: GetTransactionOptions<Include>) => Promise<TransactionResult<Include>>;
272
472
  executeTransaction: <Include extends TransactionInclude = {}>(options: ExecuteTransactionOptions<Include>) => Promise<TransactionResult<Include>>;
273
473
  simulateTransaction: <Include extends SimulateTransactionInclude = {}>(options: SimulateTransactionOptions<Include>) => Promise<SimulateTransactionResult<Include>>;
274
474
  resolveTransactionPlugin: () => TransactionPlugin;
275
475
  }
276
- interface Transaction<out Include extends TransactionInclude = {}> {
476
+ export interface Transaction<out Include extends TransactionInclude = {}> {
277
477
  digest: string;
478
+ /** The address that sent the transaction: `0x0` for system transactions. */
479
+ sender: string;
278
480
  signatures: string[];
279
481
  epoch: string | null;
280
482
  /**
@@ -307,7 +509,7 @@ declare namespace SuiClientTypes {
307
509
  bcs: true;
308
510
  } ? Uint8Array : undefined;
309
511
  }
310
- type TransactionResult<Include extends TransactionInclude = {}> = {
512
+ export type TransactionResult<Include extends TransactionInclude = {}> = {
311
513
  $kind: 'Transaction';
312
514
  Transaction: Transaction<Include>;
313
515
  FailedTransaction?: never;
@@ -316,7 +518,7 @@ declare namespace SuiClientTypes {
316
518
  Transaction?: never;
317
519
  FailedTransaction: Transaction<Include>;
318
520
  };
319
- type SimulateTransactionResult<Include extends SimulateTransactionInclude = {}> = {
521
+ export type SimulateTransactionResult<Include extends SimulateTransactionInclude = {}> = {
320
522
  $kind: 'Transaction';
321
523
  Transaction: Transaction<Include>;
322
524
  FailedTransaction?: never;
@@ -347,7 +549,7 @@ declare namespace SuiClientTypes {
347
549
  */
348
550
  gasPaymentMocked: boolean;
349
551
  };
350
- interface TransactionInclude {
552
+ export interface TransactionInclude {
351
553
  /** Include balance changes caused by the transaction. */
352
554
  balanceChanges?: boolean;
353
555
  /** Include parsed transaction effects (gas used, changed objects, status, etc.). */
@@ -355,8 +557,8 @@ declare namespace SuiClientTypes {
355
557
  /**
356
558
  * Include events emitted by the transaction.
357
559
  *
358
- * On the GraphQL transport, at most the first 50 events of a transaction are returned;
359
- * gRPC and JSON-RPC return the full event list.
560
+ * On the GraphQL transport, `executeTransaction` and `simulateTransaction` return at most
561
+ * the first 50 events of a transaction; gRPC returns the full event list.
360
562
  */
361
563
  events?: boolean;
362
564
  /** Include a map of object IDs to their types for all changed objects. */
@@ -366,35 +568,97 @@ declare namespace SuiClientTypes {
366
568
  /** Include the raw BCS-encoded transaction bytes. */
367
569
  bcs?: boolean;
368
570
  }
369
- interface SimulateTransactionInclude extends TransactionInclude {
571
+ export interface SimulateTransactionInclude extends TransactionInclude {
370
572
  /** Include return values and mutated references from each command (simulation only). */
371
573
  commandResults?: boolean;
372
574
  }
373
- interface CommandResult {
575
+ export interface CommandResult {
374
576
  returnValues: CommandOutput[];
375
577
  mutatedReferences: CommandOutput[];
376
578
  }
377
- interface CommandOutput {
579
+ export interface CommandOutput {
378
580
  bcs: Uint8Array;
379
581
  }
380
- interface BalanceChange {
582
+ export interface BalanceChange {
381
583
  coinType: string;
382
584
  address: string;
383
585
  amount: string;
384
586
  }
385
- interface TransactionData extends SerializedTransactionDataV2 {}
386
- interface GetTransactionOptions<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
587
+ /** Ledger transaction data. Narrow `kind.$kind` to read the transaction's payload. */
588
+ export interface TransactionData {
589
+ version: 2;
590
+ sender: string;
591
+ gasData: GasData;
592
+ expiration: TransactionExpiration | null;
593
+ /**
594
+ * The inputs of a `ProgrammableTransaction` or `ProgrammableSystemTransaction` kind; empty for
595
+ * every other kind.
596
+ */
597
+ inputs: TransactionInput[];
598
+ /**
599
+ * The commands of a `ProgrammableTransaction` or `ProgrammableSystemTransaction` kind; empty
600
+ * for every other kind.
601
+ */
602
+ commands: TransactionCommand[];
603
+ kind: TransactionKind;
604
+ }
605
+ export interface GasData {
606
+ budget: string;
607
+ price: string;
608
+ owner: string;
609
+ payment: {
610
+ objectId: string;
611
+ version: string;
612
+ digest: string;
613
+ }[];
614
+ }
615
+ export type TransactionExpiration = NonNullable<TransactionData$1['expiration']>;
616
+ /** A kind this SDK cannot fully map, inputs and commands included, is `Unknown`. */
617
+ export type TransactionKind = EnumOutputShape<{ [Kind in BcsTransactionKind['$kind'] | 'Unknown']: Kind extends 'Unknown' ? true : Kind extends 'ProgrammableTransaction' | 'ProgrammableSystemTransaction' ? ProgrammableTransaction : Kind extends 'EndOfEpochTransaction' ? EndOfEpochTransactionKind[] : Kind extends 'Genesis' ? {
618
+ objects: GenesisObject[];
619
+ } : NonNullable<BcsTransactionKind[Exclude<Kind, 'Unknown'>]> }>;
620
+ export interface ProgrammableTransaction {
621
+ inputs: TransactionInput[];
622
+ commands: TransactionCommand[];
623
+ }
624
+ /** A resolved input; transactions on chain never contain unresolved inputs. */
625
+ export type TransactionInput = Exclude<CallArg, {
626
+ $kind: 'UnresolvedPure' | 'UnresolvedObject';
627
+ }>;
628
+ /** A command; transactions on chain never contain intents. */
629
+ export type TransactionCommand = Exclude<Command, {
630
+ $kind: '$Intent';
631
+ }>;
632
+ export type ActiveJwk = NonNullable<TransactionKind['AuthenticatorStateUpdate']>['newActiveJwks'][number];
633
+ /** An end-of-epoch operation; ones this SDK version does not recognize are `Unknown`. */
634
+ export type EndOfEpochTransactionKind = EnumOutputShape<{ [Kind in BcsEndOfEpochTransactionKind['$kind'] | 'Unknown']: Kind extends 'Unknown' ? true : Kind extends 'BridgeStateCreate' ? BridgeStateCreate : NonNullable<BcsEndOfEpochTransactionKind[Exclude<Kind, 'Unknown'>]> }>;
635
+ /** An object created by the genesis transaction. */
636
+ export interface GenesisObject {
637
+ objectId: string;
638
+ version: string;
639
+ owner: ObjectOwner;
640
+ /** The object's Move type, or `package` for a package. */
641
+ type: string;
642
+ }
643
+ export interface BridgeStateCreate {
644
+ /**
645
+ * The chain identifier the bridge was created for: the first 4 bytes of the genesis
646
+ * checkpoint digest, hex encoded.
647
+ */
648
+ chainId: string;
649
+ }
650
+ export interface GetTransactionOptions<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
387
651
  digest: string;
388
652
  include?: Include & TransactionInclude;
389
653
  }
390
- type WaitForTransactionOptions<Include extends TransactionInclude = {}> = WaitForTransactionByDigest<Include> | WaitForTransactionByResult<Include>;
391
- interface WaitForTransactionByDigest<Include extends TransactionInclude = {}> extends GetTransactionOptions<Include> {
654
+ export type WaitForTransactionOptions<Include extends TransactionInclude = {}> = WaitForTransactionByDigest<Include> | WaitForTransactionByResult<Include>;
655
+ export interface WaitForTransactionByDigest<Include extends TransactionInclude = {}> extends GetTransactionOptions<Include> {
392
656
  timeout?: number;
393
657
  /** Absolute times (ms from start) to poll, e.g. [0, 300, 600, 1500]. After exhausted, repeats the last interval. */
394
658
  pollSchedule?: number[];
395
659
  result?: never;
396
660
  }
397
- interface WaitForTransactionByResult<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
661
+ export interface WaitForTransactionByResult<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
398
662
  result: TransactionResult<any>;
399
663
  include?: Include & TransactionInclude;
400
664
  timeout?: number;
@@ -402,18 +666,18 @@ declare namespace SuiClientTypes {
402
666
  pollSchedule?: number[];
403
667
  digest?: never;
404
668
  }
405
- interface ExecuteTransactionOptions<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
669
+ export interface ExecuteTransactionOptions<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
406
670
  transaction: Uint8Array;
407
671
  signatures: string[];
408
672
  include?: Include & TransactionInclude;
409
673
  }
410
- interface SignAndExecuteTransactionOptions<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
674
+ export interface SignAndExecuteTransactionOptions<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
411
675
  transaction: Uint8Array | Transaction$1;
412
676
  signer: Signer;
413
677
  additionalSignatures?: string[];
414
678
  include?: Include & TransactionInclude;
415
679
  }
416
- interface SimulateTransactionOptions<Include extends SimulateTransactionInclude = {}> extends CoreClientMethodOptions {
680
+ export interface SimulateTransactionOptions<Include extends SimulateTransactionInclude = {}> extends CoreClientMethodOptions {
417
681
  transaction: Uint8Array | Transaction$1;
418
682
  include?: Include & SimulateTransactionInclude;
419
683
  /**
@@ -425,19 +689,41 @@ declare namespace SuiClientTypes {
425
689
  * Defaults to `true` (checks enabled).
426
690
  */
427
691
  checksEnabled?: boolean;
692
+ /**
693
+ * Whether the server selects the sender's real gas payment during simulation. When
694
+ * disabled, a transaction without gas coins may be simulated with a mocked gas coin
695
+ * (reported as `gasPaymentMocked`). Ignored when `checksEnabled` is `false`.
696
+ *
697
+ * @default `true` when the gas payment is set to `[]`, otherwise `false`
698
+ */
699
+ doGasSelection?: boolean;
428
700
  }
429
701
  /** Query methods */
430
- interface TransportMethods {
702
+ export interface TransportMethods {
431
703
  listTransactions: <Include extends TransactionInclude = {}>(options: ListTransactionsOptions<Include>) => Promise<ListTransactionsResponse<Include>>;
432
704
  listEvents: (options: ListEventsOptions) => Promise<ListEventsResponse>;
705
+ listCheckpoints: (options: ListCheckpointsOptions) => Promise<ListCheckpointsResponse>;
433
706
  }
434
707
  /**
435
- * A filter matching transactions. Exactly one predicate must be specified.
708
+ * A filter matching transactions. Every specified predicate must match (predicates are
709
+ * ANDed), and an empty filter matches every transaction.
436
710
  *
437
- * All predicates are supported identically by every transport.
711
+ * At most one of `affectedAddress`, `affectedObject`, or `function` may be specified;
712
+ * `sender` can be combined with any of them.
438
713
  */
439
- type TransactionFilter = {
440
- /** Match transactions sent by this address. */sender: string;
714
+ export type TransactionFilter = {
715
+ /** Match transactions sent by this address. */sender?: string;
716
+ } & ({
717
+ /**
718
+ * Match transactions this address sent or paid gas for, or that changed objects it owned
719
+ * before or owns after the transaction, or its address balance.
720
+ */
721
+ affectedAddress: string;
722
+ affectedObject?: never;
723
+ function?: never;
724
+ } | {
725
+ /** Match transactions whose effects include a change to this object. */affectedObject: string;
726
+ affectedAddress?: never;
441
727
  function?: never;
442
728
  } | {
443
729
  /**
@@ -446,73 +732,96 @@ declare namespace SuiClientTypes {
446
732
  * `package::module::function`.
447
733
  */
448
734
  function: string;
449
- sender?: never;
450
- };
735
+ affectedAddress?: never;
736
+ affectedObject?: never;
737
+ } | {
738
+ affectedAddress?: never;
739
+ affectedObject?: never;
740
+ function?: never;
741
+ });
451
742
  /**
452
- * A filter matching events. Exactly one predicate must be specified.
743
+ * A filter matching events. Every specified predicate must match (predicates are ANDed),
744
+ * and an empty filter matches every event.
453
745
  *
454
- * All predicates are supported by every transport, with one caveat: on the deprecated
455
- * JSON-RPC transport, an `eventType` naming a generic type must include type arguments —
456
- * a bare generic name (e.g. `0xpkg::mod::Event` for events of type `0xpkg::mod::Event<T>`)
457
- * matches any instantiation on gRPC and GraphQL, but matches nothing on JSON-RPC, which
458
- * compares the full type for exact equality.
746
+ * `emitModule` and `eventType` cannot be combined; `sender` can be combined with either.
459
747
  */
460
- type EventFilter = {
461
- /** Match events emitted by transactions sent by this address. */sender: string;
462
- emitModule?: never;
463
- eventType?: never;
464
- } | {
465
- /** Match events emitted by a module, specified as `package::module`. */emitModule: string;
466
- sender?: never;
748
+ export type EventFilter = {
749
+ /** Match events emitted by transactions sent by this address. */sender?: string;
750
+ } & ({
751
+ /**
752
+ * Match events emitted by a module, specified as `package` (any module in the
753
+ * package) or `package::module`.
754
+ */
755
+ emitModule: string;
467
756
  eventType?: never;
468
757
  } | {
469
758
  /**
470
- * Match events by type: either every event whose type is defined in a
471
- * module (`package::module`), or events with a fully qualified type
472
- * name (`package::module::Name` or `package::module::Name<T1, T2>`).
759
+ * Match events by type: every event whose type is defined in a package (`package`)
760
+ * or module (`package::module`), or events with a fully qualified type name
761
+ * (`package::module::Name` or `package::module::Name<T1, T2>`).
473
762
  *
474
763
  * A bare generic name (`package::module::Name` without type arguments) matches
475
- * any instantiation on gRPC and GraphQL, but matches nothing on the deprecated
476
- * JSON-RPC transport, which compares the full type for exact equality.
764
+ * any instantiation, while a name with type arguments only matches that exact
765
+ * instantiation.
477
766
  */
478
767
  eventType: string;
479
- sender?: never;
480
768
  emitModule?: never;
481
- };
482
- interface ListTransactionsOptions<Include extends TransactionInclude = {}> extends CoreClientMethodOptions {
483
- filter?: TransactionFilter;
769
+ } | {
770
+ emitModule?: never;
771
+ eventType?: never;
772
+ });
773
+ /** A checkpoint sequence number. */
774
+ export type CheckpointNumber = string | number | bigint;
775
+ /** Pagination and range options shared by the ledger query methods. */
776
+ export interface LedgerQueryOptions extends CoreClientMethodOptions {
484
777
  /**
485
778
  * Maximum number of items to return. Defaults to 50.
486
779
  *
487
780
  * Servers cap page sizes (50 by default): values above the server's cap cause the
488
- * GraphQL and JSON-RPC transports to throw, while gRPC servers silently truncate
489
- * the page to their configured maximum.
781
+ * GraphQL transport to throw, while gRPC servers silently truncate the page to their
782
+ * configured maximum.
490
783
  */
491
784
  limit?: number;
492
785
  /**
493
- * Return items strictly after this cursor in ledger order (usually the `endCursor` of
494
- * an ascending page, or the `startCursor` of a descending page to poll for new items).
495
- * Implies `order: 'ascending'`, and cannot be combined with `before`.
786
+ * Return items strictly after this cursor in ledger order, regardless of `order`.
787
+ * Usually the `endCursor` of an ascending page, or the `startCursor` of a descending
788
+ * page to poll for new items. Can be combined with `before` to read a window.
789
+ *
790
+ * Cursors are only valid for the query that produced them: pass them back with the same
791
+ * filter and checkpoint range.
496
792
  */
497
793
  after?: string | null;
498
794
  /**
499
- * Return items strictly before this cursor in ledger order (usually the `endCursor` of
500
- * a descending page). Implies `order: 'descending'`, and cannot be combined with
501
- * `after`.
795
+ * Return items strictly before this cursor in ledger order, regardless of `order`.
796
+ * Usually the `endCursor` of a descending page. Can be combined with `after` to read a
797
+ * window.
502
798
  */
503
799
  before?: string | null;
504
- /** Order of returned results. Defaults to `ascending` (oldest first). */
505
- order?: 'ascending' | 'descending';
506
- include?: Include & TransactionInclude;
800
+ /**
801
+ * Order of returned results. Defaults to `descending` when only `before` is provided,
802
+ * and `ascending` (oldest first) otherwise.
803
+ */
804
+ order?: Order;
805
+ /**
806
+ * Only return items from checkpoints at or after this sequence number (inclusive).
807
+ * Intersects with `after`/`before`.
808
+ */
809
+ startCheckpoint?: CheckpointNumber;
810
+ /**
811
+ * Only return items from checkpoints before this sequence number (exclusive). Must not
812
+ * be less than `startCheckpoint`. Intersects with `after`/`before`.
813
+ */
814
+ endCheckpoint?: CheckpointNumber;
507
815
  }
508
- interface ListTransactionsResponse<out Include extends TransactionInclude = {}> {
509
- transactions: TransactionResult<Include>[];
816
+ /** Pagination fields shared by `listTransactions`, `listEvents` and `listCheckpoints`. */
817
+ export interface LedgerQueryResponse {
510
818
  /**
511
819
  * Whether more items may be available after this page.
512
820
  *
513
- * gRPC servers bound how much of the ledger a single request scans, so a scan-limited
514
- * query can return fewer items than `limit` (even none) with `hasNextPage: true`;
515
- * continuing from `endCursor` always makes progress through the scanned range.
821
+ * Servers can bound how much of the ledger a single request scans, on gRPC and GraphQL
822
+ * alike, so a query can return fewer items than `limit` (even none) with
823
+ * `hasNextPage: true`; continuing from `endCursor` always makes progress through the
824
+ * scanned range.
516
825
  */
517
826
  hasNextPage: boolean;
518
827
  /**
@@ -521,106 +830,86 @@ declare namespace SuiClientTypes {
521
830
  */
522
831
  startCursor: string | null;
523
832
  /**
524
- * Cursor at the last returned item. Continue the query by passing it as `after`
525
- * (ascending) or `before` (descending).
833
+ * Position to continue from: the last returned item on a final page, otherwise the
834
+ * server's scan position, which can be past the last item or set on an empty page.
835
+ * Continue the query by passing it as `after` (ascending) or `before` (descending).
836
+ * When paging a window (`after` + `before`),
837
+ * keep the fixed bound and replace the moving one with `endCursor`.
526
838
  */
527
839
  endCursor: string | null;
528
840
  }
529
- interface ListEventsOptions extends CoreClientMethodOptions {
841
+ export interface ListTransactionsOptions<Include extends TransactionInclude = {}> extends LedgerQueryOptions {
842
+ filter?: TransactionFilter;
843
+ include?: Include & TransactionInclude;
844
+ }
845
+ export interface ListTransactionsResponse<out Include extends TransactionInclude = {}> extends LedgerQueryResponse {
846
+ transactions: TransactionResult<Include>[];
847
+ }
848
+ export interface ListEventsOptions extends LedgerQueryOptions {
530
849
  filter?: EventFilter;
531
- /**
532
- * Maximum number of items to return. Defaults to 50.
533
- *
534
- * Servers cap page sizes (50 by default): values above the server's cap cause the
535
- * GraphQL and JSON-RPC transports to throw, while gRPC servers silently truncate
536
- * the page to their configured maximum.
537
- */
538
- limit?: number;
539
- /**
540
- * Return items strictly after this cursor in ledger order (usually the `endCursor` of
541
- * an ascending page, or the `startCursor` of a descending page to poll for new items).
542
- * Implies `order: 'ascending'`, and cannot be combined with `before`.
543
- */
544
- after?: string | null;
545
- /**
546
- * Return items strictly before this cursor in ledger order (usually the `endCursor` of
547
- * a descending page). Implies `order: 'descending'`, and cannot be combined with
548
- * `after`.
549
- */
550
- before?: string | null;
551
- /** Order of returned results. Defaults to `ascending` (oldest first). */
552
- order?: 'ascending' | 'descending';
553
850
  }
554
851
  /** An event returned from a query, along with its position in the ledger. */
555
- interface EventEntry extends Event {
556
- /**
557
- * The sequence number of the checkpoint containing the emitting transaction.
558
- *
559
- * `null` on the JSON-RPC transport, which does not expose checkpoint
560
- * information for queried events.
561
- */
562
- checkpoint: string | null;
852
+ export interface EventEntry extends Event {
853
+ /** The sequence number of the checkpoint containing the emitting transaction. */
854
+ checkpoint: string;
563
855
  /** The digest of the transaction that emitted this event. */
564
856
  transactionDigest: string;
565
857
  /** The index of this event within its transaction's event list. */
566
858
  eventIndex: number;
567
859
  }
568
- interface ListEventsResponse {
860
+ export interface ListEventsResponse extends LedgerQueryResponse {
569
861
  events: EventEntry[];
570
- /**
571
- * Whether more items may be available after this page.
572
- *
573
- * gRPC servers bound how much of the ledger a single request scans, so a scan-limited
574
- * query can return fewer items than `limit` (even none) with `hasNextPage: true`;
575
- * continuing from `endCursor` always makes progress through the scanned range.
576
- */
577
- hasNextPage: boolean;
578
- /**
579
- * Cursor at the first returned item. After a descending read of the most recent
580
- * items, pass as `after` to poll for items added since.
581
- */
582
- startCursor: string | null;
583
- /**
584
- * Cursor at the last returned item. Continue the query by passing it as `after`
585
- * (ascending) or `before` (descending).
586
- */
587
- endCursor: string | null;
588
862
  }
589
- interface GetReferenceGasPriceOptions extends CoreClientMethodOptions {}
590
- interface TransportMethods {
863
+ export interface ListCheckpointsOptions extends LedgerQueryOptions {}
864
+ /** A checkpoint summary. */
865
+ export interface Checkpoint {
866
+ /** The checkpoint's sequence number. */
867
+ sequenceNumber: string;
868
+ /** The digest of the checkpoint summary. */
869
+ digest: string;
870
+ /** The epoch the checkpoint belongs to. */
871
+ epoch: string;
872
+ /** The checkpoint's timestamp, in milliseconds since the Unix epoch. */
873
+ timestampMs: number;
874
+ }
875
+ export interface ListCheckpointsResponse extends LedgerQueryResponse {
876
+ checkpoints: Checkpoint[];
877
+ }
878
+ export interface GetReferenceGasPriceOptions extends CoreClientMethodOptions {}
879
+ export interface TransportMethods {
591
880
  getReferenceGasPrice?: (options?: GetReferenceGasPriceOptions) => Promise<GetReferenceGasPriceResponse>;
592
881
  }
593
- interface GetReferenceGasPriceResponse {
882
+ export interface GetReferenceGasPriceResponse {
594
883
  referenceGasPrice: string;
595
884
  }
596
- interface GetCurrentSystemStateOptions extends CoreClientMethodOptions {}
597
- interface TransportMethods {
885
+ export interface GetCurrentSystemStateOptions extends CoreClientMethodOptions {}
886
+ export interface TransportMethods {
598
887
  getCurrentSystemState?: (options?: GetCurrentSystemStateOptions) => Promise<GetCurrentSystemStateResponse>;
599
888
  }
600
- interface GetCurrentSystemStateResponse {
889
+ export interface GetCurrentSystemStateResponse {
601
890
  systemState: SystemStateInfo;
602
891
  }
603
- interface GetProtocolConfigOptions extends CoreClientMethodOptions {}
604
- interface TransportMethods {
892
+ export interface GetProtocolConfigOptions extends CoreClientMethodOptions {}
893
+ export interface TransportMethods {
605
894
  getProtocolConfig?: (options?: GetProtocolConfigOptions) => Promise<GetProtocolConfigResponse>;
606
895
  }
607
- interface GetProtocolConfigResponse {
896
+ export interface GetProtocolConfigResponse {
608
897
  protocolConfig: ProtocolConfig;
609
898
  }
610
- interface ProtocolConfig {
899
+ export interface ProtocolConfig {
611
900
  protocolVersion: string;
612
901
  featureFlags: Record<string, boolean>;
613
902
  attributes: Record<string, string | null>;
614
903
  }
615
- interface GetChainIdentifierOptions extends CoreClientMethodOptions {}
616
- interface TransportMethods {
904
+ export interface GetChainIdentifierOptions extends CoreClientMethodOptions {}
905
+ export interface TransportMethods {
617
906
  getChainIdentifier?: (options?: GetChainIdentifierOptions) => Promise<GetChainIdentifierResponse>;
618
907
  }
619
908
  /** The 32-byte genesis checkpoint digest (uniquely identifies the network), base58 encoded. */
620
- interface GetChainIdentifierResponse {
909
+ export interface GetChainIdentifierResponse {
621
910
  chainIdentifier: string;
622
911
  }
623
- interface SystemStateInfo {
912
+ export interface SystemStateInfo {
624
913
  systemStateVersion: string;
625
914
  epoch: string;
626
915
  protocolVersion: string;
@@ -635,7 +924,7 @@ declare namespace SuiClientTypes {
635
924
  storageFund: StorageFund;
636
925
  stakeSubsidy: StakeSubsidy;
637
926
  }
638
- interface SystemParameters {
927
+ export interface SystemParameters {
639
928
  epochDurationMs: string;
640
929
  stakeSubsidyStartEpoch: string;
641
930
  maxValidatorCount: string;
@@ -643,76 +932,107 @@ declare namespace SuiClientTypes {
643
932
  validatorLowStakeThreshold: string;
644
933
  validatorLowStakeGracePeriod: string;
645
934
  }
646
- interface StorageFund {
935
+ export interface StorageFund {
647
936
  totalObjectStorageRebates: string;
648
937
  nonRefundableBalance: string;
649
938
  }
650
- interface StakeSubsidy {
939
+ export interface StakeSubsidy {
651
940
  balance: string;
652
941
  distributionCounter: string;
653
942
  currentDistributionAmount: string;
654
943
  stakeSubsidyPeriodLength: string;
655
944
  stakeSubsidyDecreaseRate: number;
656
945
  }
946
+ /** Signature verification methods */
947
+ export interface VerifySignatureBaseOptions extends CoreClientMethodOptions {
948
+ /** The serialized signature (flag, signature and public key), Base64. */
949
+ signature: string;
950
+ /** The account the signature must be valid for. */
951
+ address: string;
952
+ /**
953
+ * Accept a signature from any of `address`'s current address aliases, not only from `address`
954
+ * itself. Defaults to `true`.
955
+ */
956
+ checkAddressAliases?: boolean;
957
+ }
958
+ export type VerifySignatureOptions = VerifySignatureBaseOptions & ({
959
+ /** The signed personal message; a string is UTF-8 encoded. */personalMessage: Uint8Array | string;
960
+ transaction?: never;
961
+ } | {
962
+ /** The signed BCS `TransactionData` bytes. */transaction: Uint8Array;
963
+ personalMessage?: never;
964
+ });
965
+ export interface VerifySignatureResponse {
966
+ valid: boolean;
967
+ /** Why verification failed, for logs. The text differs by transport, so don't match on it. */
968
+ reason?: string;
969
+ }
970
+ export interface TransportMethods {
971
+ verifySignature: (options: VerifySignatureOptions) => Promise<VerifySignatureResponse>;
972
+ }
657
973
  /** ZkLogin methods */
658
- interface VerifyZkLoginSignatureOptions extends CoreClientMethodOptions {
974
+ export interface VerifyZkLoginSignatureOptions extends CoreClientMethodOptions {
659
975
  bytes: string;
660
976
  signature: string;
661
977
  intentScope: 'TransactionData' | 'PersonalMessage';
662
978
  address: string;
663
979
  }
664
- interface ZkLoginVerifyResponse {
980
+ export interface ZkLoginVerifyResponse {
665
981
  success: boolean;
666
982
  errors: string[];
667
983
  }
668
- interface TransportMethods {
984
+ export interface TransportMethods {
985
+ /**
986
+ * @deprecated Use `verifySignature`. This method accepts signatures from the address's
987
+ * aliases, like `verifySignature` does by default.
988
+ */
669
989
  verifyZkLoginSignature: (options: VerifyZkLoginSignatureOptions) => Promise<ZkLoginVerifyResponse>;
670
990
  }
671
991
  /** Name service methods */
672
- interface ResolveNameServiceAddressOptions extends CoreClientMethodOptions {
992
+ export interface ResolveNameServiceAddressOptions extends CoreClientMethodOptions {
673
993
  name: string;
674
994
  }
675
- interface ResolveNameServiceAddressResponse {
995
+ export interface ResolveNameServiceAddressResponse {
676
996
  address: string | null;
677
997
  }
678
- interface DefaultNameServiceNameOptions extends CoreClientMethodOptions {
998
+ export interface DefaultNameServiceNameOptions extends CoreClientMethodOptions {
679
999
  address: string;
680
1000
  }
681
- interface DefaultNameServiceNameResponse {
1001
+ export interface DefaultNameServiceNameResponse {
682
1002
  data: {
683
1003
  name: string | null;
684
1004
  };
685
1005
  }
686
- interface TransportMethods {
1006
+ export interface TransportMethods {
687
1007
  resolveNameServiceAddress: (options: ResolveNameServiceAddressOptions) => Promise<ResolveNameServiceAddressResponse>;
688
1008
  defaultNameServiceName: (options: DefaultNameServiceNameOptions) => Promise<DefaultNameServiceNameResponse>;
689
1009
  }
690
1010
  /** MVR methods */
691
- interface TransportMethods {
1011
+ export interface TransportMethods {
692
1012
  mvr: MvrMethods;
693
1013
  }
694
- interface MvrMethods {
1014
+ export interface MvrMethods {
695
1015
  resolvePackage: (options: MvrResolvePackageOptions) => Promise<MvrResolvePackageResponse>;
696
1016
  resolveType: (options: MvrResolveTypeOptions) => Promise<MvrResolveTypeResponse>;
697
1017
  resolve: (options: MvrResolveOptions) => Promise<MvrResolveResponse>;
698
1018
  }
699
- interface MvrResolvePackageOptions extends CoreClientMethodOptions {
1019
+ export interface MvrResolvePackageOptions extends CoreClientMethodOptions {
700
1020
  package: string;
701
1021
  }
702
- interface MvrResolveTypeOptions extends CoreClientMethodOptions {
1022
+ export interface MvrResolveTypeOptions extends CoreClientMethodOptions {
703
1023
  type: string;
704
1024
  }
705
- interface MvrResolveOptions extends CoreClientMethodOptions {
1025
+ export interface MvrResolveOptions extends CoreClientMethodOptions {
706
1026
  packages?: string[];
707
1027
  types?: string[];
708
1028
  }
709
- interface MvrResolvePackageResponse {
1029
+ export interface MvrResolvePackageResponse {
710
1030
  package: string;
711
1031
  }
712
- interface MvrResolveTypeResponse {
1032
+ export interface MvrResolveTypeResponse {
713
1033
  type: string;
714
1034
  }
715
- interface MvrResolveResponse {
1035
+ export interface MvrResolveResponse {
716
1036
  packages: Record<string, {
717
1037
  package: string;
718
1038
  }>;
@@ -721,27 +1041,27 @@ declare namespace SuiClientTypes {
721
1041
  }>;
722
1042
  }
723
1043
  /** Move package methods */
724
- interface TransportMethods {
1044
+ export interface TransportMethods {
725
1045
  getMoveFunction: (options: GetMoveFunctionOptions) => Promise<GetMoveFunctionResponse>;
726
1046
  }
727
- interface GetMovePackageOptions extends CoreClientMethodOptions {
1047
+ export interface GetMovePackageOptions extends CoreClientMethodOptions {
728
1048
  packageId: string;
729
1049
  }
730
- interface GetMovePackageResponse {
1050
+ export interface GetMovePackageResponse {
731
1051
  package: PackageResponse;
732
1052
  }
733
- interface PackageResponse {
1053
+ export interface PackageResponse {
734
1054
  storageId: string;
735
1055
  originalId: string;
736
1056
  version: string;
737
1057
  modules: ModuleResponse[];
738
1058
  }
739
- interface ModuleResponse {
1059
+ export interface ModuleResponse {
740
1060
  name: string;
741
1061
  datatypes: DatatypeResponse[];
742
1062
  functions: FunctionResponse[];
743
1063
  }
744
- type DatatypeResponse = {
1064
+ export type DatatypeResponse = {
745
1065
  $kind: 'struct';
746
1066
  typeName: string;
747
1067
  definingId: string;
@@ -760,40 +1080,40 @@ declare namespace SuiClientTypes {
760
1080
  typeParameters: TypeParameter[];
761
1081
  variants: VariantDescriptor[];
762
1082
  };
763
- type Ability = 'copy' | 'drop' | 'store' | 'key' | 'unknown';
764
- type DatatypeKind = 'struct' | 'enum' | 'unknown';
765
- interface TypeParameter {
1083
+ export type Ability = 'copy' | 'drop' | 'store' | 'key' | 'unknown';
1084
+ export type DatatypeKind = 'struct' | 'enum' | 'unknown';
1085
+ export interface TypeParameter {
766
1086
  constraints: Ability[];
767
1087
  isPhantom: boolean;
768
1088
  }
769
- interface FieldDescriptor {
1089
+ export interface FieldDescriptor {
770
1090
  name: string;
771
1091
  position: number;
772
1092
  type: OpenSignatureBody;
773
1093
  }
774
- interface VariantDescriptor {
1094
+ export interface VariantDescriptor {
775
1095
  name: string;
776
1096
  position: number;
777
1097
  fields: FieldDescriptor[];
778
1098
  }
779
- interface GetMoveFunctionOptions extends CoreClientMethodOptions {
1099
+ export interface GetMoveFunctionOptions extends CoreClientMethodOptions {
780
1100
  packageId: string;
781
1101
  moduleName: string;
782
1102
  name: string;
783
1103
  }
784
- interface GetMoveFunctionResponse {
1104
+ export interface GetMoveFunctionResponse {
785
1105
  function: FunctionResponse;
786
1106
  }
787
- interface GetMoveDatatypeOptions extends CoreClientMethodOptions {
1107
+ export interface GetMoveDatatypeOptions extends CoreClientMethodOptions {
788
1108
  packageId: string;
789
1109
  moduleName: string;
790
1110
  name: string;
791
1111
  }
792
- interface GetMoveDatatypeResponse {
1112
+ export interface GetMoveDatatypeResponse {
793
1113
  datatype: DatatypeResponse;
794
1114
  }
795
- type Visibility = 'public' | 'friend' | 'private' | 'unknown';
796
- interface FunctionResponse {
1115
+ export type Visibility = 'public' | 'friend' | 'private' | 'unknown';
1116
+ export interface FunctionResponse {
797
1117
  packageId: string;
798
1118
  moduleName: string;
799
1119
  name: string;
@@ -803,12 +1123,12 @@ declare namespace SuiClientTypes {
803
1123
  parameters: OpenSignature[];
804
1124
  returns: OpenSignature[];
805
1125
  }
806
- type ReferenceType = 'mutable' | 'immutable' | 'unknown';
807
- type OpenSignature = {
1126
+ export type ReferenceType = 'mutable' | 'immutable' | 'unknown';
1127
+ export type OpenSignature = {
808
1128
  reference: ReferenceType | null;
809
1129
  body: OpenSignatureBody;
810
1130
  };
811
- type OpenSignatureBody = {
1131
+ export type OpenSignatureBody = {
812
1132
  $kind: 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'bool' | 'address' | 'unknown';
813
1133
  } | {
814
1134
  $kind: 'vector';
@@ -824,7 +1144,7 @@ declare namespace SuiClientTypes {
824
1144
  index: number;
825
1145
  };
826
1146
  /** ObjectOwner types */
827
- interface AddressOwner {
1147
+ export interface AddressOwner {
828
1148
  $kind: 'AddressOwner';
829
1149
  AddressOwner: string;
830
1150
  ObjectOwner?: never;
@@ -832,7 +1152,7 @@ declare namespace SuiClientTypes {
832
1152
  Immutable?: never;
833
1153
  ConsensusAddressOwner?: never;
834
1154
  }
835
- interface ParentOwner {
1155
+ export interface ParentOwner {
836
1156
  $kind: 'ObjectOwner';
837
1157
  ObjectOwner: string;
838
1158
  AddressOwner?: never;
@@ -840,7 +1160,7 @@ declare namespace SuiClientTypes {
840
1160
  Immutable?: never;
841
1161
  ConsensusAddressOwner?: never;
842
1162
  }
843
- interface SharedOwner {
1163
+ export interface SharedOwner {
844
1164
  $kind: 'Shared';
845
1165
  Shared: {
846
1166
  initialSharedVersion: string;
@@ -850,7 +1170,7 @@ declare namespace SuiClientTypes {
850
1170
  Immutable?: never;
851
1171
  ConsensusAddressOwner?: never;
852
1172
  }
853
- interface ImmutableOwner {
1173
+ export interface ImmutableOwner {
854
1174
  $kind: 'Immutable';
855
1175
  Immutable: true;
856
1176
  AddressOwner?: never;
@@ -858,7 +1178,7 @@ declare namespace SuiClientTypes {
858
1178
  Shared?: never;
859
1179
  ConsensusAddressOwner?: never;
860
1180
  }
861
- interface ConsensusAddressOwner {
1181
+ export interface ConsensusAddressOwner {
862
1182
  $kind: 'ConsensusAddressOwner';
863
1183
  ConsensusAddressOwner: {
864
1184
  startVersion: string;
@@ -869,7 +1189,7 @@ declare namespace SuiClientTypes {
869
1189
  Shared?: never;
870
1190
  Immutable?: never;
871
1191
  }
872
- interface UnknownOwner {
1192
+ export interface UnknownOwner {
873
1193
  $kind: 'Unknown';
874
1194
  AddressOwner?: never;
875
1195
  ObjectOwner?: never;
@@ -877,9 +1197,9 @@ declare namespace SuiClientTypes {
877
1197
  Immutable?: never;
878
1198
  ConsensusAddressOwner?: never;
879
1199
  }
880
- type ObjectOwner = AddressOwner | ParentOwner | SharedOwner | ImmutableOwner | ConsensusAddressOwner | UnknownOwner;
1200
+ export type ObjectOwner = AddressOwner | ParentOwner | SharedOwner | ImmutableOwner | ConsensusAddressOwner | UnknownOwner;
881
1201
  /** Effects */
882
- interface TransactionEffects {
1202
+ export interface TransactionEffects {
883
1203
  bcs: Uint8Array | null;
884
1204
  version: number;
885
1205
  status: ExecutionStatus;
@@ -893,7 +1213,7 @@ declare namespace SuiClientTypes {
893
1213
  unchangedConsensusObjects: UnchangedConsensusObject[];
894
1214
  auxiliaryDataDigest: string | null;
895
1215
  }
896
- interface ChangedObject {
1216
+ export interface ChangedObject {
897
1217
  objectId: string;
898
1218
  inputState: 'Unknown' | 'DoesNotExist' | 'Exists';
899
1219
  inputVersion: string | null;
@@ -905,26 +1225,26 @@ declare namespace SuiClientTypes {
905
1225
  outputOwner: ObjectOwner | null;
906
1226
  idOperation: 'Unknown' | 'None' | 'Created' | 'Deleted';
907
1227
  }
908
- interface GasCostSummary {
1228
+ export interface GasCostSummary {
909
1229
  computationCost: string;
910
1230
  storageCost: string;
911
1231
  storageRebate: string;
912
1232
  nonRefundableStorageFee: string;
913
1233
  }
914
- type ExecutionStatus = {
1234
+ export type ExecutionStatus = {
915
1235
  success: true;
916
1236
  error: null;
917
1237
  } | {
918
1238
  success: false;
919
1239
  error: ExecutionError;
920
1240
  };
921
- interface UnchangedConsensusObject {
1241
+ export interface UnchangedConsensusObject {
922
1242
  kind: 'Unknown' | 'ReadOnlyRoot' | 'MutateConsensusStreamEnded' | 'ReadConsensusStreamEnded' | 'Cancelled' | 'PerEpochConfig';
923
1243
  objectId: string;
924
1244
  version: string | null;
925
1245
  digest: string | null;
926
1246
  }
927
- interface Event {
1247
+ export interface Event {
928
1248
  packageId: string;
929
1249
  module: string;
930
1250
  sender: string;
@@ -934,66 +1254,65 @@ declare namespace SuiClientTypes {
934
1254
  * The JSON representation of the event's Move struct data.
935
1255
  *
936
1256
  * **Warning:** The exact shape and field names of this data may vary between different
937
- * API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs use
1257
+ * API implementations (gRPC or GraphQL). For consistent data across APIs use
938
1258
  * the `bcs` field and parse the BCS data directly.
939
1259
  */
940
1260
  json: Record<string, unknown> | null;
941
1261
  }
942
- interface MoveAbort {
1262
+ export interface MoveAbort {
943
1263
  abortCode: string;
944
1264
  location?: MoveLocation;
945
1265
  cleverError?: CleverError;
946
1266
  }
947
- interface MoveLocation {
1267
+ export interface MoveLocation {
948
1268
  package?: string;
949
1269
  module?: string;
950
- function?: number;
951
1270
  functionName?: string;
952
1271
  instruction?: number;
953
1272
  }
954
- interface CleverError {
1273
+ export interface CleverError {
955
1274
  errorCode?: number;
956
1275
  lineNumber?: number;
957
1276
  constantName?: string;
958
1277
  constantType?: string;
959
1278
  value?: string;
960
1279
  }
961
- interface SizeError {
1280
+ export interface SizeError {
962
1281
  name: string;
963
1282
  size: number;
964
1283
  maxSize: number;
965
1284
  }
966
- interface CommandArgumentError {
1285
+ export interface CommandArgumentError {
967
1286
  argument: number;
968
1287
  name: string;
969
1288
  }
970
- interface TypeArgumentError {
1289
+ export interface TypeArgumentError {
971
1290
  typeArgument: number;
972
1291
  name: string;
973
1292
  }
974
- interface PackageUpgradeError {
1293
+ export interface PackageUpgradeError {
975
1294
  name: string;
976
1295
  packageId?: string;
977
1296
  digest?: string;
978
1297
  }
979
- interface CoinDenyListError {
1298
+ export interface CoinDenyListError {
980
1299
  name: string;
981
1300
  coinType: string;
982
1301
  address?: string;
983
1302
  }
984
- interface CongestedObjects {
1303
+ export interface CongestedObjects {
985
1304
  name: string;
986
1305
  objects: string[];
987
1306
  }
988
- interface IndexError {
1307
+ export interface IndexError {
989
1308
  index?: number;
990
1309
  subresult?: number;
991
1310
  }
992
- interface ObjectIdError {
1311
+ export interface ObjectIdError {
993
1312
  name?: string;
994
1313
  objectId: string;
995
1314
  }
996
- type ExecutionError = {
1315
+ export type ExecutionError = {
997
1316
  message: string;
998
1317
  command?: number;
999
1318
  } & EnumOutputShape<{
@@ -1008,6 +1327,7 @@ declare namespace SuiClientTypes {
1008
1327
  ObjectIdError: ObjectIdError;
1009
1328
  Unknown: null;
1010
1329
  }>;
1330
+ export {};
1011
1331
  }
1012
1332
  //#endregion
1013
1333
  export { ClientWithExtensions, SuiClientRegistration, SuiClientTypes };