@block-auth.io/core 0.0.0-pre-20261015143802

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2120 @@
1
+ import * as _wagmi_core from '@wagmi/core';
2
+ import * as viem from 'viem';
3
+ import * as nanostores from 'nanostores';
4
+ import { PublicClientApplication, AuthenticationResult } from '@azure/msal-browser';
5
+ import { CountryCode } from 'libphonenumber-js/min';
6
+
7
+ interface DeletionServiceDeps {
8
+ provider: {
9
+ disconnect: () => void;
10
+ };
11
+ }
12
+ /**
13
+ * Whether a backend error message means the account's restoration period has
14
+ * expired (i.e. the account is permanently deleted).
15
+ */
16
+ declare function isRestorationExpiredMessage(message: unknown): boolean;
17
+ /**
18
+ * Wipe every SDK-owned localStorage key (preserving the extension-installed
19
+ * marker) and tell the extension to reset itself.
20
+ */
21
+ declare function clearRemainingAuthData(): void;
22
+ /**
23
+ * The account can no longer be restored: clear the remaining auth data and
24
+ * surface the "restoration expired" modal (on top of a clean modal stack).
25
+ */
26
+ declare function handleRestorationExpired(): void;
27
+ /**
28
+ * Full teardown after the user acknowledges the restoration-expired modal:
29
+ * clear storage and reset every deletion/signing UI flag so the app returns
30
+ * to a pristine signed-out state.
31
+ */
32
+ declare function finalizeAfterRestorationExpired(): void;
33
+ /**
34
+ * Route a failed restore attempt: expired-restoration errors surface the
35
+ * restoration-expired modal; anything else logs and re-opens the restore
36
+ * modal so the user can retry.
37
+ */
38
+ declare function handleRestoreFailure(error: unknown): void;
39
+ interface RestoreResult {
40
+ success: boolean;
41
+ expired?: boolean;
42
+ data?: unknown;
43
+ }
44
+ interface RestoreSocket {
45
+ connected?: boolean;
46
+ on: (event: string, cb: (data: any) => void) => void;
47
+ off: (event: string, cb: (data: any) => void) => void;
48
+ emit: (event: string, data: unknown) => void;
49
+ }
50
+ /**
51
+ * Emit `sdk:restore` and wait for the outcome. Resolves `{success: true}` on
52
+ * restore, `{success: false, expired: true}` when the restoration period has
53
+ * expired (either via the `sdk:restore` error message or a concurrent
54
+ * `signin:userDeleted`), and rejects on other failures or timeout.
55
+ *
56
+ * Listens on the RAW socket (`wsc.ws`) so the temporary listeners can coexist
57
+ * with the auth runtime's permanent ones (WsClient.on rejects duplicates).
58
+ */
59
+ declare function requestSdkRestore(wsc: {
60
+ ws?: RestoreSocket | null;
61
+ }, { token, address }: {
62
+ token?: string;
63
+ address?: string;
64
+ }, timeoutMs?: number): Promise<RestoreResult>;
65
+ /**
66
+ * Framework-agnostic deletion service. Handles
67
+ * `signin:userDeleted` / `signin:corrupted` events: validates the address
68
+ * (against the session/external DIDs, the pending deletion address, or an
69
+ * orphaned deletion state), wipes the right storage scope, resets state, and
70
+ * surfaces the "restoration expired" modal. Idempotent for the lifetime of
71
+ * the instance; `resetHandlingState()` re-arms it after a successful auth.
72
+ */
73
+ declare function createDeletionService(deps: DeletionServiceDeps): {
74
+ handleUserDeleted: (forAddress?: string | null) => boolean;
75
+ resetHandlingState: () => void;
76
+ };
77
+
78
+ /**
79
+ * This class allow you to use WebSocket API
80
+ * for Block-Auth service
81
+ *
82
+ * @class WsClient
83
+ * @param reconnect - Allow to automatically reconnect
84
+ * to the WebSocket API
85
+ * @returns WsClient
86
+ * @example
87
+ *
88
+ * import { WsClient } from '@blockauth/sdk'
89
+ * const client = new WsClient()
90
+ * await client.connect()
91
+ *
92
+ */
93
+ declare class WsClient {
94
+ private _wsUrl;
95
+ private _apiUrl?;
96
+ private _wsConfig;
97
+ private _uiConfig;
98
+ private _ws;
99
+ private _accessToken;
100
+ private _refreshToken;
101
+ private _user;
102
+ private _users;
103
+ private _roles;
104
+ private _logs;
105
+ private _kycIssuerByAddress;
106
+ /**
107
+ * @param url - the wss:// endpoint to connect to.
108
+ * @param reconnect - allow socket.io to auto-reconnect.
109
+ * @param apiUrl - backend base url used to fetch the short-lived WS
110
+ * connect ticket (GET /auth/ws-ticket) right before opening the socket.
111
+ * Defaults to https://api.block-auth.io. The cookie set by
112
+ * POST /auth/session is host-only to the API origin, so it can't reach
113
+ * this (different-host) WS endpoint directly — the ticket is what
114
+ * actually authenticates the connection now.
115
+ */
116
+ constructor(url?: string, reconnect?: boolean, apiUrl?: string);
117
+ /**
118
+ * Check if the WebSocket API is connected
119
+ * to Block-Auth service
120
+ * @returns boolean
121
+ */
122
+ isConnected(): any;
123
+ /**
124
+ * Allow you to connect to the WebSocket API
125
+ * for Block-Auth service
126
+ * @param waitMs - time to wait for connection ready
127
+ * @returns Promise<void>
128
+ */
129
+ connect(url?: string, waitMs?: number, retries?: number): Promise<void>;
130
+ /**
131
+ * Re-authenticates the CURRENT connection in place: fetches a fresh
132
+ * ws-ticket and sends it over the already-open socket, so the server
133
+ * updates its view of who this connection belongs to without a
134
+ * disconnect/reconnect. A full reconnect would replace `this._ws` with a
135
+ * brand new socket.io instance, silently dropping every listener
136
+ * authRuntime registered on the old one (e.g. the response side of
137
+ * requestSignin -> user:txns:create -> sign) - this avoids that.
138
+ * No-op if there is no open connection yet (connect() will pick up a
139
+ * ticket on its own once one exists).
140
+ * @returns 'renewed' when a ticket was sent, 'refused' when the API answered
141
+ * 401 (no session behind the cookie), 'unavailable' otherwise (not
142
+ * connected yet, or a transient failure).
143
+ */
144
+ refreshAuth(): Promise<'renewed' | 'refused' | 'unavailable'>;
145
+ /**
146
+ * Allow you to subscribe to an event, and
147
+ * verify if the event is already subscribed
148
+ * for Block-Auth service
149
+ * @param event - Event name
150
+ * @param callback - Callback function
151
+ * @returns void
152
+ */
153
+ on(event: string, callback: (...args: any[]) => void): void;
154
+ /**
155
+ * Allow you to unsubscribe to an event, and
156
+ * verify if the event is already unsubscribed
157
+ * for Block-Auth service
158
+ * @param event - Event name
159
+ * @param callback - Callback function
160
+ * @returns void
161
+ */
162
+ off(event: string, callback: (...args: any[]) => void): void;
163
+ /**
164
+ * Allow you to emit an event, and
165
+ * verify if the event is already emitted
166
+ * for Block-Auth service
167
+ * @param event - Event name
168
+ * @param data - Data to send
169
+ * @returns void
170
+ */
171
+ emit(event: string, data: any): void;
172
+ /**
173
+ * Allow you to close the connection
174
+ * to the WebSocket API for Block-Auth service
175
+ * @returns void
176
+ */
177
+ close(): void;
178
+ /**
179
+ * Event fired when the WebSocket API
180
+ * is connected to Block-Auth service
181
+ * @returns void
182
+ */
183
+ onConnect(): void;
184
+ /**
185
+ * Event fired when the WebSocket API
186
+ * got an error on reconnection to Block-Auth service
187
+ */
188
+ onReconnectError(err: any): void;
189
+ /**
190
+ * Event fired when the WebSocket API
191
+ * try to reconnect to Block-Auth service
192
+ * @param attempt - Number of attempt
193
+ */
194
+ onReconnectAttempt(attempt: number): void;
195
+ /**
196
+ * Event fired when the WebSocket API
197
+ * need to signin to Block-Auth service
198
+ * @param data - Data received from Block-Auth service
199
+ * @returns void
200
+ * @example
201
+ * ```typescript
202
+ * {
203
+ * success: true,
204
+ * message: {
205
+ * accessToken
206
+ * refreshToken
207
+ * }
208
+ * }
209
+ * ```
210
+ * */
211
+ onSdkSignin(data: any): any;
212
+ /**
213
+ * Event fired when the WebSocket API
214
+ * need to refresh the signin to Block-Auth service
215
+ * @param data - Data received from Block-Auth service
216
+ * @returns void
217
+ * @example
218
+ * ```typescript
219
+ * {
220
+ * "success": true,
221
+ * "message": {
222
+ * accessToken
223
+ * refreshToken
224
+ * }
225
+ * }
226
+ * ```
227
+ * */
228
+ onSdkRefresh(data: any): void;
229
+ /**
230
+ * Event fired when the WebSocket API
231
+ * need to check if an address is signed for
232
+ * current APP at this current time
233
+ * @param data - Data received from Block-Auth service
234
+ * @returns void
235
+ * @example
236
+ * ```typescript
237
+ * {
238
+ "success": false,
239
+ "message": "User not signed in APP yet"
240
+ }
241
+ * ```
242
+ * */
243
+ onSdkSign(data: any): void;
244
+ /**
245
+ * Event fired when the WebSocket API
246
+ * need to get APP config from Block-Auth service
247
+ * @param data - Data received from Block-Auth service
248
+ * @returns void
249
+ * @example
250
+ * ```typescript
251
+ * {
252
+ "success": true,
253
+ "message": {
254
+ "domain": "example.com",
255
+ "config": { ... }
256
+ }
257
+ }
258
+ * ```
259
+ * */
260
+ onSdkApp(data: any): void;
261
+ /**
262
+ * Event fired when the WebSocket API
263
+ * need to get APP user from Block-Auth service
264
+ * @param data - Data received from Block-Auth service
265
+ * @returns void
266
+ * @example
267
+ * ```typescript
268
+ * {
269
+ "success": true,
270
+ "message": {
271
+ "items": [ {
272
+ ...profileProperties
273
+ "did": "did:564",
274
+ "address": "0x564",
275
+ } ],
276
+ }
277
+ }
278
+ * ```
279
+ * */
280
+ onSdkUser(data: any): void;
281
+ /**
282
+ * Event fired when the WebSocket API
283
+ * need to get APP users from Block-Auth service
284
+ * @param data - Data received from Block-Auth service
285
+ * @returns void
286
+ * @example
287
+ * ```typescript
288
+ * {
289
+ "success": true,
290
+ "message": {
291
+ "pages": 1,
292
+ "items": [ ... ],
293
+ "total": 1,
294
+ }
295
+ }
296
+ * ```
297
+ * */
298
+ onSdkUsers(data: any): void;
299
+ /**
300
+ * Event fired when the WebSocket API
301
+ * need to get APP roles from Block-Auth service
302
+ * @param data - Data received from Block-Auth service
303
+ * @returns void
304
+ * @example
305
+ * ```typescript
306
+ * {
307
+ "success": true,
308
+ "message": {
309
+ "pages": 1,
310
+ "items": [ ... ],
311
+ "total": 1,
312
+ }
313
+ }
314
+ * ```
315
+ * */
316
+ onSdkRoles(data: any): void;
317
+ /**
318
+ * Event fired when the WebSocket API
319
+ * need to get APP logs from Block-Auth service
320
+ * @param data - Data received from Block-Auth service
321
+ * @returns void
322
+ * @example
323
+ * ```typescript
324
+ * {
325
+ "success": true,
326
+ "message": {
327
+ "pages": 1,
328
+ "items": [ ... ],
329
+ "total": 1,
330
+ }
331
+ }
332
+ * ```
333
+ * */
334
+ onSdkLogs(data: any): void;
335
+ onSdkKycIssuer(data: any): void;
336
+ /**
337
+ * Event fired when the WebSocket API
338
+ * is disconnected from Block-Auth service
339
+ */
340
+ onDisconnect(reason: string): void;
341
+ /**
342
+ * Get SocketIO instance
343
+ */
344
+ get ws(): any;
345
+ /**
346
+ * Get WebSocket access token
347
+ */
348
+ get accessToken(): string;
349
+ /**
350
+ * Get WebSocket refresh token
351
+ */
352
+ get refreshToken(): string;
353
+ /**
354
+ * Get WebSocket APP config
355
+ */
356
+ get uiConfig(): any;
357
+ /**
358
+ * Get WebSocket APP user
359
+ */
360
+ get user(): any;
361
+ /**
362
+ * Get WebSocket APP users
363
+ */
364
+ get users(): any[];
365
+ /**
366
+ * Get WebSocket APP roles
367
+ */
368
+ get roles(): any[];
369
+ /**
370
+ * Get WebSocket APP logs
371
+ */
372
+ get logs(): any[];
373
+ /**
374
+ * Get WebSocket APP issuer for an address
375
+ * if module KYC is enabled
376
+ */
377
+ get kycIssuerByAddress(): any;
378
+ }
379
+
380
+ /**
381
+ * This class allow you to use WebSocket API
382
+ *
383
+ * examples:
384
+ *
385
+ * const client = new WsClient();
386
+ *
387
+ */
388
+ declare class RpcClient {
389
+ private rpcUrl;
390
+ constructor();
391
+ }
392
+
393
+ type BlockAuthUserRole = {
394
+ slug: string;
395
+ name: string;
396
+ };
397
+ type BlockAuthUserProfile = {
398
+ roles?: BlockAuthUserRole[];
399
+ [key: string]: unknown;
400
+ };
401
+ declare const getUserRoles: (user?: BlockAuthUserProfile | null) => BlockAuthUserRole[];
402
+ /** Human-readable role names (primary API for client apps). */
403
+ declare const getUserRoleNames: (user?: BlockAuthUserProfile | null) => string[];
404
+ /** Technical role slugs (advanced / internal identification). */
405
+ declare const getUserRoleSlugs: (user?: BlockAuthUserProfile | null) => string[];
406
+ declare const hasRole: (user: BlockAuthUserProfile | null | undefined, roleName: string) => boolean;
407
+ declare const hasRoleBySlug: (user: BlockAuthUserProfile | null | undefined, roleSlug: string) => boolean;
408
+ declare const hasAnyRole: (user: BlockAuthUserProfile | null | undefined, roleNames: string[]) => boolean;
409
+ declare const hasAnyRoleBySlug: (user: BlockAuthUserProfile | null | undefined, roleSlugs: string[]) => boolean;
410
+
411
+ /**
412
+ * This class allow you to authenticate with your BlockAuth
413
+ * wallet and get the data from your user and/or tenant.
414
+ *
415
+ * examples:
416
+ *
417
+ * const provider = new BlockAuthProvider();
418
+ *
419
+ */
420
+ interface BlockAuthProviderOptions {
421
+ /**
422
+ * Backend base url forwarded to `WsClient` to fetch the short-lived WS
423
+ * connect ticket (GET /auth/ws-ticket). Defaults to
424
+ * https://api.block-auth.io.
425
+ */
426
+ apiUrl?: string;
427
+ /**
428
+ * Browser token issued by your backend via POST /api/browser-token.
429
+ * When provided, signin() authenticates with it and the apiSecret is
430
+ * never needed in the browser (leave apiSecret empty).
431
+ */
432
+ browserToken?: string;
433
+ }
434
+ declare class BlockAuthProvider {
435
+ private _rpc;
436
+ private _wsc;
437
+ private _apiKey;
438
+ private _apiSecret;
439
+ private _browserToken;
440
+ private _wsUrl;
441
+ constructor(apiKey?: string, apiSecret?: string, wsUrl?: string, options?: BlockAuthProviderOptions);
442
+ /**
443
+ * Browser token used instead of the apiSecret on signin().
444
+ * Can be updated at runtime (e.g. after fetching a fresh one
445
+ * from your backend when the previous one expired).
446
+ */
447
+ set browserToken(token: string);
448
+ get browserToken(): string;
449
+ /**
450
+ * Allow you to connect to the WebSocket API
451
+ * for Block-Auth service
452
+ * @param waitMs - time to wait for connection ready
453
+ * @returns Promise<void>
454
+ */
455
+ connect(waitMs?: number, url?: string, retries?: number): Promise<void>;
456
+ /**
457
+ * Allow you to disconnect from the WebSocket API
458
+ * for Block-Auth service
459
+ * @returns Promise<void>
460
+ */
461
+ disconnect(): Promise<void>;
462
+ /**
463
+ * Check if the WebSocket API is connected
464
+ * to Block-Auth service
465
+ * @returns boolean
466
+ */
467
+ isConnected(): any;
468
+ /**
469
+ * Allow to Signin to get the access token and refresh token.
470
+ * The access token is valid for 1 hour.
471
+ * The refresh token is valid for 2 hours.
472
+ * You can use the refresh token to get a new
473
+ * access token when the access token is expired using
474
+ * the method `refresh()`.
475
+ *
476
+ * Authenticates with the browser token when one was provided
477
+ * (options.browserToken or the browserToken setter); otherwise
478
+ * falls back to the API Key + API Secret pair. In browsers,
479
+ * always prefer the browser token: the apiSecret must never
480
+ * ship to the client.
481
+ * @returns Promise<any>
482
+ */
483
+ signin(): Promise<any>;
484
+ /**
485
+ * Last-resort credential for a browser: trade the publishable apiKey for a
486
+ * browser token. No-op when a credential is already configured - an
487
+ * explicit browserToken (from the app's own backend) or an apiSecret (a
488
+ * backend caller) always wins, and neither must be spent on a network
489
+ * round trip. Failure is silent (fetchBrowserToken resolves null), so a
490
+ * third-party app with no credential still reaches the server and gets its
491
+ * 'Credentials required' answer.
492
+ */
493
+ private resolveBrowserToken;
494
+ /**
495
+ * Allow to refresh the access token when it's expired.
496
+ * @param refreshToken - your refresh token
497
+ * @returns Promise<any>
498
+ */
499
+ refresh(refreshToken?: string): Promise<any>;
500
+ /**
501
+ * Allow to get the data from your user.
502
+ * @param success - allow to know if address is signed
503
+ * @param message - extended info about signed address
504
+ * @returns Promise<any>
505
+ */
506
+ isAddressSigned(address: string, token?: string): Promise<any>;
507
+ /**
508
+ * Allow to get the data from your app.
509
+ * @param token - your access token
510
+ * @returns Promise<any>
511
+ */
512
+ app(token?: string): Promise<any>;
513
+ user(address: string, token?: string): Promise<any>;
514
+ /**
515
+ * Allow to get a list of users from your app, also
516
+ * you can filter by role and/or permission.
517
+ * @param token - your access token
518
+ * @param data - the data to filter
519
+ * @returns Promise<any>
520
+ */
521
+ users(token?: string, data?: any): Promise<any>;
522
+ /**
523
+ * Allow to get a list of roles from your app.
524
+ * @param token - your access token
525
+ * @param data - the data to filter
526
+ * @returns Promise<any>
527
+ * */
528
+ roles(token?: string, data?: any): Promise<any>;
529
+ /**
530
+ * Allow to get a list of logs from your app.
531
+ * @param token - your access token
532
+ * @param data - the data to filter
533
+ * @returns Promise<any>
534
+ */
535
+ logs(token?: string, data?: any): Promise<any>;
536
+ /**
537
+ * Allow to get KYC issuer for a certain user address from your app.
538
+ * @param address - the address of the user to be paid by the issuer
539
+ * @param data - the data to connect to the KYC issuer
540
+ * { operationId, sessionId, extraData }
541
+ * @param token - your access token
542
+ * @returns Promise<any>
543
+ */
544
+ kycIssuer(address: string, data?: any, token?: string): Promise<any>;
545
+ get rpc(): RpcClient;
546
+ get wsc(): WsClient;
547
+ get socket(): any;
548
+ get uiConfig(): any;
549
+ get appUsers(): any[];
550
+ get appRoles(): any[];
551
+ get appLogs(): any[];
552
+ get appKycIssuerByAddress(): any;
553
+ /**
554
+ * Cached user profile loaded via `user()` (includes `roles` for this app).
555
+ */
556
+ get currentUser(): BlockAuthUserProfile;
557
+ /**
558
+ * Role names assigned to the loaded user profile in this app.
559
+ */
560
+ get roleNames(): string[];
561
+ /**
562
+ * Role slugs assigned to the loaded user profile in this app.
563
+ */
564
+ get roleSlugs(): string[];
565
+ /**
566
+ * Check whether the loaded user profile has a given app role name.
567
+ */
568
+ hasRole(roleName: string): boolean;
569
+ /**
570
+ * Check whether the loaded user profile has a given app role slug.
571
+ */
572
+ hasRoleBySlug(roleSlug: string): boolean;
573
+ /**
574
+ * Check whether the loaded user profile has at least one of the given role names.
575
+ */
576
+ hasAnyRole(roleNames: string[]): boolean;
577
+ /**
578
+ * Check whether the loaded user profile has at least one of the given role slugs.
579
+ */
580
+ hasAnyRoleBySlug(roleSlugs: string[]): boolean;
581
+ }
582
+
583
+ /**
584
+ * A transaction/permission request surfaced by the backend over `user:txns`.
585
+ * Kept permissive (extra backend fields allowed) while the full txn shape is
586
+ * finalized; `id` and `state` are the fields the UI relies on today.
587
+ */
588
+ interface TxnRequest {
589
+ id: number | string;
590
+ state?: 'initial' | 'accepted' | 'rejected' | string;
591
+ [key: string]: unknown;
592
+ }
593
+ interface WsState {
594
+ ready: boolean;
595
+ did: string | null;
596
+ token: string | null;
597
+ apiKey: string | null;
598
+ requests: TxnRequest[];
599
+ }
600
+ declare const $ws: nanostores.MapStore<WsState>;
601
+ declare const setReady: (ready: boolean) => void;
602
+ declare const setToken: (token: string | null) => void;
603
+ declare const setDid: (did: string | null) => void;
604
+ declare const setApiKey: (apiKey: string | null) => void;
605
+ declare const setRequests: (requests: TxnRequest[]) => void;
606
+ declare const resetWs: () => void;
607
+
608
+ interface UiState {
609
+ isSdkSignedIn: boolean;
610
+ uiConfig: Record<string, unknown> | null;
611
+ isServiceConnected: boolean;
612
+ serviceIcon: string | null;
613
+ serviceName: string | null;
614
+ isAppActive: boolean;
615
+ isCheckingAppActive: boolean;
616
+ isSignedFirstCheck: boolean;
617
+ isSigning: boolean;
618
+ isSigned: boolean;
619
+ isSigningLoader: boolean;
620
+ isAcceptingTxn: boolean;
621
+ acceptTxnError: string | null;
622
+ waitingForSuccessLogInSince: number;
623
+ isOtpRequired: boolean;
624
+ isOnDeletion: boolean;
625
+ deletionAddress: string | null;
626
+ }
627
+ declare const $ui: nanostores.MapStore<UiState>;
628
+ declare const setIsSdkSignedIn: (v: boolean) => void;
629
+ declare const setUiConfig: (v: UiState["uiConfig"]) => void;
630
+ declare const setIsServiceConnected: (v: boolean) => void;
631
+ declare const setServiceIcon: (v: string | null) => void;
632
+ declare const setServiceName: (v: string | null) => void;
633
+ declare const setIsAppActive: (v: boolean) => void;
634
+ declare const setIsCheckingAppActive: (v: boolean) => void;
635
+ declare const setIsSignedFirstCheck: (v: boolean) => void;
636
+ declare const setIsSigning: (v: boolean) => void;
637
+ declare const setIsSigned: (v: boolean) => void;
638
+ declare const setIsSigningLoader: (v: boolean) => void;
639
+ declare const setIsAcceptingTxn: (v: boolean) => void;
640
+ declare const setAcceptTxnError: (v: string | null) => void;
641
+ declare const setWaitingForSuccessLogInSince: (v: number) => void;
642
+ declare const setIsOtpRequired: (v: boolean) => void;
643
+ declare const setIsOnDeletion: (v: boolean) => void;
644
+ declare const setDeletionAddress: (v: string | null) => void;
645
+ declare const resetUi: () => void;
646
+
647
+ /** Minimal provider surface needed to load a user profile (test-friendly). */
648
+ interface UserProfileProvider {
649
+ isConnected?: () => boolean;
650
+ user: (address: string, token?: string) => Promise<any>;
651
+ }
652
+ interface UserState {
653
+ user: BlockAuthUserProfile | null;
654
+ isLoadingUser: boolean;
655
+ }
656
+ declare const $user: nanostores.MapStore<UserState>;
657
+ declare const setUser: (user: BlockAuthUserProfile | null) => void;
658
+ declare const setIsLoadingUser: (isLoadingUser: boolean) => void;
659
+ declare const resetUser: () => void;
660
+ /**
661
+ * Loads the signed-in user profile for the current client app, including app
662
+ * roles (normalized via `getUserRoles`).
663
+ */
664
+ declare function loadUserProfile(provider: UserProfileProvider | null | undefined, address: string | null | undefined): Promise<BlockAuthUserProfile | null>;
665
+ /**
666
+ * Fetches and stores the current user profile (including app roles).
667
+ * Used after sdk:sign and when clients need an explicit refresh.
668
+ */
669
+ declare function fetchUserProfile(provider: UserProfileProvider | null | undefined, address: string | null | undefined): Promise<BlockAuthUserProfile | null>;
670
+
671
+ type ModalName = 'signin' | 'signup' | 'restore' | 'restorationExpired';
672
+ /**
673
+ * Stack of open modals (order = stacking order; the last entry is the topmost).
674
+ * A stack — instead of a single value — lets modals overlay each other, e.g. the
675
+ * txn `signin` modal opens on top of the `signup` card while it stays behind.
676
+ */
677
+ declare const $openModals: nanostores.WritableAtom<ModalName[]>;
678
+ /** Open (or bring to front) a modal. */
679
+ declare const openModal: (name: ModalName) => void;
680
+ /** Close a specific modal, or — with no argument — the topmost one. */
681
+ declare const closeModal: (name?: ModalName) => void;
682
+ /** Close every open modal. */
683
+ declare const closeAllModals: () => void;
684
+ /** Whether a given modal is currently open. */
685
+ declare const isModalOpen: (name: ModalName, stack?: ModalName[]) => boolean;
686
+
687
+ type WalletKind = 'evm' | 'solana' | null;
688
+ interface WalletState {
689
+ kind: WalletKind;
690
+ address: string | null;
691
+ chainId: number | null;
692
+ isConnecting: boolean;
693
+ error: string | null;
694
+ }
695
+ declare const $wallet: nanostores.MapStore<WalletState>;
696
+ declare const resetWallet: () => void;
697
+
698
+ interface ExtensionState {
699
+ installed: boolean;
700
+ isLocked: boolean;
701
+ isUser: boolean;
702
+ isUserActive: boolean;
703
+ }
704
+ declare const $extension: nanostores.MapStore<ExtensionState>;
705
+ declare const setExtensionInstalled: (v: boolean) => void;
706
+ declare const setExtensionIsLocked: (v: boolean) => void;
707
+ declare const setExtensionIsUser: (v: boolean) => void;
708
+ declare const setExtensionIsUserActive: (v: boolean) => void;
709
+ declare const resetExtension: () => void;
710
+ /**
711
+ * The BlockAuth extension should offer the sign-in entry point only when it is
712
+ * installed, the user exists and is active, and the extension is unlocked.
713
+ * Mirrors `useStoreExtension.isShowSignin` from the React SDK.
714
+ */
715
+ declare const isShowSignin: (state?: ExtensionState) => boolean;
716
+ /**
717
+ * The page is connected to the BlockAuth extension but has no session for it
718
+ * yet: the OTP has to be entered in the extension first (the `did` only
719
+ * arrives once the extension bridges its session).
720
+ */
721
+ declare const needsExtensionUnlock: (serviceName: string | null | undefined, did: string | null | undefined, isLocked: boolean) => boolean;
722
+
723
+ interface Web3SignupState {
724
+ backendMessage: string | null;
725
+ signature: string | null;
726
+ signedBy: string | null;
727
+ }
728
+ declare const $web3: nanostores.MapStore<Web3SignupState>;
729
+ declare const setBackendMessage: (v: string | null) => void;
730
+ declare const setSignature: (v: string | null) => void;
731
+ declare const setSignedBy: (v: string | null) => void;
732
+ declare const resetWeb3: () => void;
733
+
734
+ type Locale = 'en' | 'es';
735
+ declare const $locale: nanostores.WritableAtom<Locale>;
736
+ declare const setLocale: (l: Locale) => void;
737
+
738
+ type GoogleFlow = 'auth-code' | 'implicit';
739
+ interface GoogleConfig {
740
+ clientId: string;
741
+ /** OAuth scopes; defaults to openid email profile. */
742
+ scope?: string;
743
+ }
744
+ interface GoogleSignInResult {
745
+ /** The flow used for this sign-in. */
746
+ flow: GoogleFlow;
747
+ /** Authorization code (auth-code flow). */
748
+ code?: string;
749
+ /** Access token (implicit flow). */
750
+ accessToken?: string;
751
+ /** Seconds until the access token expires (implicit flow). */
752
+ expiresIn?: number;
753
+ }
754
+ /**
755
+ * Configure the Google OAuth client.
756
+ */
757
+ declare function configureGoogle(cfg: GoogleConfig): void;
758
+ /**
759
+ * Starts the Google sign-in popup: 'auth-code' resolves with a `code` (for the
760
+ * backend to exchange), 'implicit' resolves with an `access_token` +
761
+ * `expiresIn`. On success the $ui atom is updated to reflect the connected
762
+ * Google service.
763
+ *
764
+ * @param flow 'auth-code' (default) | 'implicit'.
765
+ * @param overrides optional clientId/scope overrides.
766
+ */
767
+ declare function signInWithGoogle(flow?: GoogleFlow, overrides?: Partial<GoogleConfig>): Promise<GoogleSignInResult>;
768
+
769
+ type MicrosoftAuthorityMode = 'common' | 'tenant';
770
+ interface MicrosoftConfig {
771
+ clientId: string;
772
+ tenantId?: string | null;
773
+ authorityMode?: MicrosoftAuthorityMode;
774
+ redirectUri?: string;
775
+ }
776
+ interface MicrosoftSignInResult {
777
+ accessToken: string;
778
+ /** Full MSAL authentication result, for callers that need it. */
779
+ response: AuthenticationResult;
780
+ }
781
+ /**
782
+ * Configure the Microsoft OAuth client.
783
+ *
784
+ * Eagerly builds and initializes the MSAL instance (when running in the
785
+ * browser with a clientId) so the sign-in click can call loginPopup() without
786
+ * first awaiting initialize(). That intervening async hop dropped the browser's
787
+ * transient user activation, which made the popup open as a dead about:blank
788
+ * window that never navigated to the Microsoft login page.
789
+ */
790
+ declare function configureMicrosoft(cfg: MicrosoftConfig): void;
791
+ /**
792
+ * Builds (or returns the cached) MSAL PublicClientApplication. The instance is
793
+ * initialized before use as required by msal-browser v3+.
794
+ */
795
+ declare function getMicrosoftProvider(overrides?: Partial<MicrosoftConfig>): Promise<PublicClientApplication>;
796
+ /**
797
+ * Performs the Microsoft login popup flow and reflects the connected state
798
+ * into $ui.
799
+ *
800
+ * @returns the access token and the full MSAL response.
801
+ */
802
+ declare function signInWithMicrosoft(overrides?: Partial<MicrosoftConfig>): Promise<MicrosoftSignInResult>;
803
+
804
+ type index$1_GoogleConfig = GoogleConfig;
805
+ type index$1_GoogleFlow = GoogleFlow;
806
+ type index$1_GoogleSignInResult = GoogleSignInResult;
807
+ type index$1_MicrosoftAuthorityMode = MicrosoftAuthorityMode;
808
+ type index$1_MicrosoftConfig = MicrosoftConfig;
809
+ type index$1_MicrosoftSignInResult = MicrosoftSignInResult;
810
+ declare const index$1_configureGoogle: typeof configureGoogle;
811
+ declare const index$1_configureMicrosoft: typeof configureMicrosoft;
812
+ declare const index$1_getMicrosoftProvider: typeof getMicrosoftProvider;
813
+ declare const index$1_signInWithGoogle: typeof signInWithGoogle;
814
+ declare const index$1_signInWithMicrosoft: typeof signInWithMicrosoft;
815
+ declare namespace index$1 {
816
+ export { type index$1_GoogleConfig as GoogleConfig, type index$1_GoogleFlow as GoogleFlow, type index$1_GoogleSignInResult as GoogleSignInResult, type index$1_MicrosoftAuthorityMode as MicrosoftAuthorityMode, type index$1_MicrosoftConfig as MicrosoftConfig, type index$1_MicrosoftSignInResult as MicrosoftSignInResult, index$1_configureGoogle as configureGoogle, index$1_configureMicrosoft as configureMicrosoft, index$1_getMicrosoftProvider as getMicrosoftProvider, index$1_signInWithGoogle as signInWithGoogle, index$1_signInWithMicrosoft as signInWithMicrosoft };
817
+ }
818
+
819
+ interface BlockAuthClientConfig {
820
+ apiKey: string;
821
+ apiSecret: string;
822
+ /** Opcional: token emitido por tu backend vía POST /api/browser-token.
823
+ * Si está presente, signin() lo usa en lugar del apiSecret — en navegador
824
+ * deja apiSecret vacío para que el secreto nunca llegue al cliente. */
825
+ browserToken?: string;
826
+ wsUrl?: string;
827
+ /** Backend base url used for the session-cookie bridge (POST
828
+ * /auth/session), logout (POST /auth/logout) and the WS connect ticket
829
+ * (GET /auth/ws-ticket). Defaults to https://api.block-auth.io, mirroring
830
+ * how `wsUrl` defaults to wss://wss.block-auth.io. */
831
+ apiUrl?: string;
832
+ /** Timeout (ms) por intento del connect inicial del WS. Default 300 —
833
+ * puede quedarse corto en orígenes con más latencia (p.ej. PRE sin CDN). */
834
+ wsConnectTimeout?: number;
835
+ /** Reintentos del connect inicial del WS. Default 3. */
836
+ wsConnectRetries?: number;
837
+ /** Opcional: sin él, la conexión por QR de WalletConnect queda deshabilitada. */
838
+ walletConnectProjectId?: string;
839
+ rpcUrl?: string;
840
+ locale?: 'en' | 'es';
841
+ google?: {
842
+ clientId: string;
843
+ scope?: string;
844
+ };
845
+ microsoft?: {
846
+ clientId: string;
847
+ tenantId: string;
848
+ authorityMode?: 'common' | 'tenant';
849
+ redirectUri?: string;
850
+ };
851
+ }
852
+ declare function createBlockAuthClient(config: BlockAuthClientConfig): {
853
+ state: {
854
+ $ws: nanostores.MapStore<WsState>;
855
+ $ui: nanostores.MapStore<UiState>;
856
+ $wallet: nanostores.MapStore<WalletState>;
857
+ $openModals: nanostores.WritableAtom<ModalName[]>;
858
+ $user: nanostores.MapStore<UserState>;
859
+ };
860
+ /** App apiKey from client config (also seeded into $ws). */
861
+ apiKey: string;
862
+ connect: (waitMs?: number | undefined, url?: string | undefined, retries?: number | undefined) => Promise<void>;
863
+ disconnect: () => Promise<void>;
864
+ signin: () => Promise<any>;
865
+ setBrowserToken: (token: string) => void;
866
+ refresh: (t?: string) => Promise<any>;
867
+ app: (t?: string) => Promise<any>;
868
+ user: (addr: string, t?: string) => Promise<any>;
869
+ users: (t?: string, d?: unknown) => Promise<any>;
870
+ roles: (t?: string, d?: unknown) => Promise<any>;
871
+ logs: (t?: string, d?: unknown) => Promise<any>;
872
+ kycIssuer: (addr: string, d?: unknown, t?: string) => Promise<any>;
873
+ isAddressSigned: (addr: string, t?: string) => Promise<any>;
874
+ wallet: {
875
+ evm: {
876
+ config: _wagmi_core.Config<readonly [{
877
+ blockExplorers: {
878
+ readonly default: {
879
+ readonly name: "Etherscan";
880
+ readonly url: "https://etherscan.io";
881
+ readonly apiUrl: "https://api.etherscan.io/api";
882
+ };
883
+ };
884
+ blockTime: 12000;
885
+ contracts: {
886
+ readonly ensUniversalResolver: {
887
+ readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
888
+ readonly blockCreated: 23085558;
889
+ };
890
+ readonly multicall3: {
891
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
892
+ readonly blockCreated: 14353601;
893
+ };
894
+ };
895
+ ensTlds?: readonly string[] | undefined;
896
+ id: 1;
897
+ name: "Ethereum";
898
+ nativeCurrency: {
899
+ readonly name: "Ether";
900
+ readonly symbol: "ETH";
901
+ readonly decimals: 18;
902
+ };
903
+ experimental_preconfirmationTime?: number | undefined | undefined;
904
+ rpcUrls: {
905
+ readonly default: {
906
+ readonly http: readonly ["https://eth.merkle.io"];
907
+ };
908
+ };
909
+ sourceId?: number | undefined | undefined;
910
+ testnet?: boolean | undefined | undefined;
911
+ custom?: Record<string, unknown> | undefined;
912
+ extendSchema?: Record<string, unknown> | undefined;
913
+ fees?: viem.ChainFees<undefined> | undefined;
914
+ formatters?: undefined;
915
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
916
+ client: viem.Client;
917
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
918
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
919
+ client: viem.Client;
920
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
921
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
922
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
923
+ }] | undefined;
924
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
925
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
926
+ }], {
927
+ 1: viem.HttpTransport<undefined, false>;
928
+ }, readonly [_wagmi_core.CreateConnectorFn<{
929
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
930
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
931
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
932
+ isApexWallet?: true | undefined;
933
+ isAvalanche?: true | undefined;
934
+ isBackpack?: true | undefined;
935
+ isBifrost?: true | undefined;
936
+ isBitKeep?: true | undefined;
937
+ isBitski?: true | undefined;
938
+ isBlockWallet?: true | undefined;
939
+ isBraveWallet?: true | undefined;
940
+ isCoinbaseWallet?: true | undefined;
941
+ isDawn?: true | undefined;
942
+ isEnkrypt?: true | undefined;
943
+ isExodus?: true | undefined;
944
+ isFrame?: true | undefined;
945
+ isFrontier?: true | undefined;
946
+ isGamestop?: true | undefined;
947
+ isHyperPay?: true | undefined;
948
+ isImToken?: true | undefined;
949
+ isKuCoinWallet?: true | undefined;
950
+ isMathWallet?: true | undefined;
951
+ isMetaMask?: true | undefined;
952
+ isOkxWallet?: true | undefined;
953
+ isOKExWallet?: true | undefined;
954
+ isOneInchAndroidWallet?: true | undefined;
955
+ isOneInchIOSWallet?: true | undefined;
956
+ isOpera?: true | undefined;
957
+ isPhantom?: true | undefined;
958
+ isPortal?: true | undefined;
959
+ isRabby?: true | undefined;
960
+ isRainbow?: true | undefined;
961
+ isStatus?: true | undefined;
962
+ isTally?: true | undefined;
963
+ isTokenPocket?: true | undefined;
964
+ isTokenary?: true | undefined;
965
+ isTrust?: true | undefined;
966
+ isTrustWallet?: true | undefined;
967
+ isUniswapWallet?: true | undefined;
968
+ isXDEFI?: true | undefined;
969
+ isZerion?: true | undefined;
970
+ providers?: {
971
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
972
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
973
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
974
+ isApexWallet?: true | undefined;
975
+ isAvalanche?: true | undefined;
976
+ isBackpack?: true | undefined;
977
+ isBifrost?: true | undefined;
978
+ isBitKeep?: true | undefined;
979
+ isBitski?: true | undefined;
980
+ isBlockWallet?: true | undefined;
981
+ isBraveWallet?: true | undefined;
982
+ isCoinbaseWallet?: true | undefined;
983
+ isDawn?: true | undefined;
984
+ isEnkrypt?: true | undefined;
985
+ isExodus?: true | undefined;
986
+ isFrame?: true | undefined;
987
+ isFrontier?: true | undefined;
988
+ isGamestop?: true | undefined;
989
+ isHyperPay?: true | undefined;
990
+ isImToken?: true | undefined;
991
+ isKuCoinWallet?: true | undefined;
992
+ isMathWallet?: true | undefined;
993
+ isMetaMask?: true | undefined;
994
+ isOkxWallet?: true | undefined;
995
+ isOKExWallet?: true | undefined;
996
+ isOneInchAndroidWallet?: true | undefined;
997
+ isOneInchIOSWallet?: true | undefined;
998
+ isOpera?: true | undefined;
999
+ isPhantom?: true | undefined;
1000
+ isPortal?: true | undefined;
1001
+ isRabby?: true | undefined;
1002
+ isRainbow?: true | undefined;
1003
+ isStatus?: true | undefined;
1004
+ isTally?: true | undefined;
1005
+ isTokenPocket?: true | undefined;
1006
+ isTokenary?: true | undefined;
1007
+ isTrust?: true | undefined;
1008
+ isTrustWallet?: true | undefined;
1009
+ isUniswapWallet?: true | undefined;
1010
+ isXDEFI?: true | undefined;
1011
+ isZerion?: true | undefined;
1012
+ providers?: /*elided*/ any[] | undefined | undefined;
1013
+ _events?: {
1014
+ connect?: (() => void) | undefined;
1015
+ } | undefined | undefined;
1016
+ _state?: {
1017
+ accounts?: string[];
1018
+ initialized?: boolean;
1019
+ isConnected?: boolean;
1020
+ isPermanentlyDisconnected?: boolean;
1021
+ isUnlocked?: boolean;
1022
+ } | undefined | undefined;
1023
+ }[] | undefined | undefined;
1024
+ _events?: {
1025
+ connect?: (() => void) | undefined;
1026
+ } | undefined | undefined;
1027
+ _state?: {
1028
+ accounts?: string[];
1029
+ initialized?: boolean;
1030
+ isConnected?: boolean;
1031
+ isPermanentlyDisconnected?: boolean;
1032
+ isUnlocked?: boolean;
1033
+ } | undefined | undefined;
1034
+ } | undefined, {
1035
+ onConnect(connectInfo: viem.ProviderConnectInfo): void;
1036
+ }, {
1037
+ [x: `${string}.disconnected`]: true;
1038
+ "injected.connected": true;
1039
+ }>, _wagmi_core.CreateConnectorFn<any, {
1040
+ connect<withCapabilities extends boolean = false>(parameters?: {
1041
+ chainId?: number | undefined;
1042
+ isReconnecting?: boolean | undefined;
1043
+ pairingTopic?: string | undefined;
1044
+ withCapabilities?: withCapabilities | boolean | undefined;
1045
+ }): Promise<{
1046
+ accounts: withCapabilities extends true ? readonly {
1047
+ address: viem.Address;
1048
+ }[] : readonly viem.Address[];
1049
+ chainId: number;
1050
+ }>;
1051
+ getNamespaceChainsIds(): number[];
1052
+ getRequestedChainsIds(): Promise<number[]>;
1053
+ isChainsStale(): Promise<boolean>;
1054
+ onConnect(connectInfo: viem.ProviderConnectInfo): void;
1055
+ onDisplayUri(uri: string): void;
1056
+ onSessionDelete(data: {
1057
+ topic: string;
1058
+ }): void;
1059
+ setRequestedChainsIds(chains: number[]): void;
1060
+ requestedChainsStorageKey: `${string}.requestedChains`;
1061
+ }, {
1062
+ [x: `${string}.requestedChains`]: number[];
1063
+ }>] | readonly [_wagmi_core.CreateConnectorFn<{
1064
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1065
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1066
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
1067
+ isApexWallet?: true | undefined;
1068
+ isAvalanche?: true | undefined;
1069
+ isBackpack?: true | undefined;
1070
+ isBifrost?: true | undefined;
1071
+ isBitKeep?: true | undefined;
1072
+ isBitski?: true | undefined;
1073
+ isBlockWallet?: true | undefined;
1074
+ isBraveWallet?: true | undefined;
1075
+ isCoinbaseWallet?: true | undefined;
1076
+ isDawn?: true | undefined;
1077
+ isEnkrypt?: true | undefined;
1078
+ isExodus?: true | undefined;
1079
+ isFrame?: true | undefined;
1080
+ isFrontier?: true | undefined;
1081
+ isGamestop?: true | undefined;
1082
+ isHyperPay?: true | undefined;
1083
+ isImToken?: true | undefined;
1084
+ isKuCoinWallet?: true | undefined;
1085
+ isMathWallet?: true | undefined;
1086
+ isMetaMask?: true | undefined;
1087
+ isOkxWallet?: true | undefined;
1088
+ isOKExWallet?: true | undefined;
1089
+ isOneInchAndroidWallet?: true | undefined;
1090
+ isOneInchIOSWallet?: true | undefined;
1091
+ isOpera?: true | undefined;
1092
+ isPhantom?: true | undefined;
1093
+ isPortal?: true | undefined;
1094
+ isRabby?: true | undefined;
1095
+ isRainbow?: true | undefined;
1096
+ isStatus?: true | undefined;
1097
+ isTally?: true | undefined;
1098
+ isTokenPocket?: true | undefined;
1099
+ isTokenary?: true | undefined;
1100
+ isTrust?: true | undefined;
1101
+ isTrustWallet?: true | undefined;
1102
+ isUniswapWallet?: true | undefined;
1103
+ isXDEFI?: true | undefined;
1104
+ isZerion?: true | undefined;
1105
+ providers?: {
1106
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1107
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1108
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
1109
+ isApexWallet?: true | undefined;
1110
+ isAvalanche?: true | undefined;
1111
+ isBackpack?: true | undefined;
1112
+ isBifrost?: true | undefined;
1113
+ isBitKeep?: true | undefined;
1114
+ isBitski?: true | undefined;
1115
+ isBlockWallet?: true | undefined;
1116
+ isBraveWallet?: true | undefined;
1117
+ isCoinbaseWallet?: true | undefined;
1118
+ isDawn?: true | undefined;
1119
+ isEnkrypt?: true | undefined;
1120
+ isExodus?: true | undefined;
1121
+ isFrame?: true | undefined;
1122
+ isFrontier?: true | undefined;
1123
+ isGamestop?: true | undefined;
1124
+ isHyperPay?: true | undefined;
1125
+ isImToken?: true | undefined;
1126
+ isKuCoinWallet?: true | undefined;
1127
+ isMathWallet?: true | undefined;
1128
+ isMetaMask?: true | undefined;
1129
+ isOkxWallet?: true | undefined;
1130
+ isOKExWallet?: true | undefined;
1131
+ isOneInchAndroidWallet?: true | undefined;
1132
+ isOneInchIOSWallet?: true | undefined;
1133
+ isOpera?: true | undefined;
1134
+ isPhantom?: true | undefined;
1135
+ isPortal?: true | undefined;
1136
+ isRabby?: true | undefined;
1137
+ isRainbow?: true | undefined;
1138
+ isStatus?: true | undefined;
1139
+ isTally?: true | undefined;
1140
+ isTokenPocket?: true | undefined;
1141
+ isTokenary?: true | undefined;
1142
+ isTrust?: true | undefined;
1143
+ isTrustWallet?: true | undefined;
1144
+ isUniswapWallet?: true | undefined;
1145
+ isXDEFI?: true | undefined;
1146
+ isZerion?: true | undefined;
1147
+ providers?: /*elided*/ any[] | undefined | undefined;
1148
+ _events?: {
1149
+ connect?: (() => void) | undefined;
1150
+ } | undefined | undefined;
1151
+ _state?: {
1152
+ accounts?: string[];
1153
+ initialized?: boolean;
1154
+ isConnected?: boolean;
1155
+ isPermanentlyDisconnected?: boolean;
1156
+ isUnlocked?: boolean;
1157
+ } | undefined | undefined;
1158
+ }[] | undefined | undefined;
1159
+ _events?: {
1160
+ connect?: (() => void) | undefined;
1161
+ } | undefined | undefined;
1162
+ _state?: {
1163
+ accounts?: string[];
1164
+ initialized?: boolean;
1165
+ isConnected?: boolean;
1166
+ isPermanentlyDisconnected?: boolean;
1167
+ isUnlocked?: boolean;
1168
+ } | undefined | undefined;
1169
+ } | undefined, {
1170
+ onConnect(connectInfo: viem.ProviderConnectInfo): void;
1171
+ }, {
1172
+ [x: `${string}.disconnected`]: true;
1173
+ "injected.connected": true;
1174
+ }>]>;
1175
+ connectInjected: () => Promise<WalletState>;
1176
+ connectWalletConnect: () => Promise<WalletState>;
1177
+ disconnect: () => Promise<void>;
1178
+ signMessage: (message: string) => Promise<`0x${string}`>;
1179
+ };
1180
+ solana: {
1181
+ connect: () => Promise<string>;
1182
+ disconnect: () => Promise<void>;
1183
+ signMessage: (message: string) => Promise<Uint8Array>;
1184
+ };
1185
+ };
1186
+ web3: {
1187
+ signup: (providerSlug: string) => Promise<void>;
1188
+ };
1189
+ connectBlockAuth: () => void;
1190
+ oauth: {
1191
+ signupGoogle: (flow?: "auth-code" | "implicit") => Promise<void>;
1192
+ signupMicrosoft: () => Promise<void>;
1193
+ configureGoogle: typeof configureGoogle;
1194
+ signInWithGoogle: typeof signInWithGoogle;
1195
+ configureMicrosoft: typeof configureMicrosoft;
1196
+ getMicrosoftProvider: typeof getMicrosoftProvider;
1197
+ signInWithMicrosoft: typeof signInWithMicrosoft;
1198
+ };
1199
+ requestSignin: () => void;
1200
+ cancelTxns: () => void;
1201
+ txns: {
1202
+ reject: () => void;
1203
+ accept: (opts: {
1204
+ lifetime: number;
1205
+ userParams?: Record<string, string>;
1206
+ grantedParams?: string[];
1207
+ revokedParams?: string[];
1208
+ }) => void;
1209
+ dataRequest: (txnId: number | string) => Promise<TxnDataRequest | null>;
1210
+ report: (slug: string) => void;
1211
+ };
1212
+ restore: () => Promise<RestoreResult>;
1213
+ finalizeRestorationExpired: () => void;
1214
+ logout: () => Promise<void>;
1215
+ openModal: (name: ModalName) => void;
1216
+ closeModal: (name?: ModalName) => void;
1217
+ closeAllModals: () => void;
1218
+ wsConnectTimeout: number;
1219
+ wsConnectRetries: number;
1220
+ apiUrl: string | undefined;
1221
+ provider: BlockAuthProvider;
1222
+ };
1223
+ type BlockAuthClient = ReturnType<typeof createBlockAuthClient>;
1224
+
1225
+ type TxnDataMode = 'required' | 'optional';
1226
+ type TxnDataStatus = 'shared' | 'granted' | 'consent' | 'missing';
1227
+ interface TxnDataParam {
1228
+ slug: string;
1229
+ mode: TxnDataMode;
1230
+ status: TxnDataStatus;
1231
+ value: string | null;
1232
+ }
1233
+ interface TxnDataRequest {
1234
+ txnId: number | string;
1235
+ params: TxnDataParam[];
1236
+ }
1237
+
1238
+ declare const TEXTS: {
1239
+ readonly edit: {
1240
+ readonly es: "Editar";
1241
+ readonly en: "Edit";
1242
+ };
1243
+ readonly searchEngine: {
1244
+ readonly es: "Buscador";
1245
+ readonly en: "Search engine";
1246
+ };
1247
+ readonly webTypes: {
1248
+ readonly es: "Tipos de web";
1249
+ readonly en: "Web types";
1250
+ };
1251
+ readonly columns: {
1252
+ readonly es: "Columnas";
1253
+ readonly en: "Columns";
1254
+ };
1255
+ readonly order: {
1256
+ readonly es: "Orden";
1257
+ readonly en: "Order";
1258
+ };
1259
+ readonly activate: {
1260
+ readonly es: "Activar";
1261
+ readonly en: "Activate";
1262
+ };
1263
+ readonly providerName: {
1264
+ readonly es: "Nombre del provider";
1265
+ readonly en: "Provider name";
1266
+ };
1267
+ readonly connectWith: {
1268
+ readonly es: "Conectar con";
1269
+ readonly en: "Connect with";
1270
+ };
1271
+ readonly search: {
1272
+ readonly es: "Buscar ...";
1273
+ readonly en: "Search ...";
1274
+ };
1275
+ readonly webTypeAll: {
1276
+ readonly es: "Todos";
1277
+ readonly en: "All";
1278
+ };
1279
+ readonly login: {
1280
+ readonly es: "Iniciar sesión";
1281
+ readonly en: "Log In";
1282
+ };
1283
+ readonly lastStep: {
1284
+ readonly es: "Completa el último paso";
1285
+ readonly en: "Complete the last step";
1286
+ };
1287
+ readonly footerFirst: {
1288
+ readonly es: "¿Esperando un registro aburrido?";
1289
+ readonly en: "Expecting a boring signup?";
1290
+ };
1291
+ readonly footerSecond: {
1292
+ readonly es: "Di adiós a las contraseñas";
1293
+ readonly en: "Say goodbye to passwords";
1294
+ };
1295
+ readonly permissionsRequired: {
1296
+ readonly es: "Permisos requeridos";
1297
+ readonly en: "Permissions required";
1298
+ };
1299
+ readonly solicitedData: {
1300
+ readonly es: "Datos solicitados";
1301
+ readonly en: "Solicited data";
1302
+ };
1303
+ readonly reject: {
1304
+ readonly es: "RECHAZAR";
1305
+ readonly en: "REJECT";
1306
+ };
1307
+ readonly accept: {
1308
+ readonly es: "ACEPTAR";
1309
+ readonly en: "ACCEPT";
1310
+ };
1311
+ readonly iAuthorizeThe: {
1312
+ readonly es: "Autorizo la";
1313
+ readonly en: "I authorize the";
1314
+ };
1315
+ readonly privacyPolicy: {
1316
+ readonly es: "Política de Privacidad";
1317
+ readonly en: "Privacy Policy";
1318
+ };
1319
+ readonly andThe: {
1320
+ readonly es: "y los";
1321
+ readonly en: "and the";
1322
+ };
1323
+ readonly termsAndConditions: {
1324
+ readonly es: "Términos y Condiciones";
1325
+ readonly en: "Terms and Conditions";
1326
+ };
1327
+ readonly configureSessionTime: {
1328
+ readonly es: "Quiero configurar el tiempo de mi sesión";
1329
+ readonly en: "I want to configure my session time";
1330
+ };
1331
+ readonly solicitsTo: {
1332
+ readonly es: "solicita a";
1333
+ readonly en: "solicits to";
1334
+ };
1335
+ readonly required: {
1336
+ readonly es: "Requerido";
1337
+ readonly en: "Required";
1338
+ };
1339
+ readonly optional: {
1340
+ readonly es: "Opcional";
1341
+ readonly en: "Optional";
1342
+ };
1343
+ readonly fillRequiredFields: {
1344
+ readonly es: "Completa los campos requeridos para continuar";
1345
+ readonly en: "Fill required fields to continue";
1346
+ };
1347
+ readonly completeRequiredData: {
1348
+ readonly es: "Autoriza o completa los datos obligatorios para continuar";
1349
+ readonly en: "Authorize or fill in the required data to continue";
1350
+ };
1351
+ readonly requiredDataError: {
1352
+ readonly es: "No se pudo aceptar: faltan datos obligatorios o no son válidos. Revísalos e inténtalo de nuevo.";
1353
+ readonly en: "Could not accept: required data is missing or invalid. Please review it and try again.";
1354
+ };
1355
+ readonly shareData: {
1356
+ readonly es: "Ceder";
1357
+ readonly en: "Share";
1358
+ };
1359
+ readonly saveData: {
1360
+ readonly es: "Guardar";
1361
+ readonly en: "Save";
1362
+ };
1363
+ readonly undoChange: {
1364
+ readonly es: "Deshacer";
1365
+ readonly en: "Undo";
1366
+ };
1367
+ readonly savedToProfileHint: {
1368
+ readonly es: "Se guardará en tu perfil al aceptar";
1369
+ readonly en: "It will be saved to your profile on accept";
1370
+ };
1371
+ readonly pendingChangeHint: {
1372
+ readonly es: "Guarda o deshaz el cambio";
1373
+ readonly en: "Save or undo the change";
1374
+ };
1375
+ readonly notSharedHint: {
1376
+ readonly es: "Este dato no se cederá";
1377
+ readonly en: "This data will not be shared";
1378
+ };
1379
+ readonly clearField: {
1380
+ readonly es: "Limpiar campo";
1381
+ readonly en: "Clear field";
1382
+ };
1383
+ readonly acceptData: {
1384
+ readonly es: "Aceptar";
1385
+ readonly en: "Accept";
1386
+ };
1387
+ readonly noTransactionsFound: {
1388
+ readonly es: "No se encontraron transacciones";
1389
+ readonly en: "No transactions found";
1390
+ };
1391
+ readonly otpExpiredTitle: {
1392
+ readonly es: "Verificación caducada";
1393
+ readonly en: "Verification expired";
1394
+ };
1395
+ readonly otpExpiredExtension: {
1396
+ readonly es: "Introduce tu código en la extensión de Block-Auth para aprobar este acceso.";
1397
+ readonly en: "Enter your code in the Block-Auth extension to approve this access.";
1398
+ };
1399
+ readonly otpExpiredApp: {
1400
+ readonly es: "Introduce tu código en la app de Block-Auth para aprobar este acceso.";
1401
+ readonly en: "Enter your code in the Block-Auth app to approve this access.";
1402
+ };
1403
+ readonly openExtension: {
1404
+ readonly es: "Abrir extensión";
1405
+ readonly en: "Open extension";
1406
+ };
1407
+ readonly noAppKeyFound: {
1408
+ readonly es: "No se encontró la clave de la aplicación";
1409
+ readonly en: "No application key found";
1410
+ };
1411
+ readonly noContractAddressFound: {
1412
+ readonly es: "No se encontró la dirección del contrato";
1413
+ readonly en: "No contract address found";
1414
+ };
1415
+ readonly noTransactionsParamsFound: {
1416
+ readonly es: "No se encontraron parámetros de la transacción";
1417
+ readonly en: "No transaction params found";
1418
+ };
1419
+ readonly somethingWentWrong: {
1420
+ readonly es: "Algo salió mal";
1421
+ readonly en: "Something went wrong";
1422
+ };
1423
+ readonly permTemporalIdentity: {
1424
+ readonly es: "Acceso temporal a tu identidad";
1425
+ readonly en: "Temporal access to identity";
1426
+ };
1427
+ readonly permAuthorisedApps: {
1428
+ readonly es: "Acceso a la lista de aplicaciones autorizadas";
1429
+ readonly en: "Access to the list of authorised apps";
1430
+ };
1431
+ readonly permOnlyThisTxn: {
1432
+ readonly es: "Solo se firmará esta transacción";
1433
+ readonly en: "Only this transaction will be signed";
1434
+ };
1435
+ readonly firstName: {
1436
+ readonly es: "Nombre";
1437
+ readonly en: "First Name";
1438
+ };
1439
+ readonly lastName: {
1440
+ readonly es: "Apellido";
1441
+ readonly en: "Last Name";
1442
+ };
1443
+ readonly secondLastName: {
1444
+ readonly es: "Segundo apellido";
1445
+ readonly en: "Second Last Name";
1446
+ };
1447
+ readonly email: {
1448
+ readonly es: "Correo electrónico";
1449
+ readonly en: "Email";
1450
+ };
1451
+ readonly phone: {
1452
+ readonly es: "Teléfono";
1453
+ readonly en: "Phone";
1454
+ };
1455
+ readonly onlyLettersAllowed: {
1456
+ readonly es: "Solo se permiten letras y espacios";
1457
+ readonly en: "Only letters and spaces allowed";
1458
+ };
1459
+ readonly enterValidEmail: {
1460
+ readonly es: "Introduce un correo electrónico válido (ej. nombre@dominio.com)";
1461
+ readonly en: "Enter a valid email (e.g. name@domain.com)";
1462
+ };
1463
+ readonly enterValidPhone: {
1464
+ readonly es: "Introduce un número de teléfono válido";
1465
+ readonly en: "Enter a valid phone number";
1466
+ };
1467
+ readonly phoneCountry: {
1468
+ readonly es: "País";
1469
+ readonly en: "Country";
1470
+ };
1471
+ readonly searchPhoneCountry: {
1472
+ readonly es: "Buscar país o prefijo";
1473
+ readonly en: "Search country or code";
1474
+ };
1475
+ readonly noPhoneCountryResults: {
1476
+ readonly es: "No hay países que coincidan";
1477
+ readonly en: "No matching countries";
1478
+ };
1479
+ readonly helpUsReport: {
1480
+ readonly es: "Ayúdanos a mejorar y reporta el error aquí";
1481
+ readonly en: "Help us get better and report the error here";
1482
+ };
1483
+ readonly thanksForReport: {
1484
+ readonly es: "¡Gracias por reportar el error!";
1485
+ readonly en: "Thanks for reporting the error!";
1486
+ };
1487
+ readonly report: {
1488
+ readonly es: "REPORTAR";
1489
+ readonly en: "REPORT";
1490
+ };
1491
+ readonly close: {
1492
+ readonly es: "Cerrar";
1493
+ readonly en: "Close";
1494
+ };
1495
+ readonly modalWillCloseIn: {
1496
+ readonly es: "Este modal se cerrará en...";
1497
+ readonly en: "This modal will close in...";
1498
+ };
1499
+ };
1500
+ type TextKey = keyof typeof TEXTS;
1501
+ declare function t(key: TextKey, locale?: Locale): string;
1502
+
1503
+ declare const PARAM_LABEL_KEYS: Record<string, TextKey>;
1504
+ declare const PARAM_DISPLAY_ORDER: string[];
1505
+ declare const PARAM_INPUT_TYPE: Record<string, string>;
1506
+ declare const PARAM_VALIDATORS: Record<string, (v: string) => boolean>;
1507
+ declare const PARAM_NORMALIZERS: Record<string, (v: string) => string>;
1508
+ declare const PARAM_DISPLAY_FORMATTERS: Record<string, (v: string) => string>;
1509
+ declare const formatParamValue: (slug: string, value: string) => string;
1510
+ declare const normalizeParamValue: (slug: string, value: string) => string;
1511
+ declare const PARAM_ERROR_KEYS: Record<string, TextKey>;
1512
+ type SolicitedParam = TxnDataParam;
1513
+ interface SolicitedDataForm {
1514
+ values: Record<string, string>;
1515
+ shared: Record<string, boolean>;
1516
+ saved: Record<string, string>;
1517
+ }
1518
+ declare const EMPTY_SOLICITED_DATA_FORM: SolicitedDataForm;
1519
+ interface SolicitedField extends SolicitedParam {
1520
+ profileValue: string;
1521
+ inputValue: string;
1522
+ isEmpty: boolean;
1523
+ isShared: boolean;
1524
+ isChanged: boolean;
1525
+ isSaved: boolean;
1526
+ isValid: boolean;
1527
+ isComplete: boolean;
1528
+ }
1529
+ interface SolicitedAcceptParams {
1530
+ userParams: Record<string, string>;
1531
+ grantedParams: string[];
1532
+ revokedParams: string[];
1533
+ }
1534
+ declare const isValidParamValue: (slug: string, value: string) => boolean;
1535
+ declare function getSolicitedParams({ params, requiredParams, optionalParams, }: {
1536
+ params?: TxnDataParam[] | null;
1537
+ requiredParams?: string[];
1538
+ optionalParams?: string[];
1539
+ }): SolicitedParam[];
1540
+ declare function getSolicitedFields(items: SolicitedParam[], form?: SolicitedDataForm, withConsent?: boolean): SolicitedField[];
1541
+ declare function getSolicitedHintKey(field: SolicitedField, withConsent?: boolean): TextKey | null;
1542
+ declare const isSolicitedHintSuccess: (field: SolicitedField) => boolean;
1543
+ declare const isSolicitedDataComplete: (fields: SolicitedField[]) => boolean;
1544
+ declare function getSolicitedAcceptParams(fields: SolicitedField[]): SolicitedAcceptParams;
1545
+ declare const setSolicitedValue: (form: SolicitedDataForm, item: SolicitedParam, value: string) => SolicitedDataForm;
1546
+ declare const setSolicitedShared: (form: SolicitedDataForm, slug: string, shared: boolean) => SolicitedDataForm;
1547
+ declare const saveSolicitedValue: (form: SolicitedDataForm, slug: string) => SolicitedDataForm;
1548
+ declare const undoSolicitedValue: (form: SolicitedDataForm, item: SolicitedParam) => SolicitedDataForm;
1549
+
1550
+ type PhoneCountryCode = CountryCode;
1551
+ interface PhoneCountry {
1552
+ iso2: PhoneCountryCode;
1553
+ dialCode: string;
1554
+ flag: string;
1555
+ name: string;
1556
+ }
1557
+ interface PhoneParts {
1558
+ country: PhoneCountryCode;
1559
+ nationalNumber: string;
1560
+ }
1561
+ interface PhoneDraft extends PhoneParts {
1562
+ value: string;
1563
+ }
1564
+ declare const DEFAULT_PHONE_COUNTRY: PhoneCountryCode;
1565
+ declare const isPhoneCountry: (value: string | null | undefined) => value is PhoneCountryCode;
1566
+ declare function getPhoneCountryFlag(iso2: string): string;
1567
+ declare function getPhoneDialCode(iso2: PhoneCountryCode): string;
1568
+ declare function getPhoneCountries(locale?: Locale): PhoneCountry[];
1569
+ declare function searchPhoneCountries(countries: PhoneCountry[], query: string): PhoneCountry[];
1570
+ declare function isValidPhoneValue(value: string | null | undefined): boolean;
1571
+ declare function toPhoneE164(value: string | null | undefined): string | null;
1572
+ declare function formatPhoneForDisplay(value: string | null | undefined): string;
1573
+ declare function getDefaultPhoneCountry(languages?: readonly string[]): PhoneCountryCode;
1574
+ declare function parsePhoneValue(value: string | null | undefined, fallbackCountry?: PhoneCountryCode): PhoneParts;
1575
+ declare function buildPhoneE164(country: PhoneCountryCode, nationalNumber: string): string | null;
1576
+ declare function buildPhoneValue(country: PhoneCountryCode, nationalNumber: string): string;
1577
+ declare function updatePhoneDraft(country: PhoneCountryCode, nationalNumber: string): PhoneDraft;
1578
+ declare function resolvePhoneDraft(value: string | null | undefined, draft?: PhoneDraft | null, fallbackCountry?: PhoneCountryCode): PhoneDraft;
1579
+
1580
+ interface AuthRuntimeCallbacks {
1581
+ onSuccess?: (address: string) => void | Promise<void>;
1582
+ onError?: () => void | Promise<void>;
1583
+ onLogout?: () => void | Promise<void>;
1584
+ }
1585
+ declare function createAuthRuntime(client: BlockAuthClient, callbacks?: AuthRuntimeCallbacks): {
1586
+ start: () => Promise<void>;
1587
+ stop: () => void;
1588
+ logout: () => Promise<void>;
1589
+ };
1590
+ type AuthRuntime = ReturnType<typeof createAuthRuntime>;
1591
+
1592
+ interface EvmOptions {
1593
+ /**
1594
+ * WalletConnect Cloud project id. Optional: si se omite, el conector de
1595
+ * WalletConnect (conexión por QR con wallets móviles) no se registra y solo
1596
+ * queda disponible el conector `injected` (MetaMask u otras extensiones).
1597
+ */
1598
+ walletConnectProjectId?: string;
1599
+ rpcUrl?: string;
1600
+ }
1601
+ declare function createEvmWallet(opts: EvmOptions): {
1602
+ config: _wagmi_core.Config<readonly [{
1603
+ blockExplorers: {
1604
+ readonly default: {
1605
+ readonly name: "Etherscan";
1606
+ readonly url: "https://etherscan.io";
1607
+ readonly apiUrl: "https://api.etherscan.io/api";
1608
+ };
1609
+ };
1610
+ blockTime: 12000;
1611
+ contracts: {
1612
+ readonly ensUniversalResolver: {
1613
+ readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
1614
+ readonly blockCreated: 23085558;
1615
+ };
1616
+ readonly multicall3: {
1617
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
1618
+ readonly blockCreated: 14353601;
1619
+ };
1620
+ };
1621
+ ensTlds?: readonly string[] | undefined;
1622
+ id: 1;
1623
+ name: "Ethereum";
1624
+ nativeCurrency: {
1625
+ readonly name: "Ether";
1626
+ readonly symbol: "ETH";
1627
+ readonly decimals: 18;
1628
+ };
1629
+ experimental_preconfirmationTime?: number | undefined | undefined;
1630
+ rpcUrls: {
1631
+ readonly default: {
1632
+ readonly http: readonly ["https://eth.merkle.io"];
1633
+ };
1634
+ };
1635
+ sourceId?: number | undefined | undefined;
1636
+ testnet?: boolean | undefined | undefined;
1637
+ custom?: Record<string, unknown> | undefined;
1638
+ extendSchema?: Record<string, unknown> | undefined;
1639
+ fees?: viem.ChainFees<undefined> | undefined;
1640
+ formatters?: undefined;
1641
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
1642
+ client: viem.Client;
1643
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1644
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
1645
+ client: viem.Client;
1646
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1647
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1648
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
1649
+ }] | undefined;
1650
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1651
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1652
+ }], {
1653
+ 1: viem.HttpTransport<undefined, false>;
1654
+ }, readonly [_wagmi_core.CreateConnectorFn<{
1655
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1656
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1657
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
1658
+ isApexWallet?: true | undefined;
1659
+ isAvalanche?: true | undefined;
1660
+ isBackpack?: true | undefined;
1661
+ isBifrost?: true | undefined;
1662
+ isBitKeep?: true | undefined;
1663
+ isBitski?: true | undefined;
1664
+ isBlockWallet?: true | undefined;
1665
+ isBraveWallet?: true | undefined;
1666
+ isCoinbaseWallet?: true | undefined;
1667
+ isDawn?: true | undefined;
1668
+ isEnkrypt?: true | undefined;
1669
+ isExodus?: true | undefined;
1670
+ isFrame?: true | undefined;
1671
+ isFrontier?: true | undefined;
1672
+ isGamestop?: true | undefined;
1673
+ isHyperPay?: true | undefined;
1674
+ isImToken?: true | undefined;
1675
+ isKuCoinWallet?: true | undefined;
1676
+ isMathWallet?: true | undefined;
1677
+ isMetaMask?: true | undefined;
1678
+ isOkxWallet?: true | undefined;
1679
+ isOKExWallet?: true | undefined;
1680
+ isOneInchAndroidWallet?: true | undefined;
1681
+ isOneInchIOSWallet?: true | undefined;
1682
+ isOpera?: true | undefined;
1683
+ isPhantom?: true | undefined;
1684
+ isPortal?: true | undefined;
1685
+ isRabby?: true | undefined;
1686
+ isRainbow?: true | undefined;
1687
+ isStatus?: true | undefined;
1688
+ isTally?: true | undefined;
1689
+ isTokenPocket?: true | undefined;
1690
+ isTokenary?: true | undefined;
1691
+ isTrust?: true | undefined;
1692
+ isTrustWallet?: true | undefined;
1693
+ isUniswapWallet?: true | undefined;
1694
+ isXDEFI?: true | undefined;
1695
+ isZerion?: true | undefined;
1696
+ providers?: {
1697
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1698
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1699
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
1700
+ isApexWallet?: true | undefined;
1701
+ isAvalanche?: true | undefined;
1702
+ isBackpack?: true | undefined;
1703
+ isBifrost?: true | undefined;
1704
+ isBitKeep?: true | undefined;
1705
+ isBitski?: true | undefined;
1706
+ isBlockWallet?: true | undefined;
1707
+ isBraveWallet?: true | undefined;
1708
+ isCoinbaseWallet?: true | undefined;
1709
+ isDawn?: true | undefined;
1710
+ isEnkrypt?: true | undefined;
1711
+ isExodus?: true | undefined;
1712
+ isFrame?: true | undefined;
1713
+ isFrontier?: true | undefined;
1714
+ isGamestop?: true | undefined;
1715
+ isHyperPay?: true | undefined;
1716
+ isImToken?: true | undefined;
1717
+ isKuCoinWallet?: true | undefined;
1718
+ isMathWallet?: true | undefined;
1719
+ isMetaMask?: true | undefined;
1720
+ isOkxWallet?: true | undefined;
1721
+ isOKExWallet?: true | undefined;
1722
+ isOneInchAndroidWallet?: true | undefined;
1723
+ isOneInchIOSWallet?: true | undefined;
1724
+ isOpera?: true | undefined;
1725
+ isPhantom?: true | undefined;
1726
+ isPortal?: true | undefined;
1727
+ isRabby?: true | undefined;
1728
+ isRainbow?: true | undefined;
1729
+ isStatus?: true | undefined;
1730
+ isTally?: true | undefined;
1731
+ isTokenPocket?: true | undefined;
1732
+ isTokenary?: true | undefined;
1733
+ isTrust?: true | undefined;
1734
+ isTrustWallet?: true | undefined;
1735
+ isUniswapWallet?: true | undefined;
1736
+ isXDEFI?: true | undefined;
1737
+ isZerion?: true | undefined;
1738
+ providers?: /*elided*/ any[] | undefined | undefined;
1739
+ _events?: {
1740
+ connect?: (() => void) | undefined;
1741
+ } | undefined | undefined;
1742
+ _state?: {
1743
+ accounts?: string[];
1744
+ initialized?: boolean;
1745
+ isConnected?: boolean;
1746
+ isPermanentlyDisconnected?: boolean;
1747
+ isUnlocked?: boolean;
1748
+ } | undefined | undefined;
1749
+ }[] | undefined | undefined;
1750
+ _events?: {
1751
+ connect?: (() => void) | undefined;
1752
+ } | undefined | undefined;
1753
+ _state?: {
1754
+ accounts?: string[];
1755
+ initialized?: boolean;
1756
+ isConnected?: boolean;
1757
+ isPermanentlyDisconnected?: boolean;
1758
+ isUnlocked?: boolean;
1759
+ } | undefined | undefined;
1760
+ } | undefined, {
1761
+ onConnect(connectInfo: viem.ProviderConnectInfo): void;
1762
+ }, {
1763
+ [x: `${string}.disconnected`]: true;
1764
+ "injected.connected": true;
1765
+ }>, _wagmi_core.CreateConnectorFn<any, {
1766
+ connect<withCapabilities extends boolean = false>(parameters?: {
1767
+ chainId?: number | undefined;
1768
+ isReconnecting?: boolean | undefined;
1769
+ pairingTopic?: string | undefined;
1770
+ withCapabilities?: withCapabilities | boolean | undefined;
1771
+ }): Promise<{
1772
+ accounts: withCapabilities extends true ? readonly {
1773
+ address: viem.Address;
1774
+ }[] : readonly viem.Address[];
1775
+ chainId: number;
1776
+ }>;
1777
+ getNamespaceChainsIds(): number[];
1778
+ getRequestedChainsIds(): Promise<number[]>;
1779
+ isChainsStale(): Promise<boolean>;
1780
+ onConnect(connectInfo: viem.ProviderConnectInfo): void;
1781
+ onDisplayUri(uri: string): void;
1782
+ onSessionDelete(data: {
1783
+ topic: string;
1784
+ }): void;
1785
+ setRequestedChainsIds(chains: number[]): void;
1786
+ requestedChainsStorageKey: `${string}.requestedChains`;
1787
+ }, {
1788
+ [x: `${string}.requestedChains`]: number[];
1789
+ }>] | readonly [_wagmi_core.CreateConnectorFn<{
1790
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1791
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1792
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
1793
+ isApexWallet?: true | undefined;
1794
+ isAvalanche?: true | undefined;
1795
+ isBackpack?: true | undefined;
1796
+ isBifrost?: true | undefined;
1797
+ isBitKeep?: true | undefined;
1798
+ isBitski?: true | undefined;
1799
+ isBlockWallet?: true | undefined;
1800
+ isBraveWallet?: true | undefined;
1801
+ isCoinbaseWallet?: true | undefined;
1802
+ isDawn?: true | undefined;
1803
+ isEnkrypt?: true | undefined;
1804
+ isExodus?: true | undefined;
1805
+ isFrame?: true | undefined;
1806
+ isFrontier?: true | undefined;
1807
+ isGamestop?: true | undefined;
1808
+ isHyperPay?: true | undefined;
1809
+ isImToken?: true | undefined;
1810
+ isKuCoinWallet?: true | undefined;
1811
+ isMathWallet?: true | undefined;
1812
+ isMetaMask?: true | undefined;
1813
+ isOkxWallet?: true | undefined;
1814
+ isOKExWallet?: true | undefined;
1815
+ isOneInchAndroidWallet?: true | undefined;
1816
+ isOneInchIOSWallet?: true | undefined;
1817
+ isOpera?: true | undefined;
1818
+ isPhantom?: true | undefined;
1819
+ isPortal?: true | undefined;
1820
+ isRabby?: true | undefined;
1821
+ isRainbow?: true | undefined;
1822
+ isStatus?: true | undefined;
1823
+ isTally?: true | undefined;
1824
+ isTokenPocket?: true | undefined;
1825
+ isTokenary?: true | undefined;
1826
+ isTrust?: true | undefined;
1827
+ isTrustWallet?: true | undefined;
1828
+ isUniswapWallet?: true | undefined;
1829
+ isXDEFI?: true | undefined;
1830
+ isZerion?: true | undefined;
1831
+ providers?: {
1832
+ on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1833
+ removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
1834
+ request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
1835
+ isApexWallet?: true | undefined;
1836
+ isAvalanche?: true | undefined;
1837
+ isBackpack?: true | undefined;
1838
+ isBifrost?: true | undefined;
1839
+ isBitKeep?: true | undefined;
1840
+ isBitski?: true | undefined;
1841
+ isBlockWallet?: true | undefined;
1842
+ isBraveWallet?: true | undefined;
1843
+ isCoinbaseWallet?: true | undefined;
1844
+ isDawn?: true | undefined;
1845
+ isEnkrypt?: true | undefined;
1846
+ isExodus?: true | undefined;
1847
+ isFrame?: true | undefined;
1848
+ isFrontier?: true | undefined;
1849
+ isGamestop?: true | undefined;
1850
+ isHyperPay?: true | undefined;
1851
+ isImToken?: true | undefined;
1852
+ isKuCoinWallet?: true | undefined;
1853
+ isMathWallet?: true | undefined;
1854
+ isMetaMask?: true | undefined;
1855
+ isOkxWallet?: true | undefined;
1856
+ isOKExWallet?: true | undefined;
1857
+ isOneInchAndroidWallet?: true | undefined;
1858
+ isOneInchIOSWallet?: true | undefined;
1859
+ isOpera?: true | undefined;
1860
+ isPhantom?: true | undefined;
1861
+ isPortal?: true | undefined;
1862
+ isRabby?: true | undefined;
1863
+ isRainbow?: true | undefined;
1864
+ isStatus?: true | undefined;
1865
+ isTally?: true | undefined;
1866
+ isTokenPocket?: true | undefined;
1867
+ isTokenary?: true | undefined;
1868
+ isTrust?: true | undefined;
1869
+ isTrustWallet?: true | undefined;
1870
+ isUniswapWallet?: true | undefined;
1871
+ isXDEFI?: true | undefined;
1872
+ isZerion?: true | undefined;
1873
+ providers?: /*elided*/ any[] | undefined | undefined;
1874
+ _events?: {
1875
+ connect?: (() => void) | undefined;
1876
+ } | undefined | undefined;
1877
+ _state?: {
1878
+ accounts?: string[];
1879
+ initialized?: boolean;
1880
+ isConnected?: boolean;
1881
+ isPermanentlyDisconnected?: boolean;
1882
+ isUnlocked?: boolean;
1883
+ } | undefined | undefined;
1884
+ }[] | undefined | undefined;
1885
+ _events?: {
1886
+ connect?: (() => void) | undefined;
1887
+ } | undefined | undefined;
1888
+ _state?: {
1889
+ accounts?: string[];
1890
+ initialized?: boolean;
1891
+ isConnected?: boolean;
1892
+ isPermanentlyDisconnected?: boolean;
1893
+ isUnlocked?: boolean;
1894
+ } | undefined | undefined;
1895
+ } | undefined, {
1896
+ onConnect(connectInfo: viem.ProviderConnectInfo): void;
1897
+ }, {
1898
+ [x: `${string}.disconnected`]: true;
1899
+ "injected.connected": true;
1900
+ }>]>;
1901
+ connectInjected: () => Promise<WalletState>;
1902
+ connectWalletConnect: () => Promise<WalletState>;
1903
+ disconnect: () => Promise<void>;
1904
+ signMessage: (message: string) => Promise<`0x${string}`>;
1905
+ };
1906
+ type EvmWallet = ReturnType<typeof createEvmWallet>;
1907
+
1908
+ declare function createSolanaWallet(): {
1909
+ connect: () => Promise<string>;
1910
+ disconnect: () => Promise<void>;
1911
+ signMessage: (message: string) => Promise<Uint8Array>;
1912
+ };
1913
+ type SolanaWallet = ReturnType<typeof createSolanaWallet>;
1914
+
1915
+ /** Mobile deep-link to open the dapp inside a wallet's in-app browser. */
1916
+ declare function deepLinkFor(service: string, domain: string): string;
1917
+ /** Render `text` as a PNG data-URL QR code. */
1918
+ declare function makeQrDataUrl(text: string): Promise<string>;
1919
+
1920
+ /**
1921
+ * Every localStorage key the SDK owns. Cleared together by `clearBrowserState`.
1922
+ */
1923
+ declare const BLOCKAUTH_STORAGE_KEYS: readonly ["blockauth-session", "blockauth-ui", "blockauth-connected", "blockauth-logged-out", "blockauth-uncompleted-signup"];
1924
+ interface UiConfig {
1925
+ installed: boolean;
1926
+ isUser: boolean;
1927
+ isUserActive: boolean;
1928
+ isLocked: boolean;
1929
+ }
1930
+ interface SessionConfig {
1931
+ did: string;
1932
+ token: string;
1933
+ }
1934
+ interface ExternalServiceConfig {
1935
+ connected: boolean;
1936
+ service: string;
1937
+ did: string;
1938
+ token: string;
1939
+ iconUrl: string;
1940
+ account: string;
1941
+ networkId: string;
1942
+ }
1943
+ interface SetSessionParams {
1944
+ installed?: boolean;
1945
+ isUser?: boolean;
1946
+ isUserActive?: boolean;
1947
+ isLocked?: boolean;
1948
+ did?: string;
1949
+ token?: string;
1950
+ externalService?: Partial<ExternalServiceConfig>;
1951
+ serviceName?: string;
1952
+ /** Optional override for the backend base url used to reach
1953
+ * `/auth/session` (defaults to `https://api.block-auth.io`). Mirrors how
1954
+ * `WsClient`'s `url` is overridden. */
1955
+ apiUrl?: string;
1956
+ }
1957
+ declare class BrowserBase {
1958
+ private _sessionToken;
1959
+ private _externalToken;
1960
+ /**
1961
+ * Wipe every SDK-owned localStorage key and reseed the defaults. Unlike a
1962
+ * per-key reset it also clears the `blockauth-logged-out` /
1963
+ * `blockauth-uncompleted-signup` flags, and can preserve the
1964
+ * extension-installed marker across the wipe.
1965
+ */
1966
+ clearBrowserState({ keepExtensionInstalled }?: {
1967
+ keepExtensionInstalled?: boolean | undefined;
1968
+ }): void;
1969
+ reset(target?: 'all' | 'ui' | 'session' | 'external', { keepExtensionInstalled }?: {
1970
+ keepExtensionInstalled?: boolean | undefined;
1971
+ }): void;
1972
+ /**
1973
+ * Stable id for this browser, generated once and persisted in localStorage
1974
+ * (every tab of this browser shares it, and it survives logout). Lets the
1975
+ * server scope a signout to just this browser instead of every device
1976
+ * signed in with the same account.
1977
+ */
1978
+ getDeviceSessionId(): string;
1979
+ /**
1980
+ * Obtains the current UI configuration using localStorage as the
1981
+ * source of truth, seeding the default if none is stored.
1982
+ */
1983
+ getUI(): UiConfig;
1984
+ /**
1985
+ * Auxiliary method to update the UI configuration using websocket events.
1986
+ */
1987
+ setUILocked(isLocked: boolean): void;
1988
+ setUI({ installed, isUser, isUserActive, isLocked, }?: Partial<UiConfig>): void;
1989
+ /**
1990
+ * `did` is read from localStorage; `token` is never persisted there (see
1991
+ * the SECURITY NOTE above) and comes from the in-memory field instead, so
1992
+ * it reads back as '' after a page reload even though `did` survives.
1993
+ */
1994
+ getSession(): SessionConfig;
1995
+ /**
1996
+ * Obtains the configuration about the address and the service where the
1997
+ * user is connected. As with `getSession()`, `token` is never persisted
1998
+ * to localStorage - it's overlaid here from the in-memory field.
1999
+ */
2000
+ getExternalService(): ExternalServiceConfig;
2001
+ /**
2002
+ * Auxiliary method to update the SESSION configuration using websocket
2003
+ * events.
2004
+ *
2005
+ * IMPORTANT: the wallet JWT (`token`) is never persisted to localStorage
2006
+ * anymore (see the SECURITY NOTE at the top of this file). It's kept in
2007
+ * the `_sessionToken`/`_externalToken` in-memory fields instead, and -
2008
+ * when it's a fresh/changed `blockauth` token - bridged into an httpOnly
2009
+ * `blockauth-session` cookie via the `/auth/session` backend endpoint.
2010
+ * Only the (non-sensitive) `did` is persisted, for UI/reload purposes.
2011
+ *
2012
+ * Returns a Promise once the (best-effort) session-bridge call has
2013
+ * settled; callers that don't need to wait for it can keep calling this
2014
+ * without awaiting, same as before - every state mutation below happens
2015
+ * synchronously, before the `await`.
2016
+ */
2017
+ setSession({ installed, isUser, isUserActive, isLocked, did, token, externalService, serviceName, apiUrl, }?: SetSessionParams): Promise<void>;
2018
+ externalServiceDisconnect(): void;
2019
+ getLang(): string;
2020
+ setLang(lang: string): void;
2021
+ subscribe(callback: (value: UiConfig | null) => void): void;
2022
+ }
2023
+ declare const browserBase: BrowserBase;
2024
+
2025
+ declare function isFirefox(): boolean;
2026
+ declare function getExtensionStoreUrl(): string;
2027
+
2028
+ /**
2029
+ * Returns the image URL (or base64 data-URI) for a given service slug.
2030
+ * Falls back to the Block-Auth logo for unknown services.
2031
+ */
2032
+ declare const imgUrlByService: (service?: string) => string;
2033
+ /**
2034
+ * Returns a UTC date string of the form `YYYY-MM-DDTHH:mm:ss.SSS` (no trailing
2035
+ * `Z`), so the auth runtime can compute the unsign timeout against UTC.
2036
+ */
2037
+ declare const getUTCDateString: (date?: Date | string | number) => string;
2038
+ /**
2039
+ * Formats a number of seconds into a human-readable "Hh Mm" / "Mm" string.
2040
+ */
2041
+ declare const secsToText: (secs?: number) => string;
2042
+ /**
2043
+ * Best-effort retrieval of the caller's public IP. Returns a placeholder
2044
+ * on failure.
2045
+ */
2046
+ declare const getIp: () => Promise<string | undefined>;
2047
+ /**
2048
+ * Normalizes a URL to use the https scheme.
2049
+ */
2050
+ declare const cleanUrl: (url: string) => string;
2051
+ /**
2052
+ * Validates that a URL looks like an image URL and that the image can be
2053
+ * decoded by the browser. Returns false in non-browser environments.
2054
+ */
2055
+ declare const isValidImgUrl: (url: string) => Promise<boolean>;
2056
+
2057
+ declare const index_BLOCKAUTH_STORAGE_KEYS: typeof BLOCKAUTH_STORAGE_KEYS;
2058
+ type index_ExternalServiceConfig = ExternalServiceConfig;
2059
+ type index_SessionConfig = SessionConfig;
2060
+ type index_SetSessionParams = SetSessionParams;
2061
+ type index_UiConfig = UiConfig;
2062
+ declare const index_browserBase: typeof browserBase;
2063
+ declare const index_cleanUrl: typeof cleanUrl;
2064
+ declare const index_getExtensionStoreUrl: typeof getExtensionStoreUrl;
2065
+ declare const index_getIp: typeof getIp;
2066
+ declare const index_getUTCDateString: typeof getUTCDateString;
2067
+ declare const index_imgUrlByService: typeof imgUrlByService;
2068
+ declare const index_isFirefox: typeof isFirefox;
2069
+ declare const index_isValidImgUrl: typeof isValidImgUrl;
2070
+ declare const index_secsToText: typeof secsToText;
2071
+ declare namespace index {
2072
+ export { index_BLOCKAUTH_STORAGE_KEYS as BLOCKAUTH_STORAGE_KEYS, type index_ExternalServiceConfig as ExternalServiceConfig, type index_SessionConfig as SessionConfig, type index_SetSessionParams as SetSessionParams, type index_UiConfig as UiConfig, index_browserBase as browserBase, index_cleanUrl as cleanUrl, index_getExtensionStoreUrl as getExtensionStoreUrl, index_getIp as getIp, index_getUTCDateString as getUTCDateString, index_imgUrlByService as imgUrlByService, index_isFirefox as isFirefox, index_isValidImgUrl as isValidImgUrl, index_secsToText as secsToText };
2073
+ }
2074
+
2075
+ /**
2076
+ * Extension state sync module.
2077
+ *
2078
+ * All browser-global access is guarded so this module can be imported safely
2079
+ * in SSR / Node environments without throwing.
2080
+ */
2081
+
2082
+ declare const SDK_PAGE_MARKER = "blockauthSdk";
2083
+ declare const SYNC_TIMEOUT_MS = 800;
2084
+ declare const DISCOVERY_TIMEOUT_MS = 3000;
2085
+ declare function isSdkPage(): boolean;
2086
+ declare function markSdkPresence(): void;
2087
+ declare function clearSdkPresence(): void;
2088
+ declare const isExtensionStateComplete: (ui: Pick<UiConfig, "installed" | "isUser" | "isUserActive">) => boolean;
2089
+ declare function isExtensionPresent(): boolean;
2090
+ declare function appearsExtensionInstalled(): boolean;
2091
+ declare function clearExtensionDomMarkers(): void;
2092
+ declare function resetExtensionAbsentState(): void;
2093
+ declare function onExtensionRemoved(): void;
2094
+ declare function requestExtensionStateSync(): void;
2095
+ /** Opens the extension popup on this page's pending txn. */
2096
+ declare function openExtensionOnTxn(): void;
2097
+ declare function syncExtensionStateFromStorage(): UiConfig;
2098
+ declare function onExtensionStatePublished(): UiConfig;
2099
+ declare function confirmExtensionPresence(): boolean;
2100
+ declare function probeExtensionPresence(timeoutMs?: number): Promise<boolean>;
2101
+ declare function discoverExtensionOnce(timeoutMs?: number): Promise<UiConfig>;
2102
+ declare function reconcileExtensionState({ force, }?: {
2103
+ force?: boolean;
2104
+ }): Promise<UiConfig>;
2105
+ declare function requestExtensionRefresh(): Promise<UiConfig>;
2106
+ /** Cancels in-flight sync operations (e.g. on cleanup). */
2107
+ declare function resetExtensionSyncModuleState(): void;
2108
+ /**
2109
+ * Marks SDK presence, kicks off extension discovery, and registers all
2110
+ * event listeners (blockauth:sync / blockauth:gone / storage / visibilitychange
2111
+ * / focus).
2112
+ *
2113
+ * Returns a cleanup function that removes every listener, clears the SDK
2114
+ * marker, and cancels in-flight operations.
2115
+ *
2116
+ * SSR-safe: if called outside a browser environment it returns a no-op cleanup.
2117
+ */
2118
+ declare function startExtensionSync(): () => void;
2119
+
2120
+ export { $extension, $locale, $openModals, $ui, $user, $wallet, $web3, $ws, type AuthRuntime, type AuthRuntimeCallbacks, type BlockAuthClient, type BlockAuthClientConfig, BlockAuthProvider, type BlockAuthProviderOptions, type BlockAuthUserProfile, type BlockAuthUserRole, DEFAULT_PHONE_COUNTRY, DISCOVERY_TIMEOUT_MS, type DeletionServiceDeps, EMPTY_SOLICITED_DATA_FORM, type EvmOptions, type EvmWallet, type ExtensionState, type Locale, type ModalName, PARAM_DISPLAY_FORMATTERS, PARAM_DISPLAY_ORDER, PARAM_ERROR_KEYS, PARAM_INPUT_TYPE, PARAM_LABEL_KEYS, PARAM_NORMALIZERS, PARAM_VALIDATORS, type PhoneCountry, type PhoneCountryCode, type PhoneDraft, type PhoneParts, type RestoreResult, RpcClient, SDK_PAGE_MARKER, SYNC_TIMEOUT_MS, type SolanaWallet, type SolicitedAcceptParams, type SolicitedDataForm, type SolicitedField, type SolicitedParam, TEXTS, type TextKey, type TxnDataMode, type TxnDataParam, type TxnDataRequest, type TxnDataStatus, type TxnRequest, type UiState, type UserProfileProvider, type UserState, type WalletKind, type WalletState, type Web3SignupState, WsClient, type WsState, appearsExtensionInstalled, buildPhoneE164, buildPhoneValue, clearExtensionDomMarkers, clearRemainingAuthData, clearSdkPresence, closeAllModals, closeModal, confirmExtensionPresence, createAuthRuntime, createBlockAuthClient, createDeletionService, createEvmWallet, createSolanaWallet, deepLinkFor, discoverExtensionOnce, fetchUserProfile, finalizeAfterRestorationExpired, formatParamValue, formatPhoneForDisplay, getDefaultPhoneCountry, getExtensionStoreUrl, getPhoneCountries, getPhoneCountryFlag, getPhoneDialCode, getSolicitedAcceptParams, getSolicitedFields, getSolicitedHintKey, getSolicitedParams, getUserRoleNames, getUserRoleSlugs, getUserRoles, handleRestorationExpired, handleRestoreFailure, hasAnyRole, hasAnyRoleBySlug, hasRole, hasRoleBySlug, isExtensionPresent, isExtensionStateComplete, isFirefox, isModalOpen, isPhoneCountry, isRestorationExpiredMessage, isSdkPage, isShowSignin, isSolicitedDataComplete, isSolicitedHintSuccess, isValidParamValue, isValidPhoneValue, loadUserProfile, makeQrDataUrl, markSdkPresence, needsExtensionUnlock, normalizeParamValue, index$1 as oauth, onExtensionRemoved, onExtensionStatePublished, openExtensionOnTxn, openModal, parsePhoneValue, probeExtensionPresence, reconcileExtensionState, requestExtensionRefresh, requestExtensionStateSync, requestSdkRestore, resetExtension, resetExtensionAbsentState, resetExtensionSyncModuleState, resetUi, resetUser, resetWallet, resetWeb3, resetWs, resolvePhoneDraft, saveSolicitedValue, searchPhoneCountries, setAcceptTxnError, setApiKey, setBackendMessage, setDeletionAddress, setDid, setExtensionInstalled, setExtensionIsLocked, setExtensionIsUser, setExtensionIsUserActive, setIsAcceptingTxn, setIsAppActive, setIsCheckingAppActive, setIsLoadingUser, setIsOnDeletion, setIsOtpRequired, setIsSdkSignedIn, setIsServiceConnected, setIsSigned, setIsSignedFirstCheck, setIsSigning, setIsSigningLoader, setLocale, setReady, setRequests, setServiceIcon, setServiceName, setSignature, setSignedBy, setSolicitedShared, setSolicitedValue, setToken, setUiConfig, setUser, setWaitingForSuccessLogInSince, startExtensionSync, syncExtensionStateFromStorage, t, toPhoneE164, undoSolicitedValue, updatePhoneDraft, index as utils };