@mysten/docs 0.1.49 → 0.1.50
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.
- package/dist/dapp-kit/actions/connect-wallet.md +1 -3
- package/dist/dapp-kit/actions/disconnect-wallet.md +1 -3
- package/dist/dapp-kit/actions/sign-and-execute-transaction.md +1 -3
- package/dist/dapp-kit/actions/sign-personal-message.md +1 -3
- package/dist/dapp-kit/actions/sign-transaction.md +1 -3
- package/dist/dapp-kit/actions/switch-account.md +1 -3
- package/dist/dapp-kit/index.md +4 -16
- package/dist/dapp-kit/llms-index.md +0 -1
- package/dist/dapp-kit/state.md +1 -3
- package/dist/llms-index.md +0 -1
- package/dist/payment-kit/payment-kit-sdk.md +2 -6
- package/dist/slush-wallet/dapp.md +2 -2
- package/dist/sui/migrations/sui-2.0/dapp-kit.md +2 -3
- package/dist/sui/transactions/signing-and-execution.md +14 -25
- package/package.json +39 -40
|
@@ -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({
|
package/dist/dapp-kit/index.md
CHANGED
|
@@ -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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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.
|
package/dist/dapp-kit/state.md
CHANGED
|
@@ -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();
|
package/dist/llms-index.md
CHANGED
|
@@ -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/
|
|
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
|
|
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
|
|
9
|
-
>
|
|
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 `
|
|
79
|
-
|
|
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
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.1.50",
|
|
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.
|
|
21
|
+
"@tanstack/react-query": "^5.101.4",
|
|
22
22
|
"fast-glob": "^3.3.3",
|
|
23
|
-
"fumadocs-core": "16.
|
|
24
|
-
"fumadocs-docgen": "^3.0
|
|
25
|
-
"fumadocs-mdx": "15.
|
|
26
|
-
"fumadocs-typescript": "^5.
|
|
27
|
-
"fumadocs-ui": "16.
|
|
28
|
-
"next": "^16.
|
|
29
|
-
"react": "^19.2.
|
|
30
|
-
"react-dom": "^19.2.
|
|
31
|
-
"@mysten/aws-kms-signer": "0.3.
|
|
32
|
-
"@mysten/
|
|
33
|
-
"@mysten/
|
|
34
|
-
"@mysten/dapp-kit-
|
|
35
|
-
"@mysten/
|
|
36
|
-
"@mysten/
|
|
37
|
-
"@mysten/enoki": "1.
|
|
38
|
-
"@mysten/
|
|
39
|
-
"@mysten/gcp-kms-signer": "0.2.
|
|
40
|
-
"@mysten/
|
|
41
|
-
"@mysten/ledger-signer": "0.2.
|
|
42
|
-
"@mysten/
|
|
43
|
-
"@mysten/
|
|
44
|
-
"@mysten/
|
|
45
|
-
"@mysten/
|
|
46
|
-
"@mysten/
|
|
47
|
-
"@mysten/
|
|
48
|
-
"@mysten/
|
|
49
|
-
"@mysten/walrus": "1.2.
|
|
50
|
-
"@mysten/webcrypto-signer": "0.2.
|
|
51
|
-
"@mysten/
|
|
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/dapp-kit-react": "2.1.20",
|
|
35
|
+
"@mysten/deepbook-v3": "2.0.1",
|
|
36
|
+
"@mysten/enoki": "1.2.16",
|
|
37
|
+
"@mysten/enoki-connect": "1.1.18",
|
|
38
|
+
"@mysten/kiosk": "1.4.4",
|
|
39
|
+
"@mysten/gcp-kms-signer": "0.2.18",
|
|
40
|
+
"@mysten/payment-kit": "0.2.18",
|
|
41
|
+
"@mysten/ledger-signer": "0.2.18",
|
|
42
|
+
"@mysten/signers": "1.1.18",
|
|
43
|
+
"@mysten/seal": "1.4.4",
|
|
44
|
+
"@mysten/slush-wallet": "1.1.18",
|
|
45
|
+
"@mysten/utils": "0.4.1",
|
|
46
|
+
"@mysten/suins": "1.2.18",
|
|
47
|
+
"@mysten/wallet-standard": "0.21.18",
|
|
48
|
+
"@mysten/zksend": "1.2.18",
|
|
49
|
+
"@mysten/walrus": "1.2.18",
|
|
50
|
+
"@mysten/webcrypto-signer": "0.2.18",
|
|
51
|
+
"@mysten/sui": "2.26.2"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
|
-
"@tailwindcss/postcss": "^4.3.
|
|
54
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
56
55
|
"@types/mdx": "^2.0.14",
|
|
57
|
-
"@types/node": "^
|
|
58
|
-
"@types/react": "^19.2.
|
|
59
|
-
"@types/react-dom": "^19.2.
|
|
60
|
-
"postcss": "
|
|
61
|
-
"tailwindcss": "^4.3.
|
|
62
|
-
"typedoc": "^0.28.
|
|
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": "
|
|
63
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
65
64
|
},
|
|
66
65
|
"scripts": {
|
|
67
66
|
"build": "typedoc && next build && pnpm run build:docs",
|