@djangocfg/ext-payments 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,495 +1,15 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ConsolaInstance } from 'consola';
3
- import { z, ZodError } from 'zod';
2
+ import { E as ExtPaymentsPayments, L as LoggerConfig, R as RetryConfig, d as PaymentCreateRequest, i as PaymentCreateRequestSchema, e as PaymentCreateResponse, j as PaymentCreateResponseSchema, c as PaymentList, k as PaymentListSchema, f as WithdrawalCancelResponse, l as WithdrawalCancelResponseSchema, g as WithdrawalCreateRequest, m as WithdrawalCreateRequestSchema, h as WithdrawalCreateResponse, n as WithdrawalCreateResponseSchema, D as APIOptions, A as API } from './hooks-DG8taGyN.js';
3
+ export { U as APILogger, G as CookieStorageAdapter, Z as DEFAULT_RETRY_CONFIG, K as Enums, Q as ErrorLog, J as ExtPaymentsPaymentsTypes, V as FailedAttemptInfo, F as LocalStorageAdapter, M as MemoryStorageAdapter, I as REFRESH_TOKEN_KEY, N as RequestLog, O as ResponseLog, S as StorageAdapter, H as TOKEN_KEY, Y as shouldRetry, X as withRetry } from './hooks-DG8taGyN.js';
4
+ import { Balance, BalanceSchema, Currency, CurrencySchema, PaginatedPaymentListList, PaginatedPaymentListListSchema, PaginatedWithdrawalListList, PaginatedWithdrawalListListSchema, PaymentDetail, PaymentDetailSchema, Transaction, TransactionSchema, WithdrawalDetail, WithdrawalDetailSchema, WithdrawalList, WithdrawalListSchema, createPaymentsPaymentsConfirmCreate, createPaymentsPaymentsCreateCreate, createPaymentsWithdrawalsCancelCreate, createPaymentsWithdrawalsCreateCreate, getPaymentsBalanceRetrieve, getPaymentsCurrenciesEstimateRetrieve, getPaymentsCurrenciesList, getPaymentsCurrenciesWithdrawalEstimateRetrieve, getPaymentsPaymentsList, getPaymentsPaymentsRetrieve, getPaymentsPaymentsStatusRetrieve, getPaymentsTransactionsList, getPaymentsWithdrawalsList, getPaymentsWithdrawalsRetrieve } from './api/index.js';
5
+ export { apiPayments } from './api/index.js';
4
6
  import * as _djangocfg_ext_base from '@djangocfg/ext-base';
7
+ import { ZodError } from 'zod';
8
+ import 'swr';
9
+ import 'consola';
5
10
 
6
11
  declare function WalletPage(): react_jsx_runtime.JSX.Element;
7
12
 
8
- /**
9
- * Current payment status
10
- * * `pending` - Pending
11
- * * `confirming` - Confirming
12
- * * `confirmed` - Confirmed
13
- * * `completed` - Completed
14
- * * `partially_paid` - Partially Paid
15
- * * `failed` - Failed
16
- * * `expired` - Expired
17
- * * `cancelled` - Cancelled
18
- */
19
- declare enum PaymentDetailStatus {
20
- PENDING = "pending",
21
- CONFIRMING = "confirming",
22
- CONFIRMED = "confirmed",
23
- COMPLETED = "completed",
24
- PARTIALLY_PAID = "partially_paid",
25
- FAILED = "failed",
26
- EXPIRED = "expired",
27
- CANCELLED = "cancelled"
28
- }
29
- /**
30
- * Current payment status
31
- * * `pending` - Pending
32
- * * `confirming` - Confirming
33
- * * `confirmed` - Confirmed
34
- * * `completed` - Completed
35
- * * `partially_paid` - Partially Paid
36
- * * `failed` - Failed
37
- * * `expired` - Expired
38
- * * `cancelled` - Cancelled
39
- */
40
- declare enum PaymentListStatus {
41
- PENDING = "pending",
42
- CONFIRMING = "confirming",
43
- CONFIRMED = "confirmed",
44
- COMPLETED = "completed",
45
- PARTIALLY_PAID = "partially_paid",
46
- FAILED = "failed",
47
- EXPIRED = "expired",
48
- CANCELLED = "cancelled"
49
- }
50
- /**
51
- * Type of transaction
52
- * * `deposit` - Deposit
53
- * * `withdrawal` - Withdrawal
54
- * * `payment` - Payment
55
- * * `refund` - Refund
56
- * * `fee` - Fee
57
- * * `bonus` - Bonus
58
- * * `adjustment` - Adjustment
59
- */
60
- declare enum TransactionTransactionType {
61
- DEPOSIT = "deposit",
62
- WITHDRAWAL = "withdrawal",
63
- PAYMENT = "payment",
64
- REFUND = "refund",
65
- FEE = "fee",
66
- BONUS = "bonus",
67
- ADJUSTMENT = "adjustment"
68
- }
69
- /**
70
- * Withdrawal status
71
- * * `pending` - Pending
72
- * * `approved` - Approved
73
- * * `processing` - Processing
74
- * * `completed` - Completed
75
- * * `rejected` - Rejected
76
- * * `cancelled` - Cancelled
77
- */
78
- declare enum WithdrawalDetailStatus {
79
- PENDING = "pending",
80
- APPROVED = "approved",
81
- PROCESSING = "processing",
82
- COMPLETED = "completed",
83
- REJECTED = "rejected",
84
- CANCELLED = "cancelled"
85
- }
86
- /**
87
- * Withdrawal status
88
- * * `pending` - Pending
89
- * * `approved` - Approved
90
- * * `processing` - Processing
91
- * * `completed` - Completed
92
- * * `rejected` - Rejected
93
- * * `cancelled` - Cancelled
94
- */
95
- declare enum WithdrawalListStatus {
96
- PENDING = "pending",
97
- APPROVED = "approved",
98
- PROCESSING = "processing",
99
- COMPLETED = "completed",
100
- REJECTED = "rejected",
101
- CANCELLED = "cancelled"
102
- }
103
-
104
- type enums_PaymentDetailStatus = PaymentDetailStatus;
105
- declare const enums_PaymentDetailStatus: typeof PaymentDetailStatus;
106
- type enums_PaymentListStatus = PaymentListStatus;
107
- declare const enums_PaymentListStatus: typeof PaymentListStatus;
108
- type enums_TransactionTransactionType = TransactionTransactionType;
109
- declare const enums_TransactionTransactionType: typeof TransactionTransactionType;
110
- type enums_WithdrawalDetailStatus = WithdrawalDetailStatus;
111
- declare const enums_WithdrawalDetailStatus: typeof WithdrawalDetailStatus;
112
- type enums_WithdrawalListStatus = WithdrawalListStatus;
113
- declare const enums_WithdrawalListStatus: typeof WithdrawalListStatus;
114
- declare namespace enums {
115
- export { enums_PaymentDetailStatus as PaymentDetailStatus, enums_PaymentListStatus as PaymentListStatus, enums_TransactionTransactionType as TransactionTransactionType, enums_WithdrawalDetailStatus as WithdrawalDetailStatus, enums_WithdrawalListStatus as WithdrawalListStatus };
116
- }
117
-
118
- /**
119
- * User balance serializer.
120
- *
121
- * Response model (includes read-only fields).
122
- */
123
- interface Balance$1 {
124
- /** Current balance in USD */
125
- balance_usd: string;
126
- balance_display: string;
127
- /** Total amount deposited (lifetime) */
128
- total_deposited: string;
129
- /** Total amount withdrawn (lifetime) */
130
- total_withdrawn: string;
131
- /** When the last transaction occurred */
132
- last_transaction_at?: string | null;
133
- }
134
- /**
135
- *
136
- * Response model (includes read-only fields).
137
- */
138
- interface PaginatedPaymentListList$1 {
139
- /** Total number of items across all pages */
140
- count: number;
141
- /** Current page number (1-based) */
142
- page: number;
143
- /** Total number of pages */
144
- pages: number;
145
- /** Number of items per page */
146
- page_size: number;
147
- /** Whether there is a next page */
148
- has_next: boolean;
149
- /** Whether there is a previous page */
150
- has_previous: boolean;
151
- /** Next page number (null if no next page) */
152
- next_page?: number | null;
153
- /** Previous page number (null if no previous page) */
154
- previous_page?: number | null;
155
- /** Array of items for current page */
156
- results: Array<PaymentList$1>;
157
- }
158
- /**
159
- * Detailed payment information.
160
- *
161
- * Response model (includes read-only fields).
162
- */
163
- interface PaymentDetail$1 {
164
- /** Unique identifier for this record */
165
- id: string;
166
- /** Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID) */
167
- internal_payment_id: string;
168
- /** Payment amount in USD */
169
- amount_usd: string;
170
- currency_code: string;
171
- currency_name: string;
172
- currency_token: string;
173
- currency_network: string;
174
- pay_amount?: string | null;
175
- actual_amount?: string | null;
176
- actual_amount_usd?: string | null;
177
- /** Current payment status
178
-
179
- * `pending` - Pending
180
- * `confirming` - Confirming
181
- * `confirmed` - Confirmed
182
- * `completed` - Completed
183
- * `partially_paid` - Partially Paid
184
- * `failed` - Failed
185
- * `expired` - Expired
186
- * `cancelled` - Cancelled */
187
- status: PaymentDetailStatus;
188
- status_display: string;
189
- pay_address?: string | null;
190
- /** Get QR code URL. */
191
- qr_code_url?: string | null;
192
- payment_url?: string | null;
193
- transaction_hash?: string | null;
194
- /** Get blockchain explorer link. */
195
- explorer_link?: string | null;
196
- /** Number of blockchain confirmations */
197
- confirmations_count: number;
198
- expires_at?: string | null;
199
- completed_at?: string | null;
200
- /** When this record was created */
201
- created_at: string;
202
- is_completed: boolean;
203
- is_failed: boolean;
204
- is_expired: boolean;
205
- /** Payment description */
206
- description: string;
207
- }
208
- /**
209
- * Payment list item (lighter than detail).
210
- *
211
- * Response model (includes read-only fields).
212
- */
213
- interface PaymentList$1 {
214
- /** Unique identifier for this record */
215
- id: string;
216
- /** Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID) */
217
- internal_payment_id: string;
218
- /** Payment amount in USD */
219
- amount_usd: string;
220
- currency_code: string;
221
- currency_token: string;
222
- /** Current payment status
223
-
224
- * `pending` - Pending
225
- * `confirming` - Confirming
226
- * `confirmed` - Confirmed
227
- * `completed` - Completed
228
- * `partially_paid` - Partially Paid
229
- * `failed` - Failed
230
- * `expired` - Expired
231
- * `cancelled` - Cancelled */
232
- status: PaymentListStatus;
233
- status_display: string;
234
- /** When this record was created */
235
- created_at: string;
236
- /** When this payment was completed */
237
- completed_at?: string | null;
238
- }
239
- /**
240
- * Serializer for creating payment.
241
- *
242
- * Request model (no read-only fields).
243
- */
244
- interface PaymentCreateRequest$1 {
245
- /** Payment amount in USD */
246
- amount_usd: string;
247
- /** Currency code (e.g., USDTTRC20) */
248
- currency_code: string;
249
- /** Optional payment description */
250
- description?: string;
251
- }
252
- /**
253
- * Response for payment creation.
254
- *
255
- * Response model (includes read-only fields).
256
- */
257
- interface PaymentCreateResponse$1 {
258
- success: boolean;
259
- payment: PaymentDetail$1;
260
- qr_code_url: string | null;
261
- }
262
- /**
263
- *
264
- * Response model (includes read-only fields).
265
- */
266
- interface PaginatedWithdrawalListList$1 {
267
- /** Total number of items across all pages */
268
- count: number;
269
- /** Current page number (1-based) */
270
- page: number;
271
- /** Total number of pages */
272
- pages: number;
273
- /** Number of items per page */
274
- page_size: number;
275
- /** Whether there is a next page */
276
- has_next: boolean;
277
- /** Whether there is a previous page */
278
- has_previous: boolean;
279
- /** Next page number (null if no next page) */
280
- next_page?: number | null;
281
- /** Previous page number (null if no previous page) */
282
- previous_page?: number | null;
283
- /** Array of items for current page */
284
- results: Array<WithdrawalList$1>;
285
- }
286
- /**
287
- * Detailed withdrawal information.
288
- *
289
- * Response model (includes read-only fields).
290
- */
291
- interface WithdrawalDetail$1 {
292
- /** Unique identifier for this record */
293
- id: string;
294
- /** Internal withdrawal identifier (WD_YYYYMMDDHHMMSS_UUID) */
295
- internal_withdrawal_id: string;
296
- /** Withdrawal amount in USD (min $10) */
297
- amount_usd: string;
298
- currency_code: string;
299
- currency_name: string;
300
- currency_token: string;
301
- currency_network: string;
302
- /** Destination wallet address */
303
- wallet_address: string;
304
- /** Network transaction fee in USD */
305
- network_fee_usd: string;
306
- /** Service fee in USD */
307
- service_fee_usd: string;
308
- /** Total fee (network + service) in USD */
309
- total_fee_usd: string;
310
- /** Final amount to receive (amount - total_fee) */
311
- final_amount_usd: string;
312
- crypto_amount?: string | null;
313
- /** Withdrawal status
314
-
315
- * `pending` - Pending
316
- * `approved` - Approved
317
- * `processing` - Processing
318
- * `completed` - Completed
319
- * `rejected` - Rejected
320
- * `cancelled` - Cancelled */
321
- status: WithdrawalDetailStatus;
322
- status_display: string;
323
- transaction_hash?: string | null;
324
- /** Get blockchain explorer link. */
325
- explorer_link?: string | null;
326
- /** Admin notes (reason for rejection, etc.) */
327
- admin_notes: string;
328
- /** When this record was created */
329
- created_at: string;
330
- approved_at?: string | null;
331
- completed_at?: string | null;
332
- rejected_at?: string | null;
333
- cancelled_at?: string | null;
334
- }
335
- /**
336
- * Response for withdrawal cancellation.
337
- *
338
- * Response model (includes read-only fields).
339
- */
340
- interface WithdrawalCancelResponse$1 {
341
- success: boolean;
342
- withdrawal: WithdrawalDetail$1;
343
- message: string;
344
- }
345
- /**
346
- * Serializer for creating withdrawal request.
347
- *
348
- * Request model (no read-only fields).
349
- */
350
- interface WithdrawalCreateRequest$1 {
351
- /** Withdrawal amount in USD (min $10) */
352
- amount_usd: string;
353
- /** Currency code (e.g., USDTTRC20) */
354
- currency_code: string;
355
- /** Destination wallet address */
356
- wallet_address: string;
357
- }
358
- /**
359
- * Response for withdrawal creation.
360
- *
361
- * Response model (includes read-only fields).
362
- */
363
- interface WithdrawalCreateResponse$1 {
364
- success: boolean;
365
- withdrawal: WithdrawalDetail$1;
366
- message: string;
367
- }
368
- /**
369
- * Withdrawal list item (lighter than detail).
370
- *
371
- * Response model (includes read-only fields).
372
- */
373
- interface WithdrawalList$1 {
374
- /** Unique identifier for this record */
375
- id: string;
376
- /** Internal withdrawal identifier (WD_YYYYMMDDHHMMSS_UUID) */
377
- internal_withdrawal_id: string;
378
- /** Withdrawal amount in USD (min $10) */
379
- amount_usd: string;
380
- /** Final amount to receive (amount - total_fee) */
381
- final_amount_usd: string;
382
- currency_code: string;
383
- currency_token: string;
384
- /** Withdrawal status
385
-
386
- * `pending` - Pending
387
- * `approved` - Approved
388
- * `processing` - Processing
389
- * `completed` - Completed
390
- * `rejected` - Rejected
391
- * `cancelled` - Cancelled */
392
- status: WithdrawalListStatus;
393
- status_display: string;
394
- /** When this record was created */
395
- created_at: string;
396
- /** When withdrawal was completed */
397
- completed_at?: string | null;
398
- }
399
-
400
- declare namespace models {
401
- export type { Balance$1 as Balance, PaginatedPaymentListList$1 as PaginatedPaymentListList, PaginatedWithdrawalListList$1 as PaginatedWithdrawalListList, PaymentCreateRequest$1 as PaymentCreateRequest, PaymentCreateResponse$1 as PaymentCreateResponse, PaymentDetail$1 as PaymentDetail, PaymentList$1 as PaymentList, WithdrawalCancelResponse$1 as WithdrawalCancelResponse, WithdrawalCreateRequest$1 as WithdrawalCreateRequest, WithdrawalCreateResponse$1 as WithdrawalCreateResponse, WithdrawalDetail$1 as WithdrawalDetail, WithdrawalList$1 as WithdrawalList };
402
- }
403
-
404
- /**
405
- * API endpoints for Payments.
406
- */
407
- declare class ExtPaymentsPayments {
408
- private client;
409
- constructor(client: any);
410
- /**
411
- * Get user balance
412
- *
413
- * Get current user balance and transaction statistics
414
- */
415
- balanceRetrieve(): Promise<Balance$1>;
416
- /**
417
- * Get available currencies
418
- *
419
- * Returns list of available currencies with token+network info, popular
420
- * first
421
- */
422
- currenciesList(): Promise<any>;
423
- currenciesEstimateRetrieve(code: string, amount?: number): Promise<any>;
424
- currenciesEstimateRetrieve(code: string, params?: {
425
- amount?: number;
426
- }): Promise<any>;
427
- currenciesWithdrawalEstimateRetrieve(code: string, amount?: number): Promise<any>;
428
- currenciesWithdrawalEstimateRetrieve(code: string, params?: {
429
- amount?: number;
430
- }): Promise<any>;
431
- paymentsList(page?: number, page_size?: number): Promise<PaginatedPaymentListList$1>;
432
- paymentsList(params?: {
433
- page?: number;
434
- page_size?: number;
435
- }): Promise<PaginatedPaymentListList$1>;
436
- /**
437
- * ViewSet for payment operations. Endpoints: - GET /payments/ - List
438
- * user's payments - GET /payments/{id}/ - Get payment details - POST
439
- * /payments/create/ - Create new payment - GET /payments/{id}/status/ -
440
- * Check payment status - POST /payments/{id}/confirm/ - Confirm payment
441
- */
442
- paymentsRetrieve(id: string): Promise<PaymentDetail$1>;
443
- /**
444
- * POST /api/v1/payments/{id}/confirm/ Confirm payment (user clicked "I
445
- * have paid"). Checks status with provider and creates transaction if
446
- * completed.
447
- */
448
- paymentsConfirmCreate(id: string): Promise<PaymentList$1>;
449
- /**
450
- * GET /api/v1/payments/{id}/status/?refresh=true Check payment status
451
- * (with optional refresh from provider). Query params: - refresh: boolean
452
- * (default: false) - Force refresh from provider
453
- */
454
- paymentsStatusRetrieve(id: string): Promise<PaymentList$1[]>;
455
- /**
456
- * Create payment
457
- *
458
- * Create a new payment with specified amount and currency
459
- */
460
- paymentsCreateCreate(data: PaymentCreateRequest$1): Promise<PaymentCreateResponse$1>;
461
- transactionsList(limit?: number, offset?: number, type?: string): Promise<any>;
462
- transactionsList(params?: {
463
- limit?: number;
464
- offset?: number;
465
- type?: string;
466
- }): Promise<any>;
467
- withdrawalsList(page?: number, page_size?: number): Promise<PaginatedWithdrawalListList$1>;
468
- withdrawalsList(params?: {
469
- page?: number;
470
- page_size?: number;
471
- }): Promise<PaginatedWithdrawalListList$1>;
472
- /**
473
- * ViewSet for withdrawal operations. Endpoints: - GET /withdrawals/ - List
474
- * user's withdrawal requests - GET /withdrawals/{id}/ - Get withdrawal
475
- * details - POST /withdrawals/create/ - Create withdrawal request - POST
476
- * /withdrawals/{id}/cancel/ - Cancel pending withdrawal
477
- */
478
- withdrawalsRetrieve(id: string): Promise<WithdrawalDetail$1>;
479
- /**
480
- * Cancel withdrawal request
481
- *
482
- * Cancel a pending withdrawal request
483
- */
484
- withdrawalsCancelCreate(id: string): Promise<WithdrawalCancelResponse$1>;
485
- /**
486
- * Create withdrawal request
487
- *
488
- * Create a new withdrawal request (requires admin approval)
489
- */
490
- withdrawalsCreateCreate(data: WithdrawalCreateRequest$1): Promise<WithdrawalCreateResponse$1>;
491
- }
492
-
493
13
  /**
494
14
  * HTTP Client Adapter Pattern
495
15
  *
@@ -528,216 +48,6 @@ declare class FetchAdapter implements HttpClientAdapter {
528
48
  request<T = any>(request: HttpRequest): Promise<HttpResponse<T>>;
529
49
  }
530
50
 
531
- /**
532
- * API Logger with Consola
533
- * Beautiful console logging for API requests and responses
534
- *
535
- * Installation:
536
- * npm install consola
537
- */
538
-
539
- /**
540
- * Request log data
541
- */
542
- interface RequestLog {
543
- method: string;
544
- url: string;
545
- headers?: Record<string, string>;
546
- body?: any;
547
- timestamp: number;
548
- }
549
- /**
550
- * Response log data
551
- */
552
- interface ResponseLog {
553
- status: number;
554
- statusText: string;
555
- data?: any;
556
- duration: number;
557
- timestamp: number;
558
- }
559
- /**
560
- * Error log data
561
- */
562
- interface ErrorLog {
563
- message: string;
564
- statusCode?: number;
565
- fieldErrors?: Record<string, string[]>;
566
- duration: number;
567
- timestamp: number;
568
- }
569
- /**
570
- * Logger configuration
571
- */
572
- interface LoggerConfig {
573
- /** Enable logging */
574
- enabled: boolean;
575
- /** Log requests */
576
- logRequests: boolean;
577
- /** Log responses */
578
- logResponses: boolean;
579
- /** Log errors */
580
- logErrors: boolean;
581
- /** Log request/response bodies */
582
- logBodies: boolean;
583
- /** Log headers (excluding sensitive ones) */
584
- logHeaders: boolean;
585
- /** Custom consola instance */
586
- consola?: ConsolaInstance;
587
- }
588
- /**
589
- * API Logger class
590
- */
591
- declare class APILogger {
592
- private config;
593
- private consola;
594
- constructor(config?: Partial<LoggerConfig>);
595
- /**
596
- * Enable logging
597
- */
598
- enable(): void;
599
- /**
600
- * Disable logging
601
- */
602
- disable(): void;
603
- /**
604
- * Update configuration
605
- */
606
- setConfig(config: Partial<LoggerConfig>): void;
607
- /**
608
- * Filter sensitive headers
609
- */
610
- private filterHeaders;
611
- /**
612
- * Log request
613
- */
614
- logRequest(request: RequestLog): void;
615
- /**
616
- * Log response
617
- */
618
- logResponse(request: RequestLog, response: ResponseLog): void;
619
- /**
620
- * Log error
621
- */
622
- logError(request: RequestLog, error: ErrorLog): void;
623
- /**
624
- * Log general info
625
- */
626
- info(message: string, ...args: any[]): void;
627
- /**
628
- * Log warning
629
- */
630
- warn(message: string, ...args: any[]): void;
631
- /**
632
- * Log error
633
- */
634
- error(message: string, ...args: any[]): void;
635
- /**
636
- * Log debug
637
- */
638
- debug(message: string, ...args: any[]): void;
639
- /**
640
- * Log success
641
- */
642
- success(message: string, ...args: any[]): void;
643
- /**
644
- * Create a sub-logger with prefix
645
- */
646
- withTag(tag: string): ConsolaInstance;
647
- }
648
-
649
- /**
650
- * Retry Configuration and Utilities
651
- *
652
- * Provides automatic retry logic for failed HTTP requests using p-retry.
653
- * Retries only on network errors and server errors (5xx), not client errors (4xx).
654
- */
655
- /**
656
- * Information about a failed retry attempt.
657
- */
658
- interface FailedAttemptInfo {
659
- /** The error that caused the failure */
660
- error: Error;
661
- /** The attempt number (1-indexed) */
662
- attemptNumber: number;
663
- /** Number of retries left */
664
- retriesLeft: number;
665
- }
666
- /**
667
- * Retry configuration options.
668
- *
669
- * Uses exponential backoff with jitter by default to avoid thundering herd.
670
- */
671
- interface RetryConfig {
672
- /**
673
- * Maximum number of retry attempts.
674
- * @default 3
675
- */
676
- retries?: number;
677
- /**
678
- * Exponential backoff factor.
679
- * @default 2
680
- */
681
- factor?: number;
682
- /**
683
- * Minimum wait time between retries (ms).
684
- * @default 1000
685
- */
686
- minTimeout?: number;
687
- /**
688
- * Maximum wait time between retries (ms).
689
- * @default 60000
690
- */
691
- maxTimeout?: number;
692
- /**
693
- * Add randomness to wait times (jitter).
694
- * Helps avoid thundering herd problem.
695
- * @default true
696
- */
697
- randomize?: boolean;
698
- /**
699
- * Callback called on each failed attempt.
700
- */
701
- onFailedAttempt?: (info: FailedAttemptInfo) => void;
702
- }
703
- /**
704
- * Default retry configuration.
705
- */
706
- declare const DEFAULT_RETRY_CONFIG: Required<RetryConfig>;
707
- /**
708
- * Determine if an error should trigger a retry.
709
- *
710
- * Retries on:
711
- * - Network errors (connection refused, timeout, etc.)
712
- * - Server errors (5xx status codes)
713
- * - Rate limiting (429 status code)
714
- *
715
- * Does NOT retry on:
716
- * - Client errors (4xx except 429)
717
- * - Authentication errors (401, 403)
718
- * - Not found (404)
719
- *
720
- * @param error - The error to check
721
- * @returns true if should retry, false otherwise
722
- */
723
- declare function shouldRetry(error: any): boolean;
724
- /**
725
- * Wrap a function with retry logic.
726
- *
727
- * @param fn - Async function to retry
728
- * @param config - Retry configuration
729
- * @returns Result of the function
730
- *
731
- * @example
732
- * ```typescript
733
- * const result = await withRetry(
734
- * async () => fetch('https://api.example.com/users'),
735
- * { retries: 5, minTimeout: 2000 }
736
- * );
737
- * ```
738
- */
739
- declare function withRetry<T>(fn: () => Promise<T>, config?: RetryConfig): Promise<T>;
740
-
741
51
  /**
742
52
  * Async API client for Cmdop API.
743
53
  *
@@ -799,477 +109,6 @@ declare class APIClient {
799
109
  private _makeRequest;
800
110
  }
801
111
 
802
- /**
803
- * Storage adapters for cross-platform token storage.
804
- *
805
- * Supports:
806
- * - LocalStorage (browser)
807
- * - Cookies (SSR/browser)
808
- * - Memory (Node.js/Electron/testing)
809
- */
810
-
811
- /**
812
- * Storage adapter interface for cross-platform token storage.
813
- */
814
- interface StorageAdapter {
815
- getItem(key: string): string | null;
816
- setItem(key: string, value: string): void;
817
- removeItem(key: string): void;
818
- }
819
- /**
820
- * LocalStorage adapter with safe try-catch for browser environments.
821
- * Works in modern browsers with localStorage support.
822
- *
823
- * Note: This adapter uses window.localStorage and should only be used in browser/client environments.
824
- * For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead.
825
- */
826
- declare class LocalStorageAdapter implements StorageAdapter {
827
- private logger?;
828
- constructor(logger?: APILogger);
829
- getItem(key: string): string | null;
830
- setItem(key: string, value: string): void;
831
- removeItem(key: string): void;
832
- }
833
- /**
834
- * Cookie-based storage adapter for SSR and browser environments.
835
- * Useful for Next.js, Nuxt.js, and other SSR frameworks.
836
- */
837
- declare class CookieStorageAdapter implements StorageAdapter {
838
- private logger?;
839
- constructor(logger?: APILogger);
840
- getItem(key: string): string | null;
841
- setItem(key: string, value: string): void;
842
- removeItem(key: string): void;
843
- }
844
- /**
845
- * In-memory storage adapter for Node.js, Electron, and testing environments.
846
- * Data is stored in RAM and cleared when process exits.
847
- */
848
- declare class MemoryStorageAdapter implements StorageAdapter {
849
- private storage;
850
- private logger?;
851
- constructor(logger?: APILogger);
852
- getItem(key: string): string | null;
853
- setItem(key: string, value: string): void;
854
- removeItem(key: string): void;
855
- }
856
-
857
- /**
858
- * Zod schema for Balance
859
- *
860
- * This schema provides runtime validation and type inference.
861
- * * User balance serializer.
862
- * */
863
-
864
- /**
865
- * User balance serializer.
866
- */
867
- declare const BalanceSchema: z.ZodObject<{
868
- balance_usd: z.ZodString;
869
- balance_display: z.ZodString;
870
- total_deposited: z.ZodString;
871
- total_withdrawn: z.ZodString;
872
- last_transaction_at: z.ZodNullable<z.ZodString>;
873
- }, z.core.$strip>;
874
- /**
875
- * Infer TypeScript type from Zod schema
876
- */
877
- type Balance = z.infer<typeof BalanceSchema>;
878
-
879
- /**
880
- * Zod schema for Currency
881
- *
882
- * This schema provides runtime validation and type inference.
883
- * * Currency list serializer.
884
- * */
885
-
886
- /**
887
- * Currency list serializer.
888
- */
889
- declare const CurrencySchema: z.ZodObject<{
890
- code: z.ZodString;
891
- name: z.ZodString;
892
- token: z.ZodString;
893
- network: z.ZodNullable<z.ZodString>;
894
- display_name: z.ZodString;
895
- symbol: z.ZodString;
896
- decimal_places: z.ZodInt;
897
- is_active: z.ZodBoolean;
898
- min_amount_usd: z.ZodString;
899
- sort_order: z.ZodInt;
900
- }, z.core.$strip>;
901
- /**
902
- * Infer TypeScript type from Zod schema
903
- */
904
- type Currency = z.infer<typeof CurrencySchema>;
905
-
906
- declare const PaginatedPaymentListListSchema: z.ZodObject<{
907
- count: z.ZodInt;
908
- page: z.ZodInt;
909
- pages: z.ZodInt;
910
- page_size: z.ZodInt;
911
- has_next: z.ZodBoolean;
912
- has_previous: z.ZodBoolean;
913
- next_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
914
- previous_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
915
- results: z.ZodArray<z.ZodObject<{
916
- id: z.ZodString;
917
- internal_payment_id: z.ZodString;
918
- amount_usd: z.ZodString;
919
- currency_code: z.ZodString;
920
- currency_token: z.ZodString;
921
- status: z.ZodEnum<typeof PaymentListStatus>;
922
- status_display: z.ZodString;
923
- created_at: z.ZodString;
924
- completed_at: z.ZodNullable<z.ZodString>;
925
- }, z.core.$strip>>;
926
- }, z.core.$strip>;
927
- /**
928
- * Infer TypeScript type from Zod schema
929
- */
930
- type PaginatedPaymentListList = z.infer<typeof PaginatedPaymentListListSchema>;
931
-
932
- declare const PaginatedWithdrawalListListSchema: z.ZodObject<{
933
- count: z.ZodInt;
934
- page: z.ZodInt;
935
- pages: z.ZodInt;
936
- page_size: z.ZodInt;
937
- has_next: z.ZodBoolean;
938
- has_previous: z.ZodBoolean;
939
- next_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
940
- previous_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
941
- results: z.ZodArray<z.ZodObject<{
942
- id: z.ZodString;
943
- internal_withdrawal_id: z.ZodString;
944
- amount_usd: z.ZodString;
945
- final_amount_usd: z.ZodString;
946
- currency_code: z.ZodString;
947
- currency_token: z.ZodString;
948
- status: z.ZodEnum<typeof WithdrawalListStatus>;
949
- status_display: z.ZodString;
950
- created_at: z.ZodString;
951
- completed_at: z.ZodNullable<z.ZodString>;
952
- }, z.core.$strip>>;
953
- }, z.core.$strip>;
954
- /**
955
- * Infer TypeScript type from Zod schema
956
- */
957
- type PaginatedWithdrawalListList = z.infer<typeof PaginatedWithdrawalListListSchema>;
958
-
959
- /**
960
- * Zod schema for PaymentCreateRequest
961
- *
962
- * This schema provides runtime validation and type inference.
963
- * * Serializer for creating payment.
964
- * */
965
-
966
- /**
967
- * Serializer for creating payment.
968
- */
969
- declare const PaymentCreateRequestSchema: z.ZodObject<{
970
- amount_usd: z.ZodString;
971
- currency_code: z.ZodString;
972
- description: z.ZodOptional<z.ZodString>;
973
- }, z.core.$strip>;
974
- /**
975
- * Infer TypeScript type from Zod schema
976
- */
977
- type PaymentCreateRequest = z.infer<typeof PaymentCreateRequestSchema>;
978
-
979
- /**
980
- * Response for payment creation.
981
- */
982
- declare const PaymentCreateResponseSchema: z.ZodObject<{
983
- success: z.ZodBoolean;
984
- payment: z.ZodObject<{
985
- id: z.ZodString;
986
- internal_payment_id: z.ZodString;
987
- amount_usd: z.ZodString;
988
- currency_code: z.ZodString;
989
- currency_name: z.ZodString;
990
- currency_token: z.ZodString;
991
- currency_network: z.ZodString;
992
- pay_amount: z.ZodNullable<z.ZodString>;
993
- actual_amount: z.ZodNullable<z.ZodString>;
994
- actual_amount_usd: z.ZodNullable<z.ZodString>;
995
- status: z.ZodEnum<typeof PaymentDetailStatus>;
996
- status_display: z.ZodString;
997
- pay_address: z.ZodNullable<z.ZodString>;
998
- qr_code_url: z.ZodNullable<z.ZodString>;
999
- payment_url: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
1000
- transaction_hash: z.ZodNullable<z.ZodString>;
1001
- explorer_link: z.ZodNullable<z.ZodString>;
1002
- confirmations_count: z.ZodInt;
1003
- expires_at: z.ZodNullable<z.ZodString>;
1004
- completed_at: z.ZodNullable<z.ZodString>;
1005
- created_at: z.ZodString;
1006
- is_completed: z.ZodBoolean;
1007
- is_failed: z.ZodBoolean;
1008
- is_expired: z.ZodBoolean;
1009
- description: z.ZodString;
1010
- }, z.core.$strip>;
1011
- qr_code_url: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
1012
- }, z.core.$strip>;
1013
- /**
1014
- * Infer TypeScript type from Zod schema
1015
- */
1016
- type PaymentCreateResponse = z.infer<typeof PaymentCreateResponseSchema>;
1017
-
1018
- /**
1019
- * Zod schema for PaymentDetail
1020
- *
1021
- * This schema provides runtime validation and type inference.
1022
- * * Detailed payment information.
1023
- * */
1024
-
1025
- /**
1026
- * Detailed payment information.
1027
- */
1028
- declare const PaymentDetailSchema: z.ZodObject<{
1029
- id: z.ZodString;
1030
- internal_payment_id: z.ZodString;
1031
- amount_usd: z.ZodString;
1032
- currency_code: z.ZodString;
1033
- currency_name: z.ZodString;
1034
- currency_token: z.ZodString;
1035
- currency_network: z.ZodString;
1036
- pay_amount: z.ZodNullable<z.ZodString>;
1037
- actual_amount: z.ZodNullable<z.ZodString>;
1038
- actual_amount_usd: z.ZodNullable<z.ZodString>;
1039
- status: z.ZodEnum<typeof PaymentDetailStatus>;
1040
- status_display: z.ZodString;
1041
- pay_address: z.ZodNullable<z.ZodString>;
1042
- qr_code_url: z.ZodNullable<z.ZodString>;
1043
- payment_url: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
1044
- transaction_hash: z.ZodNullable<z.ZodString>;
1045
- explorer_link: z.ZodNullable<z.ZodString>;
1046
- confirmations_count: z.ZodInt;
1047
- expires_at: z.ZodNullable<z.ZodString>;
1048
- completed_at: z.ZodNullable<z.ZodString>;
1049
- created_at: z.ZodString;
1050
- is_completed: z.ZodBoolean;
1051
- is_failed: z.ZodBoolean;
1052
- is_expired: z.ZodBoolean;
1053
- description: z.ZodString;
1054
- }, z.core.$strip>;
1055
- /**
1056
- * Infer TypeScript type from Zod schema
1057
- */
1058
- type PaymentDetail = z.infer<typeof PaymentDetailSchema>;
1059
-
1060
- /**
1061
- * Zod schema for PaymentList
1062
- *
1063
- * This schema provides runtime validation and type inference.
1064
- * * Payment list item (lighter than detail).
1065
- * */
1066
-
1067
- /**
1068
- * Payment list item (lighter than detail).
1069
- */
1070
- declare const PaymentListSchema: z.ZodObject<{
1071
- id: z.ZodString;
1072
- internal_payment_id: z.ZodString;
1073
- amount_usd: z.ZodString;
1074
- currency_code: z.ZodString;
1075
- currency_token: z.ZodString;
1076
- status: z.ZodEnum<typeof PaymentListStatus>;
1077
- status_display: z.ZodString;
1078
- created_at: z.ZodString;
1079
- completed_at: z.ZodNullable<z.ZodString>;
1080
- }, z.core.$strip>;
1081
- /**
1082
- * Infer TypeScript type from Zod schema
1083
- */
1084
- type PaymentList = z.infer<typeof PaymentListSchema>;
1085
-
1086
- /**
1087
- * Zod schema for Transaction
1088
- *
1089
- * This schema provides runtime validation and type inference.
1090
- * * Transaction serializer.
1091
- * */
1092
-
1093
- /**
1094
- * Transaction serializer.
1095
- */
1096
- declare const TransactionSchema: z.ZodObject<{
1097
- id: z.ZodString;
1098
- transaction_type: z.ZodEnum<typeof TransactionTransactionType>;
1099
- type_display: z.ZodString;
1100
- amount_usd: z.ZodString;
1101
- amount_display: z.ZodString;
1102
- balance_after: z.ZodString;
1103
- payment_id: z.ZodNullable<z.ZodString>;
1104
- description: z.ZodString;
1105
- created_at: z.ZodString;
1106
- }, z.core.$strip>;
1107
- /**
1108
- * Infer TypeScript type from Zod schema
1109
- */
1110
- type Transaction = z.infer<typeof TransactionSchema>;
1111
-
1112
- /**
1113
- * Response for withdrawal cancellation.
1114
- */
1115
- declare const WithdrawalCancelResponseSchema: z.ZodObject<{
1116
- success: z.ZodBoolean;
1117
- withdrawal: z.ZodObject<{
1118
- id: z.ZodString;
1119
- internal_withdrawal_id: z.ZodString;
1120
- amount_usd: z.ZodString;
1121
- currency_code: z.ZodString;
1122
- currency_name: z.ZodString;
1123
- currency_token: z.ZodString;
1124
- currency_network: z.ZodString;
1125
- wallet_address: z.ZodString;
1126
- network_fee_usd: z.ZodString;
1127
- service_fee_usd: z.ZodString;
1128
- total_fee_usd: z.ZodString;
1129
- final_amount_usd: z.ZodString;
1130
- crypto_amount: z.ZodNullable<z.ZodString>;
1131
- status: z.ZodEnum<typeof WithdrawalDetailStatus>;
1132
- status_display: z.ZodString;
1133
- transaction_hash: z.ZodNullable<z.ZodString>;
1134
- explorer_link: z.ZodNullable<z.ZodString>;
1135
- admin_notes: z.ZodString;
1136
- created_at: z.ZodString;
1137
- approved_at: z.ZodNullable<z.ZodString>;
1138
- completed_at: z.ZodNullable<z.ZodString>;
1139
- rejected_at: z.ZodNullable<z.ZodString>;
1140
- cancelled_at: z.ZodNullable<z.ZodString>;
1141
- }, z.core.$strip>;
1142
- message: z.ZodString;
1143
- }, z.core.$strip>;
1144
- /**
1145
- * Infer TypeScript type from Zod schema
1146
- */
1147
- type WithdrawalCancelResponse = z.infer<typeof WithdrawalCancelResponseSchema>;
1148
-
1149
- /**
1150
- * Zod schema for WithdrawalCreateRequest
1151
- *
1152
- * This schema provides runtime validation and type inference.
1153
- * * Serializer for creating withdrawal request.
1154
- * */
1155
-
1156
- /**
1157
- * Serializer for creating withdrawal request.
1158
- */
1159
- declare const WithdrawalCreateRequestSchema: z.ZodObject<{
1160
- amount_usd: z.ZodString;
1161
- currency_code: z.ZodString;
1162
- wallet_address: z.ZodString;
1163
- }, z.core.$strip>;
1164
- /**
1165
- * Infer TypeScript type from Zod schema
1166
- */
1167
- type WithdrawalCreateRequest = z.infer<typeof WithdrawalCreateRequestSchema>;
1168
-
1169
- /**
1170
- * Response for withdrawal creation.
1171
- */
1172
- declare const WithdrawalCreateResponseSchema: z.ZodObject<{
1173
- success: z.ZodBoolean;
1174
- withdrawal: z.ZodObject<{
1175
- id: z.ZodString;
1176
- internal_withdrawal_id: z.ZodString;
1177
- amount_usd: z.ZodString;
1178
- currency_code: z.ZodString;
1179
- currency_name: z.ZodString;
1180
- currency_token: z.ZodString;
1181
- currency_network: z.ZodString;
1182
- wallet_address: z.ZodString;
1183
- network_fee_usd: z.ZodString;
1184
- service_fee_usd: z.ZodString;
1185
- total_fee_usd: z.ZodString;
1186
- final_amount_usd: z.ZodString;
1187
- crypto_amount: z.ZodNullable<z.ZodString>;
1188
- status: z.ZodEnum<typeof WithdrawalDetailStatus>;
1189
- status_display: z.ZodString;
1190
- transaction_hash: z.ZodNullable<z.ZodString>;
1191
- explorer_link: z.ZodNullable<z.ZodString>;
1192
- admin_notes: z.ZodString;
1193
- created_at: z.ZodString;
1194
- approved_at: z.ZodNullable<z.ZodString>;
1195
- completed_at: z.ZodNullable<z.ZodString>;
1196
- rejected_at: z.ZodNullable<z.ZodString>;
1197
- cancelled_at: z.ZodNullable<z.ZodString>;
1198
- }, z.core.$strip>;
1199
- message: z.ZodString;
1200
- }, z.core.$strip>;
1201
- /**
1202
- * Infer TypeScript type from Zod schema
1203
- */
1204
- type WithdrawalCreateResponse = z.infer<typeof WithdrawalCreateResponseSchema>;
1205
-
1206
- /**
1207
- * Zod schema for WithdrawalDetail
1208
- *
1209
- * This schema provides runtime validation and type inference.
1210
- * * Detailed withdrawal information.
1211
- * */
1212
-
1213
- /**
1214
- * Detailed withdrawal information.
1215
- */
1216
- declare const WithdrawalDetailSchema: z.ZodObject<{
1217
- id: z.ZodString;
1218
- internal_withdrawal_id: z.ZodString;
1219
- amount_usd: z.ZodString;
1220
- currency_code: z.ZodString;
1221
- currency_name: z.ZodString;
1222
- currency_token: z.ZodString;
1223
- currency_network: z.ZodString;
1224
- wallet_address: z.ZodString;
1225
- network_fee_usd: z.ZodString;
1226
- service_fee_usd: z.ZodString;
1227
- total_fee_usd: z.ZodString;
1228
- final_amount_usd: z.ZodString;
1229
- crypto_amount: z.ZodNullable<z.ZodString>;
1230
- status: z.ZodEnum<typeof WithdrawalDetailStatus>;
1231
- status_display: z.ZodString;
1232
- transaction_hash: z.ZodNullable<z.ZodString>;
1233
- explorer_link: z.ZodNullable<z.ZodString>;
1234
- admin_notes: z.ZodString;
1235
- created_at: z.ZodString;
1236
- approved_at: z.ZodNullable<z.ZodString>;
1237
- completed_at: z.ZodNullable<z.ZodString>;
1238
- rejected_at: z.ZodNullable<z.ZodString>;
1239
- cancelled_at: z.ZodNullable<z.ZodString>;
1240
- }, z.core.$strip>;
1241
- /**
1242
- * Infer TypeScript type from Zod schema
1243
- */
1244
- type WithdrawalDetail = z.infer<typeof WithdrawalDetailSchema>;
1245
-
1246
- /**
1247
- * Zod schema for WithdrawalList
1248
- *
1249
- * This schema provides runtime validation and type inference.
1250
- * * Withdrawal list item (lighter than detail).
1251
- * */
1252
-
1253
- /**
1254
- * Withdrawal list item (lighter than detail).
1255
- */
1256
- declare const WithdrawalListSchema: z.ZodObject<{
1257
- id: z.ZodString;
1258
- internal_withdrawal_id: z.ZodString;
1259
- amount_usd: z.ZodString;
1260
- final_amount_usd: z.ZodString;
1261
- currency_code: z.ZodString;
1262
- currency_token: z.ZodString;
1263
- status: z.ZodEnum<typeof WithdrawalListStatus>;
1264
- status_display: z.ZodString;
1265
- created_at: z.ZodString;
1266
- completed_at: z.ZodNullable<z.ZodString>;
1267
- }, z.core.$strip>;
1268
- /**
1269
- * Infer TypeScript type from Zod schema
1270
- */
1271
- type WithdrawalList = z.infer<typeof WithdrawalListSchema>;
1272
-
1273
112
  /**
1274
113
  * Zod Schemas - Runtime validation and type inference
1275
114
  *
@@ -1288,36 +127,36 @@ type WithdrawalList = z.infer<typeof WithdrawalListSchema>;
1288
127
  * ```
1289
128
  */
