@naculus/connect-appkit-ui 0.1.9 → 0.2.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.
@@ -0,0 +1,696 @@
1
+ import React from 'react';
2
+ import { WalletNamespace, EmbeddedWalletAccountView, StorageSecurityReport, PassphraseRequest, Web3ConnectConfig } from '@naculus/connect-appkit-react';
3
+ import { ClassValue } from 'clsx';
4
+ import { SiwxResult } from '@naculus/siwx';
5
+
6
+ interface ConnectButtonProps {
7
+ className?: string;
8
+ isConnected?: boolean;
9
+ isConnecting?: boolean;
10
+ onConnect?: (walletKind: "injected" | "walletconnect", closeModal: () => void, walletId?: string) => void | Promise<void>;
11
+ onDisconnect?: () => void;
12
+ onMobileDeepLink?: () => void;
13
+ mobileWalletName?: string;
14
+ startPairing?: () => Promise<string>;
15
+ completePairing?: () => Promise<any>;
16
+ address?: string;
17
+ balance?: string | null;
18
+ balanceSymbol?: string;
19
+ tokenBalances?: Array<{
20
+ symbol: string;
21
+ formatted: string | null;
22
+ name?: string;
23
+ }>;
24
+ isBalanceLoading?: boolean;
25
+ explorerUrl?: string;
26
+ explorerLabel?: string;
27
+ }
28
+ /**
29
+ * React adapter that bridges hook ecosystem to the Stencil WC.
30
+ */
31
+ declare function ConnectButtonAdapter({ className, isConnected: extConnected, isConnecting: extConnecting, onConnect, onDisconnect, onMobileDeepLink, mobileWalletName, startPairing, completePairing, address, balance, balanceSymbol, tokenBalances, isBalanceLoading, explorerUrl, explorerLabel, }: ConnectButtonProps): React.JSX.Element;
32
+
33
+ interface ChainSelectorProps {
34
+ className?: string;
35
+ showLabel?: boolean;
36
+ variant?: "dropdown" | "buttons" | "minimal";
37
+ }
38
+ declare function ChainSelector({ className, showLabel, variant }: ChainSelectorProps): React.JSX.Element | null;
39
+
40
+ interface AccountButtonProps {
41
+ className?: string;
42
+ showAddress?: boolean;
43
+ showBalance?: boolean;
44
+ address?: string;
45
+ balance?: string | null;
46
+ balanceSymbol?: string;
47
+ onConnect?: () => void;
48
+ }
49
+ declare function AccountButton({ className, showAddress, showBalance, address: externalAddress, balance: externalBalance, balanceSymbol, onConnect, }: AccountButtonProps): React.JSX.Element;
50
+
51
+ interface AccountSelectorProps {
52
+ className?: string;
53
+ /** Hide the "derive missing accounts" affordance. */
54
+ hideBackfill?: boolean;
55
+ onSelect?: (namespace: WalletNamespace) => void;
56
+ }
57
+ /**
58
+ * Lists the accounts an embedded wallet holds and lets the user choose which
59
+ * one signs.
60
+ *
61
+ * Renders nothing when there is no embedded wallet, rather than an empty
62
+ * panel: a consumer can mount this unconditionally.
63
+ */
64
+ interface AccountSelectorViewProps extends AccountSelectorProps {
65
+ accounts: EmbeddedWalletAccountView[];
66
+ activeNamespace: WalletNamespace | null;
67
+ /** Whether a stored phrase could derive an account not listed above. */
68
+ canDerive: boolean;
69
+ setActiveNamespace: (namespace: WalletNamespace) => void;
70
+ backfillAccounts: () => Promise<unknown>;
71
+ }
72
+ /**
73
+ * The presentation, separated from where the accounts come from.
74
+ *
75
+ * Exported because Storybook and a consumer with its own account source are
76
+ * both real second callers; a raw-key wallet and a phrase wallet differ only
77
+ * in `canDerive`, and that state is otherwise reachable only by importing an
78
+ * actual key.
79
+ */
80
+ declare function AccountSelectorView({ className, hideBackfill, onSelect, accounts, activeNamespace, canDerive, setActiveNamespace, backfillAccounts, }: AccountSelectorViewProps): React.JSX.Element | null;
81
+ /**
82
+ * Lists the embedded wallet's accounts and lets the user choose which signs.
83
+ *
84
+ * Renders nothing when there is no embedded wallet, so a consumer can mount
85
+ * this unconditionally.
86
+ */
87
+ declare function AccountSelector(props: AccountSelectorProps): React.JSX.Element | null;
88
+
89
+ interface WalletSecurityPanelProps {
90
+ className?: string;
91
+ /** Hide findings that cost no points. Off by default — the hot-wallet
92
+ * exposure is one of them, and it is the one users most need to read. */
93
+ hideInformational?: boolean;
94
+ }
95
+ /**
96
+ * Shows how the embedded wallet is stored, as a score with the specific
97
+ * reasons it is not higher.
98
+ *
99
+ * A tier from 1 to 4 tells a user where they stand and nothing about why or
100
+ * what to do about it. Every point this panel removes is attached to the
101
+ * sentence that explains it.
102
+ *
103
+ * Renders nothing when no embedded wallet exists — the storage backend is
104
+ * chosen when the wallet is created, so there is nothing to assess before
105
+ * then, and a warning about a wallet that does not exist is noise.
106
+ */
107
+ interface WalletSecurityPanelViewProps extends WalletSecurityPanelProps {
108
+ report: StorageSecurityReport | null;
109
+ }
110
+ /**
111
+ * The presentation, separated from where the report comes from.
112
+ *
113
+ * Exported because Storybook and any consumer holding its own report are both
114
+ * real second callers, and because every visual state here is otherwise only
115
+ * reachable by arranging a wallet on disk to be in that state.
116
+ */
117
+ declare function WalletSecurityPanelView({ className, hideInformational, report: securityReport, }: WalletSecurityPanelViewProps): React.JSX.Element | null;
118
+ /** Reads the report from the embedded wallet and renders it. */
119
+ declare function WalletSecurityPanel(props: WalletSecurityPanelProps): React.JSX.Element;
120
+
121
+ interface PassphraseDialogProps {
122
+ className?: string;
123
+ }
124
+ /**
125
+ * Asks for the passphrase that encrypts the embedded wallet on this device.
126
+ *
127
+ * Renders only while something is actually blocked on the answer — a load or
128
+ * a save inside the storage adapter — and nothing at all when the app supplies
129
+ * its own `encryptionPassphrase` or has encryption off.
130
+ */
131
+ interface PassphraseDialogViewProps extends PassphraseDialogProps {
132
+ request: PassphraseRequest | null;
133
+ submit: (passphrase: string) => void;
134
+ cancel: () => void;
135
+ }
136
+ /**
137
+ * The presentation, separated from the gate that drives it.
138
+ *
139
+ * Exported because reaching the retry and create states otherwise means
140
+ * arranging an actual failed decrypt.
141
+ */
142
+ declare function PassphraseDialogView({ className, request, submit, cancel, }: PassphraseDialogViewProps): React.JSX.Element | null;
143
+ /**
144
+ * Asks for the passphrase that encrypts the embedded wallet on this device.
145
+ *
146
+ * Renders only while a load or save inside the storage adapter is actually
147
+ * blocked on the answer, and nothing at all when the app supplies its own
148
+ * `encryptionPassphrase` or has encryption off.
149
+ */
150
+ declare function PassphraseDialog(props: PassphraseDialogProps): React.JSX.Element;
151
+
152
+ interface PasskeySetupProps {
153
+ className?: string;
154
+ }
155
+ /**
156
+ * Registers a passkey and puts the wallet's stored record under it.
157
+ *
158
+ * Two facts drive the whole of this component:
159
+ *
160
+ * PRF cannot be added to a credential after creation. A passkey registered
161
+ * without it can never unlock anything, and the only route forward is
162
+ * registering a new one — so the result of the attempt has to be reported
163
+ * honestly rather than as a generic success.
164
+ *
165
+ * A passkey protects the local copy, not the wallet. The recovery phrase is
166
+ * still the only backup that survives losing the device, and that has to be
167
+ * said here, at the moment someone turns this on, rather than in a document
168
+ * they will not read.
169
+ */
170
+ interface PasskeySetupViewProps extends PasskeySetupProps {
171
+ /** Null when passkeys are not enabled on the client. */
172
+ passkeys: {
173
+ hasCredential?: () => boolean;
174
+ createPasskey: () => Promise<unknown>;
175
+ } | null;
176
+ unlock: UnlockSnapshot | undefined;
177
+ onRegistered?: () => Promise<void> | void;
178
+ }
179
+ /**
180
+ * What the unlock layer reports, which is what decides the copy shown.
181
+ *
182
+ * `prf` being absent is a different fact from it being `"unavailable"`, and
183
+ * the component must not collapse them.
184
+ */
185
+ interface UnlockSnapshot {
186
+ prf?: "unknown" | "available" | "unavailable" | "none";
187
+ sealedWith?: string[] | null;
188
+ }
189
+ /**
190
+ * The presentation, separated from the client and wallet it reads.
191
+ *
192
+ * Exported because every state here — registered but unusable, registered but
193
+ * unsealed, not yet checked — otherwise needs a real authenticator behaving a
194
+ * particular way.
195
+ */
196
+ declare function PasskeySetupView({ className, passkeys, unlock, onRegistered, }: PasskeySetupViewProps): React.JSX.Element | null;
197
+ /**
198
+ * Registers a passkey for the embedded wallet and re-seals its stored record.
199
+ */
200
+ declare function PasskeySetup(props: PasskeySetupProps): React.JSX.Element;
201
+
202
+ /**
203
+ * Hook that detects if the user is on a mobile device.
204
+ * Returns true for iOS (iPhone, iPad, iPod) and Android devices.
205
+ */
206
+ declare function useIsMobile(): boolean;
207
+
208
+ interface DiscoveredWallet {
209
+ id: string;
210
+ name: string;
211
+ icon?: string;
212
+ rdns: string;
213
+ provider?: unknown;
214
+ }
215
+ interface UseEIP6963Result {
216
+ wallets: DiscoveredWallet[];
217
+ isDetecting: boolean;
218
+ hasWallets: boolean;
219
+ }
220
+ /**
221
+ * Hook to discover EIP-6963 wallets (browser extensions like MetaMask, Phantom, etc.)
222
+ * Uses the eip6963:announceProvider / requestProvider protocol.
223
+ */
224
+ declare function useEIP6963(): UseEIP6963Result;
225
+
226
+ declare function cn(...inputs: ClassValue[]): string;
227
+
228
+ interface ComponentRegistry {
229
+ Button?: React.ComponentType<any>;
230
+ Card?: React.ComponentType<any>;
231
+ Badge?: React.ComponentType<any>;
232
+ Switch?: React.ComponentType<any>;
233
+ Checkbox?: React.ComponentType<any>;
234
+ Tabs?: React.ComponentType<any>;
235
+ TabsContent?: React.ComponentType<any>;
236
+ TabsList?: React.ComponentType<any>;
237
+ TabsTrigger?: React.ComponentType<any>;
238
+ DropdownMenu?: React.ComponentType<any>;
239
+ Avatar?: React.ComponentType<any>;
240
+ Skeleton?: React.ComponentType<any>;
241
+ Tooltip?: React.ComponentType<any>;
242
+ Popover?: React.ComponentType<any>;
243
+ Progress?: React.ComponentType<any>;
244
+ Separator?: React.ComponentType<any>;
245
+ ScrollArea?: React.ComponentType<any>;
246
+ Input?: React.ComponentType<any>;
247
+ Select?: React.ComponentType<any>;
248
+ Label?: React.ComponentType<any>;
249
+ Sheet?: React.ComponentType<any>;
250
+ Modal?: React.ComponentType<any>;
251
+ Dialog?: React.ComponentType<any>;
252
+ DialogContent?: React.ComponentType<any>;
253
+ DialogHeader?: React.ComponentType<any>;
254
+ DialogTitle?: React.ComponentType<any>;
255
+ ConnectButton?: React.ComponentType<any>;
256
+ AccountButton?: React.ComponentType<any>;
257
+ ChainSelector?: React.ComponentType<any>;
258
+ QRCodeModal?: React.ComponentType<any>;
259
+ SignInButton?: React.ComponentType<any>;
260
+ SeedPhraseBackup?: React.ComponentType<any>;
261
+ ErrorBoundary?: React.ComponentType<any>;
262
+ AppKit?: React.ComponentType<any>;
263
+ AppKitButton?: React.ComponentType<any>;
264
+ AppKitChainSelector?: React.ComponentType<any>;
265
+ Web3ConnectUI?: React.ComponentType<any>;
266
+ }
267
+ interface Web3ComponentProviderProps {
268
+ children: React.ReactNode;
269
+ components?: ComponentRegistry;
270
+ }
271
+ declare function Web3ComponentProvider({ children, components, }: Web3ComponentProviderProps): React.JSX.Element;
272
+ declare function useComponentRegistry(): ComponentRegistry;
273
+ declare function useComponent<K extends keyof ComponentRegistry>(name: K): ComponentRegistry[K] | undefined;
274
+
275
+ declare const THEME_CONTRACT: {
276
+ readonly primary: {
277
+ readonly name: "--primary";
278
+ readonly fallback: "221.2 83.2% 53.3%";
279
+ };
280
+ readonly 'primary-foreground': {
281
+ readonly name: "--primary-foreground";
282
+ readonly fallback: "210 40% 98%";
283
+ };
284
+ readonly background: {
285
+ readonly name: "--background";
286
+ readonly fallback: "0 0% 100%";
287
+ };
288
+ readonly foreground: {
289
+ readonly name: "--foreground";
290
+ readonly fallback: "222.2 84% 4.9%";
291
+ };
292
+ readonly card: {
293
+ readonly name: "--card";
294
+ readonly fallback: "0 0% 100%";
295
+ };
296
+ readonly 'card-foreground': {
297
+ readonly name: "--card-foreground";
298
+ readonly fallback: "222.2 84% 4.9%";
299
+ };
300
+ readonly popover: {
301
+ readonly name: "--popover";
302
+ readonly fallback: "0 0% 100%";
303
+ };
304
+ readonly 'popover-foreground': {
305
+ readonly name: "--popover-foreground";
306
+ readonly fallback: "222.2 84% 4.9%";
307
+ };
308
+ readonly secondary: {
309
+ readonly name: "--secondary";
310
+ readonly fallback: "210 40% 96.1%";
311
+ };
312
+ readonly 'secondary-foreground': {
313
+ readonly name: "--secondary-foreground";
314
+ readonly fallback: "222.2 47.4% 11.2%";
315
+ };
316
+ readonly muted: {
317
+ readonly name: "--muted";
318
+ readonly fallback: "210 40% 96.1%";
319
+ };
320
+ readonly 'muted-foreground': {
321
+ readonly name: "--muted-foreground";
322
+ readonly fallback: "215.4 16.3% 46.9%";
323
+ };
324
+ readonly accent: {
325
+ readonly name: "--accent";
326
+ readonly fallback: "210 40% 96.1%";
327
+ };
328
+ readonly 'accent-foreground': {
329
+ readonly name: "--accent-foreground";
330
+ readonly fallback: "222.2 47.4% 11.2%";
331
+ };
332
+ readonly destructive: {
333
+ readonly name: "--destructive";
334
+ readonly fallback: "0 84.2% 60.2%";
335
+ };
336
+ readonly border: {
337
+ readonly name: "--border";
338
+ readonly fallback: "214.3 31.8% 91.4%";
339
+ };
340
+ readonly input: {
341
+ readonly name: "--input";
342
+ readonly fallback: "214.3 31.8% 91.4%";
343
+ };
344
+ readonly ring: {
345
+ readonly name: "--ring";
346
+ readonly fallback: "221.2 83.2% 53.3%";
347
+ };
348
+ readonly radius: {
349
+ readonly name: "--radius";
350
+ readonly fallback: "0.5rem";
351
+ };
352
+ };
353
+ type ThemeVariableName = keyof typeof THEME_CONTRACT;
354
+
355
+ interface ThemeOverride {
356
+ primary?: string;
357
+ 'primary-foreground'?: string;
358
+ background?: string;
359
+ foreground?: string;
360
+ card?: string;
361
+ 'card-foreground'?: string;
362
+ popover?: string;
363
+ 'popover-foreground'?: string;
364
+ secondary?: string;
365
+ 'secondary-foreground'?: string;
366
+ muted?: string;
367
+ 'muted-foreground'?: string;
368
+ accent?: string;
369
+ 'accent-foreground'?: string;
370
+ destructive?: string;
371
+ 'destructive-foreground'?: string;
372
+ border?: string;
373
+ input?: string;
374
+ ring?: string;
375
+ radius?: string;
376
+ }
377
+ type ThemePriority = 'computed' | 'fallback';
378
+ interface ThemeContextValue {
379
+ theme: ThemeOverride;
380
+ isDark: boolean;
381
+ setTheme: (theme: ThemeOverride) => void;
382
+ toggleDarkMode: () => void;
383
+ }
384
+ interface ThemeProviderProps {
385
+ children: React.ReactNode;
386
+ theme?: ThemeOverride;
387
+ defaultDark?: boolean;
388
+ priority?: ThemePriority;
389
+ }
390
+ declare function ThemeProvider({ children, theme, defaultDark, priority, }: ThemeProviderProps): React.JSX.Element;
391
+ declare function useTheme(): ThemeContextValue;
392
+ declare function useThemeVariable(name: ThemeVariableName): string;
393
+
394
+ type QRStatus = "idle" | "loading" | "ready" | "error" | "cancelled";
395
+ interface WalletConnectState {
396
+ qrUri: string | null;
397
+ showQR: boolean;
398
+ qrStatus: QRStatus;
399
+ error: string | null;
400
+ }
401
+ interface WalletConnectContextValue {
402
+ state: WalletConnectState;
403
+ connectWalletConnect: () => Promise<void>;
404
+ cancelQR: () => void;
405
+ retryQR: () => void;
406
+ }
407
+ interface WalletConnectProviderProps {
408
+ children: React.ReactNode;
409
+ }
410
+ declare function WalletConnectProvider({ children }: WalletConnectProviderProps): React.JSX.Element;
411
+ declare function useWalletConnect(): WalletConnectContextValue;
412
+ declare function useWalletConnectOptional(): WalletConnectContextValue | null;
413
+
414
+ type QRCodeModalStatus = "pending" | "scanned" | "expired" | "error";
415
+ interface QRCodeModalProps {
416
+ uri: string | null;
417
+ open: boolean;
418
+ onClose: () => void;
419
+ onDeepLink?: (uri: string) => void;
420
+ onRetry?: () => void;
421
+ status?: QRCodeModalStatus;
422
+ showDeepLink?: boolean;
423
+ timeoutMs?: number;
424
+ title?: string;
425
+ description?: string;
426
+ className?: string;
427
+ }
428
+ declare function QRCodeModal({ uri, open, onClose, onDeepLink, onRetry, status, showDeepLink: explicitShowDeepLink, timeoutMs, title, description, className, }: QRCodeModalProps): React.JSX.Element;
429
+
430
+ interface ErrorBoundaryProps {
431
+ children: React.ReactNode;
432
+ /** Optional custom fallback UI. Receives error and reset callback. */
433
+ fallback?: (props: {
434
+ error: Error;
435
+ reset: () => void;
436
+ }) => React.ReactNode;
437
+ /** Called when an error is caught. Useful for logging. */
438
+ onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
439
+ /** Called after the boundary resets. */
440
+ onReset?: () => void;
441
+ /** Called when the user dismisses the error dialog. */
442
+ onDismiss?: () => void;
443
+ /** Label for the retry button. Default: "Try Again" */
444
+ retryLabel?: string;
445
+ }
446
+ interface ErrorBoundaryState {
447
+ hasError: boolean;
448
+ error: Error | null;
449
+ dismissed: boolean;
450
+ }
451
+ declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
452
+ constructor(props: ErrorBoundaryProps);
453
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
454
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
455
+ handleReset: () => void;
456
+ handleDismiss: () => void;
457
+ render(): React.ReactNode;
458
+ }
459
+
460
+ interface SignInButtonProps {
461
+ className?: string;
462
+ isSignedIn?: boolean;
463
+ isSigningIn?: boolean;
464
+ result?: SiwxResult | null;
465
+ error?: Error | null;
466
+ onSignIn?: () => void;
467
+ onClearError?: () => void;
468
+ children?: React.ReactNode;
469
+ }
470
+ declare function SignInButton({ className, isSignedIn, isSigningIn, result, error, onSignIn, onClearError, children, }: SignInButtonProps): React.JSX.Element;
471
+
472
+ type DetectionMode = "auto" | "walletconnect" | "eip6963";
473
+ interface DetectionContextValue {
474
+ mode: DetectionMode;
475
+ }
476
+ declare function useDetectionMode(): DetectionContextValue;
477
+ interface Web3ConnectUIProps {
478
+ config: Web3ConnectConfig;
479
+ children: React.ReactNode;
480
+ autoConnect?: boolean;
481
+ /** Wallet connection detection mode:
482
+ * - "walletconnect" (default): Always use WalletConnect relay
483
+ * - "eip6963": Only use browser-injected EIP-6963 wallets
484
+ * - "auto": Auto-detect EIP-6963 wallets, fall back to WalletConnect
485
+ */
486
+ detectionMode?: DetectionMode;
487
+ /** Theme overrides for connect UI components */
488
+ theme?: ThemeOverride;
489
+ /** Default dark mode */
490
+ defaultDark?: boolean;
491
+ /**
492
+ * Theme priority mode:
493
+ * - "computed" (default): Respect developer's existing CSS variables (e.g. shadcn theme)
494
+ * - "fallback": Always inject connect's theme variables
495
+ */
496
+ themePriority?: ThemePriority;
497
+ }
498
+ declare function Web3ConnectUI({ config, children, autoConnect, detectionMode, theme, defaultDark, themePriority, }: Web3ConnectUIProps): React.JSX.Element;
499
+
500
+ interface SeedPhraseBackupProps {
501
+ seedPhrase: string;
502
+ onConfirm: () => void;
503
+ onSkip?: () => void;
504
+ onExportPrivateKey?: () => string | null;
505
+ className?: string;
506
+ wordCount?: 12 | 24;
507
+ /** When true, render inline instead of in a dialog */
508
+ inline?: boolean;
509
+ open?: boolean;
510
+ onOpenChange?: (open: boolean) => void;
511
+ }
512
+ declare function SeedPhraseBackup({ seedPhrase, onConfirm, onSkip, onExportPrivateKey, className, wordCount, inline, open, onOpenChange, }: SeedPhraseBackupProps): React.JSX.Element | null;
513
+
514
+ interface AppKitProps {
515
+ projectId: string;
516
+ metadata: {
517
+ name: string;
518
+ description: string;
519
+ url: string;
520
+ icons: string[];
521
+ };
522
+ enableEmbedded?: boolean;
523
+ enablePasskeys?: boolean;
524
+ /** Chain/RPC configuration forwarded to connect-appkit-react. */
525
+ chains?: Web3ConnectConfig["chains"];
526
+ /** Embedded wallet storage, signer and isolation configuration. */
527
+ embeddedConfig?: Web3ConnectConfig["embeddedConfig"];
528
+ /** Encrypts persisted connection metadata at rest (not a frontend secret). */
529
+ encryptionKey?: Web3ConnectConfig["encryptionKey"];
530
+ /** Optional SIWx authentication policy. */
531
+ siwx?: Web3ConnectConfig["siwx"];
532
+ children?: React.ReactNode;
533
+ className?: string;
534
+ autoConnect?: boolean;
535
+ theme?: Web3ConnectUIProps["theme"];
536
+ defaultDark?: boolean;
537
+ themePriority?: Web3ConnectUIProps["themePriority"];
538
+ detectionMode?: Web3ConnectUIProps["detectionMode"];
539
+ }
540
+ interface AppKitContextValue {
541
+ connect: () => void;
542
+ disconnect: () => Promise<void>;
543
+ isConnected: boolean;
544
+ isConnecting: boolean;
545
+ address: string | null;
546
+ balance: string | null;
547
+ /** Null when the chain's native symbol is not known. Do not substitute one. */
548
+ balanceSymbol: string | null;
549
+ chainName: string | null;
550
+ availableChains: Array<{
551
+ caip2: string;
552
+ name: string;
553
+ token?: string;
554
+ }>;
555
+ switchChain: (chainId: string) => Promise<void>;
556
+ wallets: DiscoveredWallet[];
557
+ hasWallets: boolean;
558
+ /** Embedded wallet backup state */
559
+ backupPending: boolean;
560
+ seedPhrase: string | null;
561
+ confirmBackup: () => void;
562
+ skipBackup: () => void;
563
+ open: boolean;
564
+ setOpen: (open: boolean) => void;
565
+ }
566
+ declare function useAppKit(): AppKitContextValue;
567
+ declare function AppKit({ projectId, metadata, enableEmbedded, enablePasskeys, chains, embeddedConfig, encryptionKey, siwx, children, className, autoConnect, theme, defaultDark, themePriority, detectionMode, }: AppKitProps): React.JSX.Element;
568
+ interface AppKitButtonProps {
569
+ className?: string;
570
+ }
571
+ declare function AppKitButton({ className }: AppKitButtonProps): React.JSX.Element;
572
+ interface AppKitChainSelectorProps {
573
+ className?: string;
574
+ variant?: "dropdown" | "buttons" | "minimal";
575
+ }
576
+ declare function AppKitChainSelector({ className, variant, }: AppKitChainSelectorProps): React.JSX.Element;
577
+
578
+ /**
579
+ * RouteSelector — UI component for cross-chain route selection.
580
+ *
581
+ * Displays route quotes from RouteEngine and lets users pick one.
582
+ * Supports loading, executing, success, and error states.
583
+ *
584
+ * Uses ComponentRegistry for all base UI (Button, Card, Badge, Skeleton, Progress).
585
+ */
586
+
587
+ /**
588
+ * Shape this component renders, declared locally on purpose.
589
+ *
590
+ * The sibling hooks already define their own domain types ("hook domain
591
+ * types, not core exports") — this component was the one place reaching into
592
+ * core's routing internals, which coupled the UI to whichever routing engine
593
+ * core happened to export. Declaring it here keeps the component usable
594
+ * against any aggregator, which is the point of shipping one appkit for every
595
+ * frontend target.
596
+ */
597
+ interface Route {
598
+ id?: string;
599
+ provider?: string;
600
+ fromChain: string;
601
+ toChain: string;
602
+ fromToken?: string;
603
+ toToken?: string;
604
+ fromAmount?: string;
605
+ toAmount?: string;
606
+ toAmountMin?: string;
607
+ steps: Array<{
608
+ type?: string;
609
+ [key: string]: unknown;
610
+ }>;
611
+ gasCosts: {
612
+ totalUsd: string;
613
+ [key: string]: unknown;
614
+ };
615
+ estimatedTime: number;
616
+ /** Aggregators attach their own fields; the component only reads the above. */
617
+ [key: string]: unknown;
618
+ }
619
+ interface TokenDisplay {
620
+ chainId: number;
621
+ address: string;
622
+ symbol: string;
623
+ }
624
+ interface RouteSelectorProps {
625
+ /** Optional input token info for the header display */
626
+ inputToken?: TokenDisplay;
627
+ /** Optional output token info for the header display */
628
+ outputToken?: TokenDisplay;
629
+ /** Input amount in human-readable units (natural numbers, not wei) */
630
+ amount?: bigint;
631
+ /** Current list of route quotes (pass empty array for no routes state) */
632
+ routes?: Route[];
633
+ /** Whether route quotes are being fetched */
634
+ loading?: boolean;
635
+ /** Whether a route execution is in progress */
636
+ executing?: boolean;
637
+ /** Called when user selects a route */
638
+ onRouteSelected?: (route: Route) => void;
639
+ /** Called when user cancels route selection */
640
+ onCancel?: () => void;
641
+ /** Success message (tx hash) after route execution completes */
642
+ successTxHash?: string | null;
643
+ /** Error message to display */
644
+ error?: string | null;
645
+ /** Optional className overrides */
646
+ className?: string;
647
+ }
648
+ declare function RouteSelector({ inputToken, outputToken, amount, routes, loading, executing, onRouteSelected, onCancel, successTxHash, error, className, }: RouteSelectorProps): React.JSX.Element;
649
+
650
+ interface SmartWalletToggleProps {
651
+ isDeployed?: boolean;
652
+ isDeploying?: boolean;
653
+ estimatedGas?: bigint;
654
+ error?: string | null;
655
+ onUpgrade?: () => void;
656
+ onShowSettings?: () => void;
657
+ onRetry?: () => void;
658
+ }
659
+ declare function SmartWalletToggle({ isDeployed, isDeploying, estimatedGas, error, onUpgrade, onShowSettings, onRetry, }: SmartWalletToggleProps): React.JSX.Element;
660
+
661
+ type AccountType = "simple" | "multi-sig" | "social-recovery";
662
+ type PaymasterType = "self" | "sponsor" | "erc20" | "custom";
663
+ type BundlerPreset = "pimlico" | "stackup" | "alchemy" | "custom";
664
+ interface SmartWalletConfig {
665
+ accountType: AccountType;
666
+ paymasterType: PaymasterType;
667
+ customPaymasterUrl: string;
668
+ bundlerPreset: BundlerPreset;
669
+ customBundlerUrl: string;
670
+ guardians: string[];
671
+ threshold: number;
672
+ }
673
+ interface SmartWalletSettingsProps {
674
+ currentConfig?: Partial<SmartWalletConfig>;
675
+ onSave?: (config: SmartWalletConfig) => void;
676
+ onBack?: () => void;
677
+ }
678
+ declare function SmartWalletSettings({ currentConfig, onSave, onBack }: SmartWalletSettingsProps): React.JSX.Element;
679
+
680
+ interface AddressWarningDialogProps {
681
+ address: string;
682
+ open: boolean;
683
+ onClose: () => void;
684
+ onProceed?: () => void;
685
+ }
686
+ declare function AddressWarningDialog({ address, open, onClose, onProceed, }: AddressWarningDialogProps): React.JSX.Element | null;
687
+
688
+ interface WalletPickerProps {
689
+ wallets: DiscoveredWallet[];
690
+ onSelect: (wallet: DiscoveredWallet) => void;
691
+ loading?: boolean;
692
+ error?: string | null;
693
+ }
694
+ declare function WalletPicker({ wallets, onSelect, loading, error, }: WalletPickerProps): React.JSX.Element;
695
+
696
+ export { AccountButton, type AccountButtonProps, AccountSelector, type AccountSelectorProps, AccountSelectorView, type AccountSelectorViewProps, type AccountType, AddressWarningDialog, type AddressWarningDialogProps, AppKit, AppKitButton, type AppKitButtonProps, AppKitChainSelector, type AppKitChainSelectorProps, type AppKitContextValue, type AppKitProps, type BundlerPreset, ChainSelector, type ChainSelectorProps, type ComponentRegistry, ConnectButtonAdapter as ConnectButton, type ConnectButtonProps, type DetectionMode, type DiscoveredWallet, ErrorBoundary, type ErrorBoundaryProps, PasskeySetup, type PasskeySetupProps, PasskeySetupView, type PasskeySetupViewProps, PassphraseDialog, type PassphraseDialogProps, PassphraseDialogView, type PassphraseDialogViewProps, type PaymasterType, QRCodeModal, type QRCodeModalProps, type QRCodeModalStatus, type QRStatus, RouteSelector, type RouteSelectorProps, SeedPhraseBackup, type SeedPhraseBackupProps, SignInButton, type SignInButtonProps, type SmartWalletConfig, SmartWalletSettings, type SmartWalletSettingsProps, SmartWalletToggle, type SmartWalletToggleProps, type ThemeOverride, type ThemePriority, ThemeProvider, type ThemeProviderProps, type TokenDisplay, type UnlockSnapshot, type UseEIP6963Result, type WalletConnectContextValue, WalletConnectProvider, type WalletConnectProviderProps, type WalletConnectState, WalletPicker, type WalletPickerProps, WalletSecurityPanel, type WalletSecurityPanelProps, WalletSecurityPanelView, type WalletSecurityPanelViewProps, Web3ComponentProvider, type Web3ComponentProviderProps, Web3ConnectUI, type Web3ConnectUIProps, cn, useAppKit, useComponent, useComponentRegistry, useDetectionMode, useEIP6963, useIsMobile, useTheme, useThemeVariable, useWalletConnect, useWalletConnectOptional };