@mysten/sui 2.16.2 → 2.17.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 (116) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/bcs/bcs.d.mts +6 -6
  3. package/dist/client/core-resolver.mjs +21 -12
  4. package/dist/client/core-resolver.mjs.map +1 -1
  5. package/dist/cryptography/signature.d.mts +6 -6
  6. package/dist/graphql/generated/queries.d.mts.map +1 -1
  7. package/dist/graphql/generated/queries.mjs.map +1 -1
  8. package/dist/graphql/generated/tada-env.d.mts +82 -1
  9. package/dist/grpc/client.d.mts +2 -0
  10. package/dist/grpc/client.d.mts.map +1 -1
  11. package/dist/grpc/client.mjs +2 -0
  12. package/dist/grpc/client.mjs.map +1 -1
  13. package/dist/grpc/proto/google/protobuf/struct.mjs +1 -1
  14. package/dist/grpc/proto/google/protobuf/struct.mjs.map +1 -1
  15. package/dist/grpc/proto/google/rpc/status.mjs +1 -1
  16. package/dist/grpc/proto/google/rpc/status.mjs.map +1 -1
  17. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +66 -0
  18. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts.map +1 -0
  19. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.mjs +48 -0
  20. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.mjs.map +1 -0
  21. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.d.mts +135 -0
  22. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.d.mts.map +1 -0
  23. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.mjs +144 -0
  24. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.mjs.map +1 -0
  25. package/dist/grpc/proto/sui/rpc/v2/checkpoint.mjs +1 -1
  26. package/dist/grpc/proto/sui/rpc/v2/checkpoint.mjs.map +1 -1
  27. package/dist/grpc/proto/sui/rpc/v2/checkpoint_contents.mjs +3 -3
  28. package/dist/grpc/proto/sui/rpc/v2/checkpoint_contents.mjs.map +1 -1
  29. package/dist/grpc/proto/sui/rpc/v2/checkpoint_summary.mjs +3 -3
  30. package/dist/grpc/proto/sui/rpc/v2/checkpoint_summary.mjs.map +1 -1
  31. package/dist/grpc/proto/sui/rpc/v2/effects.d.mts +71 -3
  32. package/dist/grpc/proto/sui/rpc/v2/effects.d.mts.map +1 -1
  33. package/dist/grpc/proto/sui/rpc/v2/effects.mjs +71 -5
  34. package/dist/grpc/proto/sui/rpc/v2/effects.mjs.map +1 -1
  35. package/dist/grpc/proto/sui/rpc/v2/event.mjs +1 -1
  36. package/dist/grpc/proto/sui/rpc/v2/event.mjs.map +1 -1
  37. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.mjs +2 -2
  38. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.mjs.map +1 -1
  39. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
  40. package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs +3 -3
  41. package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs.map +1 -1
  42. package/dist/grpc/proto/sui/rpc/v2/move_package.d.mts.map +1 -1
  43. package/dist/grpc/proto/sui/rpc/v2/move_package.mjs +13 -13
  44. package/dist/grpc/proto/sui/rpc/v2/move_package.mjs.map +1 -1
  45. package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
  46. package/dist/grpc/proto/sui/rpc/v2/move_package_service.mjs +1 -1
  47. package/dist/grpc/proto/sui/rpc/v2/move_package_service.mjs.map +1 -1
  48. package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
  49. package/dist/grpc/proto/sui/rpc/v2/object.d.mts.map +1 -1
  50. package/dist/grpc/proto/sui/rpc/v2/object.mjs +1 -1
  51. package/dist/grpc/proto/sui/rpc/v2/object.mjs.map +1 -1
  52. package/dist/grpc/proto/sui/rpc/v2/signature.mjs +3 -3
  53. package/dist/grpc/proto/sui/rpc/v2/signature.mjs.map +1 -1
  54. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
  55. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.d.mts.map +1 -1
  56. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs +1 -1
  57. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs.map +1 -1
  58. package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
  59. package/dist/grpc/proto/sui/rpc/v2/state_service.d.mts.map +1 -1
  60. package/dist/grpc/proto/sui/rpc/v2/state_service.mjs +3 -3
  61. package/dist/grpc/proto/sui/rpc/v2/state_service.mjs.map +1 -1
  62. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
  63. package/dist/grpc/proto/sui/rpc/v2/system_state.mjs +2 -2
  64. package/dist/grpc/proto/sui/rpc/v2/system_state.mjs.map +1 -1
  65. package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts.map +1 -1
  66. package/dist/grpc/proto/sui/rpc/v2/transaction.mjs +16 -16
  67. package/dist/grpc/proto/sui/rpc/v2/transaction.mjs.map +1 -1
  68. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
  69. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs +4 -4
  70. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs.map +1 -1
  71. package/dist/grpc/proto/types.d.mts +3 -2
  72. package/dist/grpc/proto/types.mjs +11 -1
  73. package/dist/grpc/proto/types.mjs.map +1 -1
  74. package/dist/jsonRpc/types/params.d.mts +5 -5
  75. package/dist/transactions/Transaction.d.mts +7 -7
  76. package/dist/transactions/Transaction.d.mts.map +1 -1
  77. package/dist/transactions/data/internal.d.mts +109 -109
  78. package/dist/transactions/data/internal.d.mts.map +1 -1
  79. package/dist/transactions/data/v1.d.mts +220 -220
  80. package/dist/transactions/data/v1.d.mts.map +1 -1
  81. package/dist/transactions/data/v2.d.mts +16 -16
  82. package/dist/transactions/data/v2.d.mts.map +1 -1
  83. package/dist/version.mjs +1 -1
  84. package/dist/version.mjs.map +1 -1
  85. package/dist/zklogin/bcs.d.mts +14 -14
  86. package/dist/zklogin/bcs.d.mts.map +1 -1
  87. package/package.json +2 -2
  88. package/src/client/core-resolver.ts +48 -13
  89. package/src/graphql/generated/queries.ts +46 -1
  90. package/src/graphql/generated/schema.graphql +49 -3
  91. package/src/graphql/generated/tada-env.ts +97 -1
  92. package/src/grpc/client.ts +3 -0
  93. package/src/grpc/proto/google/protobuf/struct.ts +1 -1
  94. package/src/grpc/proto/google/rpc/error_details.ts +4 -4
  95. package/src/grpc/proto/google/rpc/status.ts +1 -1
  96. package/src/grpc/proto/sui/forking/v1alpha/forking_service.client.ts +125 -0
  97. package/src/grpc/proto/sui/forking/v1alpha/forking_service.ts +230 -0
  98. package/src/grpc/proto/sui/rpc/v2/checkpoint.ts +1 -1
  99. package/src/grpc/proto/sui/rpc/v2/checkpoint_contents.ts +3 -3
  100. package/src/grpc/proto/sui/rpc/v2/checkpoint_summary.ts +3 -3
  101. package/src/grpc/proto/sui/rpc/v2/effects.ts +112 -6
  102. package/src/grpc/proto/sui/rpc/v2/event.ts +1 -1
  103. package/src/grpc/proto/sui/rpc/v2/executed_transaction.ts +2 -2
  104. package/src/grpc/proto/sui/rpc/v2/ledger_service.ts +3 -3
  105. package/src/grpc/proto/sui/rpc/v2/move_package.ts +19 -13
  106. package/src/grpc/proto/sui/rpc/v2/move_package_service.ts +1 -1
  107. package/src/grpc/proto/sui/rpc/v2/object.ts +7 -1
  108. package/src/grpc/proto/sui/rpc/v2/signature.ts +3 -3
  109. package/src/grpc/proto/sui/rpc/v2/signature_verification_service.ts +7 -1
  110. package/src/grpc/proto/sui/rpc/v2/state_service.ts +9 -3
  111. package/src/grpc/proto/sui/rpc/v2/system_state.ts +2 -2
  112. package/src/grpc/proto/sui/rpc/v2/transaction.ts +22 -16
  113. package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts +4 -4
  114. package/src/grpc/proto/types.ts +1 -0
  115. package/src/jsonRpc/types/params.ts +5 -5
  116. package/src/version.ts +1 -1
