@chipi-stack/chipi-react 14.7.0 → 14.9.0

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,2743 @@
1
+ import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, ChainToken, GetTokenBalanceResponse, WalletType, WalletData, SessionKeyData, SessionDataResponse, CreateSessionKeyParams, SessionConfig, Call as Call$1, SpendingPolicyConfig, SpendingPolicyData, MigrateWalletToPasskeyParams, UpdateWalletEncryptionParams, UpdateWalletEncryptionResponse, TransferHookInput, ApproveHookInput, GetTransactionListQuery, PaginatedResponse, Transaction, TransactionStatusResponse, SyncOnChainTransfersParams, SyncOnChainTransfersResponse, CreateSkuPurchaseParams, GetSkuListQuery, Sku, CallAnyContractParams, SignTypedDataParams, RecordSendTransactionParams, GetTokenBalanceParams, AddSessionKeyParams, RevokeSessionKeyParams, GetSessionDataParams, ExecuteWithSessionParams, PaymentRequirement, PaymentPayload } from '@chipi-stack/types';
2
+ import * as _tanstack_react_query from '@tanstack/react-query';
3
+ import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
4
+ import { MigrateChipiWalletToShhhParams, MigrationOutcome, Eip191Pubkey, WebAuthnPubkey, JwtAppleSubPubkey, NewOwnerInput, buildProposeAddOwnerCall, TIMELOCK_SECONDS, DEFAULT_OP_EXPIRY_SECONDS, ROLE_OWNER, ROLE_GUARDIAN, OP_ADD_OWNER, OP_REMOVE_OWNER, OP_ROTATE_OWNER, OP_SET_THRESHOLD, ShhhSignerKind, MIN_THRESHOLD_OWNERS } from '@chipi-stack/backend';
5
+ import { Call as Call$2 } from 'starknet';
6
+ import { TypedData, AccountDeploymentData } from '@starknet-io/types-js';
7
+
8
+ type CreateWalletInput = {
9
+ params: CreateWalletParams;
10
+ bearerToken: string;
11
+ };
12
+ /**
13
+ * Hook for creating a new wallet.
14
+ *
15
+ * Supports dual-key wrapping: when `usePasskey: true` AND `encryptKey` (PIN) provided,
16
+ * the private key is encrypted twice — once with the passkey-derived key (primary) and
17
+ * once with the PIN (backup). If passkey fails later, PIN recovers the wallet.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * // Passkey + PIN (recommended)
22
+ * await createWalletAsync({
23
+ * params: {
24
+ * encryptKey: pin, // PIN backup
25
+ * externalUserId: userId,
26
+ * chain: Chain.STARKNET,
27
+ * usePasskey: true, // Creates passkey + dual encryption
28
+ * },
29
+ * bearerToken,
30
+ * });
31
+ *
32
+ * // PIN only (backward compatible)
33
+ * await createWalletAsync({
34
+ * params: {
35
+ * encryptKey: pin,
36
+ * externalUserId: userId,
37
+ * chain: Chain.STARKNET,
38
+ * },
39
+ * bearerToken,
40
+ * });
41
+ * ```
42
+ */
43
+ declare function useCreateWallet(): {
44
+ createWallet: (input: CreateWalletInput) => void;
45
+ createWalletAsync: (input: CreateWalletInput) => Promise<CreateWalletResponse>;
46
+ data: CreateWalletResponse | undefined;
47
+ isLoading: boolean;
48
+ isError: boolean;
49
+ error: Error | null;
50
+ isSuccess: boolean;
51
+ reset: () => void;
52
+ };
53
+
54
+ type GetWalletInput = {
55
+ params?: GetWalletParams;
56
+ getBearerToken?: () => Promise<string | null | undefined>;
57
+ queryOptions?: Omit<UseQueryOptions<GetWalletResponse | null, Error>, "queryKey" | "queryFn">;
58
+ };
59
+ declare function useGetWallet(input?: GetWalletInput): {
60
+ fetchWallet: (newInput: GetWalletInput) => Promise<GetWalletResponse | null>;
61
+ data: GetWalletResponse | null;
62
+ error: Error;
63
+ isError: true;
64
+ isPending: false;
65
+ isLoading: false;
66
+ isLoadingError: false;
67
+ isRefetchError: true;
68
+ isSuccess: false;
69
+ isPlaceholderData: false;
70
+ status: "error";
71
+ dataUpdatedAt: number;
72
+ errorUpdatedAt: number;
73
+ failureCount: number;
74
+ failureReason: Error | null;
75
+ errorUpdateCount: number;
76
+ isFetched: boolean;
77
+ isFetchedAfterMount: boolean;
78
+ isFetching: boolean;
79
+ isInitialLoading: boolean;
80
+ isPaused: boolean;
81
+ isRefetching: boolean;
82
+ isStale: boolean;
83
+ isEnabled: boolean;
84
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetWalletResponse | null, Error>>;
85
+ fetchStatus: _tanstack_react_query.FetchStatus;
86
+ promise: Promise<GetWalletResponse | null>;
87
+ } | {
88
+ fetchWallet: (newInput: GetWalletInput) => Promise<GetWalletResponse | null>;
89
+ data: GetWalletResponse | null;
90
+ error: null;
91
+ isError: false;
92
+ isPending: false;
93
+ isLoading: false;
94
+ isLoadingError: false;
95
+ isRefetchError: false;
96
+ isSuccess: true;
97
+ isPlaceholderData: false;
98
+ status: "success";
99
+ dataUpdatedAt: number;
100
+ errorUpdatedAt: number;
101
+ failureCount: number;
102
+ failureReason: Error | null;
103
+ errorUpdateCount: number;
104
+ isFetched: boolean;
105
+ isFetchedAfterMount: boolean;
106
+ isFetching: boolean;
107
+ isInitialLoading: boolean;
108
+ isPaused: boolean;
109
+ isRefetching: boolean;
110
+ isStale: boolean;
111
+ isEnabled: boolean;
112
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetWalletResponse | null, Error>>;
113
+ fetchStatus: _tanstack_react_query.FetchStatus;
114
+ promise: Promise<GetWalletResponse | null>;
115
+ } | {
116
+ fetchWallet: (newInput: GetWalletInput) => Promise<GetWalletResponse | null>;
117
+ data: undefined;
118
+ error: Error;
119
+ isError: true;
120
+ isPending: false;
121
+ isLoading: false;
122
+ isLoadingError: true;
123
+ isRefetchError: false;
124
+ isSuccess: false;
125
+ isPlaceholderData: false;
126
+ status: "error";
127
+ dataUpdatedAt: number;
128
+ errorUpdatedAt: number;
129
+ failureCount: number;
130
+ failureReason: Error | null;
131
+ errorUpdateCount: number;
132
+ isFetched: boolean;
133
+ isFetchedAfterMount: boolean;
134
+ isFetching: boolean;
135
+ isInitialLoading: boolean;
136
+ isPaused: boolean;
137
+ isRefetching: boolean;
138
+ isStale: boolean;
139
+ isEnabled: boolean;
140
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetWalletResponse | null, Error>>;
141
+ fetchStatus: _tanstack_react_query.FetchStatus;
142
+ promise: Promise<GetWalletResponse | null>;
143
+ } | {
144
+ fetchWallet: (newInput: GetWalletInput) => Promise<GetWalletResponse | null>;
145
+ data: undefined;
146
+ error: null;
147
+ isError: false;
148
+ isPending: true;
149
+ isLoading: true;
150
+ isLoadingError: false;
151
+ isRefetchError: false;
152
+ isSuccess: false;
153
+ isPlaceholderData: false;
154
+ status: "pending";
155
+ dataUpdatedAt: number;
156
+ errorUpdatedAt: number;
157
+ failureCount: number;
158
+ failureReason: Error | null;
159
+ errorUpdateCount: number;
160
+ isFetched: boolean;
161
+ isFetchedAfterMount: boolean;
162
+ isFetching: boolean;
163
+ isInitialLoading: boolean;
164
+ isPaused: boolean;
165
+ isRefetching: boolean;
166
+ isStale: boolean;
167
+ isEnabled: boolean;
168
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetWalletResponse | null, Error>>;
169
+ fetchStatus: _tanstack_react_query.FetchStatus;
170
+ promise: Promise<GetWalletResponse | null>;
171
+ } | {
172
+ fetchWallet: (newInput: GetWalletInput) => Promise<GetWalletResponse | null>;
173
+ data: undefined;
174
+ error: null;
175
+ isError: false;
176
+ isPending: true;
177
+ isLoadingError: false;
178
+ isRefetchError: false;
179
+ isSuccess: false;
180
+ isPlaceholderData: false;
181
+ status: "pending";
182
+ dataUpdatedAt: number;
183
+ errorUpdatedAt: number;
184
+ failureCount: number;
185
+ failureReason: Error | null;
186
+ errorUpdateCount: number;
187
+ isFetched: boolean;
188
+ isFetchedAfterMount: boolean;
189
+ isFetching: boolean;
190
+ isLoading: boolean;
191
+ isInitialLoading: boolean;
192
+ isPaused: boolean;
193
+ isRefetching: boolean;
194
+ isStale: boolean;
195
+ isEnabled: boolean;
196
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetWalletResponse | null, Error>>;
197
+ fetchStatus: _tanstack_react_query.FetchStatus;
198
+ promise: Promise<GetWalletResponse | null>;
199
+ } | {
200
+ fetchWallet: (newInput: GetWalletInput) => Promise<GetWalletResponse | null>;
201
+ data: GetWalletResponse | null;
202
+ isError: false;
203
+ error: null;
204
+ isPending: false;
205
+ isLoading: false;
206
+ isLoadingError: false;
207
+ isRefetchError: false;
208
+ isSuccess: true;
209
+ isPlaceholderData: true;
210
+ status: "success";
211
+ dataUpdatedAt: number;
212
+ errorUpdatedAt: number;
213
+ failureCount: number;
214
+ failureReason: Error | null;
215
+ errorUpdateCount: number;
216
+ isFetched: boolean;
217
+ isFetchedAfterMount: boolean;
218
+ isFetching: boolean;
219
+ isInitialLoading: boolean;
220
+ isPaused: boolean;
221
+ isRefetching: boolean;
222
+ isStale: boolean;
223
+ isEnabled: boolean;
224
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetWalletResponse | null, Error>>;
225
+ fetchStatus: _tanstack_react_query.FetchStatus;
226
+ promise: Promise<GetWalletResponse | null>;
227
+ };
228
+
229
+ /**
230
+ * Configuration for useChipiWallet hook
231
+ */
232
+ interface UseChipiWalletConfig {
233
+ /** External user ID (e.g., from Clerk, Firebase, etc.) */
234
+ externalUserId: string | null | undefined;
235
+ /** Function to get the bearer token for API calls */
236
+ getBearerToken: () => Promise<string | null | undefined>;
237
+ /** Default token for balance display (defaults to USDC) */
238
+ defaultToken?: ChainToken;
239
+ /** Whether to automatically fetch wallet on mount */
240
+ enabled?: boolean;
241
+ }
242
+ /**
243
+ * Extended wallet response with additional computed properties
244
+ */
245
+ interface ChipiWalletData extends GetWalletResponse {
246
+ /** Whether this wallet supports session keys */
247
+ supportsSessionKeys: boolean;
248
+ /** Formatted short address for display */
249
+ shortAddress: string;
250
+ }
251
+ /**
252
+ * Return type for useChipiWallet hook
253
+ */
254
+ interface UseChipiWalletReturn {
255
+ /** The user's wallet data, null if not found, undefined if loading */
256
+ wallet: ChipiWalletData | null | undefined;
257
+ /** Whether the user has a wallet */
258
+ hasWallet: boolean;
259
+ /** Whether the wallet is currently being fetched */
260
+ isLoadingWallet: boolean;
261
+ /** Error from fetching wallet */
262
+ walletError: Error | null;
263
+ /** The wallet's balance for the default token */
264
+ balance: GetTokenBalanceResponse | undefined;
265
+ /** Formatted balance string (e.g., "100.50") */
266
+ formattedBalance: string;
267
+ /** Whether balance is loading */
268
+ isLoadingBalance: boolean;
269
+ /** Create a new wallet */
270
+ createWallet: (params: {
271
+ encryptKey: string;
272
+ walletType?: WalletType;
273
+ }) => Promise<CreateWalletResponse>;
274
+ /** Whether wallet creation is in progress */
275
+ isCreating: boolean;
276
+ /** Data from the last wallet creation */
277
+ createdWallet: CreateWalletResponse | undefined;
278
+ /** Refetch the wallet data */
279
+ refetchWallet: () => Promise<void>;
280
+ /** Refetch the balance */
281
+ refetchBalance: () => Promise<void>;
282
+ /** Refetch both wallet and balance */
283
+ refetchAll: () => Promise<void>;
284
+ }
285
+ /**
286
+ * All-in-one wallet hook for Chipi SDK.
287
+ *
288
+ * Combines wallet fetching, creation, and balance checking into a single hook
289
+ * for simplified wallet management.
290
+ *
291
+ * @example
292
+ * ```tsx
293
+ * import { useAuth } from "@clerk/nextjs";
294
+ * import { useChipiWallet } from "@chipi-stack/nextjs";
295
+ *
296
+ * function WalletComponent() {
297
+ * const { userId, getToken } = useAuth();
298
+ * const {
299
+ * wallet,
300
+ * hasWallet,
301
+ * balance,
302
+ * formattedBalance,
303
+ * createWallet,
304
+ * isCreating,
305
+ * isLoadingWallet,
306
+ * } = useChipiWallet({
307
+ * externalUserId: userId,
308
+ * getBearerToken: getToken,
309
+ * });
310
+ *
311
+ * if (isLoadingWallet) return <div>Loading...</div>;
312
+ *
313
+ * if (!hasWallet) {
314
+ * return (
315
+ * <button
316
+ * onClick={() => createWallet({ encryptKey: "1234" })}
317
+ * disabled={isCreating}
318
+ * >
319
+ * {isCreating ? "Creating..." : "Create Wallet"}
320
+ * </button>
321
+ * );
322
+ * }
323
+ *
324
+ * return (
325
+ * <div>
326
+ * <p>Address: {wallet?.shortAddress}</p>
327
+ * <p>Balance: ${formattedBalance} USDC</p>
328
+ * <p>Session Keys: {wallet?.supportsSessionKeys ? "Yes" : "No"}</p>
329
+ * </div>
330
+ * );
331
+ * }
332
+ * ```
333
+ */
334
+ declare function useChipiWallet(config: UseChipiWalletConfig): UseChipiWalletReturn;
335
+
336
+ /**
337
+ * Wallet data with optional wallet type for session operations
338
+ */
339
+ interface SessionWallet extends WalletData {
340
+ walletType?: WalletType;
341
+ }
342
+ /**
343
+ * Configuration for useChipiSession hook
344
+ */
345
+ interface UseChipiSessionConfig {
346
+ /** Wallet data (must be a CHIPI wallet for session support) */
347
+ wallet: SessionWallet | null | undefined;
348
+ /** Encryption key (user's PIN) for signing operations */
349
+ encryptKey: string;
350
+ /** Function to get the bearer token for API calls */
351
+ getBearerToken: () => Promise<string | null | undefined>;
352
+ /** Previously stored session data (from Clerk metadata, database, etc.) */
353
+ storedSession?: SessionKeyData | null;
354
+ /** Callback fired when a new session is created (for persistence) */
355
+ onSessionCreated?: (session: SessionKeyData) => void | Promise<void>;
356
+ /** Session duration in seconds (default: 6 hours) */
357
+ defaultDurationSeconds?: number;
358
+ /** Default max calls for session registration (default: 1000) */
359
+ defaultMaxCalls?: number;
360
+ /** Whether to auto-check session status on mount */
361
+ autoCheckStatus?: boolean;
362
+ }
363
+ /**
364
+ * Session lifecycle state
365
+ */
366
+ type SessionState = "none" | "created" | "active" | "expired" | "revoked";
367
+ /**
368
+ * Return type for useChipiSession hook
369
+ */
370
+ interface UseChipiSessionReturn {
371
+ /** Current session key data */
372
+ session: SessionKeyData | null;
373
+ /** On-chain session status (from contract query) */
374
+ sessionStatus: SessionDataResponse | undefined;
375
+ /** Current session lifecycle state */
376
+ sessionState: SessionState;
377
+ /** Whether there is an active, usable session */
378
+ hasActiveSession: boolean;
379
+ /** Whether the session has expired */
380
+ isSessionExpired: boolean;
381
+ /** Remaining calls available for the session */
382
+ remainingCalls: number | undefined;
383
+ /** Whether the wallet supports sessions (CHIPI wallet) */
384
+ supportsSession: boolean;
385
+ /** Create a new session keypair locally (does NOT register on-chain) */
386
+ createSession: (config?: Partial<CreateSessionKeyParams>) => Promise<SessionKeyData>;
387
+ /** Register the current session on the blockchain */
388
+ registerSession: (config?: Partial<SessionConfig>) => Promise<string>;
389
+ /** Revoke the current session from the blockchain */
390
+ revokeSession: () => Promise<string>;
391
+ /** Execute calls using the session key (no owner signature needed) */
392
+ executeWithSession: (calls: Call$1[]) => Promise<string>;
393
+ /** Clear the current session from local state */
394
+ clearSession: () => void;
395
+ /** Refresh the on-chain session status */
396
+ refetchStatus: () => Promise<void>;
397
+ /** Set a spending policy for the current session + token pair */
398
+ setSpendingPolicy: (config: Omit<SpendingPolicyConfig, "sessionPublicKey">) => Promise<string>;
399
+ /** Query the spending policy for a token (read-only, no gas) */
400
+ getSpendingPolicy: (token: string) => Promise<SpendingPolicyData>;
401
+ /** Remove a spending policy for a token */
402
+ removeSpendingPolicy: (token: string) => Promise<string>;
403
+ isCreating: boolean;
404
+ isRegistering: boolean;
405
+ isRevoking: boolean;
406
+ isExecuting: boolean;
407
+ isLoadingStatus: boolean;
408
+ isSettingSpendingPolicy: boolean;
409
+ isRemovingSpendingPolicy: boolean;
410
+ error: Error | null;
411
+ }
412
+ /**
413
+ * All-in-one session management hook for Chipi SDK.
414
+ *
415
+ * Combines session creation, registration, execution, and revocation
416
+ * into a single unified API. Session keys enable gasless transactions
417
+ * without requiring the owner's private key for each operation.
418
+ *
419
+ * **Important:** Sessions only work with CHIPI wallets. ARGENT wallets
420
+ * do not support session keys.
421
+ *
422
+ * @example
423
+ * ```tsx
424
+ * import { useAuth } from "@clerk/nextjs";
425
+ * import { useChipiWallet, useChipiSession } from "@chipi-stack/nextjs";
426
+ *
427
+ * function SessionComponent() {
428
+ * const { userId, getToken } = useAuth();
429
+ * const [pin, setPin] = useState("");
430
+ * const { wallet } = useChipiWallet({ externalUserId: userId, getBearerToken: getToken });
431
+ *
432
+ * const {
433
+ * session,
434
+ * hasActiveSession,
435
+ * sessionState,
436
+ * createSession,
437
+ * registerSession,
438
+ * executeWithSession,
439
+ * isCreating,
440
+ * isRegistering,
441
+ * } = useChipiSession({
442
+ * wallet,
443
+ * encryptKey: pin,
444
+ * getBearerToken: getToken,
445
+ * onSessionCreated: async (newSession) => {
446
+ * // Persist to Clerk metadata or database
447
+ * await saveSessionToClerk(newSession);
448
+ * },
449
+ * });
450
+ *
451
+ * const handleSetupSession = async () => {
452
+ * // Step 1: Create session locally
453
+ * await createSession();
454
+ * // Step 2: Register on-chain
455
+ * await registerSession();
456
+ * };
457
+ *
458
+ * const handleTransfer = async () => {
459
+ * // Execute transfer using session (no PIN needed after setup)
460
+ * await executeWithSession([{
461
+ * contractAddress: USDC_ADDRESS,
462
+ * entrypoint: "transfer",
463
+ * calldata: [recipient, amount, "0x0"],
464
+ * }]);
465
+ * };
466
+ *
467
+ * return (
468
+ * <div>
469
+ * <p>Session State: {sessionState}</p>
470
+ * {!hasActiveSession ? (
471
+ * <button onClick={handleSetupSession} disabled={isCreating || isRegistering}>
472
+ * Setup Session
473
+ * </button>
474
+ * ) : (
475
+ * <button onClick={handleTransfer}>
476
+ * Transfer (Gasless)
477
+ * </button>
478
+ * )}
479
+ * </div>
480
+ * );
481
+ * }
482
+ * ```
483
+ */
484
+ declare function useChipiSession(config: UseChipiSessionConfig): UseChipiSessionReturn;
485
+
486
+ type MigrateWalletToPasskeyInput = MigrateWalletToPasskeyParams & {
487
+ bearerToken: string;
488
+ };
489
+ interface MigrateWalletToPasskeyResult {
490
+ success: boolean;
491
+ wallet: WalletData;
492
+ credentialId: string;
493
+ }
494
+ /**
495
+ * Hook for migrating a wallet from encryptKey (PIN) to passkey authentication
496
+ */
497
+ declare function useMigrateWalletToPasskey(): {
498
+ migrateWalletToPasskey: (input: MigrateWalletToPasskeyInput) => void;
499
+ migrateWalletToPasskeyAsync: (input: MigrateWalletToPasskeyInput) => Promise<MigrateWalletToPasskeyResult>;
500
+ data: MigrateWalletToPasskeyResult | undefined;
501
+ isLoading: boolean;
502
+ isError: boolean;
503
+ error: Error | null;
504
+ isSuccess: boolean;
505
+ reset: () => void;
506
+ };
507
+
508
+ type UpdateWalletEncryptionInput = UpdateWalletEncryptionParams & {
509
+ bearerToken: string;
510
+ };
511
+ /**
512
+ * Hook for updating a wallet's encrypted private key.
513
+ * Use when the user changes their passkey or PIN; the client re-encrypts the private key
514
+ * and sends the new ciphertext here.
515
+ */
516
+ declare function useUpdateWalletEncryption(): {
517
+ updateWalletEncryption: (input: UpdateWalletEncryptionInput) => void;
518
+ updateWalletEncryptionAsync: (input: UpdateWalletEncryptionInput) => Promise<UpdateWalletEncryptionResponse>;
519
+ data: UpdateWalletEncryptionResponse | undefined;
520
+ isLoading: boolean;
521
+ isError: boolean;
522
+ error: Error | null;
523
+ isSuccess: boolean;
524
+ reset: () => void;
525
+ };
526
+
527
+ /**
528
+ * Input for the migration mutation.
529
+ *
530
+ * Drops `client` and `bearerToken` from the SDK-level params (the
531
+ * hook reads them from context + the input below) and treats the
532
+ * rest the same as the SDK call. The hook does NOT touch passkey /
533
+ * PIN orchestration — callers are responsible for handing in the
534
+ * already-resolved `encryptKey`. For the dashboard flow this means
535
+ * showing the PIN/passkey prompt yourself and passing the result
536
+ * here.
537
+ */
538
+ type MigrateInput = Omit<MigrateChipiWalletToShhhParams, "client" | "bearerToken"> & {
539
+ bearerToken: string;
540
+ };
541
+ /**
542
+ * Hook for migrating a CHIPI v29 wallet to SHHH V8.4.
543
+ *
544
+ * Wraps the `migrateChipiWalletToShhh` backend SDK function (which
545
+ * itself composes chipi-back's prepare + execute endpoints with
546
+ * client-side V8.4 OE signing). The PIN/passkey unwrap step happens
547
+ * before this hook is called; the migration multicall is signed
548
+ * locally with the resulting STARK key and the cleartext key never
549
+ * leaves the device.
550
+ *
551
+ * Two terminal outcomes the consumer must handle:
552
+ * - `{ kind: "MIGRATED", transactionHash, ... }` — happy path,
553
+ * on-chain tx landed and DB row is patched. If `partial: true`,
554
+ * the on-chain tx succeeded but the chipi-back DB patch failed;
555
+ * the operator runbook's reconciler cron (task #30) will catch
556
+ * up automatically. Dashboard should surface "wallet upgraded;
557
+ * refresh in a moment" copy in both sub-cases.
558
+ * - `{ kind: "ALREADY_MIGRATED", primaryKind, ... }` — chipi-back
559
+ * detected the wallet was already SHHH on chain and patched the
560
+ * DB row on the way out. No on-chain tx fired. Dashboard should
561
+ * surface "this wallet is already on V8.4" and refresh the
562
+ * wallet shape.
563
+ *
564
+ * Throws (surfaces via `error`) on:
565
+ * - STRANDED-state recovery (different signing flow, not in PR A)
566
+ * - UNDEPLOYED wallets (caller should redirect to createWallet)
567
+ * - DEFERRED legacy versions (v28/v33; not yet supported)
568
+ * - Mismatched encryptKey (decryption fails)
569
+ * - chipi-back kill switch off (`CHIPI_MIGRATION_ENABLED` not set)
570
+ *
571
+ * @example
572
+ * ```tsx
573
+ * const { migrateAsync, isLoading, error } = useMigrateWalletToShhh();
574
+ *
575
+ * async function onClickMigrate() {
576
+ * const encryptKey = await promptForPin(); // or passkey unlock
577
+ * const outcome = await migrateAsync({
578
+ * walletId: wallet.id,
579
+ * externalUserId: user.id,
580
+ * wallet: { publicKey: wallet.publicKey, encryptedPrivateKey: wallet.encryptedPrivateKey },
581
+ * encryptKey,
582
+ * bearerToken,
583
+ * });
584
+ * if (outcome.kind === "MIGRATED") {
585
+ * showToast(`Wallet upgraded — tx ${outcome.transactionHash}`);
586
+ * } else {
587
+ * showToast(`Wallet was already on V8.4 (${outcome.primaryKind})`);
588
+ * }
589
+ * }
590
+ * ```
591
+ */
592
+ declare function useMigrateWalletToShhh(): {
593
+ migrate: (input: MigrateInput) => void;
594
+ migrateAsync: (input: MigrateInput) => Promise<MigrationOutcome>;
595
+ data: MigrationOutcome | undefined;
596
+ isLoading: boolean;
597
+ isError: boolean;
598
+ error: Error | null;
599
+ isSuccess: boolean;
600
+ reset: () => void;
601
+ };
602
+
603
+ type TransferInput = {
604
+ params: TransferHookInput;
605
+ bearerToken: string;
606
+ };
607
+ /**
608
+ * Configuration for useTransfer hook.
609
+ */
610
+ interface UseTransferConfig {
611
+ /**
612
+ * Callback to prompt user for PIN when passkey fails.
613
+ * Should show a PIN input dialog and return the PIN, or null to cancel.
614
+ * Only called when usePasskey: true and passkey auth fails.
615
+ */
616
+ onPinRequired?: () => Promise<string | null>;
617
+ }
618
+ /**
619
+ * Hook for transferring tokens.
620
+ *
621
+ * When `usePasskey: true`:
622
+ * 1. Tries passkey authentication first
623
+ * 2. If passkey fails and wallet has `encryptedPrivateKeyBackup`:
624
+ * calls `onPinRequired` to get PIN, uses PIN to decrypt backup
625
+ * 3. If no backup or no `onPinRequired`, throws
626
+ *
627
+ * @example
628
+ * ```tsx
629
+ * const { transferAsync } = useTransfer({
630
+ * onPinRequired: async () => {
631
+ * // Show PIN dialog, return PIN or null to cancel
632
+ * return await showPinDialog();
633
+ * },
634
+ * });
635
+ * ```
636
+ */
637
+ declare function useTransfer(config?: UseTransferConfig): {
638
+ transfer: (input: TransferInput) => void;
639
+ transferAsync: (input: TransferInput) => Promise<string>;
640
+ data: string | undefined;
641
+ isLoading: boolean;
642
+ isError: boolean;
643
+ error: Error | null;
644
+ isSuccess: boolean;
645
+ reset: () => void;
646
+ };
647
+
648
+ type ApproveInput = {
649
+ params: ApproveHookInput;
650
+ bearerToken: string;
651
+ };
652
+ /**
653
+ * Hook for approving token spending
654
+ */
655
+ declare function useApprove(): {
656
+ approve: (params: ApproveInput) => void;
657
+ approveAsync: (params: ApproveInput) => Promise<string>;
658
+ data: string | undefined;
659
+ isLoading: boolean;
660
+ isError: boolean;
661
+ error: Error | null;
662
+ isSuccess: boolean;
663
+ reset: () => void;
664
+ };
665
+
666
+ type TransactionListInput = {
667
+ query: GetTransactionListQuery;
668
+ getBearerToken?: () => Promise<string | null | undefined>;
669
+ queryOptions?: Omit<UseQueryOptions<PaginatedResponse<Transaction>, Error>, "queryKey" | "queryFn">;
670
+ };
671
+ type FetchTransactionListInput = {
672
+ query: GetTransactionListQuery;
673
+ getBearerToken: () => Promise<string | null | undefined>;
674
+ };
675
+ declare function useGetTransactionList(input?: TransactionListInput): {
676
+ fetchTransactionList: (newInput: FetchTransactionListInput) => Promise<PaginatedResponse<Transaction>>;
677
+ data: PaginatedResponse<Transaction>;
678
+ error: Error;
679
+ isError: true;
680
+ isPending: false;
681
+ isLoading: false;
682
+ isLoadingError: false;
683
+ isRefetchError: true;
684
+ isSuccess: false;
685
+ isPlaceholderData: false;
686
+ status: "error";
687
+ dataUpdatedAt: number;
688
+ errorUpdatedAt: number;
689
+ failureCount: number;
690
+ failureReason: Error | null;
691
+ errorUpdateCount: number;
692
+ isFetched: boolean;
693
+ isFetchedAfterMount: boolean;
694
+ isFetching: boolean;
695
+ isInitialLoading: boolean;
696
+ isPaused: boolean;
697
+ isRefetching: boolean;
698
+ isStale: boolean;
699
+ isEnabled: boolean;
700
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
701
+ fetchStatus: _tanstack_react_query.FetchStatus;
702
+ promise: Promise<PaginatedResponse<Transaction>>;
703
+ } | {
704
+ fetchTransactionList: (newInput: FetchTransactionListInput) => Promise<PaginatedResponse<Transaction>>;
705
+ data: PaginatedResponse<Transaction>;
706
+ error: null;
707
+ isError: false;
708
+ isPending: false;
709
+ isLoading: false;
710
+ isLoadingError: false;
711
+ isRefetchError: false;
712
+ isSuccess: true;
713
+ isPlaceholderData: false;
714
+ status: "success";
715
+ dataUpdatedAt: number;
716
+ errorUpdatedAt: number;
717
+ failureCount: number;
718
+ failureReason: Error | null;
719
+ errorUpdateCount: number;
720
+ isFetched: boolean;
721
+ isFetchedAfterMount: boolean;
722
+ isFetching: boolean;
723
+ isInitialLoading: boolean;
724
+ isPaused: boolean;
725
+ isRefetching: boolean;
726
+ isStale: boolean;
727
+ isEnabled: boolean;
728
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
729
+ fetchStatus: _tanstack_react_query.FetchStatus;
730
+ promise: Promise<PaginatedResponse<Transaction>>;
731
+ } | {
732
+ fetchTransactionList: (newInput: FetchTransactionListInput) => Promise<PaginatedResponse<Transaction>>;
733
+ data: undefined;
734
+ error: Error;
735
+ isError: true;
736
+ isPending: false;
737
+ isLoading: false;
738
+ isLoadingError: true;
739
+ isRefetchError: false;
740
+ isSuccess: false;
741
+ isPlaceholderData: false;
742
+ status: "error";
743
+ dataUpdatedAt: number;
744
+ errorUpdatedAt: number;
745
+ failureCount: number;
746
+ failureReason: Error | null;
747
+ errorUpdateCount: number;
748
+ isFetched: boolean;
749
+ isFetchedAfterMount: boolean;
750
+ isFetching: boolean;
751
+ isInitialLoading: boolean;
752
+ isPaused: boolean;
753
+ isRefetching: boolean;
754
+ isStale: boolean;
755
+ isEnabled: boolean;
756
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
757
+ fetchStatus: _tanstack_react_query.FetchStatus;
758
+ promise: Promise<PaginatedResponse<Transaction>>;
759
+ } | {
760
+ fetchTransactionList: (newInput: FetchTransactionListInput) => Promise<PaginatedResponse<Transaction>>;
761
+ data: undefined;
762
+ error: null;
763
+ isError: false;
764
+ isPending: true;
765
+ isLoading: true;
766
+ isLoadingError: false;
767
+ isRefetchError: false;
768
+ isSuccess: false;
769
+ isPlaceholderData: false;
770
+ status: "pending";
771
+ dataUpdatedAt: number;
772
+ errorUpdatedAt: number;
773
+ failureCount: number;
774
+ failureReason: Error | null;
775
+ errorUpdateCount: number;
776
+ isFetched: boolean;
777
+ isFetchedAfterMount: boolean;
778
+ isFetching: boolean;
779
+ isInitialLoading: boolean;
780
+ isPaused: boolean;
781
+ isRefetching: boolean;
782
+ isStale: boolean;
783
+ isEnabled: boolean;
784
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
785
+ fetchStatus: _tanstack_react_query.FetchStatus;
786
+ promise: Promise<PaginatedResponse<Transaction>>;
787
+ } | {
788
+ fetchTransactionList: (newInput: FetchTransactionListInput) => Promise<PaginatedResponse<Transaction>>;
789
+ data: undefined;
790
+ error: null;
791
+ isError: false;
792
+ isPending: true;
793
+ isLoadingError: false;
794
+ isRefetchError: false;
795
+ isSuccess: false;
796
+ isPlaceholderData: false;
797
+ status: "pending";
798
+ dataUpdatedAt: number;
799
+ errorUpdatedAt: number;
800
+ failureCount: number;
801
+ failureReason: Error | null;
802
+ errorUpdateCount: number;
803
+ isFetched: boolean;
804
+ isFetchedAfterMount: boolean;
805
+ isFetching: boolean;
806
+ isLoading: boolean;
807
+ isInitialLoading: boolean;
808
+ isPaused: boolean;
809
+ isRefetching: boolean;
810
+ isStale: boolean;
811
+ isEnabled: boolean;
812
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
813
+ fetchStatus: _tanstack_react_query.FetchStatus;
814
+ promise: Promise<PaginatedResponse<Transaction>>;
815
+ } | {
816
+ fetchTransactionList: (newInput: FetchTransactionListInput) => Promise<PaginatedResponse<Transaction>>;
817
+ data: PaginatedResponse<Transaction>;
818
+ isError: false;
819
+ error: null;
820
+ isPending: false;
821
+ isLoading: false;
822
+ isLoadingError: false;
823
+ isRefetchError: false;
824
+ isSuccess: true;
825
+ isPlaceholderData: true;
826
+ status: "success";
827
+ dataUpdatedAt: number;
828
+ errorUpdatedAt: number;
829
+ failureCount: number;
830
+ failureReason: Error | null;
831
+ errorUpdateCount: number;
832
+ isFetched: boolean;
833
+ isFetchedAfterMount: boolean;
834
+ isFetching: boolean;
835
+ isInitialLoading: boolean;
836
+ isPaused: boolean;
837
+ isRefetching: boolean;
838
+ isStale: boolean;
839
+ isEnabled: boolean;
840
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Transaction>, Error>>;
841
+ fetchStatus: _tanstack_react_query.FetchStatus;
842
+ promise: Promise<PaginatedResponse<Transaction>>;
843
+ };
844
+
845
+ type GetTransactionInput = {
846
+ hashOrId?: string;
847
+ getBearerToken?: () => Promise<string | null | undefined>;
848
+ queryOptions?: Omit<UseQueryOptions<Transaction, Error>, "queryKey" | "queryFn">;
849
+ };
850
+ type FetchTransactionInput = {
851
+ hashOrId: string;
852
+ getBearerToken: () => Promise<string | null | undefined>;
853
+ };
854
+ declare function useGetTransaction(input?: GetTransactionInput): {
855
+ fetchTransaction: (newInput: FetchTransactionInput) => Promise<Transaction>;
856
+ data: Transaction;
857
+ error: Error;
858
+ isError: true;
859
+ isPending: false;
860
+ isLoading: false;
861
+ isLoadingError: false;
862
+ isRefetchError: true;
863
+ isSuccess: false;
864
+ isPlaceholderData: false;
865
+ status: "error";
866
+ dataUpdatedAt: number;
867
+ errorUpdatedAt: number;
868
+ failureCount: number;
869
+ failureReason: Error | null;
870
+ errorUpdateCount: number;
871
+ isFetched: boolean;
872
+ isFetchedAfterMount: boolean;
873
+ isFetching: boolean;
874
+ isInitialLoading: boolean;
875
+ isPaused: boolean;
876
+ isRefetching: boolean;
877
+ isStale: boolean;
878
+ isEnabled: boolean;
879
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
880
+ fetchStatus: _tanstack_react_query.FetchStatus;
881
+ promise: Promise<Transaction>;
882
+ } | {
883
+ fetchTransaction: (newInput: FetchTransactionInput) => Promise<Transaction>;
884
+ data: Transaction;
885
+ error: null;
886
+ isError: false;
887
+ isPending: false;
888
+ isLoading: false;
889
+ isLoadingError: false;
890
+ isRefetchError: false;
891
+ isSuccess: true;
892
+ isPlaceholderData: false;
893
+ status: "success";
894
+ dataUpdatedAt: number;
895
+ errorUpdatedAt: number;
896
+ failureCount: number;
897
+ failureReason: Error | null;
898
+ errorUpdateCount: number;
899
+ isFetched: boolean;
900
+ isFetchedAfterMount: boolean;
901
+ isFetching: boolean;
902
+ isInitialLoading: boolean;
903
+ isPaused: boolean;
904
+ isRefetching: boolean;
905
+ isStale: boolean;
906
+ isEnabled: boolean;
907
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
908
+ fetchStatus: _tanstack_react_query.FetchStatus;
909
+ promise: Promise<Transaction>;
910
+ } | {
911
+ fetchTransaction: (newInput: FetchTransactionInput) => Promise<Transaction>;
912
+ data: undefined;
913
+ error: Error;
914
+ isError: true;
915
+ isPending: false;
916
+ isLoading: false;
917
+ isLoadingError: true;
918
+ isRefetchError: false;
919
+ isSuccess: false;
920
+ isPlaceholderData: false;
921
+ status: "error";
922
+ dataUpdatedAt: number;
923
+ errorUpdatedAt: number;
924
+ failureCount: number;
925
+ failureReason: Error | null;
926
+ errorUpdateCount: number;
927
+ isFetched: boolean;
928
+ isFetchedAfterMount: boolean;
929
+ isFetching: boolean;
930
+ isInitialLoading: boolean;
931
+ isPaused: boolean;
932
+ isRefetching: boolean;
933
+ isStale: boolean;
934
+ isEnabled: boolean;
935
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
936
+ fetchStatus: _tanstack_react_query.FetchStatus;
937
+ promise: Promise<Transaction>;
938
+ } | {
939
+ fetchTransaction: (newInput: FetchTransactionInput) => Promise<Transaction>;
940
+ data: undefined;
941
+ error: null;
942
+ isError: false;
943
+ isPending: true;
944
+ isLoading: true;
945
+ isLoadingError: false;
946
+ isRefetchError: false;
947
+ isSuccess: false;
948
+ isPlaceholderData: false;
949
+ status: "pending";
950
+ dataUpdatedAt: number;
951
+ errorUpdatedAt: number;
952
+ failureCount: number;
953
+ failureReason: Error | null;
954
+ errorUpdateCount: number;
955
+ isFetched: boolean;
956
+ isFetchedAfterMount: boolean;
957
+ isFetching: boolean;
958
+ isInitialLoading: boolean;
959
+ isPaused: boolean;
960
+ isRefetching: boolean;
961
+ isStale: boolean;
962
+ isEnabled: boolean;
963
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
964
+ fetchStatus: _tanstack_react_query.FetchStatus;
965
+ promise: Promise<Transaction>;
966
+ } | {
967
+ fetchTransaction: (newInput: FetchTransactionInput) => Promise<Transaction>;
968
+ data: undefined;
969
+ error: null;
970
+ isError: false;
971
+ isPending: true;
972
+ isLoadingError: false;
973
+ isRefetchError: false;
974
+ isSuccess: false;
975
+ isPlaceholderData: false;
976
+ status: "pending";
977
+ dataUpdatedAt: number;
978
+ errorUpdatedAt: number;
979
+ failureCount: number;
980
+ failureReason: Error | null;
981
+ errorUpdateCount: number;
982
+ isFetched: boolean;
983
+ isFetchedAfterMount: boolean;
984
+ isFetching: boolean;
985
+ isLoading: boolean;
986
+ isInitialLoading: boolean;
987
+ isPaused: boolean;
988
+ isRefetching: boolean;
989
+ isStale: boolean;
990
+ isEnabled: boolean;
991
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
992
+ fetchStatus: _tanstack_react_query.FetchStatus;
993
+ promise: Promise<Transaction>;
994
+ } | {
995
+ fetchTransaction: (newInput: FetchTransactionInput) => Promise<Transaction>;
996
+ data: Transaction;
997
+ isError: false;
998
+ error: null;
999
+ isPending: false;
1000
+ isLoading: false;
1001
+ isLoadingError: false;
1002
+ isRefetchError: false;
1003
+ isSuccess: true;
1004
+ isPlaceholderData: true;
1005
+ status: "success";
1006
+ dataUpdatedAt: number;
1007
+ errorUpdatedAt: number;
1008
+ failureCount: number;
1009
+ failureReason: Error | null;
1010
+ errorUpdateCount: number;
1011
+ isFetched: boolean;
1012
+ isFetchedAfterMount: boolean;
1013
+ isFetching: boolean;
1014
+ isInitialLoading: boolean;
1015
+ isPaused: boolean;
1016
+ isRefetching: boolean;
1017
+ isStale: boolean;
1018
+ isEnabled: boolean;
1019
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
1020
+ fetchStatus: _tanstack_react_query.FetchStatus;
1021
+ promise: Promise<Transaction>;
1022
+ };
1023
+
1024
+ type GetTransactionStatusInput = {
1025
+ hash?: string;
1026
+ getBearerToken?: () => Promise<string | null | undefined>;
1027
+ /** Polling interval in ms. Defaults to 3000. Set to false to disable polling. */
1028
+ refetchInterval?: number | false;
1029
+ queryOptions?: Omit<UseQueryOptions<TransactionStatusResponse, Error>, "queryKey" | "queryFn" | "refetchInterval">;
1030
+ };
1031
+ type FetchTransactionStatusInput = {
1032
+ hash: string;
1033
+ getBearerToken: () => Promise<string | null | undefined>;
1034
+ };
1035
+ declare function useGetTransactionStatus(input?: GetTransactionStatusInput): {
1036
+ fetchTransactionStatus: (newInput: FetchTransactionStatusInput) => Promise<TransactionStatusResponse>;
1037
+ data: TransactionStatusResponse;
1038
+ error: Error;
1039
+ isError: true;
1040
+ isPending: false;
1041
+ isLoading: false;
1042
+ isLoadingError: false;
1043
+ isRefetchError: true;
1044
+ isSuccess: false;
1045
+ isPlaceholderData: false;
1046
+ status: "error";
1047
+ dataUpdatedAt: number;
1048
+ errorUpdatedAt: number;
1049
+ failureCount: number;
1050
+ failureReason: Error | null;
1051
+ errorUpdateCount: number;
1052
+ isFetched: boolean;
1053
+ isFetchedAfterMount: boolean;
1054
+ isFetching: boolean;
1055
+ isInitialLoading: boolean;
1056
+ isPaused: boolean;
1057
+ isRefetching: boolean;
1058
+ isStale: boolean;
1059
+ isEnabled: boolean;
1060
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TransactionStatusResponse, Error>>;
1061
+ fetchStatus: _tanstack_react_query.FetchStatus;
1062
+ promise: Promise<TransactionStatusResponse>;
1063
+ } | {
1064
+ fetchTransactionStatus: (newInput: FetchTransactionStatusInput) => Promise<TransactionStatusResponse>;
1065
+ data: TransactionStatusResponse;
1066
+ error: null;
1067
+ isError: false;
1068
+ isPending: false;
1069
+ isLoading: false;
1070
+ isLoadingError: false;
1071
+ isRefetchError: false;
1072
+ isSuccess: true;
1073
+ isPlaceholderData: false;
1074
+ status: "success";
1075
+ dataUpdatedAt: number;
1076
+ errorUpdatedAt: number;
1077
+ failureCount: number;
1078
+ failureReason: Error | null;
1079
+ errorUpdateCount: number;
1080
+ isFetched: boolean;
1081
+ isFetchedAfterMount: boolean;
1082
+ isFetching: boolean;
1083
+ isInitialLoading: boolean;
1084
+ isPaused: boolean;
1085
+ isRefetching: boolean;
1086
+ isStale: boolean;
1087
+ isEnabled: boolean;
1088
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TransactionStatusResponse, Error>>;
1089
+ fetchStatus: _tanstack_react_query.FetchStatus;
1090
+ promise: Promise<TransactionStatusResponse>;
1091
+ } | {
1092
+ fetchTransactionStatus: (newInput: FetchTransactionStatusInput) => Promise<TransactionStatusResponse>;
1093
+ data: undefined;
1094
+ error: Error;
1095
+ isError: true;
1096
+ isPending: false;
1097
+ isLoading: false;
1098
+ isLoadingError: true;
1099
+ isRefetchError: false;
1100
+ isSuccess: false;
1101
+ isPlaceholderData: false;
1102
+ status: "error";
1103
+ dataUpdatedAt: number;
1104
+ errorUpdatedAt: number;
1105
+ failureCount: number;
1106
+ failureReason: Error | null;
1107
+ errorUpdateCount: number;
1108
+ isFetched: boolean;
1109
+ isFetchedAfterMount: boolean;
1110
+ isFetching: boolean;
1111
+ isInitialLoading: boolean;
1112
+ isPaused: boolean;
1113
+ isRefetching: boolean;
1114
+ isStale: boolean;
1115
+ isEnabled: boolean;
1116
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TransactionStatusResponse, Error>>;
1117
+ fetchStatus: _tanstack_react_query.FetchStatus;
1118
+ promise: Promise<TransactionStatusResponse>;
1119
+ } | {
1120
+ fetchTransactionStatus: (newInput: FetchTransactionStatusInput) => Promise<TransactionStatusResponse>;
1121
+ data: undefined;
1122
+ error: null;
1123
+ isError: false;
1124
+ isPending: true;
1125
+ isLoading: true;
1126
+ isLoadingError: false;
1127
+ isRefetchError: false;
1128
+ isSuccess: false;
1129
+ isPlaceholderData: false;
1130
+ status: "pending";
1131
+ dataUpdatedAt: number;
1132
+ errorUpdatedAt: number;
1133
+ failureCount: number;
1134
+ failureReason: Error | null;
1135
+ errorUpdateCount: number;
1136
+ isFetched: boolean;
1137
+ isFetchedAfterMount: boolean;
1138
+ isFetching: boolean;
1139
+ isInitialLoading: boolean;
1140
+ isPaused: boolean;
1141
+ isRefetching: boolean;
1142
+ isStale: boolean;
1143
+ isEnabled: boolean;
1144
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TransactionStatusResponse, Error>>;
1145
+ fetchStatus: _tanstack_react_query.FetchStatus;
1146
+ promise: Promise<TransactionStatusResponse>;
1147
+ } | {
1148
+ fetchTransactionStatus: (newInput: FetchTransactionStatusInput) => Promise<TransactionStatusResponse>;
1149
+ data: undefined;
1150
+ error: null;
1151
+ isError: false;
1152
+ isPending: true;
1153
+ isLoadingError: false;
1154
+ isRefetchError: false;
1155
+ isSuccess: false;
1156
+ isPlaceholderData: false;
1157
+ status: "pending";
1158
+ dataUpdatedAt: number;
1159
+ errorUpdatedAt: number;
1160
+ failureCount: number;
1161
+ failureReason: Error | null;
1162
+ errorUpdateCount: number;
1163
+ isFetched: boolean;
1164
+ isFetchedAfterMount: boolean;
1165
+ isFetching: boolean;
1166
+ isLoading: boolean;
1167
+ isInitialLoading: boolean;
1168
+ isPaused: boolean;
1169
+ isRefetching: boolean;
1170
+ isStale: boolean;
1171
+ isEnabled: boolean;
1172
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TransactionStatusResponse, Error>>;
1173
+ fetchStatus: _tanstack_react_query.FetchStatus;
1174
+ promise: Promise<TransactionStatusResponse>;
1175
+ } | {
1176
+ fetchTransactionStatus: (newInput: FetchTransactionStatusInput) => Promise<TransactionStatusResponse>;
1177
+ data: TransactionStatusResponse;
1178
+ isError: false;
1179
+ error: null;
1180
+ isPending: false;
1181
+ isLoading: false;
1182
+ isLoadingError: false;
1183
+ isRefetchError: false;
1184
+ isSuccess: true;
1185
+ isPlaceholderData: true;
1186
+ status: "success";
1187
+ dataUpdatedAt: number;
1188
+ errorUpdatedAt: number;
1189
+ failureCount: number;
1190
+ failureReason: Error | null;
1191
+ errorUpdateCount: number;
1192
+ isFetched: boolean;
1193
+ isFetchedAfterMount: boolean;
1194
+ isFetching: boolean;
1195
+ isInitialLoading: boolean;
1196
+ isPaused: boolean;
1197
+ isRefetching: boolean;
1198
+ isStale: boolean;
1199
+ isEnabled: boolean;
1200
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<TransactionStatusResponse, Error>>;
1201
+ fetchStatus: _tanstack_react_query.FetchStatus;
1202
+ promise: Promise<TransactionStatusResponse>;
1203
+ };
1204
+
1205
+ type SyncOnChainInput = SyncOnChainTransfersParams & {
1206
+ bearerToken: string;
1207
+ };
1208
+ /**
1209
+ * Hook for syncing on-chain transfers from Voyager into the DB.
1210
+ *
1211
+ * Discovers transactions not made through the SDK (e.g., external USDC receives
1212
+ * from Argent X or other wallets). After sync, useGetTransactionList returns
1213
+ * the newly discovered transactions automatically.
1214
+ *
1215
+ * @example
1216
+ * ```tsx
1217
+ * const { syncTransfers, data, isLoading } = useSyncOnChainTransfers();
1218
+ *
1219
+ * // Sync on-chain transfers for a wallet
1220
+ * const result = await syncTransfersAsync({
1221
+ * walletAddress: wallet.publicKey,
1222
+ * bearerToken: await getToken(),
1223
+ * });
1224
+ * console.log(`Synced ${result.synced} new transfers`);
1225
+ * ```
1226
+ */
1227
+ declare function useSyncOnChainTransfers(): {
1228
+ syncTransfers: (input: SyncOnChainInput) => void;
1229
+ syncTransfersAsync: (input: SyncOnChainInput) => Promise<SyncOnChainTransfersResponse>;
1230
+ data: SyncOnChainTransfersResponse | undefined;
1231
+ isLoading: boolean;
1232
+ isError: boolean;
1233
+ error: Error | null;
1234
+ isSuccess: boolean;
1235
+ reset: () => void;
1236
+ };
1237
+
1238
+ type PurchaseSkuInput = {
1239
+ params: CreateSkuPurchaseParams;
1240
+ bearerToken: string;
1241
+ };
1242
+ /**
1243
+ * Hook for purchasing SKUs
1244
+ */
1245
+ declare function usePurchaseSku(): {
1246
+ purchaseSku: (input: PurchaseSkuInput) => void;
1247
+ purchaseSkuAsync: (input: PurchaseSkuInput) => Promise<Transaction>;
1248
+ data: Transaction | undefined;
1249
+ isLoading: boolean;
1250
+ isError: boolean;
1251
+ error: Error | null;
1252
+ isSuccess: boolean;
1253
+ reset: () => void;
1254
+ };
1255
+
1256
+ type GetSkuPurchaseInput = {
1257
+ id: string;
1258
+ getBearerToken?: () => Promise<string | null | undefined>;
1259
+ queryOptions?: Omit<UseQueryOptions<Transaction, Error>, "queryKey" | "queryFn">;
1260
+ };
1261
+ declare function useGetSkuPurchase(input?: GetSkuPurchaseInput): {
1262
+ fetchSkuPurchase: (newInput: GetSkuPurchaseInput) => Promise<Transaction>;
1263
+ data: Transaction;
1264
+ error: Error;
1265
+ isError: true;
1266
+ isPending: false;
1267
+ isLoading: false;
1268
+ isLoadingError: false;
1269
+ isRefetchError: true;
1270
+ isSuccess: false;
1271
+ isPlaceholderData: false;
1272
+ status: "error";
1273
+ dataUpdatedAt: number;
1274
+ errorUpdatedAt: number;
1275
+ failureCount: number;
1276
+ failureReason: Error | null;
1277
+ errorUpdateCount: number;
1278
+ isFetched: boolean;
1279
+ isFetchedAfterMount: boolean;
1280
+ isFetching: boolean;
1281
+ isInitialLoading: boolean;
1282
+ isPaused: boolean;
1283
+ isRefetching: boolean;
1284
+ isStale: boolean;
1285
+ isEnabled: boolean;
1286
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
1287
+ fetchStatus: _tanstack_react_query.FetchStatus;
1288
+ promise: Promise<Transaction>;
1289
+ } | {
1290
+ fetchSkuPurchase: (newInput: GetSkuPurchaseInput) => Promise<Transaction>;
1291
+ data: Transaction;
1292
+ error: null;
1293
+ isError: false;
1294
+ isPending: false;
1295
+ isLoading: false;
1296
+ isLoadingError: false;
1297
+ isRefetchError: false;
1298
+ isSuccess: true;
1299
+ isPlaceholderData: false;
1300
+ status: "success";
1301
+ dataUpdatedAt: number;
1302
+ errorUpdatedAt: number;
1303
+ failureCount: number;
1304
+ failureReason: Error | null;
1305
+ errorUpdateCount: number;
1306
+ isFetched: boolean;
1307
+ isFetchedAfterMount: boolean;
1308
+ isFetching: boolean;
1309
+ isInitialLoading: boolean;
1310
+ isPaused: boolean;
1311
+ isRefetching: boolean;
1312
+ isStale: boolean;
1313
+ isEnabled: boolean;
1314
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
1315
+ fetchStatus: _tanstack_react_query.FetchStatus;
1316
+ promise: Promise<Transaction>;
1317
+ } | {
1318
+ fetchSkuPurchase: (newInput: GetSkuPurchaseInput) => Promise<Transaction>;
1319
+ data: undefined;
1320
+ error: Error;
1321
+ isError: true;
1322
+ isPending: false;
1323
+ isLoading: false;
1324
+ isLoadingError: true;
1325
+ isRefetchError: false;
1326
+ isSuccess: false;
1327
+ isPlaceholderData: false;
1328
+ status: "error";
1329
+ dataUpdatedAt: number;
1330
+ errorUpdatedAt: number;
1331
+ failureCount: number;
1332
+ failureReason: Error | null;
1333
+ errorUpdateCount: number;
1334
+ isFetched: boolean;
1335
+ isFetchedAfterMount: boolean;
1336
+ isFetching: boolean;
1337
+ isInitialLoading: boolean;
1338
+ isPaused: boolean;
1339
+ isRefetching: boolean;
1340
+ isStale: boolean;
1341
+ isEnabled: boolean;
1342
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
1343
+ fetchStatus: _tanstack_react_query.FetchStatus;
1344
+ promise: Promise<Transaction>;
1345
+ } | {
1346
+ fetchSkuPurchase: (newInput: GetSkuPurchaseInput) => Promise<Transaction>;
1347
+ data: undefined;
1348
+ error: null;
1349
+ isError: false;
1350
+ isPending: true;
1351
+ isLoading: true;
1352
+ isLoadingError: false;
1353
+ isRefetchError: false;
1354
+ isSuccess: false;
1355
+ isPlaceholderData: false;
1356
+ status: "pending";
1357
+ dataUpdatedAt: number;
1358
+ errorUpdatedAt: number;
1359
+ failureCount: number;
1360
+ failureReason: Error | null;
1361
+ errorUpdateCount: number;
1362
+ isFetched: boolean;
1363
+ isFetchedAfterMount: boolean;
1364
+ isFetching: boolean;
1365
+ isInitialLoading: boolean;
1366
+ isPaused: boolean;
1367
+ isRefetching: boolean;
1368
+ isStale: boolean;
1369
+ isEnabled: boolean;
1370
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
1371
+ fetchStatus: _tanstack_react_query.FetchStatus;
1372
+ promise: Promise<Transaction>;
1373
+ } | {
1374
+ fetchSkuPurchase: (newInput: GetSkuPurchaseInput) => Promise<Transaction>;
1375
+ data: undefined;
1376
+ error: null;
1377
+ isError: false;
1378
+ isPending: true;
1379
+ isLoadingError: false;
1380
+ isRefetchError: false;
1381
+ isSuccess: false;
1382
+ isPlaceholderData: false;
1383
+ status: "pending";
1384
+ dataUpdatedAt: number;
1385
+ errorUpdatedAt: number;
1386
+ failureCount: number;
1387
+ failureReason: Error | null;
1388
+ errorUpdateCount: number;
1389
+ isFetched: boolean;
1390
+ isFetchedAfterMount: boolean;
1391
+ isFetching: boolean;
1392
+ isLoading: boolean;
1393
+ isInitialLoading: boolean;
1394
+ isPaused: boolean;
1395
+ isRefetching: boolean;
1396
+ isStale: boolean;
1397
+ isEnabled: boolean;
1398
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
1399
+ fetchStatus: _tanstack_react_query.FetchStatus;
1400
+ promise: Promise<Transaction>;
1401
+ } | {
1402
+ fetchSkuPurchase: (newInput: GetSkuPurchaseInput) => Promise<Transaction>;
1403
+ data: Transaction;
1404
+ isError: false;
1405
+ error: null;
1406
+ isPending: false;
1407
+ isLoading: false;
1408
+ isLoadingError: false;
1409
+ isRefetchError: false;
1410
+ isSuccess: true;
1411
+ isPlaceholderData: true;
1412
+ status: "success";
1413
+ dataUpdatedAt: number;
1414
+ errorUpdatedAt: number;
1415
+ failureCount: number;
1416
+ failureReason: Error | null;
1417
+ errorUpdateCount: number;
1418
+ isFetched: boolean;
1419
+ isFetchedAfterMount: boolean;
1420
+ isFetching: boolean;
1421
+ isInitialLoading: boolean;
1422
+ isPaused: boolean;
1423
+ isRefetching: boolean;
1424
+ isStale: boolean;
1425
+ isEnabled: boolean;
1426
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Transaction, Error>>;
1427
+ fetchStatus: _tanstack_react_query.FetchStatus;
1428
+ promise: Promise<Transaction>;
1429
+ };
1430
+
1431
+ type SkuListInput = {
1432
+ query: GetSkuListQuery;
1433
+ getBearerToken?: () => Promise<string | null | undefined>;
1434
+ queryOptions?: Omit<UseQueryOptions<PaginatedResponse<Sku>, Error>, "queryKey" | "queryFn">;
1435
+ };
1436
+ declare function useGetSkuList(input?: SkuListInput): {
1437
+ fetchSkuList: (newInput: SkuListInput) => Promise<PaginatedResponse<Sku>>;
1438
+ data: PaginatedResponse<Sku>;
1439
+ error: Error;
1440
+ isError: true;
1441
+ isPending: false;
1442
+ isLoading: false;
1443
+ isLoadingError: false;
1444
+ isRefetchError: true;
1445
+ isSuccess: false;
1446
+ isPlaceholderData: false;
1447
+ status: "error";
1448
+ dataUpdatedAt: number;
1449
+ errorUpdatedAt: number;
1450
+ failureCount: number;
1451
+ failureReason: Error | null;
1452
+ errorUpdateCount: number;
1453
+ isFetched: boolean;
1454
+ isFetchedAfterMount: boolean;
1455
+ isFetching: boolean;
1456
+ isInitialLoading: boolean;
1457
+ isPaused: boolean;
1458
+ isRefetching: boolean;
1459
+ isStale: boolean;
1460
+ isEnabled: boolean;
1461
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Sku>, Error>>;
1462
+ fetchStatus: _tanstack_react_query.FetchStatus;
1463
+ promise: Promise<PaginatedResponse<Sku>>;
1464
+ } | {
1465
+ fetchSkuList: (newInput: SkuListInput) => Promise<PaginatedResponse<Sku>>;
1466
+ data: PaginatedResponse<Sku>;
1467
+ error: null;
1468
+ isError: false;
1469
+ isPending: false;
1470
+ isLoading: false;
1471
+ isLoadingError: false;
1472
+ isRefetchError: false;
1473
+ isSuccess: true;
1474
+ isPlaceholderData: false;
1475
+ status: "success";
1476
+ dataUpdatedAt: number;
1477
+ errorUpdatedAt: number;
1478
+ failureCount: number;
1479
+ failureReason: Error | null;
1480
+ errorUpdateCount: number;
1481
+ isFetched: boolean;
1482
+ isFetchedAfterMount: boolean;
1483
+ isFetching: boolean;
1484
+ isInitialLoading: boolean;
1485
+ isPaused: boolean;
1486
+ isRefetching: boolean;
1487
+ isStale: boolean;
1488
+ isEnabled: boolean;
1489
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Sku>, Error>>;
1490
+ fetchStatus: _tanstack_react_query.FetchStatus;
1491
+ promise: Promise<PaginatedResponse<Sku>>;
1492
+ } | {
1493
+ fetchSkuList: (newInput: SkuListInput) => Promise<PaginatedResponse<Sku>>;
1494
+ data: undefined;
1495
+ error: Error;
1496
+ isError: true;
1497
+ isPending: false;
1498
+ isLoading: false;
1499
+ isLoadingError: true;
1500
+ isRefetchError: false;
1501
+ isSuccess: false;
1502
+ isPlaceholderData: false;
1503
+ status: "error";
1504
+ dataUpdatedAt: number;
1505
+ errorUpdatedAt: number;
1506
+ failureCount: number;
1507
+ failureReason: Error | null;
1508
+ errorUpdateCount: number;
1509
+ isFetched: boolean;
1510
+ isFetchedAfterMount: boolean;
1511
+ isFetching: boolean;
1512
+ isInitialLoading: boolean;
1513
+ isPaused: boolean;
1514
+ isRefetching: boolean;
1515
+ isStale: boolean;
1516
+ isEnabled: boolean;
1517
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Sku>, Error>>;
1518
+ fetchStatus: _tanstack_react_query.FetchStatus;
1519
+ promise: Promise<PaginatedResponse<Sku>>;
1520
+ } | {
1521
+ fetchSkuList: (newInput: SkuListInput) => Promise<PaginatedResponse<Sku>>;
1522
+ data: undefined;
1523
+ error: null;
1524
+ isError: false;
1525
+ isPending: true;
1526
+ isLoading: true;
1527
+ isLoadingError: false;
1528
+ isRefetchError: false;
1529
+ isSuccess: false;
1530
+ isPlaceholderData: false;
1531
+ status: "pending";
1532
+ dataUpdatedAt: number;
1533
+ errorUpdatedAt: number;
1534
+ failureCount: number;
1535
+ failureReason: Error | null;
1536
+ errorUpdateCount: number;
1537
+ isFetched: boolean;
1538
+ isFetchedAfterMount: boolean;
1539
+ isFetching: boolean;
1540
+ isInitialLoading: boolean;
1541
+ isPaused: boolean;
1542
+ isRefetching: boolean;
1543
+ isStale: boolean;
1544
+ isEnabled: boolean;
1545
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Sku>, Error>>;
1546
+ fetchStatus: _tanstack_react_query.FetchStatus;
1547
+ promise: Promise<PaginatedResponse<Sku>>;
1548
+ } | {
1549
+ fetchSkuList: (newInput: SkuListInput) => Promise<PaginatedResponse<Sku>>;
1550
+ data: undefined;
1551
+ error: null;
1552
+ isError: false;
1553
+ isPending: true;
1554
+ isLoadingError: false;
1555
+ isRefetchError: false;
1556
+ isSuccess: false;
1557
+ isPlaceholderData: false;
1558
+ status: "pending";
1559
+ dataUpdatedAt: number;
1560
+ errorUpdatedAt: number;
1561
+ failureCount: number;
1562
+ failureReason: Error | null;
1563
+ errorUpdateCount: number;
1564
+ isFetched: boolean;
1565
+ isFetchedAfterMount: boolean;
1566
+ isFetching: boolean;
1567
+ isLoading: boolean;
1568
+ isInitialLoading: boolean;
1569
+ isPaused: boolean;
1570
+ isRefetching: boolean;
1571
+ isStale: boolean;
1572
+ isEnabled: boolean;
1573
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Sku>, Error>>;
1574
+ fetchStatus: _tanstack_react_query.FetchStatus;
1575
+ promise: Promise<PaginatedResponse<Sku>>;
1576
+ } | {
1577
+ fetchSkuList: (newInput: SkuListInput) => Promise<PaginatedResponse<Sku>>;
1578
+ data: PaginatedResponse<Sku>;
1579
+ isError: false;
1580
+ error: null;
1581
+ isPending: false;
1582
+ isLoading: false;
1583
+ isLoadingError: false;
1584
+ isRefetchError: false;
1585
+ isSuccess: true;
1586
+ isPlaceholderData: true;
1587
+ status: "success";
1588
+ dataUpdatedAt: number;
1589
+ errorUpdatedAt: number;
1590
+ failureCount: number;
1591
+ failureReason: Error | null;
1592
+ errorUpdateCount: number;
1593
+ isFetched: boolean;
1594
+ isFetchedAfterMount: boolean;
1595
+ isFetching: boolean;
1596
+ isInitialLoading: boolean;
1597
+ isPaused: boolean;
1598
+ isRefetching: boolean;
1599
+ isStale: boolean;
1600
+ isEnabled: boolean;
1601
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<PaginatedResponse<Sku>, Error>>;
1602
+ fetchStatus: _tanstack_react_query.FetchStatus;
1603
+ promise: Promise<PaginatedResponse<Sku>>;
1604
+ };
1605
+
1606
+ type GetSkuInput = {
1607
+ id: string;
1608
+ getBearerToken?: () => Promise<string | null | undefined>;
1609
+ queryOptions?: Omit<UseQueryOptions<Sku, Error>, "queryKey" | "queryFn">;
1610
+ };
1611
+ declare function useGetSku(input?: GetSkuInput): {
1612
+ fetchSku: (input: GetSkuInput) => Promise<Sku>;
1613
+ data: Sku;
1614
+ error: Error;
1615
+ isError: true;
1616
+ isPending: false;
1617
+ isLoading: false;
1618
+ isLoadingError: false;
1619
+ isRefetchError: true;
1620
+ isSuccess: false;
1621
+ isPlaceholderData: false;
1622
+ status: "error";
1623
+ dataUpdatedAt: number;
1624
+ errorUpdatedAt: number;
1625
+ failureCount: number;
1626
+ failureReason: Error | null;
1627
+ errorUpdateCount: number;
1628
+ isFetched: boolean;
1629
+ isFetchedAfterMount: boolean;
1630
+ isFetching: boolean;
1631
+ isInitialLoading: boolean;
1632
+ isPaused: boolean;
1633
+ isRefetching: boolean;
1634
+ isStale: boolean;
1635
+ isEnabled: boolean;
1636
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Sku, Error>>;
1637
+ fetchStatus: _tanstack_react_query.FetchStatus;
1638
+ promise: Promise<Sku>;
1639
+ } | {
1640
+ fetchSku: (input: GetSkuInput) => Promise<Sku>;
1641
+ data: Sku;
1642
+ error: null;
1643
+ isError: false;
1644
+ isPending: false;
1645
+ isLoading: false;
1646
+ isLoadingError: false;
1647
+ isRefetchError: false;
1648
+ isSuccess: true;
1649
+ isPlaceholderData: false;
1650
+ status: "success";
1651
+ dataUpdatedAt: number;
1652
+ errorUpdatedAt: number;
1653
+ failureCount: number;
1654
+ failureReason: Error | null;
1655
+ errorUpdateCount: number;
1656
+ isFetched: boolean;
1657
+ isFetchedAfterMount: boolean;
1658
+ isFetching: boolean;
1659
+ isInitialLoading: boolean;
1660
+ isPaused: boolean;
1661
+ isRefetching: boolean;
1662
+ isStale: boolean;
1663
+ isEnabled: boolean;
1664
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Sku, Error>>;
1665
+ fetchStatus: _tanstack_react_query.FetchStatus;
1666
+ promise: Promise<Sku>;
1667
+ } | {
1668
+ fetchSku: (input: GetSkuInput) => Promise<Sku>;
1669
+ data: undefined;
1670
+ error: Error;
1671
+ isError: true;
1672
+ isPending: false;
1673
+ isLoading: false;
1674
+ isLoadingError: true;
1675
+ isRefetchError: false;
1676
+ isSuccess: false;
1677
+ isPlaceholderData: false;
1678
+ status: "error";
1679
+ dataUpdatedAt: number;
1680
+ errorUpdatedAt: number;
1681
+ failureCount: number;
1682
+ failureReason: Error | null;
1683
+ errorUpdateCount: number;
1684
+ isFetched: boolean;
1685
+ isFetchedAfterMount: boolean;
1686
+ isFetching: boolean;
1687
+ isInitialLoading: boolean;
1688
+ isPaused: boolean;
1689
+ isRefetching: boolean;
1690
+ isStale: boolean;
1691
+ isEnabled: boolean;
1692
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Sku, Error>>;
1693
+ fetchStatus: _tanstack_react_query.FetchStatus;
1694
+ promise: Promise<Sku>;
1695
+ } | {
1696
+ fetchSku: (input: GetSkuInput) => Promise<Sku>;
1697
+ data: undefined;
1698
+ error: null;
1699
+ isError: false;
1700
+ isPending: true;
1701
+ isLoading: true;
1702
+ isLoadingError: false;
1703
+ isRefetchError: false;
1704
+ isSuccess: false;
1705
+ isPlaceholderData: false;
1706
+ status: "pending";
1707
+ dataUpdatedAt: number;
1708
+ errorUpdatedAt: number;
1709
+ failureCount: number;
1710
+ failureReason: Error | null;
1711
+ errorUpdateCount: number;
1712
+ isFetched: boolean;
1713
+ isFetchedAfterMount: boolean;
1714
+ isFetching: boolean;
1715
+ isInitialLoading: boolean;
1716
+ isPaused: boolean;
1717
+ isRefetching: boolean;
1718
+ isStale: boolean;
1719
+ isEnabled: boolean;
1720
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Sku, Error>>;
1721
+ fetchStatus: _tanstack_react_query.FetchStatus;
1722
+ promise: Promise<Sku>;
1723
+ } | {
1724
+ fetchSku: (input: GetSkuInput) => Promise<Sku>;
1725
+ data: undefined;
1726
+ error: null;
1727
+ isError: false;
1728
+ isPending: true;
1729
+ isLoadingError: false;
1730
+ isRefetchError: false;
1731
+ isSuccess: false;
1732
+ isPlaceholderData: false;
1733
+ status: "pending";
1734
+ dataUpdatedAt: number;
1735
+ errorUpdatedAt: number;
1736
+ failureCount: number;
1737
+ failureReason: Error | null;
1738
+ errorUpdateCount: number;
1739
+ isFetched: boolean;
1740
+ isFetchedAfterMount: boolean;
1741
+ isFetching: boolean;
1742
+ isLoading: boolean;
1743
+ isInitialLoading: boolean;
1744
+ isPaused: boolean;
1745
+ isRefetching: boolean;
1746
+ isStale: boolean;
1747
+ isEnabled: boolean;
1748
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Sku, Error>>;
1749
+ fetchStatus: _tanstack_react_query.FetchStatus;
1750
+ promise: Promise<Sku>;
1751
+ } | {
1752
+ fetchSku: (input: GetSkuInput) => Promise<Sku>;
1753
+ data: Sku;
1754
+ isError: false;
1755
+ error: null;
1756
+ isPending: false;
1757
+ isLoading: false;
1758
+ isLoadingError: false;
1759
+ isRefetchError: false;
1760
+ isSuccess: true;
1761
+ isPlaceholderData: true;
1762
+ status: "success";
1763
+ dataUpdatedAt: number;
1764
+ errorUpdatedAt: number;
1765
+ failureCount: number;
1766
+ failureReason: Error | null;
1767
+ errorUpdateCount: number;
1768
+ isFetched: boolean;
1769
+ isFetchedAfterMount: boolean;
1770
+ isFetching: boolean;
1771
+ isInitialLoading: boolean;
1772
+ isPaused: boolean;
1773
+ isRefetching: boolean;
1774
+ isStale: boolean;
1775
+ isEnabled: boolean;
1776
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Sku, Error>>;
1777
+ fetchStatus: _tanstack_react_query.FetchStatus;
1778
+ promise: Promise<Sku>;
1779
+ };
1780
+
1781
+ type CallAnyContractInput = {
1782
+ params: CallAnyContractParams;
1783
+ bearerToken: string;
1784
+ };
1785
+ /**
1786
+ * Hook for calling any contract method
1787
+ */
1788
+ declare function useCallAnyContract(): {
1789
+ callAnyContract: (params: CallAnyContractInput) => void;
1790
+ callAnyContractAsync: (params: CallAnyContractInput) => Promise<string>;
1791
+ data: string | undefined;
1792
+ isLoading: boolean;
1793
+ isError: boolean;
1794
+ error: Error | null;
1795
+ isSuccess: boolean;
1796
+ reset: () => void;
1797
+ };
1798
+
1799
+ /**
1800
+ * Sign SNIP-12 typed data and get the full signature span (felt strings) —
1801
+ * the shape a dApp's `wallet_signTypedData` expects. Wallet-type aware: SHHH
1802
+ * returns the V2_SNIP12 owner envelope, standard accounts return `[r, s]`.
1803
+ * Purely local (decrypt + sign) — no API call.
1804
+ */
1805
+ declare function useSignTypedData(): {
1806
+ signTypedData: (params: SignTypedDataParams) => void;
1807
+ signTypedDataAsync: (params: SignTypedDataParams) => Promise<string[]>;
1808
+ data: string[] | undefined;
1809
+ isLoading: boolean;
1810
+ isError: boolean;
1811
+ error: Error | null;
1812
+ isSuccess: boolean;
1813
+ reset: () => void;
1814
+ };
1815
+
1816
+ /**
1817
+ * An approval the host (walletv2, the hosted web-wallet, or a harness) must
1818
+ * resolve before the SWO performs a sensitive action. Returning `false`
1819
+ * surfaces a USER_REFUSED_OP error to the dApp. The host renders the UI;
1820
+ * the SWO core stays framework-agnostic.
1821
+ */
1822
+ type ChipiApprovalRequest = {
1823
+ type: "connect";
1824
+ } | {
1825
+ type: "execute";
1826
+ calls: Call$2[];
1827
+ } | {
1828
+ type: "signTypedData";
1829
+ typedData: TypedData;
1830
+ } | {
1831
+ /** dApp-proposed session policy shown at connect time (approve once). */
1832
+ type: "session";
1833
+ policy: ChipiSessionPolicy;
1834
+ };
1835
+ /**
1836
+ * A dApp-proposed session policy. Mirrors the SNIP-163 sessions component the
1837
+ * SHHH/CHIPI accounts enforce on-chain via the 4-felt session signature
1838
+ * `[session_pubkey, r, s, valid_until]`.
1839
+ */
1840
+ interface ChipiSessionPolicy {
1841
+ /** Allowed (contractAddress, entrypoint) pairs the session may call. */
1842
+ allowedCalls: Array<{
1843
+ contractAddress: string;
1844
+ entrypoint: string;
1845
+ }>;
1846
+ /** Unix seconds after which the session is invalid. */
1847
+ validUntil: number;
1848
+ /** Optional per-token spend caps, by token address. */
1849
+ spendCaps?: Array<{
1850
+ token: string;
1851
+ amount: string;
1852
+ }>;
1853
+ }
1854
+ /**
1855
+ * Everything the framework-agnostic SWO needs, supplied by the host layer
1856
+ * (`@chipi-stack/react`'s `useChipiWalletObject`, the hosted web-wallet, etc.).
1857
+ * Keeping these as injected functions is what lets the SWO live in `core`
1858
+ * (depends only on `types`/`starknet`) instead of hard-importing `backend`.
1859
+ */
1860
+ interface ChipiWindowObjectDeps {
1861
+ /** Stable wallet id — MUST be `"chipi"` so the injected key, get-starknet
1862
+ * discovery entry, and starknetkit preset all agree. */
1863
+ id?: string;
1864
+ name?: string;
1865
+ version?: string;
1866
+ icon?: string;
1867
+ /** Starknet chain id felt (e.g. SN_MAIN). */
1868
+ chainId: string;
1869
+ /** Resolve the connected account address(es); `[]` when locked/disconnected. */
1870
+ getAccounts: () => Promise<string[]>;
1871
+ /**
1872
+ * Execute the dApp's calls and return the tx hash. The host implements
1873
+ * session-first routing here: in-policy → 4-felt session sig (silent);
1874
+ * out-of-policy/sensitive → owner envelope (passkey prompt). Both gasless.
1875
+ */
1876
+ executeCalls: (calls: Call$2[]) => Promise<string>;
1877
+ /** Sign SNIP-12 typed data → signature felts (envelope-aware for SHHH). */
1878
+ signTypedData: (typedData: TypedData) => Promise<string[]>;
1879
+ /** Counterfactual deployment data for an undeployed account. */
1880
+ getDeploymentData: () => Promise<AccountDeploymentData>;
1881
+ /** Optional: establish a session from a dApp-proposed policy (approve once). */
1882
+ createSession?: (policy: ChipiSessionPolicy) => Promise<void>;
1883
+ /** Host approval gate. Defaults to auto-approve (harness) when omitted. */
1884
+ requestApproval?: (req: ChipiApprovalRequest) => Promise<boolean>;
1885
+ }
1886
+
1887
+ interface UseChipiWalletObjectConfig {
1888
+ /** The connected Chipi wallet (null when locked / not yet created). */
1889
+ wallet: WalletData | null | undefined;
1890
+ /** Resolve the paymaster bearer token for execution. */
1891
+ getBearerToken: () => Promise<string>;
1892
+ /** Resolve the encryptKey (PIN / passkey-derived). Owner path may prompt;
1893
+ * the host is responsible for any caching that keeps the session path silent. */
1894
+ getEncryptKey: () => Promise<string>;
1895
+ /** Active session (host-managed) — enables session-first routing. */
1896
+ session?: SessionKeyData | null;
1897
+ /** The policy that `session` was registered with — used to decide, client
1898
+ * side, whether a dApp's calls are in-policy (so we don't send a doomed tx). */
1899
+ sessionPolicy?: ChipiSessionPolicy | null;
1900
+ /** Chain id felt; defaults to SN_MAIN. */
1901
+ chainId?: string;
1902
+ /** Host approval gate (connect / execute / signTypedData / session). */
1903
+ requestApproval?: (req: ChipiApprovalRequest) => Promise<boolean>;
1904
+ }
1905
+ /**
1906
+ * Compose the deps for a Chipi `StarknetWindowObject` from the existing SDK
1907
+ * hooks, with **session-first execution routing**:
1908
+ * - an in-policy, unexpired session → `useExecuteWithSession` (4-felt session
1909
+ * sig, no per-tx passkey),
1910
+ * - otherwise the owner path → `useCallAnyContract` (passkey).
1911
+ * Both gasless via the paymaster. Pass `deps` to `createChipiWindowObject` /
1912
+ * `injectChipiWallet`. `createSession(policy)` establishes a session on-chain
1913
+ * from a dApp-proposed policy (the "approve once" flow); the host stores the
1914
+ * returned SessionKeyData and feeds it back via `config.session`.
1915
+ */
1916
+ declare function useChipiWalletObject(config: UseChipiWalletObjectConfig): {
1917
+ deps: ChipiWindowObjectDeps;
1918
+ createSession: (policy: ChipiSessionPolicy) => Promise<SessionKeyData>;
1919
+ };
1920
+
1921
+ type RecordSendTransactionInput = {
1922
+ params: RecordSendTransactionParams;
1923
+ bearerToken: string;
1924
+ };
1925
+ declare function useRecordSendTransaction(): {
1926
+ recordSendTransaction: (input: RecordSendTransactionInput) => void;
1927
+ recordSendTransactionAsync: (input: RecordSendTransactionInput) => Promise<Transaction>;
1928
+ data: Transaction | undefined;
1929
+ isLoading: boolean;
1930
+ isError: boolean;
1931
+ error: Error | null;
1932
+ isSuccess: boolean;
1933
+ reset: () => void;
1934
+ };
1935
+
1936
+ type GetTokenBalanceInput = {
1937
+ params?: GetTokenBalanceParams;
1938
+ getBearerToken?: () => Promise<string | null | undefined>;
1939
+ queryOptions?: Omit<UseQueryOptions<GetTokenBalanceResponse, Error>, "queryKey" | "queryFn">;
1940
+ };
1941
+ declare function useGetTokenBalance(input?: GetTokenBalanceInput): {
1942
+ fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
1943
+ data: GetTokenBalanceResponse;
1944
+ error: Error;
1945
+ isError: true;
1946
+ isPending: false;
1947
+ isLoading: false;
1948
+ isLoadingError: false;
1949
+ isRefetchError: true;
1950
+ isSuccess: false;
1951
+ isPlaceholderData: false;
1952
+ status: "error";
1953
+ dataUpdatedAt: number;
1954
+ errorUpdatedAt: number;
1955
+ failureCount: number;
1956
+ failureReason: Error | null;
1957
+ errorUpdateCount: number;
1958
+ isFetched: boolean;
1959
+ isFetchedAfterMount: boolean;
1960
+ isFetching: boolean;
1961
+ isInitialLoading: boolean;
1962
+ isPaused: boolean;
1963
+ isRefetching: boolean;
1964
+ isStale: boolean;
1965
+ isEnabled: boolean;
1966
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
1967
+ fetchStatus: _tanstack_react_query.FetchStatus;
1968
+ promise: Promise<GetTokenBalanceResponse>;
1969
+ } | {
1970
+ fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
1971
+ data: GetTokenBalanceResponse;
1972
+ error: null;
1973
+ isError: false;
1974
+ isPending: false;
1975
+ isLoading: false;
1976
+ isLoadingError: false;
1977
+ isRefetchError: false;
1978
+ isSuccess: true;
1979
+ isPlaceholderData: false;
1980
+ status: "success";
1981
+ dataUpdatedAt: number;
1982
+ errorUpdatedAt: number;
1983
+ failureCount: number;
1984
+ failureReason: Error | null;
1985
+ errorUpdateCount: number;
1986
+ isFetched: boolean;
1987
+ isFetchedAfterMount: boolean;
1988
+ isFetching: boolean;
1989
+ isInitialLoading: boolean;
1990
+ isPaused: boolean;
1991
+ isRefetching: boolean;
1992
+ isStale: boolean;
1993
+ isEnabled: boolean;
1994
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
1995
+ fetchStatus: _tanstack_react_query.FetchStatus;
1996
+ promise: Promise<GetTokenBalanceResponse>;
1997
+ } | {
1998
+ fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
1999
+ data: undefined;
2000
+ error: Error;
2001
+ isError: true;
2002
+ isPending: false;
2003
+ isLoading: false;
2004
+ isLoadingError: true;
2005
+ isRefetchError: false;
2006
+ isSuccess: false;
2007
+ isPlaceholderData: false;
2008
+ status: "error";
2009
+ dataUpdatedAt: number;
2010
+ errorUpdatedAt: number;
2011
+ failureCount: number;
2012
+ failureReason: Error | null;
2013
+ errorUpdateCount: number;
2014
+ isFetched: boolean;
2015
+ isFetchedAfterMount: boolean;
2016
+ isFetching: boolean;
2017
+ isInitialLoading: boolean;
2018
+ isPaused: boolean;
2019
+ isRefetching: boolean;
2020
+ isStale: boolean;
2021
+ isEnabled: boolean;
2022
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
2023
+ fetchStatus: _tanstack_react_query.FetchStatus;
2024
+ promise: Promise<GetTokenBalanceResponse>;
2025
+ } | {
2026
+ fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
2027
+ data: undefined;
2028
+ error: null;
2029
+ isError: false;
2030
+ isPending: true;
2031
+ isLoading: true;
2032
+ isLoadingError: false;
2033
+ isRefetchError: false;
2034
+ isSuccess: false;
2035
+ isPlaceholderData: false;
2036
+ status: "pending";
2037
+ dataUpdatedAt: number;
2038
+ errorUpdatedAt: number;
2039
+ failureCount: number;
2040
+ failureReason: Error | null;
2041
+ errorUpdateCount: number;
2042
+ isFetched: boolean;
2043
+ isFetchedAfterMount: boolean;
2044
+ isFetching: boolean;
2045
+ isInitialLoading: boolean;
2046
+ isPaused: boolean;
2047
+ isRefetching: boolean;
2048
+ isStale: boolean;
2049
+ isEnabled: boolean;
2050
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
2051
+ fetchStatus: _tanstack_react_query.FetchStatus;
2052
+ promise: Promise<GetTokenBalanceResponse>;
2053
+ } | {
2054
+ fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
2055
+ data: undefined;
2056
+ error: null;
2057
+ isError: false;
2058
+ isPending: true;
2059
+ isLoadingError: false;
2060
+ isRefetchError: false;
2061
+ isSuccess: false;
2062
+ isPlaceholderData: false;
2063
+ status: "pending";
2064
+ dataUpdatedAt: number;
2065
+ errorUpdatedAt: number;
2066
+ failureCount: number;
2067
+ failureReason: Error | null;
2068
+ errorUpdateCount: number;
2069
+ isFetched: boolean;
2070
+ isFetchedAfterMount: boolean;
2071
+ isFetching: boolean;
2072
+ isLoading: boolean;
2073
+ isInitialLoading: boolean;
2074
+ isPaused: boolean;
2075
+ isRefetching: boolean;
2076
+ isStale: boolean;
2077
+ isEnabled: boolean;
2078
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
2079
+ fetchStatus: _tanstack_react_query.FetchStatus;
2080
+ promise: Promise<GetTokenBalanceResponse>;
2081
+ } | {
2082
+ fetchTokenBalance: (newInput: GetTokenBalanceInput) => Promise<GetTokenBalanceResponse>;
2083
+ data: GetTokenBalanceResponse;
2084
+ isError: false;
2085
+ error: null;
2086
+ isPending: false;
2087
+ isLoading: false;
2088
+ isLoadingError: false;
2089
+ isRefetchError: false;
2090
+ isSuccess: true;
2091
+ isPlaceholderData: true;
2092
+ status: "success";
2093
+ dataUpdatedAt: number;
2094
+ errorUpdatedAt: number;
2095
+ failureCount: number;
2096
+ failureReason: Error | null;
2097
+ errorUpdateCount: number;
2098
+ isFetched: boolean;
2099
+ isFetchedAfterMount: boolean;
2100
+ isFetching: boolean;
2101
+ isInitialLoading: boolean;
2102
+ isPaused: boolean;
2103
+ isRefetching: boolean;
2104
+ isStale: boolean;
2105
+ isEnabled: boolean;
2106
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<GetTokenBalanceResponse, Error>>;
2107
+ fetchStatus: _tanstack_react_query.FetchStatus;
2108
+ promise: Promise<GetTokenBalanceResponse>;
2109
+ };
2110
+
2111
+ /**
2112
+ * Hook for creating a session keypair locally.
2113
+ *
2114
+ * This generates session keys but does NOT register them on-chain.
2115
+ * The returned SessionKeyData should be stored by the developer externally
2116
+ * (e.g., in Clerk metadata, database, etc.) - the SDK does NOT persist this.
2117
+ *
2118
+ * After generating, call `useAddSessionKeyToContract` to register the session on-chain.
2119
+ *
2120
+ * @example
2121
+ * ```typescript
2122
+ * const { createSessionKey, data: session } = useCreateSessionKey();
2123
+ *
2124
+ * // Generate session keypair
2125
+ * createSessionKey({
2126
+ * encryptKey: userEncryptKey,
2127
+ * durationSeconds: 21600 // 6 hours (optional, default)
2128
+ * });
2129
+ *
2130
+ * // Store session externally after creation
2131
+ * if (session) {
2132
+ * await saveToClerk(session);
2133
+ * }
2134
+ * ```
2135
+ */
2136
+ declare function useCreateSessionKey(): {
2137
+ createSessionKey: (params: CreateSessionKeyParams) => void;
2138
+ createSessionKeyAsync: (params: CreateSessionKeyParams) => Promise<SessionKeyData>;
2139
+ data: SessionKeyData | undefined;
2140
+ isLoading: boolean;
2141
+ isError: boolean;
2142
+ error: Error | null;
2143
+ isSuccess: boolean;
2144
+ reset: () => void;
2145
+ };
2146
+
2147
+ type AddSessionKeyInput = {
2148
+ params: AddSessionKeyParams;
2149
+ bearerToken: string;
2150
+ };
2151
+ /**
2152
+ * Hook for registering a session key on the smart contract.
2153
+ *
2154
+ * This executes a sponsored transaction (using owner signature) to call
2155
+ * `add_or_update_session_key` on the CHIPI wallet contract.
2156
+ *
2157
+ * The session must be registered before it can be used for transactions.
2158
+ * Only works with CHIPI wallets.
2159
+ *
2160
+ * @example
2161
+ * ```typescript
2162
+ * const { addSessionKeyToContract, isLoading } = useAddSessionKeyToContract();
2163
+ *
2164
+ * // Register session on-chain
2165
+ * addSessionKeyToContract({
2166
+ * params: {
2167
+ * encryptKey: userEncryptKey,
2168
+ * wallet: userWallet,
2169
+ * sessionConfig: {
2170
+ * sessionPublicKey: session.publicKey,
2171
+ * validUntil: session.validUntil,
2172
+ * maxCalls: 1000,
2173
+ * allowedEntrypoints: [] // empty = all allowed
2174
+ * }
2175
+ * },
2176
+ * bearerToken
2177
+ * });
2178
+ * ```
2179
+ */
2180
+ declare function useAddSessionKeyToContract(): {
2181
+ addSessionKeyToContract: (input: AddSessionKeyInput) => void;
2182
+ addSessionKeyToContractAsync: (input: AddSessionKeyInput) => Promise<string>;
2183
+ data: string | undefined;
2184
+ isLoading: boolean;
2185
+ isError: boolean;
2186
+ error: Error | null;
2187
+ isSuccess: boolean;
2188
+ reset: () => void;
2189
+ };
2190
+
2191
+ type RevokeSessionKeyInput = {
2192
+ params: RevokeSessionKeyParams;
2193
+ bearerToken: string;
2194
+ };
2195
+ /**
2196
+ * Hook for revoking a session key from the smart contract.
2197
+ *
2198
+ * This executes a sponsored transaction (using owner signature) to call
2199
+ * `revoke_session_key` on the CHIPI wallet contract.
2200
+ *
2201
+ * After revocation, the session key can no longer be used for transactions.
2202
+ * Only works with CHIPI wallets.
2203
+ *
2204
+ * @example
2205
+ * ```typescript
2206
+ * const { revokeSessionKey, isLoading } = useRevokeSessionKey();
2207
+ *
2208
+ * // Revoke a session
2209
+ * revokeSessionKey({
2210
+ * params: {
2211
+ * encryptKey: userEncryptKey,
2212
+ * wallet: userWallet,
2213
+ * sessionPublicKey: session.publicKey
2214
+ * },
2215
+ * bearerToken
2216
+ * });
2217
+ * ```
2218
+ */
2219
+ declare function useRevokeSessionKey(): {
2220
+ revokeSessionKey: (input: RevokeSessionKeyInput) => void;
2221
+ revokeSessionKeyAsync: (input: RevokeSessionKeyInput) => Promise<string>;
2222
+ data: string | undefined;
2223
+ isLoading: boolean;
2224
+ isError: boolean;
2225
+ error: Error | null;
2226
+ isSuccess: boolean;
2227
+ reset: () => void;
2228
+ };
2229
+
2230
+ /**
2231
+ * Hook for querying session data from the smart contract.
2232
+ *
2233
+ * This is a read-only call that does not require signing or gas.
2234
+ * Returns the on-chain state of a session key including:
2235
+ * - Whether it's active
2236
+ * - When it expires
2237
+ * - Remaining calls
2238
+ * - Allowed entrypoints
2239
+ *
2240
+ * @example
2241
+ * ```typescript
2242
+ * const { data: sessionData, isLoading } = useGetSessionData({
2243
+ * walletAddress: userWallet.publicKey,
2244
+ * sessionPublicKey: session.publicKey
2245
+ * });
2246
+ *
2247
+ * if (sessionData?.isActive) {
2248
+ * console.log(`Session has ${sessionData.remainingCalls} calls remaining`);
2249
+ * }
2250
+ * ```
2251
+ */
2252
+ declare function useGetSessionData(params: GetSessionDataParams | null, options?: {
2253
+ enabled?: boolean;
2254
+ }): {
2255
+ data: SessionDataResponse | undefined;
2256
+ isLoading: boolean;
2257
+ isError: boolean;
2258
+ error: Error | null;
2259
+ isSuccess: boolean;
2260
+ refetch: UseQueryResult<SessionDataResponse, Error>["refetch"];
2261
+ };
2262
+
2263
+ type ExecuteWithSessionInput = {
2264
+ params: ExecuteWithSessionParams;
2265
+ bearerToken: string;
2266
+ };
2267
+ /**
2268
+ * Hook for executing a gasless transaction using a session key.
2269
+ *
2270
+ * This uses the 4-element session signature format instead of owner signature.
2271
+ * The session must be:
2272
+ * 1. Generated via `useCreateSessionKey`
2273
+ * 2. Registered on-chain via `useAddSessionKeyToContract`
2274
+ *
2275
+ * Only works with CHIPI wallets.
2276
+ *
2277
+ * @example
2278
+ * ```typescript
2279
+ * const { executeWithSession, isLoading } = useExecuteWithSession();
2280
+ *
2281
+ * // Execute a transfer using session key (no owner key needed)
2282
+ * executeWithSession({
2283
+ * params: {
2284
+ * encryptKey: userEncryptKey,
2285
+ * wallet: userWallet,
2286
+ * session: sessionKeyData,
2287
+ * calls: [{
2288
+ * contractAddress: USDC_ADDRESS,
2289
+ * entrypoint: 'transfer',
2290
+ * calldata: [recipient, amount, '0x0']
2291
+ * }]
2292
+ * },
2293
+ * bearerToken
2294
+ * });
2295
+ * ```
2296
+ */
2297
+ declare function useExecuteWithSession(): {
2298
+ executeWithSession: (input: ExecuteWithSessionInput) => void;
2299
+ executeWithSessionAsync: (input: ExecuteWithSessionInput) => Promise<string>;
2300
+ data: string | undefined;
2301
+ isLoading: boolean;
2302
+ isError: boolean;
2303
+ error: Error | null;
2304
+ isSuccess: boolean;
2305
+ reset: () => void;
2306
+ };
2307
+
2308
+ /**
2309
+ * Configuration for useX402Payment hook
2310
+ */
2311
+ interface UseX402PaymentConfig {
2312
+ /** Wallet data */
2313
+ wallet: WalletData | null | undefined;
2314
+ /** Encryption key for signing */
2315
+ encryptKey: string;
2316
+ /** Function to get the bearer token for API calls */
2317
+ getBearerToken?: () => Promise<string | null | undefined>;
2318
+ /** Static bearer token string (alternative to getBearerToken) */
2319
+ bearerToken?: string;
2320
+ /** Max amount per payment (USDC, human-readable e.g. "1.00") */
2321
+ maxPaymentAmount?: string;
2322
+ /** Alias for maxPaymentAmount */
2323
+ maxAmount?: string;
2324
+ /** Allowed recipient addresses (whitelist). Empty = allow all. */
2325
+ allowedRecipients?: string[];
2326
+ /** Active session for automatic payments (optional) */
2327
+ session?: SessionKeyData | null;
2328
+ /** Callback on successful payment */
2329
+ onPaymentComplete?: (txHash: string, amount: string) => void | Promise<void>;
2330
+ }
2331
+ /**
2332
+ * Last payment info returned by the hook
2333
+ */
2334
+ interface LastPaymentInfo {
2335
+ txHash: string | null;
2336
+ amount: string | null;
2337
+ timestamp: number;
2338
+ }
2339
+ /**
2340
+ * Return type for useX402Payment hook
2341
+ */
2342
+ interface UseX402PaymentReturn {
2343
+ /** Fetch wrapper that auto-handles 402 payments */
2344
+ x402Fetch: (url: string, init?: Record<string, any>) => Promise<Response>;
2345
+ /** Alias for x402Fetch */
2346
+ payFetch: (url: string, init?: Record<string, any>) => Promise<Response>;
2347
+ /** Manual payment signing (for custom flows) */
2348
+ signPayment: (requirement: PaymentRequirement) => Promise<PaymentPayload>;
2349
+ /** Whether a payment is in progress */
2350
+ isPaying: boolean;
2351
+ /** Last payment transaction hash */
2352
+ lastTxHash: string | null;
2353
+ /** Last payment amount (human-readable USDC) */
2354
+ lastAmount: string | null;
2355
+ /** Last payment info (txHash + amount + timestamp) */
2356
+ lastPayment: LastPaymentInfo | null;
2357
+ /** Total USDC spent in this session (human-readable) */
2358
+ totalSpent: string;
2359
+ /** Error from last payment attempt */
2360
+ error: Error | null;
2361
+ /** Total payments made in this session */
2362
+ paymentCount: number;
2363
+ }
2364
+ /**
2365
+ * React hook for x402 payment protocol support.
2366
+ *
2367
+ * Wraps fetch calls with automatic HTTP 402 payment handling.
2368
+ * When a server returns 402, the hook:
2369
+ * 1. Parses the payment requirement
2370
+ * 2. Validates against configured limits
2371
+ * 3. Signs using the wallet (or session key for automatic payments)
2372
+ * 4. Retries with the X-PAYMENT header
2373
+ *
2374
+ * @example
2375
+ * ```tsx
2376
+ * const { x402Fetch, isPaying, lastTxHash, paymentCount } = useX402Payment({
2377
+ * wallet,
2378
+ * encryptKey: pin,
2379
+ * getBearerToken: getToken,
2380
+ * maxPaymentAmount: "1.00",
2381
+ * onPaymentComplete: (txHash, amount) => {
2382
+ * console.log(`Paid ${amount} USDC, tx: ${txHash}`);
2383
+ * },
2384
+ * });
2385
+ *
2386
+ * // Automatic 402 handling
2387
+ * const response = await x402Fetch("https://api.example.com/premium");
2388
+ * const data = await response.json();
2389
+ * ```
2390
+ */
2391
+ declare function useX402Payment(config: UseX402PaymentConfig): UseX402PaymentReturn;
2392
+
2393
+ /**
2394
+ * SHHH V8.4 envelope builders surfaced as a single hook for React
2395
+ * integrators. Each helper returns the `signature: felt252[]` span
2396
+ * ready to pass to `paymaster_executeSponsoredRaw.calldata`.
2397
+ *
2398
+ * Most helpers take the OE `messageHash` plus kind-specific inputs.
2399
+ * `signWithMetaMask` is the exception: the `messageHash` is already
2400
+ * baked into the user-signed payload upstream, so it takes only the
2401
+ * 65-byte `personal_sign` signature and the registered pubkey.
2402
+ *
2403
+ * The hook is intentionally a thin facade over the
2404
+ * `@chipi-stack/backend` builders: it adds semantic names that map
2405
+ * to the user-facing wallet (`signWithMetaMask` = EIP-191,
2406
+ * `signWithPhantom` = Ed25519, `signWithPasskey` = WebAuthn P-256)
2407
+ * and stable React refs, but does NOT do browser-glue (no
2408
+ * `window.ethereum`, `window.solana`, or `navigator.credentials.get`
2409
+ * calls). Integrators retain full control of the user-prompt step:
2410
+ *
2411
+ * 1. Integrator calls their wallet adapter to get the raw signature
2412
+ * (or assertion / id_token).
2413
+ * 2. Integrator passes that into the matching helper to wrap it into
2414
+ * the V2_SNIP12 envelope.
2415
+ *
2416
+ * Pair with `useGuardianRecovery` or `useThresholdSign` (B6/B7) for
2417
+ * on-chain execution flows that need the recovery/governance builders.
2418
+ */
2419
+ interface UseShhhSignerReturn {
2420
+ /**
2421
+ * STARK ECDSA signer (legacy CHIPI v29 keys, fastest path).
2422
+ * Pure-local: no wallet prompt.
2423
+ */
2424
+ signWithStark: (params: {
2425
+ privateKey: bigint | string;
2426
+ messageHash: bigint;
2427
+ }) => bigint[];
2428
+ /**
2429
+ * Phantom-shape Ed25519 signer (Solana users importing to Starknet).
2430
+ * The 32-byte private key is the Solana keypair's secret material;
2431
+ * the public key is recovered inside the builder.
2432
+ */
2433
+ signWithPhantom: (params: {
2434
+ privateKey: Uint8Array;
2435
+ messageHash: bigint;
2436
+ }) => Promise<bigint[]>;
2437
+ /**
2438
+ * MetaMask-shape EIP-191 (`personal_sign`) signer. The signature
2439
+ * MUST come from a `personal_sign` over the 32-byte big-endian
2440
+ * messageHash; the pubkey was registered at wallet creation time.
2441
+ */
2442
+ signWithMetaMask: (params: {
2443
+ signatureHex: string;
2444
+ pubkey: Eip191Pubkey;
2445
+ }) => bigint[];
2446
+ /**
2447
+ * WebAuthn P-256 signer (passkey). Takes a completed
2448
+ * `navigator.credentials.get()` assertion split into its three
2449
+ * fields (authenticatorData, clientDataJSON, signature DER) plus
2450
+ * the pubkey registered at credential creation time.
2451
+ */
2452
+ signWithPasskey: (params: {
2453
+ authenticatorData: Uint8Array;
2454
+ clientDataJSON: Uint8Array;
2455
+ signatureDer: Uint8Array;
2456
+ pubkey: WebAuthnPubkey;
2457
+ messageHash: bigint;
2458
+ yParity?: 0n | 1n;
2459
+ }) => bigint[];
2460
+ /**
2461
+ * Apple Sign In signer (`JWT_ES256_APPLE_SUB`). Takes the
2462
+ * `id_token` from Apple's OAuth response. The nonce claim MUST
2463
+ * encode `messageHash` (see `messageHashToNonceB64url`).
2464
+ */
2465
+ signWithAppleIdToken: (params: {
2466
+ idToken: string;
2467
+ pubkey: JwtAppleSubPubkey;
2468
+ messageHash: bigint;
2469
+ }) => bigint[];
2470
+ }
2471
+ declare function useShhhSigner(): UseShhhSignerReturn;
2472
+
2473
+ type Call = ReturnType<typeof buildProposeAddOwnerCall>;
2474
+ /**
2475
+ * SHHH V8.4 multi-owner governance + guardian-recovery builders
2476
+ * surfaced as a single React hook. Each helper returns a Starknet
2477
+ * `Call` object (NOT a signature envelope); callers compose those
2478
+ * calls into an OutsideExecution and submit them via the paymaster
2479
+ * adapter, signing the OE with `useShhhSigner`.
2480
+ *
2481
+ * Two top-level flows are intended:
2482
+ *
2483
+ * 1. ADD DEVICE (user has wallet access, wants a second owner)
2484
+ * a. `proposeAddOwner` (owner-signed OE)
2485
+ * b. wait 48h timelock
2486
+ * c. `executeAddOwner` (owner-signed OE, with the opId from 1a)
2487
+ *
2488
+ * 2. RECOVER VIA GUARDIAN (user lost key)
2489
+ * a. `initiateRecovery` (guardian-signed OE)
2490
+ * b. wait 7 days
2491
+ * c. `finalizeRecovery` (anyone can submit, no signature required
2492
+ * beyond Cairo-side state checks)
2493
+ *
2494
+ * Read-only timelock helpers (`isReady`, `secondsRemaining`) take a
2495
+ * `validAfter` timestamp pulled from chain state and a clock reading;
2496
+ * they don't query the chain themselves. Pair this hook with whatever
2497
+ * mechanism your app already uses for on-chain state reads
2498
+ * (`useGetWallet`, RPC, multicall, etc.).
2499
+ *
2500
+ * The full controlled-component `<Recover />` route that wires this
2501
+ * hook into a state machine + UI ships as B6.2.
2502
+ */
2503
+ interface UseGuardianRecoveryReturn {
2504
+ buildProposeAddOwner: (args: {
2505
+ walletAddress: bigint | string;
2506
+ proposer: number;
2507
+ newOwner: NewOwnerInput;
2508
+ }) => Call;
2509
+ buildExecuteAddOwner: (args: {
2510
+ walletAddress: bigint | string;
2511
+ opId: bigint | string;
2512
+ newOwner: NewOwnerInput;
2513
+ }) => Call;
2514
+ buildProposeRemoveOwner: (args: {
2515
+ walletAddress: bigint | string;
2516
+ proposer: number;
2517
+ ownerId: number;
2518
+ }) => Call;
2519
+ buildExecuteRemoveOwner: (args: {
2520
+ walletAddress: bigint | string;
2521
+ opId: bigint | string;
2522
+ ownerId: number;
2523
+ }) => Call;
2524
+ buildProposeRotateOwner: (args: {
2525
+ walletAddress: bigint | string;
2526
+ proposer: number;
2527
+ ownerId: number;
2528
+ newPubkeyBytes: bigint[];
2529
+ }) => Call;
2530
+ buildExecuteRotateOwner: (args: {
2531
+ walletAddress: bigint | string;
2532
+ opId: bigint | string;
2533
+ ownerId: number;
2534
+ newPubkeyBytes: bigint[];
2535
+ }) => Call;
2536
+ buildProposeSetThreshold: (args: {
2537
+ walletAddress: bigint | string;
2538
+ proposer: number;
2539
+ newThreshold: number;
2540
+ }) => Call;
2541
+ buildExecuteSetThreshold: (args: {
2542
+ walletAddress: bigint | string;
2543
+ opId: bigint | string;
2544
+ newThreshold: number;
2545
+ }) => Call;
2546
+ buildCancelPendingOp: (args: {
2547
+ walletAddress: bigint | string;
2548
+ opId: bigint | string;
2549
+ }) => Call;
2550
+ buildInitiateRecovery: (args: {
2551
+ walletAddress: bigint | string;
2552
+ /** owner_id of the guardian that's signing the initiation OE */
2553
+ proposer: number;
2554
+ newOwner: NewOwnerInput;
2555
+ }) => Call;
2556
+ buildCancelRecovery: (args: {
2557
+ walletAddress: bigint | string;
2558
+ ownerId: number;
2559
+ }) => Call;
2560
+ buildFinalizeRecovery: (args: {
2561
+ walletAddress: bigint | string;
2562
+ newOwner: NewOwnerInput;
2563
+ }) => Call;
2564
+ isReady: (validAfterSecs: number | bigint, nowSecs?: number) => boolean;
2565
+ secondsRemaining: (validAfterSecs: number | bigint, nowSecs?: number) => number;
2566
+ TIMELOCK_SECONDS: typeof TIMELOCK_SECONDS;
2567
+ DEFAULT_OP_EXPIRY_SECONDS: typeof DEFAULT_OP_EXPIRY_SECONDS;
2568
+ ROLE_OWNER: typeof ROLE_OWNER;
2569
+ ROLE_GUARDIAN: typeof ROLE_GUARDIAN;
2570
+ OP_ADD_OWNER: typeof OP_ADD_OWNER;
2571
+ OP_REMOVE_OWNER: typeof OP_REMOVE_OWNER;
2572
+ OP_ROTATE_OWNER: typeof OP_ROTATE_OWNER;
2573
+ OP_SET_THRESHOLD: typeof OP_SET_THRESHOLD;
2574
+ }
2575
+ declare function useGuardianRecovery(): UseGuardianRecoveryReturn;
2576
+
2577
+ /**
2578
+ * SHHH V8.4 N-of-M threshold sign coordinator surfaced as a React
2579
+ * hook. Two complementary surfaces:
2580
+ *
2581
+ * 1. **Stateless helpers** — `assemble`, `parse`, and
2582
+ * `estimateGasOverhead` are pure facades over the matching
2583
+ * `@chipi-stack/backend` builders. Use them when you already
2584
+ * have all the inner envelopes in one render and just want to
2585
+ * ship the final V2_THRESHOLD span.
2586
+ *
2587
+ * 2. **Stateful collector** — for UI flows where N owners sign
2588
+ * asynchronously (passkey on phone → MetaMask on laptop, agent
2589
+ * auto-co-signing while a human reviews, etc.) the hook keeps
2590
+ * a queue of collected inner envelopes, exposes a "X of N
2591
+ * signed" state for UI display, validates each new envelope at
2592
+ * add-time (duplicate owner_id detection, structural shape),
2593
+ * and assembles the final span once the threshold is met via
2594
+ * `finalize()`.
2595
+ *
2596
+ * The collector validates each envelope inline using
2597
+ * `assertValidV2Snip12Envelope` from the backend — the same check the
2598
+ * `buildThresholdEnvelope` builder runs at assembly time. That way an
2599
+ * integrator's UI can show "owner 3 envelope rejected: duplicate
2600
+ * owner_id" before submitting the V2_THRESHOLD span on chain, instead
2601
+ * of after the paymaster reverts.
2602
+ *
2603
+ * Threshold governance (`propose_set_threshold` / `execute_set_threshold`)
2604
+ * lives in `useGuardianRecovery` because the multi-owner signing
2605
+ * here and the threshold-change proposals there share the same
2606
+ * Cairo SHHH wallet but are operationally separate flows.
2607
+ */
2608
+ interface UseThresholdSignReturn {
2609
+ /**
2610
+ * Assemble an N-of-M V2_THRESHOLD envelope from a pre-collected
2611
+ * list of inner V2_SNIP12 envelopes. Pure; no internal state used.
2612
+ * Throws on duplicate owner_id, structural mismatch, or negative
2613
+ * felts — same validation the on-chain dispatch would apply.
2614
+ */
2615
+ assemble: (args: {
2616
+ innerEnvelopes: bigint[][];
2617
+ }) => bigint[];
2618
+ /**
2619
+ * Inverse of `assemble`. Re-derives the constituent inner envelopes
2620
+ * from a V2_THRESHOLD span. Useful for UI flows showing "owners X,
2621
+ * Y, Z signed" from a stored envelope without re-walking the
2622
+ * collection state.
2623
+ */
2624
+ parse: (args: {
2625
+ envelope: bigint[];
2626
+ }) => {
2627
+ innerEnvelopes: bigint[][];
2628
+ };
2629
+ /**
2630
+ * Sum the per-kind paymaster gas overhead across the owners that
2631
+ * will participate. Use this to surface "this 2-of-3 mixed-kind
2632
+ * tx will cost X l2_gas to verify" copy in a UI.
2633
+ *
2634
+ * Per [services/gasless/signer-kinds#gas-overhead], a STARK +
2635
+ * EIP-191 pair budgets 2M + 10M = 12M l2_gas for verification on
2636
+ * top of the call's own cost.
2637
+ */
2638
+ estimateGasOverhead: (args: {
2639
+ owners: Array<{
2640
+ signerKind: ShhhSignerKind;
2641
+ }>;
2642
+ }) => number;
2643
+ /**
2644
+ * Live state machine. Re-renders the consuming component when an
2645
+ * envelope is added, removed, or the collection is reset.
2646
+ */
2647
+ state: ThresholdSignState;
2648
+ /**
2649
+ * Add one owner's inner V2_SNIP12 envelope to the collection.
2650
+ * Validates structurally + checks duplicate owner_id against
2651
+ * already-collected envelopes.
2652
+ *
2653
+ * Returns `true` on success, `false` on rejection. On rejection
2654
+ * the failure reason lands on `state.error` for inline UI display;
2655
+ * the collection is NOT mutated. A subsequent successful add
2656
+ * clears `state.error`.
2657
+ *
2658
+ * Idempotent in the sense that a second add of an already-rejected
2659
+ * envelope produces the same error; an already-collected envelope
2660
+ * (same owner_id) is treated as a duplicate.
2661
+ */
2662
+ addEnvelope: (envelope: bigint[]) => boolean;
2663
+ /**
2664
+ * Drop a previously-added envelope by its owner_id. Useful when
2665
+ * an owner signs but the integrator's review UI rejects their
2666
+ * specific tx and needs to ask them to re-sign with corrected
2667
+ * payload.
2668
+ */
2669
+ removeEnvelope: (ownerId: bigint) => void;
2670
+ /** Clear the entire collection (cancel + restart the sign flow). */
2671
+ reset: () => void;
2672
+ /**
2673
+ * Assemble the final V2_THRESHOLD envelope from collected inner
2674
+ * envelopes. Throws if fewer than `threshold` have been collected
2675
+ * (with a clear error so the caller's UI knows to keep prompting).
2676
+ */
2677
+ finalize: () => bigint[];
2678
+ MIN_THRESHOLD_OWNERS: typeof MIN_THRESHOLD_OWNERS;
2679
+ }
2680
+ interface ThresholdSignState {
2681
+ /** Threshold N this flow is collecting toward. */
2682
+ threshold: number;
2683
+ /** Inner envelopes collected so far, in arrival order. */
2684
+ collected: bigint[][];
2685
+ /**
2686
+ * Owner ids that have signed, in arrival order. Pre-derived from
2687
+ * `collected` so the UI doesn't have to re-parse each envelope.
2688
+ */
2689
+ signedOwnerIds: bigint[];
2690
+ /** Has the threshold been met? `collected.length >= threshold`. */
2691
+ isReady: boolean;
2692
+ /**
2693
+ * The most recent validation error from `addEnvelope`, if any.
2694
+ * Cleared on successful add or `reset()`. Use for inline UI error
2695
+ * display ("Owner X already signed", "envelope is malformed").
2696
+ */
2697
+ error: Error | null;
2698
+ }
2699
+ interface UseThresholdSignOptions {
2700
+ /**
2701
+ * Threshold N this flow targets. Must be at least
2702
+ * `MIN_THRESHOLD_OWNERS` (2). Changes to this value after first
2703
+ * render are honored — `isReady` re-evaluates against the new N
2704
+ * without dropping already-collected envelopes (use `reset` if
2705
+ * you need to start over).
2706
+ */
2707
+ threshold: number;
2708
+ }
2709
+ /**
2710
+ * SHHH V8.4 threshold sign coordinator.
2711
+ *
2712
+ * @example Pure assembly (all envelopes ready in one render)
2713
+ *
2714
+ * ```tsx
2715
+ * const t = useThresholdSign({ threshold: 2 });
2716
+ * const envelope = t.assemble({
2717
+ * innerEnvelopes: [starkInner, eip191Inner],
2718
+ * });
2719
+ * await submitThroughPaymaster(envelope);
2720
+ * ```
2721
+ *
2722
+ * @example Async sign flow (owners sign one at a time)
2723
+ *
2724
+ * ```tsx
2725
+ * const t = useThresholdSign({ threshold: 2 });
2726
+ *
2727
+ * // After owner 1 signs:
2728
+ * t.addEnvelope(owner1Envelope);
2729
+ *
2730
+ * // After owner 2 signs:
2731
+ * t.addEnvelope(owner2Envelope);
2732
+ *
2733
+ * // UI shows "Signed by: owner_id_1, owner_id_2" via t.state.signedOwnerIds.
2734
+ * // When t.state.isReady is true, submit:
2735
+ * if (t.state.isReady) {
2736
+ * const envelope = t.finalize();
2737
+ * await submitThroughPaymaster(envelope);
2738
+ * }
2739
+ * ```
2740
+ */
2741
+ declare function useThresholdSign(opts: UseThresholdSignOptions): UseThresholdSignReturn;
2742
+
2743
+ export { useCallAnyContract as A, useSignTypedData as B, type ChipiWindowObjectDeps as C, useChipiWalletObject as D, useRecordSendTransaction as E, useGetTokenBalance as F, useCreateSessionKey as G, useAddSessionKeyToContract as H, useRevokeSessionKey as I, useGetSessionData as J, useExecuteWithSession as K, useX402Payment as L, type UseX402PaymentConfig as M, type UseX402PaymentReturn as N, useShhhSigner as O, type UseShhhSignerReturn as P, useGuardianRecovery as Q, type UseGuardianRecoveryReturn as R, type SessionState as S, useThresholdSign as T, type UseChipiWalletObjectConfig as U, type UseThresholdSignReturn as V, type UseThresholdSignOptions as W, type ThresholdSignState as X, type ChipiApprovalRequest as a, type ChipiSessionPolicy as b, useGetWallet as c, useChipiWallet as d, type UseChipiWalletConfig as e, type UseChipiWalletReturn as f, type ChipiWalletData as g, useChipiSession as h, type UseChipiSessionConfig as i, type UseChipiSessionReturn as j, type SessionWallet as k, useMigrateWalletToPasskey as l, useUpdateWalletEncryption as m, useMigrateWalletToShhh as n, useTransfer as o, type UseTransferConfig as p, useApprove as q, useGetTransactionList as r, useGetTransaction as s, useGetTransactionStatus as t, useCreateWallet as u, useSyncOnChainTransfers as v, usePurchaseSku as w, useGetSkuPurchase as x, useGetSkuList as y, useGetSku as z };