@mysten/dapp-kit-react 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # dapp-kit-react
2
+
3
+ React hooks and components for building decentralized applications on the
4
+ [Sui](https://sui.io) blockchain. Built on top of
5
+ [`@mysten/dapp-kit-core`](https://www.npmjs.com/package/@mysten/dapp-kit-core).
6
+
7
+ Provides a `DAppKitProvider`, ready-to-use `ConnectButton` and `ConnectModal` components, and hooks
8
+ like `useDAppKit`, `useCurrentAccount`, `useCurrentWallet`, and more.
9
+
10
+ ## Installation
11
+
12
+ ```sh
13
+ npm i @mysten/dapp-kit-react @mysten/sui
14
+ ```
15
+
16
+ ## Documentation
17
+
18
+ See the [dApp Kit docs](https://sdk.mystenlabs.com/sui/dapp-kit) for full usage instructions,
19
+ guides, and API reference.
@@ -0,0 +1,123 @@
1
+ import * as _mysten_dapp_kit_core7 from "@mysten/dapp-kit-core";
2
+ import { DAppKit, DefaultExpectedDppKit, RegisteredDAppKit } from "@mysten/dapp-kit-core";
3
+ import { ComponentProps, PropsWithChildren } from "react";
4
+ import * as _lit_react0 from "@lit/react";
5
+ import { DAppKitConnectButton, DAppKitConnectModal } from "@mysten/dapp-kit-core/web";
6
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
7
+ import * as nanostores0 from "nanostores";
8
+ export * from "@mysten/dapp-kit-core";
9
+
10
+ //#region src/components/ConnectButton.d.ts
11
+ type ConnectButtonProps = ComponentProps<typeof ConnectButtonComponent>;
12
+ declare const ConnectButtonComponent: _lit_react0.ReactWebComponent<DAppKitConnectButton, {}>;
13
+ declare function ConnectButton({
14
+ instance,
15
+ ...props
16
+ }: ConnectButtonProps): react_jsx_runtime0.JSX.Element;
17
+ //#endregion
18
+ //#region src/components/ConnectModal.d.ts
19
+ type ConnectModalProps = ComponentProps<typeof ConnectModalComponent>;
20
+ declare const ConnectModalComponent: _lit_react0.ReactWebComponent<DAppKitConnectModal, {}>;
21
+ declare function ConnectModal({
22
+ instance,
23
+ ...props
24
+ }: ConnectModalProps): react_jsx_runtime0.JSX.Element;
25
+ //#endregion
26
+ //#region src/components/DAppKitProvider.d.ts
27
+ type DAppKitProviderProps = PropsWithChildren<{
28
+ dAppKit: DefaultExpectedDppKit;
29
+ }>;
30
+ declare function DAppKitProvider({
31
+ dAppKit,
32
+ children
33
+ }: DAppKitProviderProps): react_jsx_runtime0.JSX.Element;
34
+ //#endregion
35
+ //#region src/hooks/useDAppKit.d.ts
36
+ declare function useDAppKit<TDAppKit extends DAppKit<any> = RegisteredDAppKit>(dAppKit?: TDAppKit): TDAppKit;
37
+ //#endregion
38
+ //#region src/hooks/useWallets.d.ts
39
+ type UseWalletsOptions<TDAppKit extends DAppKit> = {
40
+ dAppKit?: TDAppKit;
41
+ };
42
+ declare function useWallets<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
43
+ dAppKit
44
+ }?: UseWalletsOptions<TDAppKit>): _mysten_dapp_kit_core7.UiWallet[];
45
+ //#endregion
46
+ //#region src/hooks/useWalletConnection.d.ts
47
+ type UseWalletConnectionOptions<TDAppKit extends DAppKit<any>> = {
48
+ dAppKit?: TDAppKit;
49
+ };
50
+ declare function useWalletConnection<TDAppKit extends DAppKit = RegisteredDAppKit>({
51
+ dAppKit
52
+ }?: UseWalletConnectionOptions<TDAppKit>): {
53
+ readonly wallet: _mysten_dapp_kit_core7.UiWallet;
54
+ readonly account: _mysten_dapp_kit_core7.UiWalletAccount;
55
+ readonly status: "connected";
56
+ readonly supportedIntents: string[];
57
+ readonly isConnected: true;
58
+ readonly isConnecting: false;
59
+ readonly isReconnecting: false;
60
+ readonly isDisconnected: false;
61
+ } | {
62
+ readonly wallet: null;
63
+ readonly account: null;
64
+ readonly status: "connecting";
65
+ readonly supportedIntents: readonly [];
66
+ readonly isConnected: false;
67
+ readonly isConnecting: true;
68
+ readonly isReconnecting: false;
69
+ readonly isDisconnected: false;
70
+ } | {
71
+ readonly wallet: _mysten_dapp_kit_core7.UiWallet;
72
+ readonly account: _mysten_dapp_kit_core7.UiWalletAccount;
73
+ readonly status: "reconnecting";
74
+ readonly supportedIntents: string[];
75
+ readonly isConnected: false;
76
+ readonly isConnecting: false;
77
+ readonly isReconnecting: true;
78
+ readonly isDisconnected: false;
79
+ } | {
80
+ readonly wallet: null;
81
+ readonly account: null;
82
+ readonly status: "disconnected";
83
+ readonly supportedIntents: readonly [];
84
+ readonly isConnected: false;
85
+ readonly isConnecting: false;
86
+ readonly isReconnecting: false;
87
+ readonly isDisconnected: true;
88
+ };
89
+ //#endregion
90
+ //#region src/hooks/useCurrentAccount.d.ts
91
+ type UseCurrentAccountOptions<TDAppKit extends DAppKit> = {
92
+ dAppKit?: TDAppKit;
93
+ };
94
+ declare function useCurrentAccount<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
95
+ dAppKit
96
+ }?: UseCurrentAccountOptions<TDAppKit>): _mysten_dapp_kit_core7.UiWalletAccount | null;
97
+ //#endregion
98
+ //#region src/hooks/useCurrentWallet.d.ts
99
+ type UseCurrentWalletOptions<TDAppKit extends DAppKit> = {
100
+ dAppKit?: TDAppKit;
101
+ };
102
+ declare function useCurrentWallet<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
103
+ dAppKit
104
+ }?: UseCurrentWalletOptions<TDAppKit>): _mysten_dapp_kit_core7.UiWallet | null;
105
+ //#endregion
106
+ //#region src/hooks/useCurrentClient.d.ts
107
+ type UseCurrentClientOptions<TDAppKit extends DAppKit<any>> = {
108
+ dAppKit?: TDAppKit;
109
+ };
110
+ declare function useCurrentClient<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
111
+ dAppKit
112
+ }?: UseCurrentClientOptions<TDAppKit>): ReturnType<TDAppKit["getClient"]>;
113
+ //#endregion
114
+ //#region src/hooks/useCurrentNetwork.d.ts
115
+ type UseCurrentNetworkOptions<TDAppKit extends DAppKit> = {
116
+ dAppKit?: TDAppKit;
117
+ };
118
+ declare function useCurrentNetwork<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
119
+ dAppKit
120
+ }?: UseCurrentNetworkOptions<TDAppKit>): nanostores0.StoreValue<TDAppKit["stores"]["$currentNetwork"]>;
121
+ //#endregion
122
+ export { ConnectButton, type ConnectButtonProps, ConnectModal, type ConnectModalProps, DAppKitProvider, type DAppKitProviderProps, useCurrentAccount, useCurrentClient, useCurrentNetwork, useCurrentWallet, useDAppKit, useWalletConnection, useWallets };
123
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/components/ConnectButton.tsx","../src/components/ConnectModal.tsx","../src/components/DAppKitProvider.tsx","../src/hooks/useDAppKit.ts","../src/hooks/useWallets.ts","../src/hooks/useWalletConnection.ts","../src/hooks/useCurrentAccount.ts","../src/hooks/useCurrentWallet.ts","../src/hooks/useCurrentClient.ts","../src/hooks/useCurrentNetwork.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KASY,kBAAA,GAAqB,sBAAsB;cAEjD,wBAAsB,WAAA,CAAA,kBAAA;iBAMZ,aAAA;;;GAAsC,qBAAkB,kBAAA,CAAA,GAAA,CAAA;;;KCR5D,iBAAA,GAAoB,sBAAsB;cAEhD,uBAAqB,WAAA,CAAA,kBAAA;iBAMX,YAAA;;;GAAqC,oBAAiB,kBAAA,CAAA,GAAA,CAAA;;;KCR1D,oBAAA,GAAuB;WACzB;;iBAGM,eAAA;;;GAAuC,uBAAoB,kBAAA,CAAA,GAAA,CAAA;;;iBCN3D,4BAA4B,eAAe,6BAA6B,WAAQ;;;KCApF,mCAAmC;YACpC;;iBAGK,4BAA4B,eAAe;;IAExD,kBAAkB,YAAD,sBAAA,CAAe,QAAA;;;KCNvB,4CAA4C;YAC7C;;iBAGK,qCAAqC,UAAU;;IAE5D,2BAA2B;mBAAD,sBAAA,CAAA;;;;;;ELJjB,SAAA,cAAkB,EAAA,KAAA;EAExB,SAAA,cAAA,EAIJ,KAAA;AAEF,CAAA,GAAgB;EAAgB,SAAA,MAAA,EAAA,IAAA;EAAsB,SAAA,OAAA,EAAA,IAAA;EAAkB,SAAA,MAAA,EAAA,YAAA;EAAA,SAAA,gBAAA,EAAA,SAAA,EAAA;;;;ECR5D,SAAA,cAAiB,EAAA,KAAA;AAAgD,CAAA,GAEvE;EAMU,SAAA,MAAY,iCAAA;EAAG,SAAA,OAAA,wCAAA;EAAsB,SAAA,MAAA,EAAA,cAAA;EAAiB,SAAA,gBAAA,EAAA,MAAA,EAAA;EAAA,SAAA,WAAA,EAAA,KAAA;;;;ACRtE,CAAA,GAAY;EAII,SAAA,MAAA,EAAA,IAAe;EAAG,SAAA,OAAA,EAAA,IAAA;EAAS,SAAA,MAAA,EAAA,cAAA;EAAY,SAAA,gBAAA,EAAA,SAAA,EAAA;EAAoB,SAAA,WAAA,EAAA,KAAA;EAAA,SAAA,YAAA,EAAA,KAAA;;;;;;KIP/D,0CAA0C;YAC3C;;iBAGK,mCAAmC,eAAe;;IAE/D,yBAAyB,YAAD,sBAAA,CAAe,eAAA;;;KCN9B,yCAAyC;YAC1C;;iBAGK,kCAAkC,eAAe;;IAE9D,wBAAwB,YAAD,sBAAA,CAAe,QAAA;;;KCL7B,yCAAyC;YAC1C;;iBAGK,kCAAkC,eAAe;;IAE9D,wBAAwB,YAEyB,WAAW;;;KCRnD,0CAA0C;YAC3C;;iBAGK,mCAAmC,eAAe;;IAE/D,yBAAyB,YAAc,WAAA,CAAA,WAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,96 @@
1
+ import * as React from "react";
2
+ import { createContext, useContext } from "react";
3
+ import { createComponent } from "@lit/react";
4
+ import { DAppKitConnectButton, DAppKitConnectModal } from "@mysten/dapp-kit-core/web";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { useStore } from "@nanostores/react";
7
+
8
+ export * from "@mysten/dapp-kit-core"
9
+
10
+ //#region src/components/DAppKitProvider.tsx
11
+ const DAppKitContext = createContext(null);
12
+ function DAppKitProvider({ dAppKit, children }) {
13
+ return /* @__PURE__ */ jsx(DAppKitContext.Provider, {
14
+ value: dAppKit,
15
+ children
16
+ });
17
+ }
18
+
19
+ //#endregion
20
+ //#region src/hooks/useDAppKit.ts
21
+ function useDAppKit(dAppKit) {
22
+ const contextValue = useContext(DAppKitContext);
23
+ if (dAppKit) return dAppKit;
24
+ if (!contextValue) throw new Error("Could not find DAppKitContext. Ensure that you have set up the `DAppKitProvider` component.");
25
+ return contextValue;
26
+ }
27
+
28
+ //#endregion
29
+ //#region src/components/ConnectButton.tsx
30
+ const ConnectButtonComponent = createComponent({
31
+ react: React,
32
+ tagName: "mysten-dapp-kit-connect-button",
33
+ elementClass: DAppKitConnectButton
34
+ });
35
+ function ConnectButton({ instance, ...props }) {
36
+ const dAppKit = useDAppKit(instance);
37
+ return /* @__PURE__ */ jsx(ConnectButtonComponent, {
38
+ ...props,
39
+ instance: dAppKit
40
+ });
41
+ }
42
+
43
+ //#endregion
44
+ //#region src/components/ConnectModal.tsx
45
+ const ConnectModalComponent = createComponent({
46
+ react: React,
47
+ tagName: "mysten-dapp-kit-connect-modal",
48
+ elementClass: DAppKitConnectModal
49
+ });
50
+ function ConnectModal({ instance, ...props }) {
51
+ const dAppKit = useDAppKit(instance);
52
+ return /* @__PURE__ */ jsx(ConnectModalComponent, {
53
+ ...props,
54
+ instance: dAppKit
55
+ });
56
+ }
57
+
58
+ //#endregion
59
+ //#region src/hooks/useWallets.ts
60
+ function useWallets({ dAppKit } = {}) {
61
+ return useStore(useDAppKit(dAppKit).stores.$wallets);
62
+ }
63
+
64
+ //#endregion
65
+ //#region src/hooks/useWalletConnection.ts
66
+ function useWalletConnection({ dAppKit } = {}) {
67
+ return useStore(useDAppKit(dAppKit).stores.$connection);
68
+ }
69
+
70
+ //#endregion
71
+ //#region src/hooks/useCurrentAccount.ts
72
+ function useCurrentAccount({ dAppKit } = {}) {
73
+ return useWalletConnection({ dAppKit }).account;
74
+ }
75
+
76
+ //#endregion
77
+ //#region src/hooks/useCurrentWallet.ts
78
+ function useCurrentWallet({ dAppKit } = {}) {
79
+ return useWalletConnection({ dAppKit }).wallet;
80
+ }
81
+
82
+ //#endregion
83
+ //#region src/hooks/useCurrentClient.ts
84
+ function useCurrentClient({ dAppKit } = {}) {
85
+ return useStore(useDAppKit(dAppKit).stores.$currentClient);
86
+ }
87
+
88
+ //#endregion
89
+ //#region src/hooks/useCurrentNetwork.ts
90
+ function useCurrentNetwork({ dAppKit } = {}) {
91
+ return useStore(useDAppKit(dAppKit).stores.$currentNetwork);
92
+ }
93
+
94
+ //#endregion
95
+ export { ConnectButton, ConnectModal, DAppKitProvider, useCurrentAccount, useCurrentClient, useCurrentNetwork, useCurrentWallet, useDAppKit, useWalletConnection, useWallets };
96
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["ConnectButtonElement","ConnectModalElement"],"sources":["../src/components/DAppKitProvider.tsx","../src/hooks/useDAppKit.ts","../src/components/ConnectButton.tsx","../src/components/ConnectModal.tsx","../src/hooks/useWallets.ts","../src/hooks/useWalletConnection.ts","../src/hooks/useCurrentAccount.ts","../src/hooks/useCurrentWallet.ts","../src/hooks/useCurrentClient.ts","../src/hooks/useCurrentNetwork.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { DefaultExpectedDppKit } from '@mysten/dapp-kit-core';\nimport { createContext } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nexport const DAppKitContext = createContext<DefaultExpectedDppKit | null>(null);\n\nexport type DAppKitProviderProps = PropsWithChildren<{\n\tdAppKit: DefaultExpectedDppKit;\n}>;\n\nexport function DAppKitProvider({ dAppKit, children }: DAppKitProviderProps) {\n\treturn <DAppKitContext.Provider value={dAppKit}>{children}</DAppKitContext.Provider>;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useContext } from 'react';\nimport { DAppKitContext } from '../components/DAppKitProvider.js';\nimport type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';\n\nexport function useDAppKit<TDAppKit extends DAppKit<any> = RegisteredDAppKit>(dAppKit?: TDAppKit) {\n\tconst contextValue = useContext(DAppKitContext);\n\n\tif (dAppKit) {\n\t\treturn dAppKit;\n\t}\n\n\tif (!contextValue) {\n\t\tthrow new Error(\n\t\t\t'Could not find DAppKitContext. Ensure that you have set up the `DAppKitProvider` component.',\n\t\t);\n\t}\n\n\treturn contextValue as TDAppKit;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport * as React from 'react';\nimport { createComponent } from '@lit/react';\nimport { DAppKitConnectButton as ConnectButtonElement } from '@mysten/dapp-kit-core/web';\nimport { useDAppKit } from '../hooks/useDAppKit.js';\nimport type { ComponentProps } from 'react';\n\nexport type ConnectButtonProps = ComponentProps<typeof ConnectButtonComponent>;\n\nconst ConnectButtonComponent = createComponent({\n\treact: React,\n\ttagName: 'mysten-dapp-kit-connect-button',\n\telementClass: ConnectButtonElement,\n});\n\nexport function ConnectButton({ instance, ...props }: ConnectButtonProps) {\n\tconst dAppKit = useDAppKit(instance);\n\treturn <ConnectButtonComponent {...props} instance={dAppKit} />;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport * as React from 'react';\nimport { createComponent } from '@lit/react';\nimport { DAppKitConnectModal as ConnectModalElement } from '@mysten/dapp-kit-core/web';\nimport { useDAppKit } from '../hooks/useDAppKit.js';\nimport type { ComponentProps } from 'react';\n\nexport type ConnectModalProps = ComponentProps<typeof ConnectModalComponent>;\n\nconst ConnectModalComponent = createComponent({\n\treact: React,\n\ttagName: 'mysten-dapp-kit-connect-modal',\n\telementClass: ConnectModalElement,\n});\n\nexport function ConnectModal({ instance, ...props }: ConnectModalProps) {\n\tconst dAppKit = useDAppKit(instance);\n\treturn <ConnectModalComponent {...props} instance={dAppKit} />;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';\nimport { useStore } from '@nanostores/react';\nimport { useDAppKit } from './useDAppKit.js';\n\nexport type UseWalletsOptions<TDAppKit extends DAppKit> = {\n\tdAppKit?: TDAppKit;\n};\n\nexport function useWallets<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({\n\tdAppKit,\n}: UseWalletsOptions<TDAppKit> = {}) {\n\tconst instance = useDAppKit(dAppKit);\n\treturn useStore(instance.stores.$wallets);\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';\nimport { useStore } from '@nanostores/react';\nimport { useDAppKit } from './useDAppKit.js';\n\nexport type UseWalletConnectionOptions<TDAppKit extends DAppKit<any>> = {\n\tdAppKit?: TDAppKit;\n};\n\nexport function useWalletConnection<TDAppKit extends DAppKit = RegisteredDAppKit>({\n\tdAppKit,\n}: UseWalletConnectionOptions<TDAppKit> = {}) {\n\tconst instance = useDAppKit(dAppKit);\n\treturn useStore(instance.stores.$connection);\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';\nimport { useWalletConnection } from './useWalletConnection.js';\n\nexport type UseCurrentAccountOptions<TDAppKit extends DAppKit> = {\n\tdAppKit?: TDAppKit;\n};\n\nexport function useCurrentAccount<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({\n\tdAppKit,\n}: UseCurrentAccountOptions<TDAppKit> = {}) {\n\tconst connection = useWalletConnection({ dAppKit });\n\treturn connection.account;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';\nimport { useWalletConnection } from './useWalletConnection.js';\n\nexport type UseCurrentWalletOptions<TDAppKit extends DAppKit> = {\n\tdAppKit?: TDAppKit;\n};\n\nexport function useCurrentWallet<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({\n\tdAppKit,\n}: UseCurrentWalletOptions<TDAppKit> = {}) {\n\tconst connection = useWalletConnection({ dAppKit });\n\treturn connection.wallet;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';\nimport { useStore } from '@nanostores/react';\nimport { useDAppKit } from './useDAppKit.js';\n\nexport type UseCurrentClientOptions<TDAppKit extends DAppKit<any>> = {\n\tdAppKit?: TDAppKit;\n};\n\nexport function useCurrentClient<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({\n\tdAppKit,\n}: UseCurrentClientOptions<TDAppKit> = {}) {\n\tconst instance = useDAppKit(dAppKit);\n\treturn useStore(instance.stores.$currentClient) as ReturnType<TDAppKit['getClient']>;\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';\nimport { useDAppKit } from './useDAppKit.js';\nimport { useStore } from '@nanostores/react';\n\nexport type UseCurrentNetworkOptions<TDAppKit extends DAppKit> = {\n\tdAppKit?: TDAppKit;\n};\n\nexport function useCurrentNetwork<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({\n\tdAppKit,\n}: UseCurrentNetworkOptions<TDAppKit> = {}) {\n\tconst instance = useDAppKit(dAppKit);\n\treturn useStore<TDAppKit['stores']['$currentNetwork']>(instance.stores.$currentNetwork);\n}\n"],"mappings":";;;;;;;;;;AAOA,MAAa,iBAAiB,cAA4C,KAAK;AAM/E,SAAgB,gBAAgB,EAAE,SAAS,YAAkC;AAC5E,QAAO,oBAAC,eAAe;EAAS,OAAO;EAAU;GAAmC;;;;;ACPrF,SAAgB,WAA8D,SAAoB;CACjG,MAAM,eAAe,WAAW,eAAe;AAE/C,KAAI,QACH,QAAO;AAGR,KAAI,CAAC,aACJ,OAAM,IAAI,MACT,8FACA;AAGF,QAAO;;;;;ACTR,MAAM,yBAAyB,gBAAgB;CAC9C,OAAO;CACP,SAAS;CACT,cAAcA;CACd,CAAC;AAEF,SAAgB,cAAc,EAAE,UAAU,GAAG,SAA6B;CACzE,MAAM,UAAU,WAAW,SAAS;AACpC,QAAO,oBAAC;EAAuB,GAAI;EAAO,UAAU;GAAW;;;;;ACRhE,MAAM,wBAAwB,gBAAgB;CAC7C,OAAO;CACP,SAAS;CACT,cAAcC;CACd,CAAC;AAEF,SAAgB,aAAa,EAAE,UAAU,GAAG,SAA4B;CACvE,MAAM,UAAU,WAAW,SAAS;AACpC,QAAO,oBAAC;EAAsB,GAAI;EAAO,UAAU;GAAW;;;;;ACR/D,SAAgB,WAA8D,EAC7E,YACgC,EAAE,EAAE;AAEpC,QAAO,SADU,WAAW,QAAQ,CACX,OAAO,SAAS;;;;;ACJ1C,SAAgB,oBAAkE,EACjF,YACyC,EAAE,EAAE;AAE7C,QAAO,SADU,WAAW,QAAQ,CACX,OAAO,YAAY;;;;;ACL7C,SAAgB,kBAAqE,EACpF,YACuC,EAAE,EAAE;AAE3C,QADmB,oBAAoB,EAAE,SAAS,CAAC,CACjC;;;;;ACJnB,SAAgB,iBAAoE,EACnF,YACsC,EAAE,EAAE;AAE1C,QADmB,oBAAoB,EAAE,SAAS,CAAC,CACjC;;;;;ACHnB,SAAgB,iBAAoE,EACnF,YACsC,EAAE,EAAE;AAE1C,QAAO,SADU,WAAW,QAAQ,CACX,OAAO,eAAe;;;;;ACJhD,SAAgB,kBAAqE,EACpF,YACuC,EAAE,EAAE;AAE3C,QAAO,SADU,WAAW,QAAQ,CAC4B,OAAO,gBAAgB"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@mysten/dapp-kit-react",
3
+ "author": "Mysten Labs <build@mystenlabs.com>",
4
+ "description": "React bindings for @mysten/dapp-kit-core",
5
+ "version": "1.0.0",
6
+ "license": "Apache-2.0",
7
+ "files": [
8
+ "LICENSE",
9
+ "README.md",
10
+ "dist",
11
+ "src"
12
+ ],
13
+ "type": "module",
14
+ "module": "./dist/index.mjs",
15
+ "types": "./dist/index.d.mts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.mts",
19
+ "import": "./dist/index.mjs"
20
+ }
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/MystenLabs/ts-sdks.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/MystenLabs/ts-sdks/issues/new"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "devDependencies": {
33
+ "@types/react": "^19.2.8",
34
+ "react": "^19.2.3",
35
+ "tsdown": "0.20.0-beta.1",
36
+ "typescript": "^5.9.3"
37
+ },
38
+ "dependencies": {
39
+ "@lit/react": "^1.0.8",
40
+ "@nanostores/react": "^1.0.0",
41
+ "nanostores": "^1.1.0",
42
+ "@mysten/dapp-kit-core": "^1.0.0"
43
+ },
44
+ "peerDependencies": {
45
+ "@types/react": ">=17.0.0",
46
+ "react": ">=17.0.0"
47
+ },
48
+ "scripts": {
49
+ "clean": "rm -rf tsconfig.tsbuildinfo ./dist",
50
+ "build": "pnpm typecheck && tsdown",
51
+ "typecheck": "tsc --noEmit",
52
+ "dev": "tsdown --watch",
53
+ "prettier:check": "prettier -c --ignore-unknown .",
54
+ "prettier:fix": "prettier -w --ignore-unknown .",
55
+ "oxlint:check": "oxlint .",
56
+ "oxlint:fix": "oxlint --fix",
57
+ "lint": "pnpm run oxlint:check && pnpm run prettier:check",
58
+ "lint:fix": "pnpm run oxlint:fix && pnpm run prettier:fix"
59
+ }
60
+ }
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import * as React from 'react';
5
+ import { createComponent } from '@lit/react';
6
+ import { DAppKitConnectButton as ConnectButtonElement } from '@mysten/dapp-kit-core/web';
7
+ import { useDAppKit } from '../hooks/useDAppKit.js';
8
+ import type { ComponentProps } from 'react';
9
+
10
+ export type ConnectButtonProps = ComponentProps<typeof ConnectButtonComponent>;
11
+
12
+ const ConnectButtonComponent = createComponent({
13
+ react: React,
14
+ tagName: 'mysten-dapp-kit-connect-button',
15
+ elementClass: ConnectButtonElement,
16
+ });
17
+
18
+ export function ConnectButton({ instance, ...props }: ConnectButtonProps) {
19
+ const dAppKit = useDAppKit(instance);
20
+ return <ConnectButtonComponent {...props} instance={dAppKit} />;
21
+ }
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import * as React from 'react';
5
+ import { createComponent } from '@lit/react';
6
+ import { DAppKitConnectModal as ConnectModalElement } from '@mysten/dapp-kit-core/web';
7
+ import { useDAppKit } from '../hooks/useDAppKit.js';
8
+ import type { ComponentProps } from 'react';
9
+
10
+ export type ConnectModalProps = ComponentProps<typeof ConnectModalComponent>;
11
+
12
+ const ConnectModalComponent = createComponent({
13
+ react: React,
14
+ tagName: 'mysten-dapp-kit-connect-modal',
15
+ elementClass: ConnectModalElement,
16
+ });
17
+
18
+ export function ConnectModal({ instance, ...props }: ConnectModalProps) {
19
+ const dAppKit = useDAppKit(instance);
20
+ return <ConnectModalComponent {...props} instance={dAppKit} />;
21
+ }
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { DefaultExpectedDppKit } from '@mysten/dapp-kit-core';
5
+ import { createContext } from 'react';
6
+ import type { PropsWithChildren } from 'react';
7
+
8
+ export const DAppKitContext = createContext<DefaultExpectedDppKit | null>(null);
9
+
10
+ export type DAppKitProviderProps = PropsWithChildren<{
11
+ dAppKit: DefaultExpectedDppKit;
12
+ }>;
13
+
14
+ export function DAppKitProvider({ dAppKit, children }: DAppKitProviderProps) {
15
+ return <DAppKitContext.Provider value={dAppKit}>{children}</DAppKitContext.Provider>;
16
+ }
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';
5
+ import { useWalletConnection } from './useWalletConnection.js';
6
+
7
+ export type UseCurrentAccountOptions<TDAppKit extends DAppKit> = {
8
+ dAppKit?: TDAppKit;
9
+ };
10
+
11
+ export function useCurrentAccount<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
12
+ dAppKit,
13
+ }: UseCurrentAccountOptions<TDAppKit> = {}) {
14
+ const connection = useWalletConnection({ dAppKit });
15
+ return connection.account;
16
+ }
@@ -0,0 +1,17 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';
5
+ import { useStore } from '@nanostores/react';
6
+ import { useDAppKit } from './useDAppKit.js';
7
+
8
+ export type UseCurrentClientOptions<TDAppKit extends DAppKit<any>> = {
9
+ dAppKit?: TDAppKit;
10
+ };
11
+
12
+ export function useCurrentClient<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
13
+ dAppKit,
14
+ }: UseCurrentClientOptions<TDAppKit> = {}) {
15
+ const instance = useDAppKit(dAppKit);
16
+ return useStore(instance.stores.$currentClient) as ReturnType<TDAppKit['getClient']>;
17
+ }
@@ -0,0 +1,17 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';
5
+ import { useDAppKit } from './useDAppKit.js';
6
+ import { useStore } from '@nanostores/react';
7
+
8
+ export type UseCurrentNetworkOptions<TDAppKit extends DAppKit> = {
9
+ dAppKit?: TDAppKit;
10
+ };
11
+
12
+ export function useCurrentNetwork<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
13
+ dAppKit,
14
+ }: UseCurrentNetworkOptions<TDAppKit> = {}) {
15
+ const instance = useDAppKit(dAppKit);
16
+ return useStore<TDAppKit['stores']['$currentNetwork']>(instance.stores.$currentNetwork);
17
+ }
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';
5
+ import { useWalletConnection } from './useWalletConnection.js';
6
+
7
+ export type UseCurrentWalletOptions<TDAppKit extends DAppKit> = {
8
+ dAppKit?: TDAppKit;
9
+ };
10
+
11
+ export function useCurrentWallet<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
12
+ dAppKit,
13
+ }: UseCurrentWalletOptions<TDAppKit> = {}) {
14
+ const connection = useWalletConnection({ dAppKit });
15
+ return connection.wallet;
16
+ }
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { useContext } from 'react';
5
+ import { DAppKitContext } from '../components/DAppKitProvider.js';
6
+ import type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';
7
+
8
+ export function useDAppKit<TDAppKit extends DAppKit<any> = RegisteredDAppKit>(dAppKit?: TDAppKit) {
9
+ const contextValue = useContext(DAppKitContext);
10
+
11
+ if (dAppKit) {
12
+ return dAppKit;
13
+ }
14
+
15
+ if (!contextValue) {
16
+ throw new Error(
17
+ 'Could not find DAppKitContext. Ensure that you have set up the `DAppKitProvider` component.',
18
+ );
19
+ }
20
+
21
+ return contextValue as TDAppKit;
22
+ }
@@ -0,0 +1,17 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';
5
+ import { useStore } from '@nanostores/react';
6
+ import { useDAppKit } from './useDAppKit.js';
7
+
8
+ export type UseWalletConnectionOptions<TDAppKit extends DAppKit<any>> = {
9
+ dAppKit?: TDAppKit;
10
+ };
11
+
12
+ export function useWalletConnection<TDAppKit extends DAppKit = RegisteredDAppKit>({
13
+ dAppKit,
14
+ }: UseWalletConnectionOptions<TDAppKit> = {}) {
15
+ const instance = useDAppKit(dAppKit);
16
+ return useStore(instance.stores.$connection);
17
+ }
@@ -0,0 +1,17 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { DAppKit, RegisteredDAppKit } from '@mysten/dapp-kit-core';
5
+ import { useStore } from '@nanostores/react';
6
+ import { useDAppKit } from './useDAppKit.js';
7
+
8
+ export type UseWalletsOptions<TDAppKit extends DAppKit> = {
9
+ dAppKit?: TDAppKit;
10
+ };
11
+
12
+ export function useWallets<TDAppKit extends DAppKit<any> = RegisteredDAppKit>({
13
+ dAppKit,
14
+ }: UseWalletsOptions<TDAppKit> = {}) {
15
+ const instance = useDAppKit(dAppKit);
16
+ return useStore(instance.stores.$wallets);
17
+ }
package/src/index.ts ADDED
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export * from '@mysten/dapp-kit-core';
5
+
6
+ export { ConnectButton } from './components/ConnectButton.js';
7
+ export type { ConnectButtonProps } from './components/ConnectButton.js';
8
+
9
+ export { ConnectModal } from './components/ConnectModal.js';
10
+ export type { ConnectModalProps } from './components/ConnectModal.js';
11
+
12
+ export { DAppKitProvider } from './components/DAppKitProvider.js';
13
+ export type { DAppKitProviderProps } from './components/DAppKitProvider.js';
14
+
15
+ export { useDAppKit } from './hooks/useDAppKit.js';
16
+ export { useWallets } from './hooks/useWallets.js';
17
+ export { useWalletConnection } from './hooks/useWalletConnection.js';
18
+ export { useCurrentAccount } from './hooks/useCurrentAccount.js';
19
+ export { useCurrentWallet } from './hooks/useCurrentWallet.js';
20
+ export { useCurrentClient } from './hooks/useCurrentClient.js';
21
+ export { useCurrentNetwork } from './hooks/useCurrentNetwork.js';