1290
129
 
1291
- type index$1_Balance = Balance;
130
+ declare const index$1_Balance: typeof Balance;
1292
131
  declare const index$1_BalanceSchema: typeof BalanceSchema;
1293
- type index$1_Currency = Currency;
132
+ declare const index$1_Currency: typeof Currency;
1294
133
  declare const index$1_CurrencySchema: typeof CurrencySchema;
1295
- type index$1_PaginatedPaymentListList = PaginatedPaymentListList;
134
+ declare const index$1_PaginatedPaymentListList: typeof PaginatedPaymentListList;
1296
135
  declare const index$1_PaginatedPaymentListListSchema: typeof PaginatedPaymentListListSchema;
1297
- type index$1_PaginatedWithdrawalListList = PaginatedWithdrawalListList;
136
+ declare const index$1_PaginatedWithdrawalListList: typeof PaginatedWithdrawalListList;
1298
137
  declare const index$1_PaginatedWithdrawalListListSchema: typeof PaginatedWithdrawalListListSchema;
1299
- type index$1_PaymentCreateRequest = PaymentCreateRequest;
138
+ declare const index$1_PaymentCreateRequest: typeof PaymentCreateRequest;
1300
139
  declare const index$1_PaymentCreateRequestSchema: typeof PaymentCreateRequestSchema;
