@lumiapassport/ui-kit 1.12.0 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
- import * as React from 'react';
2
- import React__default, { PropsWithChildren, FC, HTMLAttributes } from 'react';
3
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import React__default, { FC, HTMLAttributes, PropsWithChildren } from 'react';
4
+ import * as zustand from 'zustand';
4
5
  import { UserOperationV07, UserOperationV06 } from '@lumiapassport/core/bundler';
5
6
  import * as viem from 'viem';
6
- import { Chain, Hash as Hash$1, TransactionReceipt, Address as Address$1, Hex } from 'viem';
7
+ import { Address as Address$1, Hex, Chain, Hash as Hash$1, TransactionReceipt } from 'viem';
8
+ import * as class_variance_authority_types from 'class-variance-authority/types';
9
+ import { VariantProps } from 'class-variance-authority';
7
10
  export { JwtTokens, LoginResponse, VerifyResponse, getValidTokens, jwtTokenManager, logout } from '@lumiapassport/core/auth';
8
11
  import * as wagmi from 'wagmi';
9
12
  import * as _tanstack_react_query from '@tanstack/react-query';
@@ -64,14 +67,14 @@ interface LumiaPassportConfig {
64
67
  enabled: boolean;
65
68
  showOnProduction: boolean;
66
69
  };
70
+ preferedColorMode?: 'light' | 'dark';
67
71
  ui: {
68
72
  title: string;
69
73
  subtitle?: string;
70
- theme: 'light' | 'dark' | 'auto';
74
+ dialogClassName?: string;
71
75
  authOrder?: Array<'passkey' | 'email' | 'social'>;
72
76
  /** DEPRECATED use useLumiaPassportOpen().open('auth') in your app for auto-open auth dialog */
73
- authOpen?: boolean;
74
- /** DEPRECATED use system fonts */
77
+ /** DEPRECATED, useLayoutStore colorMode */
75
78
  fonts?: {
76
79
  base?: string;
77
80
  heading?: string;
@@ -117,10 +120,6 @@ interface LumiaPassportConfig {
117
120
  url: string;
118
121
  };
119
122
  };
120
- modal: {
121
- width: string;
122
- borderRadius: string;
123
- };
124
123
  };
