@nexus-cross/dapp-ui 1.0.0-beta.1
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 +527 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +537 -0
- package/dist/index.d.ts +537 -0
- package/dist/index.js +14 -0
- package/package.json +68 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
4
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
+
|
|
6
|
+
type Environment = "dev" | "stage" | "production";
|
|
7
|
+
type Theme = "dark" | "light";
|
|
8
|
+
type DrawerDirection$1 = "right" | "bottom" | "left";
|
|
9
|
+
|
|
10
|
+
interface AppLauncherProps {
|
|
11
|
+
env?: Environment;
|
|
12
|
+
theme?: Theme;
|
|
13
|
+
mobileBreakpoint?: number;
|
|
14
|
+
domain?: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare function AppLauncher({ env, theme, mobileBreakpoint, domain, children, }: AppLauncherProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
interface AppLauncherTriggerProps {
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare function AppLauncherTrigger({ asChild, children, }: AppLauncherTriggerProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
interface AppLauncherContentProps {
|
|
26
|
+
align?: "start" | "center" | "end";
|
|
27
|
+
sideOffset?: number;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
declare function AppLauncherContent({ align, sideOffset, className, }: AppLauncherContentProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
interface GlobalMenuItemUrl {
|
|
33
|
+
dev: string;
|
|
34
|
+
stage: string;
|
|
35
|
+
production: string;
|
|
36
|
+
}
|
|
37
|
+
interface GlobalMenuItem {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description: string;
|
|
41
|
+
url: GlobalMenuItemUrl;
|
|
42
|
+
iconUrl: string;
|
|
43
|
+
order: number;
|
|
44
|
+
type: string;
|
|
45
|
+
badge: string | null;
|
|
46
|
+
isNew: boolean;
|
|
47
|
+
}
|
|
48
|
+
interface GlobalMenu {
|
|
49
|
+
version: string;
|
|
50
|
+
items: GlobalMenuItem[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare function useGlobalMenu(env?: Environment): _tanstack_react_query.UseQueryResult<GlobalMenu, Error>;
|
|
54
|
+
|
|
55
|
+
/** CAIP-2 chain identifier (e.g. "eip155:612044") */
|
|
56
|
+
type ChainId = `eip155:${number}`;
|
|
57
|
+
declare enum ConnectorId {
|
|
58
|
+
CROSSx = "crossx",
|
|
59
|
+
MetaMask = "io.metamask",
|
|
60
|
+
Binance = "com.binance.wallet"
|
|
61
|
+
}
|
|
62
|
+
interface ConnectorMeta {
|
|
63
|
+
name: string;
|
|
64
|
+
iconUrl: string;
|
|
65
|
+
}
|
|
66
|
+
declare const CONNECTOR_REGISTRY: Record<ConnectorId, ConnectorMeta>;
|
|
67
|
+
interface PreferredToken {
|
|
68
|
+
chainId: ChainId;
|
|
69
|
+
address: string;
|
|
70
|
+
}
|
|
71
|
+
interface WalletInfoStyle extends CSSProperties {
|
|
72
|
+
"--wi-primary"?: string;
|
|
73
|
+
"--wi-secondary"?: string;
|
|
74
|
+
"--wi-surface-bg"?: string;
|
|
75
|
+
"--wi-surface-default"?: string;
|
|
76
|
+
"--wi-surface-subtle"?: string;
|
|
77
|
+
"--wi-border-default"?: string;
|
|
78
|
+
"--wi-border-subtle"?: string;
|
|
79
|
+
"--wi-texticon-primary"?: string;
|
|
80
|
+
"--wi-texticon-secondary"?: string;
|
|
81
|
+
"--wi-texticon-tertiary"?: string;
|
|
82
|
+
}
|
|
83
|
+
interface TokenBalance {
|
|
84
|
+
blockNumber: number;
|
|
85
|
+
name: string;
|
|
86
|
+
symbol: string;
|
|
87
|
+
chainId: number;
|
|
88
|
+
address: string;
|
|
89
|
+
quantity: {
|
|
90
|
+
decimals: number;
|
|
91
|
+
numeric: string;
|
|
92
|
+
};
|
|
93
|
+
icon_url: string;
|
|
94
|
+
}
|
|
95
|
+
interface TokenBalanceResponse {
|
|
96
|
+
code: number;
|
|
97
|
+
message: string;
|
|
98
|
+
data: TokenBalance[];
|
|
99
|
+
}
|
|
100
|
+
interface TokenStats {
|
|
101
|
+
chain_id: number;
|
|
102
|
+
address: string;
|
|
103
|
+
price: string;
|
|
104
|
+
percent_change_24h: string;
|
|
105
|
+
}
|
|
106
|
+
interface TokenStatsResponse {
|
|
107
|
+
code: number;
|
|
108
|
+
message: string;
|
|
109
|
+
data: TokenStats[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface WalletInfoTriggerProps {
|
|
113
|
+
asChild?: boolean;
|
|
114
|
+
className?: string;
|
|
115
|
+
children?: React.ReactNode;
|
|
116
|
+
}
|
|
117
|
+
declare function WalletInfoTrigger({ asChild, className, children, }: WalletInfoTriggerProps): react_jsx_runtime.JSX.Element;
|
|
118
|
+
|
|
119
|
+
interface WalletInfoContentProps {
|
|
120
|
+
align?: "start" | "center" | "end";
|
|
121
|
+
sideOffset?: number;
|
|
122
|
+
className?: string;
|
|
123
|
+
children?: React.ReactNode;
|
|
124
|
+
}
|
|
125
|
+
declare function WalletInfoContent({ align, sideOffset, className, children, }: WalletInfoContentProps): react_jsx_runtime.JSX.Element;
|
|
126
|
+
|
|
127
|
+
interface WalletInfoNavProps {
|
|
128
|
+
position?: "top" | "bottom";
|
|
129
|
+
children: React.ReactNode;
|
|
130
|
+
}
|
|
131
|
+
declare function WalletInfoNav({ position, children, }: WalletInfoNavProps): null;
|
|
132
|
+
|
|
133
|
+
interface WalletInfoFooterProps {
|
|
134
|
+
children: React.ReactNode;
|
|
135
|
+
}
|
|
136
|
+
declare function WalletInfoFooter({ children }: WalletInfoFooterProps): null;
|
|
137
|
+
|
|
138
|
+
interface WalletInfoProps {
|
|
139
|
+
env?: Environment;
|
|
140
|
+
theme?: Theme;
|
|
141
|
+
mobileBreakpoint?: number;
|
|
142
|
+
drawerDirection?: DrawerDirection$1;
|
|
143
|
+
modal?: boolean;
|
|
144
|
+
showBalance?: boolean;
|
|
145
|
+
showForgeToken?: boolean;
|
|
146
|
+
showGameToken?: boolean;
|
|
147
|
+
showQR?: boolean;
|
|
148
|
+
qrLogoSrc?: string;
|
|
149
|
+
walletAddress: string;
|
|
150
|
+
accountName?: string;
|
|
151
|
+
/** 헤더 좌측에 표시될 프로필 이미지 URL. 미지정 시 주소 기반 그라디언트 아바타가 자동 생성됨. */
|
|
152
|
+
profileImageUrl?: string;
|
|
153
|
+
/** Resolves connectorName & connectorIconUrl from CONNECTOR_REGISTRY */
|
|
154
|
+
connectorId?: ConnectorId;
|
|
155
|
+
connectorName?: string;
|
|
156
|
+
connectorIconUrl?: string;
|
|
157
|
+
preferredTokens?: PreferredToken[];
|
|
158
|
+
onSelectWallet?: () => void;
|
|
159
|
+
onCopyAddress?: (address: string, success: boolean) => void;
|
|
160
|
+
/** 지정 시 기본 Disconnect 버튼이 Footer에 노출됨. WalletInfo.Footer 슬롯이 우선. */
|
|
161
|
+
onDisconnect?: () => void;
|
|
162
|
+
/** 기본 Disconnect 버튼 라벨 (기본 "Disconnect"). */
|
|
163
|
+
disconnectLabel?: string;
|
|
164
|
+
/** Footer 하단 Terms 링크 URL. 지정 시에만 노출. */
|
|
165
|
+
termsUrl?: string;
|
|
166
|
+
/** Terms 링크 라벨 (기본 "Terms of Service"). */
|
|
167
|
+
termsLabel?: string;
|
|
168
|
+
/** Footer 하단 Privacy 링크 URL. 지정 시에만 노출. */
|
|
169
|
+
privacyUrl?: string;
|
|
170
|
+
/** Privacy 링크 라벨 (기본 "Privacy Policy"). */
|
|
171
|
+
privacyLabel?: string;
|
|
172
|
+
open?: boolean;
|
|
173
|
+
onOpenChange?: (open: boolean) => void;
|
|
174
|
+
/**
|
|
175
|
+
* Portfolio 뷰 사용 여부.
|
|
176
|
+
* true면 Total Assets 섹션이 클릭 가능해지며, 클릭 시 내부 Portfolio 뷰로 전환됩니다.
|
|
177
|
+
* (showBalance=true && showTotalAssets=true 일 때만 클릭 영역이 표시됩니다.)
|
|
178
|
+
*/
|
|
179
|
+
showPortfolio?: boolean;
|
|
180
|
+
/** Portfolio 뷰의 헤더 타이틀 (기본 "My Portfolio"). */
|
|
181
|
+
portfolioTitle?: string;
|
|
182
|
+
/** Total Assets 섹션 노출 여부 (기본 true). showBalance=true일 때만 실제 표기. */
|
|
183
|
+
showTotalAssets?: boolean;
|
|
184
|
+
/** Total Assets 라벨 텍스트 (기본 "Total Assets USD"). */
|
|
185
|
+
totalAssetsLabel?: string;
|
|
186
|
+
style?: WalletInfoStyle;
|
|
187
|
+
children: React.ReactNode;
|
|
188
|
+
}
|
|
189
|
+
declare function WalletInfoRoot({ env, theme, mobileBreakpoint, drawerDirection, modal, showBalance, showForgeToken, showGameToken, showQR, qrLogoSrc, walletAddress, accountName, profileImageUrl, connectorId, connectorName: connectorNameProp, connectorIconUrl: connectorIconUrlProp, preferredTokens, onSelectWallet, onCopyAddress, onDisconnect, disconnectLabel, termsUrl, termsLabel, privacyUrl, privacyLabel, open: propOpen, onOpenChange, showPortfolio, portfolioTitle, showTotalAssets, totalAssetsLabel, style, children, }: WalletInfoProps): react_jsx_runtime.JSX.Element;
|
|
190
|
+
declare const WalletInfo: typeof WalletInfoRoot & {
|
|
191
|
+
Trigger: typeof WalletInfoTrigger;
|
|
192
|
+
Content: typeof WalletInfoContent;
|
|
193
|
+
Nav: typeof WalletInfoNav;
|
|
194
|
+
Footer: typeof WalletInfoFooter;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
declare const USER_BALANCE_QUERY_KEY = "user-balance";
|
|
198
|
+
declare function useTokenBalance(env: Environment, walletAddress: string, active?: boolean): {
|
|
199
|
+
tokens: TokenBalance[];
|
|
200
|
+
isLoading: boolean;
|
|
201
|
+
isError: boolean;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
declare const TOKEN_STATS_QUERY_KEY = "token-stats";
|
|
205
|
+
declare function useTokenStats(env: Environment, enabled?: boolean): {
|
|
206
|
+
error: Error;
|
|
207
|
+
isError: true;
|
|
208
|
+
isPending: false;
|
|
209
|
+
isLoading: false;
|
|
210
|
+
isLoadingError: false;
|
|
211
|
+
isRefetchError: true;
|
|
212
|
+
isSuccess: false;
|
|
213
|
+
isPlaceholderData: false;
|
|
214
|
+
status: "error";
|
|
215
|
+
dataUpdatedAt: number;
|
|
216
|
+
errorUpdatedAt: number;
|
|
217
|
+
failureCount: number;
|
|
218
|
+
failureReason: Error | null;
|
|
219
|
+
errorUpdateCount: number;
|
|
220
|
+
isFetched: boolean;
|
|
221
|
+
isFetchedAfterMount: boolean;
|
|
222
|
+
isFetching: boolean;
|
|
223
|
+
isInitialLoading: boolean;
|
|
224
|
+
isPaused: boolean;
|
|
225
|
+
isRefetching: boolean;
|
|
226
|
+
isStale: boolean;
|
|
227
|
+
isEnabled: boolean;
|
|
228
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TokenStatsResponse, Error>>;
|
|
229
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
230
|
+
promise: Promise<TokenStatsResponse>;
|
|
231
|
+
statsMap: Map<string, TokenStats>;
|
|
232
|
+
} | {
|
|
233
|
+
error: null;
|
|
234
|
+
isError: false;
|
|
235
|
+
isPending: false;
|
|
236
|
+
isLoading: false;
|
|
237
|
+
isLoadingError: false;
|
|
238
|
+
isRefetchError: false;
|
|
239
|
+
isSuccess: true;
|
|
240
|
+
isPlaceholderData: false;
|
|
241
|
+
status: "success";
|
|
242
|
+
dataUpdatedAt: number;
|
|
243
|
+
errorUpdatedAt: number;
|
|
244
|
+
failureCount: number;
|
|
245
|
+
failureReason: Error | null;
|
|
246
|
+
errorUpdateCount: number;
|
|
247
|
+
isFetched: boolean;
|
|
248
|
+
isFetchedAfterMount: boolean;
|
|
249
|
+
isFetching: boolean;
|
|
250
|
+
isInitialLoading: boolean;
|
|
251
|
+
isPaused: boolean;
|
|
252
|
+
isRefetching: boolean;
|
|
253
|
+
isStale: boolean;
|
|
254
|
+
isEnabled: boolean;
|
|
255
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TokenStatsResponse, Error>>;
|
|
256
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
257
|
+
promise: Promise<TokenStatsResponse>;
|
|
258
|
+
statsMap: Map<string, TokenStats>;
|
|
259
|
+
} | {
|
|
260
|
+
error: Error;
|
|
261
|
+
isError: true;
|
|
262
|
+
isPending: false;
|
|
263
|
+
isLoading: false;
|
|
264
|
+
isLoadingError: true;
|
|
265
|
+
isRefetchError: false;
|
|
266
|
+
isSuccess: false;
|
|
267
|
+
isPlaceholderData: false;
|
|
268
|
+
status: "error";
|
|
269
|
+
dataUpdatedAt: number;
|
|
270
|
+
errorUpdatedAt: number;
|
|
271
|
+
failureCount: number;
|
|
272
|
+
failureReason: Error | null;
|
|
273
|
+
errorUpdateCount: number;
|
|
274
|
+
isFetched: boolean;
|
|
275
|
+
isFetchedAfterMount: boolean;
|
|
276
|
+
isFetching: boolean;
|
|
277
|
+
isInitialLoading: boolean;
|
|
278
|
+
isPaused: boolean;
|
|
279
|
+
isRefetching: boolean;
|
|
280
|
+
isStale: boolean;
|
|
281
|
+
isEnabled: boolean;
|
|
282
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TokenStatsResponse, Error>>;
|
|
283
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
284
|
+
promise: Promise<TokenStatsResponse>;
|
|
285
|
+
statsMap: Map<string, TokenStats>;
|
|
286
|
+
} | {
|
|
287
|
+
error: null;
|
|
288
|
+
isError: false;
|
|
289
|
+
isPending: true;
|
|
290
|
+
isLoading: true;
|
|
291
|
+
isLoadingError: false;
|
|
292
|
+
isRefetchError: false;
|
|
293
|
+
isSuccess: false;
|
|
294
|
+
isPlaceholderData: false;
|
|
295
|
+
status: "pending";
|
|
296
|
+
dataUpdatedAt: number;
|
|
297
|
+
errorUpdatedAt: number;
|
|
298
|
+
failureCount: number;
|
|
299
|
+
failureReason: Error | null;
|
|
300
|
+
errorUpdateCount: number;
|
|
301
|
+
isFetched: boolean;
|
|
302
|
+
isFetchedAfterMount: boolean;
|
|
303
|
+
isFetching: boolean;
|
|
304
|
+
isInitialLoading: boolean;
|
|
305
|
+
isPaused: boolean;
|
|
306
|
+
isRefetching: boolean;
|
|
307
|
+
isStale: boolean;
|
|
308
|
+
isEnabled: boolean;
|
|
309
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TokenStatsResponse, Error>>;
|
|
310
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
311
|
+
promise: Promise<TokenStatsResponse>;
|
|
312
|
+
statsMap: Map<string, TokenStats>;
|
|
313
|
+
} | {
|
|
314
|
+
error: null;
|
|
315
|
+
isError: false;
|
|
316
|
+
isPending: true;
|
|
317
|
+
isLoadingError: false;
|
|
318
|
+
isRefetchError: false;
|
|
319
|
+
isSuccess: false;
|
|
320
|
+
isPlaceholderData: false;
|
|
321
|
+
status: "pending";
|
|
322
|
+
dataUpdatedAt: number;
|
|
323
|
+
errorUpdatedAt: number;
|
|
324
|
+
failureCount: number;
|
|
325
|
+
failureReason: Error | null;
|
|
326
|
+
errorUpdateCount: number;
|
|
327
|
+
isFetched: boolean;
|
|
328
|
+
isFetchedAfterMount: boolean;
|
|
329
|
+
isFetching: boolean;
|
|
330
|
+
isLoading: boolean;
|
|
331
|
+
isInitialLoading: boolean;
|
|
332
|
+
isPaused: boolean;
|
|
333
|
+
isRefetching: boolean;
|
|
334
|
+
isStale: boolean;
|
|
335
|
+
isEnabled: boolean;
|
|
336
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TokenStatsResponse, Error>>;
|
|
337
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
338
|
+
promise: Promise<TokenStatsResponse>;
|
|
339
|
+
statsMap: Map<string, TokenStats>;
|
|
340
|
+
} | {
|
|
341
|
+
isError: false;
|
|
342
|
+
error: null;
|
|
343
|
+
isPending: false;
|
|
344
|
+
isLoading: false;
|
|
345
|
+
isLoadingError: false;
|
|
346
|
+
isRefetchError: false;
|
|
347
|
+
isSuccess: true;
|
|
348
|
+
isPlaceholderData: true;
|
|
349
|
+
status: "success";
|
|
350
|
+
dataUpdatedAt: number;
|
|
351
|
+
errorUpdatedAt: number;
|
|
352
|
+
failureCount: number;
|
|
353
|
+
failureReason: Error | null;
|
|
354
|
+
errorUpdateCount: number;
|
|
355
|
+
isFetched: boolean;
|
|
356
|
+
isFetchedAfterMount: boolean;
|
|
357
|
+
isFetching: boolean;
|
|
358
|
+
isInitialLoading: boolean;
|
|
359
|
+
isPaused: boolean;
|
|
360
|
+
isRefetching: boolean;
|
|
361
|
+
isStale: boolean;
|
|
362
|
+
isEnabled: boolean;
|
|
363
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TokenStatsResponse, Error>>;
|
|
364
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
365
|
+
promise: Promise<TokenStatsResponse>;
|
|
366
|
+
statsMap: Map<string, TokenStats>;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
interface WalletPortfolioTriggerProps {
|
|
370
|
+
asChild?: boolean;
|
|
371
|
+
children?: React.ReactNode;
|
|
372
|
+
}
|
|
373
|
+
declare function WalletPortfolioTrigger({ asChild, children, }: WalletPortfolioTriggerProps): react_jsx_runtime.JSX.Element;
|
|
374
|
+
|
|
375
|
+
interface WalletPortfolioContentProps {
|
|
376
|
+
className?: string;
|
|
377
|
+
}
|
|
378
|
+
declare function WalletPortfolioContent({ className, }: WalletPortfolioContentProps): react_jsx_runtime.JSX.Element;
|
|
379
|
+
|
|
380
|
+
interface WalletPortfolioProps {
|
|
381
|
+
env?: Environment;
|
|
382
|
+
theme?: Theme;
|
|
383
|
+
walletAddress: string;
|
|
384
|
+
open?: boolean;
|
|
385
|
+
onOpenChange?: (open: boolean) => void;
|
|
386
|
+
children: React.ReactNode;
|
|
387
|
+
}
|
|
388
|
+
declare function WalletPortfolioRoot({ env, theme, walletAddress, open: propOpen, onOpenChange, children, }: WalletPortfolioProps): react_jsx_runtime.JSX.Element;
|
|
389
|
+
declare const WalletPortfolio: typeof WalletPortfolioRoot & {
|
|
390
|
+
Trigger: typeof WalletPortfolioTrigger;
|
|
391
|
+
Content: typeof WalletPortfolioContent;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
interface WalletPortfolioBodyProps {
|
|
395
|
+
env?: Environment;
|
|
396
|
+
theme?: Theme;
|
|
397
|
+
walletAddress: string;
|
|
398
|
+
/** 왼쪽 상단 back 버튼 클릭 핸들러. 없으면 back 버튼 숨김. */
|
|
399
|
+
onBack?: () => void;
|
|
400
|
+
/** 헤더 노출 여부. embed 시 외부 헤더를 쓰면 false로 숨길 수 있음. */
|
|
401
|
+
showHeader?: boolean;
|
|
402
|
+
/**
|
|
403
|
+
* 컨테이너 variant.
|
|
404
|
+
* - `"embed"`(기본): 부모 영역을 채우도록 `.wp-embed` 래퍼로 감쌈
|
|
405
|
+
* - `"fullscreen"`: 고정 풀스크린 `.wp-fullscreen` 래퍼로 감쌈
|
|
406
|
+
* - `"none"`: 래퍼 div 없이 본문만 반환 (Drawer.Content 등 외부 래퍼에 클래스를 직접 줄 때)
|
|
407
|
+
*/
|
|
408
|
+
variant?: "fullscreen" | "embed" | "none";
|
|
409
|
+
className?: string;
|
|
410
|
+
}
|
|
411
|
+
declare function WalletPortfolioBody({ env, theme, walletAddress, onBack, showHeader, variant, className, }: WalletPortfolioBodyProps): react_jsx_runtime.JSX.Element;
|
|
412
|
+
|
|
413
|
+
declare function CROSSxIcon(): react_jsx_runtime.JSX.Element;
|
|
414
|
+
declare function MetaMaskIcon(): react_jsx_runtime.JSX.Element;
|
|
415
|
+
declare function Verse8Icon(): react_jsx_runtime.JSX.Element;
|
|
416
|
+
declare function TronIcon(): react_jsx_runtime.JSX.Element;
|
|
417
|
+
|
|
418
|
+
declare const WALLET_REGISTRY: {
|
|
419
|
+
cross_embedded: {
|
|
420
|
+
id: string;
|
|
421
|
+
name: string;
|
|
422
|
+
description: string;
|
|
423
|
+
icon: typeof CROSSxIcon;
|
|
424
|
+
featured: true;
|
|
425
|
+
};
|
|
426
|
+
cross_wallet: {
|
|
427
|
+
id: string;
|
|
428
|
+
name: string;
|
|
429
|
+
description: string;
|
|
430
|
+
icon: typeof CROSSxIcon;
|
|
431
|
+
};
|
|
432
|
+
cross_extension: {
|
|
433
|
+
id: string;
|
|
434
|
+
name: string;
|
|
435
|
+
description: string;
|
|
436
|
+
icon: typeof CROSSxIcon;
|
|
437
|
+
rdns: string;
|
|
438
|
+
installUrl: string;
|
|
439
|
+
visibility: "desktop-only";
|
|
440
|
+
};
|
|
441
|
+
metamask: {
|
|
442
|
+
id: string;
|
|
443
|
+
name: string;
|
|
444
|
+
description: string;
|
|
445
|
+
icon: typeof MetaMaskIcon;
|
|
446
|
+
rdns: string;
|
|
447
|
+
};
|
|
448
|
+
verse8: {
|
|
449
|
+
id: string;
|
|
450
|
+
name: string;
|
|
451
|
+
description: string;
|
|
452
|
+
icon: typeof Verse8Icon;
|
|
453
|
+
badge: string;
|
|
454
|
+
};
|
|
455
|
+
tron: {
|
|
456
|
+
id: string;
|
|
457
|
+
name: string;
|
|
458
|
+
description: string;
|
|
459
|
+
icon: typeof TronIcon;
|
|
460
|
+
badge: string;
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
type WalletId = keyof typeof WALLET_REGISTRY;
|
|
464
|
+
|
|
465
|
+
interface WalletConnectModalStyle extends CSSProperties {
|
|
466
|
+
"--wcm-primary"?: string;
|
|
467
|
+
"--wcm-secondary"?: string;
|
|
468
|
+
"--wcm-surface-bg"?: string;
|
|
469
|
+
"--wcm-surface-default"?: string;
|
|
470
|
+
"--wcm-surface-subtle"?: string;
|
|
471
|
+
"--wcm-border-default"?: string;
|
|
472
|
+
"--wcm-border-subtle"?: string;
|
|
473
|
+
"--wcm-texticon-primary"?: string;
|
|
474
|
+
"--wcm-texticon-secondary"?: string;
|
|
475
|
+
"--wcm-texticon-tertiary"?: string;
|
|
476
|
+
"--wcm-dialog-width"?: string;
|
|
477
|
+
"--wcm-drawer-max-width"?: string;
|
|
478
|
+
"--wcm-drawer-min-width"?: string;
|
|
479
|
+
}
|
|
480
|
+
type WalletVisibility = "always" | "mobile-only" | "desktop-only";
|
|
481
|
+
interface WalletConfig {
|
|
482
|
+
id: string;
|
|
483
|
+
name: string;
|
|
484
|
+
description: string;
|
|
485
|
+
icon: () => ReactNode;
|
|
486
|
+
rdns?: string;
|
|
487
|
+
featured?: boolean;
|
|
488
|
+
badge?: string;
|
|
489
|
+
installUrl?: string;
|
|
490
|
+
visibility?: WalletVisibility;
|
|
491
|
+
}
|
|
492
|
+
type WalletHandlers = Partial<Record<WalletId, () => void | Promise<void>>>;
|
|
493
|
+
type DrawerDirection = "bottom" | "left" | "right" | "top";
|
|
494
|
+
interface WalletConnectModalProps {
|
|
495
|
+
wallets: WalletHandlers;
|
|
496
|
+
theme?: "dark" | "light";
|
|
497
|
+
mobileBreakpoint?: number;
|
|
498
|
+
drawerDirection?: DrawerDirection;
|
|
499
|
+
dialogWidth?: string;
|
|
500
|
+
drawerMaxWidth?: string;
|
|
501
|
+
drawerMinWidth?: string;
|
|
502
|
+
style?: WalletConnectModalStyle;
|
|
503
|
+
open?: boolean;
|
|
504
|
+
onOpenChange?: (open: boolean) => void;
|
|
505
|
+
children: ReactNode;
|
|
506
|
+
}
|
|
507
|
+
interface WalletConnectModalTriggerProps {
|
|
508
|
+
asChild?: boolean;
|
|
509
|
+
children?: ReactNode;
|
|
510
|
+
}
|
|
511
|
+
interface WalletConnectModalContentProps {
|
|
512
|
+
className?: string;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
declare function WalletConnectModalTrigger({ asChild, children, }: WalletConnectModalTriggerProps): react_jsx_runtime.JSX.Element;
|
|
516
|
+
|
|
517
|
+
declare function WalletConnectModalContent({ className, }: WalletConnectModalContentProps): react_jsx_runtime.JSX.Element;
|
|
518
|
+
|
|
519
|
+
declare function WalletConnectModalRoot({ wallets, theme, mobileBreakpoint, drawerDirection, dialogWidth, drawerMaxWidth, drawerMinWidth, style, open: openProp, onOpenChange, children, }: WalletConnectModalProps): react_jsx_runtime.JSX.Element;
|
|
520
|
+
declare const WalletConnectModal: typeof WalletConnectModalRoot & {
|
|
521
|
+
Trigger: typeof WalletConnectModalTrigger;
|
|
522
|
+
Content: typeof WalletConnectModalContent;
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
interface DetectedWallet {
|
|
526
|
+
rdns: string;
|
|
527
|
+
name: string;
|
|
528
|
+
icon?: string;
|
|
529
|
+
}
|
|
530
|
+
interface WalletDetectResult {
|
|
531
|
+
wallets: DetectedWallet[];
|
|
532
|
+
isDetected: (rdns: string) => boolean;
|
|
533
|
+
isLoading: boolean;
|
|
534
|
+
}
|
|
535
|
+
declare function useWalletDetect(): WalletDetectResult;
|
|
536
|
+
|
|
537
|
+
export { AppLauncher, AppLauncherContent, type AppLauncherContentProps, type AppLauncherProps, AppLauncherTrigger, type AppLauncherTriggerProps, CONNECTOR_REGISTRY, type ChainId, ConnectorId, type ConnectorMeta, type DrawerDirection$1 as DrawerDirection, type Environment, type GlobalMenu, type GlobalMenuItem, type GlobalMenuItemUrl, type PreferredToken, TOKEN_STATS_QUERY_KEY, type Theme, type TokenBalance, type TokenBalanceResponse, type TokenStats, type TokenStatsResponse, USER_BALANCE_QUERY_KEY, WALLET_REGISTRY, type WalletConfig, WalletConnectModal, type WalletConnectModalContentProps, type WalletConnectModalProps, type WalletConnectModalStyle, type WalletConnectModalTriggerProps, type WalletHandlers, type WalletId, WalletInfo, type WalletInfoContentProps, type WalletInfoFooterProps, type WalletInfoNavProps, type WalletInfoProps, type WalletInfoStyle, type WalletInfoTriggerProps, WalletPortfolio, WalletPortfolioBody, type WalletPortfolioBodyProps, type WalletPortfolioContentProps, type WalletPortfolioProps, type WalletPortfolioTriggerProps, useGlobalMenu, useTokenBalance, useTokenStats, useWalletDetect };
|