@mysten/docs 0.1.44 → 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,6 +1,6 @@
1
1
  # React
2
2
 
3
- > Set up dApp Kit in a React application.
3
+ > Set up dApp Kit in a React application
4
4
 
5
5
  This guide walks you through integrating dApp Kit into a React application.
6
6
 
@@ -147,7 +147,7 @@ function TransferButton() {
147
147
  | [`useCurrentAccount`](/dapp-kit/react/hooks/use-current-account) | Currently selected account |
148
148
  | [`useCurrentWallet`](/dapp-kit/react/hooks/use-current-wallet) | Currently connected wallet |
149
149
  | [`useCurrentNetwork`](/dapp-kit/react/hooks/use-current-network) | Current network |
150
- | [`useCurrentClient`](/dapp-kit/react/hooks/use-current-client) | SuiClient for current network |
150
+ | [`useCurrentClient`](/dapp-kit/react/hooks/use-current-client) | Current Sui client instance |
151
151
  | [`useWallets`](/dapp-kit/react/hooks/use-wallets) | List of available wallets |
152
152
 
153
153
  ## Components
@@ -1,6 +1,6 @@
1
1
  # Vue
2
2
 
3
- > Set up dApp Kit in a Vue application.
3
+ > Set up dApp Kit in a Vue application
4
4
 
5
5
  This guide walks you through integrating dApp Kit into a Vue application using Web Components and
6
6
  direct store access.
@@ -174,7 +174,7 @@ Access these stores through `dAppKit.stores`:
174
174
  | ----------------- | ------------------------------------------------- |
175
175
  | `$connection` | Connection state with wallet, account, and status |
176
176
  | `$currentNetwork` | Current network string |
177
- | `$currentClient` | SuiClient for current network |
177
+ | `$currentClient` | Current Sui client instance |
178
178
  | `$wallets` | List of available wallets |
179
179
 
180
180
  See [State Management](/dapp-kit/state) for full documentation.
@@ -3,11 +3,11 @@
3
3
 
4
4
  - [Sui dApp Kit](..md): Build Sui apps with framework-agnostic core and React bindings.
5
5
  - [@mysten/create-dapp](./getting-started/create-dapp.md): Create a Sui app with one command using the create-dapp CLI scaffolding tool.
6
- - [React](./getting-started/react.md): Set up dApp Kit in a React application.
6
+ - [React](./getting-started/react.md): Set up dApp Kit in a React application
7
7
  - [Next.js](./getting-started/next-js.md): Set up dApp Kit in a Next.js application.
8
- - [Vue](./getting-started/vue.md): Set up dApp Kit in a Vue application.
8
+ - [Vue](./getting-started/vue.md): Set up dApp Kit in a Vue application
9
9
  - [DApp Kit Instance](./dapp-kit-instance.md): Create and configure a DAppKit instance for wallet and client management
10
- - [State](./state.md): Access and subscribe to wallet connection state in dApp Kit.
10
+ - [State](./state.md): Access and subscribe to wallet connection state in dApp Kit
11
11
  - [Connect Wallet](./actions/connect-wallet.md): Programmatically connect to a Sui wallet using the dApp Kit connectWallet action.
12
12
  - [Disconnect Wallet](./actions/disconnect-wallet.md): Programmatically disconnect from a Sui wallet using the dApp Kit disconnectWallet action.
13
13
  - [Sign and Execute Transaction](./actions/sign-and-execute-transaction.md): Sign and execute a transaction on the Sui network using the connected wallet.
@@ -19,7 +19,7 @@
19
19
  - [React Hooks](./react/hooks.md): React hooks for accessing dApp Kit state and actions in Sui applications.
20
20
  - [useDAppKit](./react/hooks/use-dapp-kit.md): React hook to access the full dApp Kit instance for calling actions directly.
21
21
  - [useCurrentAccount](./react/hooks/use-current-account.md): React hook to get the currently selected wallet account in a Sui dApp.
22
- - [useCurrentClient](./react/hooks/use-current-client.md): React hook to get the current Sui client instance for the active network.
22
+ - [useCurrentClient](./react/hooks/use-current-client.md): React hook to get the current Sui client instance for the active network
23
23
  - [useCurrentNetwork](./react/hooks/use-current-network.md): React hook to get the currently selected Sui network in dApp Kit.
24
24
  - [useCurrentWallet](./react/hooks/use-current-wallet.md): React hook to get the currently connected wallet in a Sui dApp.
25
25
  - [useWalletConnection](./react/hooks/use-wallet-connection.md): React hook to manage wallet connection status and information in a Sui dApp.
@@ -1,13 +1,14 @@
1
1
  # useCurrentClient
2
2
 
3
- > React hook to get the current Sui client instance for the active network.
3
+ > React hook to get the current Sui client instance for the active network
4
4
 
5
5
  The `useCurrentClient` hook provides access to the blockchain client instance for the current
6
6
  network.
7
7
 
8
- > **Note:** By default, this returns a `SuiClient` instance when using the standard setup. However, the dApp
9
- > Kit supports any client that implements the Sui core API, making it flexible for different
10
- > blockchain implementations.
8
+ > **Note:** With the standard setup, this returns the `SuiGrpcClient` instance created by `createClient`. More
9
+ > generally, it returns whatever client type your dApp Kit instance creates, as long as that client
10
+ > implements the Sui Core API. Application code should call the concrete client's top-level methods
11
+ > directly.
11
12
 
12
13
  > **Warning:** All dApp Kit hooks must be used within components that are descendants of
13
14
  > [`DAppKitProvider`](../dapp-kit-provider). Using them outside will result in an error.
@@ -32,5 +33,5 @@ network.
32
33
  ## Return value
33
34
 
34
35
  ```tsx
35
- SuiClient;
36
+ ReturnType<typeof dAppKit.getClient>;
36
37
  ```
@@ -1,6 +1,6 @@
1
1
  # State
2
2
 
3
- > Access and subscribe to wallet connection state in dApp Kit.
3
+ > Access and subscribe to wallet connection state in dApp Kit
4
4
 
5
5
  The Sui dApp Kit SDK uses [nanostores](https://github.com/nanostores/nanostores) for state
6
6
  management, providing a lightweight, framework-agnostic solution that works across React, Vue,
@@ -100,7 +100,7 @@ This store is read-only. Use `dAppKit.switchNetwork()` to change networks.
100
100
 
101
101
  ### Current client store (`$currentClient`)
102
102
 
103
- Contains the SuiClient instance for the current network:
103
+ Contains the Sui client instance for the current network:
104
104
 
105
105
  ```typescript
106
106
  const client = dAppKit.stores.$currentClient.get();
@@ -1,6 +1,6 @@
1
1
  # Advanced Examples
2
2
 
3
- > Advanced Kiosk SDK usage patterns and code examples for complex scenarios.
3
+ > Advanced Kiosk SDK usage patterns and code examples for complex scenarios
4
4
 
5
5
  # Some extended examples
6
6
 
@@ -14,8 +14,8 @@ const bullsharkType = `${packageId}::suifrens::SuiFren<${packageId}::bullshark::
14
14
  const capyType = `${packageId}::suifrens::SuiFren<${packageId}::capy::Capy>`;
15
15
 
16
16
  // initialize the client with the kiosk extension.
17
- const client = new SuiJsonRpcClient({
18
- url: getJsonRpcFullnodeUrl('mainnet'),
17
+ const client = new SuiGrpcClient({
18
+ baseUrl: 'https://fullnode.mainnet.sui.io:443',
19
19
  network: 'mainnet',
20
20
  }).$extend(kiosk());
21
21
  ```
@@ -1,6 +1,6 @@
1
1
  # Migrating from Kiosk SDK V1
2
2
 
3
- > Migrate from Kiosk SDK v1 to the current version with the builder-pattern API.
3
+ > Migrate from Kiosk SDK v1 to the current version with the builder-pattern API
4
4
 
5
5
  The original version of Kiosk SDK provided basic experimentation with the Kiosk API. The new version
6
6
  of the SDK (0.7+) provides a more robust experience for building kiosk/transfer policy transactions.
@@ -46,8 +46,8 @@ Using the new SDK, you can build the same transaction as follows:
46
46
  ```typescript
47
47
 
48
48
  // You need to do this only once and re-use it in the application.
49
- const client = new SuiJsonRpcClient({
50
- url: getJsonRpcFullnodeUrl('mainnet'),
49
+ const client = new SuiGrpcClient({
50
+ baseUrl: 'https://fullnode.mainnet.sui.io:443',
51
51
  network: 'mainnet',
52
52
  }).$extend(kiosk());
53
53
 
@@ -98,8 +98,8 @@ Using the new SDK, you can build the same transaction as follows:
98
98
  ```typescript
99
99
 
100
100
  // You need to do this only once and re-use it in the application.
101
- const client = new SuiJsonRpcClient({
102
- url: getJsonRpcFullnodeUrl('mainnet'),
101
+ const client = new SuiGrpcClient({
102
+ baseUrl: 'https://fullnode.mainnet.sui.io:443',
103
103
  network: 'mainnet',
104
104
  }).$extend(kiosk());
105
105
 
@@ -198,8 +198,8 @@ Using the new SDK, you can build the same transaction as follows:
198
198
  ```typescript
199
199
 
200
200
  // You need to do this only once and re-use it in the application.
201
- const client = new SuiJsonRpcClient({
202
- url: getJsonRpcFullnodeUrl('mainnet'),
201
+ const client = new SuiGrpcClient({
202
+ baseUrl: 'https://fullnode.mainnet.sui.io:443',
203
203
  network: 'mainnet',
204
204
  }).$extend(kiosk());
205
205
 
@@ -296,8 +296,8 @@ On the new SDK, the same transaction can be built as follows:
296
296
  ```typescript
297
297
 
298
298
  // You need to do this only once and re-use it in the application.
299
- const client = new SuiJsonRpcClient({
300
- url: getJsonRpcFullnodeUrl('mainnet'),
299
+ const client = new SuiGrpcClient({
300
+ baseUrl: 'https://fullnode.mainnet.sui.io:443',
301
301
  network: 'mainnet',
302
302
  }).$extend(kiosk());
303
303
 
@@ -1,6 +1,6 @@
1
1
  # Kiosk SDK
2
2
 
3
- > TypeScript SDK for interacting with Sui Kiosk onchain commerce.
3
+ > TypeScript SDK for interacting with Sui Kiosk onchain commerce
4
4
 
5
5
  Kiosk SDK is a tool to interact with Sui and Mysten Kiosk. You can use it to query kiosk related
6
6
  data, build transactions to interact, and extend Kiosk to support custom rules.
@@ -16,7 +16,10 @@ npm i @mysten/kiosk
16
16
  The Kiosk SDK exports a client extension that integrates with Sui clients. Add it to your client
17
17
  using `$extend(kiosk())` to access kiosk functionality through `client.kiosk`.
18
18
 
19
- > The Kiosk SDK requires `SuiJsonRpcClient` or `SuiGraphQLClient`. It does not work with
20
- > `SuiGrpcClient` because it uses event queries that are not available in gRPC.
19
+ The Kiosk extension accepts any Sui client that implements `ClientWithCoreApi`. Use `SuiGrpcClient`
20
+ for new Kiosk code; `SuiGraphQLClient` and the deprecated `SuiJsonRpcClient` are also compatible.
21
+
22
+ > **Note:** The gRPC object API returns Display v2 metadata. Use GraphQL or JSON-RPC when reading objects
23
+ > whose types still rely on legacy Display metadata.
21
24
 
22
25
  - [Read more about setting up the Kiosk client extension](/kiosk/kiosk-client/introduction)
@@ -1,14 +1,17 @@
1
1
  # Kiosk Client
2
2
 
3
- > Introduction to the KioskClient extension for querying and managing kiosks on Sui.
3
+ > Introduction to the KioskClient extension for querying and managing kiosks on Sui
4
4
 
5
5
  The Kiosk SDK exports a client extension that provides all Kiosk functionality.
6
6
 
7
7
  > We recommend you keep only one client instance throughout your app or script. For example, in
8
8
  > React, you'd use a context to provide the client.
9
9
 
10
- > The Kiosk SDK requires `SuiJsonRpcClient` or `SuiGraphQLClient`. It does not work with
11
- > `SuiGrpcClient` because it uses event queries that are not available in gRPC.
10
+ The Kiosk extension accepts any Sui client that implements `ClientWithCoreApi`. Use `SuiGrpcClient`
11
+ for new Kiosk code; `SuiGraphQLClient` and the deprecated `SuiJsonRpcClient` are also compatible.
12
+
13
+ > **Note:** The gRPC object API returns Display v2 metadata. Use GraphQL or JSON-RPC when reading objects
14
+ > whose types still rely on legacy Display metadata.
12
15
 
13
16
  ## Setting up the kiosk extension
14
17
 
@@ -20,8 +23,8 @@ require constantly changing the package IDs).
20
23
 
21
24
  ```typescript
22
25
 
23
- const client = new SuiJsonRpcClient({
24
- url: getJsonRpcFullnodeUrl('testnet'),
26
+ const client = new SuiGrpcClient({
27
+ baseUrl: 'https://fullnode.testnet.sui.io:443',
25
28
  network: 'testnet',
26
29
  }).$extend(kiosk());
27
30
 
@@ -36,8 +39,8 @@ for the rules and extensions you want to use.
36
39
 
37
40
  ```typescript
38
41
 
39
- const client = new SuiJsonRpcClient({
40
- url: getJsonRpcFullnodeUrl('devnet'),
42
+ const client = new SuiGrpcClient({
43
+ baseUrl: 'https://fullnode.devnet.sui.io:443',
41
44
  network: 'devnet',
42
45
  }).$extend(
43
46
  kiosk({
@@ -1,8 +1,8 @@
1
1
  # Kiosk
2
2
  > Interact with on-chain commerce applications
3
3
 
4
- - [Kiosk SDK](..md): TypeScript SDK for interacting with Sui Kiosk onchain commerce.
5
- - [Kiosk Client](./kiosk-client/introduction.md): Introduction to the KioskClient extension for querying and managing kiosks on Sui.
4
+ - [Kiosk SDK](..md): TypeScript SDK for interacting with Sui Kiosk onchain commerce
5
+ - [Kiosk Client](./kiosk-client/introduction.md): Introduction to the KioskClient extension for querying and managing kiosks on Sui
6
6
  - [Querying](./kiosk-client/querying.md): Query kiosk contents, owned kiosks, items, and transfer policies using the Kiosk SDK.
7
7
  - [KioskTransaction](./kiosk-client/kiosk-transaction/kiosk-transaction.md): Build kiosk transactions for listing, purchasing, and managing items on Sui.
8
8
  - [Managing Owned Kiosk](./kiosk-client/kiosk-transaction/managing.md): Manage kiosk items by placing, listing, delisting, and withdrawing using the Kiosk SDK.
@@ -10,5 +10,5 @@
10
10
  - [Examples](./kiosk-client/kiosk-transaction/examples.md): Practical code examples for kiosk transactions including minting, listing, and purchasing.
11
11
  - [TransferPolicyTransaction](./kiosk-client/transfer-policy-transaction/introduction.md): Create and manage transfer policies for kiosk items using the Kiosk SDK.
12
12
  - [Using the manager](./kiosk-client/transfer-policy-transaction/using-the-manager.md): Use the TransferPolicyTransaction manager to add rules and withdraw profits.
13
- - [Advanced Examples](./advanced-examples.md): Advanced Kiosk SDK usage patterns and code examples for complex scenarios.
14
- - [Migrating from Kiosk SDK V1](./from-v1.md): Migrate from Kiosk SDK v1 to the current version with the builder-pattern API.
13
+ - [Advanced Examples](./advanced-examples.md): Advanced Kiosk SDK usage patterns and code examples for complex scenarios
14
+ - [Migrating from Kiosk SDK V1](./from-v1.md): Migrate from Kiosk SDK v1 to the current version with the builder-pattern API
@@ -16,11 +16,11 @@
16
16
 
17
17
  - [Sui dApp Kit](./dapp-kit.md): Build Sui apps with framework-agnostic core and React bindings.
18
18
  - [@mysten/create-dapp](./dapp-kit/getting-started/create-dapp.md): Create a Sui app with one command using the create-dapp CLI scaffolding tool.
19
- - [React](./dapp-kit/getting-started/react.md): Set up dApp Kit in a React application.
19
+ - [React](./dapp-kit/getting-started/react.md): Set up dApp Kit in a React application
20
20
  - [Next.js](./dapp-kit/getting-started/next-js.md): Set up dApp Kit in a Next.js application.
21
- - [Vue](./dapp-kit/getting-started/vue.md): Set up dApp Kit in a Vue application.
21
+ - [Vue](./dapp-kit/getting-started/vue.md): Set up dApp Kit in a Vue application
22
22
  - [DApp Kit Instance](./dapp-kit/dapp-kit-instance.md): Create and configure a DAppKit instance for wallet and client management
23
- - [State](./dapp-kit/state.md): Access and subscribe to wallet connection state in dApp Kit.
23
+ - [State](./dapp-kit/state.md): Access and subscribe to wallet connection state in dApp Kit
24
24
  - [Connect Wallet](./dapp-kit/actions/connect-wallet.md): Programmatically connect to a Sui wallet using the dApp Kit connectWallet action.
25
25
  - [Disconnect Wallet](./dapp-kit/actions/disconnect-wallet.md): Programmatically disconnect from a Sui wallet using the dApp Kit disconnectWallet action.
26
26
  - [Sign and Execute Transaction](./dapp-kit/actions/sign-and-execute-transaction.md): Sign and execute a transaction on the Sui network using the connected wallet.
@@ -32,7 +32,7 @@
32
32
  - [React Hooks](./dapp-kit/react/hooks.md): React hooks for accessing dApp Kit state and actions in Sui applications.
33
33
  - [useDAppKit](./dapp-kit/react/hooks/use-dapp-kit.md): React hook to access the full dApp Kit instance for calling actions directly.
34
34
  - [useCurrentAccount](./dapp-kit/react/hooks/use-current-account.md): React hook to get the currently selected wallet account in a Sui dApp.
35
- - [useCurrentClient](./dapp-kit/react/hooks/use-current-client.md): React hook to get the current Sui client instance for the active network.
35
+ - [useCurrentClient](./dapp-kit/react/hooks/use-current-client.md): React hook to get the current Sui client instance for the active network
36
36
  - [useCurrentNetwork](./dapp-kit/react/hooks/use-current-network.md): React hook to get the currently selected Sui network in dApp Kit.
37
37
  - [useCurrentWallet](./dapp-kit/react/hooks/use-current-wallet.md): React hook to get the currently connected wallet in a Sui dApp.
38
38
  - [useWalletConnection](./dapp-kit/react/hooks/use-wallet-connection.md): React hook to manage wallet connection status and information in a Sui dApp.
@@ -48,8 +48,8 @@
48
48
  ## Kiosk
49
49
  > Interact with on-chain commerce applications
50
50
 
51
- - [Kiosk SDK](./kiosk.md): TypeScript SDK for interacting with Sui Kiosk onchain commerce.
52
- - [Kiosk Client](./kiosk/kiosk-client/introduction.md): Introduction to the KioskClient extension for querying and managing kiosks on Sui.
51
+ - [Kiosk SDK](./kiosk.md): TypeScript SDK for interacting with Sui Kiosk onchain commerce
52
+ - [Kiosk Client](./kiosk/kiosk-client/introduction.md): Introduction to the KioskClient extension for querying and managing kiosks on Sui
53
53
  - [Querying](./kiosk/kiosk-client/querying.md): Query kiosk contents, owned kiosks, items, and transfer policies using the Kiosk SDK.
54
54
  - [KioskTransaction](./kiosk/kiosk-client/kiosk-transaction/kiosk-transaction.md): Build kiosk transactions for listing, purchasing, and managing items on Sui.
55
55
  - [Managing Owned Kiosk](./kiosk/kiosk-client/kiosk-transaction/managing.md): Manage kiosk items by placing, listing, delisting, and withdrawing using the Kiosk SDK.
@@ -57,8 +57,8 @@
57
57
  - [Examples](./kiosk/kiosk-client/kiosk-transaction/examples.md): Practical code examples for kiosk transactions including minting, listing, and purchasing.
58
58
  - [TransferPolicyTransaction](./kiosk/kiosk-client/transfer-policy-transaction/introduction.md): Create and manage transfer policies for kiosk items using the Kiosk SDK.
59
59
  - [Using the manager](./kiosk/kiosk-client/transfer-policy-transaction/using-the-manager.md): Use the TransferPolicyTransaction manager to add rules and withdraw profits.
60
- - [Advanced Examples](./kiosk/advanced-examples.md): Advanced Kiosk SDK usage patterns and code examples for complex scenarios.
61
- - [Migrating from Kiosk SDK V1](./kiosk/from-v1.md): Migrate from Kiosk SDK v1 to the current version with the builder-pattern API.
60
+ - [Advanced Examples](./kiosk/advanced-examples.md): Advanced Kiosk SDK usage patterns and code examples for complex scenarios
61
+ - [Migrating from Kiosk SDK V1](./kiosk/from-v1.md): Migrate from Kiosk SDK v1 to the current version with the builder-pattern API
62
62
 
63
63
  ## Payment Kit
64
64
  > Accept P2P and merchant payments in any coin type on Sui with @mysten/payment-kit
@@ -94,11 +94,11 @@
94
94
 
95
95
  - [Sui TypeScript SDK](./sui.md): TypeScript SDK for building on the Sui blockchain
96
96
  - [LLM Documentation](./sui/llm-docs.md): Give AI agents access to Sui SDK documentation in your project.
97
- - [Sui Clients](./sui/clients.md): Choose and configure gRPC, GraphQL, or JSON-RPC clients for the Sui network.
98
- - [Core API](./sui/clients/core.md): Transport-agnostic Core API shared by all Sui clients.
99
- - [SuiGrpcClient](./sui/clients/grpc.md): Connect to Sui through gRPC with SuiGrpcClient.
100
- - [SuiGraphQLClient](./sui/clients/graphql.md): Connect to Sui through GraphQL with SuiGraphQLClient.
101
- - [SuiJsonRpcClient](./sui/clients/json-rpc.md): Connect to Sui through JSON-RPC with SuiJsonRpcClient.
97
+ - [Sui Clients](./sui/clients.md): Choose and configure SuiGrpcClient, SuiGraphQLClient, and legacy JSON-RPC clients
98
+ - [Core API](./sui/clients/core.md): Transport-agnostic Core API shared by Sui clients
99
+ - [SuiGrpcClient](./sui/clients/grpc.md): Connect to Sui through gRPC with the recommended SuiGrpcClient
100
+ - [SuiGraphQLClient](./sui/clients/graphql.md): Connect to Sui through GraphQL with SuiGraphQLClient
101
+ - [SuiJsonRpcClient](./sui/clients/json-rpc.md): Maintain legacy JSON-RPC code while migrating to SuiGrpcClient or SuiGraphQLClient
102
102
  - [Building Transactions](./sui/transactions/basics.md): Construct programmable transaction blocks with the Transaction API
103
103
  - [Signing and Execution](./sui/transactions/signing-and-execution.md): Sign transactions and execute them on the Sui network
104
104
  - [Coins and Balances](./sui/transactions/coins-and-balances.md): Work with coin objects and address balances in transactions
@@ -117,22 +117,22 @@
117
117
  - [Derived Objects](./sui/utils/derived_objects.md): Compute derived object IDs from parent objects for deterministic offline derivation.
118
118
  - [BCS](./sui/bcs.md): Binary Canonical Serialization for encoding Sui Move types.
119
119
  - [ZkLogin](./sui/zklogin.md): Zero-knowledge authentication with OAuth providers on Sui.
120
- - [Transaction Executors](./sui/executors.md): Manage transaction execution with queuing and parallel strategies.
120
+ - [Transaction Executors](./sui/executors.md): Manage transaction execution with queuing and parallel strategies
121
121
  - [Transaction Plugins](./sui/plugins.md): Extend transaction building with reusable plugins.
122
- - [Building SDKs](./sui/sdk-building.md): Build custom SDKs on top of the Sui TypeScript SDK.
123
- - [Migrate to 2.0](./sui/migrations/sui-2.0.md): Migration guide for Sui TypeScript SDK 2.0 covering all @mysten packages.
122
+ - [Building SDKs](./sui/sdk-building.md): Build custom SDKs on top of the Sui TypeScript SDK
123
+ - [Migrate to 2.0](./sui/migrations/sui-2.0.md): Migration guide for Sui TypeScript SDK 2.0 covering all @mysten packages
124
124
  - [Agent Migration Prompt](./sui/migrations/sui-2.0/agent-prompt.md): AI agent prompt for automated SDK 2.0 migration of your codebase.
125
- - [@mysten/sui](./sui/migrations/sui-2.0/sui.md): Migrate @mysten/sui from 1.x to 2.0 with new client APIs and BCS changes.
126
- - [Migrating from JSON-RPC](./sui/migrations/sui-2.0/json-rpc-migration.md): Migrate from JSON-RPC to the new Core API using SuiGrpcClient or SuiGraphQLClient.
127
- - [@mysten/dapp-kit](./sui/migrations/sui-2.0/dapp-kit.md): Migrate @mysten/dapp-kit to the new dapp-kit-react package in 2.0.
128
- - [@mysten/kiosk](./sui/migrations/sui-2.0/kiosk.md): Migrate @mysten/kiosk to 2.0 with client extension pattern and KioskTransaction.
129
- - [@mysten/zksend](./sui/migrations/sui-2.0/zksend.md): Migrate @mysten/zksend to 2.0 with client extension pattern and simplified API.
130
- - [@mysten/suins](./sui/migrations/sui-2.0/suins.md): Migrate @mysten/suins to 2.0 with client extension pattern.
131
- - [@mysten/deepbook-v3](./sui/migrations/sui-2.0/deepbook-v3.md): Migrate @mysten/deepbook-v3 to 2.0 with client extension pattern.
132
- - [@mysten/walrus](./sui/migrations/sui-2.0/walrus.md): Migrate @mysten/walrus to 2.0 with required client parameter and updated API.
125
+ - [@mysten/sui](./sui/migrations/sui-2.0/sui.md): Migrate @mysten/sui from 1.x to 2.0 with gRPC clients, Core API, and BCS changes
126
+ - [Migrating from JSON-RPC](./sui/migrations/sui-2.0/json-rpc-migration.md): Migrate deprecated JSON-RPC code to shared gRPC and GraphQL top-level methods
127
+ - [@mysten/dapp-kit](./sui/migrations/sui-2.0/dapp-kit.md): Migrate @mysten/dapp-kit to the new dapp-kit-react package in 2.0
128
+ - [@mysten/kiosk](./sui/migrations/sui-2.0/kiosk.md): Migrate @mysten/kiosk to 2.0 with client extension pattern and KioskTransaction
129
+ - [@mysten/zksend](./sui/migrations/sui-2.0/zksend.md): Migrate @mysten/zksend to 2.0 with client extension pattern and simplified API
130
+ - [@mysten/suins](./sui/migrations/sui-2.0/suins.md): Migrate @mysten/suins to 2.0 with client extension pattern
131
+ - [@mysten/deepbook-v3](./sui/migrations/sui-2.0/deepbook-v3.md): Migrate @mysten/deepbook-v3 to 2.0 with client extension pattern
132
+ - [@mysten/walrus](./sui/migrations/sui-2.0/walrus.md): Migrate @mysten/walrus to 2.0 with required client parameter and updated API
133
133
  - [@mysten/seal](./sui/migrations/sui-2.0/seal.md): Migrate @mysten/seal to 2.0 with the new registration function pattern.
134
134
  - [Wallet Builders](./sui/migrations/sui-2.0/wallet-builders.md): Migration guide for wallet extension developers upgrading to 2.0.
135
- - [SDK Maintainers](./sui/migrations/sui-2.0/sdk-maintainers.md): Migration guide for SDK maintainers and library authors upgrading to 2.0.
135
+ - [SDK Maintainers](./sui/migrations/sui-2.0/sdk-maintainers.md): Migration guide for SDK maintainers and library authors upgrading to 2.0
136
136
  - [Migrate to 1.0](./sui/migrations/sui-1.0.md): Migrate to Sui TypeScript SDK 1.0 with new features and API changes.
137
137
  - [Migrate to 0.38.0](./sui/migrations/0.38.md): Migrate from SDK version 0.37 to 0.38 with updated module structure and API changes.
138
138
 
@@ -46,6 +46,9 @@ The `seal()` function accepts the following options:
46
46
  authentication
47
47
  - **`verifyKeyServers`** (optional) - Whether to verify key server authenticity (default: `true`)
48
48
  - **`timeout`** (optional) - Timeout in milliseconds for network requests (default: `10000`)
49
+ - **`fetch`** (optional) - Custom fetch implementation used for all key server requests (default:
50
+ the global `fetch`), for example to send cookies with `credentials: 'include'` or attach your own
51
+ headers
49
52
 
50
53
  ## Choosing key servers
51
54
 
@@ -1,10 +1,15 @@
1
1
  # Core API
2
2
 
3
- > Transport-agnostic Core API shared by all Sui clients.
3
+ > Transport-agnostic Core API shared by Sui clients
4
4
 
5
- The Core API is the transport-agnostic interface that all Sui clients implement. It provides a
6
- consistent set of methods for interacting with the Sui blockchain, regardless of whether you're
7
- using gRPC, GraphQL, or JSON-RPC.
5
+ The Core API is the transport-agnostic interface shared by Sui clients. It provides a consistent set
6
+ of methods for interacting with the Sui blockchain across `SuiGrpcClient`, `SuiGraphQLClient`, and
7
+ the deprecated `SuiJsonRpcClient`.
8
+
9
+ For application code, prefer the top-level methods on the concrete client you instantiate, such as
10
+ `grpcClient.getObject()` or `graphqlClient.listTransactions()`. Those methods match the Core API for
11
+ common operations and may expose transport-specific additions. Use `client.core` when writing SDKs,
12
+ libraries, or helpers that accept any `ClientWithCoreApi`.
8
13
 
9
14
  ## `ClientWithCoreApi`
10
15
 
@@ -83,9 +88,7 @@ List objects owned by an address.
83
88
  ```typescript
84
89
  const result = await client.core.listOwnedObjects({
85
90
  owner: '0xabc...',
86
- filter: {
87
- StructType: '0x2::coin::Coin<0x2::sui::SUI>',
88
- },
91
+ type: '0x2::coin::Coin<0x2::sui::SUI>',
89
92
  limit: 10,
90
93
  });
91
94
 
@@ -342,9 +345,12 @@ const result = await client.core.simulateTransaction({
342
345
  },
343
346
  });
344
347
 
348
+ const simulatedTransaction =
349
+ result.$kind === 'Transaction' ? result.Transaction : result.FailedTransaction;
350
+
345
351
  // Check simulated effects before signing
346
- console.log(result.effects);
347
- console.log(result.balanceChanges);
352
+ console.log(simulatedTransaction.effects);
353
+ console.log(simulatedTransaction.balanceChanges);
348
354
  ```
349
355
 
350
356
  #### Disabling checks
@@ -598,12 +604,27 @@ console.log(fn.typeParameters);
598
604
 
599
605
  ## Name service methods
600
606
 
607
+ ### `resolveNameServiceAddress`
608
+
609
+ Resolve a SuiNS name to its target address. The address is `null` when the name does not exist, has
610
+ expired, or does not have a target address.
611
+
612
+ ```typescript
613
+ const { address } = await client.core.resolveNameServiceAddress({
614
+ name: 'example.sui',
615
+ });
616
+
617
+ console.log(address); // e.g., "0x..." or null
618
+ ```
619
+
601
620
  ### `defaultNameServiceName`
602
621
 
603
622
  Resolve an address to its default SuiNS name.
604
623
 
605
624
  ```typescript
606
- const { name } = await client.core.defaultNameServiceName({
625
+ const {
626
+ data: { name },
627
+ } = await client.core.defaultNameServiceName({
607
628
  address: '0xabc...',
608
629
  });
609
630
 
@@ -1,27 +1,60 @@
1
1
  # SuiGraphQLClient
2
2
 
3
- > Connect to Sui through GraphQL with SuiGraphQLClient.
3
+ > Connect to Sui through GraphQL with SuiGraphQLClient
4
4
 
5
5
  The `SuiGraphQLClient` enables type-safe GraphQL queries against the Sui GraphQL API.
6
6
 
7
7
  For more details on the Sui GraphQL API, see the
8
8
  [GraphQL reference](https://docs.sui.io/references/sui-graphql).
9
9
 
10
- The `SuiGraphQLClient` implements all the the [Core API](/sui/clients/core) methods:
10
+ Use `SuiGraphQLClient` when an app needs indexed GraphQL data, historical queries, or custom
11
+ selection sets that are not exposed by the gRPC top-level API.
12
+
13
+ ## Using top-level methods
14
+
15
+ `SuiGraphQLClient` exposes top-level methods for the same common operations as the
16
+ [Core API](/sui/clients/core). Use them directly in application code:
11
17
 
12
18
  ```typescript
13
19
 
14
20
  const client = new SuiGraphQLClient({
15
- url: 'https://sui-mainnet.mystenlabs.com/graphql',
21
+ url: 'https://graphql.mainnet.sui.io/graphql',
16
22
  network: 'mainnet',
17
23
  });
18
24
 
19
- const { object } = await client.getObject({ objectId: '0x...' });
25
+ const { object } = await client.getObject({
26
+ objectId: '0x...',
27
+ include: { content: true },
28
+ });
29
+
30
+ const txs = await client.listTransactions({
31
+ filter: { sender: '0x...' },
32
+ order: 'descending',
33
+ limit: 10,
34
+ });
20
35
  ```
21
36
 
37
+ The same methods are available through `client.core` when SDK code needs the transport-agnostic
38
+ `ClientWithCoreApi` contract.
39
+
40
+ Common top-level methods:
41
+
42
+ | Category | Methods |
43
+ | -------------- | ----------------------------------------------------------------------------------------------------------------- |
44
+ | Objects | `getObject`, `getObjects`, `listOwnedObjects`, `listDynamicFields`, `getDynamicField` |
45
+ | Coins | `listCoins`, `getBalance`, `listBalances`, `getCoinMetadata` |
46
+ | Transactions | `getTransaction`, `executeTransaction`, `signAndExecuteTransaction`, `waitForTransaction` |
47
+ | Simulation | `simulateTransaction` |
48
+ | Queries | `listTransactions`, `listEvents` |
49
+ | Move and names | `getMoveFunction`, `resolveNameServiceAddress`, `defaultNameServiceName`, `mvr.resolvePackage`, `mvr.resolveType` |
50
+ | Verification | `verifyZkLoginSignature` |
51
+
52
+ GraphQL-specific top-level options include `doGasSelection` on `simulateTransaction` and
53
+ `include: { value: true }` on `listDynamicFields`.
54
+
22
55
  ## Custom GraphQL queries
23
56
 
24
- To query anything no in the Core API, you can use the `query` method to execute custom GraphQL
57
+ To query anything not in the top-level API, use the `query` method to execute custom GraphQL
25
58
  queries.
26
59
 
27
60
  We'll start by creating our client, and executing a very basic query:
@@ -62,7 +95,9 @@ passed to your query are properly typed.
62
95
  const getSuinsName = graphql(`
63
96
  query getSuiName($address: SuiAddress!) {
64
97
  address(address: $address) {
65
- defaultSuinsName
98
+ defaultNameRecord {
99
+ domain
100
+ }
66
101
  }
67
102
  }
68
103
  `);
@@ -75,7 +110,7 @@ async function getDefaultSuinsName(address: string) {
75
110
  },
76
111
  });
77
112
 
78
- return result.data?.address?.defaultSuinsName;
113
+ return result.data?.address?.defaultNameRecord?.domain;
79
114
  }
80
115
  ```
81
116
 
@@ -94,7 +129,7 @@ const chainIdentifierQuery = graphql(`
94
129
  `);
95
130
 
96
131
  function ChainIdentifier() {
97
- const { loading, error, data } = useQuery(getPokemonsQuery);
132
+ const { loading, error, data } = useQuery(chainIdentifierQuery);
98
133
 
99
134
  return <div>{data?.chainIdentifier}</div>;
100
135
  }