1301
- type index$1_PaymentCreateResponse = PaymentCreateResponse;
140
+ declare const index$1_PaymentCreateResponse: typeof PaymentCreateResponse;
1302
141
  declare const index$1_PaymentCreateResponseSchema: typeof PaymentCreateResponseSchema;
1303
- type index$1_PaymentDetail = PaymentDetail;
142
+ declare const index$1_PaymentDetail: typeof PaymentDetail;
1304
143
  declare const index$1_PaymentDetailSchema: typeof PaymentDetailSchema;
1305
- type index$1_PaymentList = PaymentList;
144
+ declare const index$1_PaymentList: typeof PaymentList;
1306
145
  declare const index$1_PaymentListSchema: typeof PaymentListSchema;
1307
- type index$1_Transaction = Transaction;
146
+ declare const index$1_Transaction: typeof Transaction;
1308
147
  declare const index$1_TransactionSchema: typeof TransactionSchema;
1309
- type index$1_WithdrawalCancelResponse = WithdrawalCancelResponse;
148
+ declare const index$1_WithdrawalCancelResponse: typeof WithdrawalCancelResponse;
1310
149
  declare const index$1_WithdrawalCancelResponseSchema: typeof WithdrawalCancelResponseSchema;
1311
- type index$1_WithdrawalCreateRequest = WithdrawalCreateRequest;
150
+ declare const index$1_WithdrawalCreateRequest: typeof WithdrawalCreateRequest;
1312
151
  declare const index$1_WithdrawalCreateRequestSchema: typeof WithdrawalCreateRequestSchema;
