@mysten/docs 0.1.43 → 0.1.45

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.
@@ -1,16 +1,17 @@
1
1
  # @mysten/kiosk
2
2
 
3
- > Migrate @mysten/kiosk to 2.0 with client extension pattern and KioskTransaction.
3
+ > Migrate @mysten/kiosk to 2.0 with client extension pattern and KioskTransaction
4
4
 
5
5
  This package now exports a client extension that integrates with Sui clients.
6
6
 
7
- > **Note:** The Kiosk SDK requires `SuiJsonRpcClient` or `SuiGraphQLClient`. It does not work with
8
- > `SuiGrpcClient` because it uses event queries that are not available in gRPC.
7
+ > **Note:** The Kiosk SDK accepts `SuiGrpcClient`, `SuiGraphQLClient`, and other clients that implement
8
+ > `ClientWithCoreApi`. Use `SuiGrpcClient` for new Kiosk code. The gRPC object API returns Display
9
+ > v2 metadata; use GraphQL or JSON-RPC for object types that still rely on legacy Display metadata.
9
10
 
10
11
  ```diff
11
12
  - import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
12
13
  - import { KioskClient, Network } from '@mysten/kiosk';
13
- + import { SuiJsonRpcClient, getJsonRpcFullnodeUrl } from '@mysten/sui/jsonRpc'; // or SuiGraphQLClient
14
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
14
15
  + import { kiosk } from '@mysten/kiosk';
15
16
 
16
17
  - const suiClient = new SuiClient({ url: getFullnodeUrl('mainnet') });
@@ -18,8 +19,8 @@ This package now exports a client extension that integrates with Sui clients.
18
19
  - client: suiClient,
19
20
  - network: Network.MAINNET,
20
21
  - });
21
- + const client = new SuiJsonRpcClient({
22
- + url: getJsonRpcFullnodeUrl('mainnet'),
22
+ + const client = new SuiGrpcClient({
23
+ + baseUrl: 'https://fullnode.mainnet.sui.io:443',
23
24
  + network: 'mainnet',
24
25
  + }).$extend(kiosk());
25
26
 
@@ -100,14 +101,14 @@ The low-level helper functions have been removed in favor of the `KioskTransacti
100
101
  ```diff
101
102
  - import { createKiosk, shareKiosk, placeAndList } from '@mysten/kiosk';
102
103
  + import { kiosk, KioskTransaction } from '@mysten/kiosk';
103
- + import { SuiJsonRpcClient, getJsonRpcFullnodeUrl } from '@mysten/sui/jsonRpc';
104
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
104
105
 
105
106
  - const [kiosk, cap] = createKiosk(tx);
106
107
  - shareKiosk(tx, kiosk);
107
108
  - placeAndList(tx, itemType, kiosk, cap, item, price);
108
109
 
109
- + const client = new SuiJsonRpcClient({
110
- + url: getJsonRpcFullnodeUrl('mainnet'),
110
+ + const client = new SuiGrpcClient({
111
+ + baseUrl: 'https://fullnode.mainnet.sui.io:443',
111
112
  + network: 'mainnet',
112
113
  + }).$extend(kiosk());
113
114
  +
@@ -1,6 +1,6 @@
1
1
  # SDK Maintainers
2
2
 
3
- > Migration guide for SDK maintainers and library authors upgrading to 2.0.
3
+ > Migration guide for SDK maintainers and library authors upgrading to 2.0
4
4
 
5
5
  # Upgrading SDKs to @mysten/sui@2.0.0
6
6
 
@@ -10,8 +10,8 @@ For comprehensive SDK development patterns, see the [Building SDKs guide](/sui/s
10
10
 
11
11
  ## Use `ClientWithCoreApi`
12
12
 
13
- Accept `ClientWithCoreApi` instead of `SuiClient` to support all 3 Sui clients (JSON-RPC, GraphQL,
14
- gRPC):
13
+ Accept `ClientWithCoreApi` instead of `SuiClient` so applications can pass a `SuiGrpcClient`,
14
+ `SuiGraphQLClient`, or a legacy `SuiJsonRpcClient` during migration:
15
15
 
16
16
  ```diff
17
17
  - import { SuiClient } from '@mysten/sui/client';
@@ -24,7 +24,9 @@ gRPC):
24
24
 
25
25
  ## Access data through `client.core` methods
26
26
 
27
- All data access methods are namespaced under `client.core`:
27
+ SDKs should access shared client methods through `client.core`. Application code can use the same
28
+ methods at the top level of its concrete client, but `client.core` is the stable contract for
29
+ libraries that should work across transports:
28
30
 
29
31
  ```diff
30
32
  - const result = await this.client.getObject({ objectId });
@@ -34,13 +36,17 @@ All data access methods are namespaced under `client.core`:
34
36
  + const result = await this.client.core.listOwnedObjects({ owner });
35
37
  ```
36
38
 
37
- | v1.x Method | v2.0 Method |
38
- | -------------------------------- | --------------------------------- |
39
- | `client.getObject()` | `client.core.getObject()` |
40
- | `client.getOwnedObjects()` | `client.core.listOwnedObjects()` |
41
- | `client.getDynamicFieldObject()` | `client.core.getDynamicField()` |
42
- | `client.getDynamicFields()` | `client.core.listDynamicFields()` |
43
- | `client.multiGetObjects()` | `client.core.getObjects()` |
39
+ | v1.x Method | v2.0 Method |
40
+ | -------------------------------- | ------------------------------------------------------------------------ |
41
+ | `client.getObject()` | `client.core.getObject()` |
42
+ | `client.getOwnedObjects()` | `client.core.listOwnedObjects()` |
43
+ | `client.getDynamicFieldObject()` | `client.core.getDynamicField()` or `client.core.getDynamicObjectField()` |
44
+ | `client.getDynamicFields()` | `client.core.listDynamicFields()` |
45
+ | `client.multiGetObjects()` | `client.core.getObjects()` |
46
+
47
+ Use `getDynamicField()` for regular dynamic fields and when you need the field entry or BCS-encoded
48
+ value. Use `getDynamicObjectField()` only for dynamic object fields when you want the referenced
49
+ child object returned directly.
44
50
 
45
51
  See the [Core API documentation](/sui/clients/core) for all available methods.
46
52
 
@@ -1,51 +1,63 @@
1
1
  # @mysten/sui
2
2
 
3
- > Migrate @mysten/sui from 1.x to 2.0 with new client APIs and BCS changes.
3
+ > Migrate @mysten/sui from 1.x to 2.0 with gRPC clients, Core API, and BCS changes
4
4
 
5
5
  ## Removal of `SuiClient` exports
6
6
 
7
- The `@mysten/sui/client` export path has been removed. All JSON-RPC client functionality is now
8
- exported from `@mysten/sui/jsonRpc`.
7
+ The old `SuiClient` export has been removed from `@mysten/sui/client`. For application code, migrate
8
+ to [`SuiGrpcClient`](/sui/clients/grpc) and use top-level methods such as `client.getObject()`,
9
+ `client.listCoins()`, and `client.signAndExecuteTransaction()`.
10
+
11
+ Legacy JSON-RPC functionality moved to `@mysten/sui/jsonRpc`, but JSON-RPC APIs are deprecated in
12
+ the Sui TypeScript SDK. Use the JSON-RPC exports only when maintaining code that still needs the old
13
+ JSON-RPC method names or response shapes during migration.
9
14
 
10
15
  **Removed exports:**
11
16
 
12
- - `SuiClient` (use `SuiJsonRpcClient` instead)
13
- - `SuiClientOptions` (use `SuiJsonRpcClientOptions` instead)
14
- - `isSuiClient` (use `isSuiJsonRpcClient` instead)
15
- - `SuiTransport` (use `JsonRpcTransport` instead)
17
+ - `SuiClient` (use `SuiGrpcClient`; legacy JSON-RPC code can use `SuiJsonRpcClient`)
18
+ - `SuiClientOptions` (use `SuiGrpcClientOptions`; legacy JSON-RPC code can use
19
+ `SuiJsonRpcClientOptions`)
20
+ - `isSuiClient` (use `isSuiGrpcClient`, `isSuiGraphQLClient`, or legacy `isSuiJsonRpcClient`)
21
+ - `SuiTransport` (legacy JSON-RPC code can use `JsonRpcTransport`)
16
22
  - `SuiTransportRequestOptions` (use `JsonRpcTransportRequestOptions` instead)
17
- - `SuiTransportSubscribeOptions` (use `JsonRpcTransportSubscribeOptions` instead)
23
+ - `SuiTransportSubscribeOptions` (removed; use the gRPC subscription service for streaming APIs)
18
24
  - `SuiHTTPTransportOptions` (use `JsonRpcHTTPTransportOptions` instead)
19
25
  - `SuiHTTPTransport` (use `JsonRpcHTTPTransport` instead)
