@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,57 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- const CODE_TO_ERROR_TYPE: Record<number, string> = {
5
- '-32700': 'ParseError',
6
- '-32701': 'OversizedRequest',
7
- '-32702': 'OversizedResponse',
8
- '-32600': 'InvalidRequest',
9
- '-32601': 'MethodNotFound',
10
- '-32602': 'InvalidParams',
11
- '-32603': 'InternalError',
12
- '-32604': 'ServerBusy',
13
- '-32000': 'CallExecutionFailed',
14
- '-32001': 'UnknownError',
15
- '-32003': 'SubscriptionClosed',
16
- '-32004': 'SubscriptionClosedWithError',
17
- '-32005': 'BatchesNotSupported',
18
- '-32006': 'TooManySubscriptions',
19
- '-32050': 'TransientError',
20
- '-32002': 'TransactionExecutionClientError',
21
- };
22
-
23
- /**
24
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
25
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
26
- */
27
- export class SuiHTTPTransportError extends Error {}
28
-
29
- /**
30
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
31
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
32
- */
33
- export class JsonRpcError extends SuiHTTPTransportError {
34
- code: number;
35
- type: string;
36
-
37
- constructor(message: string, code: number) {
38
- super(message);
39
- this.code = code;
40
- this.type = CODE_TO_ERROR_TYPE[code] ?? 'ServerError';
41
- }
42
- }
43
-
44
- /**
45
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
46
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
47
- */
48
- export class SuiHTTPStatusError extends SuiHTTPTransportError {
49
- status: number;
50
- statusText: string;
51
-
52
- constructor(message: string, status: number, statusText: string) {
53
- super(message);
54
- this.status = status;
55
- this.statusText = statusText;
56
- }
57
- }
@@ -1,118 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import { PACKAGE_VERSION } from '../version.js';
5
- import { JsonRpcError, SuiHTTPStatusError } from './errors.js';
6
-
7
- /**
8
- * An object defining headers to be passed to the RPC server
9
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
10
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
11
- */
12
- export type HttpHeaders = { [header: string]: string };
13
-
14
- /**
15
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
16
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
17
- */
18
- export interface JsonRpcHTTPTransportOptions {
19
- fetch?: typeof fetch;
20
- url: string;
21
- rpc?: {
22
- headers?: HttpHeaders;
23
- url?: string;
24
- };
25
- }
26
-
27
- /**
28
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
29
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
30
- */
31
- export interface JsonRpcTransportRequestOptions {
32
- method: string;
33
- params: unknown[];
34
- signal?: AbortSignal;
35
- }
36
-
37
- /**
38
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
39
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
40
- */
41
- export interface JsonRpcTransport {
42
- request<T = unknown>(input: JsonRpcTransportRequestOptions): Promise<T>;
43
- }
44
-
45
- /**
46
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
47
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
48
- */
49
- export class JsonRpcHTTPTransport implements JsonRpcTransport {
50
- #requestId = 0;
51
- #options: JsonRpcHTTPTransportOptions;
52
-
53
- /**
54
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
55
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
56
- */
57
- constructor(options: JsonRpcHTTPTransportOptions) {
58
- this.#options = options;
59
- }
60
-
61
- /**
62
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
63
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
64
- */
65
- fetch(input: RequestInfo, init?: RequestInit): Promise<Response> {
66
- const fetchFn = this.#options.fetch ?? fetch;
67
-
68
- if (!fetchFn) {
69
- throw new Error(
70
- 'The current environment does not support fetch, you can provide a fetch implementation in the options for SuiHTTPTransport.',
71
- );
72
- }
73
-
74
- return fetchFn(input, init);
75
- }
76
-
77
- /**
78
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
79
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
80
- */
81
- async request<T>(input: JsonRpcTransportRequestOptions): Promise<T> {
82
- this.#requestId += 1;
83
-
84
- const res = await this.fetch(this.#options.rpc?.url ?? this.#options.url, {
85
- method: 'POST',
86
- signal: input.signal,
87
- headers: {
88
- 'Content-Type': 'application/json',
89
- 'Client-Sdk-Type': 'typescript',
90
- 'Client-Sdk-Version': PACKAGE_VERSION,
91
- 'Client-Request-Method': input.method,
92
- ...this.#options.rpc?.headers,
93
- },
94
- body: JSON.stringify({
95
- jsonrpc: '2.0',
96
- id: this.#requestId,
97
- method: input.method,
98
- params: input.params,
99
- }),
100
- });
101
-
102
- if (!res.ok) {
103
- throw new SuiHTTPStatusError(
104
- `Unexpected status code: ${res.status}`,
105
- res.status,
106
- res.statusText,
107
- );
108
- }
109
-
110
- const data = await res.json();
111
-
112
- if ('error' in data && data.error != null) {
113
- throw new JsonRpcError(data.error.message, data.error.code);
114
- }
115
-
116
- return data.result;
117
- }
118
- }
@@ -1,21 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /**
5
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
6
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
7
- */
8
- export function getJsonRpcFullnodeUrl(network: 'mainnet' | 'testnet' | 'devnet' | 'localnet') {
9
- switch (network) {
10
- case 'mainnet':
11
- return 'https://fullnode.mainnet.sui.io:443';
12
- case 'testnet':
13
- return 'https://fullnode.testnet.sui.io:443';
14
- case 'devnet':
15
- return 'https://fullnode.devnet.sui.io:443';
16
- case 'localnet':
17
- return 'http://127.0.0.1:9000';
18
- default:
19
- throw new Error(`Unknown network: ${network}`);
20
- }
21
- }
@@ -1,190 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type {
5
- Checkpoint,
6
- DynamicFieldInfo,
7
- SuiCallArg,
8
- SuiMoveNormalizedModule,
9
- SuiParsedData,
10
- SuiTransaction,
11
- SuiValidatorSummary,
12
- } from './generated.js';
13
-
14
- /**
15
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
16
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
17
- */
18
- export type ResolvedNameServiceNames = {
19
- data: string[];
20
- hasNextPage: boolean;
21
- nextCursor: string | null;
22
- };
23
-
24
- /**
25
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
26
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
27
- */
28
- export type EpochInfo = {
29
- epoch: string;
30
- validators: SuiValidatorSummary[];
31
- epochTotalTransactions: string;
32
- firstCheckpointId: string;
33
- epochStartTimestamp: string;
34
- endOfEpochInfo: EndOfEpochInfo | null;
35
- referenceGasPrice: number | null;
36
- };
37
-
38
- /**
39
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
40
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
41
- */
42
- export type EpochMetrics = {
43
- epoch: string;
44
- epochTotalTransactions: string;
45
- firstCheckpointId: string;
46
- epochStartTimestamp: string;
47
- endOfEpochInfo: EndOfEpochInfo | null;
48
- };
49
-
50
- /**
51
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
52
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
53
- */
54
- export type EpochPage = {
55
- data: EpochInfo[];
56
- nextCursor: string | null;
57
- hasNextPage: boolean;
58
- };
59
-
60
- /**
61
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
62
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
63
- */
64
- export type EpochMetricsPage = {
65
- data: EpochMetrics[];
66
- nextCursor: string | null;
67
- hasNextPage: boolean;
68
- };
69
-
70
- /**
71
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
72
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
73
- */
74
- export type EndOfEpochInfo = {
75
- lastCheckpointId: string;
76
- epochEndTimestamp: string;
77
- protocolVersion: string;
78
- referenceGasPrice: string;
79
- totalStake: string;
80
- storageFundReinvestment: string;
81
- storageCharge: string;
82
- storageRebate: string;
83
- storageFundBalance: string;
84
- stakeSubsidyAmount: string;
85
- totalGasFees: string;
86
- totalStakeRewardsDistributed: string;
87
- leftoverStorageFundInflow: string;
88
- };
89
-
90
- /**
91
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
92
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
93
- */
94
- export type CheckpointPage = {
95
- data: Checkpoint[];
96
- nextCursor: string | null;
97
- hasNextPage: boolean;
98
- };
99
-
100
- /**
101
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
102
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
103
- */
104
- export type NetworkMetrics = {
105
- currentTps: number;
106
- tps30Days: number;
107
- currentCheckpoint: string;
108
- currentEpoch: string;
109
- totalAddresses: string;
110
- totalObjects: string;
111
- totalPackages: string;
112
- };
113
-
114
- /**
115
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
116
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
117
- */
118
- export type AddressMetrics = {
119
- checkpoint: number;
120
- epoch: number;
121
- timestampMs: number;
122
- cumulativeAddresses: number;
123
- cumulativeActiveAddresses: number;
124
- dailyActiveAddresses: number;
125
- };
126
-
127
- /**
128
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
129
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
130
- */
131
- export type AllEpochsAddressMetrics = AddressMetrics[];
132
-
133
- /**
134
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
135
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
136
- */
137
- export type MoveCallMetrics = {
138
- rank3Days: MoveCallMetric[];
139
- rank7Days: MoveCallMetric[];
140
- rank30Days: MoveCallMetric[];
141
- };
142
-
143
- /**
144
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
145
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
146
- */
147
- export type MoveCallMetric = [
148
- {
149
- module: string;
150
- package: string;
151
- function: string;
152
- },
153
- string,
154
- ];
155
-
156
- /**
157
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
158
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
159
- */
160
- export type DynamicFieldPage = {
161
- data: DynamicFieldInfo[];
162
- nextCursor: string | null;
163
- hasNextPage: boolean;
164
- };
165
-
166
- /**
167
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
168
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
169
- */
170
- export type SuiMoveNormalizedModules = Record<string, SuiMoveNormalizedModule>;
171
-
172
- /**
173
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
174
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
175
- */
176
- export type SuiMoveObject = Extract<SuiParsedData, { dataType: 'moveObject' }>;
177
- /**
178
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
179
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
180
- */
181
- export type SuiMovePackage = Extract<SuiParsedData, { dataType: 'package' }>;
182
-
183
- /**
184
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
185
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
186
- */
187
- export type ProgrammableTransaction = {
188
- transactions: SuiTransaction[];
189
- inputs: SuiCallArg[];
190
- };
@@ -1,35 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { SuiObjectChange } from './generated.js';
5
-
6
- /**
7
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
8
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
9
- */
10
- export type SuiObjectChangePublished = Extract<SuiObjectChange, { type: 'published' }>;
11
- /**
12
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
13
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
14
- */
15
- export type SuiObjectChangeTransferred = Extract<SuiObjectChange, { type: 'transferred' }>;
16
- /**
17
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
18
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
19
- */
20
- export type SuiObjectChangeMutated = Extract<SuiObjectChange, { type: 'mutated' }>;
21
- /**
22
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
23
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
24
- */
25
- export type SuiObjectChangeDeleted = Extract<SuiObjectChange, { type: 'deleted' }>;
26
- /**
27
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
28
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
29
- */
30
- export type SuiObjectChangeWrapped = Extract<SuiObjectChange, { type: 'wrapped' }>;
31
- /**
32
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
33
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
34
- */
35
- export type SuiObjectChangeCreated = Extract<SuiObjectChange, { type: 'created' }>;
@@ -1,14 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /**
5
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
6
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
7
- */
8
- export type CoinBalance = {
9
- coinType: string;
10
- coinObjectCount: number;
11
- totalBalance: string;
12
- lockedBalance: Record<string, string>;
13
- fundsInAddressBalance?: string;
14
- };
@@ -1,8 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /**
5
- * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
6
- * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
7
- */
8
- export type Order = 'ascending' | 'descending';