1313
- type index$1_WithdrawalCreateResponse = WithdrawalCreateResponse;
152
+ declare const index$1_WithdrawalCreateResponse: typeof WithdrawalCreateResponse;
1314
153
  declare const index$1_WithdrawalCreateResponseSchema: typeof WithdrawalCreateResponseSchema;
1315
- type index$1_WithdrawalDetail = WithdrawalDetail;
154
+ declare const index$1_WithdrawalDetail: typeof WithdrawalDetail;
1316
155
  declare const index$1_WithdrawalDetailSchema: typeof WithdrawalDetailSchema;
1317
- type index$1_WithdrawalList = WithdrawalList;
156
+ declare const index$1_WithdrawalList: typeof WithdrawalList;
1318
157
  declare const index$1_WithdrawalListSchema: typeof WithdrawalListSchema;
1319
158
  declare namespace index$1 {
1320
- 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_PaginatedWithdrawalListList as PaginatedWithdrawalListList, index$1_PaginatedWithdrawalListListSchema as PaginatedWithdrawalListListSchema, type index$1_PaymentCreateRequest as PaymentCreateRequest, index$1_PaymentCreateRequestSchema as PaymentCreateRequestSchema, type index$1_PaymentCreateResponse as PaymentCreateResponse, index$1_PaymentCreateResponseSchema as PaymentCreateResponseSchema, 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, type index$1_WithdrawalCancelResponse as WithdrawalCancelResponse, index$1_WithdrawalCancelResponseSchema as WithdrawalCancelResponseSchema, type index$1_WithdrawalCreateRequest as WithdrawalCreateRequest, index$1_WithdrawalCreateRequestSchema as WithdrawalCreateRequestSchema, type index$1_WithdrawalCreateResponse as WithdrawalCreateResponse, index$1_WithdrawalCreateResponseSchema as WithdrawalCreateResponseSchema, type index$1_WithdrawalDetail as WithdrawalDetail, index$1_WithdrawalDetailSchema as WithdrawalDetailSchema, type index$1_WithdrawalList as WithdrawalList, index$1_WithdrawalListSchema as WithdrawalListSchema };
159
+ export { index$1_Balance as Balance, index$1_BalanceSchema as BalanceSchema, index$1_Currency as Currency, index$1_CurrencySchema as CurrencySchema, index$1_PaginatedPaymentListList as PaginatedPaymentListList, index$1_PaginatedPaymentListListSchema as PaginatedPaymentListListSchema, index$1_PaginatedWithdrawalListList as PaginatedWithdrawalListList, index$1_PaginatedWithdrawalListListSchema as PaginatedWithdrawalListListSchema, index$1_PaymentCreateRequest as PaymentCreateRequest, index$1_PaymentCreateRequestSchema as PaymentCreateRequestSchema, index$1_PaymentCreateResponse as PaymentCreateResponse, index$1_PaymentCreateResponseSchema as PaymentCreateResponseSchema, index$1_PaymentDetail as PaymentDetail, index$1_PaymentDetailSchema as PaymentDetailSchema, index$1_PaymentList as PaymentList, index$1_PaymentListSchema as PaymentListSchema, index$1_Transaction as Transaction, index$1_TransactionSchema as TransactionSchema, index$1_WithdrawalCancelResponse as WithdrawalCancelResponse, index$1_WithdrawalCancelResponseSchema as WithdrawalCancelResponseSchema, index$1_WithdrawalCreateRequest as WithdrawalCreateRequest, index$1_WithdrawalCreateRequestSchema as WithdrawalCreateRequestSchema, index$1_WithdrawalCreateResponse as WithdrawalCreateResponse, index$1_WithdrawalCreateResponseSchema as WithdrawalCreateResponseSchema, index$1_WithdrawalDetail as WithdrawalDetail, index$1_WithdrawalDetailSchema as WithdrawalDetailSchema, index$1_WithdrawalList as WithdrawalList, index$1_WithdrawalListSchema as WithdrawalListSchema };
1321
160
  }