20
- - `getFullnodeUrl` (use `getJsonRpcFullnodeUrl` instead)
26
+ - `getFullnodeUrl` (pass the full node URL to `SuiGrpcClient.baseUrl`; legacy JSON-RPC code can use
27
+ `getJsonRpcFullnodeUrl`)
21
28
  - All JSON-RPC types (now exported from `@mysten/sui/jsonRpc`)
22
29
 
23
30
  **Migration:**
24
31
 
25
32
  ```diff
26
33
  - import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
27
- + import { SuiJsonRpcClient, getJsonRpcFullnodeUrl } from '@mysten/sui/jsonRpc';
34
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
28
35
 
29
36
  - const client = new SuiClient({
30
37
  - url: getFullnodeUrl('devnet'),
31
- + const client = new SuiJsonRpcClient({
32
- + url: getJsonRpcFullnodeUrl('devnet'),
38
+ + const client = new SuiGrpcClient({
39
+ + baseUrl: 'https://fullnode.devnet.sui.io:443',
33
40
  network: 'devnet',
34
41
  });
35
42
  ```
36
43
 
37
44
  ## Network parameter required
38
45
 
39
- When creating a new `SuiGraphQLClient` or `SuiJsonRpcClient`, you must now provide a `network`
40
- parameter:
46
+ When creating a new `SuiGrpcClient`, `SuiGraphQLClient`, or legacy `SuiJsonRpcClient`, provide a
47
+ `network` parameter:
41
48
 
42
49
  ```ts
43
- const client = new SuiGraphQLClient({
50
+ const grpcClient = new SuiGrpcClient({
51
+ baseUrl: 'https://...',
52
+ network: 'mainnet', // Required
53
+ });
54
+
55
+ const graphqlClient = new SuiGraphQLClient({
44
56
  url: 'https://...',
45
57
  network: 'mainnet', // Required
46
58
  });
47
59
 
48
- const client = new SuiJsonRpcClient({
60
+ const jsonRpcClient = new SuiJsonRpcClient({
49
61
  url: 'https://...',
50
62
  network: 'mainnet', // Required
51
63
  });
@@ -66,11 +78,12 @@ objects.
66
78
  + effects.status.Failure.error
67
79
  ```
68
80
 
69
- **Core API** (gRPC and GraphQL responses): Uses a simplified structure with a `success` boolean:
81
+ **Core API and top-level client methods** (gRPC and GraphQL responses): Use a simplified structure
82
+ with a `success` boolean:
70
83
 
71
84
  ```typescript
72
- // Core API returns this structure
73
- const result = await client.core.getTransaction({ digest, include: { effects: true } });
85
+ // Top-level gRPC and GraphQL methods return this structure.
86
+ const result = await client.getTransaction({ digest, include: { effects: true } });
74
87
  const tx = result.Transaction ?? result.FailedTransaction;
75
88
 
76
89
  if (tx.effects.status.success) {
@@ -223,7 +236,7 @@ resolution is now built directly into the core client.
223
236
  **How it works now:**
224
237
 
225
238
  MVR name resolution happens automatically during transaction building. The SDK detects `.move` names
226
- (like `@org/package::module::Type`) and resolves them using the client's MVR resolver.
239
+ like `@org/package::module::Type` and resolves them using the client's MVR resolver.
227
240
 
228
241
  **Migration:**
229
242
 
@@ -238,11 +251,10 @@ MVR name resolution happens automatically during transaction building. The SDK d
238
251
  - })
239
252
  - );
240
253
 
241
- + import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
242
- + import type { NamedPackagesOverrides } from '@mysten/sui/client';
254
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
243
255
  +
244
- + const client = new SuiJsonRpcClient({
245
- + url: 'https://fullnode.mainnet.sui.io:443',
256
+ + const client = new SuiGrpcClient({
257
+ + baseUrl: 'https://fullnode.mainnet.sui.io:443',
246
258
  + network: 'mainnet',
247
259
  + mvr: {
248
260
  + overrides: myOverrides,
@@ -264,7 +276,8 @@ requiring `SuiJsonRpcClient` specifically.
264
276
  **Breaking changes:**
265
277
 
266
278
  - Constructor `client` parameter type changed from `SuiJsonRpcClient` to `ClientWithCoreApi`
267
- - Return type of `executeTransaction()`: `data` property renamed to `result`
279
+ - Return type of `executeTransaction()` changed from the legacy `{ digest, effects, data }` wrapper
280
+ to a Core API `TransactionResult` discriminated union returned directly
268
281
  - The second parameter changed from JSON-RPC options to core API include options
269
282
 
270
283
  **Migration:**
@@ -272,7 +285,12 @@ requiring `SuiJsonRpcClient` specifically.
272
285
  ```diff
273
286
 
274
287
  - import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