@@ -1,31 +1,31 @@
1
- import * as _mysten_bcs1118 from "@mysten/bcs";
1
+ import * as _mysten_bcs810 from "@mysten/bcs";
2
2
  import { InferBcsInput } from "@mysten/bcs";
3
3
 
4
4
  //#region src/zklogin/bcs.d.ts
5
- declare const zkLoginSignature: _mysten_bcs1118.BcsStruct<{
6
- inputs: _mysten_bcs1118.BcsStruct<{
7
- proofPoints: _mysten_bcs1118.BcsStruct<{
8
- a: _mysten_bcs1118.BcsType<string[], Iterable<string> & {
5
+ declare const zkLoginSignature: _mysten_bcs810.BcsStruct<{
6
+ inputs: _mysten_bcs810.BcsStruct<{
7
+ proofPoints: _mysten_bcs810.BcsStruct<{
8
+ a: _mysten_bcs810.BcsType<string[], Iterable<string> & {
9
9
  length: number;
10
10
  }, string>;
11
- b: _mysten_bcs1118.BcsType<string[][], Iterable<Iterable<string> & {
11
+ b: _mysten_bcs810.BcsType<string[][], Iterable<Iterable<string> & {
12
12
  length: number;
13
13
  }> & {
14
14
  length: number;
15
15
  }, string>;
16
- c: _mysten_bcs1118.BcsType<string[], Iterable<string> & {
16
+ c: _mysten_bcs810.BcsType<string[], Iterable<string> & {
17
17
  length: number;
18
18
  }, string>;
19
19
  }, string>;
20
- issBase64Details: _mysten_bcs1118.BcsStruct<{
21
- value: _mysten_bcs1118.BcsType<string, string, "string">;
22
- indexMod4: _mysten_bcs1118.BcsType<number, number, "u8">;
20
+ issBase64Details: _mysten_bcs810.BcsStruct<{
21
+ value: _mysten_bcs810.BcsType<string, string, "string">;
22
+ indexMod4: _mysten_bcs810.BcsType<number, number, "u8">;
23
23
  }, string>;
24
- headerBase64: _mysten_bcs1118.BcsType<string, string, "string">;
25
- addressSeed: _mysten_bcs1118.BcsType<string, string, "string">;
24
+ headerBase64: _mysten_bcs810.BcsType<string, string, "string">;
25
+ addressSeed: _mysten_bcs810.BcsType<string, string, "string">;
26
26
  }, string>;
27
- maxEpoch: _mysten_bcs1118.BcsType<string, string | number | bigint, "u64">;
28
- userSignature: _mysten_bcs1118.BcsType<Uint8Array<ArrayBufferLike>, Iterable<number>, "vector<u8>">;
27
+ maxEpoch: _mysten_bcs810.BcsType<string, string | number | bigint, "u64">;
28
+ userSignature: _mysten_bcs810.BcsType<Uint8Array<ArrayBufferLike>, Iterable<number>, "vector<u8>">;
29
29
  }, string>;
30
30
  type ZkLoginSignature = InferBcsInput<typeof zkLoginSignature>;
31
31
  type ZkLoginSignatureInputs = ZkLoginSignature['inputs'];
@@ -1 +1 @@
1
- {"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/zklogin/bcs.ts"],"mappings":";;;;cAMa,gBAAA,kBAAgB,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAkBjB,gBAAA,GAAmB,aAAA,QAAqB,gBAAA;AAAA,KACxC,sBAAA,GAAyB,gBAAA"}
1
+ {"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/zklogin/bcs.ts"],"mappings":";;;;cAMa,gBAAA,iBAAgB,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAkBjB,gBAAA,GAAmB,aAAA,QAAqB,gBAAA;AAAA,KACxC,sBAAA,GAAyB,gBAAA"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Mysten Labs <build@mystenlabs.com>",
4
4
  "description": "Sui TypeScript API",
5
5
  "homepage": "https://sdk.mystenlabs.com",
6
- "version": "2.16.2",
6
+ "version": "2.17.0",
7
7
  "license": "Apache-2.0",
8
8
  "sideEffects": false,
9
9
  "files": [
@@ -178,7 +178,7 @@
178
178
  "codegen:version": "node genversion.mjs",
179
179
  "codegen:grpc": "rm -rf src/grpc/proto && mkdir src/grpc/proto && pnpm codegen:grpc-protoc && pnpm codegen:grpc-header && pnpm codegen:grpc-extensions && pnpm codegen:grpc-types",
180
180
  "codegen:grpc-types": "tsx scripts/generate-grpc-types.ts",
181
- "codegen:grpc-protoc": "protoc --ts_out ./src/grpc/proto --ts_opt force_server_none --ts_opt optimize_code_size --ts_opt ts_nocheck -I ../../../sui-apis/proto -I ../../../sui-apis/proto ../../../sui-apis/proto/sui/rpc/v2/*.proto ../../../sui-apis/proto/google/*/*.proto",
181
+ "codegen:grpc-protoc": "protoc --ts_out ./src/grpc/proto --ts_opt force_server_none --ts_opt optimize_code_size --ts_opt ts_nocheck -I ../../../sui-apis/proto -I ../../../sui/crates/sui-fork/proto ../../../sui-apis/proto/sui/rpc/v2/*.proto ../../../sui-apis/proto/google/*/*.proto ../../../sui/crates/sui-fork/proto/sui/forking/v1alpha/*.proto",
182
182
  "codegen:grpc-header": "find src/grpc/proto -type f -exec sh -c 'echo \"// Copyright (c) Mysten Labs, Inc.\\n// SPDX-License-Identifier: Apache-2.0\\n\" | cat - {} > temp && mv temp {}' \\;",
183
183
  "codegen:grpc-extensions": "find src/grpc/proto -name '*.ts' | xargs sed -i '' -E 's/from \"(\\.[^\"]+)\"/from \"\\1.js\"/g'",
184
184
  "build": "rm -rf dist && node genversion.mjs && tsc --noEmit && tsdown",
@@ -84,7 +84,18 @@ export async function coreClientResolveTransactionPlugin(
84
84
  }
85
85
  }
86
86
 
87
- const needsSystemState = needsGasPrice || (needsPayment && usesGasCoin);
87
+ // `setGasBudget` simulates with `payment: []` whenever it has to compute a
88
+ // budget (i.e. one wasn't preset). The validator's replay-protection check
89
+ // then requires either a `ValidDuring` expiration or at least one
90
+ // "address-owned" input — an `ImmOrOwnedMoveObject` whose owner is
91
+ // `AddressOwner`, which we can't tell from `Immutable` without owner info we
92
+ // don't track. Provide a simulate-only `ValidDuring` whenever we'll actually
93
+ // simulate and one isn't user-set.
94
+ const needsSimulateExpiration =
95
+ !options.onlyTransactionKind && !transactionData.expiration && !transactionData.gasData.budget;
96
+ const needsSystemState =
97
+ needsGasPrice || (needsPayment && usesGasCoin) || needsSimulateExpiration;
98
+ const needsChainId = (needsPayment && usesGasCoin) || needsSimulateExpiration;
88
99
  const [, systemStateResult, balanceResult, coinsResult, chainIdResult] = await Promise.all([
89
100
  normalizeInputs(transactionData, client),
90
101
  needsSystemState ? client.core.getCurrentSystemState() : null,
@@ -92,19 +103,25 @@ export async function coreClientResolveTransactionPlugin(
92
103
  needsPayment && gasPayer
93
104
  ? client.core.listCoins({ owner: gasPayer, coinType: SUI_TYPE_ARG })
94
105
  : null,
95
- needsPayment && usesGasCoin ? client.core.getChainIdentifier() : null,
106
+ needsChainId ? client.core.getChainIdentifier() : null,
96
107
  ]);
97
108
 
98
109
  await resolveObjectReferences(transactionData, client);
99
110
 
100
111
  if (!options.onlyTransactionKind) {
101
112
  const systemState = systemStateResult?.systemState ?? null;
113
+ const chainIdentifier = chainIdResult?.chainIdentifier ?? null;
102
114
 
103
115
  if (systemState && !transactionData.gasData.price) {
104
116
  transactionData.gasData.price = systemState.referenceGasPrice;
105
117
  }
106
118
 
107
- await setGasBudget(transactionData, client);
119
+ const simulateExpiration =
120
+ needsSimulateExpiration && systemState && chainIdentifier
121
+ ? buildValidDuringExpiration(systemState, chainIdentifier)
122
+ : undefined;
123
+
124
+ await setGasBudget(transactionData, client, simulateExpiration);
108
125
 
109
126
  if (needsPayment) {
110
127
  if (!balanceResult || !coinsResult) {
@@ -119,25 +136,24 @@ export async function coreClientResolveTransactionPlugin(
119
136
  usesGasCoin,
120
137
  withdrawals,
121
138
  gasPayer: gasPayer!,
122
- chainIdentifier: chainIdResult?.chainIdentifier ?? null,
139
+ chainIdentifier,
123
140
  epoch: systemState?.epoch ?? null,
124
141
  });
125
142
  }
126
143
 
127
144
  if (!transactionData.expiration && transactionData.gasData.payment?.length === 0) {
128
- await setExpiration(
129
- transactionData,
130
- client,
131
- systemState,
132
- chainIdResult?.chainIdentifier ?? null,
133
- );
145
+ await setExpiration(transactionData, client, systemState, chainIdentifier);
134
146
  }
135
147
  }
136
148
 
137
149
  return await next();
138
150
  }
139
151
 
140
- async function setGasBudget(transactionData: TransactionDataBuilder, client: ClientWithCoreApi) {
152
+ async function setGasBudget(
153
+ transactionData: TransactionDataBuilder,
154
+ client: ClientWithCoreApi,
155
+ simulateExpiration?: ValidDuringExpiration,
156
+ ) {
141
157
  if (transactionData.gasData.budget) {
142
158
  return;
143
159
  }
@@ -149,6 +165,7 @@ async function setGasBudget(transactionData: TransactionDataBuilder, client: Cli
149
165
  budget: String(MAX_GAS),
150
166
  payment: [],
151
167
  },
168
+ ...(simulateExpiration && { expiration: simulateExpiration }),
152
169
  },
153
170
  }),
154
171
  include: { effects: true },
@@ -243,9 +260,27 @@ async function setExpiration(
243
260
  existingChainIdentifier ?? client.core.getChainIdentifier().then((r) => r.chainIdentifier),
244
261
  systemState ?? client.core.getCurrentSystemState().then((r) => r.systemState),
245
262
  ]);
246
- const currentEpoch = BigInt(resolvedSystemState.epoch);
263
+ transactionData.expiration = buildValidDuringExpiration(resolvedSystemState, chainIdentifier);
264
+ }
247
265
 
248
- transactionData.expiration = {
266
+ type ValidDuringExpiration = {
267
+ $kind: 'ValidDuring';
268
+ ValidDuring: {
269
+ minEpoch: string;
270
+ maxEpoch: string;
271
+ minTimestamp: null;
272
+ maxTimestamp: null;
273
+ chain: string;
274
+ nonce: number;
275
+ };
276
+ };
277
+
278
+ function buildValidDuringExpiration(
279
+ systemState: SystemStateData,
280
+ chainIdentifier: string,
281
+ ): ValidDuringExpiration {
282
+ const currentEpoch = BigInt(systemState.epoch);
283
+ return {
249
284
  $kind: 'ValidDuring',
250
285
  ValidDuring: {
251
286
  minEpoch: String(currentEpoch),
@@ -1991,6 +1991,14 @@ export type Input = {
1991
1991
  ix?: Maybe<Scalars['Int']['output']>;
1992
1992
  };
1993
1993
 
1994
+ /** An enum that specifies the intent scope for signature verification. */
1995
+ export enum IntentScope {
1996
+ /** Indicates that the bytes are to be parsed as a personal message. */
1997
+ PersonalMessage = 'PERSONAL_MESSAGE',
1998
+ /** Indicates that the bytes are to be parsed as transaction data bytes. */
1999
+ TransactionData = 'TRANSACTION_DATA'
2000
+ }
2001
+
1994
2002
  /** Information used by a package to link to a specific version of its dependency. */
1995
2003
  export type Linkage = {
1996
2004
  __typename?: 'Linkage';
@@ -3706,7 +3714,9 @@ export type Query = {
3706
3714
  /** The network's genesis checkpoint digest (uniquely identifies the network), Base58-encoded. */
3707
3715
  chainIdentifier: Scalars['String']['output'];
3708
3716
  /**
3709
- * Fetch a checkpoint by its sequence number, or the latest checkpoint if no sequence number is provided.
3717
+ * Fetch a checkpoint by its sequence number or digest, or the latest checkpoint if neither is provided.
3718
+ *
3719
+ * It is an error to specify both `sequenceNumber` and `digest`.
3710
3720
  *
3711
3721
  * Returns `null` if the checkpoint does not exist in the store, either because it never existed or because it was pruned.
3712
3722
  */
@@ -3882,6 +3892,22 @@ export type Query = {
3882
3892
  * Fails if the type is malformed, returns `null` if a type mentioned does not exist.
3883
3893
  */
3884
3894
  type?: Maybe<MoveType>;
3895
+ /**
3896
+ * Verify a signature is from the given `author`.
3897
+ *
3898
+ * Supports all signature types: Ed25519, Secp256k1, Secp256r1, MultiSig, ZkLogin, and
3899
+ * Passkey.
3900
+ *
3901
+ * Returns successfully if the signature is valid. If the signature is invalid, returns an
3902
+ * error with the reason for the failure.
3903
+ *
3904
+ * - `message` is either a serialized personal message or `TransactionData`, Base64-encoded.
3905
+ * - `signature` is a serialized signature, also Base64-encoded.
3906
+ * - `intentScope` indicates whether `message` is to be parsed as a personal message or
3907
+ * `TransactionData`.
3908
+ * - `author` is the signer's address.
3909
+ */
3910
+ verifySignature?: Maybe<SignatureVerifyResult>;
3885
3911
  /**
3886
3912
  * Verify a zkLogin signature is from the given `author`.
3887
3913
  *
@@ -3891,6 +3917,7 @@ export type Query = {
3891
3917
  * - `signature` is a serialized zkLogin signature, also Base64-encoded.
3892
3918
  * - `intentScope` indicates whether `bytes` are to be parsed as a personal message or `TransactionData`.
3893
3919
  * - `author` is the signer's address.
3920
+ * @deprecated Use `verifySignature` instead, which supports all signature types.
3894
3921
  */
3895
3922
  verifyZkLoginSignature?: Maybe<ZkLoginVerifyResult>;
3896
3923
  };
@@ -3905,6 +3932,7 @@ export type QueryAddressArgs = {
3905
3932
 
3906
3933
 
3907
3934
  export type QueryCheckpointArgs = {
3935
+ digest?: InputMaybe<Scalars['String']['input']>;
3908
3936
  sequenceNumber?: InputMaybe<Scalars['UInt53']['input']>;
3909
3937
  };
3910
3938
 
@@ -4084,6 +4112,14 @@ export type QueryTypeArgs = {
4084
4112
  };
4085
4113
 
4086
4114
 
4115
+ export type QueryVerifySignatureArgs = {
4116
+ author: Scalars['SuiAddress']['input'];
4117
+ intentScope: IntentScope;
4118
+ message: Scalars['Base64']['input'];
4119
+ signature: Scalars['Base64']['input'];
4120
+ };
4121
+
4122
+
4087
4123
  export type QueryVerifyZkLoginSignatureArgs = {
4088
4124
  author: Scalars['SuiAddress']['input'];
4089
4125
  bytes: Scalars['Base64']['input'];
@@ -4308,6 +4344,13 @@ export type SharedInput = {
4308
4344
  /** The structured details of a signature, varying by scheme. */
4309
4345
  export type SignatureScheme = Ed25519Signature | MultisigSignature | PasskeySignature | Secp256K1Signature | Secp256R1Signature | ZkLoginSignature;
4310
4346
 
4347
+ /** The result of signature verification. */
4348
+ export type SignatureVerifyResult = {
4349
+ __typename?: 'SignatureVerifyResult';
4350
+ /** Whether the signature was verified successfully. */
4351
+ success?: Maybe<Scalars['Boolean']['output']>;
4352
+ };
4353
+
4311
4354
  /** The result of simulating a transaction, including the predicted effects. */
4312
4355
  export type SimulationResult = {
4313
4356
  __typename?: 'SimulationResult';
@@ -4435,6 +4478,8 @@ export type TransactionEffects = {
4435
4478
  transaction?: Maybe<Transaction>;
4436
4479
  /** The unchanged consensus-managed objects that were referenced by this transaction. */
4437
4480
  unchangedConsensusObjects?: Maybe<UnchangedConsensusObjectConnection>;
4481
+ /** The schema version of the effects struct. */
4482
+ version?: Maybe<Scalars['Int']['output']>;
4438
4483
  };
4439
4484
 
4440
4485
 
@@ -1808,6 +1808,20 @@ type Input {
1808
1808
  }
1809
1809
 
1810
1810
 
1811
+ """
1812
+ An enum that specifies the intent scope for signature verification.
1813
+ """
1814
+ enum IntentScope {
1815
+ """
1816
+ Indicates that the bytes are to be parsed as transaction data bytes.
1817
+ """
1818
+ TRANSACTION_DATA
1819
+ """
1820
+ Indicates that the bytes are to be parsed as a personal message.
1821
+ """
1822
+ PERSONAL_MESSAGE
1823
+ }
1824
+
1811
1825
  """
1812
1826
  Arbitrary JSON data.
1813
1827
  """
@@ -3486,11 +3500,13 @@ type Query {
3486
3500
  """
3487
3501
  chainIdentifier: String!
3488
3502
  """
3489
- Fetch a checkpoint by its sequence number, or the latest checkpoint if no sequence number is provided.
3503
+ Fetch a checkpoint by its sequence number or digest, or the latest checkpoint if neither is provided.
3504
+
3505
+ It is an error to specify both `sequenceNumber` and `digest`.
3490
3506
 
3491
3507
  Returns `null` if the checkpoint does not exist in the store, either because it never existed or because it was pruned.
3492
3508
  """
3493
- checkpoint(sequenceNumber: UInt53): Checkpoint
3509
+ checkpoint(sequenceNumber: UInt53, digest: String): Checkpoint
3494
3510
  """
3495
3511
  Paginate checkpoints in the network, optionally bounded to checkpoints in the given epoch.
3496
3512
  """
@@ -3681,6 +3697,22 @@ type Query {
3681
3697
  """
3682
3698
  type(type: String!): MoveType
3683
3699
  """
3700
+ Verify a signature is from the given `author`.
3701
+
3702
+ Supports all signature types: Ed25519, Secp256k1, Secp256r1, MultiSig, ZkLogin, and
3703
+ Passkey.
3704
+
3705
+ Returns successfully if the signature is valid. If the signature is invalid, returns an
3706
+ error with the reason for the failure.
3707
+
3708
+ - `message` is either a serialized personal message or `TransactionData`, Base64-encoded.
3709
+ - `signature` is a serialized signature, also Base64-encoded.
3710
+ - `intentScope` indicates whether `message` is to be parsed as a personal message or
3711
+ `TransactionData`.
3712
+ - `author` is the signer's address.
3713
+ """
3714
+ verifySignature(message: Base64!, signature: Base64!, intentScope: IntentScope!, author: SuiAddress!): SignatureVerifyResult
3715
+ """
3684
3716
  Verify a zkLogin signature is from the given `author`.
3685
3717
 
3686
3718
  Returns successfully if the signature is valid. If the signature is invalid, returns an error with the reason for the failure.
@@ -3690,7 +3722,7 @@ type Query {
3690
3722
  - `intentScope` indicates whether `bytes` are to be parsed as a personal message or `TransactionData`.
3691
3723
  - `author` is the signer's address.
3692
3724
  """
3693
- verifyZkLoginSignature(bytes: Base64!, signature: Base64!, intentScope: ZkLoginIntentScope!, author: SuiAddress!): ZkLoginVerifyResult
3725
+ verifyZkLoginSignature(bytes: Base64!, signature: Base64!, intentScope: ZkLoginIntentScope!, author: SuiAddress!): ZkLoginVerifyResult @deprecated(reason: "Use `verifySignature` instead, which supports all signature types.")
3694
3726
  }
3695
3727
 
3696
3728
  """
@@ -3976,6 +4008,16 @@ The structured details of a signature, varying by scheme.
3976
4008
  """
3977
4009
  union SignatureScheme = Ed25519Signature | Secp256K1Signature | Secp256R1Signature | MultisigSignature | ZkLoginSignature | PasskeySignature
3978
4010
 
4011
+ """
4012
+ The result of signature verification.
4013
+ """
4014
+ type SignatureVerifyResult {
4015
+ """
4016
+ Whether the signature was verified successfully.
4017
+ """
4018
+ success: Boolean
4019
+ }
4020
+
3979
4021
  """
3980
4022
  The result of simulating a transaction, including the predicted effects.
3981
4023
  """
@@ -4194,6 +4236,10 @@ type TransactionEffects {
4194
4236
  The unchanged consensus-managed objects that were referenced by this transaction.
4195
4237
  """
4196
4238
  unchangedConsensusObjects(first: Int, after: String, last: Int, before: String): UnchangedConsensusObjectConnection
4239
+ """
4240
+ The schema version of the effects struct.
4241
+ """
4242
+ version: Int
4197
4243
  }
4198
4244
 
4199
4245
  input TransactionFilter {
@@ -5480,6 +5480,20 @@ const introspection = {
5480
5480
  "kind": "SCALAR",
5481
5481
  "name": "Int"
5482
5482
  },
5483
+ {
5484
+ "kind": "ENUM",
5485
+ "name": "IntentScope",
5486
+ "enumValues": [
5487
+ {
5488
+ "name": "TRANSACTION_DATA",
5489
+ "isDeprecated": false
5490
+ },
5491
+ {
5492
+ "name": "PERSONAL_MESSAGE",
5493
+ "isDeprecated": false
5494
+ }
5495
+ ]
5496
+ },
5483
5497
  {
5484
5498
  "kind": "SCALAR",
5485
5499
  "name": "JSON"
@@ -10555,6 +10569,13 @@ const introspection = {
10555
10569
  "name": "Checkpoint"
10556
10570
  },
10557
10571
  "args": [
10572
+ {
10573
+ "name": "digest",
10574
+ "type": {
10575
+ "kind": "SCALAR",
10576
+ "name": "String"
10577
+ }
10578
+ },
10558
10579
  {
10559
10580
  "name": "sequenceNumber",
10560
10581
  "type": {
@@ -11475,6 +11496,56 @@ const introspection = {
11475
11496
  ],
11476
11497
  "isDeprecated": false
11477
11498
  },
11499
+ {
11500
+ "name": "verifySignature",
11501
+ "type": {
11502
+ "kind": "OBJECT",
11503
+ "name": "SignatureVerifyResult"
11504
+ },
11505
+ "args": [
11506
+ {
11507
+ "name": "author",
11508
+ "type": {
11509
+ "kind": "NON_NULL",
11510
+ "ofType": {
11511
+ "kind": "SCALAR",
11512
+ "name": "SuiAddress"
11513
+ }
11514
+ }
11515
+ },
11516
+ {
11517
+ "name": "intentScope",
11518
+ "type": {
11519
+ "kind": "NON_NULL",
11520
+ "ofType": {
11521
+ "kind": "ENUM",
11522
+ "name": "IntentScope"
11523
+ }
11524
+ }
11525
+ },
11526
+ {
11527
+ "name": "message",
11528
+ "type": {
11529
+ "kind": "NON_NULL",
11530
+ "ofType": {
11531
+ "kind": "SCALAR",
11532
+ "name": "Base64"
11533
+ }
11534
+ }
11535
+ },
11536
+ {
11537
+ "name": "signature",
11538
+ "type": {
11539
+ "kind": "NON_NULL",
11540
+ "ofType": {
11541
+ "kind": "SCALAR",
11542
+ "name": "Base64"
11543
+ }
11544
+ }
11545
+ }
11546
+ ],
11547
+ "isDeprecated": false
11548
+ },
11478
11549
  {
11479
11550
  "name": "verifyZkLoginSignature",
11480
11551
  "type": {
@@ -11523,7 +11594,7 @@ const introspection = {
11523
11594
  }
11524
11595
  }
11525
11596
  ],
11526
- "isDeprecated": false
11597
+ "isDeprecated": true
11527
11598
  }
11528
11599
  ],
11529
11600
  "interfaces": []
@@ -12085,6 +12156,22 @@ const introspection = {
12085
12156
  }
12086
12157
  ]
12087
12158
  },
12159
+ {
12160
+ "kind": "OBJECT",
12161
+ "name": "SignatureVerifyResult",
12162
+ "fields": [
12163
+ {
12164
+ "name": "success",
12165
+ "type": {
12166
+ "kind": "SCALAR",
12167
+ "name": "Boolean"
12168
+ },
12169
+ "args": [],
12170
+ "isDeprecated": false
12171
+ }
12172
+ ],
12173
+ "interfaces": []
12174
+ },
12088
12175
  {
12089
12176
  "kind": "OBJECT",
12090
12177
  "name": "SimulationResult",
@@ -12722,6 +12809,15 @@ const introspection = {
12722
12809
  }
12723
12810
  ],
12724
12811
  "isDeprecated": false
12812
+ },
12813
+ {
12814
+ "name": "version",
12815
+ "type": {
12816
+ "kind": "SCALAR",
12817
+ "name": "Int"
12818
+ },
12819
+ "args": [],
12820
+ "isDeprecated": false
12725
12821
  }
12726
12822
  ],
12727
12823
  "interfaces": []
@@ -17,6 +17,7 @@ import { DynamicField_DynamicFieldKind } from './proto/sui/rpc/v2/state_service.
17
17
  import { normalizeStructTag } from '../utils/sui-types.js';
18
18
  import { fromBase64, toBase64 } from '@mysten/utils';
19
19
  import { NameServiceClient } from './proto/sui/rpc/v2/name_service.client.js';
20
+ import { ForkingServiceClient } from './proto/sui/forking/v1alpha/forking_service.client.js';
20
21
  import type { TransactionPlugin } from '../transactions/index.js';
21
22
 
22
23
  interface SuiGrpcTransportOptions extends GrpcWebOptions {
@@ -68,6 +69,7 @@ export class SuiGrpcClient extends BaseClient implements SuiClientTypes.Transpor
68
69
  movePackageService: MovePackageServiceClient;
69
70
  signatureVerificationService: SignatureVerificationServiceClient;
70
71
  nameService: NameServiceClient;
72
+ forkingService: ForkingServiceClient;
71
73
 
72
74
  get [SUI_CLIENT_BRAND]() {
73
75
  return true;
@@ -85,6 +87,7 @@ export class SuiGrpcClient extends BaseClient implements SuiClientTypes.Transpor
85
87
  this.movePackageService = new MovePackageServiceClient(transport);
86
88
  this.signatureVerificationService = new SignatureVerificationServiceClient(transport);
87
89
  this.nameService = new NameServiceClient(transport);
90
+ this.forkingService = new ForkingServiceClient(transport);
88
91
 
89
92
  this.core = new GrpcCoreClient({
90
93
  client: this,
@@ -298,7 +298,7 @@ export const Value = new Value$Type();
298
298
  class ListValue$Type extends MessageType<ListValue> {
299
299
  constructor() {
300
300
  super('google.protobuf.ListValue', [
301
- { no: 1, name: 'values', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Value },
301
+ { no: 1, name: 'values', kind: 'message', repeat: 2 /*RepeatType.UNPACKED*/, T: () => Value },
302
302
  ]);
303
303
  }
304
304
  /**
@@ -505,7 +505,7 @@ class QuotaFailure$Type extends MessageType<QuotaFailure> {
505
505
  no: 1,
506
506
  name: 'violations',
507
507
  kind: 'message',
508
- repeat: 1 /*RepeatType.PACKED*/,
508
+ repeat: 2 /*RepeatType.UNPACKED*/,
509
509
  T: () => QuotaFailure_Violation,
510
510
  },
511
511
  ]);
@@ -536,7 +536,7 @@ class PreconditionFailure$Type extends MessageType<PreconditionFailure> {
536
536
  no: 1,
537
537
  name: 'violations',
538
538
  kind: 'message',
539
- repeat: 1 /*RepeatType.PACKED*/,
539
+ repeat: 2 /*RepeatType.UNPACKED*/,
540
540
  T: () => PreconditionFailure_Violation,
541
541
  },
542
542
  ]);
@@ -568,7 +568,7 @@ class BadRequest$Type extends MessageType<BadRequest> {
568
568
  no: 1,
569
569
  name: 'field_violations',
570
570
  kind: 'message',
571
- repeat: 1 /*RepeatType.PACKED*/,
571
+ repeat: 2 /*RepeatType.UNPACKED*/,
572
572
  T: () => BadRequest_FieldViolation,
573
573
  },
574
574
  ]);
@@ -629,7 +629,7 @@ class Help$Type extends MessageType<Help> {
629
629
  no: 1,
630
630
  name: 'links',
631
631
  kind: 'message',
632
- repeat: 1 /*RepeatType.PACKED*/,
632
+ repeat: 2 /*RepeatType.UNPACKED*/,
633
633
  T: () => Help_Link,
634
634
  },
635
635
  ]);
@@ -64,7 +64,7 @@ class Status$Type extends MessageType<Status> {
64
64
  super('google.rpc.Status', [
65
65
  { no: 1, name: 'code', kind: 'scalar', T: 5 /*ScalarType.INT32*/ },
66
66
  { no: 2, name: 'message', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
67
- { no: 3, name: 'details', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Any },
67
+ { no: 3, name: 'details', kind: 'message', repeat: 2 /*RepeatType.UNPACKED*/, T: () => Any },
68
68
  ]);
69
69
  }
70
70
  }