@djangocfg/ext-payments 1.0.13 → 1.0.17
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/config.cjs +5 -8
- package/dist/config.js +5 -8
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.cjs +1085 -1107
- package/dist/index.d.cts +480 -41
- package/dist/index.d.ts +480 -41
- package/dist/index.js +1037 -1093
- package/package.json +13 -16
- package/src/api/generated/ext_payments/CLAUDE.md +7 -3
- package/src/api/generated/ext_payments/_utils/fetchers/ext_payments__payments.ts +237 -5
- package/src/api/generated/ext_payments/_utils/hooks/ext_payments__payments.ts +71 -3
- package/src/api/generated/ext_payments/_utils/schemas/PaginatedWithdrawalListList.schema.ts +24 -0
- package/src/api/generated/ext_payments/_utils/schemas/PaymentCreateRequest.schema.ts +21 -0
- package/src/api/generated/ext_payments/_utils/schemas/WithdrawalCreateRequest.schema.ts +21 -0
- package/src/api/generated/ext_payments/_utils/schemas/WithdrawalDetail.schema.ts +42 -0
- package/src/api/generated/ext_payments/_utils/schemas/WithdrawalList.schema.ts +29 -0
- package/src/api/generated/ext_payments/_utils/schemas/index.ts +5 -0
- package/src/api/generated/ext_payments/enums.ts +36 -0
- package/src/api/generated/ext_payments/ext_payments__payments/client.ts +58 -5
- package/src/api/generated/ext_payments/ext_payments__payments/models.ts +141 -0
- package/src/api/generated/ext_payments/schema.json +579 -3
- package/src/components/ActivityItem.tsx +118 -0
- package/src/components/ActivityList.tsx +93 -0
- package/src/components/AddFundsSheet.tsx +258 -0
- package/src/components/BalanceHero.tsx +102 -0
- package/src/components/PaymentSheet.tsx +290 -0
- package/src/components/ResponsiveSheet.tsx +151 -0
- package/src/components/WithdrawSheet.tsx +329 -0
- package/src/components/index.ts +18 -0
- package/src/contexts/WalletContext.tsx +355 -0
- package/src/contexts/index.ts +12 -45
- package/src/index.ts +6 -18
- package/src/contexts/BalancesContext.tsx +0 -63
- package/src/contexts/CurrenciesContext.tsx +0 -64
- package/src/contexts/OverviewContext.tsx +0 -173
- package/src/contexts/PaymentsContext.tsx +0 -122
- package/src/contexts/PaymentsExtensionProvider.tsx +0 -56
- package/src/contexts/README.md +0 -201
- package/src/contexts/RootPaymentsContext.tsx +0 -66
- package/src/contexts/types.ts +0 -40
- package/src/hooks/index.ts +0 -20
- package/src/layouts/PaymentsLayout/PaymentsLayout.tsx +0 -90
- package/src/layouts/PaymentsLayout/components/CreatePaymentDialog.tsx +0 -274
- package/src/layouts/PaymentsLayout/components/PaymentDetailsDialog.tsx +0 -287
- package/src/layouts/PaymentsLayout/components/index.ts +0 -2
- package/src/layouts/PaymentsLayout/events.ts +0 -47
- package/src/layouts/PaymentsLayout/index.ts +0 -16
- package/src/layouts/PaymentsLayout/types.ts +0 -6
- package/src/layouts/PaymentsLayout/views/overview/components/BalanceCard.tsx +0 -121
- package/src/layouts/PaymentsLayout/views/overview/components/RecentPayments.tsx +0 -139
- package/src/layouts/PaymentsLayout/views/overview/components/index.ts +0 -2
- package/src/layouts/PaymentsLayout/views/overview/index.tsx +0 -21
- package/src/layouts/PaymentsLayout/views/payments/components/PaymentsList.tsx +0 -279
- package/src/layouts/PaymentsLayout/views/payments/components/index.ts +0 -1
- package/src/layouts/PaymentsLayout/views/payments/index.tsx +0 -18
- package/src/layouts/PaymentsLayout/views/transactions/components/TransactionsList.tsx +0 -260
- package/src/layouts/PaymentsLayout/views/transactions/components/index.ts +0 -1
- package/src/layouts/PaymentsLayout/views/transactions/index.tsx +0 -18
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConsolaInstance } from 'consola';
|
|
2
|
-
import
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { z, ZodError } from 'zod';
|
|
4
|
+
import * as React from 'react';
|
|
4
5
|
import * as _djangocfg_ext_base from '@djangocfg/ext-base';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -64,6 +65,40 @@ declare enum TransactionTransactionType {
|
|
|
64
65
|
BONUS = "bonus",
|
|
65
66
|
ADJUSTMENT = "adjustment"
|
|
66
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Withdrawal status
|
|
70
|
+
* * `pending` - Pending
|
|
71
|
+
* * `approved` - Approved
|
|
72
|
+
* * `processing` - Processing
|
|
73
|
+
* * `completed` - Completed
|
|
74
|
+
* * `rejected` - Rejected
|
|
75
|
+
* * `cancelled` - Cancelled
|
|
76
|
+
*/
|
|
77
|
+
declare enum WithdrawalDetailStatus {
|
|
78
|
+
PENDING = "pending",
|
|
79
|
+
APPROVED = "approved",
|
|
80
|
+
PROCESSING = "processing",
|
|
81
|
+
COMPLETED = "completed",
|
|
82
|
+
REJECTED = "rejected",
|
|
83
|
+
CANCELLED = "cancelled"
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Withdrawal status
|
|
87
|
+
* * `pending` - Pending
|
|
88
|
+
* * `approved` - Approved
|
|
89
|
+
* * `processing` - Processing
|
|
90
|
+
* * `completed` - Completed
|
|
91
|
+
* * `rejected` - Rejected
|
|
92
|
+
* * `cancelled` - Cancelled
|
|
93
|
+
*/
|
|
94
|
+
declare enum WithdrawalListStatus {
|
|
95
|
+
PENDING = "pending",
|
|
96
|
+
APPROVED = "approved",
|
|
97
|
+
PROCESSING = "processing",
|
|
98
|
+
COMPLETED = "completed",
|
|
99
|
+
REJECTED = "rejected",
|
|
100
|
+
CANCELLED = "cancelled"
|
|
101
|
+
}
|
|
67
102
|
|
|
68
103
|
type enums_PaymentDetailStatus = PaymentDetailStatus;
|
|
69
104
|
declare const enums_PaymentDetailStatus: typeof PaymentDetailStatus;
|
|
@@ -71,8 +106,12 @@ type enums_PaymentListStatus = PaymentListStatus;
|
|
|
71
106
|
declare const enums_PaymentListStatus: typeof PaymentListStatus;
|
|
72
107
|
type enums_TransactionTransactionType = TransactionTransactionType;
|
|
73
108
|
declare const enums_TransactionTransactionType: typeof TransactionTransactionType;
|
|
109
|
+
type enums_WithdrawalDetailStatus = WithdrawalDetailStatus;
|
|
110
|
+
declare const enums_WithdrawalDetailStatus: typeof WithdrawalDetailStatus;
|
|
111
|
+
type enums_WithdrawalListStatus = WithdrawalListStatus;
|
|
112
|
+
declare const enums_WithdrawalListStatus: typeof WithdrawalListStatus;
|
|
74
113
|
declare namespace enums {
|
|
75
|
-
export { enums_PaymentDetailStatus as PaymentDetailStatus, enums_PaymentListStatus as PaymentListStatus, enums_TransactionTransactionType as TransactionTransactionType };
|
|
114
|
+
export { enums_PaymentDetailStatus as PaymentDetailStatus, enums_PaymentListStatus as PaymentListStatus, enums_TransactionTransactionType as TransactionTransactionType, enums_WithdrawalDetailStatus as WithdrawalDetailStatus, enums_WithdrawalListStatus as WithdrawalListStatus };
|
|
76
115
|
}
|
|
77
116
|
|
|
78
117
|
/**
|
|
@@ -204,9 +243,145 @@ interface PaymentList$1 {
|
|
|
204
243
|
/** When this payment was completed */
|
|
205
244
|
completed_at?: string | null;
|
|
206
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* Serializer for creating payment.
|
|
248
|
+
*
|
|
249
|
+
* Request model (no read-only fields).
|
|
250
|
+
*/
|
|
251
|
+
interface PaymentCreateRequest$1 {
|
|
252
|
+
/** Payment amount in USD */
|
|
253
|
+
amount_usd: string;
|
|
254
|
+
/** Currency code (e.g., USDTTRC20) */
|
|
255
|
+
currency_code: string;
|
|
256
|
+
/** Optional payment description */
|
|
257
|
+
description?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
*
|
|
261
|
+
* Response model (includes read-only fields).
|
|
262
|
+
*/
|
|
263
|
+
interface PaginatedWithdrawalListList$1 {
|
|
264
|
+
/** Total number of items across all pages */
|
|
265
|
+
count: number;
|
|
266
|
+
/** Current page number (1-based) */
|
|
267
|
+
page: number;
|
|
268
|
+
/** Total number of pages */
|
|
269
|
+
pages: number;
|
|
270
|
+
/** Number of items per page */
|
|
271
|
+
page_size: number;
|
|
272
|
+
/** Whether there is a next page */
|
|
273
|
+
has_next: boolean;
|
|
274
|
+
/** Whether there is a previous page */
|
|
275
|
+
has_previous: boolean;
|
|
276
|
+
/** Next page number (null if no next page) */
|
|
277
|
+
next_page?: number | null;
|
|
278
|
+
/** Previous page number (null if no previous page) */
|
|
279
|
+
previous_page?: number | null;
|
|
280
|
+
/** Array of items for current page */
|
|
281
|
+
results: Array<WithdrawalList$1>;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Detailed withdrawal information.
|
|
285
|
+
*
|
|
286
|
+
* Response model (includes read-only fields).
|
|
287
|
+
*/
|
|
288
|
+
interface WithdrawalDetail$1 {
|
|
289
|
+
/** Unique identifier for this record */
|
|
290
|
+
id: string;
|
|
291
|
+
/** Internal withdrawal identifier (WD_YYYYMMDDHHMMSS_UUID) */
|
|
292
|
+
internal_withdrawal_id: string;
|
|
293
|
+
/** Withdrawal amount in USD (min $10) */
|
|
294
|
+
amount_usd: string;
|
|
295
|
+
currency_code: string;
|
|
296
|
+
currency_name: string;
|
|
297
|
+
currency_token: string;
|
|
298
|
+
currency_network: string;
|
|
299
|
+
/** Destination wallet address */
|
|
300
|
+
wallet_address: string;
|
|
301
|
+
/** Network transaction fee in USD */
|
|
302
|
+
network_fee_usd: string;
|
|
303
|
+
/** Service fee in USD */
|
|
304
|
+
service_fee_usd: string;
|
|
305
|
+
/** Total fee (network + service) in USD */
|
|
306
|
+
total_fee_usd: string;
|
|
307
|
+
/** Final amount to receive (amount - total_fee) */
|
|
308
|
+
final_amount_usd: string;
|
|
309
|
+
/** Amount in cryptocurrency (calculated at processing time) */
|
|
310
|
+
crypto_amount?: string | null;
|
|
311
|
+
/** Withdrawal status
|
|
312
|
+
|
|
313
|
+
* `pending` - Pending
|
|
314
|
+
* `approved` - Approved
|
|
315
|
+
* `processing` - Processing
|
|
316
|
+
* `completed` - Completed
|
|
317
|
+
* `rejected` - Rejected
|
|
318
|
+
* `cancelled` - Cancelled */
|
|
319
|
+
status: WithdrawalDetailStatus;
|
|
320
|
+
status_display: string;
|
|
321
|
+
/** Blockchain transaction hash (after sending) */
|
|
322
|
+
transaction_hash?: string | null;
|
|
323
|
+
/** Get blockchain explorer link. */
|
|
324
|
+
explorer_link?: string | null;
|
|
325
|
+
/** Admin notes (reason for rejection, etc.) */
|
|
326
|
+
admin_notes: string;
|
|
327
|
+
/** When this record was created */
|
|
328
|
+
created_at: string;
|
|
329
|
+
/** When approved by admin */
|
|
330
|
+
approved_at?: string | null;
|
|
331
|
+
/** When withdrawal was completed */
|
|
332
|
+
completed_at?: string | null;
|
|
333
|
+
/** When rejected by admin */
|
|
334
|
+
rejected_at?: string | null;
|
|
335
|
+
/** When cancelled by user */
|
|
336
|
+
cancelled_at?: string | null;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Serializer for creating withdrawal request.
|
|
340
|
+
*
|
|
341
|
+
* Request model (no read-only fields).
|
|
342
|
+
*/
|
|
343
|
+
interface WithdrawalCreateRequest$1 {
|
|
344
|
+
/** Withdrawal amount in USD (min $10) */
|
|
345
|
+
amount_usd: string;
|
|
346
|
+
/** Currency code (e.g., USDTTRC20) */
|
|
347
|
+
currency_code: string;
|
|
348
|
+
/** Destination wallet address */
|
|
349
|
+
wallet_address: string;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Withdrawal list item (lighter than detail).
|
|
353
|
+
*
|
|
354
|
+
* Response model (includes read-only fields).
|
|
355
|
+
*/
|
|
356
|
+
interface WithdrawalList$1 {
|
|
357
|
+
/** Unique identifier for this record */
|
|
358
|
+
id: string;
|
|
359
|
+
/** Internal withdrawal identifier (WD_YYYYMMDDHHMMSS_UUID) */
|
|
360
|
+
internal_withdrawal_id: string;
|
|
361
|
+
/** Withdrawal amount in USD (min $10) */
|
|
362
|
+
amount_usd: string;
|
|
363
|
+
/** Final amount to receive (amount - total_fee) */
|
|
364
|
+
final_amount_usd: string;
|
|
365
|
+
currency_code: string;
|
|
366
|
+
currency_token: string;
|
|
367
|
+
/** Withdrawal status
|
|
368
|
+
|
|
369
|
+
* `pending` - Pending
|
|
370
|
+
* `approved` - Approved
|
|
371
|
+
* `processing` - Processing
|
|
372
|
+
* `completed` - Completed
|
|
373
|
+
* `rejected` - Rejected
|
|
374
|
+
* `cancelled` - Cancelled */
|
|
375
|
+
status: WithdrawalListStatus;
|
|
376
|
+
status_display: string;
|
|
377
|
+
/** When this record was created */
|
|
378
|
+
created_at: string;
|
|
379
|
+
/** When withdrawal was completed */
|
|
380
|
+
completed_at?: string | null;
|
|
381
|
+
}
|
|
207
382
|
|
|
208
383
|
declare namespace models {
|
|
209
|
-
export type { Balance$1 as Balance, PaginatedPaymentListList$1 as PaginatedPaymentListList, PaymentDetail$1 as PaymentDetail, PaymentList$1 as PaymentList };
|
|
384
|
+
export type { Balance$1 as Balance, PaginatedPaymentListList$1 as PaginatedPaymentListList, PaginatedWithdrawalListList$1 as PaginatedWithdrawalListList, PaymentCreateRequest$1 as PaymentCreateRequest, PaymentDetail$1 as PaymentDetail, PaymentList$1 as PaymentList, WithdrawalCreateRequest$1 as WithdrawalCreateRequest, WithdrawalDetail$1 as WithdrawalDetail, WithdrawalList$1 as WithdrawalList };
|
|
210
385
|
}
|
|
211
386
|
|
|
212
387
|
/**
|
|
@@ -252,17 +427,41 @@ declare class ExtPaymentsPayments {
|
|
|
252
427
|
*/
|
|
253
428
|
paymentsStatusRetrieve(id: string): Promise<PaymentList$1[]>;
|
|
254
429
|
/**
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
430
|
+
* Create payment
|
|
431
|
+
*
|
|
432
|
+
* Create a new payment with specified amount and currency
|
|
258
433
|
*/
|
|
259
|
-
paymentsCreateCreate(): Promise<
|
|
434
|
+
paymentsCreateCreate(data: PaymentCreateRequest$1): Promise<PaymentDetail$1>;
|
|
260
435
|
transactionsList(limit?: number, offset?: number, type?: string): Promise<any>;
|
|
261
436
|
transactionsList(params?: {
|
|
262
437
|
limit?: number;
|
|
263
438
|
offset?: number;
|
|
264
439
|
type?: string;
|
|
265
440
|
}): Promise<any>;
|
|
441
|
+
withdrawalsList(page?: number, page_size?: number): Promise<PaginatedWithdrawalListList$1>;
|
|
442
|
+
withdrawalsList(params?: {
|
|
443
|
+
page?: number;
|
|
444
|
+
page_size?: number;
|
|
445
|
+
}): Promise<PaginatedWithdrawalListList$1>;
|
|
446
|
+
/**
|
|
447
|
+
* ViewSet for withdrawal operations. Endpoints: - GET /withdrawals/ - List
|
|
448
|
+
* user's withdrawal requests - GET /withdrawals/{id}/ - Get withdrawal
|
|
449
|
+
* details - POST /withdrawals/create/ - Create withdrawal request - POST
|
|
450
|
+
* /withdrawals/{id}/cancel/ - Cancel pending withdrawal
|
|
451
|
+
*/
|
|
452
|
+
withdrawalsRetrieve(id: string): Promise<WithdrawalDetail$1>;
|
|
453
|
+
/**
|
|
454
|
+
* Cancel withdrawal request
|
|
455
|
+
*
|
|
456
|
+
* Cancel a pending withdrawal request
|
|
457
|
+
*/
|
|
458
|
+
withdrawalsCancelCreate(id: string): Promise<WithdrawalDetail$1>;
|
|
459
|
+
/**
|
|
460
|
+
* Create withdrawal request
|
|
461
|
+
*
|
|
462
|
+
* Create a new withdrawal request (requires admin approval)
|
|
463
|
+
*/
|
|
464
|
+
withdrawalsCreateCreate(data: WithdrawalCreateRequest$1): Promise<WithdrawalDetail$1>;
|
|
266
465
|
}
|
|
267
466
|
|
|
268
467
|
/**
|
|
@@ -704,6 +903,53 @@ declare const PaginatedPaymentListListSchema: z.ZodObject<{
|
|
|
704
903
|
*/
|
|
705
904
|
type PaginatedPaymentListList = z.infer<typeof PaginatedPaymentListListSchema>;
|
|
706
905
|
|
|
906
|
+
declare const PaginatedWithdrawalListListSchema: 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_withdrawal_id: z.ZodString;
|
|
918
|
+
amount_usd: z.ZodString;
|
|
919
|
+
final_amount_usd: z.ZodString;
|
|
920
|
+
currency_code: z.ZodString;
|
|
921
|
+
currency_token: z.ZodString;
|
|
922
|
+
status: z.ZodEnum<typeof WithdrawalListStatus>;
|
|
923
|
+
status_display: z.ZodString;
|
|
924
|
+
created_at: z.ZodISODateTime;
|
|
925
|
+
completed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
926
|
+
}, z.core.$strip>>;
|
|
927
|
+
}, z.core.$strip>;
|
|
928
|
+
/**
|
|
929
|
+
* Infer TypeScript type from Zod schema
|
|
930
|
+
*/
|
|
931
|
+
type PaginatedWithdrawalListList = z.infer<typeof PaginatedWithdrawalListListSchema>;
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* Zod schema for PaymentCreateRequest
|
|
935
|
+
*
|
|
936
|
+
* This schema provides runtime validation and type inference.
|
|
937
|
+
* * Serializer for creating payment.
|
|
938
|
+
* */
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Serializer for creating payment.
|
|
942
|
+
*/
|
|
943
|
+
declare const PaymentCreateRequestSchema: z.ZodObject<{
|
|
944
|
+
amount_usd: z.ZodString;
|
|
945
|
+
currency_code: z.ZodString;
|
|
946
|
+
description: z.ZodOptional<z.ZodString>;
|
|
947
|
+
}, z.core.$strip>;
|
|
948
|
+
/**
|
|
949
|
+
* Infer TypeScript type from Zod schema
|
|
950
|
+
*/
|
|
951
|
+
type PaymentCreateRequest = z.infer<typeof PaymentCreateRequestSchema>;
|
|
952
|
+
|
|
707
953
|
/**
|
|
708
954
|
* Zod schema for PaymentDetail
|
|
709
955
|
*
|
|
@@ -798,6 +1044,93 @@ declare const TransactionSchema: z.ZodObject<{
|
|
|
798
1044
|
*/
|
|
799
1045
|
type Transaction = z.infer<typeof TransactionSchema>;
|
|
800
1046
|
|
|
1047
|
+
/**
|
|
1048
|
+
* Zod schema for WithdrawalCreateRequest
|
|
1049
|
+
*
|
|
1050
|
+
* This schema provides runtime validation and type inference.
|
|
1051
|
+
* * Serializer for creating withdrawal request.
|
|
1052
|
+
* */
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Serializer for creating withdrawal request.
|
|
1056
|
+
*/
|
|
1057
|
+
declare const WithdrawalCreateRequestSchema: z.ZodObject<{
|
|
1058
|
+
amount_usd: z.ZodString;
|
|
1059
|
+
currency_code: z.ZodString;
|
|
1060
|
+
wallet_address: z.ZodString;
|
|
1061
|
+
}, z.core.$strip>;
|
|
1062
|
+
/**
|
|
1063
|
+
* Infer TypeScript type from Zod schema
|
|
1064
|
+
*/
|
|
1065
|
+
type WithdrawalCreateRequest = z.infer<typeof WithdrawalCreateRequestSchema>;
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* Zod schema for WithdrawalDetail
|
|
1069
|
+
*
|
|
1070
|
+
* This schema provides runtime validation and type inference.
|
|
1071
|
+
* * Detailed withdrawal information.
|
|
1072
|
+
* */
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Detailed withdrawal information.
|
|
1076
|
+
*/
|
|
1077
|
+
declare const WithdrawalDetailSchema: z.ZodObject<{
|
|
1078
|
+
id: z.ZodString;
|
|
1079
|
+
internal_withdrawal_id: z.ZodString;
|
|
1080
|
+
amount_usd: z.ZodString;
|
|
1081
|
+
currency_code: z.ZodString;
|
|
1082
|
+
currency_name: z.ZodString;
|
|
1083
|
+
currency_token: z.ZodString;
|
|
1084
|
+
currency_network: z.ZodString;
|
|
1085
|
+
wallet_address: z.ZodString;
|
|
1086
|
+
network_fee_usd: z.ZodString;
|
|
1087
|
+
service_fee_usd: z.ZodString;
|
|
1088
|
+
total_fee_usd: z.ZodString;
|
|
1089
|
+
final_amount_usd: z.ZodString;
|
|
1090
|
+
crypto_amount: z.ZodNullable<z.ZodString>;
|
|
1091
|
+
status: z.ZodEnum<typeof WithdrawalDetailStatus>;
|
|
1092
|
+
status_display: z.ZodString;
|
|
1093
|
+
transaction_hash: z.ZodNullable<z.ZodString>;
|
|
1094
|
+
explorer_link: z.ZodNullable<z.ZodString>;
|
|
1095
|
+
admin_notes: z.ZodString;
|
|
1096
|
+
created_at: z.ZodISODateTime;
|
|
1097
|
+
approved_at: z.ZodNullable<z.ZodISODateTime>;
|
|
1098
|
+
completed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
1099
|
+
rejected_at: z.ZodNullable<z.ZodISODateTime>;
|
|
1100
|
+
cancelled_at: z.ZodNullable<z.ZodISODateTime>;
|
|
1101
|
+
}, z.core.$strip>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Infer TypeScript type from Zod schema
|
|
1104
|
+
*/
|
|
1105
|
+
type WithdrawalDetail = z.infer<typeof WithdrawalDetailSchema>;
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Zod schema for WithdrawalList
|
|
1109
|
+
*
|
|
1110
|
+
* This schema provides runtime validation and type inference.
|
|
1111
|
+
* * Withdrawal list item (lighter than detail).
|
|
1112
|
+
* */
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Withdrawal list item (lighter than detail).
|
|
1116
|
+
*/
|
|
1117
|
+
declare const WithdrawalListSchema: z.ZodObject<{
|
|
1118
|
+
id: z.ZodString;
|
|
1119
|
+
internal_withdrawal_id: z.ZodString;
|
|
1120
|
+
amount_usd: z.ZodString;
|
|
1121
|
+
final_amount_usd: z.ZodString;
|
|
1122
|
+
currency_code: z.ZodString;
|
|
1123
|
+
currency_token: z.ZodString;
|
|
1124
|
+
status: z.ZodEnum<typeof WithdrawalListStatus>;
|
|
1125
|
+
status_display: z.ZodString;
|
|
1126
|
+
created_at: z.ZodISODateTime;
|
|
1127
|
+
completed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
1128
|
+
}, z.core.$strip>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Infer TypeScript type from Zod schema
|
|
1131
|
+
*/
|
|
1132
|
+
type WithdrawalList = z.infer<typeof WithdrawalListSchema>;
|
|
1133
|
+
|
|
801
1134
|
/**
|
|
802
1135
|
* Zod Schemas - Runtime validation and type inference
|
|
803
1136
|
*
|
|
@@ -822,14 +1155,24 @@ type index$1_Currency = Currency;
|
|
|
822
1155
|
declare const index$1_CurrencySchema: typeof CurrencySchema;
|
|
823
1156
|
type index$1_PaginatedPaymentListList = PaginatedPaymentListList;
|
|
824
1157
|
declare const index$1_PaginatedPaymentListListSchema: typeof PaginatedPaymentListListSchema;
|
|
1158
|
+
type index$1_PaginatedWithdrawalListList = PaginatedWithdrawalListList;
|
|
1159
|
+
declare const index$1_PaginatedWithdrawalListListSchema: typeof PaginatedWithdrawalListListSchema;
|
|
1160
|
+
type index$1_PaymentCreateRequest = PaymentCreateRequest;
|
|
1161
|
+
declare const index$1_PaymentCreateRequestSchema: typeof PaymentCreateRequestSchema;
|
|
825
1162
|
type index$1_PaymentDetail = PaymentDetail;
|
|
826
1163
|
declare const index$1_PaymentDetailSchema: typeof PaymentDetailSchema;
|
|
827
1164
|
type index$1_PaymentList = PaymentList;
|
|
828
1165
|
declare const index$1_PaymentListSchema: typeof PaymentListSchema;
|
|
829
1166
|
type index$1_Transaction = Transaction;
|
|
830
1167
|
declare const index$1_TransactionSchema: typeof TransactionSchema;
|
|
1168
|
+
type index$1_WithdrawalCreateRequest = WithdrawalCreateRequest;
|
|
1169
|
+
declare const index$1_WithdrawalCreateRequestSchema: typeof WithdrawalCreateRequestSchema;
|
|
1170
|
+
type index$1_WithdrawalDetail = WithdrawalDetail;
|
|
1171
|
+
declare const index$1_WithdrawalDetailSchema: typeof WithdrawalDetailSchema;
|
|
1172
|
+
type index$1_WithdrawalList = WithdrawalList;
|
|
1173
|
+
declare const index$1_WithdrawalListSchema: typeof WithdrawalListSchema;
|
|
831
1174
|
declare namespace index$1 {
|
|
832
|
-
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 };
|
|
1175
|
+
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_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_WithdrawalCreateRequest as WithdrawalCreateRequest, index$1_WithdrawalCreateRequestSchema as WithdrawalCreateRequestSchema, type index$1_WithdrawalDetail as WithdrawalDetail, index$1_WithdrawalDetailSchema as WithdrawalDetailSchema, type index$1_WithdrawalList as WithdrawalList, index$1_WithdrawalListSchema as WithdrawalListSchema };
|
|
833
1176
|
}
|
|
834
1177
|
|
|
835
1178
|
/**
|
|
@@ -951,12 +1294,12 @@ declare function createPaymentsPaymentsConfirmCreate(id: string, client?: any):
|
|
|
951
1294
|
*/
|
|
952
1295
|
declare function getPaymentsPaymentsStatusRetrieve(id: string, client?: any): Promise<PaymentList>;
|
|
953
1296
|
/**
|
|
954
|
-
*
|
|
1297
|
+
* Create payment
|
|
955
1298
|
*
|
|
956
1299
|
* @method POST
|
|
957
1300
|
* @path /cfg/payments/payments/create/
|
|
958
1301
|
*/
|
|
959
|
-
declare function createPaymentsPaymentsCreateCreate(client?: any): Promise<
|
|
1302
|
+
declare function createPaymentsPaymentsCreateCreate(data: PaymentCreateRequest, client?: any): Promise<PaymentDetail>;
|
|
960
1303
|
/**
|
|
961
1304
|
* Get user transactions
|
|
962
1305
|
*
|
|
@@ -968,6 +1311,37 @@ declare function getPaymentsTransactionsList(params?: {
|
|
|
968
1311
|
offset?: number;
|
|
969
1312
|
type?: string;
|
|
970
1313
|
}, client?: any): Promise<any>;
|
|
1314
|
+
/**
|
|
1315
|
+
* API operation
|
|
1316
|
+
*
|
|
1317
|
+
* @method GET
|
|
1318
|
+
* @path /cfg/payments/withdrawals/
|
|
1319
|
+
*/
|
|
1320
|
+
declare function getPaymentsWithdrawalsList(params?: {
|
|
1321
|
+
page?: number;
|
|
1322
|
+
page_size?: number;
|
|
1323
|
+
}, client?: any): Promise<PaginatedWithdrawalListList>;
|
|
1324
|
+
/**
|
|
1325
|
+
* API operation
|
|
1326
|
+
*
|
|
1327
|
+
* @method GET
|
|
1328
|
+
* @path /cfg/payments/withdrawals/{id}/
|
|
1329
|
+
*/
|
|
1330
|
+
declare function getPaymentsWithdrawalsRetrieve(id: string, client?: any): Promise<WithdrawalDetail>;
|
|
1331
|
+
/**
|
|
1332
|
+
* Cancel withdrawal request
|
|
1333
|
+
*
|
|
1334
|
+
* @method POST
|
|
1335
|
+
* @path /cfg/payments/withdrawals/{id}/cancel/
|
|
1336
|
+
*/
|
|
1337
|
+
declare function createPaymentsWithdrawalsCancelCreate(id: string, client?: any): Promise<WithdrawalDetail>;
|
|
1338
|
+
/**
|
|
1339
|
+
* Create withdrawal request
|
|
1340
|
+
*
|
|
1341
|
+
* @method POST
|
|
1342
|
+
* @path /cfg/payments/withdrawals/create/
|
|
1343
|
+
*/
|
|
1344
|
+
declare function createPaymentsWithdrawalsCreateCreate(data: WithdrawalCreateRequest, client?: any): Promise<WithdrawalDetail>;
|
|
971
1345
|
|
|
972
1346
|
/**
|
|
973
1347
|
* Typed Fetchers - Universal API functions
|
|
@@ -998,14 +1372,18 @@ declare function getPaymentsTransactionsList(params?: {
|
|
|
998
1372
|
|
|
999
1373
|
declare const index_createPaymentsPaymentsConfirmCreate: typeof createPaymentsPaymentsConfirmCreate;
|
|
1000
1374
|
declare const index_createPaymentsPaymentsCreateCreate: typeof createPaymentsPaymentsCreateCreate;
|
|
1375
|
+
declare const index_createPaymentsWithdrawalsCancelCreate: typeof createPaymentsWithdrawalsCancelCreate;
|
|
1376
|
+
declare const index_createPaymentsWithdrawalsCreateCreate: typeof createPaymentsWithdrawalsCreateCreate;
|
|
1001
1377
|
declare const index_getPaymentsBalanceRetrieve: typeof getPaymentsBalanceRetrieve;
|
|
1002
1378
|
declare const index_getPaymentsCurrenciesList: typeof getPaymentsCurrenciesList;
|
|
1003
1379
|
declare const index_getPaymentsPaymentsList: typeof getPaymentsPaymentsList;
|
|
1004
1380
|
declare const index_getPaymentsPaymentsRetrieve: typeof getPaymentsPaymentsRetrieve;
|
|
1005
1381
|
declare const index_getPaymentsPaymentsStatusRetrieve: typeof getPaymentsPaymentsStatusRetrieve;
|
|
1006
1382
|
declare const index_getPaymentsTransactionsList: typeof getPaymentsTransactionsList;
|
|
1383
|
+
declare const index_getPaymentsWithdrawalsList: typeof getPaymentsWithdrawalsList;
|
|
1384
|
+
declare const index_getPaymentsWithdrawalsRetrieve: typeof getPaymentsWithdrawalsRetrieve;
|
|
1007
1385
|
declare namespace index {
|
|
1008
|
-
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 };
|
|
1386
|
+
export { index_createPaymentsPaymentsConfirmCreate as createPaymentsPaymentsConfirmCreate, index_createPaymentsPaymentsCreateCreate as createPaymentsPaymentsCreateCreate, index_createPaymentsWithdrawalsCancelCreate as createPaymentsWithdrawalsCancelCreate, index_createPaymentsWithdrawalsCreateCreate as createPaymentsWithdrawalsCreateCreate, index_getPaymentsBalanceRetrieve as getPaymentsBalanceRetrieve, index_getPaymentsCurrenciesList as getPaymentsCurrenciesList, index_getPaymentsPaymentsList as getPaymentsPaymentsList, index_getPaymentsPaymentsRetrieve as getPaymentsPaymentsRetrieve, index_getPaymentsPaymentsStatusRetrieve as getPaymentsPaymentsStatusRetrieve, index_getPaymentsTransactionsList as getPaymentsTransactionsList, index_getPaymentsWithdrawalsList as getPaymentsWithdrawalsList, index_getPaymentsWithdrawalsRetrieve as getPaymentsWithdrawalsRetrieve };
|
|
1009
1387
|
}
|
|
1010
1388
|
|
|
1011
1389
|
/**
|
|
@@ -1269,48 +1647,109 @@ declare class API {
|
|
|
1269
1647
|
declare const apiPayments: API;
|
|
1270
1648
|
|
|
1271
1649
|
/**
|
|
1272
|
-
*
|
|
1650
|
+
* Balance Hero (Apple-style)
|
|
1273
1651
|
*
|
|
1274
|
-
*
|
|
1275
|
-
* Removed: API Keys, Tariffs (deprecated in v2.0)
|
|
1652
|
+
* Large centered balance display with action buttons
|
|
1276
1653
|
*/
|
|
1654
|
+
interface BalanceHeroProps {
|
|
1655
|
+
onAddFunds?: () => void;
|
|
1656
|
+
onWithdraw?: () => void;
|
|
1657
|
+
className?: string;
|
|
1658
|
+
}
|
|
1659
|
+
declare function BalanceHero({ onAddFunds, onWithdraw, className }: BalanceHeroProps): react_jsx_runtime.JSX.Element;
|
|
1277
1660
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1661
|
+
type ActivityType = 'payment' | 'deposit' | 'withdrawal';
|
|
1662
|
+
interface ActivityItem$1 {
|
|
1663
|
+
id: string;
|
|
1664
|
+
type: ActivityType;
|
|
1665
|
+
amount: string;
|
|
1666
|
+
amountDisplay: string;
|
|
1667
|
+
currency?: string;
|
|
1668
|
+
status: 'pending' | 'completed' | 'failed' | 'expired' | 'confirming';
|
|
1669
|
+
statusDisplay: string;
|
|
1670
|
+
description: string;
|
|
1671
|
+
createdAt: string;
|
|
1672
|
+
payment?: PaymentList;
|
|
1673
|
+
transaction?: Transaction;
|
|
1674
|
+
withdrawal?: WithdrawalList;
|
|
1280
1675
|
}
|
|
1281
|
-
declare const PaymentsLayout: React.FC<PaymentsLayoutProps>;
|
|
1282
1676
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1677
|
+
interface ActivityListProps {
|
|
1678
|
+
onItemClick?: (item: ActivityItem$1) => void;
|
|
1679
|
+
onViewAll?: () => void;
|
|
1680
|
+
limit?: number;
|
|
1681
|
+
className?: string;
|
|
1682
|
+
}
|
|
1683
|
+
declare function ActivityList({ onItemClick, onViewAll, limit, className, }: ActivityListProps): react_jsx_runtime.JSX.Element;
|
|
1684
|
+
|
|
1685
|
+
interface ActivityItemProps {
|
|
1686
|
+
item: ActivityItem$1;
|
|
1687
|
+
onClick?: () => void;
|
|
1688
|
+
}
|
|
1689
|
+
declare function ActivityItem({ item, onClick }: ActivityItemProps): react_jsx_runtime.JSX.Element;
|
|
1690
|
+
|
|
1691
|
+
interface AddFundsSheetProps {
|
|
1692
|
+
open: boolean;
|
|
1693
|
+
onOpenChange: (open: boolean) => void;
|
|
1694
|
+
onSuccess?: (payment: PaymentDetail) => void;
|
|
1695
|
+
}
|
|
1696
|
+
declare function AddFundsSheet({ open, onOpenChange, onSuccess }: AddFundsSheetProps): react_jsx_runtime.JSX.Element;
|
|
1697
|
+
|
|
1698
|
+
interface WithdrawSheetProps {
|
|
1699
|
+
open: boolean;
|
|
1700
|
+
onOpenChange: (open: boolean) => void;
|
|
1701
|
+
onSuccess?: (withdrawal: WithdrawalDetail) => void;
|
|
1702
|
+
}
|
|
1703
|
+
declare function WithdrawSheet({ open, onOpenChange, onSuccess }: WithdrawSheetProps): react_jsx_runtime.JSX.Element;
|
|
1287
1704
|
|
|
1288
1705
|
/**
|
|
1289
|
-
* Payment
|
|
1706
|
+
* Payment Sheet (Apple-style)
|
|
1290
1707
|
*
|
|
1291
|
-
*
|
|
1292
|
-
*
|
|
1708
|
+
* Responsive: Dialog on desktop, Drawer on mobile
|
|
1709
|
+
* Shows payment details with QR code and address
|
|
1293
1710
|
*/
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1711
|
+
interface PaymentSheetProps {
|
|
1712
|
+
paymentId: string | null;
|
|
1713
|
+
open: boolean;
|
|
1714
|
+
onOpenChange: (open: boolean) => void;
|
|
1715
|
+
}
|
|
1716
|
+
declare function PaymentSheet({ paymentId, open, onOpenChange }: PaymentSheetProps): react_jsx_runtime.JSX.Element;
|
|
1717
|
+
|
|
1718
|
+
interface ResponsiveSheetProps {
|
|
1719
|
+
open: boolean;
|
|
1720
|
+
onOpenChange: (open: boolean) => void;
|
|
1721
|
+
children: React.ReactNode;
|
|
1722
|
+
}
|
|
1723
|
+
interface ResponsiveSheetHeaderProps {
|
|
1724
|
+
children: React.ReactNode;
|
|
1725
|
+
className?: string;
|
|
1726
|
+
}
|
|
1727
|
+
interface ResponsiveSheetTitleProps {
|
|
1728
|
+
children: React.ReactNode;
|
|
1729
|
+
className?: string;
|
|
1730
|
+
}
|
|
1731
|
+
interface ResponsiveSheetDescriptionProps {
|
|
1732
|
+
children: React.ReactNode;
|
|
1733
|
+
className?: string;
|
|
1734
|
+
}
|
|
1735
|
+
interface ResponsiveSheetContentProps {
|
|
1736
|
+
children: React.ReactNode;
|
|
1737
|
+
className?: string;
|
|
1738
|
+
}
|
|
1739
|
+
interface ResponsiveSheetFooterProps {
|
|
1740
|
+
children: React.ReactNode;
|
|
1741
|
+
className?: string;
|
|
1742
|
+
}
|
|
1743
|
+
declare function ResponsiveSheet({ open, onOpenChange, children }: ResponsiveSheetProps): react_jsx_runtime.JSX.Element;
|
|
1744
|
+
declare function ResponsiveSheetContent({ children, className }: ResponsiveSheetContentProps): react_jsx_runtime.JSX.Element;
|
|
1745
|
+
declare function ResponsiveSheetHeader({ children, className }: ResponsiveSheetHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1746
|
+
declare function ResponsiveSheetTitle({ children, className }: ResponsiveSheetTitleProps): react_jsx_runtime.JSX.Element;
|
|
1747
|
+
declare function ResponsiveSheetDescription({ children, className }: ResponsiveSheetDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
1748
|
+
declare function ResponsiveSheetFooter({ children, className }: ResponsiveSheetFooterProps): react_jsx_runtime.JSX.Element;
|
|
1310
1749
|
|
|
1311
1750
|
/**
|
|
1312
1751
|
* Payments extension configuration
|
|
1313
1752
|
*/
|
|
1314
1753
|
declare const extensionConfig: _djangocfg_ext_base.ExtensionMetadata;
|
|
1315
1754
|
|
|
1316
|
-
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,
|
|
1755
|
+
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 PaymentDetail, PaymentDetailSchema, type PaymentList, PaymentListSchema, PaymentSheet, REFRESH_TOKEN_KEY, type RequestLog, type ResponseLog, ResponsiveSheet, ResponsiveSheetContent, ResponsiveSheetDescription, ResponsiveSheetFooter, ResponsiveSheetHeader, ResponsiveSheetTitle, type RetryConfig, index$1 as Schemas, type StorageAdapter, TOKEN_KEY, type Transaction, TransactionSchema, type ValidationErrorDetail, type ValidationErrorEvent, WithdrawSheet, type WithdrawalCreateRequest, WithdrawalCreateRequestSchema, type WithdrawalDetail, WithdrawalDetailSchema, type WithdrawalList, WithdrawalListSchema, apiPayments, clearAPITokens, configureAPI, createPaymentsPaymentsConfirmCreate, createPaymentsPaymentsCreateCreate, createPaymentsWithdrawalsCancelCreate, createPaymentsWithdrawalsCreateCreate, dispatchValidationError, extensionConfig, formatZodError, getAPIInstance, getPaymentsBalanceRetrieve, getPaymentsCurrenciesList, getPaymentsPaymentsList, getPaymentsPaymentsRetrieve, getPaymentsPaymentsStatusRetrieve, getPaymentsTransactionsList, getPaymentsWithdrawalsList, getPaymentsWithdrawalsRetrieve, isAPIConfigured, onValidationError, reconfigureAPI, resetAPI, shouldRetry, withRetry };
|