275
- + // Works with any client: SuiJsonRpcClient, SuiGrpcClient, or SuiGraphQLClient
288
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
289
+
290
+ + const client = new SuiGrpcClient({
291
+ + baseUrl: 'https://fullnode.devnet.sui.io:443',
292
+ + network: 'devnet',
293
+ + });
276
294
 
277
295
  const executor = new SerialTransactionExecutor({
278
296
  - client: jsonRpcClient,
@@ -282,10 +300,10 @@ const executor = new SerialTransactionExecutor({
282
300
 
283
301
  const result = await executor.executeTransaction(tx);
284
302
 
285
- // Accessing the transaction result (changed)
303
+ // Accessing the transaction result now returned directly
286
304
  - console.log(result.data.effects?.status.status);
287
- + const tx = result.Transaction ?? result.FailedTransaction;
288
- + console.log(tx.effects.status.success);
305
+ + const transaction = result.Transaction ?? result.FailedTransaction;
306
+ + console.log(transaction.effects.status.success);
289
307
  ```
290
308
 
291
309
  Include options have also changed:
@@ -1,13 +1,13 @@
1
1
  # @mysten/suins
2
2
 
3
- > Migrate @mysten/suins to 2.0 with client extension pattern.
3
+ > Migrate @mysten/suins to 2.0 with client extension pattern
4
4
 
5
5
  This package now exports a client extension that integrates with Sui clients.
6
6
 
7
7
  ```diff
8
8
  - import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
9
9
  - import { SuinsClient } from '@mysten/suins';
10
- + import { SuiGrpcClient } from '@mysten/sui/grpc'; // or SuiJsonRpcClient, SuiGraphQLClient
10
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
11
11
  + import { suins } from '@mysten/suins';
12
12
 
13
13
  - const suiClient = new SuiClient({ url: getFullnodeUrl('mainnet') });
@@ -1,6 +1,6 @@
1
1
  # @mysten/walrus
2
2
 
3
- > Migrate @mysten/walrus to 2.0 with required client parameter and updated API.
3
+ > Migrate @mysten/walrus to 2.0 with required client parameter and updated API
4
4
 
5
5
  ## Breaking changes
6
6
 
@@ -17,7 +17,7 @@ If you were creating `WalrusClient` directly:
17
17
 
18
18
  ```diff
19
19
  - import { WalrusClient } from '@mysten/walrus';
20
- + import { SuiGrpcClient } from '@mysten/sui/grpc'; // or SuiJsonRpcClient, SuiGraphQLClient
20
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
21
21
  + import { walrus } from '@mysten/walrus';
22
22
 
23
23
  - const walrusClient = new WalrusClient({
@@ -30,7 +30,7 @@ If you were creating `WalrusClient` directly:
30
30
  + }).$extend(walrus());
31
31
 
32
32
  - await walrusClient.getBlob(blobId);
33
- + await client.walrus.getBlob(blobId);
33
+ + await client.walrus.getBlob({ blobId });
34
34
  ```
35
35
 
36
36
  If you were passing `network` to `walrus()`, remove it:
@@ -1,9 +1,9 @@
1
1
  # @mysten/zksend
2
2
 
3
- > Migrate @mysten/zksend to 2.0 with client extension pattern and simplified API.
3
+ > Migrate @mysten/zksend to 2.0 with client extension pattern and simplified API
4
4
 
5
- This package now exports a client extension that integrates with Sui clients, enabling compatibility
6
- with gRPC, GraphQL, and JSON RPC transports.
5
+ This package now exports a client extension that integrates with Sui clients through the Core API.
6
+ Use `SuiGrpcClient` for most applications.
7
7
 
8
8
  ## Breaking changes
9
9
 
@@ -23,7 +23,7 @@ Update your code to use the client extension:
23
23
  ```diff
24
24
  - import { ZkSendLinkBuilder, ZkSendLink } from '@mysten/zksend';
25
25
  + import { zksend } from '@mysten/zksend';
26
- + import { SuiGrpcClient } from '@mysten/sui/grpc'; // or SuiJsonRpcClient, SuiGraphQLClient
26
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
27
27
 
28
28
  + const client = new SuiGrpcClient({
29
29
  + baseUrl: 'https://fullnode.testnet.sui.io:443',
@@ -84,12 +84,13 @@ const linkBuilder = client.zksend.linkBuilder({
84
84
  });
85
85
 
86
86
  // Add assets to the link
87
- linkBuilder.addSui(1_000_000_000n); // 1 SUI
87
+ linkBuilder.addClaimableMist(1_000_000_000n); // 1 SUI
88
88
 
89
- // Create the transaction
90
- const { tx, link } = await linkBuilder.build();
89
+ // Create the transaction and get the claim URL
90
+ const tx = await linkBuilder.createSendTransaction();
91
+ const linkUrl = linkBuilder.getLink();
91
92
 
92
93
  // Later, load an existing link
93
94
  const existingLink = await client.zksend.loadLinkFromUrl(linkUrl);
94
- const assets = await existingLink.getAssets();
95
+ const assets = existingLink.assets;
95
96
  ```
@@ -1,14 +1,16 @@
1
1
  # Building SDKs
2
2
 
3
- > Build custom SDKs on top of the Sui TypeScript SDK.
3
+ > Build custom SDKs on top of the Sui TypeScript SDK
4
4
 
5
5
  This guide covers recommended patterns for building TypeScript SDKs that integrate with the Sui SDK.
6
- Following these patterns ensures your SDK integrates seamlessly with the ecosystem, works across
7
- different transports (JSON-RPC, GraphQL, gRPC), and composes well with other SDKs.
6
+ Following these patterns ensures your SDK integrates seamlessly with the ecosystem, works with
7
+ `SuiGrpcClient` and `SuiGraphQLClient` through the shared Core API, and composes well with other
8
+ SDKs. Legacy JSON-RPC clients can also be supported during migration because they implement the same
9
+ Core API contract.
8
10
 
9
11
  All SDKs should depend on [`ClientWithCoreApi`](./clients/core), which is the transport-agnostic
10
- interface implemented by all Sui clients. This ensures your SDK works with any client the user
11
- chooses.
12
+ interface implemented by Sui clients. This lets application code choose one concrete client and use
13
+ top-level methods, while SDK internals use `client.core` for portable reads, writes, and queries.
12
14
 
13
15
  ## Package setup
14
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten/docs",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -28,28 +28,28 @@
28
28
  "next": "^16.2.12",
29
29
  "react": "^19.2.7",
30
30
  "react-dom": "^19.2.7",
31
- "@mysten/aws-kms-signer": "0.3.9",
32
31
  "@mysten/bcs": "2.1.0",
33
- "@mysten/dapp-kit-core": "1.6.12",
34
- "@mysten/dapp-kit": "1.1.12",
35
- "@mysten/dapp-kit-react": "2.1.14",
36
- "@mysten/enoki-connect": "1.1.12",
37
- "@mysten/deepbook-v3": "1.6.2",
38
- "@mysten/kiosk": "1.3.12",
39
- "@mysten/gcp-kms-signer": "0.2.12",
40
- "@mysten/ledger-signer": "0.2.12",
41
- "@mysten/enoki": "1.2.10",
42
- "@mysten/seal": "1.3.7",
43
- "@mysten/signers": "1.1.12",
44
- "@mysten/slush-wallet": "1.1.12",
45
- "@mysten/payment-kit": "0.2.12",
46
- "@mysten/sui": "2.23.1",
47
- "@mysten/suins": "1.2.12",
32
+ "@mysten/aws-kms-signer": "0.3.11",
33
+ "@mysten/dapp-kit": "1.1.14",
34
+ "@mysten/dapp-kit-react": "2.1.16",
35
+ "@mysten/dapp-kit-core": "1.6.14",
36
+ "@mysten/deepbook-v3": "1.6.4",
37
+ "@mysten/gcp-kms-signer": "0.2.14",
38
+ "@mysten/enoki-connect": "1.1.14",
39
+ "@mysten/kiosk": "1.4.0",
40
+ "@mysten/enoki": "1.2.12",
41
+ "@mysten/payment-kit": "0.2.14",
42
+ "@mysten/seal": "1.4.0",
43
+ "@mysten/ledger-signer": "0.2.14",
44
+ "@mysten/signers": "1.1.14",
45
+ "@mysten/sui": "2.24.0",
46
+ "@mysten/slush-wallet": "1.1.14",
47
+ "@mysten/suins": "1.2.14",
48
48
  "@mysten/utils": "0.4.0",
49
- "@mysten/wallet-standard": "0.21.12",
50
- "@mysten/webcrypto-signer": "0.2.12",
51
- "@mysten/zksend": "1.2.12",
52
- "@mysten/walrus": "1.2.12"
49
+ "@mysten/wallet-standard": "0.21.14",
50
+ "@mysten/walrus": "1.2.14",
51
+ "@mysten/zksend": "1.2.14",
52
+ "@mysten/webcrypto-signer": "0.2.14"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@tailwindcss/postcss": "^4.3.1",