1322
161
 
1323
162
  /**
@@ -1393,119 +232,6 @@ declare function onValidationError(callback: (detail: ValidationErrorDetail) =>
1393
232
  */
1394
233
  declare function formatZodError(error: ZodError): string;
1395
234
 
1396
- /**
1397
- * Get user balance
1398
- *
1399
- * @method GET
1400
- * @path /cfg/payments/balance/
1401
- */
1402
- declare function getPaymentsBalanceRetrieve(client?: any): Promise<Balance>;
1403
- /**
1404
- * Get available currencies
1405
- *
1406
- * @method GET
1407
- * @path /cfg/payments/currencies/
1408
- */
1409
- declare function getPaymentsCurrenciesList(client?: any): Promise<any>;
1410
- /**
1411
- * Get currency estimate
1412
- *
1413
- * @method GET
1414
- * @path /cfg/payments/currencies/{code}/estimate/
1415
- */
1416
- declare function getPaymentsCurrenciesEstimateRetrieve(code: string, params?: {
1417
- amount?: number;
1418
- }, client?: any): Promise<any>;
1419
- /**
1420
- * Get withdrawal estimate
1421
- *
1422
- * @method GET
1423
- * @path /cfg/payments/currencies/{code}/withdrawal-estimate/
1424
- */
1425
- declare function getPaymentsCurrenciesWithdrawalEstimateRetrieve(code: string, params?: {
1426
- amount?: number;
1427
- }, client?: any): Promise<any>;
1428
- /**
1429
- * API operation
1430
- *
1431
- * @method GET
1432
- * @path /cfg/payments/payments/
1433
- */
1434
- declare function getPaymentsPaymentsList(params?: {
1435
- page?: number;
1436
- page_size?: number;
1437
- }, client?: any): Promise<PaginatedPaymentListList>;
1438
- /**
1439
- * API operation
1440
- *
1441
- * @method GET
1442
- * @path /cfg/payments/payments/{id}/
1443
- */
1444
- declare function getPaymentsPaymentsRetrieve(id: string, client?: any): Promise<PaymentDetail>;
1445
- /**
1446
- * API operation
1447
- *
1448
- * @method POST
1449
- * @path /cfg/payments/payments/{id}/confirm/
1450
- */
1451
- declare function createPaymentsPaymentsConfirmCreate(id: string, client?: any): Promise<PaymentList>;
1452
- /**
1453
- * API operation
1454
- *
1455
- * @method GET
1456
- * @path /cfg/payments/payments/{id}/status/
1457
- */
1458
- declare function getPaymentsPaymentsStatusRetrieve(id: string, client?: any): Promise<PaymentList>;
1459
- /**
1460
- * Create payment
1461
- *
1462
- * @method POST
1463
- * @path /cfg/payments/payments/create/
1464
- */
1465
- declare function createPaymentsPaymentsCreateCreate(data: PaymentCreateRequest, client?: any): Promise<PaymentCreateResponse>;
1466
- /**
1467
- * Get user transactions
1468
- *
1469
- * @method GET
1470
- * @path /cfg/payments/transactions/
1471
- */
1472
- declare function getPaymentsTransactionsList(params?: {
1473
- limit?: number;
1474
- offset?: number;
1475
- type?: string;
1476
- }, client?: any): Promise<any>;
1477
- /**
1478
- * API operation
1479
- *
1480
- * @method GET
1481
- * @path /cfg/payments/withdrawals/
1482
- */
1483
- declare function getPaymentsWithdrawalsList(params?: {
1484
- page?: number;
1485
- page_size?: number;
1486
- }, client?: any): Promise<PaginatedWithdrawalListList>;
1487
- /**
1488
- * API operation
1489
- *
1490
- * @method GET
1491
- * @path /cfg/payments/withdrawals/{id}/
1492
- */
1493
- declare function getPaymentsWithdrawalsRetrieve(id: string, client?: any): Promise<WithdrawalDetail>;
1494
- /**
1495
- * Cancel withdrawal request
1496
- *
1497
- * @method POST
1498
- * @path /cfg/payments/withdrawals/{id}/cancel/
1499
- */
1500
- declare function createPaymentsWithdrawalsCancelCreate(id: string, client?: any): Promise<WithdrawalCancelResponse>;
1501
- /**
1502
- * Create withdrawal request
1503
- *
1504
- * @method POST
1505
- * @path /cfg/payments/withdrawals/create/
1506
- */
1507
- declare function createPaymentsWithdrawalsCreateCreate(data: WithdrawalCreateRequest, client?: any): Promise<WithdrawalCreateResponse>;
1508
-
1509
235
  /**
1510
236
  * Typed Fetchers - Universal API functions
1511
237
  *
@@ -1701,116 +427,6 @@ declare class NetworkError extends Error {
1701
427
  constructor(message: string, url: string, originalError?: Error);
1702
428
  }
1703
429
 
1704
- /**
1705
- * Cmdop API - API Client with JWT Management
1706
- *
1707
- * Usage:
1708
- * ```typescript
1709
- * import { API } from './api';
1710
- *
1711
- * const api = new API('https://api.example.com');
1712
- *
1713
- * // Set JWT token
1714
- * api.setToken('your-jwt-token', 'refresh-token');
1715
- *
1716
- * // Use API
1717
- * const posts = await api.posts.list();
1718
- * const user = await api.users.retrieve(1);
1719
- *
1720
- * // Check authentication
1721
- * if (api.isAuthenticated()) {
1722
- * // ...
1723
- * }
1724
- *
1725
- * // Custom storage with logging (for Electron/Node.js)
1726
- * import { MemoryStorageAdapter, APILogger } from './storage';
1727
- * const logger = new APILogger({ enabled: true, logLevel: 'debug' });
1728
- * const api = new API('https://api.example.com', {
1729
- * storage: new MemoryStorageAdapter(logger),
1730
- * loggerConfig: { enabled: true, logLevel: 'debug' }
1731
- * });
1732
- *
1733
- * // Get OpenAPI schema
1734
- * const schema = api.getSchema();
1735
- * ```
1736
- */
1737
-
1738
- declare const TOKEN_KEY = "auth_token";
1739
- declare const REFRESH_TOKEN_KEY = "refresh_token";
1740
- interface APIOptions {
1741
- /** Custom storage adapter (defaults to LocalStorageAdapter) */
1742
- storage?: StorageAdapter;
1743
- /** Retry configuration for failed requests */
1744
- retryConfig?: RetryConfig;
1745
- /** Logger configuration */
1746
- loggerConfig?: Partial<LoggerConfig>;
1747
- }
1748
- declare class API {
1749
- private baseUrl;
1750
- private _client;
1751
- private _token;
1752
- private _refreshToken;
1753
- private storage;
1754
- private options?;
1755
- ext_payments_payments: ExtPaymentsPayments;
1756
- constructor(baseUrl: string, options?: APIOptions);
1757
- private _loadTokensFromStorage;
1758
- private _reinitClients;
1759
- private _injectAuthHeader;
1760
- /**
1761
- * Get current JWT token
1762
- */
1763
- getToken(): string | null;
1764
- /**
1765
- * Get current refresh token
1766
- */
1767
- getRefreshToken(): string | null;
1768
- /**
1769
- * Set JWT token and refresh token
1770
- * @param token - JWT access token
1771
- * @param refreshToken - JWT refresh token (optional)
1772
- */
1773
- setToken(token: string, refreshToken?: string): void;
1774
- /**
1775
- * Clear all tokens
1776
- */
1777
- clearTokens(): void;
1778
- /**
1779
- * Check if user is authenticated
1780
- */
1781
- isAuthenticated(): boolean;
1782
- /**
1783
- * Update base URL and reinitialize clients
1784
- * @param url - New base URL
1785
- */
1786
- setBaseUrl(url: string): void;
1787
- /**
1788
- * Get current base URL
1789
- */
1790
- getBaseUrl(): string;
1791
- /**
1792
- * Get OpenAPI schema path
1793
- * @returns Path to the OpenAPI schema JSON file
1794
- *
1795
- * Note: The OpenAPI schema is available in the schema.json file.
1796
- * You can load it dynamically using:
1797
- * ```typescript
1798
- * const schema = await fetch('./schema.json').then(r => r.json());
1799
- * // or using fs in Node.js:
1800
- * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
1801
- * ```
1802
- */
1803
- getSchemaPath(): string;
1804
- }
1805
-
1806
- /**
1807
- * Payments Extension API
1808
- *
1809
- * Pre-configured API instance with shared authentication
1810
- */
1811
-
1812
- declare const apiPayments: API;
1813
-
1814
430
  /**
1815
431
  * Balance Hero (Apple-style)
1816
432
  *
@@ -1898,4 +514,4 @@ declare function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }: Pa
1898
514
  */
