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