@supanovaapp/sdk 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1307 @@
1
+ /**
2
+ * Supa SDK
3
+ *
4
+ * React SDK for seamless integration with Supa Backend API and Privy.io authentication,
5
+ * featuring full Canton Network support with Ed25519 signing via Stellar wallets.
6
+ *
7
+ * @packageDocumentation
8
+ *
9
+ * @example
10
+ * Basic setup
11
+ * ```tsx
12
+ * import { SupaProvider, useAuth, useCanton } from '@supa/sdk';
13
+ *
14
+ * function App() {
15
+ * return (
16
+ * <SupaProvider config={{ privyAppId: 'your_app_id' }}>
17
+ * <Dashboard />
18
+ * </SupaProvider>
19
+ * );
20
+ * }
21
+ *
22
+ * function Dashboard() {
23
+ * const { login, authenticated } = useAuth();
24
+ * const { registerCanton, isRegistered } = useCanton();
25
+ *
26
+ * if (!authenticated) {
27
+ * return <button onClick={login}>Login</button>;
28
+ * }
29
+ *
30
+ * if (!isRegistered) {
31
+ * return <button onClick={registerCanton}>Register Canton</button>;
32
+ * }
33
+ *
34
+ * return <div>Ready to use Canton Network!</div>;
35
+ * }
36
+ * ```
37
+ *
38
+ * @see {@link https://github.com/your-repo/supa-sdk | GitHub Repository}
39
+ * @see {@link https://docs.privy.io | Privy Documentation}
40
+ * @see {@link https://canton.network | Canton Network}
41
+ */
42
+
43
+ import { AxiosRequestConfig } from 'axios';
44
+ import { JSX } from 'react/jsx-runtime';
45
+ import { ReactNode } from 'react';
46
+ import { User } from '@privy-io/react-auth';
47
+ import { useSignRawHash } from '@privy-io/react-auth/extended-chains';
48
+
49
+ export declare interface AccountTokenBalance {
50
+ contractAddress: string;
51
+ tokenBalance: string;
52
+ error?: any | null;
53
+ }
54
+
55
+ export declare interface AccountTokensBalancesResponse {
56
+ address: string;
57
+ tokenBalances: AccountTokenBalance[];
58
+ }
59
+
60
+ export declare type AlchemyNetwork = 'eth-mainnet' | 'arb-mainnet' | 'opt-mainnet' | 'polygon-mainnet';
61
+
62
+ export declare class ApiClient {
63
+ private client;
64
+ private getAccessToken?;
65
+ private nodeIdentifier;
66
+ constructor(config?: ClientConfig);
67
+ get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
68
+ post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
69
+ put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
70
+ delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
71
+ patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
72
+ setAccessTokenGetter(getter: () => Promise<string | null>): void;
73
+ getBaseURL(): string;
74
+ }
75
+
76
+ export declare interface ApiError {
77
+ statusCode: number;
78
+ message: string;
79
+ error?: string;
80
+ }
81
+
82
+ export declare interface ApiResponse<T = any> {
83
+ data?: T;
84
+ error?: ApiError;
85
+ }
86
+
87
+ export declare class ApiService {
88
+ private client;
89
+ constructor(client: ApiClient);
90
+ /**
91
+ * Get current user information
92
+ * GET /user/me
93
+ */
94
+ getCurrentUser(): Promise<UserResponseDto>;
95
+ /**
96
+ * Get all users
97
+ * GET /user/all
98
+ */
99
+ getAllUsers(): Promise<UserResponseDto[]>;
100
+ /**
101
+ * Get user by Privy user ID
102
+ * GET /user/{privyUserId}
103
+ */
104
+ getUserByPrivyId(privyUserId: string): Promise<UserResponseDto>;
105
+ /**
106
+ * Get current user's smart wallet token balances
107
+ * GET /user/smart_wallet_balances
108
+ */
109
+ getSmartWalletBalances(force?: boolean): Promise<UserBalanceResponseDto>;
110
+ /**
111
+ * Create new dialog
112
+ * POST /dialogs
113
+ */
114
+ createDialog(text: string): Promise<DialogWithMessagesResponseDto>;
115
+ /**
116
+ * Get all user dialogs
117
+ * GET /dialogs
118
+ */
119
+ getAllDialogs(params?: PaginationParams): Promise<OffsetPaginatedDto<DialogListResponseDto>>;
120
+ /**
121
+ * Get specific dialog
122
+ * GET /dialogs/{id}
123
+ */
124
+ getDialog(id: number): Promise<DialogListResponseDto>;
125
+ /**
126
+ * Delete dialog
127
+ * DELETE /dialogs/{id}
128
+ */
129
+ deleteDialog(id: number): Promise<void>;
130
+ /**
131
+ * Create new message in dialog
132
+ * POST /dialogs/{dialogId}/messages
133
+ */
134
+ createMessage(dialogId: number, text: string): Promise<MessageResponseDto>;
135
+ /**
136
+ * Get all messages in dialog
137
+ * GET /dialogs/{dialogId}/messages
138
+ */
139
+ getDialogMessages(dialogId: number, params?: PaginationParams): Promise<OffsetPaginatedDto<MessageResponseDto>>;
140
+ /**
141
+ * Get specific message
142
+ * GET /messages/{id}
143
+ */
144
+ getMessage(id: number): Promise<MessageResponseDto>;
145
+ /**
146
+ * Get token prices by contract addresses
147
+ * POST /onchain/tokens_prices_by_addresses
148
+ */
149
+ getTokenPricesByAddresses(addresses: Array<{
150
+ network: AlchemyNetwork;
151
+ contractAddress: string;
152
+ }>): Promise<NetworkAddressAndPriceDto[]>;
153
+ /**
154
+ * Get token prices by symbols
155
+ * GET /onchain/tokens_prices
156
+ * @param symbols Array of token symbols (e.g., ['BTC', 'ETH', 'USDT'])
157
+ */
158
+ getTokenPrices(symbols: string[]): Promise<Record<string, number>>;
159
+ /**
160
+ * Get token price history
161
+ * GET /onchain/token_price_history
162
+ */
163
+ getTokenPriceHistory(params: TokenPriceHistoryParams): Promise<TokenPriceHistoryResponse>;
164
+ /**
165
+ * Get 24hr price changes for tokens
166
+ * POST /onchain/tokens_24hr_changes
167
+ */
168
+ getTokens24hrPriceChanges(tokens: Array<{
169
+ network: AlchemyNetwork;
170
+ contractAddress: string;
171
+ }>): Promise<TokenInfoWithPriceChangeDto[]>;
172
+ /**
173
+ * Get token info by address(es)
174
+ * GET /onchain/token_info/{network}
175
+ * @param network Blockchain network
176
+ * @param addresses Single address or array of addresses
177
+ */
178
+ getTokenInfo(network: string, addresses: string | string[]): Promise<Record<string, TokenInfo>>;
179
+ /**
180
+ * Get account token balances
181
+ * GET /onchain/account_tokens_balances/{network}
182
+ */
183
+ getAccountTokenBalances(network: string, account: string, force?: boolean): Promise<AccountTokensBalancesResponse>;
184
+ /**
185
+ * Get user transactions
186
+ * GET /transactions
187
+ */
188
+ getTransactions(params?: TransactionQueryParams): Promise<any>;
189
+ /**
190
+ * Force load user transactions
191
+ * POST /transactions/transactions_force
192
+ */
193
+ forceLoadTransactions(params?: TransactionQueryParams): Promise<any>;
194
+ /**
195
+ * Get SupaPoints balance
196
+ * GET /supa_points/balance
197
+ */
198
+ getSupaPointsBalance(): Promise<SupaPointsBalanceResponseDto>;
199
+ /**
200
+ * Get SupaPoints history
201
+ * GET /supa_points/history
202
+ */
203
+ getSupaPointsHistory(params?: SupaPointsHistoryParams): Promise<OffsetPaginatedDto<any>>;
204
+ /**
205
+ * Process daily login
206
+ * POST /supa_points/daily_login
207
+ */
208
+ dailyLogin(): Promise<DailyLoginResponseDto>;
209
+ /**
210
+ * Check if paymaster can sponsor user operation
211
+ * POST /paymaster
212
+ */
213
+ checkPaymasterSponsorship(request: PaymasterRequestDto): Promise<PaymasterResponseDto>;
214
+ /**
215
+ * Get Privy balance
216
+ * GET /privy/balance
217
+ */
218
+ getPrivyBalance(): Promise<any>;
219
+ }
220
+
221
+ /**
222
+ * Converts base64 string to Uint8Array
223
+ * @param base64 - Base64 encoded string
224
+ * @returns Byte array
225
+ */
226
+ export declare const base64ToBytes: (base64: string) => Uint8Array;
227
+
228
+ /**
229
+ * Converts base64 string to hex format
230
+ * @param base64 - Base64 encoded string
231
+ * @returns Hex string with 0x prefix
232
+ * @example
233
+ * ```ts
234
+ * const hex = base64ToHex('SGVsbG8=');
235
+ * console.log(hex); // "0x48656c6c6f"
236
+ * ```
237
+ */
238
+ export declare const base64ToHex: (base64: string) => string;
239
+
240
+ /**
241
+ * Converts Uint8Array to base64 string
242
+ * @param bytes - Byte array to convert
243
+ * @returns Base64 encoded string
244
+ */
245
+ export declare const bytesToBase64: (bytes: Uint8Array) => string;
246
+
247
+ export declare interface CantonActiveContract {
248
+ /** Contract ID */
249
+ contractId: string;
250
+ /** Template ID */
251
+ templateId: string;
252
+ /** Contract blob data (untyped) */
253
+ blob: unknown;
254
+ }
255
+
256
+ /** Active contract response item from API */
257
+ export declare interface CantonActiveContractItem {
258
+ /** Workflow ID (can be empty) */
259
+ workflowId: string;
260
+ /** Contract entry containing the active contract */
261
+ contractEntry: CantonContractEntry;
262
+ }
263
+
264
+ /** Response from /canton/api/active_contracts */
265
+ export declare type CantonActiveContractsResponseDto = CantonActiveContractItem[];
266
+
267
+ /** Amount with rate decay for Canton Amulet */
268
+ export declare interface CantonAmuletAmount {
269
+ /** Initial amount as decimal string */
270
+ initialAmount: string;
271
+ /** Round number when created */
272
+ createdAt: {
273
+ number: string;
274
+ };
275
+ /** Rate per round for decay */
276
+ ratePerRound: {
277
+ rate: string;
278
+ };
279
+ }
280
+
281
+ /** Create argument for Canton Amulet contract */
282
+ export declare interface CantonAmuletCreateArgument {
283
+ /** DSO party ID */
284
+ dso: string;
285
+ /** Owner party ID */
286
+ owner: string;
287
+ /** Amount with rate */
288
+ amount: CantonAmuletAmount;
289
+ }
290
+
291
+ /** Contract entry wrapper */
292
+ export declare interface CantonContractEntry {
293
+ JsActiveContract: CantonJsActiveContract;
294
+ }
295
+
296
+ /** Created event for Canton contract */
297
+ export declare interface CantonCreatedEvent {
298
+ /** Offset in ledger */
299
+ offset: number;
300
+ /** Node ID */
301
+ nodeId: number;
302
+ /** Contract ID */
303
+ contractId: string;
304
+ /** Template ID in format packageId:module:entity */
305
+ templateId: string;
306
+ /** Contract key (can be null) */
307
+ contractKey: unknown | null;
308
+ /** Create argument data */
309
+ createArgument: CantonAmuletCreateArgument | Record<string, unknown>;
310
+ /** Created event blob (base64) */
311
+ createdEventBlob: string;
312
+ /** Interface views */
313
+ interfaceViews: unknown[];
314
+ /** Witness parties */
315
+ witnessParties: string[];
316
+ /** Signatories */
317
+ signatories: string[];
318
+ /** Observers */
319
+ observers: string[];
320
+ /** Created timestamp (ISO 8601) */
321
+ createdAt: string;
322
+ /** Package name */
323
+ packageName: string;
324
+ /** Representative package ID */
325
+ representativePackageId: string;
326
+ /** ACS delta flag */
327
+ acsDelta: boolean;
328
+ }
329
+
330
+ /** Active contract in Canton */
331
+ export declare interface CantonJsActiveContract {
332
+ /** Created event with all contract details */
333
+ createdEvent: CantonCreatedEvent;
334
+ /** Synchronizer ID */
335
+ synchronizerId: string;
336
+ /** Reassignment counter */
337
+ reassignmentCounter: number;
338
+ }
339
+
340
+ export declare interface CantonMeResponseDto {
341
+ /** Canton party ID */
342
+ partyId: string;
343
+ /** User email (can be null if not set) */
344
+ email: string | null;
345
+ }
346
+
347
+ export declare interface CantonPrepareRegisterRequestDto {
348
+ /** Base64 stellar public key from privy */
349
+ publicKey: string;
350
+ }
351
+
352
+ export declare interface CantonPrepareTapRequestDto {
353
+ /** Positive integer amount of how many canton coins to receive */
354
+ amount: string;
355
+ }
356
+
357
+ export declare interface CantonPrepareTransactionRequestDto {
358
+ /** Command or array of commands */
359
+ commandId: unknown;
360
+ /** Optional disclosed contracts */
361
+ disclosedContracts?: unknown;
362
+ }
363
+
364
+ export declare interface CantonPrepareTransactionResponseDto {
365
+ /** Base64 hash to be signed by the user */
366
+ hash: string;
367
+ }
368
+
369
+ export declare interface CantonQueryCompletionResponseDto {
370
+ /** Status of the completion query */
371
+ status: CantonQueryCompletionStatus;
372
+ /** Completion data (nullable, present when status is 'completed') */
373
+ data: Record<string, unknown> | null;
374
+ /** Message explaining the status */
375
+ message: string;
376
+ }
377
+
378
+ export declare type CantonQueryCompletionStatus = 'completed' | 'unknown';
379
+
380
+ export declare interface CantonRegisterParams {
381
+ /** Base64 public key from Stellar wallet */
382
+ publicKey: string;
383
+ /** Function to sign hash (returns signature in hex) */
384
+ signFunction: (hashHex: string) => Promise<string>;
385
+ }
386
+
387
+ export declare class CantonService {
388
+ private client;
389
+ constructor(client: ApiClient);
390
+ /**
391
+ * Register Canton wallet
392
+ * Flow:
393
+ * 1. Call /canton/register/prepare with publicKey -> get hash
394
+ * 2. Sign hash with Stellar wallet
395
+ * 3. Call /canton/register/submit with hash + signature
396
+ *
397
+ * @param params Registration parameters
398
+ */
399
+ registerCanton(params: CantonRegisterParams, errCounter?: number): Promise<void>;
400
+ /**
401
+ * Tap devnet faucet to receive test Canton coins
402
+ * Flow:
403
+ * 1. Call /canton/devnet/tap with amount -> get hash
404
+ * 2. Sign hash with Stellar wallet
405
+ * 3. Call /canton/api/submit_prepared with hash + signature
406
+ * 4. Poll for completion
407
+ *
408
+ * @param params Tap parameters
409
+ * @param options Polling options
410
+ */
411
+ tapDevnet(params: CantonTapParams, options?: CantonSubmitPreparedOptions): Promise<CantonQueryCompletionResponseDto>;
412
+ /**
413
+ * Submit signed Canton transaction
414
+ * @param hash Base64 hash
415
+ * @param signature Base64 signature
416
+ */
417
+ submitPrepared(hash: string, signature: string): Promise<CantonSubmitTransactionResponseDto>;
418
+ /**
419
+ * Query completion status for a submission
420
+ * @param submissionId Submission ID from submitPrepared
421
+ */
422
+ queryCompletion(submissionId: string): Promise<CantonQueryCompletionResponseDto>;
423
+ /**
424
+ * Submit signed Canton transaction and wait for completion
425
+ * Polls the ledger API until the transaction is completed or timeout is reached
426
+ * @param hash Base64 hash
427
+ * @param signature Base64 signature
428
+ * @param options Polling options (timeout, pollInterval)
429
+ * @returns Completion data when transaction is completed
430
+ * @throws Error if timeout is reached before completion
431
+ */
432
+ submitPreparedAndWait(hash: string, signature: string, options?: CantonSubmitPreparedOptions): Promise<CantonQueryCompletionResponseDto>;
433
+ /**
434
+ * Get current Canton user info (partyId and email)
435
+ * Only works after registration
436
+ */
437
+ getMe(): Promise<CantonMeResponseDto>;
438
+ /**
439
+ * Get active contracts with optional template filtering
440
+ * Returns array of active contract items with full contract details
441
+ * @param templateIds Optional array of template IDs to filter by
442
+ */
443
+ getActiveContracts(templateIds?: string[]): Promise<CantonActiveContractsResponseDto>;
444
+ /**
445
+ * Sign text message (client-side only, no backend call)
446
+ * Converts text to bytes and signs with Stellar wallet
447
+ * @param message Text message to sign
448
+ * @param signFunction Function to sign hash (returns signature in hex)
449
+ */
450
+ signMessage(message: string, signFunction: (hashHex: string) => Promise<string>): Promise<string>;
451
+ /**
452
+ * Prepare Canton transaction
453
+ * @param commandId Command or array of commands
454
+ * @param disclosedContracts Optional disclosed contracts
455
+ */
456
+ prepareTransaction(commandId: unknown, disclosedContracts?: unknown): Promise<CantonPrepareTransactionResponseDto>;
457
+ /**
458
+ * Check if user has Canton wallet registered
459
+ * This is inferred - if registration succeeds, user has wallet
460
+ * If it fails with 409 or similar, wallet already exists
461
+ */
462
+ checkRegistrationStatus(): Promise<boolean>;
463
+ }
464
+
465
+ export declare interface CantonSubmitPreparedOptions {
466
+ /** Timeout in milliseconds to wait for completion (default: 30000) */
467
+ timeout?: number;
468
+ /** Polling interval in milliseconds (default: 1000) */
469
+ pollInterval?: number;
470
+ }
471
+
472
+ export declare interface CantonSubmitRegisterRequestDto {
473
+ /** Base64 hash provided for signing */
474
+ hash: string;
475
+ /** Base64 signature for provided hash */
476
+ signature: string;
477
+ }
478
+
479
+ export declare interface CantonSubmitTransactionResponseDto {
480
+ /** Submission ID for tracking completion */
481
+ submissionId: string;
482
+ }
483
+
484
+ export declare interface CantonTapParams {
485
+ /** Amount of Canton coins to receive */
486
+ amount: string;
487
+ /** Function to sign hash (returns signature in hex) */
488
+ signFunction: (hashHex: string) => Promise<string>;
489
+ }
490
+
491
+ export declare interface ClientConfig {
492
+ baseURL?: string;
493
+ nodeIdentifier: string;
494
+ getAccessToken?: () => Promise<string | null>;
495
+ }
496
+
497
+ export declare function ConfirmationModal({ open, onClose, onConfirm, onReject, title, message, confirmText, rejectText, description, infoText, icon, loading, }: ConfirmationModalProps): JSX.Element;
498
+
499
+ export declare interface ConfirmationModalProps {
500
+ open: boolean;
501
+ onClose: () => void;
502
+ onConfirm: () => void;
503
+ onReject: () => void;
504
+ title?: ReactNode;
505
+ message: string;
506
+ confirmText?: string;
507
+ rejectText?: string;
508
+ description?: string;
509
+ infoText?: string;
510
+ icon?: ReactNode;
511
+ loading?: boolean;
512
+ }
513
+
514
+ export declare interface ConfirmModalOptions {
515
+ title?: string;
516
+ message: string;
517
+ confirmText?: string;
518
+ rejectText?: string;
519
+ description?: string;
520
+ icon?: ReactNode;
521
+ }
522
+
523
+ export declare function createApiClient(config?: ClientConfig): ApiClient;
524
+
525
+ export declare interface DailyLoginResponseDto {
526
+ /** Current SupaPoints balance */
527
+ balance: number;
528
+ /** SupaPoints balance change */
529
+ add: number;
530
+ }
531
+
532
+ export declare interface DialogListResponseDto {
533
+ id: number;
534
+ createdAt: string;
535
+ updatedAt: string;
536
+ isProcessingNow: boolean;
537
+ firstMessage: string;
538
+ }
539
+
540
+ export declare interface DialogWithMessagesResponseDto {
541
+ id: number;
542
+ createdAt: string;
543
+ updatedAt: string;
544
+ isProcessingNow: boolean;
545
+ messages: MessageResponseDto[];
546
+ }
547
+
548
+ export declare function getApiClient(): ApiClient;
549
+
550
+ /**
551
+ * Gets the first Stellar wallet from user and wallets array
552
+ * Convenience function that throws if no Stellar wallet is found
553
+ *
554
+ * @param user - Privy user object
555
+ * @param wallets - Privy wallets array from useWallets hook
556
+ * @returns First Stellar wallet found
557
+ * @throws {Error} If no Stellar wallet found
558
+ *
559
+ * @example
560
+ * ```ts
561
+ * try {
562
+ * const wallet = getFirstStellarWallet(user, wallets);
563
+ * console.log('Using wallet:', wallet.address);
564
+ * } catch (err) {
565
+ * console.error('No Stellar wallet available');
566
+ * }
567
+ * ```
568
+ */
569
+ export declare const getFirstStellarWallet: (user: any, wallets: any[]) => StellarWallet;
570
+
571
+ export declare interface GetPricesByAddressesBodyDto {
572
+ /** Array of pairs of alchemy network and contract address */
573
+ addresses: Array<{
574
+ network: AlchemyNetwork;
575
+ contractAddress: string;
576
+ }>;
577
+ }
578
+
579
+ /**
580
+ * Converts Stellar wallet public key to Canton Network base64 format
581
+ * Handles removal of leading 00 byte and conversion from hex to base64
582
+ *
583
+ * @param wallet - Stellar wallet object containing publicKey
584
+ * @returns Public key in base64 format ready for Canton Network API
585
+ * @throws {Error} If wallet is invalid or publicKey is missing/malformed
586
+ *
587
+ * @example
588
+ * ```ts
589
+ * const publicKeyBase64 = getPublicKeyBase64(stellarWallet);
590
+ * // Use with Canton Network API
591
+ * await fetch('/canton/register/prepare', {
592
+ * body: JSON.stringify({ publicKey: publicKeyBase64 })
593
+ * });
594
+ * ```
595
+ */
596
+ export declare const getPublicKeyBase64: (wallet: StellarWallet | any) => string;
597
+
598
+ /**
599
+ * Extracts all Stellar wallets from Privy user and wallets array
600
+ * Combines wallets from both user.linkedAccounts and useWallets hook,
601
+ * removing duplicates by address.
602
+ *
603
+ * @param user - Privy user object
604
+ * @param wallets - Privy wallets array from useWallets hook
605
+ * @returns Array of unique Stellar wallets
606
+ *
607
+ * @example
608
+ * ```ts
609
+ * const { user } = usePrivy();
610
+ * const { wallets } = useWallets();
611
+ * const stellarWallets = getStellarWallets(user, wallets);
612
+ * console.log(`Found ${stellarWallets.length} Stellar wallets`);
613
+ * ```
614
+ */
615
+ export declare const getStellarWallets: (user: any, wallets: any[]) => StellarWallet[];
616
+
617
+ export declare interface GetTokens24hrPriceChangeParams {
618
+ /** Array of pairs of alchemy network and contract address */
619
+ tokens: Array<{
620
+ network: AlchemyNetwork;
621
+ contractAddress: string;
622
+ }>;
623
+ }
624
+
625
+ /**
626
+ * Converts hex string to base64 format
627
+ * @param hex - Hex string (with or without 0x prefix)
628
+ * @returns Base64 encoded string
629
+ * @example
630
+ * ```ts
631
+ * const base64 = hexToBase64('0x48656c6c6f');
632
+ * console.log(base64); // "SGVsbG8="
633
+ * ```
634
+ */
635
+ export declare const hexToBase64: (hex: string) => string;
636
+
637
+ /**
638
+ * Type guard to check if a wallet is a Stellar wallet
639
+ * @param wallet - Wallet object to check
640
+ * @returns True if wallet is a valid Stellar wallet
641
+ *
642
+ * @example
643
+ * ```ts
644
+ * if (isStellarWallet(wallet)) {
645
+ * console.log('Stellar wallet address:', wallet.address);
646
+ * }
647
+ * ```
648
+ */
649
+ export declare const isStellarWallet: (wallet: any) => wallet is StellarWallet;
650
+
651
+ export declare interface MessageResponseDto {
652
+ id: number;
653
+ dialogId: number;
654
+ text: string;
655
+ isReply: boolean;
656
+ date: string;
657
+ command?: any | null;
658
+ payload?: any | null;
659
+ actionSuggestions?: any | null;
660
+ }
661
+
662
+ export declare interface ModalResult<T = void> {
663
+ confirmed: boolean;
664
+ data?: T;
665
+ }
666
+
667
+ export declare interface NetworkAddressAndPriceDto {
668
+ /** Alchemy network */
669
+ network: string;
670
+ /** Contract address */
671
+ contractAddress: string;
672
+ /** USD price */
673
+ price: number;
674
+ }
675
+
676
+ export declare interface NewDialogRequestDto {
677
+ text: string;
678
+ }
679
+
680
+ export declare interface NewMessageRequestDto {
681
+ /** Message text content */
682
+ text: string;
683
+ }
684
+
685
+ export declare interface OffsetPaginatedDto<T = any> {
686
+ data: T[];
687
+ pagination: OffsetPaginationDto;
688
+ }
689
+
690
+ export declare interface OffsetPaginationDto {
691
+ limit: number;
692
+ currentPage: number;
693
+ }
694
+
695
+ /**
696
+ * TypeScript types generated from Supa Backend API Swagger
697
+ * Based on OpenAPI 3.0.0 specification
698
+ */
699
+ export declare type Order = 'ASC' | 'DESC';
700
+
701
+ export declare interface PaginationParams {
702
+ limit?: number;
703
+ page?: number;
704
+ order?: Order;
705
+ }
706
+
707
+ export declare interface PaymasterRequestDataDto {
708
+ /** User operation hex-string */
709
+ userOperation: string;
710
+ /** Entrypoint address */
711
+ entryPoint: string;
712
+ /** Network ID */
713
+ chainId: number;
714
+ /** Sponsorship policy ID */
715
+ sponsorshipPolicyId: string;
716
+ }
717
+
718
+ export declare interface PaymasterRequestDto {
719
+ /** Request type */
720
+ type: 'sponsorshipPolicy.webhook';
721
+ /** Request data */
722
+ data: PaymasterRequestDataDto;
723
+ }
724
+
725
+ export declare interface PaymasterResponseDto {
726
+ sponsor: boolean;
727
+ }
728
+
729
+ /**
730
+ * Converts Privy public key (hex with leading 00) to Canton format (base64 without leading 00)
731
+ * This function handles the conversion from Privy's Stellar wallet public key format
732
+ * to Canton Network's expected base64 format.
733
+ *
734
+ * @param publicKeyHex - Public key in hex format from Privy (may include 0x prefix and leading 00)
735
+ * @returns Public key in base64 format for Canton Network
736
+ * @throws {Error} If conversion fails
737
+ *
738
+ * @example
739
+ * ```ts
740
+ * const wallet = { publicKey: '00e95cb2553361ed...' };
741
+ * const cantonKey = privyPublicKeyToCantonBase64(wallet.publicKey);
742
+ * // Use cantonKey for Canton Network API calls
743
+ * ```
744
+ */
745
+ export declare const privyPublicKeyToCantonBase64: (publicKeyHex: string) => string;
746
+
747
+ export declare interface SendTransactionOptions {
748
+ onSuccess?: (result: CantonQueryCompletionResponseDto) => void;
749
+ onRejection?: () => void;
750
+ onError?: (error: Error) => void;
751
+ skipModal?: boolean;
752
+ modalTitle?: string;
753
+ modalDescription?: string;
754
+ modalConfirmText?: string;
755
+ modalRejectText?: string;
756
+ /** Custom content to display in modal instead of transaction hash */
757
+ modalDisplayContent?: string;
758
+ /** Show technical transaction details (command, contracts, hash) as JSON. Default: false */
759
+ showTechnicalDetails?: boolean;
760
+ submitOptions?: CantonSubmitPreparedOptions;
761
+ }
762
+
763
+ export declare function SignMessageModal({ open, onClose, onConfirm, onReject, message, loading, title, description, confirmText, rejectText, }: SignMessageModalProps): JSX.Element;
764
+
765
+ export declare interface SignMessageModalOptions {
766
+ message: string;
767
+ title?: string;
768
+ description?: string;
769
+ confirmText?: string;
770
+ rejectText?: string;
771
+ }
772
+
773
+ export declare interface SignMessageModalProps {
774
+ open: boolean;
775
+ onClose: () => void;
776
+ onConfirm: () => void;
777
+ onReject: () => void;
778
+ message: string;
779
+ loading?: boolean;
780
+ title?: string;
781
+ description?: string;
782
+ confirmText?: string;
783
+ rejectText?: string;
784
+ }
785
+
786
+ export declare interface SignMessageOptions {
787
+ onSuccess?: (signature: string) => void;
788
+ onRejection?: () => void;
789
+ onError?: (error: Error) => void;
790
+ skipModal?: boolean;
791
+ title?: string;
792
+ description?: string;
793
+ confirmText?: string;
794
+ rejectText?: string;
795
+ /** Custom content to display in modal instead of message */
796
+ displayContent?: string;
797
+ /** Show technical details (address, chainType, hash) as JSON. Default: false */
798
+ showTechnicalDetails?: boolean;
799
+ }
800
+
801
+ export declare interface SignRawHashModalOptions {
802
+ skipModal?: boolean;
803
+ title?: string;
804
+ description?: string;
805
+ confirmText?: string;
806
+ rejectText?: string;
807
+ infoText?: string;
808
+ /** Custom content to display instead of auto-generated JSON */
809
+ displayHash?: string;
810
+ /** Show technical details (address, chainType, hash) as JSON. Default: false */
811
+ showTechnicalDetails?: boolean;
812
+ }
813
+
814
+ declare type SignRawHashParams = Parameters<ReturnType<typeof useSignRawHash>['signRawHash']>[0];
815
+
816
+ export declare function SignTransactionModal({ open, onClose, onConfirm, onReject, transaction, loading, title, description, confirmText, rejectText, infoText, }: SignTransactionModalProps): JSX.Element;
817
+
818
+ export declare interface SignTransactionModalOptions {
819
+ transaction: string;
820
+ title?: string;
821
+ description?: string;
822
+ confirmText?: string;
823
+ rejectText?: string;
824
+ infoText?: string;
825
+ }
826
+
827
+ export declare interface SignTransactionModalProps {
828
+ open: boolean;
829
+ onClose: () => void;
830
+ onConfirm: () => void;
831
+ onReject: () => void;
832
+ transaction: string;
833
+ loading?: boolean;
834
+ title?: string;
835
+ description?: string;
836
+ confirmText?: string;
837
+ rejectText?: string;
838
+ infoText?: string;
839
+ }
840
+
841
+ /**
842
+ * Stellar wallet utilities for Privy integration
843
+ * Stellar chain type is used for Ed25519 signing required by Canton Network
844
+ */
845
+ /**
846
+ * Stellar wallet interface representing a Privy Stellar wallet
847
+ */
848
+ export declare interface StellarWallet {
849
+ /** Stellar address (public key in Stellar format) */
850
+ address: string;
851
+ /** Raw public key in hex format */
852
+ publicKey: string;
853
+ /** Chain type, always 'stellar' for Stellar wallets */
854
+ chainType: 'stellar';
855
+ /** Wallet client type (e.g., 'privy') */
856
+ walletClientType?: string;
857
+ /** Whether the wallet was imported or created */
858
+ imported?: boolean;
859
+ }
860
+
861
+ /**
862
+ * Removes leading 00 byte from hex string if present
863
+ * Required for Stellar public keys from Privy which include a leading 00 byte
864
+ * @param hex - Hex string (with or without 0x prefix)
865
+ * @returns Clean hex string with 0x prefix
866
+ * @example
867
+ * ```ts
868
+ * const clean = stripLeadingZero('0x00e95cb2553361ed...');
869
+ * console.log(clean); // "0xe95cb2553361ed..."
870
+ * ```
871
+ */
872
+ export declare const stripLeadingZero: (hex: string) => string;
873
+
874
+ export declare interface SupaConfig {
875
+ privyAppId: string;
876
+ privyClientId?: string;
877
+ apiBaseUrl?: string;
878
+ nodeIdentifier: string;
879
+ appearance?: {
880
+ theme?: 'light' | 'dark';
881
+ accentColor?: string;
882
+ logo?: string;
883
+ };
884
+ loginMethods?: Array<'email' | 'wallet' | 'google' | 'twitter' | 'discord' | 'github' | 'linkedin'>;
885
+ }
886
+
887
+ export declare interface SupaContextValue {
888
+ apiClient: ApiClient;
889
+ cantonService: CantonService;
890
+ apiService: ApiService;
891
+ config: SupaConfig;
892
+ theme: 'light' | 'dark';
893
+ confirm: (options: ConfirmModalOptions) => Promise<ModalResult>;
894
+ signMessageConfirm: (options: SignMessageModalOptions) => Promise<ModalResult>;
895
+ signTransactionConfirm: (options: SignTransactionModalOptions) => Promise<ModalResult>;
896
+ setModalLoading: (loading: boolean) => void;
897
+ closeModal: () => void;
898
+ }
899
+
900
+ export declare interface SupaPointsBalanceResponseDto {
901
+ /** Current SupaPoints balance */
902
+ balance: number;
903
+ }
904
+
905
+ export declare interface SupaPointsHistoryParams extends PaginationParams {
906
+ startDate?: string;
907
+ endDate?: string;
908
+ action?: string;
909
+ }
910
+
911
+ export declare function SupaProvider({ config, children }: SupaProviderProps): JSX.Element | null;
912
+
913
+ export declare interface SupaProviderProps {
914
+ config: SupaConfig;
915
+ children: ReactNode;
916
+ }
917
+
918
+ export declare type TimeInterval = 'ONE_HOUR' | 'ONE_DAY' | 'ONE_MONTH' | 'ONE_YEAR' | 'ALL_TIME';
919
+
920
+ export declare interface TokenInfo {
921
+ network: string;
922
+ logo: string;
923
+ name: string;
924
+ website: string;
925
+ description: string;
926
+ explorer: string;
927
+ type: string;
928
+ symbol: string;
929
+ decimals: number;
930
+ status: string;
931
+ tags: string[];
932
+ id: string;
933
+ links: any[];
934
+ }
935
+
936
+ export declare interface TokenInfoWithPriceChangeDto {
937
+ /** Token name */
938
+ name: string;
939
+ /** Token symbol */
940
+ symbol: string;
941
+ /** Token logo */
942
+ logo: string;
943
+ /** Token description */
944
+ description?: string | null;
945
+ /** Decimals */
946
+ decimals: number;
947
+ /** Contract address */
948
+ contractAddress: string;
949
+ /** Network */
950
+ network: string;
951
+ /** Native token flag */
952
+ native: boolean;
953
+ /** Price change */
954
+ priceChange: TokenPriceChange;
955
+ }
956
+
957
+ export declare interface TokenPriceChange {
958
+ currentPrice: number;
959
+ oldPrice: number;
960
+ priceChangeAbsolute: number;
961
+ priceChangePercentage: number;
962
+ }
963
+
964
+ export declare interface TokenPriceHistoryDataPoint {
965
+ value: string;
966
+ timestamp: string;
967
+ }
968
+
969
+ export declare interface TokenPriceHistoryParams {
970
+ contractAddress: string;
971
+ network: AlchemyNetwork;
972
+ interval?: TimeInterval;
973
+ limit?: number;
974
+ page?: number;
975
+ order?: Order;
976
+ }
977
+
978
+ export declare interface TokenPriceHistoryResponse {
979
+ symbol: string;
980
+ currency: string;
981
+ data: TokenPriceHistoryDataPoint[];
982
+ }
983
+
984
+ export declare interface TransactionQueryParams {
985
+ withScam?: boolean;
986
+ }
987
+
988
+ /**
989
+ * Return type for useAPI hook
990
+ * Provides organized access to all backend API methods
991
+ */
992
+ declare interface UseAPIReturn {
993
+ /** User management and profile methods */
994
+ user: {
995
+ /** Fetches current authenticated user profile */
996
+ getCurrent: () => Promise<UserResponseDto>;
997
+ /** Fetches all users (admin only) */
998
+ getAll: () => Promise<UserResponseDto[]>;
999
+ /** Fetches user by Privy ID */
1000
+ getByPrivyId: (privyUserId: string) => Promise<UserResponseDto>;
1001
+ /** Fetches user's smart wallet token balances */
1002
+ getBalance: (force?: boolean) => Promise<UserBalanceResponseDto>;
1003
+ };
1004
+ /** AI dialog management methods */
1005
+ dialogs: {
1006
+ /** Creates a new AI dialog with initial message */
1007
+ create: (text: string) => Promise<DialogWithMessagesResponseDto>;
1008
+ /** Fetches all user dialogs with pagination */
1009
+ findAll: (params?: PaginationParams) => Promise<OffsetPaginatedDto<DialogListResponseDto>>;
1010
+ /** Fetches a specific dialog by ID */
1011
+ findOne: (id: number) => Promise<DialogListResponseDto>;
1012
+ /** Deletes a dialog and all its messages */
1013
+ delete: (id: number) => Promise<void>;
1014
+ };
1015
+ /** AI message methods within dialogs */
1016
+ messages: {
1017
+ /** Creates a new message in a dialog */
1018
+ create: (dialogId: number, text: string) => Promise<MessageResponseDto>;
1019
+ /** Fetches all messages in a dialog with pagination */
1020
+ findAll: (dialogId: number, params?: PaginationParams) => Promise<OffsetPaginatedDto<MessageResponseDto>>;
1021
+ /** Fetches a specific message by ID */
1022
+ findOne: (id: number) => Promise<MessageResponseDto>;
1023
+ };
1024
+ /** On-chain data and token price methods */
1025
+ onchain: {
1026
+ /** Fetches token prices by contract addresses */
1027
+ getPricesByAddresses: (addresses: Array<{
1028
+ network: AlchemyNetwork;
1029
+ contractAddress: string;
1030
+ }>) => Promise<NetworkAddressAndPriceDto[]>;
1031
+ /** Fetches token prices by symbols (BTC, ETH, etc.) */
1032
+ getTokenPrices: (symbols: string[]) => Promise<Record<string, number>>;
1033
+ /** Fetches historical price data for a token */
1034
+ getPriceHistory: (params: TokenPriceHistoryParams) => Promise<TokenPriceHistoryResponse>;
1035
+ /** Fetches 24-hour price changes for tokens */
1036
+ get24hrPriceChanges: (tokens: Array<{
1037
+ network: AlchemyNetwork;
1038
+ contractAddress: string;
1039
+ }>) => Promise<TokenInfoWithPriceChangeDto[]>;
1040
+ /** Fetches detailed token information */
1041
+ getTokenInfo: (network: string, addresses: string | string[]) => Promise<Record<string, TokenInfo>>;
1042
+ /** Fetches token balances for an account */
1043
+ getAccountBalances: (network: string, account: string, force?: boolean) => Promise<AccountTokensBalancesResponse>;
1044
+ };
1045
+ /** Transaction history methods */
1046
+ transactions: {
1047
+ /** Fetches user transaction history */
1048
+ get: (params?: TransactionQueryParams) => Promise<any>;
1049
+ /** Forces reload of transaction history from blockchain */
1050
+ forceLoad: (params?: TransactionQueryParams) => Promise<any>;
1051
+ };
1052
+ /** SupaPoints reward system methods */
1053
+ supaPoints: {
1054
+ /** Fetches current SupaPoints balance */
1055
+ getBalance: () => Promise<SupaPointsBalanceResponseDto>;
1056
+ /** Fetches SupaPoints transaction history */
1057
+ getHistory: (params?: SupaPointsHistoryParams) => Promise<OffsetPaginatedDto<any>>;
1058
+ /** Processes daily login bonus */
1059
+ dailyLogin: () => Promise<DailyLoginResponseDto>;
1060
+ };
1061
+ /** Paymaster sponsorship methods */
1062
+ paymaster: {
1063
+ /** Checks if transaction qualifies for gas sponsorship */
1064
+ checkSponsorship: (request: PaymasterRequestDto) => Promise<PaymasterResponseDto>;
1065
+ };
1066
+ /** Privy wallet methods */
1067
+ privy: {
1068
+ /** Fetches Privy embedded wallet balance */
1069
+ getBalance: () => Promise<any>;
1070
+ };
1071
+ }
1072
+
1073
+ /**
1074
+ * Hook for managing user authentication via Privy
1075
+ * Automatically configures API client with access token when user authenticates
1076
+ *
1077
+ * @returns Authentication methods and user state
1078
+ *
1079
+ * @example
1080
+ * ```tsx
1081
+ * function LoginButton() {
1082
+ * const { login, logout, authenticated, user } = useAuth();
1083
+ *
1084
+ * if (!authenticated) {
1085
+ * return <button onClick={login}>Login</button>;
1086
+ * }
1087
+ *
1088
+ * return (
1089
+ * <div>
1090
+ * <p>Welcome, {user?.email?.address}!</p>
1091
+ * <button onClick={logout}>Logout</button>
1092
+ * </div>
1093
+ * );
1094
+ * }
1095
+ * ```
1096
+ */
1097
+ export declare const useAuth: () => UseAuthReturn;
1098
+
1099
+ /**
1100
+ * Return type for useAuth hook
1101
+ */
1102
+ export declare interface UseAuthReturn {
1103
+ /** Opens Privy login modal */
1104
+ login: () => void;
1105
+ /** Logs out the current user */
1106
+ logout: () => Promise<void>;
1107
+ /** Whether user is authenticated */
1108
+ authenticated: boolean;
1109
+ /** Whether authentication is in progress */
1110
+ loading: boolean;
1111
+ /** Privy user object containing linked accounts and profile data */
1112
+ user: User | null;
1113
+ /** Gets Privy JWT access token for authenticated API calls */
1114
+ getAccessToken: () => Promise<string | null>;
1115
+ /** Whether SDK is ready (not loading) */
1116
+ ready: boolean;
1117
+ }
1118
+
1119
+ /**
1120
+ * Hook for Canton Network operations
1121
+ */
1122
+ export declare function useCanton(): UseCantonReturn;
1123
+
1124
+ export declare interface UseCantonReturn {
1125
+ /** First Stellar wallet (primary) */
1126
+ stellarWallet: StellarWallet | null;
1127
+ /** All Stellar wallets */
1128
+ stellarWallets: StellarWallet[];
1129
+ /** Create new Stellar wallet */
1130
+ createStellarWallet: () => Promise<StellarWallet | null>;
1131
+ /** Register Canton wallet on backend */
1132
+ registerCanton: () => Promise<void>;
1133
+ /** Whether Canton wallet is registered */
1134
+ isRegistered: boolean;
1135
+ /** Canton user info (partyId and email) */
1136
+ cantonUser: CantonMeResponseDto | null;
1137
+ /** Get Canton user info */
1138
+ getMe: () => Promise<CantonMeResponseDto>;
1139
+ /** Get active contracts with optional filtering */
1140
+ getActiveContracts: (templateIds?: string[]) => Promise<CantonActiveContractsResponseDto>;
1141
+ /** Tap devnet faucet */
1142
+ tapDevnet: (amount: string, options?: CantonSubmitPreparedOptions) => Promise<CantonQueryCompletionResponseDto>;
1143
+ /** Sign hash with Stellar wallet */
1144
+ signHash: (hashBase64: string) => Promise<string>;
1145
+ /** Sign text message */
1146
+ signMessage: (message: string) => Promise<string>;
1147
+ /** Prepare and submit transaction with polling for completion */
1148
+ sendTransaction: (commandId: unknown, disclosedContracts?: unknown, options?: CantonSubmitPreparedOptions) => Promise<CantonQueryCompletionResponseDto>;
1149
+ /** Loading state */
1150
+ loading: boolean;
1151
+ /** Error state */
1152
+ error: Error | null;
1153
+ /** Clear error */
1154
+ clearError: () => void;
1155
+ }
1156
+
1157
+ export declare function useConfirmModal(): UseConfirmModalReturn;
1158
+
1159
+ export declare interface UseConfirmModalReturn {
1160
+ /** Show a generic confirmation modal */
1161
+ confirm: (options: ConfirmModalOptions) => Promise<ModalResult>;
1162
+ /** Show a message signing confirmation modal */
1163
+ signMessageConfirm: (options: SignMessageModalOptions) => Promise<ModalResult>;
1164
+ /** Show a transaction signing confirmation modal */
1165
+ signTransactionConfirm: (options: SignTransactionModalOptions) => Promise<ModalResult>;
1166
+ /** Set loading state for current modal */
1167
+ setModalLoading: (loading: boolean) => void;
1168
+ /** Close current modal */
1169
+ closeModal: () => void;
1170
+ }
1171
+
1172
+ export declare interface UserBalanceEntryDto {
1173
+ /** Token contract address */
1174
+ contractAddress: string;
1175
+ /** Token balance as a big integer string */
1176
+ tokenBalance: string;
1177
+ /** Token balance as a human-readable decimal string */
1178
+ tokenBalanceDecimal: string;
1179
+ /** Token decimals */
1180
+ decimals: number;
1181
+ /** Token logo URL */
1182
+ logoUrl: string;
1183
+ /** Token name */
1184
+ name: string;
1185
+ /** Token symbol */
1186
+ symbol: string;
1187
+ /** Network name */
1188
+ network: string;
1189
+ }
1190
+
1191
+ export declare interface UserBalanceResponseDto {
1192
+ /** Wallet address */
1193
+ address: string;
1194
+ /** List of token balances */
1195
+ balances: UserBalanceEntryDto[];
1196
+ /** Total USD balance. Decimal string */
1197
+ totalUsdBalance: string;
1198
+ }
1199
+
1200
+ export declare interface UserResponseDto {
1201
+ [key: string]: any;
1202
+ }
1203
+
1204
+ export declare function useSendTransaction(): UseSendTransactionReturn;
1205
+
1206
+ export declare interface UseSendTransactionReturn {
1207
+ /** Sign and send a Canton transaction with confirmation modal */
1208
+ sendTransaction: (commandId: unknown, disclosedContracts?: unknown, options?: SendTransactionOptions) => Promise<CantonQueryCompletionResponseDto | null>;
1209
+ loading: boolean;
1210
+ error: Error | null;
1211
+ clearError: () => void;
1212
+ stellarWallets: StellarWallet[];
1213
+ stellarWallet: StellarWallet | null;
1214
+ }
1215
+
1216
+ export declare function useSignMessage(): UseSignMessageReturn;
1217
+
1218
+ export declare interface UseSignMessageReturn {
1219
+ /** Sign a text message with confirmation modal */
1220
+ signMessage: (message: string, options?: SignMessageOptions) => Promise<string | null>;
1221
+ loading: boolean;
1222
+ error: Error | null;
1223
+ clearError: () => void;
1224
+ stellarWallets: StellarWallet[];
1225
+ stellarWallet: StellarWallet | null;
1226
+ }
1227
+
1228
+ export declare function useSignRawHashWithModal(): UseSignRawHashWithModalReturn;
1229
+
1230
+ export declare interface UseSignRawHashWithModalReturn {
1231
+ /** Sign a raw hash with confirmation modal */
1232
+ signRawHashWithModal: (params: SignRawHashParams, modalOptions?: SignRawHashModalOptions) => Promise<{
1233
+ signature: string;
1234
+ } | null>;
1235
+ }
1236
+
1237
+ export declare function useStellarWallet(): UseStellarWalletReturn;
1238
+
1239
+ export declare interface UseStellarWalletReturn {
1240
+ stellarWallets: StellarWallet[];
1241
+ stellarWallet: StellarWallet | null;
1242
+ }
1243
+
1244
+ /**
1245
+ * Main hook for accessing all Supa SDK features
1246
+ * Combines authentication, Canton Network, and API functionality
1247
+ *
1248
+ * @returns Combined SDK functionality with convenience methods
1249
+ *
1250
+ * @example
1251
+ * Basic usage
1252
+ * ```tsx
1253
+ * function Dashboard() {
1254
+ * const { auth, canton, api } = useSupa();
1255
+ *
1256
+ * if (!auth.authenticated) {
1257
+ * return <button onClick={auth.login}>Login</button>;
1258
+ * }
1259
+ *
1260
+ * return (
1261
+ * <div>
1262
+ * <p>User: {auth.user?.email?.address}</p>
1263
+ * <button onClick={() => canton.registerCanton()}>
1264
+ * Register Canton
1265
+ * </button>
1266
+ * </div>
1267
+ * );
1268
+ * }
1269
+ * ```
1270
+ *
1271
+ * @example
1272
+ * Using automated onboarding
1273
+ * ```tsx
1274
+ * function OnboardButton() {
1275
+ * const { onboard, canton } = useSupa();
1276
+ *
1277
+ * return (
1278
+ * <button onClick={onboard}>
1279
+ * {canton.isRegistered ? 'Already registered' : 'Get Started'}
1280
+ * </button>
1281
+ * );
1282
+ * }
1283
+ * ```
1284
+ */
1285
+ declare const useSupa: () => UseSupaReturn;
1286
+ export { useSupa }
1287
+ export { useSupa as useWalletino }
1288
+
1289
+ export declare function useSupaContext(): SupaContextValue;
1290
+
1291
+ /**
1292
+ * Return type for useSupa hook
1293
+ */
1294
+ declare interface UseSupaReturn {
1295
+ /** Authentication methods and user state */
1296
+ auth: UseAuthReturn;
1297
+ /** Canton Network operations and wallet management */
1298
+ canton: UseCantonReturn;
1299
+ /** Backend API methods for data access */
1300
+ api: UseAPIReturn;
1301
+ /** Automated onboarding flow (login → create wallet → register Canton) */
1302
+ onboard: () => Promise<void>;
1303
+ }
1304
+ export { UseSupaReturn }
1305
+ export { UseSupaReturn as UseWalletinoReturn }
1306
+
1307
+ export { }