1899
515
  declare const extensionConfig: _djangocfg_ext_base.ExtensionMetadata;
1900
516
 
1901
- export { API, APIClient, APIError, APILogger, type APIOptions, ActivityItem, ActivityList, AddFundsSheet, type Balance, BalanceHero, 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, type PaginatedPaymentListList, PaginatedPaymentListListSchema, type PaginatedWithdrawalListList, PaginatedWithdrawalListListSchema, type PaymentCreateRequest, PaymentCreateRequestSchema, type PaymentCreateResponse, PaymentCreateResponseSchema, type PaymentDetail, PaymentDetailSchema, type PaymentList, PaymentListSchema, PaymentSheet, REFRESH_TOKEN_KEY, type RequestLog, type ResponseLog, type RetryConfig, index$1 as Schemas, type StorageAdapter, TOKEN_KEY, type Transaction, TransactionSchema, type ValidationErrorDetail, type ValidationErrorEvent, WalletPage, WithdrawSheet, type WithdrawalCancelResponse, WithdrawalCancelResponseSchema, type WithdrawalCreateRequest, WithdrawalCreateRequestSchema, type WithdrawalCreateResponse, WithdrawalCreateResponseSchema, type WithdrawalDetail, WithdrawalDetailSchema, type WithdrawalList, WithdrawalListSchema, WithdrawalSheet, apiPayments, clearAPITokens, configureAPI, createPaymentsPaymentsConfirmCreate, createPaymentsPaymentsCreateCreate, createPaymentsWithdrawalsCancelCreate, createPaymentsWithdrawalsCreateCreate, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getPaymentsBalanceRetrieve, getPaymentsCurrenciesEstimateRetrieve, getPaymentsCurrenciesList, getPaymentsCurrenciesWithdrawalEstimateRetrieve, getPaymentsPaymentsList, getPaymentsPaymentsRetrieve, getPaymentsPaymentsStatusRetrieve, getPaymentsTransactionsList, getPaymentsWithdrawalsList, getPaymentsWithdrawalsRetrieve, isAPIConfigured, onValidationError, reconfigureAPI, resetAPI, shouldRetry, withRetry };
517
+ export { API, APIClient, APIError, APIOptions, ActivityItem, ActivityList, AddFundsSheet, Balance, BalanceHero, BalanceSchema, Currency, CurrencySchema, FetchAdapter, index as Fetchers, type HttpClientAdapter, type HttpRequest, type HttpResponse, LoggerConfig, NetworkError, PaginatedPaymentListList, PaginatedPaymentListListSchema, PaginatedWithdrawalListList, PaginatedWithdrawalListListSchema, PaymentCreateRequest, PaymentCreateRequestSchema, PaymentCreateResponse, PaymentCreateResponseSchema, PaymentDetail, PaymentDetailSchema, PaymentList, PaymentListSchema, PaymentSheet, RetryConfig, index$1 as Schemas, Transaction, TransactionSchema, type ValidationErrorDetail, type ValidationErrorEvent, WalletPage, WithdrawSheet, WithdrawalCancelResponse, WithdrawalCancelResponseSchema, WithdrawalCreateRequest, WithdrawalCreateRequestSchema, WithdrawalCreateResponse, WithdrawalCreateResponseSchema, WithdrawalDetail, WithdrawalDetailSchema, WithdrawalList, WithdrawalListSchema, WithdrawalSheet, clearAPITokens, configureAPI, createPaymentsPaymentsConfirmCreate, createPaymentsPaymentsCreateCreate, createPaymentsWithdrawalsCancelCreate, createPaymentsWithdrawalsCreateCreate, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getPaymentsBalanceRetrieve, getPaymentsCurrenciesEstimateRetrieve, getPaymentsCurrenciesList, getPaymentsCurrenciesWithdrawalEstimateRetrieve, getPaymentsPaymentsList, getPaymentsPaymentsRetrieve, getPaymentsPaymentsStatusRetrieve, getPaymentsTransactionsList, getPaymentsWithdrawalsList, getPaymentsWithdrawalsRetrieve, isAPIConfigured, onValidationError, reconfigureAPI, resetAPI };