@mysten/sui 2.39.0 → 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 +162 -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 +8 -8
  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/forking/v1alpha/forking_service.client.d.mts +4 -4
  137. package/dist/grpc/proto/sui/rpc/v2/error_reason.d.mts +176 -1
  138. package/dist/grpc/proto/sui/rpc/v2/error_reason.d.mts.map +1 -1
  139. package/dist/grpc/proto/sui/rpc/v2/error_reason.mjs +175 -0
  140. package/dist/grpc/proto/sui/rpc/v2/error_reason.mjs.map +1 -1
  141. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.d.mts +2 -2
  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/name_service.client.d.mts +4 -4
  152. package/dist/grpc/proto/sui/rpc/v2/object.mjs +1 -1
  153. package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts +111 -9
  154. package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts.map +1 -1
  155. package/dist/grpc/proto/sui/rpc/v2/query_options.mjs +63 -19
  156. package/dist/grpc/proto/sui/rpc/v2/query_options.mjs.map +1 -1
  157. package/dist/grpc/proto/sui/rpc/v2/signature.d.mts +5 -5
  158. package/dist/grpc/proto/sui/rpc/v2/signature.mjs.map +1 -1
  159. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.d.mts +5 -1
  160. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.d.mts.map +1 -1
  161. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.mjs +4 -0
  162. package/dist/grpc/proto/sui/rpc/v2/signature_scheme.mjs.map +1 -1
  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 +20 -14
  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 +14 -13
  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 +3 -4
  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
@@ -3,8 +3,14 @@
3
3
 
4
4
  import type { EnumOutputShape } from '@mysten/bcs';
5
5
  import type {
6
- SerializedTransactionDataV2,
6
+ EndOfEpochTransactionKind as BcsEndOfEpochTransactionKindSchema,
7
+ TransactionKind as BcsTransactionKindSchema,
8
+ } from '../bcs/transactions.js';
9
+ import type {
7
10
  TransactionPlugin,
11
+ CallArg as BuilderCallArg,
12
+ Command as BuilderCommand,
13
+ TransactionData as BuilderTransactionData,
8
14
  Transaction as TransactionInstance,
9
15
  } from '../transactions/index.js';
10
16
  import type { Signer } from '../cryptography/keypair.js';
@@ -22,6 +28,9 @@ export type SuiClientRegistration<
22
28
 
23
29
  export type ClientWithExtensions<T, Base extends BaseClient = BaseClient> = Base & T;
24
30
 
31
+ type BcsTransactionKind = typeof BcsTransactionKindSchema.$inferType;
32
+ type BcsEndOfEpochTransactionKind = typeof BcsEndOfEpochTransactionKindSchema.$inferType;
33
+
25
34
  export namespace SuiClientTypes {
26
35
  export type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {});
27
36
 
@@ -44,6 +53,214 @@ export namespace SuiClientTypes {
44
53
  signal?: AbortSignal;
45
54
  }
46
55
 