125
124
  network: {
126
125
  name: string;
@@ -205,10 +204,19 @@ interface LumiaPassportProviderProps {
205
204
  initialConfig?: Partial<LumiaPassportConfig>;
206
205
  callbacks?: LumiaPassportCallbacks;
207
206
  }
208
- declare const LumiaPassportProvider: React__default.FC<LumiaPassportProviderProps>;
207
+ declare function LumiaPassportProvider(props: LumiaPassportProviderProps): react_jsx_runtime.JSX.Element;
209
208
  declare const useLumiaPassportConfig: () => LumiaPassportContextType;
210
209
 
211
- interface AccountSession$1 {
210
+ interface ConnectWalletButtonProps {
211
+ /** Button Component to render as unsigned button instance */
212
+ ConnectButton?: FC<HTMLAttributes<HTMLButtonElement>>;
213
+ className?: string;
214
+ label?: string;
215
+ usePaymaster?: boolean;
216
+ }
217
+ declare function ConnectWalletButton(props: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
218
+
219
+ interface AccountSession {
212
220
  ownerAddress: `0x${string}`;
213
221
  smartAccountAddress: `0x${string}`;
214
222
  factoryAddress: `0x${string}`;
@@ -218,7 +226,7 @@ interface AccountSession$1 {
218
226
  kind: 'lumia';
219
227
  address: `0x${string}`;
220
228
  }
221
- declare function sendUserOperation(session: AccountSession$1, callTarget: `0x${string}`, amountWei: string, innerData?: `0x${string}`, feeType?: 'economy' | 'standard' | 'fast', entryPointVersion?: 'v0.6' | 'v0.7'): Promise<`0x${string}`>;
229
+ declare function sendUserOperation(session: AccountSession, callTarget: `0x${string}`, amountWei: string, innerData?: `0x${string}`, feeType?: 'economy' | 'standard' | 'fast', entryPointVersion?: 'v0.6' | 'v0.7'): Promise<`0x${string}`>;
222
230
  /**
223
231
  * Prepare and sign a UserOperation without sending it to the bundler.
224
232
  * Returns the signed UserOp and its hash for backend verification and submission.
@@ -231,7 +239,7 @@ declare function sendUserOperation(session: AccountSession$1, callTarget: `0x${s
231
239
  * @param entryPointVersion - EntryPoint version: 'v0.6' or 'v0.7'
232
240
  * @returns Object with signed UserOperation and its hash
233
241
  */
234
- declare function prepareUserOperation(session: AccountSession$1, callTarget: `0x${string}`, amountWei: string, innerData?: `0x${string}`, feeType?: 'economy' | 'standard' | 'fast', entryPointVersion?: 'v0.6' | 'v0.7'): Promise<{
242
+ declare function prepareUserOperation(session: AccountSession, callTarget: `0x${string}`, amountWei: string, innerData?: `0x${string}`, feeType?: 'economy' | 'standard' | 'fast', entryPointVersion?: 'v0.6' | 'v0.7'): Promise<{
235
243
  userOp: UserOperationV07 | UserOperationV06;
236
244
  userOpHash: `0x${string}`;
237
245
  }>;
@@ -294,7 +302,7 @@ interface SignTypedDataParams {
294
302
  * });
295
303
  * ```
296
304
  */
297
- declare function signTypedData(session: AccountSession$1, params: SignTypedDataParams): Promise<`0x${string}`>;
305
+ declare function signTypedData(session: AccountSession, params: SignTypedDataParams): Promise<`0x${string}`>;
298
306
  /**
299
307
  * Deploy smart account contract if not already deployed.
300
308
  *
@@ -324,286 +332,575 @@ declare function signTypedData(session: AccountSession$1, params: SignTypedDataP
324
332
  * const hash = await deployAccount(session, 'economy', { force: true });
325
333
  * ```
326
334
  */
327
- declare function deployAccount(session: AccountSession$1, feeType?: 'economy' | 'standard' | 'fast', options?: {
335
+ declare function deployAccount(session: AccountSession, feeType?: 'economy' | 'standard' | 'fast', options?: {
328
336
  force?: boolean;
329
337
  }): Promise<`0x${string}` | null>;
330
338
 
331
- type AccountSession = AccountSession$1;
332
- interface SessionState {
333
- session: AccountSession | null;
334
- address: `0x${string}` | null;
335
- status: string;
336
- error: string | null;
337
- recoveryUserId: string | null;
338
- isIframeReady: boolean;
339
- setIsIframeReady: (ready: boolean) => void;
340
- setSession: (s: AccountSession | null) => void;
341
- setAddress: (a: `0x${string}` | null) => void;
342
- setStatus: (s: string) => void;
343
- setError: (e: string | null) => void;
344
- setRecoveryUserId: (userId: string | null) => void;
345
- }
346
- declare function LumiaPassportSessionProvider({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
347
- declare function useLumiaPassportSession(): SessionState;
348
- /**
349
- * @deprecated Use `useLumiaPassportSession` instead. This alias will be removed in v2.0.0
350
- */
351
- declare function useLumiaSession(): SessionState;
352
- /**
353
- * @deprecated Use `LumiaPassportSessionProviderProps` instead. This alias will be removed in v2.0.0
354
- */
355
- type LumiaSessionProviderProps = PropsWithChildren;
356
- /**
357
- * @deprecated Use `LumiaPassportSessionProvider` instead. This alias will be removed in v2.0.0
358
- */
359
- declare const LumiaSessionProvider: React__default.FC<LumiaSessionProviderProps>;
360
-
361
- interface LumiaWagmiProviderProps {
362
- children: React__default.ReactNode;
363
- }
364
- declare const LumiaWagmiProvider: React__default.FC<LumiaWagmiProviderProps>;
365
-
366
- interface LumiaRainbowKitProviderProps {
367
- children: React__default.ReactNode;
368
- }
369
- declare const LumiaRainbowKitProvider: React__default.FC<LumiaRainbowKitProviderProps>;
370
-
371
- interface ConnectWalletButtonProps {
372
- /** Button Component to render as unsigned button instance */
373
- ConnectButton?: FC<HTMLAttributes<HTMLButtonElement>>;
374
- /** Button container class name */
375
- className?: string;
376
- /** Button label */
377
- label?: string;
378
- usePaymaster?: boolean;
379
- authOpen?: boolean;
380
- mode?: 'default' | 'compact';
381
- callbacks?: LumiaPassportCallbacks;
382
- onConnected?: (params: {
383
- address: `0x${string}`;
384
- session: any;
385
- }) => void;
386
- }
387
- declare const ConnectWalletButton: React__default.FC<ConnectWalletButtonProps>;
388
-
389
- /**
390
- * Theme toggle component for testing dark/light/auto mode
391
- * This is a demo component to showcase theme switching
392
- */
393
- declare const ThemeToggle: React__default.FC;
394
-
395
- interface LumiaLogoProps {
396
- size?: number;
397
- className?: string;
398
- }
399
- declare const LumiaLogo: React__default.FC<LumiaLogoProps>;
400
-
401
- type Theme = 'light' | 'dark' | 'auto';
402
- /** @deprecated will not be provided by v2 */
403
- declare function useTheme(configTheme: Theme): {
404
- theme: "light" | "dark";
405
- isDark: boolean;
406
- classes: {
407
- modalBg: string;
408
- titleText: string;
409
- bodyText: string;
410
- mutedText: string;
411
- linkText: string;
412
- inputBg: string;
413
- inputText: string;
414
- primaryBtn: string;
415
- secondaryBtn: string;
416
- outlineBtn: string;
417
- actionBtn: string;
418
- divider: string;
419
- errorText: string;
420
- successText: string;
421
- iconColor: string;
422
- };
423
- };
424
-
425
- type PageKey = 'auth' | 'terms-of-service' | 'main-menu' | 'send' | 'receive' | 'buy' | 'kyc' | 'transactions' | 'assets' | 'manage-wallet' | 'add-provider' | 'unlink-provider' | 'security' | 'keysare-backup';
426
-
427
339
  /**
428
- * Hook to programmatically open the LumiaPassport dialogs
429
- * @example
430
- * ```tsx
431
- * function MyComponent() {
432
- * const { isOpen, open, close } = useLumiaPassportOpen();
340
+ * Iframe Manager for Parent SDK
433
341
  *
434
- * return (
435
- * <button onClick={() => open('manage-wallet')}>
436
- * Manage Wallet
437
- * </button>
438
- * );
439
- * }
440
- * ```
342
+ * Manages secure communication with the isolated iframe wallet at auth.lumiapassport.com
343
+ * Implements postMessage protocol with HMAC authentication and replay protection
441
344
  */
442
- declare function useLumiaPassportOpen(): {
443
- /** Opens the Manage Wallet modal */
444
- readonly open: (passportPage: PageKey) => void;
445
- /** Closes the Manage Wallet modal */
446
- readonly close: () => void;
447
- /** Whether the Manage Wallet modal is currently open */
448
- readonly isOpen: boolean;
449
- };
450
-
451
- type ChainLike$2 = {
452
- id: number;
453
- blockExplorers?: {
454
- default?: {
455
- url: string;
456
- };
457
- };
458
- };
459
- type UserOpStatusProps = {
460
- userOpHash: `0x${string}` | string;
461
- chain?: ChainLike$2;
462
- className?: string;
463
- pollMs?: number;
464
- maxPollTimeMs?: number;
465
- externalState?: {
466
- receipt?: any | null;
467
- mempool?: any | null;
468
- error?: string | null;
469
- isPolling?: boolean;
470
- };
471
- };
472
- declare const UserOpStatus: React.FC<UserOpStatusProps>;
473
-
474
- type ChainLike$1 = {
475
- id: number;
476
- blockExplorers?: {
477
- default?: {
478
- url: string;
479
- };
480
- };
481
- };
482
- type HashProps = {
483
- hash?: `0x${string}` | string | null;
484
- chain?: ChainLike$1;
485
- className?: string;
486
- truncate?: boolean;
487
- showCopy?: boolean;
488
- showExplorer?: boolean;
489
- kind?: 'tx' | 'address' | 'block';
490
- label?: string;
491
- };
492
- declare const Hash: React.FC<HashProps>;
493
-
494
- type ChainLike = {
495
- id: number;
496
- blockExplorers?: {
497
- default?: {
498
- url: string;
499
- };
500
- };
501
- };
502
- type AddressProps = {
503
- address?: `0x${string}` | string | null;
504
- chain?: ChainLike;
505
- className?: string;
506
- truncate?: boolean;
507
- showCopy?: boolean;
508
- showExplorer?: boolean;
509
- label?: string;
510
- };
511
- declare const Address: React.FC<AddressProps>;
512
-
513
- interface TransactionsListProps {
514
- address: string;
515
- itemsCount?: number;
516
- }
517
- declare const TransactionsList: React__default.FC<TransactionsListProps>;
518
345
 
519
- declare function KeyshareBackupMenu(): react_jsx_runtime.JSX.Element;
520
-
521
- interface SendTransactionParams$1 {
522
- to: `0x${string}`;
346
+ interface Transaction$1 {
347
+ to: Address$1;
523
348
  value: string;
524
- data?: `0x${string}`;
525
- }
526
- interface UseSendTransactionReturn {
527
- sendTransaction: (params: SendTransactionParams$1) => Promise<string | null>;
528
- isLoading: boolean;
529
- error: string | null;
530
- userOpHash: string | null;
531
- reset: () => void;
349
+ data?: Hex;
350
+ gasLimit?: string;
532
351
  }
533
- declare function useSendTransaction(): UseSendTransactionReturn;
534
-
535
- interface UserOpReceipt {
536
- userOpHash: `0x${string}`;
537
- sender: `0x${string}`;
538
- nonce: string;
539
- actualGasUsed: string;
540
- actualGasCost: string;
541
- success: boolean;
542
- receipt?: {
543
- transactionHash: `0x${string}`;
544
- blockNumber: string;
545
- blockHash: string;
546
- logs: any[];
352
+ interface IframeManagerConfig {
353
+ iframeUrl: string;
354
+ projectId: string;
355
+ debug?: boolean;
356
+ onWalletReady?: (status: WalletReadyStatus) => void;
357
+ themeColors?: {
358
+ background?: string;
359
+ text?: string;
360
+ textSecondary?: string;
361
+ border?: string;
547
362
  };
548
363
  }
549
- interface UserOpMempool {
550
- entryPoint: `0x${string}` | null;
551
- sender: `0x${string}` | null;
552
- }
553
- type UserOpState = 'waiting' | 'pending' | 'included' | 'failed' | 'rejected' | 'timeout';
554
- interface UseUserOpStatusOptions {
555
- userOpHash?: `0x${string}` | string | null;
556
- pollMs?: number;
557
- maxPollTimeMs?: number;
558
- enabled?: boolean;
559
- onStateChange?: (state: UserOpState) => void;
560
- onReceipt?: (receipt: UserOpReceipt) => void;
561
- onTxHash?: (txHash: `0x${string}`) => void;
562
- }
563
- interface UseUserOpStatusReturn {
564
- state: UserOpState;
565
- receipt: UserOpReceipt | null;
566
- mempool: UserOpMempool | null;
567
- txHash: `0x${string}` | null;
568
- error: string | null;
569
- isPolling: boolean;
570
- refresh: () => Promise<void>;
571
- }
572
- declare function useUserOpStatus(options?: UseUserOpStatusOptions): UseUserOpStatusReturn;
573
-
574
- interface UseLogoutReturn {
575
- logout: () => Promise<void>;
576
- }
577
- /**
578
- * Hook for logging out and disconnecting from Lumia Passport
579
- * Clears session, tokens, and notifies callbacks
580
- *
581
- * @example
582
- * ```tsx
583
- * function MyComponent() {
584
- * const { logout } = useLogout();
585
- *
586
- * return (
587
- * <button onClick={logout}>
588
- * Disconnect
589
- * </button>
590
- * );
591
- * }
592
- * ```
593
- */
594
- declare function useLogout(): UseLogoutReturn;
595
-
596
- declare const LUMIA_EXPLORER_URL: string;
597
- declare const lumiaBeam: Chain;
598
-
599
- declare global {
600
- interface Window {
601
- __LUMIA_CONDITIONAL_UI_ACTIVE__?: boolean;
602
- }
364
+ interface WalletReadyStatus {
365
+ ready: boolean;
366
+ userId?: string;
367
+ address?: `0x${string}`;
368
+ hasKeyshare: boolean;
369
+ hasSession: boolean;
370
+ timestamp: number;
603
371
  }
604
-
605
- interface AuthProvider {
606
- provider: 'passkey' | 'email' | 'telegram' | 'google' | 'discord' | 'twitter' | 'wallet';
372
+ declare class IframeManager {
373
+ private iframe;
374
+ private iframeUrl;
375
+ private projectId;
376
+ private debug;
377
+ private sessionToken;
378
+ private isReady;
379
+ private readyPromise;
380
+ private readyResolve;
381
+ private onWalletReadyCallback?;
382
+ private themeColors?;
383
+ private pendingRequests;
384
+ private usedNonces;
385
+ private messageListener;
386
+ private hiddenElements;
387
+ private pointerGuardCleanup;
388
+ private iframeHideTimeout;
389
+ private iframeActive;
390
+ private providerSessions;
391
+ private providerConnections;
392
+ private readonly REQUEST_TIMEOUT;
393
+ private readonly NONCE_EXPIRY;
394
+ constructor(config: IframeManagerConfig);
395
+ /**
396
+ * Initialize iframe and wait for it to be ready
397
+ */
398
+ initialize(): Promise<void>;
399
+ /**
400
+ * Set the onWalletReady callback
401
+ */
402
+ setOnWalletReady(callback: (status: WalletReadyStatus) => void): void;
403
+ /**
404
+ * Authenticate SDK with iframe to establish session
405
+ */
406
+ private authenticateSDK;
407
+ /**
408
+ * Handle incoming postMessage events
409
+ */
410
+ private handleMessage;
411
+ /**
412
+ * Handle token refresh request from iframe
413
+ */
414
+ private handleTokenRefreshRequest;
415
+ /**
416
+ * Send secure message to iframe
417
+ */
418
+ private sendMessage;
419
+ /**
420
+ * Compute HMAC for message authentication
421
+ */
422
+ private computeHMAC;
423
+ /**
424
+ * Generate unique message ID
425
+ */
426
+ private generateMessageId;
427
+ /**
428
+ * Generate nonce for replay protection
429
+ */
430
+ private generateNonce;
431
+ /**
432
+ * Show iframe (for consent/confirmation UI)
433
+ */
434
+ showIframe(): void;
435
+ /**
436
+ * Hide iframe
437
+ */
438
+ hideIframe(): void;
439
+ /**
440
+ * Hide all Radix Dialog modals (SendModal, etc.)
441
+ */
442
+ private hideAllDialogs;
443
+ /**
444
+ * Restore all previously hidden Radix Dialog modals
445
+ */
446
+ private restoreAllDialogs;
447
+ /**
448
+ * Stop Radix dismissable layers from swallowing the first click on the iframe.
449
+ * Radix attaches pointer event guards at the document level; we intercept at window
450
+ * capture phase so user clicks flow straight into the consent iframe.
451
+ */
452
+ private enablePointerEventGuards;
453
+ /**
454
+ * Remove pointer interception once iframe is hidden again.
455
+ */
456
+ private disablePointerEventGuards;
457
+ /**
458
+ * Authenticate user with application
459
+ */
460
+ authenticate(userId: string, avatar?: string | null, displayName?: string | null): Promise<{
461
+ userId: string;
462
+ address: Address$1 | undefined;
463
+ }>;
464
+ /**
465
+ * Start DKG (Distributed Key Generation)
466
+ */
467
+ startDKG(userId: string, accessToken?: string): Promise<Address$1>;
468
+ /**
469
+ * Sign transaction
470
+ */
471
+ signTransaction(userId: string, transaction: Transaction$1, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
472
+ /**
473
+ * Sign EIP712 typed data
474
+ */
475
+ signTypedData(userId: string, typedData: {
476
+ domain: {
477
+ name?: string;
478
+ version?: string;
479
+ chainId?: number;
480
+ verifyingContract?: string;
481
+ salt?: string;
482
+ };
483
+ types: Record<string, Array<{
484
+ name: string;
485
+ type: string;
486
+ }>>;
487
+ primaryType: string;
488
+ message: Record<string, any>;
489
+ }, digest32: Hex, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
490
+ /**
491
+ * Get user's wallet address
492
+ */
493
+ getAddress(userId: string): Promise<Address$1 | undefined>;
494
+ /**
495
+ * Check if user has a keyshare
496
+ */
497
+ checkKeyshare(userId: string): Promise<{
498
+ hasKeyshare: boolean;
499
+ address?: Address$1;
500
+ }>;
501
+ /**
502
+ * Open social auth popup (Telegram, Discord, Twitter, etc.)
503
+ */
504
+ openSocialAuthPopup(provider: string, config?: Record<string, any>): Promise<{
505
+ provider: string;
506
+ success: boolean;
507
+ user?: any;
508
+ mode?: 'login' | 'link';
509
+ error?: string;
510
+ }>;
511
+ /**
512
+ * Fallback verification for X OAuth cancellations.
513
+ * Attempts to detect if the backend session was still established.
514
+ */
515
+ private verifyXAuthSession;
516
+ /**
517
+ * Prime provider session/cache state to detect future changes.
518
+ */
519
+ private primeProviderSessions;
520
+ private getKnownSessionId;
521
+ private getKnownProviderConnection;
522
+ private recordProviderSession;
523
+ private recordProviderConnection;
524
+ private updateProviderTrackingFromUser;
525
+ private extractSessionId;
526
+ private getProvidersList;
527
+ /**
528
+ * Get trusted apps for user
529
+ */
530
+ getTrustedApps(userId: string): Promise<Array<{
531
+ userId: string;
532
+ projectId: string;
533
+ origin: string;
534
+ trustedAt: number;
535
+ }>>;
536
+ /**
537
+ * Remove app from trusted list
538
+ */
539
+ removeTrustedApp(userId: string, projectId: string, origin: string): Promise<boolean>;
540
+ /**
541
+ * Clear all authorizations for current project (for testing consent flow)
542
+ * This will force the consent modal to appear on next authentication
543
+ */
544
+ clearAuthorizations(): Promise<boolean>;
545
+ /**
546
+ * Create backup of keyshare
547
+ */
548
+ createBackup(userId: string, backupRequest: {
549
+ method: 'server' | 'cloud' | 'local';
550
+ password?: string;
551
+ cloudProvider?: string;
552
+ }, accessToken?: string): Promise<{
553
+ success: boolean;
554
+ method: string;
555
+ timestamp: number;
556
+ error?: string;
557
+ }>;
558
+ /**
559
+ * Restore keyshare from server backup
560
+ */
561
+ restoreFromServer(userId: string, password?: string, accessToken?: string): Promise<{
562
+ success: boolean;
563
+ timestamp: number;
564
+ error?: string;
565
+ data?: any;
566
+ }>;
567
+ /**
568
+ * Encrypt backup data without uploading (for cloud/local backups)
569
+ * Returns encrypted data that parent can upload/download
570
+ */
571
+ encryptBackupData(userId: string, password?: string): Promise<any>;
572
+ /**
573
+ * Restore keyshare from local file backup
574
+ */
575
+ restoreFromLocalFile(userId: string, fileContent: string, password?: string): Promise<{
576
+ success: boolean;
577
+ timestamp: number;
578
+ error?: string;
579
+ data?: any;
580
+ }>;
581
+ /**
582
+ * Get backup status for user
583
+ */
584
+ getBackupStatus(userId: string): Promise<{
585
+ server: {
586
+ lastBackup?: number;
587
+ error?: string;
588
+ };
589
+ cloud: {
590
+ lastBackup?: number;
591
+ error?: string;
592
+ };
593
+ local: {
594
+ lastBackup?: number;
595
+ error?: string;
596
+ };
597
+ }>;
598
+ /**
599
+ * Get available cloud providers
600
+ */
601
+ getCloudProviders(): Promise<Array<{
602
+ id: string;
603
+ name: string;
604
+ available: boolean;
605
+ }>>;
606
+ /**
607
+ * Cleanup and destroy iframe
608
+ */
609
+ destroy(): void;
610
+ /**
611
+ * Debug logging
612
+ */
613
+ private log;
614
+ }
615
+ /**
616
+ * Get or create iframe manager singleton
617
+ */
618
+ declare function getIframeManager(config?: IframeManagerConfig): IframeManager;
619
+ /**
620
+ * Destroy iframe manager singleton
621
+ */
622
+ declare function destroyIframeManager(): void;
623
+
624
+ interface SessionState {
625
+ session: AccountSession | null;
626
+ address: `0x${string}` | null;
627
+ status: string;
628
+ error: string | null;
629
+ recoveryUserId: string | null;
630
+ isIframeReady: boolean;
631
+ usePaymaster: boolean;
632
+ hasServerVault: boolean;
633
+ isLoading: boolean;
634
+ walletReadyStatus: WalletReadyStatus | null;
635
+ setUsePaymaster: (usePaymaster: boolean) => void;
636
+ setIsIframeReady: (ready: boolean) => void;
637
+ setSession: (s: AccountSession | null) => void;
638
+ setAddress: (a: `0x${string}` | null) => void;
639
+ setStatus: (s: string) => void;
640
+ setError: (e: string | null) => void;
641
+ setRecoveryUserId: (userId: string | null) => void;
642
+ setHasServerVault: (hasServerVault: boolean) => void;
643
+ setIsLoading: (isLoading: boolean) => void;
644
+ setWalletReadyStatus: (status: WalletReadyStatus) => void;
645
+ }
646
+ /** Lumia Passport session store */
647
+ declare const useLumiaPassportSession: zustand.UseBoundStore<zustand.StoreApi<SessionState>>;
648
+ declare function LumiaPassportSessionProvider({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
649
+
650
+ declare const useLumiaPassportBalance: () => {
651
+ walletBalance: {
652
+ decimals: number;
653
+ formatted: string;
654
+ symbol: string;
655
+ value: bigint;
656
+ };
657
+ currentLumiaRate: number;
658
+ };
659
+ declare const useLumiaPassportIFrameReady: () => boolean;
660
+ declare const useLumiaPassportAccountSession: () => AccountSession;
661
+ declare const useLumiaPassportAddress: () => `0x${string}`;
662
+ declare const useLumiaPassportError: () => string;
663
+ declare const useLumiaPassportLoadingStatus: () => {
664
+ isSessionLoading: boolean;
665
+ sessionStatus: string;
666
+ };
667
+ declare const useLumiaPassportRecoveryUserId: () => string;
668
+ declare const useLumiaPassportHasServerVault: () => boolean;
669
+
670
+ declare enum PageKey {
671
+ AUTH = "auth",
672
+ TERMS_OF_SERVICE = "terms-of-service",
673
+ MAIN_MENU = "main-menu",
674
+ SEND = "send",
675
+ RECEIVE = "receive",
676
+ BUY = "buy",
677
+ KYC = "kyc",
678
+ TRANSACTIONS = "transactions",
679
+ ASSETS = "assets",
680
+ MANAGE_WALLET = "manage-wallet",
681
+ ADD_PROVIDER = "add-provider",
682
+ UNLINK_PROVIDER = "unlink-provider",
683
+ SECURITY = "security",
684
+ KEYSARE_BACKUP = "keysare-backup",
685
+ KEYSHARE_RESTORE = "keyshare-restore"
686
+ }
687
+ /** WIP: need to develop page options typeset, i.e options: AuthOpenOptions | BuyOpenOption etc */
688
+ interface PageOpenParams {
689
+ key: PageKey;
690
+ [option: string]: unknown;
691
+ }
692
+
693
+ /**
694
+ * Hook to programmatically open the LumiaPassport dialogs
695
+ * @example
696
+ * ```tsx
697
+ * function MyComponent() {
698
+ * const { isOpen, open, close } = useLumiaPassportOpen();
699
+ *
700
+ * return (
701
+ * <button onClick={() => open(PageKey.BUY, { amount: 10 })}>
702
+ * Buy LUMIA
703
+ * </button>
704
+ * );
705
+ * }
706
+ * ```
707
+ */
708
+ declare function useLumiaPassportOpen(): {
709
+ readonly open: (passportPage: PageKey, params?: PageOpenParams) => void;
710
+ readonly close: () => void;
711
+ readonly isOpen: boolean;
712
+ };
713
+
714
+ type ColorMode = 'light' | 'dark';
715
+
716
+ declare function useLumiaPassportColorMode(): {
717
+ colorMode: ColorMode;
718
+ setColorMode: (mode: ColorMode) => void;
719
+ };
720
+
721
+ declare const buttonVariants: (props?: {
722
+ variant?: "link" | "telegram" | "success" | "default" | "outline" | "ghost" | "destructive" | "secondary";
723
+ size?: "small" | "large" | "default" | "medium" | "icon" | "sm" | "lg";
724
+ } & class_variance_authority_types.ClassProp) => string;
725
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
726
+ asChild?: boolean;
727
+ }
728
+
729
+ /** LumiaPassport Color Mode Switcher */
730
+ declare function ThemeToggle(props: ButtonProps): react_jsx_runtime.JSX.Element;
731
+
732
+ interface LumiaWagmiProviderProps {
733
+ children: React__default.ReactNode;
734
+ }
735
+ declare const LumiaWagmiProvider: React__default.FC<LumiaWagmiProviderProps>;
736
+
737
+ interface LumiaRainbowKitProviderProps {
738
+ children: React__default.ReactNode;
739
+ }
740
+ declare const LumiaRainbowKitProvider: React__default.FC<LumiaRainbowKitProviderProps>;
741
+
742
+ interface LumiaLogoProps {
743
+ size?: number;
744
+ className?: string;
745
+ }
746
+ declare const LumiaLogo: React.ForwardRefExoticComponent<LumiaLogoProps & React.RefAttributes<SVGSVGElement>>;
747
+
748
+ type ChainLike$2 = {
749
+ id: number;
750
+ blockExplorers?: {
751
+ default?: {
752
+ url: string;
753
+ };
754
+ };
755
+ };
756
+ type UserOpStatusProps = {
757
+ userOpHash: `0x${string}` | string;
758
+ chain?: ChainLike$2;
759
+ className?: string;
760
+ pollMs?: number;
761
+ maxPollTimeMs?: number;
762
+ externalState?: {
763
+ receipt?: any | null;
764
+ mempool?: any | null;
765
+ error?: string | null;
766
+ isPolling?: boolean;
767
+ };
768
+ };
769
+ declare const UserOpStatus: React.FC<UserOpStatusProps>;
770
+
771
+ type ChainLike$1 = {
772
+ id: number;
773
+ blockExplorers?: {
774
+ default?: {
775
+ url: string;
776
+ };
777
+ };
778
+ };
779
+ type HashProps = {
780
+ hash?: `0x${string}` | string | null;
781
+ chain?: ChainLike$1;
782
+ className?: string;
783
+ truncate?: boolean;
784
+ showCopy?: boolean;
785
+ showExplorer?: boolean;
786
+ kind?: 'tx' | 'address' | 'block';
787
+ label?: string;
788
+ };
789
+ declare const Hash: React.FC<HashProps>;
790
+
791
+ type ChainLike = {
792
+ id: number;
793
+ blockExplorers?: {
794
+ default?: {
795
+ url: string;
796
+ };
797
+ };
798
+ };
799
+ type AddressProps = {
800
+ address?: `0x${string}` | string | null;
801
+ chain?: ChainLike;
802
+ className?: string;
803
+ truncate?: boolean;
804
+ showCopy?: boolean;
805
+ showExplorer?: boolean;
806
+ label?: string;
807
+ };
808
+ declare const Address: React.FC<AddressProps>;
809
+
810
+ interface TransactionsListProps {
811
+ address: string;
812
+ itemsCount?: number;
813
+ }
814
+ declare const TransactionsList: React__default.FC<TransactionsListProps>;
815
+
816
+ declare function KeyshareBackupMenu(): react_jsx_runtime.JSX.Element;
817
+
818
+ interface SendTransactionParams$1 {
819
+ to: `0x${string}`;
820
+ value: string;
821
+ data?: `0x${string}`;
822
+ }
823
+ interface UseSendTransactionReturn {
824
+ sendTransaction: (params: SendTransactionParams$1) => Promise<string | null>;
825
+ isLoading: boolean;
826
+ error: string | null;
827
+ userOpHash: string | null;
828
+ reset: () => void;
829
+ }
830
+ declare function useSendTransaction(): UseSendTransactionReturn;
831
+
832
+ interface UserOpReceipt {
833
+ userOpHash: `0x${string}`;
834
+ sender: `0x${string}`;
835
+ nonce: string;
836
+ actualGasUsed: string;
837
+ actualGasCost: string;
838
+ success: boolean;
839
+ receipt?: {
840
+ transactionHash: `0x${string}`;
841
+ blockNumber: string;
842
+ blockHash: string;
843
+ logs: any[];
844
+ };
845
+ }
846
+ interface UserOpMempool {
847
+ entryPoint: `0x${string}` | null;
848
+ sender: `0x${string}` | null;
849
+ }
850
+ type UserOpState = 'waiting' | 'pending' | 'included' | 'failed' | 'rejected' | 'timeout';
851
+ interface UseUserOpStatusOptions {
852
+ userOpHash?: `0x${string}` | string | null;
853
+ pollMs?: number;
854
+ maxPollTimeMs?: number;
855
+ enabled?: boolean;
856
+ onStateChange?: (state: UserOpState) => void;
857
+ onReceipt?: (receipt: UserOpReceipt) => void;
858
+ onTxHash?: (txHash: `0x${string}`) => void;
859
+ }
860
+ interface UseUserOpStatusReturn {
861
+ state: UserOpState;
862
+ receipt: UserOpReceipt | null;
863
+ mempool: UserOpMempool | null;
864
+ txHash: `0x${string}` | null;
865
+ error: string | null;
866
+ isPolling: boolean;
867
+ refresh: () => Promise<void>;
868
+ }
869
+ declare function useUserOpStatus(options?: UseUserOpStatusOptions): UseUserOpStatusReturn;
870
+
871
+ interface UseLogoutReturn {
872
+ logout: () => Promise<void>;
873
+ }
874
+ /**
875
+ * Hook for logging out and disconnecting from Lumia Passport
876
+ * Clears session, tokens, and notifies callbacks
877
+ *
878
+ * @example
879
+ * ```tsx
880
+ * function MyComponent() {
881
+ * const { logout } = useLogout();
882
+ *
883
+ * return (
884
+ * <button onClick={logout}>
885
+ * Disconnect
886
+ * </button>
887
+ * );
888
+ * }
889
+ * ```
890
+ */
891
+ declare function useLogout(): UseLogoutReturn;
892
+
893
+ declare const LUMIA_EXPLORER_URL: string;
894
+ declare const lumiaBeam: Chain;
895
+
896
+ declare global {
897
+ interface Window {
898
+ __LUMIA_CONDITIONAL_UI_ACTIVE__?: boolean;
899
+ }
900
+ }
901
+
902
+ interface AuthProvider {
903
+ provider: 'passkey' | 'email' | 'telegram' | 'google' | 'discord' | 'twitter' | 'wallet';
607
904
  verified: boolean;
608
905
  linkedAt: string;
609
906
  lastUsedAt?: string;
@@ -662,7 +959,7 @@ declare const wagmiConfig: wagmi.Config<readonly [viem.Chain], {
662
959
  [lumiaBeam.id]: viem.HttpTransport<undefined, false>;
663
960
  }, readonly wagmi.CreateConnectorFn[]>;
664
961
 
665
- interface Transaction$1 {
962
+ interface Transaction {
666
963
  hash: Hash$1;
667
964
  from: string;
668
965
  to: string | null;
@@ -811,7 +1108,7 @@ declare function useTransactions(): {
811
1108
  transactionIndex: number;
812
1109
  }>;
813
1110
  getTransactionReceipt: (hash: Hash$1) => Promise<TransactionReceipt>;
814
- getTransactionHistory: (address: `0x${string}`, limit?: number) => Promise<Transaction$1[]>;
1111
+ getTransactionHistory: (address: `0x${string}`, limit?: number) => Promise<Transaction[]>;
815
1112
  address: `0x${string}`;
816
1113
  isConnected: boolean;
817
1114
  };
@@ -886,440 +1183,155 @@ interface UserOperation {
886
1183
  actualGasCost: bigint;
887
1184
  blockNumber: bigint;
888
1185
  timestamp: number;
889
- transactionHash: Hash$1;
890
- }
891
- declare function useSmartAccountTransactions(): {
892
- getUserOperations: (address: `0x${string}`, fromBlock?: bigint | "earliest", toBlock?: bigint | "latest") => Promise<UserOperation[]>;
893
- getRecentUserOperations: (address: `0x${string}`, limit?: number) => Promise<UserOperation[]>;
894
- getTransactionDetails: (txHash: Hash$1) => Promise<{
895
- transaction: {
896
- input: viem.Hex;
897
- s: viem.Hex;
898
- from: viem.Address;
899
- gas: bigint;
900
- nonce: number;
901
- to: viem.Address | null;
902
- type: "legacy";
903
- value: bigint;
904
- r: viem.Hex;
905
- v: bigint;
906
- yParity?: undefined;
907
- blobVersionedHashes?: undefined;
908
- gasPrice: bigint;
909
- maxFeePerBlobGas?: undefined;
910
- maxFeePerGas?: undefined;
911
- maxPriorityFeePerGas?: undefined;
912
- chainId?: number;
913
- accessList?: undefined;
914
- authorizationList?: undefined;
915
- hash: Hash$1;
916
- typeHex: viem.Hex | null;
917
- blockHash: `0x${string}`;
918
- blockNumber: bigint;
919
- transactionIndex: number;
920
- } | {
1186
+ transactionHash: Hash$1;
1187
+ }
1188
+ declare function useSmartAccountTransactions(): {
1189
+ getUserOperations: (address: `0x${string}`, fromBlock?: bigint | "earliest", toBlock?: bigint | "latest") => Promise<UserOperation[]>;
1190
+ getRecentUserOperations: (address: `0x${string}`, limit?: number) => Promise<UserOperation[]>;
1191
+ getTransactionDetails: (txHash: Hash$1) => Promise<{
1192
+ transaction: {
921
1193
  input: viem.Hex;
922
1194
  s: viem.Hex;
923
1195
  from: viem.Address;
924
1196
  gas: bigint;
925
1197
  nonce: number;
926
1198
  to: viem.Address | null;
927
- type: "eip2930";
1199
+ type: "legacy";
928
1200
  value: bigint;
929
1201
  r: viem.Hex;
930
1202
  v: bigint;
931
- yParity: number;
1203
+ yParity?: undefined;
932
1204
  blobVersionedHashes?: undefined;
933
1205
  gasPrice: bigint;
934
1206
  maxFeePerBlobGas?: undefined;
935
1207
  maxFeePerGas?: undefined;
936
1208
  maxPriorityFeePerGas?: undefined;
937
- chainId: number;
938
- accessList: viem.AccessList;
939
- authorizationList?: undefined;
940
- hash: Hash$1;
941
- typeHex: viem.Hex | null;
942
- blockHash: `0x${string}`;
943
- blockNumber: bigint;
944
- transactionIndex: number;
945
- } | {
946
- input: viem.Hex;
947
- s: viem.Hex;
948
- from: viem.Address;
949
- gas: bigint;
950
- nonce: number;
951
- to: viem.Address | null;
952
- type: "eip1559";
953
- value: bigint;
954
- r: viem.Hex;
955
- v: bigint;
956
- yParity: number;
957
- blobVersionedHashes?: undefined;
958
- gasPrice?: undefined;
959
- maxFeePerBlobGas?: undefined;
960
- maxFeePerGas: bigint;
961
- maxPriorityFeePerGas: bigint;
962
- chainId: number;
963
- accessList: viem.AccessList;
964
- authorizationList?: undefined;
965
- hash: Hash$1;
966
- typeHex: viem.Hex | null;
967
- blockHash: `0x${string}`;
968
- blockNumber: bigint;
969
- transactionIndex: number;
970
- } | {
971
- input: viem.Hex;
972
- s: viem.Hex;
973
- from: viem.Address;
974
- gas: bigint;
975
- nonce: number;
976
- to: viem.Address | null;
977
- type: "eip4844";
978
- value: bigint;
979
- r: viem.Hex;
980
- v: bigint;
981
- yParity: number;
982
- blobVersionedHashes: readonly viem.Hex[];
983
- gasPrice?: undefined;
984
- maxFeePerBlobGas: bigint;
985
- maxFeePerGas: bigint;
986
- maxPriorityFeePerGas: bigint;
987
- chainId: number;
988
- accessList: viem.AccessList;
1209
+ chainId?: number;
1210
+ accessList?: undefined;
989
1211
  authorizationList?: undefined;
990
1212
  hash: Hash$1;
991
- typeHex: viem.Hex | null;
992
- blockHash: `0x${string}`;
993
- blockNumber: bigint;
994
- transactionIndex: number;
995
- } | {
996
- input: viem.Hex;
997
- s: viem.Hex;
998
- from: viem.Address;
999
- gas: bigint;
1000
- nonce: number;
1001
- to: viem.Address | null;
1002
- type: "eip7702";
1003
- value: bigint;
1004
- r: viem.Hex;
1005
- v: bigint;
1006
- yParity: number;
1007
- blobVersionedHashes?: undefined;
1008
- gasPrice?: undefined;
1009
- maxFeePerBlobGas?: undefined;
1010
- maxFeePerGas: bigint;
1011
- maxPriorityFeePerGas: bigint;
1012
- chainId: number;
1013
- accessList: viem.AccessList;
1014
- authorizationList: viem.SignedAuthorizationList;
1015
- hash: Hash$1;
1016
- typeHex: viem.Hex | null;
1017
- blockHash: `0x${string}`;
1018
- blockNumber: bigint;
1019
- transactionIndex: number;
1020
- };
1021
- receipt: viem.TransactionReceipt;
1022
- }>;
1023
- };
1024
-
1025
- interface LinkedProfileDisplay extends AuthProvider {
1026
- displayName: string;
1027
- icon?: React.ComponentType<{
1028
- className?: string;
1029
- }>;
1030
- color?: string;
1031
- }
1032
- declare function useLumiaPassportLinkedProfiles(): {
1033
- readonly profiles: LinkedProfileDisplay[];
1034
- readonly avatar: string;
1035
- readonly isLoading: boolean;
1036
- readonly error: string;
1037
- readonly refresh: () => Promise<void>;
1038
- };
1039
-
1040
- /**
1041
- * Iframe Manager for Parent SDK
1042
- *
1043
- * Manages secure communication with the isolated iframe wallet at auth.lumiapassport.com
1044
- * Implements postMessage protocol with HMAC authentication and replay protection
1045
- */
1046
-
1047
- interface Transaction {
1048
- to: Address$1;
1049
- value: string;
1050
- data?: Hex;
1051
- gasLimit?: string;
1052
- }
1053
- interface IframeManagerConfig {
1054
- iframeUrl: string;
1055
- projectId: string;
1056
- debug?: boolean;
1057
- onWalletReady?: (status: WalletReadyStatus) => void;
1058
- themeColors?: {
1059
- background?: string;
1060
- text?: string;
1061
- textSecondary?: string;
1062
- border?: string;
1063
- };
1064
- }
1065
- interface WalletReadyStatus {
1066
- ready: boolean;
1067
- userId?: string;
1068
- address?: `0x${string}`;
1069
- hasKeyshare: boolean;
1070
- hasSession: boolean;
1071
- timestamp: number;
1072
- }
1073
- declare class IframeManager {
1074
- private iframe;
1075
- private iframeUrl;
1076
- private projectId;
1077
- private debug;
1078
- private sessionToken;
1079
- private isReady;
1080
- private readyPromise;
1081
- private readyResolve;
1082
- private onWalletReadyCallback?;
1083
- private themeColors?;
1084
- private pendingRequests;
1085
- private usedNonces;
1086
- private messageListener;
1087
- private hiddenElements;
1088
- private pointerGuardCleanup;
1089
- private iframeHideTimeout;
1090
- private iframeActive;
1091
- private providerSessions;
1092
- private providerConnections;
1093
- private readonly REQUEST_TIMEOUT;
1094
- private readonly NONCE_EXPIRY;
1095
- constructor(config: IframeManagerConfig);
1096
- /**
1097
- * Initialize iframe and wait for it to be ready
1098
- */
1099
- initialize(): Promise<void>;
1100
- /**
1101
- * Set the onWalletReady callback
1102
- */
1103
- setOnWalletReady(callback: (status: WalletReadyStatus) => void): void;
1104
- /**
1105
- * Authenticate SDK with iframe to establish session
1106
- */
1107
- private authenticateSDK;
1108
- /**
1109
- * Handle incoming postMessage events
1110
- */
1111
- private handleMessage;
1112
- /**
1113
- * Handle token refresh request from iframe
1114
- */
1115
- private handleTokenRefreshRequest;
1116
- /**
1117
- * Send secure message to iframe
1118
- */
1119
- private sendMessage;
1120
- /**
1121
- * Compute HMAC for message authentication
1122
- */
1123
- private computeHMAC;
1124
- /**
1125
- * Generate unique message ID
1126
- */
1127
- private generateMessageId;
1128
- /**
1129
- * Generate nonce for replay protection
1130
- */
1131
- private generateNonce;
1132
- /**
1133
- * Show iframe (for consent/confirmation UI)
1134
- */
1135
- showIframe(): void;
1136
- /**
1137
- * Hide iframe
1138
- */
1139
- hideIframe(): void;
1140
- /**
1141
- * Hide all Radix Dialog modals (SendModal, etc.)
1142
- */
1143
- private hideAllDialogs;
1144
- /**
1145
- * Restore all previously hidden Radix Dialog modals
1146
- */
1147
- private restoreAllDialogs;
1148
- /**
1149
- * Stop Radix dismissable layers from swallowing the first click on the iframe.
1150
- * Radix attaches pointer event guards at the document level; we intercept at window
1151
- * capture phase so user clicks flow straight into the consent iframe.
1152
- */
1153
- private enablePointerEventGuards;
1154
- /**
1155
- * Remove pointer interception once iframe is hidden again.
1156
- */
1157
- private disablePointerEventGuards;
1158
- /**
1159
- * Authenticate user with application
1160
- */
1161
- authenticate(userId: string, avatar?: string | null, displayName?: string | null): Promise<{
1162
- userId: string;
1163
- address: Address$1 | undefined;
1164
- }>;
1165
- /**
1166
- * Start DKG (Distributed Key Generation)
1167
- */
1168
- startDKG(userId: string, accessToken?: string): Promise<Address$1>;
1169
- /**
1170
- * Sign transaction
1171
- */
1172
- signTransaction(userId: string, transaction: Transaction, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
1173
- /**
1174
- * Sign EIP712 typed data
1175
- */
1176
- signTypedData(userId: string, typedData: {
1177
- domain: {
1178
- name?: string;
1179
- version?: string;
1180
- chainId?: number;
1181
- verifyingContract?: string;
1182
- salt?: string;
1213
+ typeHex: viem.Hex | null;
1214
+ blockHash: `0x${string}`;
1215
+ blockNumber: bigint;
1216
+ transactionIndex: number;
1217
+ } | {
1218
+ input: viem.Hex;
1219
+ s: viem.Hex;
1220
+ from: viem.Address;
1221
+ gas: bigint;
1222
+ nonce: number;
1223
+ to: viem.Address | null;
1224
+ type: "eip2930";
1225
+ value: bigint;
1226
+ r: viem.Hex;
1227
+ v: bigint;
1228
+ yParity: number;
1229
+ blobVersionedHashes?: undefined;
1230
+ gasPrice: bigint;
1231
+ maxFeePerBlobGas?: undefined;
1232
+ maxFeePerGas?: undefined;
1233
+ maxPriorityFeePerGas?: undefined;
1234
+ chainId: number;
1235
+ accessList: viem.AccessList;
1236
+ authorizationList?: undefined;
1237
+ hash: Hash$1;
1238
+ typeHex: viem.Hex | null;
1239
+ blockHash: `0x${string}`;
1240
+ blockNumber: bigint;
1241
+ transactionIndex: number;
1242
+ } | {
1243
+ input: viem.Hex;
1244
+ s: viem.Hex;
1245
+ from: viem.Address;
1246
+ gas: bigint;
1247
+ nonce: number;
1248
+ to: viem.Address | null;
1249
+ type: "eip1559";
1250
+ value: bigint;
1251
+ r: viem.Hex;
1252
+ v: bigint;
1253
+ yParity: number;
1254
+ blobVersionedHashes?: undefined;
1255
+ gasPrice?: undefined;
1256
+ maxFeePerBlobGas?: undefined;
1257
+ maxFeePerGas: bigint;
1258
+ maxPriorityFeePerGas: bigint;
1259
+ chainId: number;
1260
+ accessList: viem.AccessList;
1261
+ authorizationList?: undefined;
1262
+ hash: Hash$1;
1263
+ typeHex: viem.Hex | null;
1264
+ blockHash: `0x${string}`;
1265
+ blockNumber: bigint;
1266
+ transactionIndex: number;
1267
+ } | {
1268
+ input: viem.Hex;
1269
+ s: viem.Hex;
1270
+ from: viem.Address;
1271
+ gas: bigint;
1272
+ nonce: number;
1273
+ to: viem.Address | null;
1274
+ type: "eip4844";
1275
+ value: bigint;
1276
+ r: viem.Hex;
1277
+ v: bigint;
1278
+ yParity: number;
1279
+ blobVersionedHashes: readonly viem.Hex[];
1280
+ gasPrice?: undefined;
1281
+ maxFeePerBlobGas: bigint;
1282
+ maxFeePerGas: bigint;
1283
+ maxPriorityFeePerGas: bigint;
1284
+ chainId: number;
1285
+ accessList: viem.AccessList;
1286
+ authorizationList?: undefined;
1287
+ hash: Hash$1;
1288
+ typeHex: viem.Hex | null;
1289
+ blockHash: `0x${string}`;
1290
+ blockNumber: bigint;
1291
+ transactionIndex: number;
1292
+ } | {
1293
+ input: viem.Hex;
1294
+ s: viem.Hex;
1295
+ from: viem.Address;
1296
+ gas: bigint;
1297
+ nonce: number;
1298
+ to: viem.Address | null;
1299
+ type: "eip7702";
1300
+ value: bigint;
1301
+ r: viem.Hex;
1302
+ v: bigint;
1303
+ yParity: number;
1304
+ blobVersionedHashes?: undefined;
1305
+ gasPrice?: undefined;
1306
+ maxFeePerBlobGas?: undefined;
1307
+ maxFeePerGas: bigint;
1308
+ maxPriorityFeePerGas: bigint;
1309
+ chainId: number;
1310
+ accessList: viem.AccessList;
1311
+ authorizationList: viem.SignedAuthorizationList;
1312
+ hash: Hash$1;
1313
+ typeHex: viem.Hex | null;
1314
+ blockHash: `0x${string}`;
1315
+ blockNumber: bigint;
1316
+ transactionIndex: number;
1183
1317
  };
1184
- types: Record<string, Array<{
1185
- name: string;
1186
- type: string;
1187
- }>>;
1188
- primaryType: string;
1189
- message: Record<string, any>;
1190
- }, digest32: Hex, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
1191
- /**
1192
- * Get user's wallet address
1193
- */
1194
- getAddress(userId: string): Promise<Address$1 | undefined>;
1195
- /**
1196
- * Check if user has a keyshare
1197
- */
1198
- checkKeyshare(userId: string): Promise<{
1199
- hasKeyshare: boolean;
1200
- address?: Address$1;
1201
- }>;
1202
- /**
1203
- * Open social auth popup (Telegram, Discord, Twitter, etc.)
1204
- */
1205
- openSocialAuthPopup(provider: string, config?: Record<string, any>): Promise<{
1206
- provider: string;
1207
- success: boolean;
1208
- user?: any;
1209
- mode?: 'login' | 'link';
1210
- error?: string;
1211
- }>;
1212
- /**
1213
- * Fallback verification for X OAuth cancellations.
1214
- * Attempts to detect if the backend session was still established.
1215
- */
1216
- private verifyXAuthSession;
1217
- /**
1218
- * Prime provider session/cache state to detect future changes.
1219
- */
1220
- private primeProviderSessions;
1221
- private getKnownSessionId;
1222
- private getKnownProviderConnection;
1223
- private recordProviderSession;
1224
- private recordProviderConnection;
1225
- private updateProviderTrackingFromUser;
1226
- private extractSessionId;
1227
- private getProvidersList;
1228
- /**
1229
- * Get trusted apps for user
1230
- */
1231
- getTrustedApps(userId: string): Promise<Array<{
1232
- userId: string;
1233
- projectId: string;
1234
- origin: string;
1235
- trustedAt: number;
1236
- }>>;
1237
- /**
1238
- * Remove app from trusted list
1239
- */
1240
- removeTrustedApp(userId: string, projectId: string, origin: string): Promise<boolean>;
1241
- /**
1242
- * Clear all authorizations for current project (for testing consent flow)
1243
- * This will force the consent modal to appear on next authentication
1244
- */
1245
- clearAuthorizations(): Promise<boolean>;
1246
- /**
1247
- * Create backup of keyshare
1248
- */
1249
- createBackup(userId: string, backupRequest: {
1250
- method: 'server' | 'cloud' | 'local';
1251
- password?: string;
1252
- cloudProvider?: string;
1253
- }, accessToken?: string): Promise<{
1254
- success: boolean;
1255
- method: string;
1256
- timestamp: number;
1257
- error?: string;
1258
- }>;
1259
- /**
1260
- * Restore keyshare from server backup
1261
- */
1262
- restoreFromServer(userId: string, password?: string, accessToken?: string): Promise<{
1263
- success: boolean;
1264
- timestamp: number;
1265
- error?: string;
1266
- data?: any;
1267
- }>;
1268
- /**
1269
- * Encrypt backup data without uploading (for cloud/local backups)
1270
- * Returns encrypted data that parent can upload/download
1271
- */
1272
- encryptBackupData(userId: string, password?: string): Promise<any>;
1273
- /**
1274
- * Restore keyshare from local file backup
1275
- */
1276
- restoreFromLocalFile(userId: string, fileContent: string, password?: string): Promise<{
1277
- success: boolean;
1278
- timestamp: number;
1279
- error?: string;
1280
- data?: any;
1318
+ receipt: viem.TransactionReceipt;
1281
1319
  }>;
1282
- /**
1283
- * Get backup status for user
1284
- */
1285
- getBackupStatus(userId: string): Promise<{
1286
- server: {
1287
- lastBackup?: number;
1288
- error?: string;
1289
- };
1290
- cloud: {
1291
- lastBackup?: number;
1292
- error?: string;
1293
- };
1294
- local: {
1295
- lastBackup?: number;
1296
- error?: string;
1297
- };
1320
+ };
1321
+
1322
+ interface LinkedProfileDisplay extends AuthProvider {
1323
+ displayName: string;
1324
+ icon?: React.ComponentType<{
1325
+ className?: string;
1298
1326
  }>;
1299
- /**
1300
- * Get available cloud providers
1301
- */
1302
- getCloudProviders(): Promise<Array<{
1303
- id: string;
1304
- name: string;
1305
- available: boolean;
1306
- }>>;
1307
- /**
1308
- * Cleanup and destroy iframe
1309
- */
1310
- destroy(): void;
1311
- /**
1312
- * Debug logging
1313
- */
1314
- private log;
1327
+ color?: string;
1315
1328
  }
1316
- /**
1317
- * Get or create iframe manager singleton
1318
- */
1319
- declare function getIframeManager(config?: IframeManagerConfig): IframeManager;
1320
- /**
1321
- * Destroy iframe manager singleton
1322
- */
1323
- declare function destroyIframeManager(): void;
1329
+ declare function useLumiaPassportLinkedProfiles(): {
1330
+ readonly profiles: LinkedProfileDisplay[];
1331
+ readonly avatar: string;
1332
+ readonly isLoading: boolean;
1333
+ readonly error: string;
1334
+ readonly refresh: () => Promise<void>;
1335
+ };
1324
1336
 
1325
- export { type AccountSession$1 as AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaSessionProvider, type LumiaSessionProviderProps, LumiaWagmiProvider, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type Theme, ThemeToggle, type TokenBalance, type Transaction$1 as Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, type WalletReadyStatus, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportConfig, useLumiaPassportLinkedProfiles, useLumiaPassportOpen, useLumiaPassportSession, useLumiaSession, useSendTransaction, useSmartAccountTransactions, useTheme, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
1337
+ export { type AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaWagmiProvider, PageKey, type PageOpenParams, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, type WalletReadyStatus, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportAccountSession, useLumiaPassportAddress, useLumiaPassportBalance, useLumiaPassportColorMode, useLumiaPassportConfig, useLumiaPassportError, useLumiaPassportHasServerVault, useLumiaPassportIFrameReady, useLumiaPassportLinkedProfiles, useLumiaPassportLoadingStatus, useLumiaPassportOpen, useLumiaPassportRecoveryUserId, useLumiaPassportSession, useSendTransaction, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };