@solana/connector 0.1.10 → 0.2.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/README.md +344 -88
- package/dist/{chunk-MN7XNCYI.js → chunk-BJAVJQLK.js} +6 -6
- package/dist/{chunk-MN7XNCYI.js.map → chunk-BJAVJQLK.js.map} +1 -1
- package/dist/{chunk-6AJJJG5B.js → chunk-BZ2VBJCZ.js} +618 -415
- package/dist/chunk-BZ2VBJCZ.js.map +1 -0
- package/dist/{chunk-ATYK5OKR.js → chunk-EM4KNOKG.js} +614 -194
- package/dist/chunk-EM4KNOKG.js.map +1 -0
- package/dist/{chunk-4JT24DIX.js → chunk-HN5AJF7F.js} +61 -20
- package/dist/chunk-HN5AJF7F.js.map +1 -0
- package/dist/{chunk-FVA4TUI4.mjs → chunk-HPQ5T32K.mjs} +4 -4
- package/dist/{chunk-FVA4TUI4.mjs.map → chunk-HPQ5T32K.mjs.map} +1 -1
- package/dist/{chunk-QOIQBWMP.mjs → chunk-IDTUFDNB.mjs} +531 -339
- package/dist/chunk-IDTUFDNB.mjs.map +1 -0
- package/dist/{chunk-WGZYKDXF.mjs → chunk-RTXUS5KG.mjs} +529 -115
- package/dist/chunk-RTXUS5KG.mjs.map +1 -0
- package/dist/{chunk-64LV76OK.js → chunk-SITQ4JWM.js} +23 -2
- package/dist/chunk-SITQ4JWM.js.map +1 -0
- package/dist/{chunk-7XHVZW2L.mjs → chunk-UCISIAOG.mjs} +60 -19
- package/dist/chunk-UCISIAOG.mjs.map +1 -0
- package/dist/{chunk-DKCZA2QI.mjs → chunk-ZZTY3O4N.mjs} +21 -3
- package/dist/chunk-ZZTY3O4N.mjs.map +1 -0
- package/dist/compat.d.mts +1 -1
- package/dist/compat.d.ts +1 -1
- package/dist/compat.js +2 -2
- package/dist/compat.mjs +1 -1
- package/dist/headless.d.mts +25 -7
- package/dist/headless.d.ts +25 -7
- package/dist/headless.js +196 -132
- package/dist/headless.mjs +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +255 -175
- package/dist/index.mjs +5 -5
- package/dist/react.d.mts +230 -8
- package/dist/react.d.ts +230 -8
- package/dist/react.js +78 -42
- package/dist/react.mjs +2 -2
- package/dist/{standard-shim-BTUm7cur.d.mts → standard-shim-CGB88PPO.d.mts} +396 -54
- package/dist/{standard-shim-LsQ97i9T.d.ts → standard-shim-tmnQelaJ.d.ts} +396 -54
- package/dist/{transaction-signer-T-KVQFi8.d.ts → transaction-signer-7NaYmP5w.d.mts} +1 -0
- package/dist/{transaction-signer-T-KVQFi8.d.mts → transaction-signer-7NaYmP5w.d.ts} +1 -0
- package/dist/{walletconnect-D4JN6H2O.js → walletconnect-447EY3OJ.js} +8 -8
- package/dist/{walletconnect-D4JN6H2O.js.map → walletconnect-447EY3OJ.js.map} +1 -1
- package/dist/walletconnect-U455PO4I.mjs +3 -0
- package/dist/{walletconnect-I3PZUBTA.mjs.map → walletconnect-U455PO4I.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-4JT24DIX.js.map +0 -1
- package/dist/chunk-64LV76OK.js.map +0 -1
- package/dist/chunk-6AJJJG5B.js.map +0 -1
- package/dist/chunk-7XHVZW2L.mjs.map +0 -1
- package/dist/chunk-ATYK5OKR.js.map +0 -1
- package/dist/chunk-DKCZA2QI.mjs.map +0 -1
- package/dist/chunk-QOIQBWMP.mjs.map +0 -1
- package/dist/chunk-WGZYKDXF.mjs.map +0 -1
- package/dist/walletconnect-I3PZUBTA.mjs +0 -3
|
@@ -1,10 +1,284 @@
|
|
|
1
|
-
import { installPolyfills,
|
|
2
|
-
import { createLogger, __publicField, createSolanaClient, NetworkError, prepareTransaction } from './chunk-
|
|
3
|
-
import
|
|
4
|
-
import { jsx,
|
|
1
|
+
import { installPolyfills, isMainnetCluster, isDevnetCluster, isTestnetCluster, isLocalCluster, getClusterExplorerUrl, getClusterType, formatAddress, copyAddressToClipboard, createConnectorId, createTransactionSigner, createKitTransactionSigner, formatLamportsToSolSafe, getTransactionUrl, ConnectorClient, formatBigIntBalance, formatBigIntUsd } from './chunk-IDTUFDNB.mjs';
|
|
2
|
+
import { createLogger, __publicField, WalletErrorType, createSolanaClient, NetworkError, prepareTransaction, isConnectorError } from './chunk-ZZTY3O4N.mjs';
|
|
3
|
+
import React2, { createContext, Component, useTransition, useState, useCallback, useMemo, useRef, useEffect, useContext, useSyncExternalStore } from 'react';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { address } from '@solana/addresses';
|
|
6
6
|
import { signature } from '@solana/keys';
|
|
7
7
|
|
|
8
|
+
var logger = createLogger("ErrorBoundary");
|
|
9
|
+
var ErrorLogger = class {
|
|
10
|
+
static log(error, errorInfo, context) {
|
|
11
|
+
if (process.env.NODE_ENV === "development" && logger.error(error.message, {
|
|
12
|
+
error,
|
|
13
|
+
errorInfo,
|
|
14
|
+
context
|
|
15
|
+
}), process.env.NODE_ENV === "production" && typeof window < "u")
|
|
16
|
+
try {
|
|
17
|
+
let gtag = window.gtag;
|
|
18
|
+
typeof gtag == "function" && gtag("event", "exception", {
|
|
19
|
+
description: error.message,
|
|
20
|
+
fatal: false,
|
|
21
|
+
custom_map: { error_type: "wallet_error", ...context }
|
|
22
|
+
});
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function classifyError(error) {
|
|
28
|
+
if (isConnectorError(error)) {
|
|
29
|
+
let typeMapping = {
|
|
30
|
+
WALLET_NOT_CONNECTED: WalletErrorType.CONNECTION_FAILED,
|
|
31
|
+
WALLET_NOT_FOUND: WalletErrorType.WALLET_NOT_FOUND,
|
|
32
|
+
CONNECTION_FAILED: WalletErrorType.CONNECTION_FAILED,
|
|
33
|
+
USER_REJECTED: WalletErrorType.USER_REJECTED,
|
|
34
|
+
RPC_ERROR: WalletErrorType.NETWORK_ERROR,
|
|
35
|
+
NETWORK_TIMEOUT: WalletErrorType.NETWORK_ERROR,
|
|
36
|
+
SIGNING_FAILED: WalletErrorType.TRANSACTION_FAILED,
|
|
37
|
+
SEND_FAILED: WalletErrorType.TRANSACTION_FAILED
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
...error,
|
|
41
|
+
type: typeMapping[error.code] || WalletErrorType.UNKNOWN_ERROR,
|
|
42
|
+
recoverable: error.recoverable,
|
|
43
|
+
context: error.context
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
let walletError = error;
|
|
47
|
+
if (walletError.type) return walletError;
|
|
48
|
+
let type = WalletErrorType.UNKNOWN_ERROR, recoverable = false;
|
|
49
|
+
return error.message.includes("User rejected") || error.message.includes("User denied") ? (type = WalletErrorType.USER_REJECTED, recoverable = true) : error.message.includes("Insufficient funds") ? (type = WalletErrorType.INSUFFICIENT_FUNDS, recoverable = false) : error.message.includes("Network") || error.message.includes("fetch") ? (type = WalletErrorType.NETWORK_ERROR, recoverable = true) : error.message.includes("Wallet not found") || error.message.includes("not installed") ? (type = WalletErrorType.WALLET_NOT_FOUND, recoverable = true) : (error.message.includes("Failed to connect") || error.message.includes("Connection")) && (type = WalletErrorType.CONNECTION_FAILED, recoverable = true), {
|
|
50
|
+
...error,
|
|
51
|
+
type,
|
|
52
|
+
recoverable,
|
|
53
|
+
context: { originalMessage: error.message }
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var ConnectorErrorBoundary = class extends Component {
|
|
57
|
+
constructor(props) {
|
|
58
|
+
super(props);
|
|
59
|
+
__publicField(this, "retryTimeouts", /* @__PURE__ */ new Set());
|
|
60
|
+
__publicField(this, "retry", () => {
|
|
61
|
+
let { maxRetries = 3 } = this.props;
|
|
62
|
+
this.state.retryCount >= maxRetries || this.setState((prevState) => ({
|
|
63
|
+
hasError: false,
|
|
64
|
+
error: null,
|
|
65
|
+
errorInfo: null,
|
|
66
|
+
retryCount: prevState.retryCount + 1
|
|
67
|
+
}));
|
|
68
|
+
});
|
|
69
|
+
this.state = {
|
|
70
|
+
hasError: false,
|
|
71
|
+
error: null,
|
|
72
|
+
errorInfo: null,
|
|
73
|
+
errorId: "",
|
|
74
|
+
retryCount: 0
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
static getDerivedStateFromError(error) {
|
|
78
|
+
return {
|
|
79
|
+
hasError: true,
|
|
80
|
+
error,
|
|
81
|
+
errorId: `error_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
componentDidCatch(error, errorInfo) {
|
|
85
|
+
this.setState({ errorInfo }), ErrorLogger.log(error, errorInfo, {
|
|
86
|
+
retryCount: this.state.retryCount,
|
|
87
|
+
errorId: this.state.errorId,
|
|
88
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
89
|
+
}), this.props.onError?.(error, errorInfo);
|
|
90
|
+
}
|
|
91
|
+
componentWillUnmount() {
|
|
92
|
+
this.retryTimeouts.forEach((timeout) => clearTimeout(timeout));
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
if (this.state.hasError && this.state.error) {
|
|
96
|
+
let walletError = classifyError(this.state.error);
|
|
97
|
+
return this.props.fallback ? this.props.fallback(walletError, this.retry) : /* @__PURE__ */ jsx(DefaultErrorFallback, { error: walletError, onRetry: this.retry });
|
|
98
|
+
}
|
|
99
|
+
return this.props.children;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
function DefaultErrorFallback({ error, onRetry }) {
|
|
103
|
+
let [isPending, startTransition] = useTransition(), [isRetrying, setIsRetrying] = useState(false), handleRetry = useCallback(() => {
|
|
104
|
+
setIsRetrying(true), startTransition(() => {
|
|
105
|
+
setTimeout(() => {
|
|
106
|
+
onRetry(), setIsRetrying(false);
|
|
107
|
+
}, 500);
|
|
108
|
+
});
|
|
109
|
+
}, [onRetry]), { title, message, actionText, showRetry } = useMemo(() => {
|
|
110
|
+
switch (error.type) {
|
|
111
|
+
case WalletErrorType.USER_REJECTED:
|
|
112
|
+
return {
|
|
113
|
+
title: "Transaction Cancelled",
|
|
114
|
+
message: "You cancelled the transaction. No problem!",
|
|
115
|
+
actionText: "Try Again",
|
|
116
|
+
showRetry: true
|
|
117
|
+
};
|
|
118
|
+
case WalletErrorType.WALLET_NOT_FOUND:
|
|
119
|
+
return {
|
|
120
|
+
title: "Wallet Not Found",
|
|
121
|
+
message: "Please install a supported Solana wallet to continue.",
|
|
122
|
+
actionText: "Check Wallets",
|
|
123
|
+
showRetry: true
|
|
124
|
+
};
|
|
125
|
+
case WalletErrorType.NETWORK_ERROR:
|
|
126
|
+
return {
|
|
127
|
+
title: "Network Error",
|
|
128
|
+
message: "Having trouble connecting. Please check your internet connection.",
|
|
129
|
+
actionText: "Retry",
|
|
130
|
+
showRetry: true
|
|
131
|
+
};
|
|
132
|
+
case WalletErrorType.INSUFFICIENT_FUNDS:
|
|
133
|
+
return {
|
|
134
|
+
title: "Insufficient Funds",
|
|
135
|
+
message: "You don't have enough SOL for this transaction.",
|
|
136
|
+
actionText: "Add Funds",
|
|
137
|
+
showRetry: false
|
|
138
|
+
};
|
|
139
|
+
default:
|
|
140
|
+
return {
|
|
141
|
+
title: "Something went wrong",
|
|
142
|
+
message: "An unexpected error occurred. Please try again.",
|
|
143
|
+
actionText: "Retry",
|
|
144
|
+
showRetry: error.recoverable
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}, [error.type, error.recoverable]);
|
|
148
|
+
return /* @__PURE__ */ jsxs(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
style: {
|
|
152
|
+
display: "flex",
|
|
153
|
+
flexDirection: "column",
|
|
154
|
+
alignItems: "center",
|
|
155
|
+
justifyContent: "center",
|
|
156
|
+
padding: "2rem",
|
|
157
|
+
textAlign: "center",
|
|
158
|
+
borderRadius: "12px",
|
|
159
|
+
border: "1px solid #e5e7eb",
|
|
160
|
+
backgroundColor: "#fafafa",
|
|
161
|
+
maxWidth: "400px",
|
|
162
|
+
margin: "0 auto"
|
|
163
|
+
},
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsx(
|
|
166
|
+
"div",
|
|
167
|
+
{
|
|
168
|
+
style: {
|
|
169
|
+
width: "48px",
|
|
170
|
+
height: "48px",
|
|
171
|
+
borderRadius: "50%",
|
|
172
|
+
backgroundColor: "#fee2e2",
|
|
173
|
+
display: "flex",
|
|
174
|
+
alignItems: "center",
|
|
175
|
+
justifyContent: "center",
|
|
176
|
+
marginBottom: "1rem"
|
|
177
|
+
},
|
|
178
|
+
children: /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "#dc2626", children: /* @__PURE__ */ jsx("path", { d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) })
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ jsx(
|
|
182
|
+
"h3",
|
|
183
|
+
{
|
|
184
|
+
style: {
|
|
185
|
+
margin: "0 0 0.5rem 0",
|
|
186
|
+
fontSize: "1.125rem",
|
|
187
|
+
fontWeight: "600",
|
|
188
|
+
color: "#111827"
|
|
189
|
+
},
|
|
190
|
+
children: title
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
"p",
|
|
195
|
+
{
|
|
196
|
+
style: {
|
|
197
|
+
margin: "0 0 1.5rem 0",
|
|
198
|
+
fontSize: "0.875rem",
|
|
199
|
+
color: "#6b7280",
|
|
200
|
+
lineHeight: "1.5"
|
|
201
|
+
},
|
|
202
|
+
children: message
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "0.75rem", flexWrap: "wrap" }, children: [
|
|
206
|
+
showRetry && /* @__PURE__ */ jsx(
|
|
207
|
+
"button",
|
|
208
|
+
{
|
|
209
|
+
onClick: handleRetry,
|
|
210
|
+
disabled: isPending || isRetrying,
|
|
211
|
+
style: {
|
|
212
|
+
padding: "0.5rem 1rem",
|
|
213
|
+
backgroundColor: "#3b82f6",
|
|
214
|
+
color: "white",
|
|
215
|
+
border: "none",
|
|
216
|
+
borderRadius: "6px",
|
|
217
|
+
fontSize: "0.875rem",
|
|
218
|
+
fontWeight: "500",
|
|
219
|
+
cursor: isPending || isRetrying ? "wait" : "pointer",
|
|
220
|
+
opacity: isPending || isRetrying ? 0.7 : 1,
|
|
221
|
+
transition: "all 0.2s"
|
|
222
|
+
},
|
|
223
|
+
children: isRetrying ? "Retrying..." : actionText
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
227
|
+
"button",
|
|
228
|
+
{
|
|
229
|
+
onClick: () => window.location.reload(),
|
|
230
|
+
style: {
|
|
231
|
+
padding: "0.5rem 1rem",
|
|
232
|
+
backgroundColor: "transparent",
|
|
233
|
+
color: "#6b7280",
|
|
234
|
+
border: "1px solid #d1d5db",
|
|
235
|
+
borderRadius: "6px",
|
|
236
|
+
fontSize: "0.875rem",
|
|
237
|
+
fontWeight: "500",
|
|
238
|
+
cursor: "pointer",
|
|
239
|
+
transition: "all 0.2s"
|
|
240
|
+
},
|
|
241
|
+
children: "Refresh Page"
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
] }),
|
|
245
|
+
process.env.NODE_ENV === "development" && /* @__PURE__ */ jsxs(
|
|
246
|
+
"details",
|
|
247
|
+
{
|
|
248
|
+
style: {
|
|
249
|
+
marginTop: "1rem",
|
|
250
|
+
fontSize: "0.75rem",
|
|
251
|
+
color: "#6b7280",
|
|
252
|
+
width: "100%"
|
|
253
|
+
},
|
|
254
|
+
children: [
|
|
255
|
+
/* @__PURE__ */ jsx("summary", { style: { cursor: "pointer", marginBottom: "0.5rem" }, children: "Error Details" }),
|
|
256
|
+
/* @__PURE__ */ jsx(
|
|
257
|
+
"pre",
|
|
258
|
+
{
|
|
259
|
+
style: {
|
|
260
|
+
whiteSpace: "pre-wrap",
|
|
261
|
+
wordBreak: "break-all",
|
|
262
|
+
backgroundColor: "#f3f4f6",
|
|
263
|
+
padding: "0.5rem",
|
|
264
|
+
borderRadius: "4px",
|
|
265
|
+
overflow: "auto",
|
|
266
|
+
maxHeight: "200px"
|
|
267
|
+
},
|
|
268
|
+
children: error.message
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
function withErrorBoundary(Component2, errorBoundaryProps) {
|
|
279
|
+
let WrappedComponent = (props) => /* @__PURE__ */ jsx(ConnectorErrorBoundary, { ...errorBoundaryProps, children: /* @__PURE__ */ jsx(Component2, { ...props }) });
|
|
280
|
+
return WrappedComponent.displayName = `withErrorBoundary(${Component2.displayName || Component2.name})`, WrappedComponent;
|
|
281
|
+
}
|
|
8
282
|
var WalletConnectContext = createContext(null);
|
|
9
283
|
function WalletConnectProvider({ children }) {
|
|
10
284
|
let [uri, setUriState] = useState(null), isMountedRef = useRef(false), pendingUriRef = useRef(null);
|
|
@@ -32,7 +306,7 @@ function useWalletConnectUri() {
|
|
|
32
306
|
}
|
|
33
307
|
};
|
|
34
308
|
}
|
|
35
|
-
var
|
|
309
|
+
var logger2 = createLogger("ConnectorProvider");
|
|
36
310
|
installPolyfills();
|
|
37
311
|
var ConnectorContext = createContext(null);
|
|
38
312
|
ConnectorContext.displayName = "ConnectorContext";
|
|
@@ -41,13 +315,13 @@ function ConnectorProviderInternal({
|
|
|
41
315
|
config,
|
|
42
316
|
mobile
|
|
43
317
|
}) {
|
|
44
|
-
let clientRef = useRef(null), client =
|
|
318
|
+
let clientRef = useRef(null), client = React2.useCallback(() => {
|
|
45
319
|
if (!clientRef.current)
|
|
46
320
|
try {
|
|
47
|
-
clientRef.current = new ConnectorClient(config), typeof window < "u" && (window.__connectorClient = clientRef.current), config?.debug &&
|
|
321
|
+
clientRef.current = new ConnectorClient(config), typeof window < "u" && (window.__connectorClient = clientRef.current), config?.debug && logger2.info("Client initialized successfully");
|
|
48
322
|
} catch (error) {
|
|
49
323
|
let err = error;
|
|
50
|
-
|
|
324
|
+
logger2.error("Failed to initialize client", { error: err });
|
|
51
325
|
let extendedConfig = config;
|
|
52
326
|
return extendedConfig?.errorBoundary?.onError && extendedConfig.errorBoundary.onError(err, {
|
|
53
327
|
componentStack: "client-initialization",
|
|
@@ -56,7 +330,7 @@ function ConnectorProviderInternal({
|
|
|
56
330
|
}
|
|
57
331
|
return clientRef.current;
|
|
58
332
|
}, [config])();
|
|
59
|
-
return
|
|
333
|
+
return React2.useEffect(() => {
|
|
60
334
|
let currentClient = clientRef.current;
|
|
61
335
|
if (currentClient) {
|
|
62
336
|
let privateClient = currentClient;
|
|
@@ -65,7 +339,7 @@ function ConnectorProviderInternal({
|
|
|
65
339
|
return () => {
|
|
66
340
|
typeof window < "u" && (window.__connectorClient = void 0), currentClient && typeof currentClient.destroy == "function" && currentClient.destroy();
|
|
67
341
|
};
|
|
68
|
-
}, []),
|
|
342
|
+
}, []), React2.useEffect(() => {
|
|
69
343
|
if (!mobile) return;
|
|
70
344
|
let cancelled = false;
|
|
71
345
|
return (async () => {
|
|
@@ -120,25 +394,45 @@ function useConnector() {
|
|
|
120
394
|
"useConnector must be used within ConnectorProvider. Wrap your app with <ConnectorProvider> or <UnifiedProvider> to use connector hooks."
|
|
121
395
|
);
|
|
122
396
|
let { uri: walletConnectUri, clearUri: clearWalletConnectUri } = useWalletConnectUri(), state = useSyncExternalStore(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
397
|
+
React2.useCallback((cb) => client.subscribe(cb), [client]),
|
|
398
|
+
React2.useCallback(() => client.getSnapshot(), [client]),
|
|
399
|
+
React2.useCallback(() => client.getSnapshot(), [client])
|
|
126
400
|
), methods = useMemo(
|
|
127
401
|
() => ({
|
|
402
|
+
// Legacy (kept for backwards compatibility)
|
|
128
403
|
select: client.select.bind(client),
|
|
129
404
|
disconnect: client.disconnect.bind(client),
|
|
130
|
-
selectAccount: client.selectAccount.bind(client)
|
|
405
|
+
selectAccount: client.selectAccount.bind(client),
|
|
406
|
+
// vNext
|
|
407
|
+
connectWallet: client.connectWallet.bind(client),
|
|
408
|
+
disconnectWallet: client.disconnectWallet.bind(client)
|
|
131
409
|
}),
|
|
132
410
|
[client]
|
|
133
|
-
)
|
|
411
|
+
), vNextFields = useMemo(() => {
|
|
412
|
+
let walletStatus = state.wallet, isConnected2 = walletStatus.status === "connected", isConnecting2 = walletStatus.status === "connecting", isError = walletStatus.status === "error", connectorId = null, account = null, sessionAccounts = [], walletError = null;
|
|
413
|
+
walletStatus.status === "connected" ? (connectorId = walletStatus.session.connectorId, account = walletStatus.session.selectedAccount.address, sessionAccounts = walletStatus.session.accounts) : walletStatus.status === "connecting" ? connectorId = walletStatus.connectorId : walletStatus.status === "error" && (walletError = walletStatus.error, connectorId = walletStatus.connectorId ?? null);
|
|
414
|
+
let connector = connectorId ? state.connectors.find((c) => c.id === connectorId) ?? null : null;
|
|
415
|
+
return {
|
|
416
|
+
walletStatus,
|
|
417
|
+
isConnected: isConnected2,
|
|
418
|
+
isConnecting: isConnecting2,
|
|
419
|
+
isError,
|
|
420
|
+
walletError,
|
|
421
|
+
account,
|
|
422
|
+
sessionAccounts,
|
|
423
|
+
connectorId,
|
|
424
|
+
connector
|
|
425
|
+
};
|
|
426
|
+
}, [state.wallet, state.connectors]);
|
|
134
427
|
return useMemo(
|
|
135
428
|
() => ({
|
|
136
429
|
...state,
|
|
137
430
|
...methods,
|
|
431
|
+
...vNextFields,
|
|
138
432
|
walletConnectUri,
|
|
139
433
|
clearWalletConnectUri
|
|
140
434
|
}),
|
|
141
|
-
[state, methods, walletConnectUri, clearWalletConnectUri]
|
|
435
|
+
[state, methods, vNextFields, walletConnectUri, clearWalletConnectUri]
|
|
142
436
|
);
|
|
143
437
|
}
|
|
144
438
|
function useConnectorClient() {
|
|
@@ -170,6 +464,92 @@ function AppProvider(props) {
|
|
|
170
464
|
return props.connectorConfig?.walletConnect?.enabled ? /* @__PURE__ */ jsx(WalletConnectProvider, { children: /* @__PURE__ */ jsx(AppProviderInner, { ...props }) }) : /* @__PURE__ */ jsx(AppProviderInner, { ...props });
|
|
171
465
|
}
|
|
172
466
|
var UnifiedProvider = AppProvider;
|
|
467
|
+
function useWallet() {
|
|
468
|
+
let client = useContext(ConnectorContext);
|
|
469
|
+
if (!client)
|
|
470
|
+
throw new Error(
|
|
471
|
+
"useWallet must be used within ConnectorProvider. Wrap your app with <ConnectorProvider> or <UnifiedProvider> to use wallet hooks."
|
|
472
|
+
);
|
|
473
|
+
let walletStatus = useSyncExternalStore(
|
|
474
|
+
useCallback((cb) => client.subscribe(cb), [client]),
|
|
475
|
+
useCallback(() => client.getSnapshot().wallet, [client]),
|
|
476
|
+
useCallback(() => client.getSnapshot().wallet, [client])
|
|
477
|
+
);
|
|
478
|
+
return useMemo(() => {
|
|
479
|
+
let status = walletStatus.status, isConnected2 = status === "connected", isConnecting2 = status === "connecting", isError = status === "error", connectorId = null, account = null, accounts = [], session = null, error = null;
|
|
480
|
+
return walletStatus.status === "connected" ? (connectorId = walletStatus.session.connectorId, account = walletStatus.session.selectedAccount.address, accounts = walletStatus.session.accounts, session = walletStatus.session) : walletStatus.status === "connecting" ? connectorId = walletStatus.connectorId : walletStatus.status === "error" && (error = walletStatus.error, connectorId = walletStatus.connectorId ?? null), {
|
|
481
|
+
status,
|
|
482
|
+
walletStatus,
|
|
483
|
+
isConnected: isConnected2,
|
|
484
|
+
isConnecting: isConnecting2,
|
|
485
|
+
isError,
|
|
486
|
+
error,
|
|
487
|
+
connectorId,
|
|
488
|
+
account,
|
|
489
|
+
accounts,
|
|
490
|
+
session
|
|
491
|
+
};
|
|
492
|
+
}, [walletStatus]);
|
|
493
|
+
}
|
|
494
|
+
function useWalletConnectors() {
|
|
495
|
+
let client = useContext(ConnectorContext);
|
|
496
|
+
if (!client)
|
|
497
|
+
throw new Error(
|
|
498
|
+
"useWalletConnectors must be used within ConnectorProvider. Wrap your app with <ConnectorProvider> or <UnifiedProvider> to use wallet hooks."
|
|
499
|
+
);
|
|
500
|
+
return useSyncExternalStore(
|
|
501
|
+
useCallback((cb) => client.subscribe(cb), [client]),
|
|
502
|
+
useCallback(() => client.getSnapshot().connectors, [client]),
|
|
503
|
+
useCallback(() => client.getSnapshot().connectors, [client])
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
function useConnectWallet() {
|
|
507
|
+
let client = useContext(ConnectorContext), [isConnecting2, setIsConnecting] = useState(false), [error, setError] = useState(null);
|
|
508
|
+
if (!client)
|
|
509
|
+
throw new Error(
|
|
510
|
+
"useConnectWallet must be used within ConnectorProvider. Wrap your app with <ConnectorProvider> or <UnifiedProvider> to use wallet hooks."
|
|
511
|
+
);
|
|
512
|
+
let connect = useCallback(
|
|
513
|
+
async (connectorId, options) => {
|
|
514
|
+
setIsConnecting(true), setError(null);
|
|
515
|
+
try {
|
|
516
|
+
await client.connectWallet(connectorId, options);
|
|
517
|
+
} catch (e) {
|
|
518
|
+
let connectError = e instanceof Error ? e : new Error(String(e));
|
|
519
|
+
throw setError(connectError), connectError;
|
|
520
|
+
} finally {
|
|
521
|
+
setIsConnecting(false);
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
[client]
|
|
525
|
+
), resetError = useCallback(() => {
|
|
526
|
+
setError(null);
|
|
527
|
+
}, []);
|
|
528
|
+
return {
|
|
529
|
+
connect,
|
|
530
|
+
isConnecting: isConnecting2,
|
|
531
|
+
error,
|
|
532
|
+
resetError
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
function useDisconnectWallet() {
|
|
536
|
+
let client = useContext(ConnectorContext), [isDisconnecting, setIsDisconnecting] = useState(false);
|
|
537
|
+
if (!client)
|
|
538
|
+
throw new Error(
|
|
539
|
+
"useDisconnectWallet must be used within ConnectorProvider. Wrap your app with <ConnectorProvider> or <UnifiedProvider> to use wallet hooks."
|
|
540
|
+
);
|
|
541
|
+
return {
|
|
542
|
+
disconnect: useCallback(async () => {
|
|
543
|
+
setIsDisconnecting(true);
|
|
544
|
+
try {
|
|
545
|
+
await client.disconnectWallet();
|
|
546
|
+
} finally {
|
|
547
|
+
setIsDisconnecting(false);
|
|
548
|
+
}
|
|
549
|
+
}, [client]),
|
|
550
|
+
isDisconnecting
|
|
551
|
+
};
|
|
552
|
+
}
|
|
173
553
|
function useCluster() {
|
|
174
554
|
let { cluster, clusters } = useConnector(), client = useConnectorClient();
|
|
175
555
|
if (!client)
|
|
@@ -196,7 +576,7 @@ function useCluster() {
|
|
|
196
576
|
}, [cluster, clusters, setCluster]);
|
|
197
577
|
}
|
|
198
578
|
function useAccount() {
|
|
199
|
-
let { selectedAccount, accounts, connected, selectAccount } = useConnector(), [copied, setCopied] = useState(false), copyTimeoutRef =
|
|
579
|
+
let { selectedAccount, accounts, connected, selectAccount } = useConnector(), [copied, setCopied] = useState(false), copyTimeoutRef = React2.useRef(void 0), account = useMemo(
|
|
200
580
|
() => accounts.find((a) => a.address === selectedAccount) ?? null,
|
|
201
581
|
[accounts, selectedAccount]
|
|
202
582
|
), formatted = useMemo(() => selectedAccount ? formatAddress(selectedAccount) : "", [selectedAccount]), copy = useCallback(async () => selectedAccount ? (copyTimeoutRef.current && clearTimeout(copyTimeoutRef.current), await copyAddressToClipboard(selectedAccount, {
|
|
@@ -208,7 +588,7 @@ function useAccount() {
|
|
|
208
588
|
error: "empty_value" /* EMPTY_VALUE */,
|
|
209
589
|
errorMessage: "No account selected"
|
|
210
590
|
}, [selectedAccount]);
|
|
211
|
-
return
|
|
591
|
+
return React2.useEffect(() => () => {
|
|
212
592
|
copyTimeoutRef.current && clearTimeout(copyTimeoutRef.current);
|
|
213
593
|
}, []), useMemo(
|
|
214
594
|
() => ({
|
|
@@ -229,6 +609,7 @@ function useWalletInfo() {
|
|
|
229
609
|
() => wallets.map(
|
|
230
610
|
(walletInfo) => ({
|
|
231
611
|
name: walletInfo.wallet.name,
|
|
612
|
+
connectorId: createConnectorId(walletInfo.wallet.name),
|
|
232
613
|
icon: walletInfo.wallet.icon,
|
|
233
614
|
installed: walletInfo.installed,
|
|
234
615
|
connectable: walletInfo.connectable
|
|
@@ -298,7 +679,7 @@ function useKitTransactionSigner() {
|
|
|
298
679
|
};
|
|
299
680
|
}
|
|
300
681
|
var useGillTransactionSigner = useKitTransactionSigner;
|
|
301
|
-
var
|
|
682
|
+
var logger3 = createLogger("useSolanaClient");
|
|
302
683
|
function useSolanaClient() {
|
|
303
684
|
let { type } = useCluster(), connectorClient = useConnectorClient(), client = useMemo(() => {
|
|
304
685
|
if (!type || !connectorClient) return null;
|
|
@@ -310,7 +691,7 @@ function useSolanaClient() {
|
|
|
310
691
|
urlOrMoniker: type
|
|
311
692
|
}) : null;
|
|
312
693
|
} catch (error) {
|
|
313
|
-
return
|
|
694
|
+
return logger3.error("Failed to create Solana client", { error }), null;
|
|
314
695
|
}
|
|
315
696
|
}, [type, connectorClient]);
|
|
316
697
|
return useMemo(
|
|
@@ -1645,7 +2026,7 @@ function DisconnectElement({
|
|
|
1645
2026
|
onDisconnect,
|
|
1646
2027
|
render
|
|
1647
2028
|
}) {
|
|
1648
|
-
let { disconnect, connecting } = useConnector(), [disconnecting, setDisconnecting] =
|
|
2029
|
+
let { disconnect, connecting } = useConnector(), [disconnecting, setDisconnecting] = React2.useState(false), handleDisconnect = async () => {
|
|
1649
2030
|
setDisconnecting(true);
|
|
1650
2031
|
try {
|
|
1651
2032
|
await disconnect(), onDisconnect?.();
|
|
@@ -1889,7 +2270,7 @@ function ClusterElement({
|
|
|
1889
2270
|
labels = {},
|
|
1890
2271
|
render
|
|
1891
2272
|
}) {
|
|
1892
|
-
let { cluster, clusters, setCluster, isMainnet, isDevnet, isTestnet, isLocal } = useCluster(), [isOpen, setIsOpen] =
|
|
2273
|
+
let { cluster, clusters, setCluster, isMainnet, isDevnet, isTestnet, isLocal } = useCluster(), [isOpen, setIsOpen] = React2.useState(false);
|
|
1893
2274
|
if (render)
|
|
1894
2275
|
return /* @__PURE__ */ jsx(Fragment, { children: render({ cluster, clusters, setCluster, isMainnet, isDevnet, isTestnet, isLocal }) });
|
|
1895
2276
|
if (!cluster) return null;
|
|
@@ -2096,14 +2477,32 @@ function WalletListElement({
|
|
|
2096
2477
|
variant = "list",
|
|
2097
2478
|
showStatus = true,
|
|
2098
2479
|
onSelect,
|
|
2480
|
+
onConnect,
|
|
2099
2481
|
render,
|
|
2100
2482
|
renderWallet
|
|
2101
2483
|
}) {
|
|
2102
2484
|
let { wallets, connecting } = useWalletInfo(), { select } = useConnector(), installedWallets = wallets.filter((w) => w.installed), displayWallets = installedOnly ? installedWallets : wallets, handleSelect = async (walletName) => {
|
|
2103
2485
|
await select(walletName), onSelect?.(walletName);
|
|
2486
|
+
}, handleConnectById = async (connectorId) => {
|
|
2487
|
+
let wallet = wallets.find((w) => w.connectorId === connectorId);
|
|
2488
|
+
if (!wallet) {
|
|
2489
|
+
let availableConnectorIds = wallets.map((w) => w.connectorId);
|
|
2490
|
+
console.warn(
|
|
2491
|
+
`[WalletListElement] Wallet not found for connectorId: ${connectorId}. Available connectorIds (${availableConnectorIds.length}):`,
|
|
2492
|
+
availableConnectorIds
|
|
2493
|
+
);
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2496
|
+
await select(wallet.name), onConnect?.(connectorId);
|
|
2104
2497
|
};
|
|
2105
2498
|
if (render)
|
|
2106
|
-
return /* @__PURE__ */ jsx(Fragment, { children: render({
|
|
2499
|
+
return /* @__PURE__ */ jsx(Fragment, { children: render({
|
|
2500
|
+
wallets,
|
|
2501
|
+
installedWallets,
|
|
2502
|
+
select: handleSelect,
|
|
2503
|
+
connectById: handleConnectById,
|
|
2504
|
+
connecting
|
|
2505
|
+
}) });
|
|
2107
2506
|
if (displayWallets.length === 0)
|
|
2108
2507
|
return /* @__PURE__ */ jsx(
|
|
2109
2508
|
"div",
|
|
@@ -2161,28 +2560,33 @@ function WalletListElement({
|
|
|
2161
2560
|
className: `ck-wallet-list-block ck-wallet-list-block--grid ${className || ""}`,
|
|
2162
2561
|
"data-slot": "wallet-list-element",
|
|
2163
2562
|
"data-variant": "grid",
|
|
2164
|
-
children: displayWallets.map((wallet) =>
|
|
2165
|
-
wallet
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2563
|
+
children: displayWallets.map((wallet) => {
|
|
2564
|
+
let handleWalletConnect = () => handleConnectById(wallet.connectorId);
|
|
2565
|
+
return renderWallet ? /* @__PURE__ */ jsx(React2.Fragment, { children: renderWallet({
|
|
2566
|
+
wallet,
|
|
2567
|
+
select: handleWalletConnect,
|
|
2568
|
+
connect: handleWalletConnect,
|
|
2569
|
+
connecting
|
|
2570
|
+
}) }, wallet.name) : /* @__PURE__ */ jsxs(
|
|
2571
|
+
"button",
|
|
2572
|
+
{
|
|
2573
|
+
type: "button",
|
|
2574
|
+
className: "ck-wallet-list-item ck-wallet-list-item--grid",
|
|
2575
|
+
onClick: handleWalletConnect,
|
|
2576
|
+
disabled: connecting || !wallet.installed && installedOnly,
|
|
2577
|
+
"data-slot": "wallet-list-item",
|
|
2578
|
+
"data-wallet": wallet.name,
|
|
2579
|
+
"data-connector-id": wallet.connectorId,
|
|
2580
|
+
"data-installed": wallet.installed,
|
|
2581
|
+
children: [
|
|
2582
|
+
/* @__PURE__ */ jsx("div", { className: "ck-wallet-list-item-icon", "data-slot": "wallet-list-item-icon", children: wallet.icon ? /* @__PURE__ */ jsx("img", { src: wallet.icon, alt: wallet.name }) : walletIcon }),
|
|
2583
|
+
/* @__PURE__ */ jsx("span", { className: "ck-wallet-list-item-name", "data-slot": "wallet-list-item-name", children: wallet.name }),
|
|
2584
|
+
showStatus && !wallet.installed && /* @__PURE__ */ jsx("span", { className: "ck-wallet-list-item-status", "data-slot": "wallet-list-item-status", children: "Not installed" })
|
|
2585
|
+
]
|
|
2586
|
+
},
|
|
2587
|
+
wallet.name
|
|
2588
|
+
);
|
|
2589
|
+
})
|
|
2186
2590
|
}
|
|
2187
2591
|
) : variant === "compact" ? /* @__PURE__ */ jsx(
|
|
2188
2592
|
"div",
|
|
@@ -2190,27 +2594,32 @@ function WalletListElement({
|
|
|
2190
2594
|
className: `ck-wallet-list-block ck-wallet-list-block--compact ${className || ""}`,
|
|
2191
2595
|
"data-slot": "wallet-list-element",
|
|
2192
2596
|
"data-variant": "compact",
|
|
2193
|
-
children: displayWallets.map((wallet) =>
|
|
2194
|
-
wallet
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2597
|
+
children: displayWallets.map((wallet) => {
|
|
2598
|
+
let handleWalletConnect = () => handleConnectById(wallet.connectorId);
|
|
2599
|
+
return renderWallet ? /* @__PURE__ */ jsx(React2.Fragment, { children: renderWallet({
|
|
2600
|
+
wallet,
|
|
2601
|
+
select: handleWalletConnect,
|
|
2602
|
+
connect: handleWalletConnect,
|
|
2603
|
+
connecting
|
|
2604
|
+
}) }, wallet.name) : /* @__PURE__ */ jsxs(
|
|
2605
|
+
"button",
|
|
2606
|
+
{
|
|
2607
|
+
type: "button",
|
|
2608
|
+
className: "ck-wallet-list-item ck-wallet-list-item--compact",
|
|
2609
|
+
onClick: handleWalletConnect,
|
|
2610
|
+
disabled: connecting || !wallet.installed && installedOnly,
|
|
2611
|
+
"data-slot": "wallet-list-item",
|
|
2612
|
+
"data-wallet": wallet.name,
|
|
2613
|
+
"data-connector-id": wallet.connectorId,
|
|
2614
|
+
"data-installed": wallet.installed,
|
|
2615
|
+
children: [
|
|
2616
|
+
/* @__PURE__ */ jsx("div", { className: "ck-wallet-list-item-icon", "data-slot": "wallet-list-item-icon", children: wallet.icon ? /* @__PURE__ */ jsx("img", { src: wallet.icon, alt: wallet.name }) : walletIcon }),
|
|
2617
|
+
/* @__PURE__ */ jsx("span", { className: "ck-wallet-list-item-name", "data-slot": "wallet-list-item-name", children: wallet.name })
|
|
2618
|
+
]
|
|
2619
|
+
},
|
|
2620
|
+
wallet.name
|
|
2621
|
+
);
|
|
2622
|
+
})
|
|
2214
2623
|
}
|
|
2215
2624
|
) : /* @__PURE__ */ jsx(
|
|
2216
2625
|
"div",
|
|
@@ -2218,54 +2627,59 @@ function WalletListElement({
|
|
|
2218
2627
|
className: `ck-wallet-list-block ck-wallet-list-block--list ${className || ""}`,
|
|
2219
2628
|
"data-slot": "wallet-list-element",
|
|
2220
2629
|
"data-variant": "list",
|
|
2221
|
-
children: displayWallets.map((wallet) =>
|
|
2222
|
-
wallet
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2630
|
+
children: displayWallets.map((wallet) => {
|
|
2631
|
+
let handleWalletConnect = () => handleConnectById(wallet.connectorId);
|
|
2632
|
+
return renderWallet ? /* @__PURE__ */ jsx(React2.Fragment, { children: renderWallet({
|
|
2633
|
+
wallet,
|
|
2634
|
+
select: handleWalletConnect,
|
|
2635
|
+
connect: handleWalletConnect,
|
|
2636
|
+
connecting
|
|
2637
|
+
}) }, wallet.name) : /* @__PURE__ */ jsxs(
|
|
2638
|
+
"button",
|
|
2639
|
+
{
|
|
2640
|
+
type: "button",
|
|
2641
|
+
className: "ck-wallet-list-item ck-wallet-list-item--list",
|
|
2642
|
+
onClick: handleWalletConnect,
|
|
2643
|
+
disabled: connecting || !wallet.installed && installedOnly,
|
|
2644
|
+
"data-slot": "wallet-list-item",
|
|
2645
|
+
"data-wallet": wallet.name,
|
|
2646
|
+
"data-connector-id": wallet.connectorId,
|
|
2647
|
+
"data-installed": wallet.installed,
|
|
2648
|
+
children: [
|
|
2649
|
+
/* @__PURE__ */ jsx("div", { className: "ck-wallet-list-item-icon", "data-slot": "wallet-list-item-icon", children: wallet.icon ? /* @__PURE__ */ jsx("img", { src: wallet.icon, alt: wallet.name }) : walletIcon }),
|
|
2650
|
+
/* @__PURE__ */ jsxs("div", { className: "ck-wallet-list-item-info", "data-slot": "wallet-list-item-info", children: [
|
|
2651
|
+
/* @__PURE__ */ jsx("span", { className: "ck-wallet-list-item-name", "data-slot": "wallet-list-item-name", children: wallet.name }),
|
|
2652
|
+
showStatus && /* @__PURE__ */ jsx(
|
|
2653
|
+
"span",
|
|
2654
|
+
{
|
|
2655
|
+
className: "ck-wallet-list-item-status",
|
|
2656
|
+
"data-slot": "wallet-list-item-status",
|
|
2657
|
+
"data-installed": wallet.installed,
|
|
2658
|
+
children: wallet.installed ? "Detected" : "Not installed"
|
|
2659
|
+
}
|
|
2660
|
+
)
|
|
2661
|
+
] }),
|
|
2662
|
+
/* @__PURE__ */ jsx(
|
|
2663
|
+
"svg",
|
|
2241
2664
|
{
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
"
|
|
2245
|
-
|
|
2665
|
+
width: "16",
|
|
2666
|
+
height: "16",
|
|
2667
|
+
viewBox: "0 0 24 24",
|
|
2668
|
+
fill: "none",
|
|
2669
|
+
stroke: "currentColor",
|
|
2670
|
+
strokeWidth: "2",
|
|
2671
|
+
strokeLinecap: "round",
|
|
2672
|
+
strokeLinejoin: "round",
|
|
2673
|
+
className: "ck-wallet-list-item-arrow",
|
|
2674
|
+
"data-slot": "wallet-list-item-arrow",
|
|
2675
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" })
|
|
2246
2676
|
}
|
|
2247
2677
|
)
|
|
2248
|
-
]
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
height: "16",
|
|
2254
|
-
viewBox: "0 0 24 24",
|
|
2255
|
-
fill: "none",
|
|
2256
|
-
stroke: "currentColor",
|
|
2257
|
-
strokeWidth: "2",
|
|
2258
|
-
strokeLinecap: "round",
|
|
2259
|
-
strokeLinejoin: "round",
|
|
2260
|
-
className: "ck-wallet-list-item-arrow",
|
|
2261
|
-
"data-slot": "wallet-list-item-arrow",
|
|
2262
|
-
children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" })
|
|
2263
|
-
}
|
|
2264
|
-
)
|
|
2265
|
-
]
|
|
2266
|
-
},
|
|
2267
|
-
wallet.name
|
|
2268
|
-
))
|
|
2678
|
+
]
|
|
2679
|
+
},
|
|
2680
|
+
wallet.name
|
|
2681
|
+
);
|
|
2682
|
+
})
|
|
2269
2683
|
}
|
|
2270
2684
|
);
|
|
2271
2685
|
}
|
|
@@ -2302,7 +2716,7 @@ function injectStyles() {
|
|
|
2302
2716
|
}
|
|
2303
2717
|
}
|
|
2304
2718
|
function SkeletonShine() {
|
|
2305
|
-
return
|
|
2719
|
+
return React2.useEffect(() => {
|
|
2306
2720
|
injectStyles();
|
|
2307
2721
|
}, []), /* @__PURE__ */ jsx("div", { className: "ck-skeleton-shine", "data-slot": "skeleton-shine" });
|
|
2308
2722
|
}
|
|
@@ -2836,6 +3250,6 @@ function TokenListElement({
|
|
|
2836
3250
|
}
|
|
2837
3251
|
TokenListElement.displayName = "TokenListElement";
|
|
2838
3252
|
|
|
2839
|
-
export { AccountElement, AppProvider, BalanceElement, ClusterElement, ConnectorProvider, DisconnectElement, SkeletonShine, TokenListElement, TransactionHistoryElement, UnifiedProvider, WalletConnectProvider, WalletListElement, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnector, useConnectorClient, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletConnectUri, useWalletInfo };
|
|
2840
|
-
//# sourceMappingURL=chunk-
|
|
2841
|
-
//# sourceMappingURL=chunk-
|
|
3253
|
+
export { AccountElement, AppProvider, BalanceElement, ClusterElement, ConnectorErrorBoundary, ConnectorProvider, DisconnectElement, SkeletonShine, TokenListElement, TransactionHistoryElement, UnifiedProvider, WalletConnectProvider, WalletListElement, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnectWallet, useConnector, useConnectorClient, useDisconnectWallet, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWallet, useWalletConnectUri, useWalletConnectors, useWalletInfo, withErrorBoundary };
|
|
3254
|
+
//# sourceMappingURL=chunk-RTXUS5KG.mjs.map
|
|
3255
|
+
//# sourceMappingURL=chunk-RTXUS5KG.mjs.map
|