56
+ export type Order = 'ascending' | 'descending';
57
+
58
+ /** Opaque resume position, valid only for the stream that produced it. */
59
+ export type StreamResumeToken = string;
60
+
61
+ /**
62
+ * Where a stream starts: at a checkpoint (inclusive), or after the frame that carried a resume
63
+ * token, so save a token only once its frame is processed.
64
+ */
65
+ export type StreamStart =
66
+ | { checkpoint: CheckpointNumber; resumeToken?: never }
67
+ | { resumeToken: StreamResumeToken; checkpoint?: never };
68
+
69
+ /** Where a finite stream stops: before this checkpoint (exclusive). */
70
+ export interface StreamEnd {
71
+ checkpoint: CheckpointNumber;
72
+ }
73
+
74
+ export interface StreamRetryOptions {
75
+ /**
76
+ * First retry delay in milliseconds; each further failure doubles it.
77
+ * @default 250
78
+ */
79
+ initialDelay?: number;
80
+ /**
81
+ * Cap on the retry delay in milliseconds.
82
+ * @default 30_000
83
+ */
84
+ maxDelay?: number;
85
+ /**
86
+ * Consecutive failures without progress before the stream throws. 0 disables retries.
87
+ * @default 10
88
+ */
89
+ maxAttempts?: number;
90
+ }
91
+
92
+ /**
93
+ * Why a failed request may succeed on retry.
94
+ * - `Unavailable`: the server could not be reached, the connection dropped, or a live feed ended.
95
+ * - `RateLimited`: the server or a proxy is limiting requests.
96
+ * - `ServerError`: any other failure that may clear on retry.
97
+ */
98
+ export type RetryReason = 'Unavailable' | 'RateLimited' | 'ServerError';
99
+
100
+ /** Connection state reported to `onStatus`, for diagnostics only. Use frame tokens to resume. */
101
+ export type StreamStatus =
102
+ /** An attempt is starting; `attempt` counts consecutive failures without progress. */
103
+ | { $kind: 'Connecting'; attempt: number }
104
+ /** This attempt received its first page or live frame, or its GraphQL subscription opened. */
105
+ | { $kind: 'Connected' }
106
+ /** Waiting `delay` ms before the next attempt after `error`. */
107
+ | {
108
+ $kind: 'Retrying';
109
+ attempt: number;
110
+ delay: number;
111
+ reason: RetryReason;
112
+ error: unknown;
113
+ };
114
+
115
+ /** Control frames to emit in addition to items. */
116
+ export interface StreamFrameOptions {
117
+ /** Emit a final Complete frame after a finite stream finishes. */
118
+ completion?: boolean;
119
+ /** Emit Progress frames carrying resumable positions that no item reported. */
120
+ progress?: boolean;
121
+ }
122
+
123
+ export interface StreamOptions<
124
+ Frames extends StreamFrameOptions = {},
125
+ > extends CoreClientMethodOptions {
126
+ /**
127
+ * Where to start: at a checkpoint, or after the frame that carried a resume token. Required
128
+ * for a finite ascending read.
129
+ */
130
+ start?: StreamStart;
131
+ /** Where a finite stream stops (exclusive). */
132
+ end?: StreamEnd;
133
+ /** Defaults to the resume token's order, else `'ascending'`. */
134
+ order?: Order;
135
+ /**
136
+ * Keep following new checkpoints after the history.
137
+ * @default true for an ascending stream without an `end`
138
+ */
139
+ follow?: boolean;
140
+ /**
141
+ * How a followed stream receives new data: a live subscription, or polling every
142
+ * `pollInterval`.
143
+ * @default 'subscribe'
144
+ */
145
+ delivery?: 'subscribe' | 'poll';
146
+ /**
147
+ * Milliseconds between polls, and between reads while waiting for the server to index.
148
+ * @default 1000
149
+ */
150
+ pollInterval?: number;
151
+ retry?: StreamRetryOptions;
152
+ /** Called synchronously with each status. Throwing ends the stream with that error. */
153
+ onStatus?: (status: StreamStatus) => void;
154
+ /** Control frames to emit alongside items. */
155
+ frames?: Frames;
156
+ }
157
+
158
+ /** Data to deliver with each streamed checkpoint. */
159
+ export interface StreamCheckpointInclude {
160
+ /**
161
+ * Deliver every transaction of the checkpoint, in execution order, with these fields. Each
162
+ * checkpoint is yielded once all of its transactions have been read.
163
+ */
164
+ transactions?: TransactionInclude;
165
+ }
166
+
167
+ export interface StreamCheckpointsOptions<
168
+ Include extends StreamCheckpointInclude = {},
169
+ Frames extends StreamFrameOptions = {},
170
+ > extends StreamOptions<Frames> {
171
+ include?: Include;
172
+ }
173
+
174
+ export interface StreamTransactionsOptions<
175
+ Include extends TransactionInclude = {},
176
+ Frames extends StreamFrameOptions = {},
177
+ > extends StreamOptions<Frames> {
178
+ filter?: TransactionFilter;
179
+ include?: Include;
180
+ }
181
+
182
+ export interface StreamEventsOptions<
183
+ Frames extends StreamFrameOptions = {},
184
+ > extends StreamOptions<Frames> {
185
+ filter?: EventFilter;
186
+ }
187
+
188
+ export interface StreamCheckpoint<Include extends StreamCheckpointInclude = {}> {
189
+ $kind: 'Checkpoint';
190
+ /** Includes `transactions` when `include.transactions` is set. */
191
+ checkpoint: Checkpoint &
192
+ (Include extends { transactions: infer TransactionFields extends TransactionInclude }
193
+ ? { transactions: TransactionResult<TransactionFields>[] }
194
+ : {});
195
+ resumeToken: StreamResumeToken;
196
+ }
197
+
198
+ export interface StreamTransaction<Include extends TransactionInclude = {}> {
199
+ $kind: 'Transaction';
200
+ transaction: TransactionResult<Include>;
201
+ resumeToken: StreamResumeToken;
202
+ }
203
+
204
+ export interface StreamEvent {
205
+ $kind: 'Event';
206
+ event: EventEntry;
207
+ resumeToken: StreamResumeToken;
208
+ }
209
+
210
+ /** A resumable position that no item reported, such as the end of an empty range. */
211
+ export interface StreamProgressFrame {
212
+ $kind: 'Progress';
213
+ resumeToken: StreamResumeToken;
214
+ }
215
+
216
+ /**
217
+ * Sent once after a finite stream finishes, even an empty one.
218
+ * - `checkpointBound`: reached `end`.
219
+ * - `indexedTip`: reached the indexed tip read when the stream started (`follow: false`).
220
+ * - `genesis`: a descending read reached checkpoint 0.
221
+ * - `retentionLimit`: a descending read reached the oldest checkpoint the server retains.
222
+ */
223
+ export interface StreamCompletionFrame {
224
+ $kind: 'Complete';
225
+ reason: 'checkpointBound' | 'indexedTip' | 'genesis' | 'retentionLimit';
226
+ /** Last delivered position, if there is one. */
227
+ resumeToken?: StreamResumeToken;
228
+ }
229
+
230
+ /**
231
+ * `T` when `Frames[Key]` may be true; includes non-literal booleans. Distributes over a union of
232
+ * option objects, so a frame that any member enables is included.
233
+ */
234
+ type EnabledFrame<
235
+ Frames extends StreamFrameOptions,
236
+ Key extends keyof StreamFrameOptions,
237
+ T,
238
+ > = Frames extends unknown
239
+ ? Key extends keyof Frames
240
+ ? true extends Frames[Key]
241
+ ? T
242
+ : never
243
+ : never
244
+ : never;
245
+
246
+ export type StreamResult<Item, Frames extends StreamFrameOptions = {}> =
247
+ | Item
248
+ | EnabledFrame<Frames, 'completion', StreamCompletionFrame>
249
+ | EnabledFrame<Frames, 'progress', StreamProgressFrame>;
250
+
251
+ export type StreamCheckpointFrame<
252
+ Include extends StreamCheckpointInclude = {},
253
+ Frames extends StreamFrameOptions = {},
254
+ > = StreamResult<StreamCheckpoint<Include>, Frames>;
255
+ export type StreamTransactionFrame<
256
+ Include extends TransactionInclude = {},
257
+ Frames extends StreamFrameOptions = {},
258
+ > = StreamResult<StreamTransaction<Include>, Frames>;
259
+ export type StreamEventFrame<Frames extends StreamFrameOptions = {}> = StreamResult<
260
+ StreamEvent,
261
+ Frames
262
+ >;
263
+
47
264
  /** Object methods */
