@mysten/sui 2.20.2 → 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 (91) hide show
  1. package/CHANGELOG.md +21 -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/client/transaction-resolver.mjs +1 -0
  11. package/dist/client/transaction-resolver.mjs.map +1 -1
  12. package/dist/cryptography/signature.d.mts +8 -8
  13. package/dist/graphql/core.mjs +3 -1
  14. package/dist/graphql/core.mjs.map +1 -1
  15. package/dist/graphql/generated/queries.d.mts.map +1 -1
  16. package/dist/graphql/generated/queries.mjs +6 -2
  17. package/dist/graphql/generated/queries.mjs.map +1 -1
  18. package/dist/grpc/client.d.mts.map +1 -1
  19. package/dist/grpc/client.mjs +1 -1
  20. package/dist/grpc/client.mjs.map +1 -1
  21. package/dist/grpc/core.d.mts +4 -4
  22. package/dist/grpc/core.d.mts.map +1 -1
  23. package/dist/grpc/core.mjs +45 -27
  24. package/dist/grpc/core.mjs.map +1 -1
  25. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
  26. package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
  27. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
  28. package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
  29. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
  30. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
  31. package/dist/jsonRpc/client.d.mts +160 -0
  32. package/dist/jsonRpc/client.d.mts.map +1 -1
  33. package/dist/jsonRpc/client.mjs +142 -0
  34. package/dist/jsonRpc/client.mjs.map +1 -1
  35. package/dist/jsonRpc/core.d.mts +80 -0
  36. package/dist/jsonRpc/core.d.mts.map +1 -1
  37. package/dist/jsonRpc/core.mjs +80 -0
  38. package/dist/jsonRpc/core.mjs.map +1 -1
  39. package/dist/jsonRpc/errors.d.mts +12 -0
  40. package/dist/jsonRpc/errors.d.mts.map +1 -1
  41. package/dist/jsonRpc/errors.mjs +12 -0
  42. package/dist/jsonRpc/errors.mjs.map +1 -1
  43. package/dist/jsonRpc/http-transport.d.mts +30 -0
  44. package/dist/jsonRpc/http-transport.d.mts.map +1 -1
  45. package/dist/jsonRpc/http-transport.mjs +16 -0
  46. package/dist/jsonRpc/http-transport.mjs.map +1 -1
  47. package/dist/jsonRpc/network.d.mts +4 -0
  48. package/dist/jsonRpc/network.d.mts.map +1 -1
  49. package/dist/jsonRpc/network.mjs +4 -0
  50. package/dist/jsonRpc/network.mjs.map +1 -1
  51. package/dist/jsonRpc/types/chain.d.mts +68 -0
  52. package/dist/jsonRpc/types/chain.d.mts.map +1 -1
  53. package/dist/jsonRpc/types/changes.d.mts +24 -0
  54. package/dist/jsonRpc/types/changes.d.mts.map +1 -1
  55. package/dist/jsonRpc/types/coins.d.mts +4 -0
  56. package/dist/jsonRpc/types/coins.d.mts.map +1 -1
  57. package/dist/jsonRpc/types/common.d.mts +4 -0
  58. package/dist/jsonRpc/types/common.d.mts.map +1 -1
  59. package/dist/jsonRpc/types/generated.d.mts +497 -16
  60. package/dist/jsonRpc/types/generated.d.mts.map +1 -1
  61. package/dist/jsonRpc/types/params.d.mts +289 -41
  62. package/dist/jsonRpc/types/params.d.mts.map +1 -1
  63. package/dist/transactions/Transaction.d.mts +9 -9
  64. package/dist/transactions/Transaction.d.mts.map +1 -1
  65. package/dist/transactions/data/v1.d.mts +220 -220
  66. package/dist/transactions/data/v1.d.mts.map +1 -1
  67. package/dist/transactions/data/v2.d.mts +16 -16
  68. package/dist/transactions/data/v2.d.mts.map +1 -1
  69. package/dist/version.mjs +1 -1
  70. package/dist/version.mjs.map +1 -1
  71. package/package.json +3 -3
  72. package/src/client/core.ts +1 -0
  73. package/src/client/mvr.ts +39 -6
  74. package/src/client/transaction-resolver.ts +1 -0
  75. package/src/graphql/core.ts +2 -0
  76. package/src/graphql/generated/queries.ts +211 -4923
  77. package/src/graphql/queries/transactions.graphql +10 -2
  78. package/src/grpc/client.ts +10 -7
  79. package/src/grpc/core.ts +204 -134
  80. package/src/jsonRpc/client.ts +160 -0
  81. package/src/jsonRpc/core.ts +80 -0
  82. package/src/jsonRpc/errors.ts +12 -0
  83. package/src/jsonRpc/http-transport.ts +30 -0
  84. package/src/jsonRpc/network.ts +4 -0
  85. package/src/jsonRpc/types/chain.ts +68 -0
  86. package/src/jsonRpc/types/changes.ts +24 -0
  87. package/src/jsonRpc/types/coins.ts +4 -0
  88. package/src/jsonRpc/types/common.ts +4 -0
  89. package/src/jsonRpc/types/generated.ts +497 -16
  90. package/src/jsonRpc/types/params.ts +289 -41
  91. package/src/version.ts +1 -1
