@djangocfg/ext-payments 1.0.2 → 1.0.4

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,1293 @@
1
+ import { ConsolaInstance } from 'consola';
2
+ import React from 'react';
3
+ import { z, ZodError } from 'zod';
4
+ import * as _djangocfg_ext_base from '@djangocfg/ext-base';
5
+
6
+ /**
7
+ * Current payment status
8
+ * * `pending` - Pending
9
+ * * `confirming` - Confirming
10
+ * * `confirmed` - Confirmed
11
+ * * `completed` - Completed
12
+ * * `partially_paid` - Partially Paid
13
+ * * `failed` - Failed
14
+ * * `expired` - Expired
15
+ * * `cancelled` - Cancelled
16
+ */
17
+ declare enum PaymentDetailStatus {
18
+ PENDING = "pending",
19
+ CONFIRMING = "confirming",
20
+ CONFIRMED = "confirmed",
21
+ COMPLETED = "completed",
22
+ PARTIALLY_PAID = "partially_paid",
23
+ FAILED = "failed",
24
+ EXPIRED = "expired",
25
+ CANCELLED = "cancelled"
26
+ }
27
+ /**
28
+ * Current payment status
29
+ * * `pending` - Pending
30
+ * * `confirming` - Confirming
31
+ * * `confirmed` - Confirmed
32
+ * * `completed` - Completed
33
+ * * `partially_paid` - Partially Paid
34
+ * * `failed` - Failed
35
+ * * `expired` - Expired
36
+ * * `cancelled` - Cancelled
37
+ */
38
+ declare enum PaymentListStatus {
39
+ PENDING = "pending",
40
+ CONFIRMING = "confirming",
41
+ CONFIRMED = "confirmed",
42
+ COMPLETED = "completed",
43
+ PARTIALLY_PAID = "partially_paid",
44
+ FAILED = "failed",
45
+ EXPIRED = "expired",
46
+ CANCELLED = "cancelled"
47
+ }
48
+ /**
49
+ * Type of transaction
50
+ * * `deposit` - Deposit
51
+ * * `withdrawal` - Withdrawal
52
+ * * `payment` - Payment
53
+ * * `refund` - Refund
54
+ * * `fee` - Fee
55
+ * * `bonus` - Bonus
56
+ * * `adjustment` - Adjustment
57
+ */
58
+ declare enum TransactionTransactionType {
59
+ DEPOSIT = "deposit",
60
+ WITHDRAWAL = "withdrawal",
61
+ PAYMENT = "payment",
62
+ REFUND = "refund",
63
+ FEE = "fee",
64
+ BONUS = "bonus",
65
+ ADJUSTMENT = "adjustment"
66
+ }
67
+
68
+ type enums_PaymentDetailStatus = PaymentDetailStatus;
69
+ declare const enums_PaymentDetailStatus: typeof PaymentDetailStatus;
70
+ type enums_PaymentListStatus = PaymentListStatus;
71
+ declare const enums_PaymentListStatus: typeof PaymentListStatus;
72
+ type enums_TransactionTransactionType = TransactionTransactionType;
73
+ declare const enums_TransactionTransactionType: typeof TransactionTransactionType;
74
+ declare namespace enums {
75
+ export { enums_PaymentDetailStatus as PaymentDetailStatus, enums_PaymentListStatus as PaymentListStatus, enums_TransactionTransactionType as TransactionTransactionType };
76
+ }
77
+
78
+ /**
79
+ * User balance serializer.
80
+ *
81
+ * Response model (includes read-only fields).
82
+ */
83
+ interface Balance$1 {
84
+ /** Current balance in USD */
85
+ balance_usd: string;
86
+ balance_display: string;
87
+ /** Total amount deposited (lifetime) */
88
+ total_deposited: string;
89
+ /** Total amount withdrawn (lifetime) */
90
+ total_withdrawn: string;
91
+ /** When the last transaction occurred */
92
+ last_transaction_at?: string | null;
93
+ }
94
+ /**
95
+ *
96
+ * Response model (includes read-only fields).
97
+ */
98
+ interface PaginatedPaymentListList$1 {
99
+ /** Total number of items across all pages */
100
+ count: number;
101
+ /** Current page number (1-based) */
102
+ page: number;
103
+ /** Total number of pages */
104
+ pages: number;
105
+ /** Number of items per page */
106
+ page_size: number;
107
+ /** Whether there is a next page */
108
+ has_next: boolean;
109
+ /** Whether there is a previous page */
110
+ has_previous: boolean;
111
+ /** Next page number (null if no next page) */
112
+ next_page?: number | null;
113
+ /** Previous page number (null if no previous page) */
114
+ previous_page?: number | null;
115
+ /** Array of items for current page */
116
+ results: Array<PaymentList$1>;
117
+ }
118
+ /**
119
+ * Detailed payment information.
120
+ *
121
+ * Response model (includes read-only fields).
122
+ */
123
+ interface PaymentDetail$1 {
124
+ /** Unique identifier for this record */
125
+ id: string;
126
+ /** Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID) */
127
+ internal_payment_id: string;
128
+ /** Payment amount in USD */
129
+ amount_usd: string;
130
+ currency_code: string;
131
+ currency_name: string;
132
+ currency_token: string;
133
+ currency_network: string;
134
+ /** Amount to pay in cryptocurrency */
135
+ pay_amount?: string | null;
136
+ /** Actual amount received in cryptocurrency */
137
+ actual_amount?: string | null;
138
+ /** Actual amount received in USD */
139
+ actual_amount_usd?: string | null;
140
+ /** Current payment status
141
+
142
+ * `pending` - Pending
143
+ * `confirming` - Confirming
144
+ * `confirmed` - Confirmed
145
+ * `completed` - Completed
146
+ * `partially_paid` - Partially Paid
147
+ * `failed` - Failed
148
+ * `expired` - Expired
149
+ * `cancelled` - Cancelled */
150
+ status: PaymentDetailStatus;
151
+ status_display: string;
152
+ /** Cryptocurrency payment address */
153
+ pay_address?: string | null;
154
+ /** Get QR code URL. */
155
+ qr_code_url?: string | null;
156
+ /** Payment page URL (if provided by provider) */
157
+ payment_url?: string | null;
158
+ /** Blockchain transaction hash */
159
+ transaction_hash?: string | null;
160
+ /** Get blockchain explorer link. */
161
+ explorer_link?: string | null;
162
+ /** Number of blockchain confirmations */
163
+ confirmations_count: number;
164
+ /** When this payment expires (typically 30 minutes) */
165
+ expires_at?: string | null;
166
+ /** When this payment was completed */
167
+ completed_at?: string | null;
168
+ /** When this record was created */
169
+ created_at: string;
170
+ is_completed: boolean;
171
+ is_failed: boolean;
172
+ is_expired: boolean;
173
+ /** Payment description */
174
+ description: string;
175
+ }
176
+ /**
177
+ * Payment list item (lighter than detail).
178
+ *
179
+ * Response model (includes read-only fields).
180
+ */
181
+ interface PaymentList$1 {
182
+ /** Unique identifier for this record */
183
+ id: string;
184
+ /** Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID) */
185
+ internal_payment_id: string;
186
+ /** Payment amount in USD */
187
+ amount_usd: string;
188
+ currency_code: string;
189
+ currency_token: string;
190
+ /** Current payment status
191
+
192
+ * `pending` - Pending
193
+ * `confirming` - Confirming
194
+ * `confirmed` - Confirmed
195
+ * `completed` - Completed
196
+ * `partially_paid` - Partially Paid
197
+ * `failed` - Failed
198
+ * `expired` - Expired
199
+ * `cancelled` - Cancelled */
200
+ status: PaymentListStatus;
201
+ status_display: string;
202
+ /** When this record was created */
203
+ created_at: string;
204
+ /** When this payment was completed */
205
+ completed_at?: string | null;
206
+ }
207
+
208
+ declare namespace models {
209
+ export type { Balance$1 as Balance, PaginatedPaymentListList$1 as PaginatedPaymentListList, PaymentDetail$1 as PaymentDetail, PaymentList$1 as PaymentList };
210
+ }
211
+
212
+ /**
213
+ * API endpoints for Payments.
214
+ */
215
+ declare class ExtPaymentsPayments {
216
+ private client;
217
+ constructor(client: any);
218
+ /**
219
+ * Get user balance
220
+ *
221
+ * Get current user balance and transaction statistics
222
+ */
223
+ balanceRetrieve(): Promise<Balance$1>;
224
+ /**
225
+ * Get available currencies
226
+ *
227
+ * Returns list of available currencies with token+network info
228
+ */
229
+ currenciesList(): Promise<any>;
230
+ paymentsList(page?: number, page_size?: number): Promise<PaginatedPaymentListList$1>;
231
+ paymentsList(params?: {
232
+ page?: number;
233
+ page_size?: number;
234
+ }): Promise<PaginatedPaymentListList$1>;
235
+ /**
236
+ * ViewSet for payment operations. Endpoints: - GET /payments/ - List
237
+ * user's payments - GET /payments/{id}/ - Get payment details - POST
238
+ * /payments/create/ - Create new payment - GET /payments/{id}/status/ -
239
+ * Check payment status - POST /payments/{id}/confirm/ - Confirm payment
240
+ */
241
+ paymentsRetrieve(id: string): Promise<PaymentDetail$1>;
242
+ /**
243
+ * POST /api/v1/payments/{id}/confirm/ Confirm payment (user clicked "I
244
+ * have paid"). Checks status with provider and creates transaction if
245
+ * completed.
246
+ */
247
+ paymentsConfirmCreate(id: string): Promise<PaymentList$1>;
248
+ /**
249
+ * GET /api/v1/payments/{id}/status/?refresh=true Check payment status
250
+ * (with optional refresh from provider). Query params: - refresh: boolean
251
+ * (default: false) - Force refresh from provider
252
+ */
253
+ paymentsStatusRetrieve(id: string): Promise<PaymentList$1[]>;
254
+ /**
255
+ * POST /api/v1/payments/create/ Create new payment. Request body: {
256
+ * "amount_usd": "100.00", "currency_code": "USDTTRC20", "description":
257
+ * "Optional description" }
258
+ */
259
+ paymentsCreateCreate(): Promise<PaymentList$1>;
260
+ transactionsList(limit?: number, offset?: number, type?: string): Promise<any>;
261
+ transactionsList(params?: {
262
+ limit?: number;
263
+ offset?: number;
264
+ type?: string;
265
+ }): Promise<any>;
266
+ }
267
+
268
+ /**
269
+ * HTTP Client Adapter Pattern
270
+ *
271
+ * Allows switching between fetch/axios/httpx without changing generated code.
272
+ * Provides unified interface for making HTTP requests.
273
+ */
274
+ interface HttpRequest {
275
+ method: string;
276
+ url: string;
277
+ headers?: Record<string, string>;
278
+ body?: any;
279
+ params?: Record<string, any>;
280
+ /** FormData for file uploads (multipart/form-data) */
281
+ formData?: FormData;
282
+ }
283
+ interface HttpResponse<T = any> {
284
+ data: T;
285
+ status: number;
286
+ statusText: string;
287
+ headers: Record<string, string>;
288
+ }
289
+ /**
290
+ * HTTP Client Adapter Interface.
291
+ * Implement this to use custom HTTP clients (axios, httpx, etc.)
292
+ */
293
+ interface HttpClientAdapter {
294
+ request<T = any>(request: HttpRequest): Promise<HttpResponse<T>>;
295
+ }
296
+ /**
297
+ * Default Fetch API adapter.
298
+ * Uses native browser fetch() with proper error handling.
299
+ */
300
+ declare class FetchAdapter implements HttpClientAdapter {
301
+ request<T = any>(request: HttpRequest): Promise<HttpResponse<T>>;
302
+ }
303
+
304
+ /**
305
+ * API Logger with Consola
306
+ * Beautiful console logging for API requests and responses
307
+ *
308
+ * Installation:
309
+ * npm install consola
310
+ */
311
+
312
+ /**
313
+ * Request log data
314
+ */
315
+ interface RequestLog {
316
+ method: string;
317
+ url: string;
318
+ headers?: Record<string, string>;
319
+ body?: any;
320
+ timestamp: number;
321
+ }
322
+ /**
323
+ * Response log data
324
+ */
325
+ interface ResponseLog {
326
+ status: number;
327
+ statusText: string;
328
+ data?: any;
329
+ duration: number;
330
+ timestamp: number;
331
+ }
332
+ /**
333
+ * Error log data
334
+ */
335
+ interface ErrorLog {
336
+ message: string;
337
+ statusCode?: number;
338
+ fieldErrors?: Record<string, string[]>;
339
+ duration: number;
340
+ timestamp: number;
341
+ }
342
+ /**
343
+ * Logger configuration
344
+ */
345
+ interface LoggerConfig {
346
+ /** Enable logging */
347
+ enabled: boolean;
348
+ /** Log requests */
349
+ logRequests: boolean;
350
+ /** Log responses */
351
+ logResponses: boolean;
352
+ /** Log errors */
353
+ logErrors: boolean;
354
+ /** Log request/response bodies */
355
+ logBodies: boolean;
356
+ /** Log headers (excluding sensitive ones) */
357
+ logHeaders: boolean;
358
+ /** Custom consola instance */
359
+ consola?: ConsolaInstance;
360
+ }
361
+ /**
362
+ * API Logger class
363
+ */
364
+ declare class APILogger {
365
+ private config;
366
+ private consola;
367
+ constructor(config?: Partial<LoggerConfig>);
368
+ /**
369
+ * Enable logging
370
+ */
371
+ enable(): void;
372
+ /**
373
+ * Disable logging
374
+ */
375
+ disable(): void;
376
+ /**
377
+ * Update configuration
378
+ */
379
+ setConfig(config: Partial<LoggerConfig>): void;
380
+ /**
381
+ * Filter sensitive headers
382
+ */
383
+ private filterHeaders;
384
+ /**
385
+ * Log request
386
+ */
387
+ logRequest(request: RequestLog): void;
388
+ /**
389
+ * Log response
390
+ */
391
+ logResponse(request: RequestLog, response: ResponseLog): void;
392
+ /**
393
+ * Log error
394
+ */
395
+ logError(request: RequestLog, error: ErrorLog): void;
396
+ /**
397
+ * Log general info
398
+ */
399
+ info(message: string, ...args: any[]): void;
400
+ /**
401
+ * Log warning
402
+ */
403
+ warn(message: string, ...args: any[]): void;
404
+ /**
405
+ * Log error
406
+ */
407
+ error(message: string, ...args: any[]): void;
408
+ /**
409
+ * Log debug
410
+ */
411
+ debug(message: string, ...args: any[]): void;
412
+ /**
413
+ * Log success
414
+ */
415
+ success(message: string, ...args: any[]): void;
416
+ /**
417
+ * Create a sub-logger with prefix
418
+ */
419
+ withTag(tag: string): ConsolaInstance;
420
+ }
421
+
422
+ /**
423
+ * Retry Configuration and Utilities
424
+ *
425
+ * Provides automatic retry logic for failed HTTP requests using p-retry.
426
+ * Retries only on network errors and server errors (5xx), not client errors (4xx).
427
+ */
428
+ /**
429
+ * Information about a failed retry attempt.
430
+ */
431
+ interface FailedAttemptInfo {
432
+ /** The error that caused the failure */
433
+ error: Error;
434
+ /** The attempt number (1-indexed) */
435
+ attemptNumber: number;
436
+ /** Number of retries left */
437
+ retriesLeft: number;
438
+ }
439
+ /**
440
+ * Retry configuration options.
441
+ *
442
+ * Uses exponential backoff with jitter by default to avoid thundering herd.
443
+ */
444
+ interface RetryConfig {
445
+ /**
446
+ * Maximum number of retry attempts.
447
+ * @default 3
448
+ */
449
+ retries?: number;
450
+ /**
451
+ * Exponential backoff factor.
452
+ * @default 2
453
+ */
454
+ factor?: number;
455
+ /**
456
+ * Minimum wait time between retries (ms).
457
+ * @default 1000
458
+ */
459
+ minTimeout?: number;
460
+ /**
461
+ * Maximum wait time between retries (ms).
462
+ * @default 60000
463
+ */
464
+ maxTimeout?: number;
465
+ /**
466
+ * Add randomness to wait times (jitter).
467
+ * Helps avoid thundering herd problem.
468
+ * @default true
469
+ */
470
+ randomize?: boolean;
471
+ /**
472
+ * Callback called on each failed attempt.
473
+ */
474
+ onFailedAttempt?: (info: FailedAttemptInfo) => void;
475
+ }
476
+ /**
477
+ * Default retry configuration.
478
+ */
479
+ declare const DEFAULT_RETRY_CONFIG: Required<RetryConfig>;
480
+ /**
481
+ * Determine if an error should trigger a retry.
482
+ *
483
+ * Retries on:
484
+ * - Network errors (connection refused, timeout, etc.)
485
+ * - Server errors (5xx status codes)
486
+ * - Rate limiting (429 status code)
487
+ *
488
+ * Does NOT retry on:
489
+ * - Client errors (4xx except 429)
490
+ * - Authentication errors (401, 403)
491
+ * - Not found (404)
492
+ *
493
+ * @param error - The error to check
494
+ * @returns true if should retry, false otherwise
495
+ */
496
+ declare function shouldRetry(error: any): boolean;
497
+ /**
498
+ * Wrap a function with retry logic.
499
+ *
500
+ * @param fn - Async function to retry
501
+ * @param config - Retry configuration
502
+ * @returns Result of the function
503
+ *
504
+ * @example
505
+ * ```typescript
506
+ * const result = await withRetry(
507
+ * async () => fetch('https://api.example.com/users'),
508
+ * { retries: 5, minTimeout: 2000 }
509
+ * );
510
+ * ```
511
+ */
512
+ declare function withRetry<T>(fn: () => Promise<T>, config?: RetryConfig): Promise<T>;
513
+
514
+ /**
515
+ * Async API client for Django CFG API.
516
+ *
517
+ * Usage:
518
+ * ```typescript
519
+ * const client = new APIClient('https://api.example.com');
520
+ * const users = await client.users.list();
521
+ * const post = await client.posts.create(newPost);
522
+ *
523
+ * // Custom HTTP adapter (e.g., Axios)
524
+ * const client = new APIClient('https://api.example.com', {
525
+ * httpClient: new AxiosAdapter()
526
+ * });
527
+ * ```
528
+ */
529
+ declare class APIClient {
530
+ private baseUrl;
531
+ private httpClient;
532
+ private logger;
533
+ private retryConfig;
534
+ ext_payments_payments: ExtPaymentsPayments;
535
+ constructor(baseUrl: string, options?: {
536
+ httpClient?: HttpClientAdapter;
537
+ loggerConfig?: Partial<LoggerConfig>;
538
+ retryConfig?: RetryConfig;
539
+ });
540
+ /**
541
+ * Get CSRF token from cookies (for SessionAuthentication).
542
+ *
543
+ * Returns null if cookie doesn't exist (JWT-only auth).
544
+ */
545
+ getCsrfToken(): string | null;
546
+ /**
547
+ * Make HTTP request with Django CSRF and session handling.
548
+ * Automatically retries on network errors and 5xx server errors.
549
+ */
550
+ request<T>(method: string, path: string, options?: {
551
+ params?: Record<string, any>;
552
+ body?: any;
553
+ formData?: FormData;
554
+ headers?: Record<string, string>;
555
+ }): Promise<T>;
556
+ /**
557
+ * Internal request method (without retry wrapper).
558
+ * Used by request() method with optional retry logic.
559
+ */
560
+ private _makeRequest;
561
+ }
562
+
563
+ /**
564
+ * Storage adapters for cross-platform token storage.
565
+ *
566
+ * Supports:
567
+ * - LocalStorage (browser)
568
+ * - Cookies (SSR/browser)
569
+ * - Memory (Node.js/Electron/testing)
570
+ */
571
+
572
+ /**
573
+ * Storage adapter interface for cross-platform token storage.
574
+ */
575
+ interface StorageAdapter {
576
+ getItem(key: string): string | null;
577
+ setItem(key: string, value: string): void;
578
+ removeItem(key: string): void;
579
+ }
580
+ /**
581
+ * LocalStorage adapter with safe try-catch for browser environments.
582
+ * Works in modern browsers with localStorage support.
583
+ *
584
+ * Note: This adapter uses window.localStorage and should only be used in browser/client environments.
585
+ * For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead.
586
+ */
587
+ declare class LocalStorageAdapter implements StorageAdapter {
588
+ private logger?;
589
+ constructor(logger?: APILogger);
590
+ getItem(key: string): string | null;
591
+ setItem(key: string, value: string): void;
592
+ removeItem(key: string): void;
593
+ }
594
+ /**
595
+ * Cookie-based storage adapter for SSR and browser environments.
596
+ * Useful for Next.js, Nuxt.js, and other SSR frameworks.
597
+ */
598
+ declare class CookieStorageAdapter implements StorageAdapter {
599
+ private logger?;
600
+ constructor(logger?: APILogger);
601
+ getItem(key: string): string | null;
602
+ setItem(key: string, value: string): void;
603
+ removeItem(key: string): void;
604
+ }
605
+ /**
606
+ * In-memory storage adapter for Node.js, Electron, and testing environments.
607
+ * Data is stored in RAM and cleared when process exits.
608
+ */
609
+ declare class MemoryStorageAdapter implements StorageAdapter {
610
+ private storage;
611
+ private logger?;
612
+ constructor(logger?: APILogger);
613
+ getItem(key: string): string | null;
614
+ setItem(key: string, value: string): void;
615
+ removeItem(key: string): void;
616
+ }
617
+
618
+ /**
619
+ * Zod schema for Balance
620
+ *
621
+ * This schema provides runtime validation and type inference.
622
+ * * User balance serializer.
623
+ * */
624
+
625
+ /**
626
+ * User balance serializer.
627
+ */
628
+ declare const BalanceSchema: z.ZodObject<{
629
+ balance_usd: z.ZodString;
630
+ balance_display: z.ZodString;
631
+ total_deposited: z.ZodString;
632
+ total_withdrawn: z.ZodString;
633
+ last_transaction_at: z.ZodNullable<z.ZodISODateTime>;
634
+ }, z.core.$strip>;
635
+ /**
636
+ * Infer TypeScript type from Zod schema
637
+ */
638
+ type Balance = z.infer<typeof BalanceSchema>;
639
+
640
+ /**
641
+ * Zod schema for Currency
642
+ *
643
+ * This schema provides runtime validation and type inference.
644
+ * * Currency list serializer.
645
+ * */
646
+
647
+ /**
648
+ * Currency list serializer.
649
+ */
650
+ declare const CurrencySchema: z.ZodObject<{
651
+ code: z.ZodString;
652
+ name: z.ZodString;
653
+ token: z.ZodString;
654
+ network: z.ZodNullable<z.ZodString>;
655
+ display_name: z.ZodString;
656
+ symbol: z.ZodString;
657
+ decimal_places: z.ZodInt;
658
+ is_active: z.ZodBoolean;
659
+ min_amount_usd: z.ZodString;
660
+ sort_order: z.ZodInt;
661
+ }, z.core.$strip>;
662
+ /**
663
+ * Infer TypeScript type from Zod schema
664
+ */
665
+ type Currency = z.infer<typeof CurrencySchema>;
666
+
667
+ declare const PaginatedPaymentListListSchema: z.ZodObject<{
668
+ count: z.ZodInt;
669
+ page: z.ZodInt;
670
+ pages: z.ZodInt;
671
+ page_size: z.ZodInt;
672
+ has_next: z.ZodBoolean;
673
+ has_previous: z.ZodBoolean;
674
+ next_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
675
+ previous_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
676
+ results: z.ZodArray<z.ZodObject<{
677
+ id: z.ZodString;
678
+ internal_payment_id: z.ZodString;
679
+ amount_usd: z.ZodString;
680
+ currency_code: z.ZodString;
681
+ currency_token: z.ZodString;
682
+ status: z.ZodEnum<typeof PaymentListStatus>;
683
+ status_display: z.ZodString;
684
+ created_at: z.ZodISODateTime;
685
+ completed_at: z.ZodNullable<z.ZodISODateTime>;
686
+ }, z.core.$strip>>;
687
+ }, z.core.$strip>;
688
+ /**
689
+ * Infer TypeScript type from Zod schema
690
+ */
691
+ type PaginatedPaymentListList = z.infer<typeof PaginatedPaymentListListSchema>;
692
+
693
+ /**
694
+ * Zod schema for PaymentDetail
695
+ *
696
+ * This schema provides runtime validation and type inference.
697
+ * * Detailed payment information.
698
+ * */
699
+
700
+ /**
701
+ * Detailed payment information.
702
+ */
703
+ declare const PaymentDetailSchema: z.ZodObject<{
704
+ id: z.ZodString;
705
+ internal_payment_id: z.ZodString;
706
+ amount_usd: z.ZodString;
707
+ currency_code: z.ZodString;
708
+ currency_name: z.ZodString;
709
+ currency_token: z.ZodString;
710
+ currency_network: z.ZodString;
711
+ pay_amount: z.ZodNullable<z.ZodString>;
712
+ actual_amount: z.ZodNullable<z.ZodString>;
713
+ actual_amount_usd: z.ZodNullable<z.ZodString>;
714
+ status: z.ZodEnum<typeof PaymentDetailStatus>;
715
+ status_display: z.ZodString;
716
+ pay_address: z.ZodNullable<z.ZodString>;
717
+ qr_code_url: z.ZodNullable<z.ZodString>;
718
+ payment_url: z.ZodNullable<z.ZodURL>;
719
+ transaction_hash: z.ZodNullable<z.ZodString>;
720
+ explorer_link: z.ZodNullable<z.ZodString>;
721
+ confirmations_count: z.ZodInt;
722
+ expires_at: z.ZodNullable<z.ZodISODateTime>;
723
+ completed_at: z.ZodNullable<z.ZodISODateTime>;
724
+ created_at: z.ZodISODateTime;
725
+ is_completed: z.ZodBoolean;
726
+ is_failed: z.ZodBoolean;
727
+ is_expired: z.ZodBoolean;
728
+ description: z.ZodString;
729
+ }, z.core.$strip>;
730
+ /**
731
+ * Infer TypeScript type from Zod schema
732
+ */
733
+ type PaymentDetail = z.infer<typeof PaymentDetailSchema>;
734
+
735
+ /**
736
+ * Zod schema for PaymentList
737
+ *
738
+ * This schema provides runtime validation and type inference.
739
+ * * Payment list item (lighter than detail).
740
+ * */
741
+
742
+ /**
743
+ * Payment list item (lighter than detail).
744
+ */
745
+ declare const PaymentListSchema: z.ZodObject<{
746
+ id: z.ZodString;
747
+ internal_payment_id: z.ZodString;
748
+ amount_usd: z.ZodString;
749
+ currency_code: z.ZodString;
750
+ currency_token: z.ZodString;
751
+ status: z.ZodEnum<typeof PaymentListStatus>;
752
+ status_display: z.ZodString;
753
+ created_at: z.ZodISODateTime;
754
+ completed_at: z.ZodNullable<z.ZodISODateTime>;
755
+ }, z.core.$strip>;
756
+ /**
757
+ * Infer TypeScript type from Zod schema
758
+ */
759
+ type PaymentList = z.infer<typeof PaymentListSchema>;
760
+
761
+ /**
762
+ * Zod schema for Transaction
763
+ *
764
+ * This schema provides runtime validation and type inference.
765
+ * * Transaction serializer.
766
+ * */
767
+
768
+ /**
769
+ * Transaction serializer.
770
+ */
771
+ declare const TransactionSchema: z.ZodObject<{
772
+ id: z.ZodString;
773
+ transaction_type: z.ZodEnum<typeof TransactionTransactionType>;
774
+ type_display: z.ZodString;
775
+ amount_usd: z.ZodString;
776
+ amount_display: z.ZodString;
777
+ balance_after: z.ZodString;
778
+ payment_id: z.ZodNullable<z.ZodString>;
779
+ description: z.ZodString;
780
+ created_at: z.ZodISODateTime;
781
+ }, z.core.$strip>;
782
+ /**
783
+ * Infer TypeScript type from Zod schema
784
+ */
785
+ type Transaction = z.infer<typeof TransactionSchema>;
786
+
787
+ /**
788
+ * Zod Schemas - Runtime validation and type inference
789
+ *
790
+ * Auto-generated from OpenAPI specification.
791
+ * Provides runtime validation for API requests and responses.
792
+ *
793
+ * Usage:
794
+ * ```typescript
795
+ * import { UserSchema } from './schemas'
796
+ *
797
+ * // Validate data
798
+ * const user = UserSchema.parse(data)
799
+ *
800
+ * // Type inference
801
+ * type User = z.infer<typeof UserSchema>
802
+ * ```
803
+ */
804
+
805
+ type index$1_Balance = Balance;
806
+ declare const index$1_BalanceSchema: typeof BalanceSchema;
807
+ type index$1_Currency = Currency;
808
+ declare const index$1_CurrencySchema: typeof CurrencySchema;
809
+ type index$1_PaginatedPaymentListList = PaginatedPaymentListList;
810
+ declare const index$1_PaginatedPaymentListListSchema: typeof PaginatedPaymentListListSchema;
811
+ type index$1_PaymentDetail = PaymentDetail;
812
+ declare const index$1_PaymentDetailSchema: typeof PaymentDetailSchema;
813
+ type index$1_PaymentList = PaymentList;
814
+ declare const index$1_PaymentListSchema: typeof PaymentListSchema;
815
+ type index$1_Transaction = Transaction;
816
+ declare const index$1_TransactionSchema: typeof TransactionSchema;
817
+ declare namespace index$1 {
818
+ export { type index$1_Balance as Balance, index$1_BalanceSchema as BalanceSchema, type index$1_Currency as Currency, index$1_CurrencySchema as CurrencySchema, type index$1_PaginatedPaymentListList as PaginatedPaymentListList, index$1_PaginatedPaymentListListSchema as PaginatedPaymentListListSchema, type index$1_PaymentDetail as PaymentDetail, index$1_PaymentDetailSchema as PaymentDetailSchema, type index$1_PaymentList as PaymentList, index$1_PaymentListSchema as PaymentListSchema, type index$1_Transaction as Transaction, index$1_TransactionSchema as TransactionSchema };
819
+ }
820
+
821
+ /**
822
+ * Zod Validation Events - Browser CustomEvent integration
823
+ *
824
+ * Dispatches browser CustomEvents when Zod validation fails, allowing
825
+ * React/frontend apps to listen and handle validation errors globally.
826
+ *
827
+ * @example
828
+ * ```typescript
829
+ * // In your React app
830
+ * window.addEventListener('zod-validation-error', (event) => {
831
+ * const { operation, path, method, error, response } = event.detail;
832
+ * console.error(`Validation failed for ${method} ${path}`, error);
833
+ * // Show toast notification, log to Sentry, etc.
834
+ * });
835
+ * ```
836
+ */
837
+
838
+ /**
839
+ * Validation error event detail
840
+ */
841
+ interface ValidationErrorDetail {
842
+ /** Operation/function name that failed validation */
843
+ operation: string;
844
+ /** API endpoint path */
845
+ path: string;
846
+ /** HTTP method */
847
+ method: string;
848
+ /** Zod validation error */
849
+ error: ZodError;
850
+ /** Raw response data that failed validation */
851
+ response: any;
852
+ /** Timestamp of the error */
853
+ timestamp: Date;
854
+ }
855
+ /**
856
+ * Custom event type for Zod validation errors
857
+ */
858
+ type ValidationErrorEvent = CustomEvent<ValidationErrorDetail>;
859
+ /**
860
+ * Dispatch a Zod validation error event.
861
+ *
862
+ * Only dispatches in browser environment (when window is defined).
863
+ * Safe to call in Node.js/SSR - will be a no-op.
864
+ *
865
+ * @param detail - Validation error details
866
+ */
867
+ declare function dispatchValidationError(detail: ValidationErrorDetail): void;
868
+ /**
869
+ * Add a global listener for Zod validation errors.
870
+ *
871
+ * @param callback - Function to call when validation error occurs
872
+ * @returns Cleanup function to remove the listener
873
+ *
874
+ * @example
875
+ * ```typescript
876
+ * const cleanup = onValidationError(({ operation, error }) => {
877
+ * toast.error(`Validation failed in ${operation}`);
878
+ * logToSentry(error);
879
+ * });
880
+ *
881
+ * // Later, remove listener
882
+ * cleanup();
883
+ * ```
884
+ */
885
+ declare function onValidationError(callback: (detail: ValidationErrorDetail) => void): () => void;
886
+ /**
887
+ * Format Zod error for logging/display.
888
+ *
889
+ * @param error - Zod validation error
890
+ * @returns Formatted error message
891
+ */
892
+ declare function formatZodError(error: ZodError): string;
893
+
894
+ /**
895
+ * Get user balance
896
+ *
897
+ * @method GET
898
+ * @path /cfg/payments/balance/
899
+ */
900
+ declare function getPaymentsBalanceRetrieve(client?: any): Promise<Balance>;
901
+ /**
902
+ * Get available currencies
903
+ *
904
+ * @method GET
905
+ * @path /cfg/payments/currencies/
906
+ */
907
+ declare function getPaymentsCurrenciesList(client?: any): Promise<any>;
908
+ /**
909
+ * API operation
910
+ *
911
+ * @method GET
912
+ * @path /cfg/payments/payments/
913
+ */
914
+ declare function getPaymentsPaymentsList(params?: {
915
+ page?: number;
916
+ page_size?: number;
917
+ }, client?: any): Promise<PaginatedPaymentListList>;
918
+ /**
919
+ * API operation
920
+ *
921
+ * @method GET
922
+ * @path /cfg/payments/payments/{id}/
923
+ */
924
+ declare function getPaymentsPaymentsRetrieve(id: string, client?: any): Promise<PaymentDetail>;
925
+ /**
926
+ * API operation
927
+ *
928
+ * @method POST
929
+ * @path /cfg/payments/payments/{id}/confirm/
930
+ */
931
+ declare function createPaymentsPaymentsConfirmCreate(id: string, client?: any): Promise<PaymentList>;
932
+ /**
933
+ * API operation
934
+ *
935
+ * @method GET
936
+ * @path /cfg/payments/payments/{id}/status/
937
+ */
938
+ declare function getPaymentsPaymentsStatusRetrieve(id: string, client?: any): Promise<PaymentList>;
939
+ /**
940
+ * API operation
941
+ *
942
+ * @method POST
943
+ * @path /cfg/payments/payments/create/
944
+ */
945
+ declare function createPaymentsPaymentsCreateCreate(client?: any): Promise<PaymentList>;
946
+ /**
947
+ * Get user transactions
948
+ *
949
+ * @method GET
950
+ * @path /cfg/payments/transactions/
951
+ */
952
+ declare function getPaymentsTransactionsList(params?: {
953
+ limit?: number;
954
+ offset?: number;
955
+ type?: string;
956
+ }, client?: any): Promise<any>;
957
+
958
+ /**
959
+ * Typed Fetchers - Universal API functions
960
+ *
961
+ * Auto-generated from OpenAPI specification.
962
+ * These functions work in any JavaScript environment.
963
+ *
964
+ * Features:
965
+ * - Runtime validation with Zod
966
+ * - Type-safe parameters and responses
967
+ * - Works with any data-fetching library (SWR, React Query, etc)
968
+ * - Server Component compatible
969
+ *
970
+ * Usage:
971
+ * ```typescript
972
+ * import * as fetchers from './fetchers'
973
+ *
974
+ * // Direct usage
975
+ * const user = await fetchers.getUser(1)
976
+ *
977
+ * // With SWR
978
+ * const { data } = useSWR('user-1', () => fetchers.getUser(1))
979
+ *
980
+ * // With React Query
981
+ * const { data } = useQuery(['user', 1], () => fetchers.getUser(1))
982
+ * ```
983
+ */
984
+
985
+ declare const index_createPaymentsPaymentsConfirmCreate: typeof createPaymentsPaymentsConfirmCreate;
986
+ declare const index_createPaymentsPaymentsCreateCreate: typeof createPaymentsPaymentsCreateCreate;
987
+ declare const index_getPaymentsBalanceRetrieve: typeof getPaymentsBalanceRetrieve;
988
+ declare const index_getPaymentsCurrenciesList: typeof getPaymentsCurrenciesList;
989
+ declare const index_getPaymentsPaymentsList: typeof getPaymentsPaymentsList;
990
+ declare const index_getPaymentsPaymentsRetrieve: typeof getPaymentsPaymentsRetrieve;
991
+ declare const index_getPaymentsPaymentsStatusRetrieve: typeof getPaymentsPaymentsStatusRetrieve;
992
+ declare const index_getPaymentsTransactionsList: typeof getPaymentsTransactionsList;
993
+ declare namespace index {
994
+ export { index_createPaymentsPaymentsConfirmCreate as createPaymentsPaymentsConfirmCreate, index_createPaymentsPaymentsCreateCreate as createPaymentsPaymentsCreateCreate, index_getPaymentsBalanceRetrieve as getPaymentsBalanceRetrieve, index_getPaymentsCurrenciesList as getPaymentsCurrenciesList, index_getPaymentsPaymentsList as getPaymentsPaymentsList, index_getPaymentsPaymentsRetrieve as getPaymentsPaymentsRetrieve, index_getPaymentsPaymentsStatusRetrieve as getPaymentsPaymentsStatusRetrieve, index_getPaymentsTransactionsList as getPaymentsTransactionsList };
995
+ }
996
+
997
+ /**
998
+ * Global API Instance - Singleton configuration
999
+ *
1000
+ * This module provides a global API instance that can be configured once
1001
+ * and used throughout your application.
1002
+ *
1003
+ * Usage:
1004
+ * ```typescript
1005
+ * // Configure once (e.g., in your app entry point)
1006
+ * import { configureAPI } from './api-instance'
1007
+ *
1008
+ * configureAPI({
1009
+ * baseUrl: 'https://api.example.com',
1010
+ * token: 'your-jwt-token'
1011
+ * })
1012
+ *
1013
+ * // Then use fetchers and hooks anywhere without configuration
1014
+ * import { getUsers } from './fetchers'
1015
+ * const users = await getUsers({ page: 1 })
1016
+ * ```
1017
+ *
1018
+ * For SSR or multiple instances:
1019
+ * ```typescript
1020
+ * import { API } from './index'
1021
+ * import { getUsers } from './fetchers'
1022
+ *
1023
+ * const api = new API('https://api.example.com')
1024
+ * const users = await getUsers({ page: 1 }, api)
1025
+ * ```
1026
+ */
1027
+
1028
+ /**
1029
+ * Get the global API instance
1030
+ * @throws Error if API is not configured
1031
+ */
1032
+ declare function getAPIInstance(): API;
1033
+ /**
1034
+ * Check if API is configured
1035
+ */
1036
+ declare function isAPIConfigured(): boolean;
1037
+ /**
1038
+ * Configure the global API instance
1039
+ *
1040
+ * @param baseUrl - Base URL for the API
1041
+ * @param options - Optional configuration (storage, retry, logger)
1042
+ *
1043
+ * @example
1044
+ * ```typescript
1045
+ * configureAPI({
1046
+ * baseUrl: 'https://api.example.com',
1047
+ * token: 'jwt-token',
1048
+ * options: {
1049
+ * retryConfig: { maxRetries: 3 },
1050
+ * loggerConfig: { enabled: true }
1051
+ * }
1052
+ * })
1053
+ * ```
1054
+ */
1055
+ declare function configureAPI(config: {
1056
+ baseUrl: string;
1057
+ token?: string;
1058
+ refreshToken?: string;
1059
+ options?: APIOptions;
1060
+ }): API;
1061
+ /**
1062
+ * Reconfigure the global API instance with new settings
1063
+ * Useful for updating tokens or base URL
1064
+ */
1065
+ declare function reconfigureAPI(updates: {
1066
+ baseUrl?: string;
1067
+ token?: string;
1068
+ refreshToken?: string;
1069
+ }): API;
1070
+ /**
1071
+ * Clear tokens from the global API instance
1072
+ */
1073
+ declare function clearAPITokens(): void;
1074
+ /**
1075
+ * Reset the global API instance
1076
+ * Useful for testing or logout scenarios
1077
+ */
1078
+ declare function resetAPI(): void;
1079
+
1080
+ /**
1081
+ * API Error Classes
1082
+ *
1083
+ * Typed error classes with Django REST Framework support.
1084
+ */
1085
+ /**
1086
+ * HTTP API Error with DRF field-specific validation errors.
1087
+ *
1088
+ * Usage:
1089
+ * ```typescript
1090
+ * try {
1091
+ * await api.users.create(userData);
1092
+ * } catch (error) {
1093
+ * if (error instanceof APIError) {
1094
+ * if (error.isValidationError) {
1095
+ * console.log('Field errors:', error.fieldErrors);
1096
+ * // { "email": ["Email already exists"], "username": ["Required"] }
1097
+ * }
1098
+ * }
1099
+ * }
1100
+ * ```
1101
+ */
1102
+ declare class APIError extends Error {
1103
+ statusCode: number;
1104
+ statusText: string;
1105
+ response: any;
1106
+ url: string;
1107
+ constructor(statusCode: number, statusText: string, response: any, url: string, message?: string);
1108
+ /**
1109
+ * Get error details from response.
1110
+ * DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] }
1111
+ */
1112
+ get details(): Record<string, any> | null;
1113
+ /**
1114
+ * Get field-specific validation errors from DRF.
1115
+ * Returns: { "field_name": ["error1", "error2"], ... }
1116
+ */
1117
+ get fieldErrors(): Record<string, string[]> | null;
1118
+ /**
1119
+ * Get single error message from DRF.
1120
+ * Checks for "detail", "message", or first field error.
1121
+ */
1122
+ get errorMessage(): string;
1123
+ get isValidationError(): boolean;
1124
+ get isAuthError(): boolean;
1125
+ get isPermissionError(): boolean;
1126
+ get isNotFoundError(): boolean;
1127
+ get isServerError(): boolean;
1128
+ }
1129
+ /**
1130
+ * Network Error (connection failed, timeout, etc.)
1131
+ */
1132
+ declare class NetworkError extends Error {
1133
+ url: string;
1134
+ originalError?: Error;
1135
+ constructor(message: string, url: string, originalError?: Error);
1136
+ }
1137
+
1138
+ /**
1139
+ * Django CFG API - API Client with JWT Management
1140
+ *
1141
+ * Usage:
1142
+ * ```typescript
1143
+ * import { API } from './api';
1144
+ *
1145
+ * const api = new API('https://api.example.com');
1146
+ *
1147
+ * // Set JWT token
1148
+ * api.setToken('your-jwt-token', 'refresh-token');
1149
+ *
1150
+ * // Use API
1151
+ * const posts = await api.posts.list();
1152
+ * const user = await api.users.retrieve(1);
1153
+ *
1154
+ * // Check authentication
1155
+ * if (api.isAuthenticated()) {
1156
+ * // ...
1157
+ * }
1158
+ *
1159
+ * // Custom storage with logging (for Electron/Node.js)
1160
+ * import { MemoryStorageAdapter, APILogger } from './storage';
1161
+ * const logger = new APILogger({ enabled: true, logLevel: 'debug' });
1162
+ * const api = new API('https://api.example.com', {
1163
+ * storage: new MemoryStorageAdapter(logger),
1164
+ * loggerConfig: { enabled: true, logLevel: 'debug' }
1165
+ * });
1166
+ *
1167
+ * // Get OpenAPI schema
1168
+ * const schema = api.getSchema();
1169
+ * ```
1170
+ */
1171
+
1172
+ declare const TOKEN_KEY = "auth_token";
1173
+ declare const REFRESH_TOKEN_KEY = "refresh_token";
1174
+ interface APIOptions {
1175
+ /** Custom storage adapter (defaults to LocalStorageAdapter) */
1176
+ storage?: StorageAdapter;
1177
+ /** Retry configuration for failed requests */
1178
+ retryConfig?: RetryConfig;
1179
+ /** Logger configuration */
1180
+ loggerConfig?: Partial<LoggerConfig>;
1181
+ }
1182
+ declare class API {
1183
+ private baseUrl;
1184
+ private _client;
1185
+ private _token;
1186
+ private _refreshToken;
1187
+ private storage;
1188
+ private options?;
1189
+ ext_payments_payments: ExtPaymentsPayments;
1190
+ constructor(baseUrl: string, options?: APIOptions);
1191
+ private _loadTokensFromStorage;
1192
+ private _reinitClients;
1193
+ private _injectAuthHeader;
1194
+ /**
1195
+ * Get current JWT token
1196
+ */
1197
+ getToken(): string | null;
1198
+ /**
1199
+ * Get current refresh token
1200
+ */
1201
+ getRefreshToken(): string | null;
1202
+ /**
1203
+ * Set JWT token and refresh token
1204
+ * @param token - JWT access token
1205
+ * @param refreshToken - JWT refresh token (optional)
1206
+ */
1207
+ setToken(token: string, refreshToken?: string): void;
1208
+ /**
1209
+ * Clear all tokens
1210
+ */
1211
+ clearTokens(): void;
1212
+ /**
1213
+ * Check if user is authenticated
1214
+ */
1215
+ isAuthenticated(): boolean;
1216
+ /**
1217
+ * Update base URL and reinitialize clients
1218
+ * @param url - New base URL
1219
+ */
1220
+ setBaseUrl(url: string): void;
1221
+ /**
1222
+ * Get current base URL
1223
+ */
1224
+ getBaseUrl(): string;
1225
+ /**
1226
+ * Get OpenAPI schema path
1227
+ * @returns Path to the OpenAPI schema JSON file
1228
+ *
1229
+ * Note: The OpenAPI schema is available in the schema.json file.
1230
+ * You can load it dynamically using:
1231
+ * ```typescript
1232
+ * const schema = await fetch('./schema.json').then(r => r.json());
1233
+ * // or using fs in Node.js:
1234
+ * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
1235
+ * ```
1236
+ */
1237
+ getSchemaPath(): string;
1238
+ }
1239
+
1240
+ /**
1241
+ * Payments Extension API
1242
+ *
1243
+ * Pre-configured API instance with shared authentication
1244
+ */
1245
+
1246
+ declare const apiPayments: API;
1247
+
1248
+ /**
1249
+ * Payments Layout (v2.0 - Simplified)
1250
+ *
1251
+ * Simplified layout with 3 tabs: Overview, Payments, Transactions
1252
+ * Removed: API Keys, Tariffs (deprecated in v2.0)
1253
+ */
1254
+
1255
+ interface PaymentsLayoutProps {
1256
+ children?: React.ReactNode;
1257
+ }
1258
+ declare const PaymentsLayout: React.FC<PaymentsLayoutProps>;
1259
+
1260
+ /**
1261
+ * Payments Layout Types (v2.0 - Simplified)
1262
+ */
1263
+ type PaymentTab = 'overview' | 'payments' | 'transactions';
1264
+
1265
+ /**
1266
+ * Payment Events System (v2.0 - Simplified)
1267
+ *
1268
+ * Event-based communication for dialogs using DOM events
1269
+ * Removed: API Keys events (deprecated)
1270
+ */
1271
+ declare const PAYMENT_EVENTS: {
1272
+ readonly OPEN_CREATE_PAYMENT_DIALOG: "payments:open-create-payment";
1273
+ readonly OPEN_PAYMENT_DETAILS_DIALOG: "payments:open-payment-details";
1274
+ readonly CLOSE_DIALOG: "payments:close-dialog";
1275
+ };
1276
+ type PaymentEvent = {
1277
+ type: 'OPEN_CREATE_PAYMENT';
1278
+ } | {
1279
+ type: 'OPEN_PAYMENT_DETAILS';
1280
+ id: string;
1281
+ } | {
1282
+ type: 'CLOSE_DIALOG';
1283
+ };
1284
+ declare const openCreatePaymentDialog: () => void;
1285
+ declare const openPaymentDetailsDialog: (id: string) => void;
1286
+ declare const closePaymentsDialog: () => void;
1287
+
1288
+ /**
1289
+ * Payments extension configuration
1290
+ */
1291
+ declare const extensionConfig: _djangocfg_ext_base.ExtensionMetadata;
1292
+
1293
+ export { API, APIClient, APIError, APILogger, type APIOptions, type Balance, BalanceSchema, CookieStorageAdapter, type Currency, CurrencySchema, DEFAULT_RETRY_CONFIG, enums as Enums, type ErrorLog, models as ExtPaymentsPaymentsTypes, type FailedAttemptInfo, FetchAdapter, index as Fetchers, type HttpClientAdapter, type HttpRequest, type HttpResponse, LocalStorageAdapter, type LoggerConfig, MemoryStorageAdapter, NetworkError, PAYMENT_EVENTS, type PaginatedPaymentListList, PaginatedPaymentListListSchema, type PaymentDetail, PaymentDetailSchema, type PaymentEvent, type PaymentList, PaymentListSchema, type PaymentTab, PaymentsLayout, type PaymentsLayoutProps, REFRESH_TOKEN_KEY, type RequestLog, type ResponseLog, type RetryConfig, index$1 as Schemas, type StorageAdapter, TOKEN_KEY, type Transaction, TransactionSchema, type ValidationErrorDetail, type ValidationErrorEvent, apiPayments, clearAPITokens, closePaymentsDialog, configureAPI, createPaymentsPaymentsConfirmCreate, createPaymentsPaymentsCreateCreate, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getPaymentsBalanceRetrieve, getPaymentsCurrenciesList, getPaymentsPaymentsList, getPaymentsPaymentsRetrieve, getPaymentsPaymentsStatusRetrieve, getPaymentsTransactionsList, isAPIConfigured, onValidationError, openCreatePaymentDialog, openPaymentDetailsDialog, reconfigureAPI, resetAPI, shouldRetry, withRetry };