48
265
  export interface TransportMethods {
49
266
  getObjects: <Include extends ObjectInclude = {}>(
@@ -53,8 +270,11 @@ export namespace SuiClientTypes {
53
270
  options: ListOwnedObjectsOptions<Include>,
54
271
  ) => Promise<ListOwnedObjectsResponse<Include>>;
55
272
  listCoins: (options: ListCoinsOptions) => Promise<ListCoinsResponse>;
56
- listDynamicFields: (options: ListDynamicFieldsOptions) => Promise<ListDynamicFieldsResponse>;
273
+ listDynamicFields: <Include extends DynamicFieldInclude = {}>(
274
+ options: ListDynamicFieldsOptions<Include>,
275
+ ) => Promise<ListDynamicFieldsResponse<Include>>;
57
276
  getDynamicField: (options: GetDynamicFieldOptions) => Promise<GetDynamicFieldResponse>;
277
+ getAddressAliases: (options: GetAddressAliasesOptions) => Promise<GetAddressAliasesResponse>;
58
278
  }
59
279
 
60
280
  export interface ObjectInclude {
@@ -81,7 +301,7 @@ export namespace SuiClientTypes {
81
301
  * Include the JSON representation of the object's Move struct content.
82
302
  *
83
303
  * **Warning:** The exact shape and field names of this data may vary between different
84
- * API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs,
304
+ * API implementations (gRPC or GraphQL). For consistent data across APIs,
85
305
  * use the `content` field and parse the BCS data directly.
86
306
  */
87
307
  json?: boolean;
@@ -129,10 +349,18 @@ export namespace SuiClientTypes {
129
349
  cursor?: string | null;
130
350
  }
131
351
 
132
- export interface ListDynamicFieldsOptions extends CoreClientMethodOptions {
352
+ export interface DynamicFieldInclude {
353
+ /** Include each field's `value`. */
354
+ value?: boolean;
355
+ }
356
+
357
+ export interface ListDynamicFieldsOptions<
358
+ Include extends DynamicFieldInclude = {},
359
+ > extends CoreClientMethodOptions {
133
360
  parentId: string;
134
361
  limit?: number;
135
362
  cursor?: string | null;
363
+ include?: Include & DynamicFieldInclude;
136
364
  }
137
365
 
138
366
  export interface GetDynamicFieldOptions extends CoreClientMethodOptions {
@@ -140,6 +368,28 @@ export namespace SuiClientTypes {
140
368
  name: DynamicFieldName;
141
369
  }
142
370
 
371
+ export interface GetAddressAliasesOptions extends CoreClientMethodOptions {
372
+ address: string;
373
+ }
374
+
375
+ /**
376
+ * The addresses whose signatures are accepted for `address`. An address that never enabled
377
+ * aliases is only its own alias.
378
+ */
379
+ export interface AddressAliases {
380
+ address: string;
381
+ /** Whether `address` has enabled aliases, so its alias set is an object on chain. */
382
+ enabled: boolean;
383
+ /** The current alias set; `[address]` when aliases are not enabled. */
384
+ aliases: string[];
385
+ /** The ID of the alias set object, derived from `address` whether or not it exists. */
386
+ objectId: string;
387
+ }
388
+
389
+ export interface GetAddressAliasesResponse {
390
+ addressAliases: AddressAliases;
391
+ }
392
+
143
393
  export interface GetObjectsResponse<out Include extends ObjectInclude = {}> {
144
394
  objects: (Object<Include> | Error)[];
145
395
  }
@@ -175,7 +425,7 @@ export namespace SuiClientTypes {
175
425
  * The JSON representation of the object's Move struct content.
176
426
  *
177
427
  * **Warning:** The exact shape and field names of this data may vary between different
178
- * API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs use
428
+ * API implementations (gRPC or GraphQL). For consistent data across APIs use
179
429
  * the `content` field and parse the BCS data directly.
180
430
  */
181
431
  json: Include extends { json: true } ? Record<string, unknown> | null : undefined;
@@ -205,24 +455,35 @@ export namespace SuiClientTypes {
205
455
  balance: string;
206
456
  }
207
457
 
208
- export type DynamicFieldEntry = {
458
+ export type DynamicFieldEntry<Include extends DynamicFieldInclude = {}> = {
459
+ /** ID of the `0x2::dynamic_field::Field` object. */
209
460
  fieldId: string;
461
+ /** Type of the `0x2::dynamic_field::Field` object. */
210
462
  type: string;
211
463
  name: DynamicFieldName;
464
+ /**
465
+ * Type of the value. For dynamic object fields, `listDynamicFields` reports the child object's
466
+ * type and `getDynamicField` reports `0x2::object::ID`.
467
+ */
212
468
  valueType: string;
469
+ /**
470
+ * The field's value; `value.type` always equals `valueType`. For dynamic object fields,
471
+ * `listDynamicFields` returns the child object's BCS-encoded content and `getDynamicField`
472
+ * the child's ID.
473
+ */
474
+ value: Include extends { value: true } ? DynamicFieldValue : undefined;
213
475
  } & ({ $kind: 'DynamicField'; childId?: never } | { $kind: 'DynamicObject'; childId: string });
214
476
 
215
- export type DynamicField = DynamicFieldEntry & {
216
- value: DynamicFieldValue;
477
+ export type DynamicField = DynamicFieldEntry<{ value: true }> & {
217
478
  version: string;
218
479
  digest: string;
219
480
  previousTransaction: string | null;
220
481
  };
221
482
 
222
- export interface ListDynamicFieldsResponse {
483
+ export interface ListDynamicFieldsResponse<out Include extends DynamicFieldInclude = {}> {
223
484
  hasNextPage: boolean;
224
485
  cursor: string | null;
225
- dynamicFields: DynamicFieldEntry[];
486
+ dynamicFields: DynamicFieldEntry<Include>[];
226
487
  }
227
488
 
228
489
  export interface GetDynamicFieldResponse {
@@ -324,6 +585,8 @@ export namespace SuiClientTypes {
324
585
 
325
586
  export interface Transaction<out Include extends TransactionInclude = {}> {
326
587
  digest: string;
588
+ /** The address that sent the transaction: `0x0` for system transactions. */
589
+ sender: string;
327
590
  signatures: string[];
328
591
  epoch: string | null;
329
592
  /**
@@ -395,8 +658,8 @@ export namespace SuiClientTypes {
395
658
  /**
396
659
  * Include events emitted by the transaction.
397
660
  *
398
- * On the GraphQL transport, at most the first 50 events of a transaction are returned;
399
- * gRPC and JSON-RPC return the full event list.
661
+ * On the GraphQL transport, `executeTransaction` and `simulateTransaction` return at most
662
+ * the first 50 events of a transaction; gRPC returns the full event list.
400
663
  */
401
664
  events?: boolean;
402
665
  /** Include a map of object IDs to their types for all changed objects. */
@@ -427,7 +690,82 @@ export namespace SuiClientTypes {
427
690
  amount: string;
428
691
  }
429
692
 
430
- export interface TransactionData extends SerializedTransactionDataV2 {}
693
+ /** Ledger transaction data. Narrow `kind.$kind` to read the transaction's payload. */
694
+ export interface TransactionData {
695
+ version: 2;
696
+ sender: string;
697
+ gasData: GasData;
698
+ expiration: TransactionExpiration | null;
699
+ /**
700
+ * The inputs of a `ProgrammableTransaction` or `ProgrammableSystemTransaction` kind; empty for
701
+ * every other kind.
702
+ */
703
+ inputs: TransactionInput[];
704
+ /**
705
+ * The commands of a `ProgrammableTransaction` or `ProgrammableSystemTransaction` kind; empty
706
+ * for every other kind.
707
+ */
708
+ commands: TransactionCommand[];
709
+ kind: TransactionKind;
710
+ }
711
+
712
+ export interface GasData {
713
+ budget: string;
714
+ price: string;
715
+ owner: string;
716
+ payment: { objectId: string; version: string; digest: string }[];
717
+ }
718
+
719
+ export type TransactionExpiration = NonNullable<BuilderTransactionData['expiration']>;
720
+ /** A kind this SDK cannot fully map, inputs and commands included, is `Unknown`. */
721
+ export type TransactionKind = EnumOutputShape<{
722
+ [Kind in BcsTransactionKind['$kind'] | 'Unknown']: Kind extends 'Unknown'
723
+ ? true
724
+ : Kind extends 'ProgrammableTransaction' | 'ProgrammableSystemTransaction'
725
+ ? ProgrammableTransaction
726
+ : Kind extends 'EndOfEpochTransaction'
727
+ ? EndOfEpochTransactionKind[]
728
+ : Kind extends 'Genesis'
729
+ ? { objects: GenesisObject[] }
730
+ : NonNullable<BcsTransactionKind[Exclude<Kind, 'Unknown'>]>;
731
+ }>;
732
+ export interface ProgrammableTransaction {
733
+ inputs: TransactionInput[];
734
+ commands: TransactionCommand[];
735
+ }
736
+ /** A resolved input; transactions on chain never contain unresolved inputs. */
737
+ export type TransactionInput = Exclude<
738
+ BuilderCallArg,
739
+ { $kind: 'UnresolvedPure' | 'UnresolvedObject' }
740
+ >;
741
+ /** A command; transactions on chain never contain intents. */
742
+ export type TransactionCommand = Exclude<BuilderCommand, { $kind: '$Intent' }>;
743
+ export type ActiveJwk = NonNullable<
744
+ TransactionKind['AuthenticatorStateUpdate']
745
+ >['newActiveJwks'][number];
746
+ /** An end-of-epoch operation; ones this SDK version does not recognize are `Unknown`. */
747
+ export type EndOfEpochTransactionKind = EnumOutputShape<{
748
+ [Kind in BcsEndOfEpochTransactionKind['$kind'] | 'Unknown']: Kind extends 'Unknown'
749
+ ? true
750
+ : Kind extends 'BridgeStateCreate'
751
+ ? BridgeStateCreate
752
+ : NonNullable<BcsEndOfEpochTransactionKind[Exclude<Kind, 'Unknown'>]>;
753
+ }>;
754
+ /** An object created by the genesis transaction. */
755
+ export interface GenesisObject {
756
+ objectId: string;
757
+ version: string;
758
+ owner: ObjectOwner;
759
+ /** The object's Move type, or `package` for a package. */
760
+ type: string;
761
+ }
762
+ export interface BridgeStateCreate {
763
+ /**
764
+ * The chain identifier the bridge was created for: the first 4 bytes of the genesis
765
+ * checkpoint digest, hex encoded.
766
+ */
767
+ chainId: string;
768
+ }
431
769
 
432
770
  export interface GetTransactionOptions<
433
771
  Include extends TransactionInclude = {},
@@ -490,6 +828,14 @@ export namespace SuiClientTypes {
490
828
  * Defaults to `true` (checks enabled).
491
829
  */
492
830
  checksEnabled?: boolean;
831
+ /**
832
+ * Whether the server selects the sender's real gas payment during simulation. When
833
+ * disabled, a transaction without gas coins may be simulated with a mocked gas coin
834
+ * (reported as `gasPaymentMocked`). Ignored when `checksEnabled` is `false`.
835
+ *
836
+ * @default `true` when the gas payment is set to `[]`, otherwise `false`
837
+ */
838
+ doGasSelection?: boolean;
493
839
  }
494
840
 
495
841
  /** Query methods */
@@ -498,17 +844,33 @@ export namespace SuiClientTypes {
498
844
  options: ListTransactionsOptions<Include>,
499
845
  ) => Promise<ListTransactionsResponse<Include>>;
500
846
  listEvents: (options: ListEventsOptions) => Promise<ListEventsResponse>;
847
+ listCheckpoints: (options: ListCheckpointsOptions) => Promise<ListCheckpointsResponse>;
501
848
  }
502
849
 
503
850
  /**
504
- * A filter matching transactions. Exactly one predicate must be specified.
851
+ * A filter matching transactions. Every specified predicate must match (predicates are
852
+ * ANDed), and an empty filter matches every transaction.
505
853
  *
506
- * All predicates are supported identically by every transport.
854
+ * At most one of `affectedAddress`, `affectedObject`, or `function` may be specified;
855
+ * `sender` can be combined with any of them.
507
856
  */
508
- export type TransactionFilter =
857
+ export type TransactionFilter = {
858
+ /** Match transactions sent by this address. */
859
+ sender?: string;
860
+ } & (
509
861
  | {
510
- /** Match transactions sent by this address. */
511
- sender: string;
862
+ /**
863
+ * Match transactions this address sent or paid gas for, or that changed objects it owned
864
+ * before or owns after the transaction, or its address balance.
865
+ */
866
+ affectedAddress: string;
867
+ affectedObject?: never;
868
+ function?: never;
869
+ }
870
+ | {
871
+ /** Match transactions whose effects include a change to this object. */
872
+ affectedObject: string;
873
+ affectedAddress?: never;
512
874
  function?: never;
513
875
  }
514
876
  | {
@@ -518,83 +880,107 @@ export namespace SuiClientTypes {
518
880
  * `package::module::function`.
519
881
  */
520
882
  function: string;
521
- sender?: never;
522
- };
883
+ affectedAddress?: never;
884
+ affectedObject?: never;
885
+ }
886
+ | {
887
+ affectedAddress?: never;
888
+ affectedObject?: never;
889
+ function?: never;
890
+ }
891
+ );
523
892
 
524
893
  /**
525
- * A filter matching events. Exactly one predicate must be specified.
894
+ * A filter matching events. Every specified predicate must match (predicates are ANDed),
895
+ * and an empty filter matches every event.
526
896
  *
527
- * All predicates are supported by every transport, with one caveat: on the deprecated
528
- * JSON-RPC transport, an `eventType` naming a generic type must include type arguments —
529
- * a bare generic name (e.g. `0xpkg::mod::Event` for events of type `0xpkg::mod::Event<T>`)
530
- * matches any instantiation on gRPC and GraphQL, but matches nothing on JSON-RPC, which
531
- * compares the full type for exact equality.
897
+ * `emitModule` and `eventType` cannot be combined; `sender` can be combined with either.
532
898
  */
533
- export type EventFilter =
534
- | {
535
- /** Match events emitted by transactions sent by this address. */
536
- sender: string;
537
- emitModule?: never;
538
- eventType?: never;
539
- }
899
+ export type EventFilter = {
900
+ /** Match events emitted by transactions sent by this address. */
901
+ sender?: string;
902
+ } & (
540
903
  | {
541
- /** Match events emitted by a module, specified as `package::module`. */
904
+ /**
905
+ * Match events emitted by a module, specified as `package` (any module in the
906
+ * package) or `package::module`.
907
+ */
542
908
  emitModule: string;
543
- sender?: never;
544
909
  eventType?: never;
545
910
  }
546
911
  | {
547
912
  /**
548
- * Match events by type: either every event whose type is defined in a
549
- * module (`package::module`), or events with a fully qualified type
550
- * name (`package::module::Name` or `package::module::Name<T1, T2>`).
913
+ * Match events by type: every event whose type is defined in a package (`package`)
914
+ * or module (`package::module`), or events with a fully qualified type name
915
+ * (`package::module::Name` or `package::module::Name<T1, T2>`).
551
916
  *
552
917
  * A bare generic name (`package::module::Name` without type arguments) matches
553
- * any instantiation on gRPC and GraphQL, but matches nothing on the deprecated
554
- * JSON-RPC transport, which compares the full type for exact equality.
918
+ * any instantiation, while a name with type arguments only matches that exact
919
+ * instantiation.
555
920
  */
556
921
  eventType: string;
557
- sender?: never;
558
922
  emitModule?: never;
559
- };
923
+ }
924
+ | {
925
+ emitModule?: never;
926
+ eventType?: never;
927
+ }
928
+ );
560
929
 
561
- export interface ListTransactionsOptions<
562
- Include extends TransactionInclude = {},
563
- > extends CoreClientMethodOptions {
564
- filter?: TransactionFilter;
930
+ /** A checkpoint sequence number. */
931
+ export type CheckpointNumber = string | number | bigint;
932
+
933
+ /** Pagination and range options shared by the ledger query methods. */
934
+ export interface LedgerQueryOptions extends CoreClientMethodOptions {
565
935
  /**
566
936
  * Maximum number of items to return. Defaults to 50.
567
937
  *
568
938
  * Servers cap page sizes (50 by default): values above the server's cap cause the
569
- * GraphQL and JSON-RPC transports to throw, while gRPC servers silently truncate
570
- * the page to their configured maximum.
939
+ * GraphQL transport to throw, while gRPC servers silently truncate the page to their
940
+ * configured maximum.
571
941
  */
572
942
  limit?: number;
573
943
  /**
574
- * Return items strictly after this cursor in ledger order (usually the `endCursor` of
575
- * an ascending page, or the `startCursor` of a descending page to poll for new items).
576
- * Implies `order: 'ascending'`, and cannot be combined with `before`.
944
+ * Return items strictly after this cursor in ledger order, regardless of `order`.
945
+ * Usually the `endCursor` of an ascending page, or the `startCursor` of a descending
946
+ * page to poll for new items. Can be combined with `before` to read a window.
947
+ *
948
+ * Cursors are only valid for the query that produced them: pass them back with the same
949
+ * filter and checkpoint range.
577
950
  */
578
951
  after?: string | null;
579
952
  /**
580
- * Return items strictly before this cursor in ledger order (usually the `endCursor` of
581
- * a descending page). Implies `order: 'descending'`, and cannot be combined with
582
- * `after`.
953
+ * Return items strictly before this cursor in ledger order, regardless of `order`.
954
+ * Usually the `endCursor` of a descending page. Can be combined with `after` to read a
955
+ * window.
583
956
  */
584
957
  before?: string | null;
585
- /** Order of returned results. Defaults to `ascending` (oldest first). */
586
- order?: 'ascending' | 'descending';
587
- include?: Include & TransactionInclude;
958
+ /**
959
+ * Order of returned results. Defaults to `descending` when only `before` is provided,
960
+ * and `ascending` (oldest first) otherwise.
961
+ */
962
+ order?: Order;
963
+ /**
964
+ * Only return items from checkpoints at or after this sequence number (inclusive).
965
+ * Intersects with `after`/`before`.
966
+ */
967
+ startCheckpoint?: CheckpointNumber;
968
+ /**
969
+ * Only return items from checkpoints before this sequence number (exclusive). Must not
970
+ * be less than `startCheckpoint`. Intersects with `after`/`before`.
971
+ */
972
+ endCheckpoint?: CheckpointNumber;
588
973
  }
589
974
 
590
- export interface ListTransactionsResponse<out Include extends TransactionInclude = {}> {
591
- transactions: TransactionResult<Include>[];
975
+ /** Pagination fields shared by `listTransactions`, `listEvents` and `listCheckpoints`. */
976
+ export interface LedgerQueryResponse {
592
977
  /**
593
978
  * Whether more items may be available after this page.
594
979
  *
595
- * gRPC servers bound how much of the ledger a single request scans, so a scan-limited
596
- * query can return fewer items than `limit` (even none) with `hasNextPage: true`;
597
- * continuing from `endCursor` always makes progress through the scanned range.
980
+ * Servers can bound how much of the ledger a single request scans, on gRPC and GraphQL
981
+ * alike, so a query can return fewer items than `limit` (even none) with
982
+ * `hasNextPage: true`; continuing from `endCursor` always makes progress through the
983
+ * scanned range.
598
984
  */
599
985
  hasNextPage: boolean;
600
986
  /**
@@ -603,73 +989,62 @@ export namespace SuiClientTypes {
603
989
  */
604
990
  startCursor: string | null;
605
991
  /**
606
- * Cursor at the last returned item. Continue the query by passing it as `after`
607
- * (ascending) or `before` (descending).
992
+ * Position to continue from: the last returned item on a final page, otherwise the
993
+ * server's scan position, which can be past the last item or set on an empty page.
994
+ * Continue the query by passing it as `after` (ascending) or `before` (descending).
995
+ * When paging a window (`after` + `before`),
996
+ * keep the fixed bound and replace the moving one with `endCursor`.
608
997
  */
609
998
  endCursor: string | null;
610
999
  }
611
1000
 
612
- export interface ListEventsOptions extends CoreClientMethodOptions {
1001
+ export interface ListTransactionsOptions<
1002
+ Include extends TransactionInclude = {},
1003
+ > extends LedgerQueryOptions {
1004
+ filter?: TransactionFilter;
1005
+ include?: Include & TransactionInclude;
1006
+ }
1007
+
1008
+ export interface ListTransactionsResponse<
1009
+ out Include extends TransactionInclude = {},
1010
+ > extends LedgerQueryResponse {
1011
+ transactions: TransactionResult<Include>[];
1012
+ }
1013
+
1014
+ export interface ListEventsOptions extends LedgerQueryOptions {
613
1015
  filter?: EventFilter;
614
- /**
615
- * Maximum number of items to return. Defaults to 50.
616
- *
617
- * Servers cap page sizes (50 by default): values above the server's cap cause the
618
- * GraphQL and JSON-RPC transports to throw, while gRPC servers silently truncate
619
- * the page to their configured maximum.
620
- */
621
- limit?: number;
622
- /**
623
- * Return items strictly after this cursor in ledger order (usually the `endCursor` of
624
- * an ascending page, or the `startCursor` of a descending page to poll for new items).
625
- * Implies `order: 'ascending'`, and cannot be combined with `before`.
626
- */
627
- after?: string | null;
628
- /**
629
- * Return items strictly before this cursor in ledger order (usually the `endCursor` of
630
- * a descending page). Implies `order: 'descending'`, and cannot be combined with
631
- * `after`.
632
- */
633
- before?: string | null;
634
- /** Order of returned results. Defaults to `ascending` (oldest first). */
635
- order?: 'ascending' | 'descending';
636
1016
  }
637
1017
 
638
1018
  /** An event returned from a query, along with its position in the ledger. */
639
1019
  export interface EventEntry extends Event {
640
- /**
641
- * The sequence number of the checkpoint containing the emitting transaction.
642
- *
643
- * `null` on the JSON-RPC transport, which does not expose checkpoint
644
- * information for queried events.
645
- */
646
- checkpoint: string | null;
1020
+ /** The sequence number of the checkpoint containing the emitting transaction. */
1021
+ checkpoint: string;
647
1022
  /** The digest of the transaction that emitted this event. */
648
1023
  transactionDigest: string;
649
1024
  /** The index of this event within its transaction's event list. */
650
1025
  eventIndex: number;
651
1026
  }
652
1027
 
653
- export interface ListEventsResponse {
1028
+ export interface ListEventsResponse extends LedgerQueryResponse {
654
1029
  events: EventEntry[];
655
- /**
656
- * Whether more items may be available after this page.
657
- *
658
- * gRPC servers bound how much of the ledger a single request scans, so a scan-limited
659
- * query can return fewer items than `limit` (even none) with `hasNextPage: true`;
660
- * continuing from `endCursor` always makes progress through the scanned range.
661
- */
662
- hasNextPage: boolean;
663
- /**
664
- * Cursor at the first returned item. After a descending read of the most recent
665
- * items, pass as `after` to poll for items added since.
666
- */
667
- startCursor: string | null;
668
- /**
669
- * Cursor at the last returned item. Continue the query by passing it as `after`
670
- * (ascending) or `before` (descending).
671
- */
672
- endCursor: string | null;
1030
+ }
1031
+
1032
+ export interface ListCheckpointsOptions extends LedgerQueryOptions {}
1033
+
1034
+ /** A checkpoint summary. */
1035
+ export interface Checkpoint {
1036
+ /** The checkpoint's sequence number. */
1037
+ sequenceNumber: string;
1038
+ /** The digest of the checkpoint summary. */
1039
+ digest: string;
1040
+ /** The epoch the checkpoint belongs to. */
1041
+ epoch: string;
1042
+ /** The checkpoint's timestamp, in milliseconds since the Unix epoch. */
1043
+ timestampMs: number;
1044
+ }
1045
+
1046
+ export interface ListCheckpointsResponse extends LedgerQueryResponse {
1047
+ checkpoints: Checkpoint[];
673
1048
  }
674
1049
 
675
1050
  export interface GetReferenceGasPriceOptions extends CoreClientMethodOptions {}
@@ -763,6 +1138,43 @@ export namespace SuiClientTypes {
763
1138
  stakeSubsidyDecreaseRate: number;
764
1139
  }
765
1140
 
1141
+ /** Signature verification methods */
1142
+ export interface VerifySignatureBaseOptions extends CoreClientMethodOptions {
1143
+ /** The serialized signature (flag, signature and public key), Base64. */
1144
+ signature: string;
1145
+ /** The account the signature must be valid for. */
1146
+ address: string;
1147
+ /**
1148
+ * Accept a signature from any of `address`'s current address aliases, not only from `address`
1149
+ * itself. Defaults to `true`.
1150
+ */
1151
+ checkAddressAliases?: boolean;
1152
+ }
1153
+
1154
+ export type VerifySignatureOptions = VerifySignatureBaseOptions &
1155
+ (
1156
+ | {
1157
+ /** The signed personal message; a string is UTF-8 encoded. */
1158
+ personalMessage: Uint8Array | string;
1159
+ transaction?: never;
1160
+ }
1161
+ | {
1162
+ /** The signed BCS `TransactionData` bytes. */
1163
+ transaction: Uint8Array;
1164
+ personalMessage?: never;
1165
+ }
1166
+ );
1167
+
1168
+ export interface VerifySignatureResponse {
1169
+ valid: boolean;
1170
+ /** Why verification failed, for logs. The text differs by transport, so don't match on it. */
1171
+ reason?: string;
1172
+ }
1173
+
1174
+ export interface TransportMethods {
1175
+ verifySignature: (options: VerifySignatureOptions) => Promise<VerifySignatureResponse>;
1176
+ }
1177
+
766
1178
  /** ZkLogin methods */
767
1179
  export interface VerifyZkLoginSignatureOptions extends CoreClientMethodOptions {
768
1180
  bytes: string;
@@ -777,6 +1189,10 @@ export namespace SuiClientTypes {
777
1189
  }
778
1190
 
779
1191
  export interface TransportMethods {
1192
+ /**
1193
+ * @deprecated Use `verifySignature`. This method accepts signatures from the address's
1194
+ * aliases, like `verifySignature` does by default.
1195
+ */
780
1196
  verifyZkLoginSignature: (
781
1197
  options: VerifyZkLoginSignatureOptions,
782
1198
  ) => Promise<ZkLoginVerifyResponse>;
@@ -1126,7 +1542,7 @@ export namespace SuiClientTypes {
1126
1542
  * The JSON representation of the event's Move struct data.
1127
1543
  *
1128
1544
  * **Warning:** The exact shape and field names of this data may vary between different
1129
- * API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs use
1545
+ * API implementations (gRPC or GraphQL). For consistent data across APIs use
1130
1546
  * the `bcs` field and parse the BCS data directly.
1131
1547
  */
1132
1548
  json: Record<string, unknown> | null;
@@ -1141,7 +1557,6 @@ export namespace SuiClientTypes {
1141
1557
  export interface MoveLocation {
1142
1558
  package?: string;
1143
1559
  module?: string;
1144
- function?: number;
1145
1560
  functionName?: string;
1146
1561
  instruction?: number;
1147
1562
  }