@@ -143,8 +143,16 @@ fragment TRANSACTION_FIELDS on Transaction {
143
143
  }
144
144
  }
145
145
 
146
- query resolveTransaction($transaction: JSON!, $doGasSelection: Boolean = true) {
147
- simulateTransaction(transaction: $transaction, doGasSelection: $doGasSelection) {
146
+ query resolveTransaction(
147
+ $transaction: JSON!
148
+ $doGasSelection: Boolean = true
149
+ $checksEnabled: Boolean = true
150
+ ) {
151
+ simulateTransaction(
152
+ transaction: $transaction
153
+ doGasSelection: $doGasSelection
154
+ checksEnabled: $checksEnabled
155
+ ) {
148
156
  effects {
149
157
  transaction {
150
158
  transactionBcs
@@ -178,14 +178,17 @@ export class SuiGrpcClient extends BaseClient implements SuiClientTypes.Transpor
178
178
  paths.push('value');
179
179
  }
180
180
 
181
- const response = await this.stateService.listDynamicFields({
182
- parent: input.parentId,
183
- pageToken: input.cursor ? fromBase64(input.cursor) : undefined,
184
- pageSize: input.limit,
185
- readMask: {
186
- paths,
181
+ const response = await this.stateService.listDynamicFields(
182
+ {
183
+ parent: input.parentId,
184
+ pageToken: input.cursor ? fromBase64(input.cursor) : undefined,
185
+ pageSize: input.limit,
186
+ readMask: {
187
+ paths,
188
+ },
187
189
  },
188
- });
190
+ { abort: input.signal },
191
+ );
189
192
 
190
193
  return {
191
194
  dynamicFields: response.response.dynamicFields.map(
package/src/grpc/core.ts CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  import type { CoreClientOptions, SuiClientTypes } from '../client/index.js';
5
5
  import { CoreClient, formatMoveAbortMessage, SimulationError } from '../client/index.js';
6
+ import { raceSignal } from '../client/mvr.js';
6
7
  import type { SuiGrpcClient } from './client.js';
7
8
  import type { Owner } from './proto/sui/rpc/v2/owner.js';
8
9
  import { Owner_OwnerKind } from './proto/sui/rpc/v2/owner.js';
@@ -80,12 +81,15 @@ export class GrpcCoreClient extends CoreClient {
80
81
  }
81
82
 
82
83
  for (const batch of batches) {
83
- const response = await this.#client.ledgerService.batchGetObjects({
84
- requests: batch.map((id) => ({ objectId: id })),
85
- readMask: {
86
- paths,
84
+ const response = await this.#client.ledgerService.batchGetObjects(
85
+ {
86
+ requests: batch.map((id) => ({ objectId: id })),
87
+ readMask: {
88
+ paths,
89
+ },
87
90
  },
88
- });
91
+ { abort: options.signal },
92
+ );
89
93
 
90
94
  results.push(
91
95
  ...response.response.objects.map((object): SuiClientTypes.Object<Include> | Error => {
@@ -160,17 +164,20 @@ export class GrpcCoreClient extends CoreClient {
160
164
  paths.push('display');
161
165
  }
162
166
 
163
- const response = await this.#client.stateService.listOwnedObjects({
164
- owner: options.owner,
165
- objectType: options.type
166
- ? (await this.mvr.resolveType({ type: options.type })).type
167
- : undefined,
168
- pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
169
- pageSize: options.limit,
170
- readMask: {
171
- paths,
167
+ const response = await this.#client.stateService.listOwnedObjects(
168
+ {
169
+ owner: options.owner,
170
+ objectType: options.type
171
+ ? (await this.mvr.resolveType({ type: options.type, signal: options.signal })).type
172
+ : undefined,
173
+ pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
174
+ pageSize: options.limit,
175
+ readMask: {
176
+ paths,
177
+ },
172
178
  },
173
- });
179
+ { abort: options.signal },
180
+ );
174
181
 
175
182
  const objects = response.response.objects.map(
176
183
  (object): SuiClientTypes.Object<Include> => ({
@@ -207,15 +214,18 @@ export class GrpcCoreClient extends CoreClient {
207
214
  const paths = ['owner', 'object_type', 'digest', 'version', 'object_id', 'balance'];
208
215
  const coinType = options.coinType ?? SUI_TYPE_ARG;
209
216
 
210
- const response = await this.#client.stateService.listOwnedObjects({
211
- owner: options.owner,
212
- objectType: `0x2::coin::Coin<${(await this.mvr.resolveType({ type: coinType })).type}>`,
213
- pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
214
- pageSize: options.limit,
215
- readMask: {
216
- paths,
217
+ const response = await this.#client.stateService.listOwnedObjects(
218
+ {
219
+ owner: options.owner,
220
+ objectType: `0x2::coin::Coin<${(await this.mvr.resolveType({ type: coinType, signal: options.signal })).type}>`,
221
+ pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
222
+ pageSize: options.limit,
223
+ readMask: {
224
+ paths,
225
+ },
217
226
  },
218
- });
227
+ { abort: options.signal },
228
+ );
219
229
 
220
230
  return {
221
231
  objects: response.response.objects.map(
@@ -237,10 +247,13 @@ export class GrpcCoreClient extends CoreClient {
237
247
  options: SuiClientTypes.GetBalanceOptions,
238
248
  ): Promise<SuiClientTypes.GetBalanceResponse> {
239
249
  const coinType = options.coinType ?? SUI_TYPE_ARG;
240
- const result = await this.#client.stateService.getBalance({
241
- owner: options.owner,
242
- coinType: (await this.mvr.resolveType({ type: coinType })).type,
243
- });
250
+ const result = await this.#client.stateService.getBalance(
251
+ {
252
+ owner: options.owner,
253
+ coinType: (await this.mvr.resolveType({ type: coinType, signal: options.signal })).type,
254
+ },
255
+ { abort: options.signal },
256
+ );
244
257
 
245
258
  return {
246
259
  balance: {
@@ -255,14 +268,23 @@ export class GrpcCoreClient extends CoreClient {
255
268
  async getCoinMetadata(
256
269
  options: SuiClientTypes.GetCoinMetadataOptions,
257
270
  ): Promise<SuiClientTypes.GetCoinMetadataResponse> {
258
- const coinType = (await this.mvr.resolveType({ type: options.coinType })).type;
271
+ const coinType = (
272
+ await this.mvr.resolveType({ type: options.coinType, signal: options.signal })
273
+ ).type;
259
274
 
260
275
  let response;
261
276
  try {
262
- ({ response } = await this.#client.stateService.getCoinInfo({
263
- coinType,
264
- }));
265
- } catch {
277
+ ({ response } = await this.#client.stateService.getCoinInfo(
278
+ {
279
+ coinType,
280
+ },
281
+ { abort: options.signal },
282
+ ));
283
+ } catch (error) {
284
+ // Don't swallow cancellation — only treat the coin as missing on real errors.
285
+ if (options.signal?.aborted) {
286
+ throw error;
287
+ }
266
288
  return { coinMetadata: null };
267
289
  }
268
290
 
@@ -285,11 +307,14 @@ export class GrpcCoreClient extends CoreClient {
285
307
  async listBalances(
286
308
  options: SuiClientTypes.ListBalancesOptions,
287
309
  ): Promise<SuiClientTypes.ListBalancesResponse> {
288
- const result = await this.#client.stateService.listBalances({
289
- owner: options.owner,
290
- pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
291
- pageSize: options.limit,
292
- });
310
+ const result = await this.#client.stateService.listBalances(
311
+ {
312
+ owner: options.owner,
313
+ pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
314
+ pageSize: options.limit,
315
+ },
316
+ { abort: options.signal },
317
+ );
293
318
 
294
319
  return {
295
320
  hasNextPage: !!result.response.nextPageToken,
@@ -331,12 +356,15 @@ export class GrpcCoreClient extends CoreClient {
331
356
  paths.push('effects.changed_objects.object_id');
332
357
  }
333
358
 
334
- const { response } = await this.#client.ledgerService.getTransaction({
335
- digest: options.digest,
336
- readMask: {
337
- paths,
359
+ const { response } = await this.#client.ledgerService.getTransaction(
360
+ {
361
+ digest: options.digest,
362
+ readMask: {
363
+ paths,
364
+ },
338
365
  },
339
- });
366
+ { abort: options.signal },
367
+ );
340
368
 
341
369
  if (!response.transaction) {
342
370
  throw new Error(`Transaction ${options.digest} not found`);
@@ -373,24 +401,27 @@ export class GrpcCoreClient extends CoreClient {
373
401
  paths.push('effects.changed_objects.object_id');
374
402
  }
375
403
 
376
- const { response } = await this.#client.transactionExecutionService.executeTransaction({
377
- transaction: {
378
- bcs: {
379
- value: options.transaction,
380
- },
381
- },
382
- signatures: options.signatures.map((signature) => ({
383
- bcs: {
384
- value: fromBase64(signature),
404
+ const { response } = await this.#client.transactionExecutionService.executeTransaction(
405
+ {
406
+ transaction: {
407
+ bcs: {
408
+ value: options.transaction,
409
+ },
385
410
  },
386
- signature: {
387
- oneofKind: undefined,
411
+ signatures: options.signatures.map((signature) => ({
412
+ bcs: {
413
+ value: fromBase64(signature),
414
+ },
415
+ signature: {
416
+ oneofKind: undefined,
417
+ },
418
+ })),
419
+ readMask: {
420
+ paths,
388
421
  },
389
- })),
390
- readMask: {
391
- paths,
392
422
  },
393
- });
423
+ { abort: options.signal },
424
+ );
394
425
 
395
426
  return parseTransaction(response.transaction!, options.include);
396
427
  }
@@ -436,24 +467,27 @@ export class GrpcCoreClient extends CoreClient {
436
467
  await options.transaction.prepareForSerialization({ client: this });
437
468
  }
438
469
 
439
- const { response } = await this.#client.transactionExecutionService.simulateTransaction({
440
- transaction:
441
- options.transaction instanceof Uint8Array
442
- ? {
443
- bcs: {
444
- value: options.transaction,
445
- },
446
- }
447
- : transactionToGrpcTransaction(options.transaction),
448
- readMask: {
449
- paths,
470
+ const { response } = await this.#client.transactionExecutionService.simulateTransaction(
471
+ {
472
+ transaction:
473
+ options.transaction instanceof Uint8Array
474
+ ? {
475
+ bcs: {
476
+ value: options.transaction,
477
+ },
478
+ }
479
+ : transactionToGrpcTransaction(options.transaction),
480
+ readMask: {
481
+ paths,
482
+ },
483
+ doGasSelection: false,
484
+ checks:
485
+ options.checksEnabled === false
486
+ ? SimulateTransactionRequest_TransactionChecks.DISABLED
487
+ : SimulateTransactionRequest_TransactionChecks.ENABLED,
450
488
  },
451
- doGasSelection: false,
452
- checks:
453
- options.checksEnabled === false
454
- ? SimulateTransactionRequest_TransactionChecks.DISABLED
455
- : SimulateTransactionRequest_TransactionChecks.ENABLED,
456
- });
489
+ { abort: options.signal },
490
+ );
457
491
 
458
492
  const transactionResult = parseTransaction(response.transaction!, options.include);
459
493
 
@@ -486,22 +520,32 @@ export class GrpcCoreClient extends CoreClient {
486
520
  };
487
521
  }
488
522
  }
489
- async getReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {
490
- const response = await this.#client.ledgerService.getEpoch({
491
- readMask: {
492
- paths: ['reference_gas_price'],
523
+ async getReferenceGasPrice(
524
+ options?: SuiClientTypes.GetReferenceGasPriceOptions,
525
+ ): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {
526
+ const response = await this.#client.ledgerService.getEpoch(
527
+ {
528
+ readMask: {
529
+ paths: ['reference_gas_price'],
530
+ },
493
531
  },
494
- });
532
+ { abort: options?.signal },
533
+ );
495
534
 
496
535
  return {
497
536
  referenceGasPrice: response.response.epoch?.referenceGasPrice?.toString() ?? '',
498
537
  };
499
538
  }
500
539
 
501
- async getProtocolConfig(): Promise<SuiClientTypes.GetProtocolConfigResponse> {
502
- const response = await this.#client.ledgerService.getEpoch({
503
- readMask: { paths: ['protocol_config'] },
504
- });
540
+ async getProtocolConfig(
541
+ options?: SuiClientTypes.GetProtocolConfigOptions,
542
+ ): Promise<SuiClientTypes.GetProtocolConfigResponse> {
543
+ const response = await this.#client.ledgerService.getEpoch(
544
+ {
545
+ readMask: { paths: ['protocol_config'] },
546
+ },
547
+ { abort: options?.signal },
548
+ );
505
549
 
506
550
  const protocolConfig = response.response.epoch?.protocolConfig;
507
551
  if (!protocolConfig) {
@@ -525,26 +569,31 @@ export class GrpcCoreClient extends CoreClient {
525
569
  };
526
570
  }
527
571
 
528
- async getCurrentSystemState(): Promise<SuiClientTypes.GetCurrentSystemStateResponse> {
529
- const response = await this.#client.ledgerService.getEpoch({
530
- readMask: {
531
- paths: [
532
- 'system_state.version',
533
- 'system_state.epoch',
534
- 'system_state.protocol_version',
535
- 'system_state.reference_gas_price',
536
- 'system_state.epoch_start_timestamp_ms',
537
- 'system_state.safe_mode',
538
- 'system_state.safe_mode_storage_rewards',
539
- 'system_state.safe_mode_computation_rewards',
540
- 'system_state.safe_mode_storage_rebates',
541
- 'system_state.safe_mode_non_refundable_storage_fee',
542
- 'system_state.parameters',
543
- 'system_state.storage_fund',
544
- 'system_state.stake_subsidy',
545
- ],
572
+ async getCurrentSystemState(
573
+ options?: SuiClientTypes.GetCurrentSystemStateOptions,
574
+ ): Promise<SuiClientTypes.GetCurrentSystemStateResponse> {
575
+ const response = await this.#client.ledgerService.getEpoch(
576
+ {
577
+ readMask: {
578
+ paths: [
579
+ 'system_state.version',
580
+ 'system_state.epoch',
581
+ 'system_state.protocol_version',
582
+ 'system_state.reference_gas_price',
583
+ 'system_state.epoch_start_timestamp_ms',
584
+ 'system_state.safe_mode',
585
+ 'system_state.safe_mode_storage_rewards',
586
+ 'system_state.safe_mode_computation_rewards',
587
+ 'system_state.safe_mode_storage_rebates',
588
+ 'system_state.safe_mode_non_refundable_storage_fee',
589
+ 'system_state.parameters',
590
+ 'system_state.storage_fund',
591
+ 'system_state.stake_subsidy',
592
+ ],
593
+ },
546
594
  },
547
- });
595
+ { abort: options?.signal },
596
+ );
548
597
 
549
598
  const epoch = response.response.epoch;
550
599
  const systemState = epoch?.systemState;
@@ -624,22 +673,25 @@ export class GrpcCoreClient extends CoreClient {
624
673
  ? bcs.byteVector().serialize(messageBytes).toBytes()
625
674
  : messageBytes;
626
675
 
627
- const { response } = await this.#client.signatureVerificationService.verifySignature({
628
- message: {
629
- name: options.intentScope,
630
- value: messageValue,
631
- },
632
- signature: {
633
- bcs: {
634
- value: fromBase64(options.signature),
676
+ const { response } = await this.#client.signatureVerificationService.verifySignature(
677
+ {
678
+ message: {
679
+ name: options.intentScope,
680
+ value: messageValue,
635
681
  },
636
682
  signature: {
637
- oneofKind: undefined,
683
+ bcs: {
684
+ value: fromBase64(options.signature),
685
+ },
686
+ signature: {
687
+ oneofKind: undefined,
688
+ },
638
689
  },
690
+ address: options.address,
691
+ jwks: [],
639
692
  },
640
- address: options.address,
641
- jwks: [],
642
- });
693
+ { abort: options.signal },
694
+ );
643
695
 
644
696
  return {
645
697
  success: response.isValid ?? false,
@@ -652,9 +704,12 @@ export class GrpcCoreClient extends CoreClient {
652
704
  ): Promise<SuiClientTypes.DefaultNameServiceNameResponse> {
653
705
  const name =
654
706
  (
655
- await this.#client.nameService.reverseLookupName({
656
- address: options.address,
657
- })
707
+ await this.#client.nameService.reverseLookupName(
708
+ {
709
+ address: options.address,
710
+ },
711
+ { abort: options.signal },
712
+ )
658
713
  ).response.record?.name ?? null;
659
714
  return {
660
715
  data: {
@@ -666,13 +721,17 @@ export class GrpcCoreClient extends CoreClient {
666
721
  async getMoveFunction(
667
722
  options: SuiClientTypes.GetMoveFunctionOptions,
668
723
  ): Promise<SuiClientTypes.GetMoveFunctionResponse> {
669
- const resolvedPackageId = (await this.mvr.resolvePackage({ package: options.packageId }))
670
- .package;
671
- const { response } = await this.#client.movePackageService.getFunction({
672
- packageId: resolvedPackageId,
673
- moduleName: options.moduleName,
674
- name: options.name,
675
- });
724
+ const resolvedPackageId = (
725
+ await this.mvr.resolvePackage({ package: options.packageId, signal: options.signal })
726
+ ).package;
727
+ const { response } = await this.#client.movePackageService.getFunction(
728
+ {
729
+ packageId: resolvedPackageId,
730
+ moduleName: options.moduleName,
731
+ name: options.name,
732
+ },
733
+ { abort: options.signal },
734
+ );
676
735
 
677
736
  let visibility: 'public' | 'private' | 'friend' | 'unknown' = 'unknown';
678
737
 
@@ -722,17 +781,24 @@ export class GrpcCoreClient extends CoreClient {
722
781
  }
723
782
 
724
783
  async getChainIdentifier(
725
- _options?: SuiClientTypes.GetChainIdentifierOptions,
784
+ options?: SuiClientTypes.GetChainIdentifierOptions,
726
785
  ): Promise<SuiClientTypes.GetChainIdentifierResponse> {
727
- return this.cache.read(['chainIdentifier'], async () => {
728
- const { response } = await this.#client.ledgerService.getServiceInfo({});
729
- if (!response.chainId) {
730
- throw new Error('Chain identifier not found in service info');
731
- }
732
- return {
733
- chainIdentifier: response.chainId,
734
- };
735
- });
786
+ // The result is cached and shared across callers, so the underlying request must
787
+ // not carry any single caller's signal. Isolate cancellation per-caller instead.
788
+ return raceSignal(
789
+ Promise.resolve(
790
+ this.cache.read(['chainIdentifier'], async () => {
791
+ const { response } = await this.#client.ledgerService.getServiceInfo({});
792
+ if (!response.chainId) {
793
+ throw new Error('Chain identifier not found in service info');
794
+ }
795
+ return {
796
+ chainIdentifier: response.chainId,
797
+ };
798
+ }),
799
+ ),
800
+ options?.signal,
801
+ );
736
802
  }
737
803
 
738
804
  resolveTransactionPlugin() {
@@ -757,6 +823,10 @@ export class GrpcCoreClient extends CoreClient {
757
823
  doGasSelection:
758
824
  !options.onlyTransactionKind &&
759
825
  (snapshot.gasData.budget == null || snapshot.gasData.payment == null),
826
+ // Kind-only txns are never executed directly and do not have sender, so skip validation checks.
827
+ checks: options.onlyTransactionKind
828
+ ? SimulateTransactionRequest_TransactionChecks.DISABLED
829
+ : SimulateTransactionRequest_TransactionChecks.ENABLED,
760
830
  readMask: {
761
831
  paths: [
762
832
  'transaction.transaction.sender',