@embarkai/ui-kit 0.4.16 → 0.4.18

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,3034 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React$1 from 'react';
3
+ import React__default, { ReactNode, MutableRefObject, FC, HTMLAttributes, ButtonHTMLAttributes } from 'react';
4
+ import { BlockscoutTokenBalance } from '@embarkai/core/clients';
5
+ import * as viem from 'viem';
6
+ import { Address as Address$1, Hex, PublicClient, Chain, Hash as Hash$1, TransactionReceipt } from 'viem';
7
+ import * as _tanstack_react_query from '@tanstack/react-query';
8
+ import * as zustand_middleware from 'zustand/middleware';
9
+ import * as zustand from 'zustand';
10
+ import { ChainConfig, createPublicClientForChain, createBundlerClientForChain, getChainConfig, getViemChain, lumiaTestnetChain, lumiaMainnetChain } from '@embarkai/core/read';
11
+ import { BundlerClient } from 'viem/account-abstraction';
12
+ import { UserOperationV07 } from '@embarkai/core/bundler';
13
+ import * as class_variance_authority_types from 'class-variance-authority/types';
14
+ import { VariantProps } from 'class-variance-authority';
15
+ import * as wagmi from 'wagmi';
16
+ export { JwtTokens, LoginResponse, VerifyResponse, getValidTokens, jwtTokenManager, logout } from '@embarkai/core/auth';
17
+
18
+ interface TokenBalance {
19
+ address: `0x${string}`;
20
+ name: string;
21
+ symbol: string;
22
+ decimals: number;
23
+ balance: string;
24
+ formattedBalance: string;
25
+ logo?: string;
26
+ }
27
+ /**
28
+ * Asset type classification
29
+ */
30
+ type AssetType = 'native' | 'erc20' | 'erc721' | 'erc1155' | 'erc3643';
31
+ /**
32
+ * NFT metadata from token instance
33
+ */
34
+ interface NFTMetadata {
35
+ /** NFT name from metadata */
36
+ name?: string;
37
+ /** NFT description */
38
+ description?: string;
39
+ /** Image URL (resolved from IPFS if needed) */
40
+ image?: string;
41
+ /** External URL for more info */
42
+ externalUrl?: string;
43
+ /** Collection name */
44
+ collectionName?: string;
45
+ /** Additional attributes */
46
+ attributes?: Array<{
47
+ trait_type: string;
48
+ value: string | number;
49
+ }>;
50
+ }
51
+ /**
52
+ * Compliance status for security tokens (ERC3643)
53
+ */
54
+ interface ComplianceStatus {
55
+ /** Whether the token is a security token (ERC3643) */
56
+ isSecurityToken: boolean;
57
+ /** Identity registry address */
58
+ identityRegistry?: `0x${string}`;
59
+ /** Whether current user is verified */
60
+ isVerified?: boolean;
61
+ /** Transfer restrictions message */
62
+ transferRestrictions?: string;
63
+ }
64
+ /**
65
+ * Error state for asset list
66
+ */
67
+ interface AssetListError {
68
+ /** Error type for categorization */
69
+ type: 'network' | 'api' | 'timeout' | 'unknown';
70
+ /** Human-readable error message */
71
+ message: string;
72
+ /** Whether the request can be retried */
73
+ retryable: boolean;
74
+ }
75
+ /**
76
+ * Represents a token or NFT asset
77
+ */
78
+ interface Asset {
79
+ /** Asset type classification */
80
+ type: AssetType;
81
+ /** Contract address (undefined for native token) */
82
+ address?: `0x${string}`;
83
+ /** Human-readable token name */
84
+ name: string;
85
+ /** Token symbol (e.g., "LUMIA", "USDC") */
86
+ symbol: string;
87
+ /** Raw balance as string (wei for fungible, count for NFT) */
88
+ balance: string;
89
+ /** Human-readable formatted balance */
90
+ formattedBalance: string;
91
+ /** Decimal precision (undefined for NFTs) */
92
+ decimals?: number;
93
+ /** USD rate reported by explorer when available */
94
+ exchangeRateUsd?: string;
95
+ /** NFT token ID (only for ERC721/ERC1155) */
96
+ tokenId?: string;
97
+ /** Token logo URL */
98
+ logo?: string;
99
+ /** NFT image URL (only for ERC721/ERC1155) */
100
+ image?: string;
101
+ /** NFT metadata (only for ERC721/ERC1155) */
102
+ nftMetadata?: NFTMetadata;
103
+ /** Security token compliance status (only for ERC3643) */
104
+ complianceStatus?: ComplianceStatus;
105
+ }
106
+ declare function useAssets(address?: `0x${string}`): {
107
+ nativeBalance: {
108
+ decimals: number;
109
+ formatted: string;
110
+ symbol: string;
111
+ value: bigint;
112
+ };
113
+ tokenBalances: any;
114
+ assets: Asset[];
115
+ getTokenBalance: (tokenAddress: `0x${string}`) => {
116
+ address: `0x${string}`;
117
+ name: string;
118
+ symbol: string;
119
+ decimals: number;
120
+ balance: string;
121
+ formattedBalance: string;
122
+ logo: string;
123
+ };
124
+ refreshBalances: () => Promise<void>;
125
+ isLoading: any;
126
+ isConnected: boolean;
127
+ };
128
+ declare function useTokenInfo(tokenAddress: `0x${string}`): {
129
+ isLoading: any;
130
+ tokenInfo: any;
131
+ } | {
132
+ isLoading: boolean;
133
+ tokenInfo: {
134
+ name: string;
135
+ symbol: string;
136
+ decimals: number;
137
+ address: `0x${string}`;
138
+ };
139
+ };
140
+ declare function useTokenBalance(tokenAddress: `0x${string}`, userAddress?: `0x${string}`): {
141
+ balance: bigint;
142
+ formattedBalance: string;
143
+ tokenInfo: any;
144
+ isLoading: boolean;
145
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<bigint, viem.ReadContractErrorType>>;
146
+ };
147
+
148
+ /** Default config can be overridden via Provider initialConfig */
149
+
150
+ declare global {
151
+ interface Window {
152
+ __EMBARK_SERVICES__?: Partial<{
153
+ tssUrl: string;
154
+ shareVaultUrl: string;
155
+ dashboardApiUrl: string;
156
+ tssRequireWasm: boolean;
157
+ tssWasmDebug: boolean;
158
+ }>;
159
+ __EMBARK_PROJECT_ID__?: string;
160
+ }
161
+ }
162
+ interface SocialProvider {
163
+ id: string;
164
+ name: string;
165
+ enabled: boolean;
166
+ icon: React__default.ComponentType<{
167
+ className?: string;
168
+ }>;
169
+ comingSoon?: boolean;
170
+ meta?: Record<string, any>;
171
+ }
172
+ interface ProjectAsset extends Omit<Asset, 'type'> {
173
+ type: 'project';
174
+ balanceQueryKey: string[];
175
+ balanceQuery: () => Promise<{
176
+ cryptoFormatted: number;
177
+ cryptoFiatRate: number;
178
+ cryptoSymbol: string;
179
+ fiatFormatted: number;
180
+ fiatSymbol: string;
181
+ }>;
182
+ hideInPortfolio?: boolean;
183
+ }
184
+ interface AssetRateQueryInput {
185
+ symbol: string;
186
+ address?: `0x${string}`;
187
+ }
188
+ interface AssetRateQueryResult {
189
+ symbol: string;
190
+ price: string;
191
+ }
192
+ /**
193
+ * Token configuration for custom token watching.
194
+ * Used when chain doesn't have Blockscout API or for project-specific tokens.
195
+ * SDK will fetch balances via RPC multicall.
196
+ */
197
+ interface WatchToken {
198
+ /** Contract address (required) */
199
+ address: `0x${string}`;
200
+ /** Token symbol for display (required) */
201
+ symbol: string;
202
+ /** Token name (optional, fetched from contract if missing) */
203
+ name?: string;
204
+ /** Token decimals (optional, fetched from contract if missing) */
205
+ decimals?: number;
206
+ /** Logo URL (optional) */
207
+ logo?: string;
208
+ }
209
+ type WalletMode = 'linked' | 'direct' | 'both';
210
+ interface ProviderConfig {
211
+ projectId: string;
212
+ passkey: {
213
+ enabled: boolean;
214
+ showCreateButton: boolean;
215
+ primaryButtonText: string;
216
+ };
217
+ email: {
218
+ enabled: boolean;
219
+ placeholder: string;
220
+ buttonText: string;
221
+ verificationTitle: string;
222
+ };
223
+ social: {
224
+ enabled: boolean;
225
+ providers: SocialProvider[];
226
+ };
227
+ wallet: {
228
+ enabled: boolean;
229
+ supportedChains?: number[];
230
+ requireSignature: boolean;
231
+ walletConnectProjectId?: string;
232
+ /** Operating mode: 'linked' = AA (current), 'direct' = external wallet signs, 'both' = user choice */
233
+ mode?: WalletMode;
234
+ /** Filter RainbowKit wallet list. undefined = show all wallets */
235
+ allowedWallets?: string[];
236
+ };
237
+ preferedColorMode?: 'light' | 'dark';
238
+ projectAssets?: {
239
+ assets: ProjectAsset[];
240
+ showBalanceAs?: ProjectAsset['symbol'];
241
+ };
242
+ /**
243
+ * Host-provided portfolio data overrides.
244
+ * If tokenBalancesQuery is provided, SDK uses it instead of Blockscout
245
+ * for ERC-20 portfolio balances and keeps the legacy Blockscout path as fallback.
246
+ */
247
+ portfolio?: {
248
+ tokenBalancesQuery?: (address: `0x${string}`) => Promise<BlockscoutTokenBalance[]>;
249
+ tokenBalancesQueryKey?: readonly unknown[];
250
+ assetRateQuery?: (input: AssetRateQueryInput) => Promise<AssetRateQueryResult | null>;
251
+ assetRateQueryKey?: readonly unknown[];
252
+ };
253
+ /**
254
+ * Custom tokens to monitor per chain.
255
+ * SDK will fetch balances via RPC multicall.
256
+ * Useful for chains without Blockscout API (BSC, Sepolia, Arbitrum, Base, etc.).
257
+ * Can also be used on Blockscout chains - tokens are merged with discovered ones.
258
+ *
259
+ * @example
260
+ * watchTokens: {
261
+ * 97: [ // BSC Testnet
262
+ * { address: '0x...', symbol: 'USDT', decimals: 18 },
263
+ * { address: '0x...', symbol: 'BUSD', decimals: 18, logo: 'https://...' },
264
+ * ],
265
+ * 11155111: [ // Sepolia
266
+ * { address: '0x...', symbol: 'LINK', decimals: 18 },
267
+ * ]
268
+ * }
269
+ */
270
+ watchTokens?: {
271
+ [chainId: number]: WatchToken[];
272
+ };
273
+ ui: {
274
+ title: string;
275
+ subtitle?: string;
276
+ useExternalIcons?: boolean;
277
+ dialogClassName?: string;
278
+ authOrder?: ('email' | 'social' | 'wallet')[];
279
+ };
280
+ network: {
281
+ name: string;
282
+ symbol: string;
283
+ /**
284
+ * Default chain ID for new users.
285
+ * Priority: User's explicit selection > dApp config chainId > SDK default (Testnet).
286
+ * If user manually switches chains, their choice is preserved in localStorage.
287
+ */
288
+ chainId: number;
289
+ rpcUrl: string;
290
+ explorerUrl?: string;
291
+ testnet?: boolean;
292
+ forceChain?: boolean;
293
+ };
294
+ services: {
295
+ tssUrl: string;
296
+ shareVaultUrl: string;
297
+ dashboardApiUrl?: string;
298
+ iframeUrl?: string;
299
+ tssRequireWasm?: boolean;
300
+ tssWasmDebug?: boolean;
301
+ };
302
+ features: {
303
+ mpcSecurity: boolean;
304
+ strictMode: boolean;
305
+ requestDeduplication: boolean;
306
+ kycNeeded?: boolean;
307
+ displayNameNeeded?: boolean;
308
+ showActiveBalanceAsFiat?: boolean;
309
+ };
310
+ warnings: {
311
+ backupWarning: boolean;
312
+ emailNotConnectedWarning: boolean;
313
+ };
314
+ kyc?: {
315
+ provider?: 'sumsub' | 'uaepass' | 'custom';
316
+ options?: Record<string, any>;
317
+ };
318
+ /** language -> project namespace -> resource map */
319
+ translations?: Record<string, Record<string, unknown>>;
320
+ }
321
+
322
+ interface WalletReadyStatus$1 {
323
+ ready: boolean;
324
+ userId?: string;
325
+ address?: `0x${string}`;
326
+ hasKeyshare: boolean;
327
+ hasSession: boolean;
328
+ timestamp: number;
329
+ }
330
+ interface CallbacksConfig {
331
+ onConnecting?: (payload: {
332
+ method: 'passkey' | 'email' | 'social' | 'wallet';
333
+ provider?: string;
334
+ }) => void;
335
+ onConnect?: (payload: {
336
+ address: `0x${string}`;
337
+ session: any;
338
+ }) => void;
339
+ onAccount?: (payload: {
340
+ userId?: string | null;
341
+ address?: `0x${string}` | null;
342
+ session?: any;
343
+ hasKeyshare?: boolean;
344
+ }) => void;
345
+ onAccountUpdate?: (payload: {
346
+ providers?: Array<any>;
347
+ }) => void;
348
+ onDisconnect?: (payload: {
349
+ address?: `0x${string}` | null;
350
+ userId?: string | null;
351
+ }) => void;
352
+ onError?: (payload: {
353
+ error: Error;
354
+ code?: string;
355
+ message: string;
356
+ }) => void;
357
+ onChainChange?: (payload: {
358
+ chainId: number;
359
+ previousChainId: number;
360
+ }) => void;
361
+ onWalletReady?: (status: WalletReadyStatus$1) => void;
362
+ }
363
+ interface UIContextType {
364
+ config: MutableRefObject<ProviderConfig>;
365
+ updateConfig: (updates: Partial<ProviderConfig>) => void;
366
+ /**
367
+ * Legacy snapshot of callbacks from provider props.
368
+ * This field is not reactive and may become stale after calling updateCallbacks().
369
+ * Use callbacksRef to read the current callbacks.
370
+ * @deprecated
371
+ */
372
+ callbacks?: CallbacksConfig;
373
+ callbacksRef: MutableRefObject<CallbacksConfig | undefined>;
374
+ updateCallbacks: (updates: Partial<CallbacksConfig> | null) => void;
375
+ }
376
+ interface ProviderProps {
377
+ children: ReactNode;
378
+ projectId?: string;
379
+ initialConfig?: Partial<ProviderConfig>;
380
+ callbacks?: CallbacksConfig;
381
+ }
382
+ /** NEVER EVER declare here any state (useState or whatever). This Provider should NEVER trigger self of child-app re-renders */
383
+ declare function Provider(props: ProviderProps): react_jsx_runtime.JSX.Element;
384
+ declare const useProviderConfig: () => UIContextType;
385
+
386
+ interface ConnectWalletButtonProps {
387
+ /** Button Component to render as unsigned button instance */
388
+ ConnectButton?: FC<HTMLAttributes<HTMLButtonElement>>;
389
+ className?: string;
390
+ label?: string;
391
+ usePaymaster?: boolean;
392
+ }
393
+ declare function ConnectWalletButton(props: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
394
+
395
+ /**
396
+ * Account session containing wallet and smart account information.
397
+ * Shared across multiple modules (session, user-operations, signing, deployment).
398
+ */
399
+ interface AccountSession$1 {
400
+ ownerAddress: `0x${string}`;
401
+ smartAccountAddress: `0x${string}`;
402
+ factoryAddress: `0x${string}`;
403
+ ownerPrivateKey?: `0x${string}`;
404
+ mpcUserId?: string;
405
+ usePaymaster?: boolean;
406
+ kind: 'lumia';
407
+ address: `0x${string}`;
408
+ }
409
+
410
+ /**
411
+ * Deploy smart account contract if not already deployed.
412
+ *
413
+ * This sends a minimal UserOperation (to 0x0, value 0, data 0x) which triggers
414
+ * account deployment via factory without requiring user consent.
415
+ *
416
+ * By default, checks if account is already deployed to avoid unnecessary gas costs.
417
+ * If already deployed, returns null without sending a transaction.
418
+ *
419
+ * @param session - Account session with signing credentials
420
+ * @param feeType - Fee type: 'economy', 'standard', or 'fast' (default: 'economy')
421
+ * @param options - Deployment options
422
+ * @param options.force - If true, sends transaction even if already deployed (default: false)
423
+ * @param options.chainId - Chain ID
424
+ * @returns UserOperation hash if deployed, null if already deployed (when force=false)
425
+ *
426
+ * @example
427
+ * ```typescript
428
+ * // Deploy account immediately after DKG (skips if already deployed)
429
+ * const userOpHash = await deployAccount(session, 'economy');
430
+ * if (userOpHash) {
431
+ * console.log('Account deployed:', userOpHash);
432
+ * } else {
433
+ * console.log('Account already deployed');
434
+ * }
435
+ *
436
+ * // Force deployment even if already deployed (not recommended)
437
+ * const hash = await deployAccount(session, 'economy', { force: true });
438
+ * ```
439
+ */
440
+ declare function deployAccount(session: AccountSession$1, feeType?: 'economy' | 'standard' | 'fast', options?: {
441
+ force?: boolean;
442
+ chainId?: number;
443
+ }): Promise<`0x${string}` | null>;
444
+
445
+ interface SmartAccountEntry {
446
+ chainId: number;
447
+ address: string;
448
+ factoryAddress?: string;
449
+ registeredAt: string;
450
+ }
451
+ interface RegisterSmartAccountResult {
452
+ success: boolean;
453
+ chainId: number;
454
+ smartAccountAddress: string;
455
+ alreadySet: boolean;
456
+ }
457
+ /**
458
+ * Get all registered Smart Accounts across all chains.
459
+ *
460
+ * @returns List of Smart Account entries with chain IDs
461
+ */
462
+ declare function getAllSmartAccounts(): Promise<SmartAccountEntry[]>;
463
+ /**
464
+ * Get Smart Account for a specific chain.
465
+ *
466
+ * @param chainId - The chain ID to get Smart Account for
467
+ * @returns Smart Account entry or null if not registered
468
+ */
469
+ declare function getSmartAccountForChain(chainId: number): Promise<SmartAccountEntry | null>;
470
+
471
+ interface AccountSession {
472
+ ownerAddress: `0x${string}`;
473
+ smartAccountAddress: `0x${string}`;
474
+ factoryAddress: `0x${string}`;
475
+ ownerPrivateKey?: `0x${string}`;
476
+ mpcUserId?: string;
477
+ usePaymaster?: boolean;
478
+ kind: 'lumia';
479
+ address: `0x${string}`;
480
+ }
481
+ /**
482
+ * Parameters for preparing a UserOperation
483
+ */
484
+ interface PrepareUserOperationParams {
485
+ /** Target address for the transaction */
486
+ to: `0x${string}`;
487
+ /** Amount in wei to send (as string) */
488
+ value: string;
489
+ /** Call data for the transaction (optional, defaults to '0x') */
490
+ data?: `0x${string}`;
491
+ /** Fee tier: 'economy', 'standard' (default), or 'fast' */
492
+ feeType?: 'economy' | 'standard' | 'fast';
493
+ /** Chain ID (optional - uses activeChainId from store if not provided) */
494
+ chainId?: number;
495
+ }
496
+ /**
497
+ * Prepare and sign a UserOperation without sending it to the bundler.
498
+ * Returns the signed UserOp and its hash for backend verification and submission.
499
+ * Uses object-based parameters with multi-chain support.
500
+ *
501
+ * @param session - Account session with signing credentials
502
+ * @param params - Transaction parameters (to, value, data, feeType, chainId)
503
+ * @returns Object with signed UserOperation and its hash
504
+ *
505
+ * @example
506
+ * ```typescript
507
+ * const { userOp, userOpHash } = await prepareUserOperation(session, {
508
+ * to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
509
+ * value: '1000000000000000000',
510
+ * data: '0x',
511
+ * feeType: 'standard'
512
+ * });
513
+ * ```
514
+ */
515
+ declare function prepareUserOperation(session: AccountSession, params: PrepareUserOperationParams): Promise<{
516
+ userOp: UserOperationV07;
517
+ userOpHash: `0x${string}`;
518
+ }>;
519
+ /**
520
+ * EIP712 Domain descriptor
521
+ */
522
+ interface TypedDataDomain {
523
+ name?: string;
524
+ version?: string;
525
+ chainId?: number;
526
+ verifyingContract?: `0x${string}`;
527
+ salt?: `0x${string}`;
528
+ }
529
+ /**
530
+ * EIP712 Type definition
531
+ */
532
+ interface TypedDataField {
533
+ name: string;
534
+ type: string;
535
+ }
536
+ /**
537
+ * Parameters for signing typed data (EIP712)
538
+ */
539
+ /**
540
+ * Parameters for sending or preparing a UserOperation (UI-Kit layer)
541
+ * Higher-level API compared to core/bundler UserOperationParams
542
+ */
543
+ interface SendUserOperationParams {
544
+ /** Target address for the transaction */
545
+ to: `0x${string}`;
546
+ /** Amount in wei to send (as string) */
547
+ value: string;
548
+ /** Call data for the transaction (optional, defaults to '0x') */
549
+ data?: `0x${string}`;
550
+ /** Fee tier: 'economy', 'standard' (default), or 'fast' */
551
+ feeType?: 'economy' | 'standard' | 'fast';
552
+ /** Chain ID (optional - uses activeChainId from store if not provided) */
553
+ chainId?: number;
554
+ }
555
+ /**
556
+ * Send a user operation with multi-chain support.
557
+ * Uses object-based parameters for better developer experience.
558
+ *
559
+ * @param session - Account session with signing credentials
560
+ * @param params - Transaction parameters (to, value, data, feeType, chainId)
561
+ * @returns Promise resolving to the user operation hash
562
+ *
563
+ * @example
564
+ * ```typescript
565
+ * const hash = await sendUserOperation(session, {
566
+ * to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
567
+ * value: '1000000000000000000', // 1 ETH in wei
568
+ * data: '0x',
569
+ * feeType: 'standard'
570
+ * });
571
+ * ```
572
+ */
573
+ declare function sendUserOperation(session: AccountSession, params: SendUserOperationParams): Promise<`0x${string}`>;
574
+ /**
575
+ * Parameters for EIP-712 typed data signing
576
+ */
577
+ interface SignTypedDataParams {
578
+ domain: TypedDataDomain;
579
+ types: Record<string, TypedDataField[]>;
580
+ primaryType: string;
581
+ message: Record<string, any>;
582
+ /** Chain ID (optional - overrides domain.chainId if provided) */
583
+ chainId?: number;
584
+ }
585
+ /**
586
+ * Sign typed data according to EIP712 standard.
587
+ * This method computes the EIP712 hash and signs it using MPC.
588
+ *
589
+ * @param session - Account session with signing credentials
590
+ * @param params - EIP712 typed data parameters (domain, types, primaryType, message)
591
+ * @returns Hex-encoded signature
592
+ *
593
+ * @example
594
+ * ```typescript
595
+ * const signature = await signTypedData(session, {
596
+ * domain: {
597
+ * name: 'MyApp',
598
+ * version: '1',
599
+ * chainId: 994,
600
+ * verifyingContract: '0x...'
601
+ * },
602
+ * types: {
603
+ * Order: [
604
+ * { name: 'tokenIds', type: 'uint256[]' },
605
+ * { name: 'price', type: 'uint256' },
606
+ * { name: 'deadline', type: 'uint256' }
607
+ * ]
608
+ * },
609
+ * primaryType: 'Order',
610
+ * message: {
611
+ * tokenIds: [1n, 2n, 3n],
612
+ * price: 1000000000000000000n,
613
+ * deadline: 1735689600n
614
+ * }
615
+ * });
616
+ * ```
617
+ */
618
+ declare function signTypedData(session: AccountSession, params: SignTypedDataParams): Promise<`0x${string}`>;
619
+
620
+ /**
621
+ * Iframe Manager for Parent SDK
622
+ *
623
+ * Manages secure communication with the isolated iframe wallet at auth.lumiapassport.com
624
+ * Implements postMessage protocol with HMAC authentication and replay protection
625
+ */
626
+
627
+ interface Transaction$1 {
628
+ to: Address$1;
629
+ value: string;
630
+ data?: Hex;
631
+ gasLimit?: string;
632
+ }
633
+ interface IframeManagerConfig {
634
+ iframeUrl: string;
635
+ projectId: string;
636
+ debug?: boolean;
637
+ onWalletReady?: (status: WalletReadyStatus) => void;
638
+ }
639
+ interface WalletReadyStatus {
640
+ ready: boolean;
641
+ userId?: string;
642
+ address?: `0x${string}`;
643
+ hasKeyshare: boolean;
644
+ hasSession: boolean;
645
+ timestamp: number;
646
+ }
647
+ declare class IframeManager {
648
+ private iframe;
649
+ private iframeUrl;
650
+ private projectId;
651
+ private debug;
652
+ private channelToken;
653
+ private isReady;
654
+ private readyPromise;
655
+ private readyResolve;
656
+ private initPromise;
657
+ private onWalletReadyCallback?;
658
+ private pendingRequests;
659
+ private usedNonces;
660
+ private messageListener;
661
+ private hiddenElements;
662
+ private pointerGuardCleanup;
663
+ private iframeHideTimeout;
664
+ private iframeActive;
665
+ private providerSessions;
666
+ private providerConnections;
667
+ private readonly REQUEST_TIMEOUT;
668
+ private readonly NONCE_EXPIRY;
669
+ private readonly HEARTBEAT_INTERVAL;
670
+ private heartbeatInterval?;
671
+ private isReconnecting;
672
+ private sseListeners;
673
+ constructor(config: IframeManagerConfig);
674
+ setDebug(debug: boolean): void;
675
+ /**
676
+ * Initialize iframe and wait for it to be ready
677
+ */
678
+ initialize(): Promise<void>;
679
+ private doInitialize;
680
+ /**
681
+ * Set the onWalletReady callback
682
+ */
683
+ setOnWalletReady(callback: (status: WalletReadyStatus) => void): void;
684
+ /**
685
+ * Authenticate SDK with iframe to establish secure channel
686
+ */
687
+ private authenticateSDK;
688
+ /**
689
+ * Start periodic heartbeat to check SDK channel validity
690
+ */
691
+ private startHeartbeat;
692
+ /**
693
+ * Stop heartbeat
694
+ */
695
+ private stopHeartbeat;
696
+ /**
697
+ * Reconnect SDK channel after it becomes invalid
698
+ */
699
+ reconnect(): Promise<void>;
700
+ /**
701
+ * Setup visibility change handler to check channel when tab becomes visible
702
+ */
703
+ private setupVisibilityHandler;
704
+ /**
705
+ * Normalize legacy message types from cached iframe versions.
706
+ * Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
707
+ * This ensures both work until all browser caches expire.
708
+ */
709
+ private normalizeMessageType;
710
+ /**
711
+ * Handle incoming postMessage events
712
+ */
713
+ private handleMessage;
714
+ /**
715
+ * Handle token refresh request from iframe
716
+ */
717
+ private handleTokenRefreshRequest;
718
+ /**
719
+ * Send secure message to iframe
720
+ */
721
+ sendMessage(type: string, data: Record<string, any>): Promise<any>;
722
+ onSseEvent(listener: (data: any) => void): () => void;
723
+ /**
724
+ * Compute HMAC for message authentication using SDK channel token
725
+ */
726
+ private computeHMAC;
727
+ /**
728
+ * Generate unique message ID
729
+ */
730
+ private generateMessageId;
731
+ /**
732
+ * Generate nonce for replay protection
733
+ */
734
+ private generateNonce;
735
+ /**
736
+ * Show iframe (for consent/confirmation UI)
737
+ */
738
+ showIframe(): void;
739
+ /**
740
+ * Hide iframe
741
+ */
742
+ hideIframe(): void;
743
+ /**
744
+ * Hide all Radix Dialog modals (SendModal, etc.)
745
+ */
746
+ private hideAllDialogs;
747
+ /**
748
+ * Restore all previously hidden Radix Dialog modals
749
+ */
750
+ private restoreAllDialogs;
751
+ /**
752
+ * Stop Radix dismissable layers from swallowing the first click on the iframe.
753
+ * Radix attaches pointer event guards at the document level; we intercept at window
754
+ * capture phase so user clicks flow straight into the consent iframe.
755
+ */
756
+ private enablePointerEventGuards;
757
+ /**
758
+ * Remove pointer interception once iframe is hidden again.
759
+ */
760
+ private disablePointerEventGuards;
761
+ /**
762
+ * Authenticate user with application
763
+ */
764
+ authenticate(userId: string, avatar?: string | null, displayName?: string | null): Promise<{
765
+ userId: string;
766
+ address: Address$1 | undefined;
767
+ }>;
768
+ /**
769
+ * Start DKG (Distributed Key Generation)
770
+ */
771
+ startDKG(userId: string, accessToken?: string): Promise<Address$1>;
772
+ /**
773
+ * Sign transaction
774
+ */
775
+ signTransaction(userId: string, transaction: Transaction$1, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
776
+ /**
777
+ * Sign EIP712 typed data
778
+ */
779
+ signTypedData(userId: string, typedData: {
780
+ domain: {
781
+ name?: string;
782
+ version?: string;
783
+ chainId?: number;
784
+ verifyingContract?: string;
785
+ salt?: string;
786
+ };
787
+ types: Record<string, Array<{
788
+ name: string;
789
+ type: string;
790
+ }>>;
791
+ primaryType: string;
792
+ message: Record<string, any>;
793
+ }, digest32: Hex, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
794
+ /**
795
+ * Get user's wallet address
796
+ */
797
+ getAddress(userId: string): Promise<Address$1 | undefined>;
798
+ /**
799
+ * Check if user has a keyshare
800
+ */
801
+ checkKeyshare(userId: string): Promise<{
802
+ hasKeyshare: boolean;
803
+ address?: Address$1;
804
+ }>;
805
+ /**
806
+ * Open social auth popup (Telegram, Discord, Twitter, etc.)
807
+ */
808
+ openSocialAuthPopup(provider: string, config?: Record<string, any>): Promise<{
809
+ provider: string;
810
+ success: boolean;
811
+ user?: any;
812
+ mode?: 'login' | 'link';
813
+ error?: string;
814
+ }>;
815
+ /**
816
+ * Verify current auth session with the backend.
817
+ * Can optionally track session state for a specific provider.
818
+ * @param options.silent - If true, suppress logging
819
+ * @param options.provider - Optional provider key to track session state for (e.g., 'x', 'telegram')
820
+ */
821
+ private verifyAuthSession;
822
+ /**
823
+ * Prime provider session/cache state to detect future changes.
824
+ */
825
+ private primeProviderSessions;
826
+ private getKnownSessionId;
827
+ private getKnownProviderConnection;
828
+ private recordProviderSession;
829
+ private recordProviderConnection;
830
+ private updateProviderTrackingFromUser;
831
+ private extractSessionId;
832
+ private getProvidersList;
833
+ /**
834
+ * Get trusted apps for user
835
+ */
836
+ getTrustedApps(userId: string): Promise<{
837
+ userId: string;
838
+ projectId: string;
839
+ origin: string;
840
+ trustedAt: number;
841
+ appName?: string;
842
+ appLogo?: string;
843
+ }[]>;
844
+ /**
845
+ * Remove app from trusted list
846
+ */
847
+ removeTrustedApp(userId: string, projectId: string, origin: string): Promise<boolean>;
848
+ /**
849
+ * Clear all authorizations for current project (for testing consent flow)
850
+ * This will force the consent modal to appear on next authentication
851
+ */
852
+ clearAuthorizations(): Promise<boolean>;
853
+ /**
854
+ * Create backup of keyshare
855
+ */
856
+ createBackup(userId: string, backupRequest: {
857
+ method: 'server' | 'cloud' | 'local';
858
+ password?: string;
859
+ cloudProvider?: string;
860
+ }, accessToken?: string): Promise<{
861
+ success: boolean;
862
+ method: string;
863
+ timestamp: number;
864
+ error?: string;
865
+ }>;
866
+ /**
867
+ * Restore keyshare from server backup
868
+ */
869
+ restoreFromServer(userId: string, password?: string, accessToken?: string): Promise<{
870
+ success: boolean;
871
+ timestamp: number;
872
+ error?: string;
873
+ data?: any;
874
+ }>;
875
+ /**
876
+ * Encrypt backup data without uploading (for cloud/local backups)
877
+ * Returns encrypted data that parent can upload/download
878
+ */
879
+ encryptBackupData(userId: string, password?: string): Promise<any>;
880
+ /**
881
+ * Encrypt current keyshare as EnvelopeEncryptedShare (for Guardian backup)
882
+ */
883
+ encryptEnvelopeData(userId: string, password: string): Promise<string>;
884
+ /**
885
+ * Decrypt EnvelopeEncryptedShare and restore keyshare (for Guardian restore)
886
+ */
887
+ decryptAndRestoreEnvelope(userId: string, envelopeJson: string, password: string): Promise<{
888
+ success: boolean;
889
+ timestamp: number;
890
+ error?: string;
891
+ }>;
892
+ /**
893
+ * Restore keyshare from local file backup
894
+ */
895
+ restoreFromLocalFile(userId: string, fileContent: string, password?: string): Promise<{
896
+ success: boolean;
897
+ timestamp: number;
898
+ error?: string;
899
+ data?: any;
900
+ }>;
901
+ /**
902
+ * Get backup status for user
903
+ */
904
+ getBackupStatus(userId: string): Promise<{
905
+ server: {
906
+ lastBackup?: number;
907
+ error?: string;
908
+ };
909
+ cloud: {
910
+ lastBackup?: number;
911
+ error?: string;
912
+ };
913
+ local: {
914
+ lastBackup?: number;
915
+ error?: string;
916
+ };
917
+ }>;
918
+ /**
919
+ * Get available cloud providers
920
+ */
921
+ getCloudProviders(): Promise<Array<{
922
+ id: string;
923
+ name: string;
924
+ available: boolean;
925
+ }>>;
926
+ /**
927
+ * Cleanup and destroy iframe
928
+ */
929
+ destroy(): void;
930
+ /**
931
+ * Debug logging
932
+ */
933
+ private log;
934
+ }
935
+ /**
936
+ * Get or create iframe manager singleton
937
+ */
938
+ declare function getIframeManager(config?: IframeManagerConfig): IframeManager;
939
+ /**
940
+ * Destroy iframe manager singleton
941
+ */
942
+ declare function destroyIframeManager(): void;
943
+
944
+ interface ChainParams {
945
+ activeChainId: number;
946
+ publicClient: ReturnType<typeof createPublicClientForChain>;
947
+ bundlerClient: ReturnType<typeof createBundlerClientForChain>;
948
+ chainConfig: ReturnType<typeof getChainConfig>;
949
+ viemChain: ReturnType<typeof getViemChain>;
950
+ }
951
+ interface SessionState {
952
+ session: AccountSession | null;
953
+ address: `0x${string}` | null;
954
+ status: string;
955
+ error: string | null;
956
+ recoveryUserId: string | null;
957
+ isIframeReady: boolean;
958
+ usePaymaster: boolean;
959
+ hasServerVault: boolean;
960
+ isLoading: boolean;
961
+ activeChainId: number | null;
962
+ publicClient: PublicClient | null;
963
+ bundlerClient: BundlerClient | null;
964
+ chainConfig: ChainConfig | null;
965
+ viemChain: Chain | null;
966
+ /** Tracks if user explicitly selected a chain (vs using dApp config default) */
967
+ walletReadyStatus: WalletReadyStatus | null;
968
+ /** Whether zustand persist has finished hydrating from localStorage */
969
+ hasHydrated: boolean;
970
+ setUsePaymaster: (usePaymaster: boolean) => void;
971
+ setIsIframeReady: (ready: boolean) => void;
972
+ setSession: (s: AccountSession | null) => void;
973
+ setAddress: (a: `0x${string}` | null) => void;
974
+ setStatus: (s: string) => void;
975
+ setError: (e: string | null) => void;
976
+ setRecoveryUserId: (userId: string | null) => void;
977
+ setHasServerVault: (hasServerVault: boolean) => void;
978
+ setIsLoading: (isLoading: boolean) => void;
979
+ setWalletReadyStatus: (status: WalletReadyStatus) => void;
980
+ setActiveChainId: (activeChainId: number | null) => void;
981
+ setActiveChain: (chainParams: ChainParams) => void;
982
+ }
983
+ /**
984
+ * @function useSession is UNLIKELY to use outside EmbarkAI, as it is INTERNAL zustand session store!
985
+ * Use it with caution, using zustand callback extraction. EX: const address = useSession((st) => st.address)
986
+ * @description refactor your app to NOT use this directly in your application, use set of new dedicated session hooks: useAccountSession, useAddress, etc.
987
+ */
988
+ declare const useSession: zustand.UseBoundStore<Omit<zustand.StoreApi<SessionState>, "setState" | "persist"> & {
989
+ setState(partial: SessionState | Partial<SessionState> | ((state: SessionState) => SessionState | Partial<SessionState>), replace?: false): unknown;
990
+ setState(state: SessionState | ((state: SessionState) => SessionState), replace: true): unknown;
991
+ persist: {
992
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<SessionState, {
993
+ activeChainId: number;
994
+ }, unknown>>) => void;
995
+ clearStorage: () => void;
996
+ rehydrate: () => Promise<void> | void;
997
+ hasHydrated: () => boolean;
998
+ onHydrate: (fn: (state: SessionState) => void) => () => void;
999
+ onFinishHydration: (fn: (state: SessionState) => void) => () => void;
1000
+ getOptions: () => Partial<zustand_middleware.PersistOptions<SessionState, {
1001
+ activeChainId: number;
1002
+ }, unknown>>;
1003
+ };
1004
+ }>;
1005
+ /**
1006
+ * Wait for zustand persist hydration to complete.
1007
+ * Use in async functions to ensure activeChainId and other persisted state is available.
1008
+ */
1009
+ declare function waitForStoreHydration(): Promise<void>;
1010
+ /**
1011
+ * Require active chain ID from session store (for non-React usage)
1012
+ * Throws an error if the chain ID is not yet set (e.g., before store hydration)
1013
+ *
1014
+ * @returns Current active chain ID
1015
+ * @throws Error if activeChainId is null (store not hydrated yet)
1016
+ *
1017
+ * @example
1018
+ * ```typescript
1019
+ * import { requireActiveChainId } from '@embarkai/ui-kit'
1020
+ *
1021
+ * // In non-React code (e.g., sendUserOperation)
1022
+ * const chainId = requireActiveChainId()
1023
+ * const client = createPublicClientForChain(chainId)
1024
+ * ```
1025
+ */
1026
+ declare const requireActiveChainId: () => number;
1027
+
1028
+ declare const useIsMobileView: () => boolean;
1029
+ declare const useBalance: () => {
1030
+ walletBalance: {
1031
+ decimals: number;
1032
+ formatted: string;
1033
+ symbol: string;
1034
+ value: bigint;
1035
+ };
1036
+ fiatBalance: number;
1037
+ cryptoRate: number;
1038
+ fiatSymbol: string;
1039
+ cryptoSymbol: string;
1040
+ };
1041
+ declare const useIFrameReady: () => boolean;
1042
+ declare const useAccountSession: () => AccountSession;
1043
+ declare const useAddress: () => `0x${string}`;
1044
+ declare const useError: () => string;
1045
+ declare const useLoadingStatus: () => {
1046
+ isSessionLoading: boolean;
1047
+ sessionStatus: string;
1048
+ };
1049
+ declare const useRecoveryUserId: () => string;
1050
+ declare const useHasServerVault: () => boolean;
1051
+ declare const useActiveChainId: () => number;
1052
+ declare const useHydrated: () => boolean;
1053
+
1054
+ declare enum PageKey {
1055
+ AUTH = "auth",
1056
+ LANGUAGES = "languages",
1057
+ TERMS_OF_SERVICE = "terms-of-service",
1058
+ MAIN_MENU = "main-menu",
1059
+ SETTINGS = "settings",
1060
+ SEND = "send",
1061
+ RECEIVE = "receive",
1062
+ BUY = "buy",
1063
+ KYC = "kyc",
1064
+ TRANSACTIONS = "transactions",
1065
+ ASSETS = "assets",
1066
+ MANAGE_WALLET = "manage-wallet",
1067
+ UNLINK_PROVIDER = "unlink-provider",
1068
+ SECURITY = "security",
1069
+ KEYSARE_BACKUP = "keysare-backup",
1070
+ KEYSHARE_RESTORE = "keyshare-restore",
1071
+ CHAIN = "chain",
1072
+ CHAIN_SWITCH_REQUEST = "chain-switch-request",
1073
+ NICKNAME_SETTINGS = "nickname-settings",
1074
+ DEVICES = "devices",
1075
+ DEVICE_LINK = "device-link",
1076
+ DEVICE_MANAGE = "device-manage",
1077
+ DEVICE_RESTORE = "device-restore"
1078
+ }
1079
+ /** WIP: need to develop page options typeset, i.e options: AuthOpenOptions | BuyOpenOption etc */
1080
+ interface PageOpenParams {
1081
+ key: PageKey;
1082
+ [option: string]: unknown;
1083
+ }
1084
+
1085
+ /**
1086
+ * Hook to programmatically open the dialogs
1087
+ * @example
1088
+ * ```tsx
1089
+ * function MyComponent() {
1090
+ * const { isOpen, open, close } = useOpenPage();
1091
+ *
1092
+ * return (
1093
+ * <button onClick={() => open(PageKey.BUY, { amount: 10 })}>
1094
+ * Buy CRYPTO
1095
+ * </button>
1096
+ * );
1097
+ * }
1098
+ * ```
1099
+ */
1100
+ declare function useOpenPage(): {
1101
+ readonly open: (passportPage: PageKey, params?: PageOpenParams) => void;
1102
+ readonly close: () => void;
1103
+ readonly isOpen: boolean;
1104
+ };
1105
+
1106
+ type ColorMode = 'light' | 'dark';
1107
+
1108
+ declare function useColorMode(): {
1109
+ colorMode: ColorMode;
1110
+ setColorMode: (mode: ColorMode) => void;
1111
+ };
1112
+
1113
+ declare const buttonVariants: (props?: {
1114
+ variant?: "default" | "outline" | "ghost";
1115
+ size?: "small" | "large" | "medium" | "icon";
1116
+ } & class_variance_authority_types.ClassProp) => string;
1117
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
1118
+ asChild?: boolean;
1119
+ }
1120
+
1121
+ /** EmbarkAI Color Mode Switcher */
1122
+ declare function ThemeToggle(props: ButtonProps): react_jsx_runtime.JSX.Element;
1123
+
1124
+ /** EmbarkAI Language Switcher */
1125
+ declare function LangToggle(props: ButtonProps): react_jsx_runtime.JSX.Element;
1126
+
1127
+ type ChainLike$2 = {
1128
+ id: number;
1129
+ blockExplorers?: {
1130
+ default?: {
1131
+ url: string;
1132
+ };
1133
+ };
1134
+ };
1135
+ type UserOpStatusProps = {
1136
+ userOpHash: `0x${string}` | string;
1137
+ chain?: ChainLike$2;
1138
+ chainId?: number;
1139
+ className?: string;
1140
+ pollMs?: number;
1141
+ maxPollTimeMs?: number;
1142
+ externalState?: {
1143
+ receipt?: any | null;
1144
+ mempool?: any | null;
1145
+ error?: string | null;
1146
+ isPolling?: boolean;
1147
+ };
1148
+ };
1149
+ declare const UserOpStatus: React$1.FC<UserOpStatusProps>;
1150
+
1151
+ type ChainLike$1 = {
1152
+ id: number;
1153
+ blockExplorers?: {
1154
+ default?: {
1155
+ url: string;
1156
+ };
1157
+ };
1158
+ };
1159
+ type HashProps = {
1160
+ hash?: `0x${string}` | string | null;
1161
+ chain?: ChainLike$1;
1162
+ className?: string;
1163
+ truncate?: boolean;
1164
+ showCopy?: boolean;
1165
+ showExplorer?: boolean;
1166
+ kind?: 'tx' | 'address' | 'block';
1167
+ label?: string;
1168
+ };
1169
+ declare const Hash: React$1.FC<HashProps>;
1170
+
1171
+ type ChainLike = {
1172
+ id: number;
1173
+ blockExplorers?: {
1174
+ default?: {
1175
+ url: string;
1176
+ };
1177
+ };
1178
+ };
1179
+ type AddressProps = {
1180
+ address?: `0x${string}` | string | null;
1181
+ chain?: ChainLike;
1182
+ className?: string;
1183
+ truncate?: boolean;
1184
+ showCopy?: boolean;
1185
+ showExplorer?: boolean;
1186
+ label?: string;
1187
+ };
1188
+ declare const Address: React$1.FC<AddressProps>;
1189
+
1190
+ interface TransactionsListProps {
1191
+ address: string;
1192
+ itemsCount?: number;
1193
+ }
1194
+ declare const TransactionsList: React__default.FC<TransactionsListProps>;
1195
+
1196
+ declare function KeyshareBackupMenu(): react_jsx_runtime.JSX.Element;
1197
+
1198
+ interface RecoveryStatsDeviceEntry {
1199
+ deviceId: string;
1200
+ name?: string;
1201
+ count: number;
1202
+ lastAt: string;
1203
+ ip?: string;
1204
+ ua?: string;
1205
+ secChUa?: string;
1206
+ browser?: string;
1207
+ }
1208
+ interface RecoveryStatsCreatedMeta {
1209
+ at: string;
1210
+ ip?: string;
1211
+ ua?: string;
1212
+ secChUa?: string;
1213
+ browser?: string;
1214
+ deviceId?: string;
1215
+ deviceName?: string;
1216
+ country?: string;
1217
+ encryptionMethod?: 'passkey' | 'password';
1218
+ }
1219
+ interface RecoveryStats {
1220
+ created: RecoveryStatsCreatedMeta;
1221
+ devices: RecoveryStatsDeviceEntry[];
1222
+ }
1223
+ declare function getShareRecoveryStats(): Promise<RecoveryStats | null>;
1224
+
1225
+ interface SendTransactionParams$1 {
1226
+ to: `0x${string}`;
1227
+ value: string;
1228
+ data?: `0x${string}`;
1229
+ assetType?: AssetType;
1230
+ tokenAddress?: `0x${string}`;
1231
+ tokenId?: string;
1232
+ decimals?: number;
1233
+ }
1234
+ interface UseSendTransactionReturn {
1235
+ sendTransaction: (params: SendTransactionParams$1) => Promise<string | null>;
1236
+ isLoading: boolean;
1237
+ error: string | null;
1238
+ userOpHash: string | null;
1239
+ reset: () => void;
1240
+ }
1241
+ declare function useSendTransaction(): UseSendTransactionReturn;
1242
+
1243
+ interface UserOpMempool {
1244
+ entryPoint: `0x${string}` | null;
1245
+ sender: `0x${string}` | null;
1246
+ }
1247
+ type UserOpState = 'waiting' | 'pending' | 'included' | 'failed' | 'rejected' | 'timeout';
1248
+ interface UseUserOpStatusOptions {
1249
+ userOpHash?: `0x${string}` | string | null;
1250
+ pollMs?: number;
1251
+ maxPollTimeMs?: number;
1252
+ enabled?: boolean;
1253
+ onStateChange?: (state: UserOpState) => void;
1254
+ onReceipt?: (receipt: UserOperationReceipt) => void;
1255
+ onTxHash?: (txHash: `0x${string}`) => void;
1256
+ }
1257
+ interface UseUserOpStatusReturn {
1258
+ state: UserOpState;
1259
+ receipt: UserOperationReceipt | null;
1260
+ mempool: UserOpMempool | null;
1261
+ txHash: `0x${string}` | null;
1262
+ error: string | null;
1263
+ isPolling: boolean;
1264
+ refresh: () => Promise<void>;
1265
+ }
1266
+ declare function useUserOpStatus(options?: UseUserOpStatusOptions): UseUserOpStatusReturn;
1267
+
1268
+ interface UseErc3643ComplianceOptions {
1269
+ /** Token contract address */
1270
+ tokenAddress: Address$1 | undefined;
1271
+ /** Recipient address */
1272
+ to: Address$1 | undefined;
1273
+ /** Amount to transfer (as bigint) */
1274
+ amount: bigint | undefined;
1275
+ /** Whether to enable the query */
1276
+ enabled?: boolean;
1277
+ /** Chain ID to use for the query */
1278
+ chainId?: number;
1279
+ }
1280
+ interface UseErc3643ComplianceResult {
1281
+ /** Whether the transfer is allowed */
1282
+ canTransfer: boolean | undefined;
1283
+ /** Whether the query is loading */
1284
+ isLoading: boolean;
1285
+ /** Error message if compliance check failed */
1286
+ error: string | null;
1287
+ /** Refetch the compliance status */
1288
+ refetch: () => void;
1289
+ }
1290
+ /**
1291
+ * Hook to check ERC3643 (Security Token) transfer compliance.
1292
+ *
1293
+ * ERC3643 tokens have compliance requirements that must be met before transfers.
1294
+ * This hook calls the `canTransfer` function on the token contract to verify
1295
+ * if a transfer is allowed.
1296
+ *
1297
+ * @example
1298
+ * ```tsx
1299
+ * const { canTransfer, isLoading, error } = useErc3643Compliance({
1300
+ * tokenAddress: '0x...',
1301
+ * to: recipientAddress,
1302
+ * amount: parseUnits('100', 18),
1303
+ * enabled: selectedAsset?.type === 'erc3643'
1304
+ * });
1305
+ *
1306
+ * if (!canTransfer) {
1307
+ * // Show compliance error
1308
+ * }
1309
+ * ```
1310
+ */
1311
+ declare function useErc3643Compliance(options: UseErc3643ComplianceOptions): UseErc3643ComplianceResult;
1312
+
1313
+ interface UseWalletModeReturn {
1314
+ /** Currently configured mode from provider config */
1315
+ configMode: WalletMode;
1316
+ /** Currently active mode (relevant when configMode='both') */
1317
+ activeMode: WalletMode;
1318
+ /** Switch active mode (only works when configMode='both') */
1319
+ switchMode: (mode: 'linked' | 'direct') => void;
1320
+ /** Whether the current active mode uses direct EOA signing */
1321
+ isDirect: boolean;
1322
+ }
1323
+ declare function useWalletMode(): UseWalletModeReturn;
1324
+
1325
+ interface UseDirectWalletReturn {
1326
+ /** Connected external wallet address */
1327
+ address: `0x${string}` | null;
1328
+ /** Chain ID the external wallet is on */
1329
+ chainId: number | null;
1330
+ /** Whether external wallet is connected */
1331
+ isConnected: boolean;
1332
+ /** Wallet connector name (e.g. 'MetaMask') */
1333
+ connectorName: string | null;
1334
+ /** Connect + link: opens RainbowKit modal, signs, calls linkWallet API */
1335
+ connect: () => void;
1336
+ /** Reconnect only: opens RainbowKit modal to restore wagmi session (no re-linking) */
1337
+ reconnect: () => void;
1338
+ /** Disconnect the external wallet */
1339
+ disconnect: () => void;
1340
+ }
1341
+ declare function useDirectWallet(): UseDirectWalletReturn;
1342
+
1343
+ interface DirectTransactionParams {
1344
+ to: `0x${string}`;
1345
+ /** Amount in human-readable native currency units (e.g. '1.5' for 1.5 ETH), not wei */
1346
+ value: string;
1347
+ data?: `0x${string}`;
1348
+ chainId?: number;
1349
+ }
1350
+ interface UseSendDirectTransactionReturn {
1351
+ sendTransaction: (params: DirectTransactionParams) => Promise<`0x${string}` | null>;
1352
+ isPending: boolean;
1353
+ error: string | null;
1354
+ txHash: `0x${string}` | null;
1355
+ reset: () => void;
1356
+ }
1357
+ declare function useSendDirectTransaction(): UseSendDirectTransactionReturn;
1358
+
1359
+ interface TransferToLinkedParams {
1360
+ /** Token contract address, or 'native' for native currency */
1361
+ token: `0x${string}` | 'native';
1362
+ /** Human-readable amount (e.g. '1.5', '1000') */
1363
+ amount: string;
1364
+ /** Chain ID — transfer only works within same chain */
1365
+ chainId: number;
1366
+ /** Token decimals (default: 18). Required for ERC20 tokens */
1367
+ decimals?: number;
1368
+ /** Target linked wallet address. If omitted, uses first linked wallet */
1369
+ toAddress?: `0x${string}`;
1370
+ }
1371
+ interface UseTransferToLinkedReturn {
1372
+ transfer: (params: TransferToLinkedParams) => Promise<string | null>;
1373
+ isPending: boolean;
1374
+ error: string | null;
1375
+ userOpHash: string | null;
1376
+ /** List of linked wallet addresses from profile */
1377
+ linkedWallets: `0x${string}`[];
1378
+ reset: () => void;
1379
+ }
1380
+ declare function useTransferToLinkedWallet(): UseTransferToLinkedReturn;
1381
+
1382
+ interface AuthProviderMeta extends Record<string, unknown> {
1383
+ walletName?: string;
1384
+ walletType?: string;
1385
+ chainId?: number;
1386
+ email?: string;
1387
+ }
1388
+ interface AuthProvider {
1389
+ provider: 'passkey' | 'email' | 'telegram' | 'google' | 'discord' | 'twitter' | 'wallet';
1390
+ verified: boolean;
1391
+ linkedAt: string;
1392
+ lastUsedAt?: string;
1393
+ externalId: string;
1394
+ meta?: AuthProviderMeta;
1395
+ }
1396
+
1397
+ declare function fetchProjectName(projectId: string): Promise<string>;
1398
+
1399
+ declare function useNativeWalletSignature(): {
1400
+ signMessage: wagmi.UseSignMessageReturnType<unknown>;
1401
+ /** EIP-712 signature */
1402
+ signTypedMessage: wagmi.UseSignTypedDataReturnType<unknown>;
1403
+ fetchProjectNameById: typeof fetchProjectName;
1404
+ };
1405
+
1406
+ interface UseLogoutReturn {
1407
+ logout: () => Promise<void>;
1408
+ }
1409
+ /**
1410
+ * Hook for logging out and disconnecting from EmbarkAI
1411
+ * Clears session, tokens, and notifies callbacks
1412
+ *
1413
+ * @example
1414
+ * ```tsx
1415
+ * function MyComponent() {
1416
+ * const { logout } = useLogout();
1417
+ *
1418
+ * return (
1419
+ * <button onClick={logout}>
1420
+ * Disconnect
1421
+ * </button>
1422
+ * );
1423
+ * }
1424
+ * ```
1425
+ */
1426
+ declare function useLogout(): UseLogoutReturn;
1427
+
1428
+ /**
1429
+ * Nickname fingerprint verification utilities
1430
+ * Implements client-side verification per FRD spec
1431
+ *
1432
+ * IMPORTANT: Client MUST NOT trust server blindly.
1433
+ * Always verify fingerprint locally before displaying to user.
1434
+ */
1435
+ /**
1436
+ * Generate fingerprint from owner address
1437
+ * Must match backend algorithm exactly
1438
+ *
1439
+ * Algorithm:
1440
+ * 1. Normalize address to checksum format
1441
+ * 2. Compute keccak256 hash
1442
+ * 3. Take first 5 bytes (40 bits)
1443
+ * 4. Encode using Base32 alphabet
1444
+ * 5. Format as XXXX-XXXX
1445
+ *
1446
+ * @param ownerAddress - The EOA owner address
1447
+ * @returns Fingerprint in format "XXXX-XXXX"
1448
+ */
1449
+ declare function generateFingerprint(ownerAddress: string): string;
1450
+ /**
1451
+ * Verify that received fingerprint matches computed fingerprint
1452
+ *
1453
+ * @param ownerAddress - The owner address from API response
1454
+ * @param receivedFingerprint - The fingerprint from API response
1455
+ * @returns true if fingerprint is valid, false if verification failed
1456
+ */
1457
+ declare function verifyFingerprint(ownerAddress: string, receivedFingerprint: string): boolean;
1458
+ /**
1459
+ * Fingerprint verification result
1460
+ */
1461
+ interface FingerprintVerificationResult {
1462
+ isValid: boolean;
1463
+ computedFingerprint: string | null;
1464
+ receivedFingerprint: string | null;
1465
+ error?: string;
1466
+ }
1467
+ /**
1468
+ * Verify fingerprint with detailed result
1469
+ * Use this for UI display of verification status
1470
+ *
1471
+ * @param ownerAddress - The owner address from API response
1472
+ * @param receivedFingerprint - The fingerprint from API response
1473
+ * @returns Detailed verification result
1474
+ */
1475
+ declare function verifyFingerprintDetailed(ownerAddress: string | null, receivedFingerprint: string | null): FingerprintVerificationResult;
1476
+
1477
+ /**
1478
+ * Nickname API types
1479
+ * Types for nickname-related API responses and requests
1480
+ */
1481
+ /**
1482
+ * Detailed nickname information
1483
+ * Returned by GET /api/auth/nickname
1484
+ */
1485
+ interface NicknameInfo {
1486
+ handle: string;
1487
+ displayHandle: string;
1488
+ createdAt: string;
1489
+ changedAt: string | null;
1490
+ changeCount: number;
1491
+ canChange: boolean;
1492
+ cooldownEndsAt: string | null;
1493
+ }
1494
+ /**
1495
+ * Result of changing nickname
1496
+ * Returned by PUT /api/auth/nickname
1497
+ */
1498
+ interface NicknameChangeResult {
1499
+ handle: string;
1500
+ displayHandle: string;
1501
+ previousHandle: string;
1502
+ isFirstChange: boolean;
1503
+ }
1504
+ /**
1505
+ * Nickname availability check result
1506
+ * Returned by GET /api/auth/nicknames/{handle}/check
1507
+ */
1508
+ interface NicknameAvailability {
1509
+ handle: string;
1510
+ available: boolean;
1511
+ reason?: NicknameUnavailableReason;
1512
+ }
1513
+ type NicknameUnavailableReason = 'TAKEN' | 'RESERVED' | 'TOO_SHORT' | 'TOO_LONG' | 'INVALID_CHARS' | 'INVALID_UNDERSCORE';
1514
+ /**
1515
+ * Resolved target for a specific chain
1516
+ */
1517
+ interface NicknameResolvedTarget {
1518
+ chainId: number;
1519
+ wallet: `0x${string}`;
1520
+ }
1521
+ /**
1522
+ * Avatar information for nickname resolution
1523
+ */
1524
+ interface NicknameAvatar {
1525
+ type: 'deterministic-circles';
1526
+ seed: string;
1527
+ }
1528
+ /**
1529
+ * Nickname to wallet address resolution (v2)
1530
+ * Returned by POST /api/auth/nicknames/resolve
1531
+ */
1532
+ interface NicknameResolution {
1533
+ handle: string;
1534
+ requestedChainId: number;
1535
+ resolvedTarget: NicknameResolvedTarget | null;
1536
+ availableTargets: NicknameResolvedTarget[];
1537
+ owner: `0x${string}` | null;
1538
+ fingerprint: string | null;
1539
+ avatar: NicknameAvatar | null;
1540
+ avatarSvg: string | null;
1541
+ isFrozen: boolean;
1542
+ }
1543
+ /**
1544
+ * Request body for resolving nickname (v2)
1545
+ */
1546
+ interface NicknameResolveRequest {
1547
+ handle: string;
1548
+ chainId: number;
1549
+ }
1550
+ /**
1551
+ * Client-side nickname validation result
1552
+ */
1553
+ interface NicknameValidationResult {
1554
+ valid: boolean;
1555
+ error?: NicknameValidationError;
1556
+ }
1557
+ type NicknameValidationError = 'TOO_SHORT' | 'TOO_LONG' | 'INVALID_CHARS' | 'INVALID_UNDERSCORE';
1558
+
1559
+ /**
1560
+ * useNicknameResolve hook
1561
+ * Public hook for resolving nicknames to wallet addresses with verification
1562
+ */
1563
+
1564
+ interface UseNicknameResolveResult {
1565
+ data: NicknameResolution | undefined;
1566
+ isLoading: boolean;
1567
+ isResolving: boolean;
1568
+ isError: boolean;
1569
+ isNotFound: boolean;
1570
+ isWalletNotSetup: boolean;
1571
+ isFrozen: boolean;
1572
+ isFingerprintVerified: boolean;
1573
+ fingerprintVerification: FingerprintVerificationResult | null;
1574
+ error: Error | null;
1575
+ resolvedAddress: string | null;
1576
+ }
1577
+ /**
1578
+ * Detect if input looks like a nickname (vs an address)
1579
+ * - Starts with @ or contains only lowercase a-z, 0-9, underscore
1580
+ * - Does not start with 0x
1581
+ */
1582
+ declare function looksLikeNickname(input: string): boolean;
1583
+ interface UseNicknameResolveOptions {
1584
+ enabled?: boolean;
1585
+ chainId: number;
1586
+ }
1587
+ /**
1588
+ * Hook to resolve a nickname to a wallet address with verification
1589
+ *
1590
+ * - Debounces API calls by 300ms
1591
+ * - Only resolves when input looks like a nickname
1592
+ * - Verifies fingerprint locally before returning data (MANDATORY)
1593
+ * - Returns resolved address when found and verified
1594
+ *
1595
+ * @param input - The recipient input (can be address or nickname)
1596
+ * @param options - Resolution options including chainId (required) and enabled flag
1597
+ * @returns Resolution data, loading states, error state, verification status, resolved address
1598
+ */
1599
+ declare function useNicknameResolve(input: string, options: UseNicknameResolveOptions): UseNicknameResolveResult;
1600
+
1601
+ /**
1602
+ * Get UserOperation data by hash
1603
+ */
1604
+
1605
+ /**
1606
+ * UserOperation data from bundler response
1607
+ */
1608
+ interface UserOperationByHash {
1609
+ /** EntryPoint address */
1610
+ entryPoint: `0x${string}`;
1611
+ /** User operation details */
1612
+ userOperation: {
1613
+ sender: `0x${string}`;
1614
+ nonce: `0x${string}`;
1615
+ callData: `0x${string}`;
1616
+ callGasLimit: `0x${string}`;
1617
+ verificationGasLimit: `0x${string}`;
1618
+ preVerificationGas: `0x${string}`;
1619
+ maxPriorityFeePerGas: `0x${string}`;
1620
+ maxFeePerGas: `0x${string}`;
1621
+ paymaster?: `0x${string}`;
1622
+ paymasterVerificationGasLimit?: `0x${string}`;
1623
+ paymasterPostOpGasLimit?: `0x${string}`;
1624
+ paymasterData?: `0x${string}`;
1625
+ signature: `0x${string}`;
1626
+ };
1627
+ /** Transaction hash (null if not yet included in block) */
1628
+ transactionHash: `0x${string}` | null;
1629
+ /** Block number (null if not yet included in block) */
1630
+ blockNumber: `0x${string}` | null;
1631
+ /** Block hash (null if not yet included in block) */
1632
+ blockHash: `0x${string}` | null;
1633
+ }
1634
+ /**
1635
+ * Get UserOperation data by hash
1636
+ *
1637
+ * Automatically uses active chain from UI unless chainId is specified.
1638
+ * Returns null if UserOp is not found.
1639
+ *
1640
+ * @param userOpHash - UserOperation hash returned from sendUserOperation
1641
+ * @param chainId - Optional chain ID (defaults to active chain)
1642
+ * @returns UserOperation data if found, null if not found
1643
+ * @throws {Error} If chain has no bundlerUrl configured
1644
+ *
1645
+ * @example
1646
+ * ```typescript
1647
+ * const hash = await sendUserOperation(session, { ... })
1648
+ * const userOp = await getUserOperationByHash(hash)
1649
+ * ```
1650
+ */
1651
+ declare function getUserOperationByHash(userOpHash: Hash$1 | string, chainId?: number): Promise<UserOperationByHash | null>;
1652
+
1653
+ /**
1654
+ * Get UserOperation receipt by hash
1655
+ */
1656
+
1657
+ /**
1658
+ * UserOperation receipt
1659
+ *
1660
+ * Contains execution details after UserOp is included in a block
1661
+ */
1662
+ interface UserOperationReceipt {
1663
+ /** UserOperation hash */
1664
+ userOpHash: Hash$1;
1665
+ /** EntryPoint address that processed this UserOp */
1666
+ entryPoint: `0x${string}`;
1667
+ /** Sender (smart account) address */
1668
+ sender: `0x${string}`;
1669
+ /** Nonce used for this UserOp */
1670
+ nonce: `0x${string}`;
1671
+ /** True if UserOp succeeded, false if reverted */
1672
+ success: boolean;
1673
+ /** Actual gas cost paid */
1674
+ actualGasCost: `0x${string}`;
1675
+ /** Actual gas used */
1676
+ actualGasUsed: `0x${string}`;
1677
+ /** Paymaster address (if used) */
1678
+ paymaster?: `0x${string}`;
1679
+ /** Transaction receipt */
1680
+ receipt: {
1681
+ transactionHash: Hash$1;
1682
+ blockNumber: `0x${string}`;
1683
+ blockHash: Hash$1;
1684
+ [key: string]: any;
1685
+ };
1686
+ /** Logs emitted during execution */
1687
+ logs?: any[];
1688
+ /** Revert reason, if unsuccessful */
1689
+ reason?: string;
1690
+ }
1691
+ /**
1692
+ * Get UserOperation receipt by hash
1693
+ *
1694
+ * Automatically uses active chain from UI unless chainId is specified.
1695
+ * Returns null if UserOp is still pending or not found.
1696
+ *
1697
+ * @param userOpHash - UserOperation hash returned from sendUserOperation
1698
+ * @param chainId - Optional chain ID (defaults to active chain)
1699
+ * @returns Receipt if found and mined, null if pending or not found
1700
+ * @throws {Error} If chain has no bundlerUrl configured
1701
+ *
1702
+ * @example
1703
+ * ```typescript
1704
+ * const hash = await sendUserOperation(session, { ... })
1705
+ * const receipt = await getUserOperationReceipt(hash)
1706
+ * if (receipt?.success) {
1707
+ * console.log('Gas used:', receipt.actualGasUsed)
1708
+ * }
1709
+ * ```
1710
+ */
1711
+ declare function getUserOperationReceipt(userOpHash: Hash$1 | string, chainId?: number): Promise<UserOperationReceipt | null>;
1712
+
1713
+ /**
1714
+ * Wait for UserOperation receipt with polling
1715
+ */
1716
+
1717
+ /**
1718
+ * Options for waiting for UserOperation receipt
1719
+ */
1720
+ interface WaitForReceiptOptions {
1721
+ /**
1722
+ * Polling interval in milliseconds
1723
+ * @default 1000 (1 second)
1724
+ */
1725
+ pollIntervalMs?: number;
1726
+ /**
1727
+ * Maximum wait time in milliseconds
1728
+ * @default 60000 (60 seconds)
1729
+ */
1730
+ maxPollTimeMs?: number;
1731
+ /**
1732
+ * Chain ID (optional)
1733
+ * If not provided, uses activeChainId from UI state.
1734
+ */
1735
+ chainId?: number;
1736
+ }
1737
+ /**
1738
+ * Thrown when waitForUserOperationReceipt exceeds maxPollTimeMs
1739
+ */
1740
+ declare class UserOperationTimeoutError extends Error {
1741
+ userOpHash: Hash$1;
1742
+ chainId: number;
1743
+ timeoutMs: number;
1744
+ constructor(userOpHash: Hash$1, chainId: number, timeoutMs: number);
1745
+ }
1746
+ /**
1747
+ * Wait for UserOperation receipt with automatic polling
1748
+ *
1749
+ * Polls bundler until receipt is available or timeout is reached.
1750
+ * Automatically uses active chain from UI unless chainId is specified in options.
1751
+ *
1752
+ * @param userOpHash - UserOperation hash returned from sendUserOperation
1753
+ * @param options - Polling configuration and optional chainId
1754
+ * @returns Receipt once UserOp is mined
1755
+ * @throws {UserOperationTimeoutError} If timeout is exceeded before receipt is available
1756
+ * @throws {Error} If chain has no bundlerUrl configured
1757
+ *
1758
+ * @example
1759
+ * ```typescript
1760
+ * const hash = await sendUserOperation(session, { to, value, data })
1761
+ * const receipt = await waitForUserOperationReceipt(hash)
1762
+ * if (receipt.success) {
1763
+ * console.log('TxHash:', receipt.receipt.transactionHash)
1764
+ * }
1765
+ * ```
1766
+ */
1767
+ declare function waitForUserOperationReceipt(userOpHash: Hash$1, options?: WaitForReceiptOptions): Promise<UserOperationReceipt>;
1768
+
1769
+ declare global {
1770
+ interface Window {
1771
+ __EMBARK_CONDITIONAL_UI_ACTIVE__?: boolean;
1772
+ }
1773
+ }
1774
+
1775
+ /**
1776
+ * Provider information in user profile
1777
+ * Matches the structure returned by backend /api/auth/profile
1778
+ */
1779
+ interface ProviderDetail {
1780
+ id: string;
1781
+ provider: string;
1782
+ verified: boolean;
1783
+ linkedAt: string;
1784
+ lastUsedAt: string;
1785
+ externalId: string;
1786
+ meta?: Record<string, any>;
1787
+ }
1788
+ /**
1789
+ * User profile information
1790
+ * Extended to include nickname fields from backend
1791
+ */
1792
+ interface UserProfile {
1793
+ userId: string;
1794
+ displayName?: string;
1795
+ avatar?: string;
1796
+ providers: ProviderDetail[];
1797
+ createdAt: string;
1798
+ updatedAt: string;
1799
+ hasKeyshare: boolean;
1800
+ kycDetails: {
1801
+ provider: 'sumsub' | 'uaepass' | 'custom';
1802
+ kycStatus: string;
1803
+ } | null;
1804
+ nickname: string | null;
1805
+ nicknameDisplay: string | null;
1806
+ nicknameCanChange: boolean;
1807
+ nicknameCooldownEndsAt: string | null;
1808
+ }
1809
+ interface UpdateProfileRequest {
1810
+ displayName?: string;
1811
+ }
1812
+ /**
1813
+ * Get user profile with detailed provider information
1814
+ *
1815
+ * Backend /api/auth/profile now returns complete provider details including:
1816
+ * - Provider type and identifier
1817
+ * - Verification status
1818
+ * - Linked and last used timestamps
1819
+ * - Provider-specific metadata
1820
+ */
1821
+ declare function getUserProfile(): Promise<UserProfile>;
1822
+ /**
1823
+ * Update user profile
1824
+ */
1825
+ declare function updateUserProfile(updates: UpdateProfileRequest): Promise<UserProfile>;
1826
+
1827
+ interface ConnectedApp {
1828
+ projectId: string;
1829
+ name: string;
1830
+ appUrl: string | null;
1831
+ logo: string;
1832
+ domains: unknown;
1833
+ providers: unknown;
1834
+ smartWalletAddress: string;
1835
+ firstConnectedAt: string;
1836
+ lastActiveAt: string;
1837
+ }
1838
+
1839
+ declare function useConnectedApps(): _tanstack_react_query.UseQueryResult<ConnectedApp[], Error>;
1840
+ declare function useKeyshareRecoveryStats(): _tanstack_react_query.UseQueryResult<{
1841
+ keyshareInfo: {
1842
+ hasKeyshare: boolean;
1843
+ ownerAddress?: `0x${string}`;
1844
+ sessionId?: string;
1845
+ keyshareSize?: number;
1846
+ };
1847
+ shareRecoveryStats: RecoveryStats;
1848
+ }, Error>;
1849
+
1850
+ interface LinkedProfileDisplay extends AuthProvider {
1851
+ displayName: string;
1852
+ icon?: React.ComponentType<{
1853
+ className?: string;
1854
+ }>;
1855
+ color?: string;
1856
+ }
1857
+ declare function useLinkedProfiles(): {
1858
+ profiles: LinkedProfileDisplay[];
1859
+ avatar: string;
1860
+ isLoading: boolean;
1861
+ error: Error;
1862
+ refresh: () => Promise<void>;
1863
+ };
1864
+
1865
+ /**
1866
+ * Custom error types for EmbarkAI operations
1867
+ */
1868
+ /**
1869
+ * Base error class for all EmbarkAI errors
1870
+ * Local copy to avoid @embarkai/core dependency in iframe bundle
1871
+ */
1872
+ declare class AccountAbstractionError extends Error {
1873
+ /** Machine-readable error code for programmatic handling */
1874
+ readonly code: string;
1875
+ constructor(message: string, code: string);
1876
+ }
1877
+ /**
1878
+ * Error thrown when user rejects a transaction or signature request
1879
+ */
1880
+ declare class UserRejectedError extends AccountAbstractionError {
1881
+ static readonly CODE: "USER_REJECTED";
1882
+ constructor(message?: string);
1883
+ }
1884
+ /**
1885
+ * Error codes for EmbarkAI operations
1886
+ */
1887
+ declare const ErrorCodes: {
1888
+ readonly MPC_SIGNING_ERROR: "MPC_SIGNING_ERROR";
1889
+ readonly USER_REJECTED: "USER_REJECTED";
1890
+ };
1891
+ /**
1892
+ * Create appropriate error from error code
1893
+ * Used to reconstruct errors from iframe postMessage
1894
+ */
1895
+ declare function createAccountAbstractionError(params: {
1896
+ message: string;
1897
+ code?: string;
1898
+ }): Error;
1899
+
1900
+ /**
1901
+ * Wagmi config for RainbowKit and wallet connections.
1902
+ * Note: Balance fetching uses dynamic publicClient from session store,
1903
+ * so chains don't need to be listed here for balance queries.
1904
+ */
1905
+ declare const wagmiConfig: wagmi.Config<readonly [viem.Chain, viem.Chain], {
1906
+ [lumiaTestnetChain.id]: viem.HttpTransport<undefined, false> | viem.FallbackTransport<viem.HttpTransport<undefined, false>[]>;
1907
+ [lumiaMainnetChain.id]: viem.HttpTransport<undefined, false> | viem.FallbackTransport<viem.HttpTransport<undefined, false>[]>;
1908
+ }, readonly wagmi.CreateConnectorFn[]>;
1909
+
1910
+ declare function getExplorerUrl(): string;
1911
+
1912
+ /**
1913
+ * Hook for fetching all assets from Blockscout API
1914
+ */
1915
+
1916
+ interface UseBlockscoutAssetsOptions {
1917
+ /** Wallet address to query */
1918
+ address: Address$1 | undefined;
1919
+ /** Whether to enable the query (default: true when address provided) */
1920
+ enabled?: boolean;
1921
+ /** Whether to detect ERC3643 security tokens (default: true) */
1922
+ detectSecurityTokens?: boolean;
1923
+ }
1924
+ interface UseBlockscoutAssetsResult {
1925
+ /** Native token balance (always available via RPC) */
1926
+ nativeBalance: {
1927
+ value: bigint;
1928
+ formatted: string;
1929
+ symbol: string;
1930
+ } | null;
1931
+ /** All discovered assets (native + tokens + NFTs) */
1932
+ assets: Asset[];
1933
+ /** Whether any data is currently loading */
1934
+ isLoading: boolean;
1935
+ /** Whether initial load is in progress */
1936
+ isInitialLoading: boolean;
1937
+ /** Error from Blockscout API (null if native balance available) */
1938
+ error: AssetListError | null;
1939
+ /** Whether Blockscout API is reachable */
1940
+ isBlockscoutAvailable: boolean;
1941
+ /** Manually refresh all balances */
1942
+ refreshBalances: () => Promise<void>;
1943
+ /** Get balance for a specific token by address */
1944
+ getTokenBalance: (tokenAddress: Address$1) => Asset | null;
1945
+ /** Timestamp of last successful fetch */
1946
+ lastUpdated: number | null;
1947
+ }
1948
+ /**
1949
+ * React hook for fetching all assets from Blockscout API
1950
+ *
1951
+ * @example
1952
+ * ```tsx
1953
+ * const { assets, isLoading, error, refreshBalances } = useBlockscoutAssets({
1954
+ * address: '0x...',
1955
+ * });
1956
+ * ```
1957
+ */
1958
+ declare function useBlockscoutAssets(options: UseBlockscoutAssetsOptions): UseBlockscoutAssetsResult;
1959
+
1960
+ interface Transaction {
1961
+ hash: Hash$1;
1962
+ from: string;
1963
+ to: string | null;
1964
+ value: string;
1965
+ gasUsed: string;
1966
+ gasPrice: string;
1967
+ blockNumber: bigint;
1968
+ timestamp: number;
1969
+ status: 'success' | 'failed' | 'pending';
1970
+ }
1971
+ interface SendTransactionParams {
1972
+ to: `0x${string}`;
1973
+ value: string;
1974
+ data?: `0x${string}`;
1975
+ }
1976
+ interface SendTransactionResult {
1977
+ hash: Hash$1;
1978
+ wait: () => Promise<TransactionReceipt>;
1979
+ }
1980
+ declare function useTransactions(): {
1981
+ sendTransaction: (params: SendTransactionParams) => Promise<SendTransactionResult>;
1982
+ getTransaction: (hash: Hash$1) => Promise<{
1983
+ input: viem.Hex;
1984
+ s: viem.Hex;
1985
+ value: bigint;
1986
+ hash: Hash$1;
1987
+ v: bigint;
1988
+ r: viem.Hex;
1989
+ type: "legacy";
1990
+ to: viem.Address | null;
1991
+ from: viem.Address;
1992
+ gas: bigint;
1993
+ nonce: number;
1994
+ blobVersionedHashes?: undefined;
1995
+ gasPrice: bigint;
1996
+ maxFeePerBlobGas?: undefined;
1997
+ maxFeePerGas?: undefined;
1998
+ maxPriorityFeePerGas?: undefined;
1999
+ accessList?: undefined;
2000
+ authorizationList?: undefined;
2001
+ yParity?: undefined;
2002
+ typeHex: viem.Hex | null;
2003
+ chainId?: number;
2004
+ blockNumber: bigint;
2005
+ blockHash: `0x${string}`;
2006
+ transactionIndex: number;
2007
+ } | {
2008
+ input: viem.Hex;
2009
+ s: viem.Hex;
2010
+ value: bigint;
2011
+ hash: Hash$1;
2012
+ v: bigint;
2013
+ r: viem.Hex;
2014
+ type: "eip2930";
2015
+ to: viem.Address | null;
2016
+ from: viem.Address;
2017
+ gas: bigint;
2018
+ nonce: number;
2019
+ blobVersionedHashes?: undefined;
2020
+ gasPrice: bigint;
2021
+ maxFeePerBlobGas?: undefined;
2022
+ maxFeePerGas?: undefined;
2023
+ maxPriorityFeePerGas?: undefined;
2024
+ accessList: viem.AccessList;
2025
+ authorizationList?: undefined;
2026
+ yParity: number;
2027
+ typeHex: viem.Hex | null;
2028
+ chainId: number;
2029
+ blockNumber: bigint;
2030
+ blockHash: `0x${string}`;
2031
+ transactionIndex: number;
2032
+ } | {
2033
+ input: viem.Hex;
2034
+ s: viem.Hex;
2035
+ value: bigint;
2036
+ hash: Hash$1;
2037
+ v: bigint;
2038
+ r: viem.Hex;
2039
+ type: "eip1559";
2040
+ to: viem.Address | null;
2041
+ from: viem.Address;
2042
+ gas: bigint;
2043
+ nonce: number;
2044
+ blobVersionedHashes?: undefined;
2045
+ gasPrice?: undefined;
2046
+ maxFeePerBlobGas?: undefined;
2047
+ maxFeePerGas: bigint;
2048
+ maxPriorityFeePerGas: bigint;
2049
+ accessList: viem.AccessList;
2050
+ authorizationList?: undefined;
2051
+ yParity: number;
2052
+ typeHex: viem.Hex | null;
2053
+ chainId: number;
2054
+ blockNumber: bigint;
2055
+ blockHash: `0x${string}`;
2056
+ transactionIndex: number;
2057
+ } | {
2058
+ input: viem.Hex;
2059
+ s: viem.Hex;
2060
+ value: bigint;
2061
+ hash: Hash$1;
2062
+ v: bigint;
2063
+ r: viem.Hex;
2064
+ type: "eip4844";
2065
+ to: viem.Address | null;
2066
+ from: viem.Address;
2067
+ gas: bigint;
2068
+ nonce: number;
2069
+ blobVersionedHashes: readonly viem.Hex[];
2070
+ gasPrice?: undefined;
2071
+ maxFeePerBlobGas: bigint;
2072
+ maxFeePerGas: bigint;
2073
+ maxPriorityFeePerGas: bigint;
2074
+ accessList: viem.AccessList;
2075
+ authorizationList?: undefined;
2076
+ yParity: number;
2077
+ typeHex: viem.Hex | null;
2078
+ chainId: number;
2079
+ blockNumber: bigint;
2080
+ blockHash: `0x${string}`;
2081
+ transactionIndex: number;
2082
+ } | {
2083
+ input: viem.Hex;
2084
+ s: viem.Hex;
2085
+ value: bigint;
2086
+ hash: Hash$1;
2087
+ v: bigint;
2088
+ r: viem.Hex;
2089
+ type: "eip7702";
2090
+ to: viem.Address | null;
2091
+ from: viem.Address;
2092
+ gas: bigint;
2093
+ nonce: number;
2094
+ blobVersionedHashes?: undefined;
2095
+ gasPrice?: undefined;
2096
+ maxFeePerBlobGas?: undefined;
2097
+ maxFeePerGas: bigint;
2098
+ maxPriorityFeePerGas: bigint;
2099
+ accessList: viem.AccessList;
2100
+ authorizationList: viem.SignedAuthorizationList;
2101
+ yParity: number;
2102
+ typeHex: viem.Hex | null;
2103
+ chainId: number;
2104
+ blockNumber: bigint;
2105
+ blockHash: `0x${string}`;
2106
+ transactionIndex: number;
2107
+ }>;
2108
+ getTransactionReceipt: (hash: Hash$1) => Promise<TransactionReceipt>;
2109
+ getTransactionHistory: (address: `0x${string}`, limit?: number) => Promise<Transaction[]>;
2110
+ address: `0x${string}`;
2111
+ isConnected: boolean;
2112
+ };
2113
+
2114
+ interface UserOperation {
2115
+ hash: Hash$1;
2116
+ sender: `0x${string}`;
2117
+ nonce: bigint;
2118
+ success: boolean;
2119
+ actualGasCost: bigint;
2120
+ blockNumber: bigint;
2121
+ timestamp: number;
2122
+ transactionHash: Hash$1;
2123
+ }
2124
+ declare function useSmartAccountTransactions(): {
2125
+ getUserOperations: (address: `0x${string}`, fromBlock?: bigint | "earliest", toBlock?: bigint | "latest") => Promise<UserOperation[]>;
2126
+ getRecentUserOperations: (address: `0x${string}`, limit?: number) => Promise<UserOperation[]>;
2127
+ getTransactionDetails: (txHash: Hash$1) => Promise<{
2128
+ transaction: {
2129
+ input: viem.Hex;
2130
+ s: viem.Hex;
2131
+ value: bigint;
2132
+ hash: Hash$1;
2133
+ v: bigint;
2134
+ r: viem.Hex;
2135
+ type: "legacy";
2136
+ to: viem.Address | null;
2137
+ from: viem.Address;
2138
+ gas: bigint;
2139
+ nonce: number;
2140
+ blobVersionedHashes?: undefined;
2141
+ gasPrice: bigint;
2142
+ maxFeePerBlobGas?: undefined;
2143
+ maxFeePerGas?: undefined;
2144
+ maxPriorityFeePerGas?: undefined;
2145
+ accessList?: undefined;
2146
+ authorizationList?: undefined;
2147
+ yParity?: undefined;
2148
+ typeHex: viem.Hex | null;
2149
+ chainId?: number;
2150
+ blockNumber: bigint;
2151
+ blockHash: `0x${string}`;
2152
+ transactionIndex: number;
2153
+ } | {
2154
+ input: viem.Hex;
2155
+ s: viem.Hex;
2156
+ value: bigint;
2157
+ hash: Hash$1;
2158
+ v: bigint;
2159
+ r: viem.Hex;
2160
+ type: "eip2930";
2161
+ to: viem.Address | null;
2162
+ from: viem.Address;
2163
+ gas: bigint;
2164
+ nonce: number;
2165
+ blobVersionedHashes?: undefined;
2166
+ gasPrice: bigint;
2167
+ maxFeePerBlobGas?: undefined;
2168
+ maxFeePerGas?: undefined;
2169
+ maxPriorityFeePerGas?: undefined;
2170
+ accessList: viem.AccessList;
2171
+ authorizationList?: undefined;
2172
+ yParity: number;
2173
+ typeHex: viem.Hex | null;
2174
+ chainId: number;
2175
+ blockNumber: bigint;
2176
+ blockHash: `0x${string}`;
2177
+ transactionIndex: number;
2178
+ } | {
2179
+ input: viem.Hex;
2180
+ s: viem.Hex;
2181
+ value: bigint;
2182
+ hash: Hash$1;
2183
+ v: bigint;
2184
+ r: viem.Hex;
2185
+ type: "eip1559";
2186
+ to: viem.Address | null;
2187
+ from: viem.Address;
2188
+ gas: bigint;
2189
+ nonce: number;
2190
+ blobVersionedHashes?: undefined;
2191
+ gasPrice?: undefined;
2192
+ maxFeePerBlobGas?: undefined;
2193
+ maxFeePerGas: bigint;
2194
+ maxPriorityFeePerGas: bigint;
2195
+ accessList: viem.AccessList;
2196
+ authorizationList?: undefined;
2197
+ yParity: number;
2198
+ typeHex: viem.Hex | null;
2199
+ chainId: number;
2200
+ blockNumber: bigint;
2201
+ blockHash: `0x${string}`;
2202
+ transactionIndex: number;
2203
+ } | {
2204
+ input: viem.Hex;
2205
+ s: viem.Hex;
2206
+ value: bigint;
2207
+ hash: Hash$1;
2208
+ v: bigint;
2209
+ r: viem.Hex;
2210
+ type: "eip4844";
2211
+ to: viem.Address | null;
2212
+ from: viem.Address;
2213
+ gas: bigint;
2214
+ nonce: number;
2215
+ blobVersionedHashes: readonly viem.Hex[];
2216
+ gasPrice?: undefined;
2217
+ maxFeePerBlobGas: bigint;
2218
+ maxFeePerGas: bigint;
2219
+ maxPriorityFeePerGas: bigint;
2220
+ accessList: viem.AccessList;
2221
+ authorizationList?: undefined;
2222
+ yParity: number;
2223
+ typeHex: viem.Hex | null;
2224
+ chainId: number;
2225
+ blockNumber: bigint;
2226
+ blockHash: `0x${string}`;
2227
+ transactionIndex: number;
2228
+ } | {
2229
+ input: viem.Hex;
2230
+ s: viem.Hex;
2231
+ value: bigint;
2232
+ hash: Hash$1;
2233
+ v: bigint;
2234
+ r: viem.Hex;
2235
+ type: "eip7702";
2236
+ to: viem.Address | null;
2237
+ from: viem.Address;
2238
+ gas: bigint;
2239
+ nonce: number;
2240
+ blobVersionedHashes?: undefined;
2241
+ gasPrice?: undefined;
2242
+ maxFeePerBlobGas?: undefined;
2243
+ maxFeePerGas: bigint;
2244
+ maxPriorityFeePerGas: bigint;
2245
+ accessList: viem.AccessList;
2246
+ authorizationList: viem.SignedAuthorizationList;
2247
+ yParity: number;
2248
+ typeHex: viem.Hex | null;
2249
+ chainId: number;
2250
+ blockNumber: bigint;
2251
+ blockHash: `0x${string}`;
2252
+ transactionIndex: number;
2253
+ };
2254
+ receipt: viem.TransactionReceipt;
2255
+ }>;
2256
+ };
2257
+
2258
+ /**
2259
+ * Passport translations object.
2260
+ * Note: For use in combineI18NResources, translations are imported directly
2261
+ * in utils.ts to avoid esbuild lazy initialization issues.
2262
+ */
2263
+ declare const PASSPORT_TRANSLATIONS: {
2264
+ en: {
2265
+ passport: {
2266
+ common: {
2267
+ create: string;
2268
+ add: string;
2269
+ added: string;
2270
+ edit: string;
2271
+ confirm: string;
2272
+ purchase: string;
2273
+ buy: string;
2274
+ save: string;
2275
+ saved: string;
2276
+ delete: string;
2277
+ download: string;
2278
+ cancel: string;
2279
+ close: string;
2280
+ copy: string;
2281
+ back: string;
2282
+ language: string;
2283
+ account: string;
2284
+ asset: string;
2285
+ amount: string;
2286
+ balance: string;
2287
+ continue: string;
2288
+ network: string;
2289
+ fingerprint: string;
2290
+ from: string;
2291
+ to: string;
2292
+ hide: string;
2293
+ show: string;
2294
+ received: string;
2295
+ sent: string;
2296
+ created: string;
2297
+ settings: string;
2298
+ password: string;
2299
+ passkey: string;
2300
+ standard: string;
2301
+ advanced: string;
2302
+ next: string;
2303
+ prev: string;
2304
+ errors: {
2305
+ oops: string;
2306
+ };
2307
+ };
2308
+ auth: {
2309
+ signin: string;
2310
+ logout: string;
2311
+ backToSignIn: string;
2312
+ orSeparator: string;
2313
+ email: {
2314
+ placeholder: string;
2315
+ };
2316
+ verification: {
2317
+ title: string;
2318
+ sentTo: string;
2319
+ codeExpires: string;
2320
+ didntReceive: string;
2321
+ resend: string;
2322
+ };
2323
+ social: {
2324
+ comingSoonMessage: string;
2325
+ };
2326
+ wallet: {
2327
+ label: string;
2328
+ };
2329
+ passkey: {
2330
+ label: string;
2331
+ title: string;
2332
+ signInExisting: string;
2333
+ dontHave: string;
2334
+ create: string;
2335
+ };
2336
+ terms: {
2337
+ text: string;
2338
+ action: string;
2339
+ };
2340
+ };
2341
+ main: {
2342
+ send: string;
2343
+ receive: string;
2344
+ buy: string;
2345
+ assets: string;
2346
+ };
2347
+ sendMenu: {
2348
+ title: string;
2349
+ selectAsset: string;
2350
+ confirmStep: string;
2351
+ sendNft: string;
2352
+ recipient: string;
2353
+ pendingStep: string;
2354
+ pendingStepMsg: string;
2355
+ };
2356
+ receiveMenu: {
2357
+ title: string;
2358
+ copyAddress: string;
2359
+ warning: string;
2360
+ share: string;
2361
+ };
2362
+ buyMenu: {
2363
+ title: string;
2364
+ provider: string;
2365
+ selectProvider: string;
2366
+ selectCrypto: string;
2367
+ selectFiat: string;
2368
+ selectPaymentMode: string;
2369
+ enterAmount: string;
2370
+ purchaseSummary: string;
2371
+ summary: {
2372
+ youPay: string;
2373
+ youReceive: string;
2374
+ exchangeRate: string;
2375
+ networkFee: string;
2376
+ serviceFee: string;
2377
+ paymentMethod: string;
2378
+ };
2379
+ transactionHistory: {
2380
+ details: string;
2381
+ };
2382
+ noItems: {
2383
+ noTransactions: string;
2384
+ noPaymentModes: string;
2385
+ noCryptoForChain: string;
2386
+ };
2387
+ inputPlaceholder: {
2388
+ selectCurrencies: string;
2389
+ providerMin: string;
2390
+ };
2391
+ };
2392
+ portfolioMenu: {
2393
+ title: string;
2394
+ noAssets: string;
2395
+ };
2396
+ transactionsMenu: {
2397
+ title: string;
2398
+ noTransactions: string;
2399
+ internalTransactions: string;
2400
+ comingSoon: string;
2401
+ };
2402
+ kycMenu: {
2403
+ title: string;
2404
+ };
2405
+ nicknameMenu: {
2406
+ title: string;
2407
+ yourNickname: string;
2408
+ cooldownMessage: string;
2409
+ lastChanged: string;
2410
+ timesChanged: string;
2411
+ placeholder: string;
2412
+ hint: string;
2413
+ errors: {
2414
+ tooShort: string;
2415
+ tooLong: string;
2416
+ invalidChars: string;
2417
+ invalidUnderscore: string;
2418
+ invalidFormat: string;
2419
+ nicknameTaken: string;
2420
+ nicknameReserved: string;
2421
+ cooldownActive: string;
2422
+ nicknameNotFound: string;
2423
+ unknown: string;
2424
+ };
2425
+ availability: {
2426
+ alreadyYourNickname: string;
2427
+ checkingAvailability: string;
2428
+ nicknameAvailable: string;
2429
+ nicknameNotAvailable: string;
2430
+ };
2431
+ };
2432
+ profilesMenu: {
2433
+ title: string;
2434
+ email: {
2435
+ placeholder: string;
2436
+ sentTo: string;
2437
+ warningTitle: string;
2438
+ warningMsg: string;
2439
+ };
2440
+ passkey: {
2441
+ message: string;
2442
+ message2: string;
2443
+ linking: string;
2444
+ createOnDevice: string;
2445
+ createOnSecurityKey: string;
2446
+ };
2447
+ unlinkTitle: string;
2448
+ unlinkConfirm: string;
2449
+ unlinkPlaceholder: string;
2450
+ };
2451
+ securityMenu: {
2452
+ title: string;
2453
+ connectedApps: {
2454
+ connectedApp: string;
2455
+ trustedApp: string;
2456
+ trustedAt: string;
2457
+ connectedAt: string;
2458
+ connectedApps: string;
2459
+ noConnectedApps: string;
2460
+ untrustApp: string;
2461
+ removalNoteTitle: string;
2462
+ removalNoteMsg1: string;
2463
+ removalNoteMsg2: string;
2464
+ };
2465
+ keyshareStatus: {
2466
+ title: string;
2467
+ serverReady: string;
2468
+ serverMissing: string;
2469
+ localReady: string;
2470
+ localMissing: string;
2471
+ valutBackupCreated: string;
2472
+ valutBackupMissing: string;
2473
+ };
2474
+ lastBackup: string;
2475
+ lastBackupMeta: string;
2476
+ };
2477
+ backupMenu: {
2478
+ title: string;
2479
+ passwordMsg: string;
2480
+ passkeyMsg: string;
2481
+ passkeyCompleteMsg: string;
2482
+ passkeyAccessMsg: string;
2483
+ passkeyMemo0: string;
2484
+ passkeyMemo1: string;
2485
+ passkeyMemo2: string;
2486
+ passkeyLearnMore: string;
2487
+ vaultRecoveryStatus: string;
2488
+ vaultCreate: string;
2489
+ vaultRestore: string;
2490
+ file: string;
2491
+ fileCreate: string;
2492
+ fileRestore: string;
2493
+ cloud: string;
2494
+ };
2495
+ restoreMenu: {
2496
+ title: string;
2497
+ check: string;
2498
+ noBackups: string;
2499
+ noBackupsMsg1: string;
2500
+ noBackupsMsg2: string;
2501
+ uploadBackupFile: string;
2502
+ restoreWithBackupFile: string;
2503
+ tryAnotherAccount: string;
2504
+ };
2505
+ chainMenu: {
2506
+ title: string;
2507
+ chainSwitchRequest: {
2508
+ title: string;
2509
+ description: string;
2510
+ confirmButton: string;
2511
+ cancelButton: string;
2512
+ };
2513
+ };
2514
+ };
2515
+ };
2516
+ zh: {
2517
+ passport: {
2518
+ common: {
2519
+ create: string;
2520
+ add: string;
2521
+ added: string;
2522
+ edit: string;
2523
+ confirm: string;
2524
+ purchase: string;
2525
+ buy: string;
2526
+ save: string;
2527
+ saved: string;
2528
+ delete: string;
2529
+ download: string;
2530
+ cancel: string;
2531
+ close: string;
2532
+ copy: string;
2533
+ back: string;
2534
+ language: string;
2535
+ account: string;
2536
+ asset: string;
2537
+ amount: string;
2538
+ balance: string;
2539
+ continue: string;
2540
+ network: string;
2541
+ fingerprint: string;
2542
+ from: string;
2543
+ to: string;
2544
+ hide: string;
2545
+ show: string;
2546
+ received: string;
2547
+ sent: string;
2548
+ created: string;
2549
+ settings: string;
2550
+ password: string;
2551
+ passkey: string;
2552
+ standard: string;
2553
+ advanced: string;
2554
+ next: string;
2555
+ prev: string;
2556
+ errors: {
2557
+ oops: string;
2558
+ };
2559
+ };
2560
+ auth: {
2561
+ signin: string;
2562
+ logout: string;
2563
+ backToSignIn: string;
2564
+ orSeparator: string;
2565
+ email: {
2566
+ placeholder: string;
2567
+ };
2568
+ verification: {
2569
+ title: string;
2570
+ sentTo: string;
2571
+ codeExpires: string;
2572
+ didntReceive: string;
2573
+ resend: string;
2574
+ };
2575
+ social: {
2576
+ comingSoonMessage: string;
2577
+ };
2578
+ wallet: {
2579
+ label: string;
2580
+ };
2581
+ passkey: {
2582
+ label: string;
2583
+ title: string;
2584
+ signInExisting: string;
2585
+ dontHave: string;
2586
+ create: string;
2587
+ };
2588
+ terms: {
2589
+ text: string;
2590
+ action: string;
2591
+ };
2592
+ };
2593
+ main: {
2594
+ send: string;
2595
+ receive: string;
2596
+ buy: string;
2597
+ assets: string;
2598
+ };
2599
+ sendMenu: {
2600
+ title: string;
2601
+ selectAsset: string;
2602
+ confirmStep: string;
2603
+ sendNft: string;
2604
+ recipient: string;
2605
+ pendingStep: string;
2606
+ pendingStepMsg: string;
2607
+ };
2608
+ receiveMenu: {
2609
+ title: string;
2610
+ copyAddress: string;
2611
+ warning: string;
2612
+ share: string;
2613
+ };
2614
+ buyMenu: {
2615
+ title: any;
2616
+ provider: any;
2617
+ selectProvider: any;
2618
+ selectCrypto: any;
2619
+ selectFiat: any;
2620
+ selectPaymentMode: any;
2621
+ enterAmount: any;
2622
+ };
2623
+ portfolioMenu: {
2624
+ title: string;
2625
+ noAssets: string;
2626
+ };
2627
+ transactionsMenu: {
2628
+ title: string;
2629
+ noTransactions: string;
2630
+ internalTransactions: string;
2631
+ comingSoon: any;
2632
+ };
2633
+ kycMenu: {
2634
+ title: string;
2635
+ };
2636
+ nicknameMenu: {
2637
+ title: string;
2638
+ yourNickname: string;
2639
+ cooldownMessage: string;
2640
+ lastChanged: string;
2641
+ timesChanged: string;
2642
+ placeholder: string;
2643
+ hint: string;
2644
+ errors: {
2645
+ tooShort: string;
2646
+ tooLong: string;
2647
+ invalidChars: string;
2648
+ invalidUnderscore: string;
2649
+ invalidFormat: string;
2650
+ nicknameTaken: string;
2651
+ nicknameReserved: string;
2652
+ cooldownActive: string;
2653
+ nicknameNotFound: string;
2654
+ unknown: string;
2655
+ };
2656
+ availability: {
2657
+ alreadyYourNickname: string;
2658
+ checkingAvailability: string;
2659
+ nicknameAvailable: string;
2660
+ nicknameNotAvailable: string;
2661
+ };
2662
+ };
2663
+ profilesMenu: {
2664
+ title: string;
2665
+ email: {
2666
+ placeholder: string;
2667
+ sentTo: string;
2668
+ warningTitle: string;
2669
+ warningMsg: string;
2670
+ };
2671
+ passkey: {
2672
+ message: string;
2673
+ message2: string;
2674
+ linking: string;
2675
+ createOnDevice: string;
2676
+ createOnSecurityKey: string;
2677
+ };
2678
+ unlinkTitle: string;
2679
+ unlinkConfirm: string;
2680
+ unlinkPlaceholder: string;
2681
+ };
2682
+ securityMenu: {
2683
+ title: string;
2684
+ connectedApps: {
2685
+ connectedApp: string;
2686
+ trustedApp: string;
2687
+ trustedAt: string;
2688
+ connectedAt: string;
2689
+ connectedApps: string;
2690
+ noConnectedApps: string;
2691
+ untrustApp: string;
2692
+ removalNoteTitle: string;
2693
+ removalNoteMsg1: string;
2694
+ removalNoteMsg2: string;
2695
+ };
2696
+ keyshareStatus: {
2697
+ title: string;
2698
+ serverReady: string;
2699
+ serverMissing: string;
2700
+ localReady: string;
2701
+ localMissing: string;
2702
+ valutBackupCreated: string;
2703
+ valutBackupMissing: string;
2704
+ };
2705
+ lastBackup: string;
2706
+ lastBackupMeta: string;
2707
+ };
2708
+ backupMenu: {
2709
+ title: string;
2710
+ passwordMsg: string;
2711
+ passkeyMsg: string;
2712
+ passkeyCompleteMsg: string;
2713
+ passkeyAccessMsg: string;
2714
+ passkeyMemo0: string;
2715
+ passkeyMemo1: string;
2716
+ passkeyMemo2: string;
2717
+ passkeyLearnMore: string;
2718
+ vaultRecoveryStatus: string;
2719
+ vaultCreate: string;
2720
+ vaultRestore: string;
2721
+ file: string;
2722
+ fileCreate: string;
2723
+ fileRestore: string;
2724
+ cloud: string;
2725
+ };
2726
+ restoreMenu: {
2727
+ title: string;
2728
+ check: string;
2729
+ noBackups: string;
2730
+ noBackupsMsg1: string;
2731
+ noBackupsMsg2: string;
2732
+ uploadBackupFile: string;
2733
+ restoreWithBackupFile: string;
2734
+ tryAnotherAccount: string;
2735
+ };
2736
+ chainMenu: {
2737
+ title: string;
2738
+ chainSwitchRequest: {
2739
+ title: any;
2740
+ description: any;
2741
+ confirmButton: any;
2742
+ cancelButton: any;
2743
+ };
2744
+ };
2745
+ };
2746
+ };
2747
+ ru: {
2748
+ passport: {
2749
+ common: {
2750
+ create: string;
2751
+ add: string;
2752
+ added: string;
2753
+ edit: string;
2754
+ confirm: string;
2755
+ purchase: string;
2756
+ buy: string;
2757
+ save: string;
2758
+ saved: string;
2759
+ delete: string;
2760
+ download: string;
2761
+ cancel: string;
2762
+ close: string;
2763
+ copy: string;
2764
+ back: string;
2765
+ language: string;
2766
+ account: string;
2767
+ asset: string;
2768
+ amount: string;
2769
+ balance: string;
2770
+ continue: string;
2771
+ network: string;
2772
+ fingerprint: string;
2773
+ from: string;
2774
+ to: string;
2775
+ hide: string;
2776
+ show: string;
2777
+ received: string;
2778
+ sent: string;
2779
+ created: string;
2780
+ settings: string;
2781
+ password: string;
2782
+ passkey: string;
2783
+ standard: string;
2784
+ advanced: string;
2785
+ next: string;
2786
+ prev: string;
2787
+ errors: {
2788
+ oops: string;
2789
+ };
2790
+ };
2791
+ auth: {
2792
+ signin: string;
2793
+ logout: string;
2794
+ backToSignIn: string;
2795
+ orSeparator: string;
2796
+ email: {
2797
+ placeholder: string;
2798
+ };
2799
+ verification: {
2800
+ title: string;
2801
+ sentTo: string;
2802
+ codeExpires: string;
2803
+ didntReceive: string;
2804
+ resend: string;
2805
+ };
2806
+ social: {
2807
+ comingSoonMessage: string;
2808
+ };
2809
+ wallet: {
2810
+ label: string;
2811
+ };
2812
+ passkey: {
2813
+ label: string;
2814
+ title: string;
2815
+ signInExisting: string;
2816
+ dontHave: string;
2817
+ create: string;
2818
+ };
2819
+ terms: {
2820
+ text: string;
2821
+ action: string;
2822
+ };
2823
+ };
2824
+ main: {
2825
+ send: string;
2826
+ receive: string;
2827
+ buy: string;
2828
+ assets: string;
2829
+ };
2830
+ sendMenu: {
2831
+ title: string;
2832
+ selectAsset: string;
2833
+ confirmStep: string;
2834
+ sendNft: string;
2835
+ recipient: string;
2836
+ pendingStep: string;
2837
+ pendingStepMsg: string;
2838
+ };
2839
+ receiveMenu: {
2840
+ title: string;
2841
+ copyAddress: string;
2842
+ warning: string;
2843
+ share: string;
2844
+ };
2845
+ buyMenu: {
2846
+ title: string;
2847
+ provider: string;
2848
+ selectProvider: string;
2849
+ selectCrypto: string;
2850
+ selectFiat: string;
2851
+ selectPaymentMode: string;
2852
+ enterAmount: string;
2853
+ purchaseSummary: string;
2854
+ summary: {
2855
+ youPay: string;
2856
+ youReceive: string;
2857
+ exchangeRate: string;
2858
+ networkFee: string;
2859
+ serviceFee: string;
2860
+ paymentMethod: string;
2861
+ };
2862
+ transactionHistory: {
2863
+ details: string;
2864
+ };
2865
+ noItems: {
2866
+ noTransactions: string;
2867
+ noPaymentModes: string;
2868
+ noCryptoForChain: string;
2869
+ };
2870
+ inputPlaceholder: {
2871
+ selectCurrencies: string;
2872
+ providerMin: string;
2873
+ };
2874
+ };
2875
+ portfolioMenu: {
2876
+ title: string;
2877
+ noAssets: string;
2878
+ };
2879
+ transactionsMenu: {
2880
+ title: string;
2881
+ noTransactions: string;
2882
+ internalTransactions: string;
2883
+ comingSoon: string;
2884
+ };
2885
+ kycMenu: {
2886
+ title: string;
2887
+ };
2888
+ nicknameMenu: {
2889
+ title: string;
2890
+ yourNickname: string;
2891
+ cooldownMessage: string;
2892
+ lastChanged: string;
2893
+ timesChanged: string;
2894
+ placeholder: string;
2895
+ hint: string;
2896
+ errors: {
2897
+ tooShort: string;
2898
+ tooLong: string;
2899
+ invalidChars: string;
2900
+ invalidUnderscore: string;
2901
+ invalidFormat: string;
2902
+ nicknameTaken: string;
2903
+ nicknameReserved: string;
2904
+ cooldownActive: string;
2905
+ nicknameNotFound: string;
2906
+ unknown: string;
2907
+ };
2908
+ availability: {
2909
+ alreadyYourNickname: string;
2910
+ checkingAvailability: string;
2911
+ nicknameAvailable: string;
2912
+ nicknameNotAvailable: string;
2913
+ };
2914
+ };
2915
+ profilesMenu: {
2916
+ title: string;
2917
+ email: {
2918
+ placeholder: string;
2919
+ sentTo: string;
2920
+ warningTitle: string;
2921
+ warningMsg: string;
2922
+ };
2923
+ passkey: {
2924
+ message: string;
2925
+ message2: string;
2926
+ linking: string;
2927
+ createOnDevice: string;
2928
+ createOnSecurityKey: string;
2929
+ };
2930
+ unlinkTitle: string;
2931
+ unlinkConfirm: string;
2932
+ unlinkPlaceholder: string;
2933
+ };
2934
+ securityMenu: {
2935
+ title: string;
2936
+ connectedApps: {
2937
+ connectedApp: string;
2938
+ trustedApp: string;
2939
+ trustedAt: string;
2940
+ connectedAt: string;
2941
+ connectedApps: string;
2942
+ noConnectedApps: string;
2943
+ untrustApp: string;
2944
+ removalNoteTitle: string;
2945
+ removalNoteMsg1: string;
2946
+ removalNoteMsg2: string;
2947
+ };
2948
+ keyshareStatus: {
2949
+ title: string;
2950
+ serverReady: string;
2951
+ serverMissing: string;
2952
+ localReady: string;
2953
+ localMissing: string;
2954
+ valutBackupCreated: string;
2955
+ valutBackupMissing: string;
2956
+ };
2957
+ lastBackup: string;
2958
+ lastBackupMeta: string;
2959
+ };
2960
+ backupMenu: {
2961
+ title: string;
2962
+ passwordMsg: string;
2963
+ passkeyMsg: string;
2964
+ passkeyCompleteMsg: string;
2965
+ passkeyAccessMsg: string;
2966
+ passkeyMemo0: string;
2967
+ passkeyMemo1: string;
2968
+ passkeyMemo2: string;
2969
+ passkeyLearnMore: string;
2970
+ vaultRecoveryStatus: string;
2971
+ vaultCreate: string;
2972
+ vaultRestore: string;
2973
+ file: string;
2974
+ fileCreate: string;
2975
+ fileRestore: string;
2976
+ cloud: string;
2977
+ };
2978
+ restoreMenu: {
2979
+ title: string;
2980
+ check: string;
2981
+ noBackups: string;
2982
+ noBackupsMsg1: string;
2983
+ noBackupsMsg2: string;
2984
+ uploadBackupFile: string;
2985
+ restoreWithBackupFile: string;
2986
+ tryAnotherAccount: string;
2987
+ };
2988
+ chainMenu: {
2989
+ title: string;
2990
+ chainSwitchRequest: {
2991
+ title: string;
2992
+ description: string;
2993
+ confirmButton: string;
2994
+ cancelButton: string;
2995
+ };
2996
+ };
2997
+ };
2998
+ };
2999
+ };
3000
+ declare const LOCAL_STORAGE_I18N_KEY = "passport-language";
3001
+
3002
+ type TranslationResources = Record<string, Record<string, unknown>>;
3003
+ /**
3004
+ * Combines project's translation resources with PASSPORT_TRANSLATIONS for i18n initialization
3005
+ * @param resourses - translation resources to merge with PASSPORT_TRANSLATIONS
3006
+ *
3007
+ * resource object structure (passport namespace is MANDATORY):
3008
+ *
3009
+ * ```
3010
+ * {
3011
+ * language1: {
3012
+ * passport: {...}
3013
+ * projectNamespace: {...}
3014
+ * ...
3015
+ * },
3016
+ * language2: {
3017
+ * passport: {...}
3018
+ * projectNamespace: {...}
3019
+ * ...
3020
+ * },
3021
+ * }
3022
+ * ```
3023
+ */
3024
+ declare function combineI18NResources(...resourses: TranslationResources[]): TranslationResources;
3025
+ /**
3026
+ * Get list of available language keys from provided translation resources & LP default langset,
3027
+ * returns only languages with 'passport' namespace provided
3028
+ * */
3029
+ declare function getAvailableLanguages(resourses: TranslationResources): string[];
3030
+ declare function getLanguageIcon(languageKey: string): string | null;
3031
+
3032
+ declare const USER_PROFILE_QUERY_KEY: string;
3033
+
3034
+ export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, USER_PROFILE_QUERY_KEY, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getExplorerUrl, getIframeManager, getLanguageIcon, getShareRecoveryStats, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareUserOperation, requireActiveChainId, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useBlockscoutAssets, useColorMode, useConnectedApps, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useKeyshareRecoveryStats, useLinkedProfiles, useLoadingStatus, useLogout, useNativeWalletSignature, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };