@mysten/dapp-kit-react 2.1.14 → 2.1.16
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/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mysten_dapp_kit_core5 from "@mysten/dapp-kit-core";
|
|
2
2
|
import { DAppKit, DefaultExpectedDppKit, RegisteredDAppKit } from "@mysten/dapp-kit-core";
|
|
3
3
|
import * as react0 from "react";
|
|
4
4
|
import { PropsWithChildren } from "react";
|
|
@@ -6,7 +6,7 @@ import * as nanostores0 from "nanostores";
|
|
|
6
6
|
export * from "@mysten/dapp-kit-core";
|
|
7
7
|
|
|
8
8
|
//#region src/components/DAppKitProvider.d.ts
|
|
9
|
-
declare const DAppKitContext: react0.Context<
|
|
9
|
+
declare const DAppKitContext: react0.Context<_mysten_dapp_kit_core5.DAppKit<any, _mysten_dapp_kit_core5.ClientWithCoreApi> | null>;
|
|
10
10
|
type DAppKitProviderProps = PropsWithChildren<{
|
|
11
11
|
dAppKit: DefaultExpectedDppKit;
|
|
12
12
|
}>;
|
|
@@ -24,7 +24,7 @@ type UseWalletsOptions<TDAppKit extends DAppKit> = {
|
|
|
24
24
|
};
|
|
25
25
|
declare function useWallets<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
|
|
26
26
|
dAppKit
|
|
27
|
-
}?: UseWalletsOptions<TDAppKit>):
|
|
27
|
+
}?: UseWalletsOptions<TDAppKit>): _mysten_dapp_kit_core5.UiWallet[];
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/hooks/useWalletConnection.d.ts
|
|
30
30
|
type UseWalletConnectionOptions<TDAppKit extends DAppKit<any>> = {
|
|
@@ -42,8 +42,8 @@ declare function useWalletConnection<TDAppKit extends DAppKit = RegisteredDAppKi
|
|
|
42
42
|
readonly isReconnecting: false;
|
|
43
43
|
readonly isDisconnected: true;
|
|
44
44
|
} | {
|
|
45
|
-
readonly wallet:
|
|
46
|
-
readonly account:
|
|
45
|
+
readonly wallet: _mysten_dapp_kit_core5.UiWallet;
|
|
46
|
+
readonly account: _mysten_dapp_kit_core5.UiWalletAccount;
|
|
47
47
|
readonly status: "connected";
|
|
48
48
|
readonly supportedIntents: string[];
|
|
49
49
|
readonly isConnected: true;
|
|
@@ -69,8 +69,8 @@ declare function useWalletConnection<TDAppKit extends DAppKit = RegisteredDAppKi
|
|
|
69
69
|
readonly isReconnecting: true;
|
|
70
70
|
readonly isDisconnected: false;
|
|
71
71
|
} | {
|
|
72
|
-
readonly wallet:
|
|
73
|
-
readonly account:
|
|
72
|
+
readonly wallet: _mysten_dapp_kit_core5.UiWallet;
|
|
73
|
+
readonly account: _mysten_dapp_kit_core5.UiWalletAccount;
|
|
74
74
|
readonly status: "reconnecting";
|
|
75
75
|
readonly supportedIntents: string[];
|
|
76
76
|
readonly isConnected: false;
|
|
@@ -85,7 +85,7 @@ type UseCurrentAccountOptions<TDAppKit extends DAppKit> = {
|
|
|
85
85
|
};
|
|
86
86
|
declare function useCurrentAccount<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
|
|
87
87
|
dAppKit
|
|
88
|
-
}?: UseCurrentAccountOptions<TDAppKit>):
|
|
88
|
+
}?: UseCurrentAccountOptions<TDAppKit>): _mysten_dapp_kit_core5.UiWalletAccount | null;
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/hooks/useCurrentWallet.d.ts
|
|
91
91
|
type UseCurrentWalletOptions<TDAppKit extends DAppKit> = {
|
|
@@ -93,7 +93,7 @@ type UseCurrentWalletOptions<TDAppKit extends DAppKit> = {
|
|
|
93
93
|
};
|
|
94
94
|
declare function useCurrentWallet<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
|
|
95
95
|
dAppKit
|
|
96
|
-
}?: UseCurrentWalletOptions<TDAppKit>):
|
|
96
|
+
}?: UseCurrentWalletOptions<TDAppKit>): _mysten_dapp_kit_core5.UiWallet | null;
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/hooks/useCurrentClient.d.ts
|
|
99
99
|
type UseCurrentClientOptions<TDAppKit extends DAppKit<any>> = {
|
|
@@ -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) |
|
|
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` |
|
|
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.
|
package/docs/llms-index.md
CHANGED
|
@@ -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:**
|
|
9
|
-
>
|
|
10
|
-
>
|
|
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
|
-
|
|
36
|
+
ReturnType<typeof dAppKit.getClient>;
|
|
36
37
|
```
|
package/docs/state.md
CHANGED
|
@@ -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
|
|
103
|
+
Contains the Sui client instance for the current network:
|
|
104
104
|
|
|
105
105
|
```typescript
|
|
106
106
|
const client = dAppKit.stores.$currentClient.get();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@mysten/dapp-kit-react",
|
|
3
3
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
4
4
|
"description": "React bindings for @mysten/dapp-kit-core",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.16",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"files": [
|
|
8
8
|
"LICENSE",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@lit/react": "^1.0.8",
|
|
45
45
|
"@nanostores/react": "^1.0.0",
|
|
46
46
|
"nanostores": "^1.3.0",
|
|
47
|
-
"@mysten/dapp-kit-core": "^1.6.
|
|
47
|
+
"@mysten/dapp-kit-core": "^1.6.14"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@types/react": ">=17.0.0",
|