@mysten/docs 0.1.49 → 0.1.51

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.
@@ -18,9 +18,7 @@ The `connectWallet` action prompts a wallet to connect and authorize accounts fo
18
18
 
19
19
  ```typescript
20
20
 
21
- const dAppKit = createDAppKit({
22
- /* config */
23
- });
21
+ const dAppKit = createDAppKit({/* config */});
24
22
 
25
23
  // Connect to a specific wallet
26
24
  const result = await dAppKit.connectWallet({
@@ -19,9 +19,7 @@ The `disconnectWallet` action terminates the connection with the currently conne
19
19
 
20
20
  ```typescript
21
21
 
22
- const dAppKit = createDAppKit({
23
- /* config */
24
- });
22
+ const dAppKit = createDAppKit({/* config */});
25
23
 
26
24
  await dAppKit.disconnectWallet();
27
25
  ```
@@ -9,9 +9,7 @@ a transaction on the Sui network. This is the most common way to execute transac
9
9
 
10
10
  ```typescript
11
11
 
12
- const dAppKit = createDAppKit({
13
- /* config */
14
- });
12
+ const dAppKit = createDAppKit({/* config */});
15
13
 
16
14
  const tx = new Transaction();
17
15
  // No need to manually set sender - it's done automatically
@@ -10,9 +10,7 @@ that a user controls a specific account.
10
10
 
11
11
  ```typescript
12
12
 
13
- const dAppKit = createDAppKit({
14
- /* config */
15
- });
13
+ const dAppKit = createDAppKit({/* config */});
16
14
 
17
15
  const message = new TextEncoder().encode('Please sign this message');
18
16
  const result = await dAppKit.signPersonalMessage({
@@ -10,9 +10,7 @@ scenarios.
10
10
 
11
11
  ```typescript
12
12
 
13
- const dAppKit = createDAppKit({
14
- /* config */
15
- });
13
+ const dAppKit = createDAppKit({/* config */});
16
14
 
17
15
  const tx = new Transaction();
18
16
  // No need to manually set sender - it's done automatically
@@ -17,9 +17,7 @@ connected wallet.
17
17
 
18
18
  ```typescript
19
19
 
20
- const dAppKit = createDAppKit({
21
- /* config */
22
- });
20
+ const dAppKit = createDAppKit({/* config */});
23
21
 
24
22
  // Switch to a different account
25
23
  dAppKit.switchAccount({
@@ -52,19 +52,7 @@ Check the framework-specific guides:
52
52
  - [Next.js](/dapp-kit/getting-started/next-js)
53
53
  - [Vue](/dapp-kit/getting-started/vue)
54
54
 
55
- ## Legacy package
56
-
57
- ### @mysten/dapp-kit (Legacy)
58
-
59
- See the [Legacy dApp Kit documentation](/dapp-kit/legacy).
60
-
61
- The original React-focused version of the dApp Kit. This package provides:
62
-
63
- - React hooks for wallet connection and blockchain queries
64
- - Pre-built UI components with Radix UI
65
- - Integration with TanStack React Query
66
- - Comprehensive wallet state management
67
-
68
- > **Warning:** **Deprecated JSON RPC Only**: This legacy package only works with the deprecated JSON RPC API and
69
- > will not be updated to support gRPC or GraphQL. All new projects should use
70
- > `@mysten/dapp-kit-core` and `@mysten/dapp-kit-react`.
55
+ > **Warning:** **Deprecated JSON RPC Only**: The legacy `@mysten/dapp-kit` package only works with the deprecated
56
+ > JSON RPC API and will not receive further updates. Follow the [migration
57
+ > guide](/sui/migrations/sui-2.0/dapp-kit) to move to `@mysten/dapp-kit-core` and
58
+ > `@mysten/dapp-kit-react`.
@@ -30,4 +30,3 @@
30
30
  - [Connect Button](./web-components/connect-button.md): >- Framework-agnostic web component providing a complete wallet connection UI for Sui dApps.
31
31
  - [Connect Modal](./web-components/connect-modal.md): >- Framework-agnostic web component for wallet selection and connection in Sui dApps.
32
32
  - [Theming](./theming.md): Customize the appearance of dApp Kit UI components.
33
- - [Sui dApp Kit (Legacy)](./legacy.md): >- Legacy dApp Kit API reference for the deprecated @mysten/dapp-kit package using JSON RPC.
@@ -21,9 +21,7 @@ All stores are available through the `dAppKit.stores` property:
21
21
 
22
22
  ```typescript
23
23
 
24
- const dAppKit = createDAppKit({
25
- /* config */
26
- });
24
+ const dAppKit = createDAppKit({/* config */});
27
25
 
28
26
  // Access stores
29
27
  const connection = dAppKit.stores.$connection.get();
@@ -43,7 +43,6 @@
43
43
  - [Connect Button](./dapp-kit/web-components/connect-button.md): >- Framework-agnostic web component providing a complete wallet connection UI for Sui dApps.
44
44
  - [Connect Modal](./dapp-kit/web-components/connect-modal.md): >- Framework-agnostic web component for wallet selection and connection in Sui dApps.
45
45
  - [Theming](./dapp-kit/theming.md): Customize the appearance of dApp Kit UI components.
46
- - [Sui dApp Kit (Legacy)](./dapp-kit/legacy.md): >- Legacy dApp Kit API reference for the deprecated @mysten/dapp-kit package using JSON RPC.
47
46
 
48
47
  ## Kiosk
49
48
  > Interact with on-chain commerce applications
@@ -486,9 +486,7 @@ const tx = new Transaction();
486
486
  // Add custom logic before payment
487
487
  tx.moveCall({
488
488
  target: '0xMyPackage::my_module::pre_payment_check',
489
- arguments: [
490
- /* ... */
491
- ],
489
+ arguments: [/* ... */],
492
490
  });
493
491
 
494
492
  // Add payment command
@@ -505,9 +503,7 @@ tx.add(
505
503
  // Add custom logic after payment
506
504
  tx.moveCall({
507
505
  target: '0xMyPackage::my_module::post_payment_action',
508
- arguments: [
509
- /* ... */
510
- ],
506
+ arguments: [/* ... */],
511
507
  });
512
508
 
513
509
  await client.signAndExecuteTransaction({
@@ -3,7 +3,7 @@
3
3
  > >- Connect your app to Slush Wallet using the Slush Wallet SDK and wallet standard.
4
4
 
5
5
  > **Note:** If you are using `dapp-kit`, you do not need to install any additional packages to integrate with
6
- > the Slush wallet. [Read how to integrate with dapp-kit.](/dapp-kit/legacy/slush)
6
+ > the Slush wallet. [Read how to integrate with dapp-kit.](/dapp-kit/getting-started/react)
7
7
 
8
8
  Using the Slush Wallet SDK, you can allow users to connect to the Slush wallet from your app. The
9
9
  wallet is provided through the [Wallet Standard](https://docs.sui.io/standards/wallet-standard), and
@@ -52,7 +52,7 @@ wallet, and check if it is the Slush wallet.
52
52
  ```ts
53
53
 
54
54
  function SlushOnly() {
55
- const { currentWallet } = useCurrentWallet();
55
+ const currentWallet = useCurrentWallet();
56
56
  const walletIsSlushWallet = currentWallet?.name === SLUSH_WALLET_NAME;
57
57
 
58
58
  // rest of component logic...
@@ -5,9 +5,8 @@
5
5
  This guide helps you migrate from the original `@mysten/dapp-kit` (legacy) to the new
6
6
  `@mysten/dapp-kit-react` package.
7
7
 
8
- > **Note:** The legacy `@mysten/dapp-kit` package will continue to work with the latest SDK, but it only
9
- > supports JSON-RPC and will not receive further updates. We recommend migrating to
10
- > `@mysten/dapp-kit-react` for new features and gRPC support.
8
+ > **Note:** The legacy `@mysten/dapp-kit` package only supports the deprecated JSON RPC API and will not
9
+ > receive further updates. Migrate to `@mysten/dapp-kit-react` for gRPC support and new features.
11
10
 
12
11
  ## Overview
13
12
 
@@ -75,29 +75,24 @@ Available keypair types:
75
75
 
76
76
  ## With dapp-kit (React frontend)
77
77
 
78
- In a React app, use the `useSignAndExecuteTransaction` hook. The user's connected wallet signs and
79
- submits the transaction:
78
+ In a React app, use the `useDAppKit` hook. The user's connected wallet signs and submits the
79
+ transaction:
80
80
 
81
81
  ```tsx
82
82
 
83
83
  function SendButton() {
84
- const { mutate: signAndExecute } = useSignAndExecuteTransaction();
84
+ const dAppKit = useDAppKit();
85
85
 
86
- function handleClick() {
86
+ async function handleClick() {
87
87
  const tx = new Transaction();
88
88
  // ... build your transaction ...
89
89
 
90
- signAndExecute(
91
- { transaction: tx },
92
- {
93
- onSuccess: (result) => {
94
- console.log('Transaction digest:', result.digest);
95
- },
96
- onError: (error) => {
97
- console.error('Transaction failed:', error);
98
- },
99
- },
100
- );
90
+ const result = await dAppKit.signAndExecuteTransaction({ transaction: tx });
91
+ if (result.FailedTransaction) {
92
+ throw new Error(`Transaction failed: ${result.FailedTransaction.status.error?.message}`);
93
+ }
94
+
95
+ console.log('Transaction digest:', result.Transaction.digest);
101
96
  }
102
97
 
103
98
  return <button onClick={handleClick}>Send</button>;
@@ -127,20 +122,14 @@ const { signature } = await keypair.signTransaction(bytes);
127
122
  ```tsx
128
123
 
129
124
  function SignButton() {
130
- const { mutate: signTransaction } = useSignTransaction();
125
+ const dAppKit = useDAppKit();
131
126
 
132
- function handleClick() {
127
+ async function handleClick() {
133
128
  const tx = new Transaction();
134
129
  // ... build your transaction ...
135
130
 
136
- signTransaction(
137
- { transaction: tx },
138
- {
139
- onSuccess: ({ bytes, signature }) => {
140
- // Send bytes + signature to your backend, sponsor, etc.
141
- },
142
- },
143
- );
131
+ const { bytes, signature } = await dAppKit.signTransaction({ transaction: tx });
132
+ // Send bytes + signature to your backend, sponsor, etc.
144
133
  }
145
134
 
146
135
  return <button onClick={handleClick}>Sign</button>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten/docs",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -18,50 +18,49 @@
18
18
  "node": ">=24"
19
19
  },
20
20
  "dependencies": {
21
- "@tanstack/react-query": "^5.101.0",
21
+ "@tanstack/react-query": "^5.101.4",
22
22
  "fast-glob": "^3.3.3",
23
- "fumadocs-core": "16.10.2",
24
- "fumadocs-docgen": "^3.0.10",
25
- "fumadocs-mdx": "15.0.12",
26
- "fumadocs-typescript": "^5.2.6",
27
- "fumadocs-ui": "16.10.2",
28
- "next": "^16.2.12",
29
- "react": "^19.2.7",
30
- "react-dom": "^19.2.7",
31
- "@mysten/aws-kms-signer": "0.3.14",
32
- "@mysten/dapp-kit": "1.1.17",
33
- "@mysten/bcs": "2.1.0",
34
- "@mysten/dapp-kit-core": "1.6.17",
35
- "@mysten/dapp-kit-react": "2.1.19",
36
- "@mysten/deepbook-v3": "2.0.0",
37
- "@mysten/enoki": "1.2.15",
38
- "@mysten/enoki-connect": "1.1.17",
39
- "@mysten/gcp-kms-signer": "0.2.17",
40
- "@mysten/kiosk": "1.4.3",
41
- "@mysten/ledger-signer": "0.2.17",
42
- "@mysten/payment-kit": "0.2.17",
43
- "@mysten/slush-wallet": "1.1.17",
44
- "@mysten/signers": "1.1.17",
45
- "@mysten/seal": "1.4.3",
46
- "@mysten/sui": "2.26.1",
47
- "@mysten/suins": "1.2.17",
48
- "@mysten/wallet-standard": "0.21.17",
49
- "@mysten/walrus": "1.2.17",
50
- "@mysten/webcrypto-signer": "0.2.17",
51
- "@mysten/utils": "0.4.0",
52
- "@mysten/zksend": "1.2.17"
23
+ "fumadocs-core": "16.14.4",
24
+ "fumadocs-docgen": "^3.1.0",
25
+ "fumadocs-mdx": "15.2.3",
26
+ "fumadocs-typescript": "^5.3.0",
27
+ "fumadocs-ui": "16.14.4",
28
+ "next": "^16.3.1",
29
+ "react": "^19.2.8",
30
+ "react-dom": "^19.2.8",
31
+ "@mysten/aws-kms-signer": "0.3.15",
32
+ "@mysten/bcs": "2.1.1",
33
+ "@mysten/dapp-kit-core": "1.6.18",
34
+ "@mysten/deepbook-v3": "2.0.1",
35
+ "@mysten/dapp-kit-react": "2.1.20",
36
+ "@mysten/enoki": "1.2.16",
37
+ "@mysten/gcp-kms-signer": "0.2.18",
38
+ "@mysten/kiosk": "1.4.4",
39
+ "@mysten/enoki-connect": "1.1.18",
40
+ "@mysten/payment-kit": "0.2.18",
41
+ "@mysten/ledger-signer": "0.2.18",
42
+ "@mysten/slush-wallet": "1.1.18",
43
+ "@mysten/seal": "1.4.4",
44
+ "@mysten/signers": "1.1.18",
45
+ "@mysten/sui": "2.26.2",
46
+ "@mysten/suins": "2.0.0",
47
+ "@mysten/utils": "0.4.1",
48
+ "@mysten/wallet-standard": "0.21.18",
49
+ "@mysten/walrus": "1.2.19",
50
+ "@mysten/zksend": "1.2.18",
51
+ "@mysten/webcrypto-signer": "0.2.18"
53
52
  },
54
53
  "devDependencies": {
55
- "@tailwindcss/postcss": "^4.3.1",
54
+ "@tailwindcss/postcss": "^4.3.3",
56
55
  "@types/mdx": "^2.0.14",
57
- "@types/node": "^25.9.3",
58
- "@types/react": "^19.2.17",
59
- "@types/react-dom": "^19.2.3",
60
- "postcss": "^8.5.23",
61
- "tailwindcss": "^4.3.1",
62
- "typedoc": "^0.28.19",
56
+ "@types/node": "^26.2.0",
57
+ "@types/react": "^19.2.18",
58
+ "@types/react-dom": "^19.2.4",
59
+ "postcss": ">=8.5.23",
60
+ "tailwindcss": "^4.3.3",
61
+ "typedoc": "^0.28.20",
63
62
  "typedoc-plugin-mermaid": "^1.12.0",
64
- "typescript": "^6.0.3"
63
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
65
64
  },
66
65
  "scripts": {
67
66
  "build": "typedoc && next build && pnpm run build:docs",