@mysten/sui 2.20.3 → 2.20.4

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 (76) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/bcs/bcs.d.mts +6 -6
  3. package/dist/bcs/index.d.mts +20 -20
  4. package/dist/client/core.d.mts.map +1 -1
  5. package/dist/client/core.mjs +4 -1
  6. package/dist/client/core.mjs.map +1 -1
  7. package/dist/client/mvr.d.mts.map +1 -1
  8. package/dist/client/mvr.mjs +29 -7
  9. package/dist/client/mvr.mjs.map +1 -1
  10. package/dist/cryptography/signature.d.mts +8 -8
  11. package/dist/grpc/client.d.mts.map +1 -1
  12. package/dist/grpc/client.mjs +1 -1
  13. package/dist/grpc/client.mjs.map +1 -1
  14. package/dist/grpc/core.d.mts +4 -4
  15. package/dist/grpc/core.d.mts.map +1 -1
  16. package/dist/grpc/core.mjs +44 -27
  17. package/dist/grpc/core.mjs.map +1 -1
  18. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
  19. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
  20. package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
  21. package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
  22. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
  23. package/dist/jsonRpc/client.d.mts +160 -0
  24. package/dist/jsonRpc/client.d.mts.map +1 -1
  25. package/dist/jsonRpc/client.mjs +142 -0
  26. package/dist/jsonRpc/client.mjs.map +1 -1
  27. package/dist/jsonRpc/core.d.mts +80 -0
  28. package/dist/jsonRpc/core.d.mts.map +1 -1
  29. package/dist/jsonRpc/core.mjs +80 -0
  30. package/dist/jsonRpc/core.mjs.map +1 -1
  31. package/dist/jsonRpc/errors.d.mts +12 -0
  32. package/dist/jsonRpc/errors.d.mts.map +1 -1
  33. package/dist/jsonRpc/errors.mjs +12 -0
  34. package/dist/jsonRpc/errors.mjs.map +1 -1
  35. package/dist/jsonRpc/http-transport.d.mts +30 -0
  36. package/dist/jsonRpc/http-transport.d.mts.map +1 -1
  37. package/dist/jsonRpc/http-transport.mjs +16 -0
  38. package/dist/jsonRpc/http-transport.mjs.map +1 -1
  39. package/dist/jsonRpc/network.d.mts +4 -0
  40. package/dist/jsonRpc/network.d.mts.map +1 -1
  41. package/dist/jsonRpc/network.mjs +4 -0
  42. package/dist/jsonRpc/network.mjs.map +1 -1
  43. package/dist/jsonRpc/types/chain.d.mts +68 -0
  44. package/dist/jsonRpc/types/chain.d.mts.map +1 -1
  45. package/dist/jsonRpc/types/changes.d.mts +24 -0
  46. package/dist/jsonRpc/types/changes.d.mts.map +1 -1
  47. package/dist/jsonRpc/types/coins.d.mts +4 -0
  48. package/dist/jsonRpc/types/coins.d.mts.map +1 -1
  49. package/dist/jsonRpc/types/common.d.mts +4 -0
  50. package/dist/jsonRpc/types/common.d.mts.map +1 -1
  51. package/dist/jsonRpc/types/generated.d.mts +497 -16
  52. package/dist/jsonRpc/types/generated.d.mts.map +1 -1
  53. package/dist/jsonRpc/types/params.d.mts +289 -41
  54. package/dist/jsonRpc/types/params.d.mts.map +1 -1
  55. package/dist/transactions/Transaction.d.mts +9 -9
  56. package/dist/version.mjs +1 -1
  57. package/dist/version.mjs.map +1 -1
  58. package/dist/zklogin/bcs.d.mts +14 -14
  59. package/dist/zklogin/bcs.d.mts.map +1 -1
  60. package/package.json +3 -3
  61. package/src/client/core.ts +1 -0
  62. package/src/client/mvr.ts +39 -6
  63. package/src/grpc/client.ts +10 -7
  64. package/src/grpc/core.ts +200 -134
  65. package/src/jsonRpc/client.ts +160 -0
  66. package/src/jsonRpc/core.ts +80 -0
  67. package/src/jsonRpc/errors.ts +12 -0
  68. package/src/jsonRpc/http-transport.ts +30 -0
  69. package/src/jsonRpc/network.ts +4 -0
  70. package/src/jsonRpc/types/chain.ts +68 -0
  71. package/src/jsonRpc/types/changes.ts +24 -0
  72. package/src/jsonRpc/types/coins.ts +4 -0
  73. package/src/jsonRpc/types/common.ts +4 -0
  74. package/src/jsonRpc/types/generated.ts +497 -16
  75. package/src/jsonRpc/types/params.ts +289 -41
  76. package/src/version.ts +1 -1
@@ -97,6 +97,10 @@ import { isValidNamedPackage } from '../utils/move-registry.js';
97
97
  import { hasMvrName } from '../client/mvr.js';
98
98
  import { JSONRpcCoreClient } from './core.js';
99
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
+ */
100
104
  export interface PaginationArguments<Cursor> {
101
105
  /** Optional paging cursor */
102
106
  cursor?: Cursor;
@@ -104,6 +108,10 @@ export interface PaginationArguments<Cursor> {
104
108
  limit?: number | null;
105
109
  }
106
110
 
111
+ /**
112
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
113
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
114
+ */
107
115
  export interface OrderArguments {
108
116
  order?: Order | null;
109
117
  }
@@ -111,6 +119,8 @@ export interface OrderArguments {
111
119
  /**
112
120
  * Configuration options for the SuiJsonRpcClient
113
121
  * You must provide either a `url` or a `transport`
122
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
123
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
114
124
  */
115
125
  export type SuiJsonRpcClientOptions = NetworkOrTransport & {
116
126
  network: SuiClientTypes.Network;
@@ -129,14 +139,30 @@ type NetworkOrTransport =
129
139
 
130
140
  const SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiJsonRpcClient') as never;
131
141
 
142
+ /**
143
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
144
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
145
+ */
132
146
  export function isSuiJsonRpcClient(client: unknown): client is SuiJsonRpcClient {
133
147
  return (
134
148
  typeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true
135
149
  );
136
150
  }
137
151
 
152
+ /**
153
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
154
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
155
+ */
138
156
  export class SuiJsonRpcClient extends BaseClient {
157
+ /**
158
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
159
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
160
+ */
139
161
  core: JSONRpcCoreClient;
162
+ /**
163
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
164
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
165
+ */
140
166
  jsonRpc = this;
141
167
  protected transport: JsonRpcTransport;
142
168
 
@@ -148,6 +174,8 @@ export class SuiJsonRpcClient extends BaseClient {
148
174
  * Establish a connection to a Sui RPC endpoint
149
175
  *
150
176
  * @param options configuration options for the API Client
177
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
178
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
151
179
  */
152
180
  constructor(options: SuiJsonRpcClientOptions) {
153
181
  super({ network: options.network });
@@ -158,6 +186,10 @@ export class SuiJsonRpcClient extends BaseClient {
158
186
  });
159
187
  }
160
188
 
189
+ /**
190
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
191
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
192
+ */
161
193
  async getRpcApiVersion({ signal }: { signal?: AbortSignal } = {}): Promise<string | undefined> {
162
194
  const resp = await this.transport.request<{ info: { version: string } }>({
163
195
  method: 'rpc.discover',
@@ -170,6 +202,8 @@ export class SuiJsonRpcClient extends BaseClient {
170
202
 
171
203
  /**
172
204
  * Get all Coin<`coin_type`> objects owned by an address.
205
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
206
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
173
207
  */
174
208
  async getCoins({
175
209
  coinType,
@@ -204,6 +238,8 @@ export class SuiJsonRpcClient extends BaseClient {
204
238
 
205
239
  /**
206
240
  * Get all Coin objects owned by an address.
241
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
242
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
207
243
  */
208
244
  async getAllCoins(input: GetAllCoinsParams): Promise<PaginatedCoins> {
209
245
  if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {
@@ -224,6 +260,8 @@ export class SuiJsonRpcClient extends BaseClient {
224
260
 
225
261
  /**
226
262
  * Get the total coin balance for one coin type, owned by the address owner.
263
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
264
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
227
265
  */
228
266
  async getBalance({ owner, coinType, signal }: GetBalanceParams): Promise<CoinBalance> {
229
267
  if (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) {
@@ -247,6 +285,8 @@ export class SuiJsonRpcClient extends BaseClient {
247
285
 
248
286
  /**
249
287
  * Get the total coin balance for all coin types, owned by the address owner.
288
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
289
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
250
290
  */
251
291
  async getAllBalances(input: GetAllBalancesParams): Promise<CoinBalance[]> {
252
292
  if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {
@@ -261,6 +301,8 @@ export class SuiJsonRpcClient extends BaseClient {
261
301
 
262
302
  /**
263
303
  * Fetch CoinMetadata for a given coin type
304
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
305
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
264
306
  */
265
307
  async getCoinMetadata({ coinType, signal }: GetCoinMetadataParams): Promise<CoinMetadata | null> {
266
308
  if (coinType && hasMvrName(coinType)) {
@@ -280,6 +322,8 @@ export class SuiJsonRpcClient extends BaseClient {
280
322
 
281
323
  /**
282
324
  * Fetch total supply for a coin
325
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
326
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
283
327
  */
284
328
  async getTotalSupply({ coinType, signal }: GetTotalSupplyParams): Promise<CoinSupply> {
285
329
  if (coinType && hasMvrName(coinType)) {
@@ -301,6 +345,8 @@ export class SuiJsonRpcClient extends BaseClient {
301
345
  * Invoke any RPC method
302
346
  * @param method the method to be invoked
303
347
  * @param args the arguments to be passed to the RPC request
348
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
349
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
304
350
  */
305
351
  async call<T = unknown>(
306
352
  method: string,
@@ -312,6 +358,8 @@ export class SuiJsonRpcClient extends BaseClient {
312
358
 
313
359
  /**
314
360
  * Get Move function argument types like read, write and full access
361
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
362
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
315
363
  */
316
364
  async getMoveFunctionArgTypes({
317
365
  package: pkg,
@@ -337,6 +385,8 @@ export class SuiJsonRpcClient extends BaseClient {
337
385
  /**
338
386
  * Get a map from module name to
339
387
  * structured representations of Move modules
388
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
389
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
340
390
  */
341
391
  async getNormalizedMoveModulesByPackage({
342
392
  package: pkg,
@@ -359,6 +409,8 @@ export class SuiJsonRpcClient extends BaseClient {
359
409
 
360
410
  /**
361
411
  * Get a structured representation of Move module
412
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
413
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
362
414
  */
363
415
  async getNormalizedMoveModule({
364
416
  package: pkg,
@@ -382,6 +434,8 @@ export class SuiJsonRpcClient extends BaseClient {
382
434
 
383
435
  /**
384
436
  * Get a structured representation of Move function
437
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
438
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
385
439
  */
386
440
  async getNormalizedMoveFunction({
387
441
  package: pkg,
@@ -406,6 +460,8 @@ export class SuiJsonRpcClient extends BaseClient {
406
460
 
407
461
  /**
408
462
  * Get a structured representation of Move struct
463
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
464
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
409
465
  */
410
466
  async getNormalizedMoveStruct({
411
467
  package: pkg,
@@ -430,6 +486,8 @@ export class SuiJsonRpcClient extends BaseClient {
430
486
 
431
487
  /**
432
488
  * Get all objects owned by an address
489
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
490
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
433
491
  */
434
492
  async getOwnedObjects(input: GetOwnedObjectsParams): Promise<PaginatedObjectsResponse> {
435
493
  if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {
@@ -476,6 +534,8 @@ export class SuiJsonRpcClient extends BaseClient {
476
534
 
477
535
  /**
478
536
  * Get details about an object
537
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
538
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
479
539
  */
480
540
  async getObject(input: GetObjectParams): Promise<SuiObjectResponse> {
481
541
  if (!input.id || !isValidSuiObjectId(normalizeSuiObjectId(input.id))) {
@@ -488,6 +548,10 @@ export class SuiJsonRpcClient extends BaseClient {
488
548
  });
489
549
  }
490
550
 
551
+ /**
552
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
553
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
554
+ */
491
555
  async tryGetPastObject(input: TryGetPastObjectParams): Promise<ObjectRead> {
492
556
  return await this.transport.request({
493
557
  method: 'sui_tryGetPastObject',
@@ -498,6 +562,8 @@ export class SuiJsonRpcClient extends BaseClient {
498
562
 
499
563
  /**
500
564
  * Batch get details about a list of objects. If any of the object ids are duplicates the call will fail
565
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
566
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
501
567
  */
502
568
  async multiGetObjects(input: MultiGetObjectsParams): Promise<SuiObjectResponse[]> {
503
569
  input.ids.forEach((id) => {
@@ -519,6 +585,8 @@ export class SuiJsonRpcClient extends BaseClient {
519
585
 
520
586
  /**
521
587
  * Get transaction blocks for a given query criteria
588
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
589
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
522
590
  */
523
591
  async queryTransactionBlocks({
524
592
  filter,
@@ -556,6 +624,10 @@ export class SuiJsonRpcClient extends BaseClient {
556
624
  });
557
625
  }
558
626
 
627
+ /**
628
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
629
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
630
+ */
559
631
  async getTransactionBlock(
560
632
  input: GetTransactionBlockParams,
561
633
  ): Promise<SuiTransactionBlockResponse> {
@@ -569,6 +641,10 @@ export class SuiJsonRpcClient extends BaseClient {
569
641
  });
570
642
  }
571
643
 
644
+ /**
645
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
646
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
647
+ */
572
648
  async multiGetTransactionBlocks(
573
649
  input: MultiGetTransactionBlocksParams,
574
650
  ): Promise<SuiTransactionBlockResponse[]> {
@@ -590,6 +666,10 @@ export class SuiJsonRpcClient extends BaseClient {
590
666
  });
591
667
  }
592
668
 
669
+ /**
670
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
671
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
672
+ */
593
673
  async executeTransactionBlock({
594
674
  transactionBlock,
595
675
  signature,
@@ -609,6 +689,10 @@ export class SuiJsonRpcClient extends BaseClient {
609
689
  return result;
610
690
  }
611
691
 
692
+ /**
693
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
694
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
695
+ */
612
696
  async signAndExecuteTransaction({
613
697
  transaction,
614
698
  signer,
@@ -642,6 +726,10 @@ export class SuiJsonRpcClient extends BaseClient {
642
726
  * Get total number of transactions
643
727
  */
644
728
 
729
+ /**
730
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
731
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
732
+ */
645
733
  async getTotalTransactionBlocks({ signal }: { signal?: AbortSignal } = {}): Promise<bigint> {
646
734
  const resp = await this.transport.request<string>({
647
735
  method: 'sui_getTotalTransactionBlocks',
@@ -653,6 +741,8 @@ export class SuiJsonRpcClient extends BaseClient {
653
741
 
654
742
  /**
655
743
  * Getting the reference gas price for the network
744
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
745
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
656
746
  */
657
747
  async getReferenceGasPrice({ signal }: GetReferenceGasPriceParams = {}): Promise<bigint> {
658
748
  const resp = await this.transport.request<string>({
@@ -665,6 +755,8 @@ export class SuiJsonRpcClient extends BaseClient {
665
755
 
666
756
  /**
667
757
  * Return the delegated stakes for an address
758
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
759
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
668
760
  */
669
761
  async getStakes(input: GetStakesParams): Promise<DelegatedStake[]> {
670
762
  if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {
@@ -679,6 +771,8 @@ export class SuiJsonRpcClient extends BaseClient {
679
771
 
680
772
  /**
681
773
  * Return the delegated stakes queried by id.
774
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
775
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
682
776
  */
683
777
  async getStakesByIds(input: GetStakesByIdsParams): Promise<DelegatedStake[]> {
684
778
  input.stakedSuiIds.forEach((id) => {
@@ -695,6 +789,8 @@ export class SuiJsonRpcClient extends BaseClient {
695
789
 
696
790
  /**
697
791
  * Return the latest system state content.
792
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
793
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
698
794
  */
699
795
  async getLatestSuiSystemState({
700
796
  signal,
@@ -708,6 +804,8 @@ export class SuiJsonRpcClient extends BaseClient {
708
804
 
709
805
  /**
710
806
  * Get events for a given query criteria
807
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
808
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
711
809
  */
712
810
  async queryEvents({
713
811
  query,
@@ -766,6 +864,8 @@ export class SuiJsonRpcClient extends BaseClient {
766
864
  * Runs the transaction block in dev-inspect mode. Which allows for nearly any
767
865
  * transaction (or Move call) with any arguments. Detailed results are
768
866
  * provided, including both the transaction effects and any return values.
867
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
868
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
769
869
  */
770
870
  async devInspectTransactionBlock(
771
871
  input: DevInspectTransactionBlockParams,
@@ -798,6 +898,8 @@ export class SuiJsonRpcClient extends BaseClient {
798
898
 
799
899
  /**
800
900
  * Dry run a transaction block and return the result.
901
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
902
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
801
903
  */
802
904
  async dryRunTransactionBlock(
803
905
  input: DryRunTransactionBlockParams,
@@ -814,6 +916,8 @@ export class SuiJsonRpcClient extends BaseClient {
814
916
 
815
917
  /**
816
918
  * Return the list of dynamic field objects owned by an object
919
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
920
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
817
921
  */
818
922
  async getDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage> {
819
923
  if (!input.parentId || !isValidSuiObjectId(normalizeSuiObjectId(input.parentId))) {
@@ -828,6 +932,8 @@ export class SuiJsonRpcClient extends BaseClient {
828
932
 
829
933
  /**
830
934
  * Return the dynamic field object information for a specified object
935
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
936
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
831
937
  */
832
938
  async getDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse> {
833
939
  return await this.transport.request({
@@ -839,6 +945,8 @@ export class SuiJsonRpcClient extends BaseClient {
839
945
 
840
946
  /**
841
947
  * Get the sequence number of the latest checkpoint that has been executed
948
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
949
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
842
950
  */
843
951
  async getLatestCheckpointSequenceNumber({
844
952
  signal,
@@ -853,6 +961,8 @@ export class SuiJsonRpcClient extends BaseClient {
853
961
 
854
962
  /**
855
963
  * Returns information about a given checkpoint
964
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
965
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
856
966
  */
857
967
  async getCheckpoint(input: GetCheckpointParams): Promise<Checkpoint> {
858
968
  return await this.transport.request({
@@ -864,6 +974,8 @@ export class SuiJsonRpcClient extends BaseClient {
864
974
 
865
975
  /**
866
976
  * Returns historical checkpoints paginated
977
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
978
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
867
979
  */
868
980
  async getCheckpoints(
869
981
  input: PaginationArguments<CheckpointPage['nextCursor']> & GetCheckpointsParams,
@@ -877,6 +989,8 @@ export class SuiJsonRpcClient extends BaseClient {
877
989
 
878
990
  /**
879
991
  * Return the committee information for the asked epoch
992
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
993
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
880
994
  */
881
995
  async getCommitteeInfo(input?: GetCommitteeInfoParams): Promise<CommitteeInfo> {
882
996
  return await this.transport.request({
@@ -886,6 +1000,10 @@ export class SuiJsonRpcClient extends BaseClient {
886
1000
  });
887
1001
  }
888
1002
 
1003
+ /**
1004
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1005
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1006
+ */
889
1007
  async getNetworkMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<NetworkMetrics> {
890
1008
  return await this.transport.request({
891
1009
  method: 'suix_getNetworkMetrics',
@@ -894,6 +1012,10 @@ export class SuiJsonRpcClient extends BaseClient {
894
1012
  });
895
1013
  }
896
1014
 
1015
+ /**
1016
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1017
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1018
+ */
897
1019
  async getAddressMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<AddressMetrics> {
898
1020
  return await this.transport.request({
899
1021
  method: 'suix_getLatestAddressMetrics',
@@ -902,6 +1024,10 @@ export class SuiJsonRpcClient extends BaseClient {
902
1024
  });
903
1025
  }
904
1026
 
1027
+ /**
1028
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1029
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1030
+ */
905
1031
  async getEpochMetrics(
906
1032
  input?: {
907
1033
  descendingOrder?: boolean;
@@ -915,6 +1041,10 @@ export class SuiJsonRpcClient extends BaseClient {
915
1041
  });
916
1042
  }
917
1043
 
1044
+ /**
1045
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1046
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1047
+ */
918
1048
  async getAllEpochAddressMetrics(input?: {
919
1049
  descendingOrder?: boolean;
920
1050
  signal?: AbortSignal;
@@ -928,6 +1058,8 @@ export class SuiJsonRpcClient extends BaseClient {
928
1058
 
929
1059
  /**
930
1060
  * Return the committee information for the asked epoch
1061
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1062
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
931
1063
  */
932
1064
  async getEpochs(
933
1065
  input?: {
@@ -944,6 +1076,8 @@ export class SuiJsonRpcClient extends BaseClient {
944
1076
 
945
1077
  /**
946
1078
  * Returns list of top move calls by usage
1079
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1080
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
947
1081
  */
948
1082
  async getMoveCallMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<MoveCallMetrics> {
949
1083
  return await this.transport.request({
@@ -955,6 +1089,8 @@ export class SuiJsonRpcClient extends BaseClient {
955
1089
 
956
1090
  /**
957
1091
  * Return the committee information for the asked epoch
1092
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1093
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
958
1094
  */
959
1095
  async getCurrentEpoch({ signal }: { signal?: AbortSignal } = {}): Promise<EpochInfo> {
960
1096
  return await this.transport.request({
@@ -966,6 +1102,8 @@ export class SuiJsonRpcClient extends BaseClient {
966
1102
 
967
1103
  /**
968
1104
  * Return the Validators APYs
1105
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1106
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
969
1107
  */
970
1108
  async getValidatorsApy({ signal }: { signal?: AbortSignal } = {}): Promise<ValidatorsApy> {
971
1109
  return await this.transport.request({
@@ -976,12 +1114,20 @@ export class SuiJsonRpcClient extends BaseClient {
976
1114
  }
977
1115
 
978
1116
  // TODO: Migrate this to `sui_getChainIdentifier` once it is widely available.
1117
+ /**
1118
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1119
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1120
+ */
979
1121
  async getChainIdentifier({ signal }: { signal?: AbortSignal } = {}): Promise<string> {
980
1122
  const checkpoint = await this.getCheckpoint({ id: '0', signal });
981
1123
  const bytes = fromBase58(checkpoint.digest);
982
1124
  return toHex(bytes.slice(0, 4));
983
1125
  }
984
1126
 
1127
+ /**
1128
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1129
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1130
+ */
985
1131
  async resolveNameServiceAddress(input: ResolveNameServiceAddressParams): Promise<string | null> {
986
1132
  return await this.transport.request({
987
1133
  method: 'suix_resolveNameServiceAddress',
@@ -990,6 +1136,10 @@ export class SuiJsonRpcClient extends BaseClient {
990
1136
  });
991
1137
  }
992
1138
 
1139
+ /**
1140
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1141
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1142
+ */
993
1143
  async resolveNameServiceNames({
994
1144
  format = 'dot',
995
1145
  ...input
@@ -1010,6 +1160,10 @@ export class SuiJsonRpcClient extends BaseClient {
1010
1160
  };
1011
1161
  }
1012
1162
 
1163
+ /**
1164
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1165
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1166
+ */
1013
1167
  async getProtocolConfig(input?: GetProtocolConfigParams): Promise<ProtocolConfig> {
1014
1168
  return await this.transport.request({
1015
1169
  method: 'sui_getProtocolConfig',
@@ -1018,6 +1172,10 @@ export class SuiJsonRpcClient extends BaseClient {
1018
1172
  });
1019
1173
  }
1020
1174
 
1175
+ /**
1176
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1177
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1178
+ */
1021
1179
  async verifyZkLoginSignature(input: VerifyZkLoginSignatureParams): Promise<ZkLoginVerifyResult> {
1022
1180
  return await this.transport.request({
1023
1181
  method: 'sui_verifyZkLoginSignature',
@@ -1031,6 +1189,8 @@ export class SuiJsonRpcClient extends BaseClient {
1031
1189
  * This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to
1032
1190
  * be available via the API.
1033
1191
  * This currently polls the `getTransactionBlock` API to check for the transaction.
1192
+ * @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
1193
+ * from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
1034
1194
  */
1035
1195
  async waitForTransaction({
1036
1196
  signal,