@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.
@@ -0,0 +1,372 @@
1
+ import { P as PaymentListStatus, W as WithdrawalListStatus, a as PaymentDetailStatus, T as TransactionTransactionType, b as WithdrawalDetailStatus, c as PaymentList, d as PaymentCreateRequest, e as PaymentCreateResponse, f as WithdrawalCancelResponse, g as WithdrawalCreateRequest, h as WithdrawalCreateResponse, A as API } from '../hooks-DG8taGyN.js';
2
+ export { i as PaymentCreateRequestSchema, j as PaymentCreateResponseSchema, k as PaymentListSchema, l as WithdrawalCancelResponseSchema, m as WithdrawalCreateRequestSchema, n as WithdrawalCreateResponseSchema, t as useCreatePaymentsPaymentsConfirmCreate, w as useCreatePaymentsPaymentsCreateCreate, B as useCreatePaymentsWithdrawalsCancelCreate, C as useCreatePaymentsWithdrawalsCreateCreate, u as usePaymentsBalanceRetrieve, p as usePaymentsCurrenciesEstimateRetrieve, o as usePaymentsCurrenciesList, q as usePaymentsCurrenciesWithdrawalEstimateRetrieve, r as usePaymentsPaymentsList, s as usePaymentsPaymentsRetrieve, v as usePaymentsPaymentsStatusRetrieve, x as usePaymentsTransactionsList, y as usePaymentsWithdrawalsList, z as usePaymentsWithdrawalsRetrieve } from '../hooks-DG8taGyN.js';
3
+ import { z } from 'zod';
4
+ import 'swr';
5
+ import 'consola';
6
+
7
+ /**
8
+ * Zod schema for Balance
9
+ *
10
+ * This schema provides runtime validation and type inference.
11
+ * * User balance serializer.
12
+ * */
13
+
14
+ /**
15
+ * User balance serializer.
16
+ */
17
+ declare const BalanceSchema: z.ZodObject<{
18
+ balance_usd: z.ZodString;
19
+ balance_display: z.ZodString;
20
+ total_deposited: z.ZodString;
21
+ total_withdrawn: z.ZodString;
22
+ last_transaction_at: z.ZodNullable<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ /**
25
+ * Infer TypeScript type from Zod schema
26
+ */
27
+ type Balance = z.infer<typeof BalanceSchema>;
28
+
29
+ /**
30
+ * Zod schema for Currency
31
+ *
32
+ * This schema provides runtime validation and type inference.
33
+ * * Currency list serializer.
34
+ * */
35
+
36
+ /**
37
+ * Currency list serializer.
38
+ */
39
+ declare const CurrencySchema: z.ZodObject<{
40
+ code: z.ZodString;
41
+ name: z.ZodString;
42
+ token: z.ZodString;
43
+ network: z.ZodNullable<z.ZodString>;
44
+ display_name: z.ZodString;
45
+ symbol: z.ZodString;
46
+ decimal_places: z.ZodInt;
47
+ is_active: z.ZodBoolean;
48
+ min_amount_usd: z.ZodString;
49
+ sort_order: z.ZodInt;
50
+ }, z.core.$strip>;
51
+ /**
52
+ * Infer TypeScript type from Zod schema
53
+ */
54
+ type Currency = z.infer<typeof CurrencySchema>;
55
+
56
+ declare const PaginatedPaymentListListSchema: z.ZodObject<{
57
+ count: z.ZodInt;
58
+ page: z.ZodInt;
59
+ pages: z.ZodInt;
60
+ page_size: z.ZodInt;
61
+ has_next: z.ZodBoolean;
62
+ has_previous: z.ZodBoolean;
63
+ next_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
64
+ previous_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
65
+ results: z.ZodArray<z.ZodObject<{
66
+ id: z.ZodString;
67
+ internal_payment_id: z.ZodString;
68
+ amount_usd: z.ZodString;
69
+ currency_code: z.ZodString;
70
+ currency_token: z.ZodString;
71
+ status: z.ZodEnum<typeof PaymentListStatus>;
72
+ status_display: z.ZodString;
73
+ created_at: z.ZodString;
74
+ completed_at: z.ZodNullable<z.ZodString>;
75
+ }, z.core.$strip>>;
76
+ }, z.core.$strip>;
77
+ /**
78
+ * Infer TypeScript type from Zod schema
79
+ */
80
+ type PaginatedPaymentListList = z.infer<typeof PaginatedPaymentListListSchema>;
81
+
82
+ declare const PaginatedWithdrawalListListSchema: z.ZodObject<{
83
+ count: z.ZodInt;
84
+ page: z.ZodInt;
85
+ pages: z.ZodInt;
86
+ page_size: z.ZodInt;
87
+ has_next: z.ZodBoolean;
88
+ has_previous: z.ZodBoolean;
89
+ next_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
90
+ previous_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
91
+ results: z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ internal_withdrawal_id: z.ZodString;
94
+ amount_usd: z.ZodString;
95
+ final_amount_usd: z.ZodString;
96
+ currency_code: z.ZodString;
97
+ currency_token: z.ZodString;
98
+ status: z.ZodEnum<typeof WithdrawalListStatus>;
99
+ status_display: z.ZodString;
100
+ created_at: z.ZodString;
101
+ completed_at: z.ZodNullable<z.ZodString>;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>;
104
+ /**
105
+ * Infer TypeScript type from Zod schema
106
+ */
107
+ type PaginatedWithdrawalListList = z.infer<typeof PaginatedWithdrawalListListSchema>;
108
+
109
+ /**
110
+ * Zod schema for PaymentDetail
111
+ *
112
+ * This schema provides runtime validation and type inference.
113
+ * * Detailed payment information.
114
+ * */
115
+
116
+ /**
117
+ * Detailed payment information.
118
+ */
119
+ declare const PaymentDetailSchema: z.ZodObject<{
120
+ id: z.ZodString;
121
+ internal_payment_id: z.ZodString;
122
+ amount_usd: z.ZodString;
123
+ currency_code: z.ZodString;
124
+ currency_name: z.ZodString;
125
+ currency_token: z.ZodString;
126
+ currency_network: z.ZodString;
127
+ pay_amount: z.ZodNullable<z.ZodString>;
128
+ actual_amount: z.ZodNullable<z.ZodString>;
129
+ actual_amount_usd: z.ZodNullable<z.ZodString>;
130
+ status: z.ZodEnum<typeof PaymentDetailStatus>;
131
+ status_display: z.ZodString;
132
+ pay_address: z.ZodNullable<z.ZodString>;
133
+ qr_code_url: z.ZodNullable<z.ZodString>;
134
+ payment_url: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
135
+ transaction_hash: z.ZodNullable<z.ZodString>;
136
+ explorer_link: z.ZodNullable<z.ZodString>;
137
+ confirmations_count: z.ZodInt;
138
+ expires_at: z.ZodNullable<z.ZodString>;
139
+ completed_at: z.ZodNullable<z.ZodString>;
140
+ created_at: z.ZodString;
141
+ is_completed: z.ZodBoolean;
142
+ is_failed: z.ZodBoolean;
143
+ is_expired: z.ZodBoolean;
144
+ description: z.ZodString;
145
+ }, z.core.$strip>;
146
+ /**
147
+ * Infer TypeScript type from Zod schema
148
+ */
149
+ type PaymentDetail = z.infer<typeof PaymentDetailSchema>;
150
+
151
+ /**
152
+ * Zod schema for Transaction
153
+ *
154
+ * This schema provides runtime validation and type inference.
155
+ * * Transaction serializer.
156
+ * */
157
+
158
+ /**
159
+ * Transaction serializer.
160
+ */
161
+ declare const TransactionSchema: z.ZodObject<{
162
+ id: z.ZodString;
163
+ transaction_type: z.ZodEnum<typeof TransactionTransactionType>;
164
+ type_display: z.ZodString;
165
+ amount_usd: z.ZodString;
166
+ amount_display: z.ZodString;
167
+ balance_after: z.ZodString;
168
+ payment_id: z.ZodNullable<z.ZodString>;
169
+ description: z.ZodString;
170
+ created_at: z.ZodString;
171
+ }, z.core.$strip>;
172
+ /**
173
+ * Infer TypeScript type from Zod schema
174
+ */
175
+ type Transaction = z.infer<typeof TransactionSchema>;
176
+
177
+ /**
178
+ * Zod schema for WithdrawalDetail
179
+ *
180
+ * This schema provides runtime validation and type inference.
181
+ * * Detailed withdrawal information.
182
+ * */
183
+
184
+ /**
185
+ * Detailed withdrawal information.
186
+ */
187
+ declare const WithdrawalDetailSchema: z.ZodObject<{
188
+ id: z.ZodString;
189
+ internal_withdrawal_id: z.ZodString;
190
+ amount_usd: z.ZodString;
191
+ currency_code: z.ZodString;
192
+ currency_name: z.ZodString;
193
+ currency_token: z.ZodString;
194
+ currency_network: z.ZodString;
195
+ wallet_address: z.ZodString;
196
+ network_fee_usd: z.ZodString;
197
+ service_fee_usd: z.ZodString;
198
+ total_fee_usd: z.ZodString;
199
+ final_amount_usd: z.ZodString;
200
+ crypto_amount: z.ZodNullable<z.ZodString>;
201
+ status: z.ZodEnum<typeof WithdrawalDetailStatus>;
202
+ status_display: z.ZodString;
203
+ transaction_hash: z.ZodNullable<z.ZodString>;
204
+ explorer_link: z.ZodNullable<z.ZodString>;
205
+ admin_notes: z.ZodString;
206
+ created_at: z.ZodString;
207
+ approved_at: z.ZodNullable<z.ZodString>;
208
+ completed_at: z.ZodNullable<z.ZodString>;
209
+ rejected_at: z.ZodNullable<z.ZodString>;
210
+ cancelled_at: z.ZodNullable<z.ZodString>;
211
+ }, z.core.$strip>;
212
+ /**
213
+ * Infer TypeScript type from Zod schema
214
+ */
215
+ type WithdrawalDetail = z.infer<typeof WithdrawalDetailSchema>;
216
+
217
+ /**
218
+ * Zod schema for WithdrawalList
219
+ *
220
+ * This schema provides runtime validation and type inference.
221
+ * * Withdrawal list item (lighter than detail).
222
+ * */
223
+
224
+ /**
225
+ * Withdrawal list item (lighter than detail).
226
+ */
227
+ declare const WithdrawalListSchema: z.ZodObject<{
228
+ id: z.ZodString;
229
+ internal_withdrawal_id: z.ZodString;
230
+ amount_usd: z.ZodString;
231
+ final_amount_usd: z.ZodString;
232
+ currency_code: z.ZodString;
233
+ currency_token: z.ZodString;
234
+ status: z.ZodEnum<typeof WithdrawalListStatus>;
235
+ status_display: z.ZodString;
236
+ created_at: z.ZodString;
237
+ completed_at: z.ZodNullable<z.ZodString>;
238
+ }, z.core.$strip>;
239
+ /**
240
+ * Infer TypeScript type from Zod schema
241
+ */
242
+ type WithdrawalList = z.infer<typeof WithdrawalListSchema>;
243
+
244
+ /**
245
+ * Get user balance
246
+ *
247
+ * @method GET
248
+ * @path /cfg/payments/balance/
249
+ */
250
+ declare function getPaymentsBalanceRetrieve(client?: any): Promise<Balance>;
251
+ /**
252
+ * Get available currencies
253
+ *
254
+ * @method GET
255
+ * @path /cfg/payments/currencies/
256
+ */
257
+ declare function getPaymentsCurrenciesList(client?: any): Promise<any>;
258
+ /**
259
+ * Get currency estimate
260
+ *
261
+ * @method GET
262
+ * @path /cfg/payments/currencies/{code}/estimate/
263
+ */
264
+ declare function getPaymentsCurrenciesEstimateRetrieve(code: string, params?: {
265
+ amount?: number;
266
+ }, client?: any): Promise<any>;
267
+ /**
268
+ * Get withdrawal estimate
269
+ *
270
+ * @method GET
271
+ * @path /cfg/payments/currencies/{code}/withdrawal-estimate/
272
+ */
273
+ declare function getPaymentsCurrenciesWithdrawalEstimateRetrieve(code: string, params?: {
274
+ amount?: number;
275
+ }, client?: any): Promise<any>;
276
+ /**
277
+ * API operation
278
+ *
279
+ * @method GET
280
+ * @path /cfg/payments/payments/
281
+ */
282
+ declare function getPaymentsPaymentsList(params?: {
283
+ page?: number;
284
+ page_size?: number;
285
+ }, client?: any): Promise<PaginatedPaymentListList>;
286
+ /**
287
+ * API operation
288
+ *
289
+ * @method GET
290
+ * @path /cfg/payments/payments/{id}/
291
+ */
292
+ declare function getPaymentsPaymentsRetrieve(id: string, client?: any): Promise<PaymentDetail>;
293
+ /**
294
+ * API operation
295
+ *
296
+ * @method POST
297
+ * @path /cfg/payments/payments/{id}/confirm/
298
+ */
299
+ declare function createPaymentsPaymentsConfirmCreate(id: string, client?: any): Promise<PaymentList>;
300
+ /**
301
+ * API operation
302
+ *
303
+ * @method GET
304
+ * @path /cfg/payments/payments/{id}/status/
305
+ */
306
+ declare function getPaymentsPaymentsStatusRetrieve(id: string, client?: any): Promise<PaymentList>;
307
+ /**
308
+ * Create payment
309
+ *
310
+ * @method POST
311
+ * @path /cfg/payments/payments/create/
312
+ */
313
+ declare function createPaymentsPaymentsCreateCreate(data: PaymentCreateRequest, client?: any): Promise<PaymentCreateResponse>;
314
+ /**
315
+ * Get user transactions
316
+ *
317
+ * @method GET
318
+ * @path /cfg/payments/transactions/
319
+ */
320
+ declare function getPaymentsTransactionsList(params?: {
321
+ limit?: number;
322
+ offset?: number;
323
+ type?: string;
324
+ }, client?: any): Promise<any>;
325
+ /**
326
+ * API operation
327
+ *
328
+ * @method GET
329
+ * @path /cfg/payments/withdrawals/
330
+ */
331
+ declare function getPaymentsWithdrawalsList(params?: {
332
+ page?: number;
333
+ page_size?: number;
334
+ }, client?: any): Promise<PaginatedWithdrawalListList>;
335
+ /**
336
+ * API operation
337
+ *
338
+ * @method GET
339
+ * @path /cfg/payments/withdrawals/{id}/
340
+ */
341
+ declare function getPaymentsWithdrawalsRetrieve(id: string, client?: any): Promise<WithdrawalDetail>;
342
+ /**
343
+ * Cancel withdrawal request
344
+ *
345
+ * @method POST
346
+ * @path /cfg/payments/withdrawals/{id}/cancel/
347
+ */
348
+ declare function createPaymentsWithdrawalsCancelCreate(id: string, client?: any): Promise<WithdrawalCancelResponse>;
349
+ /**
350
+ * Create withdrawal request
351
+ *
352
+ * @method POST
353
+ * @path /cfg/payments/withdrawals/create/
354
+ */
355
+ declare function createPaymentsWithdrawalsCreateCreate(data: WithdrawalCreateRequest, client?: any): Promise<WithdrawalCreateResponse>;
356
+
357
+ /**
358
+ * Payments Extension API
359
+ *
360
+ * Pre-configured API instance with shared authentication.
361
+ *
362
+ * @example
363
+ * ```typescript
364
+ * import { apiPayments } from '@djangocfg/ext-payments/api';
365
+ *
366
+ * const balance = await apiPayments.payments.balanceRetrieve();
367
+ * ```
368
+ */
369
+
370
+ declare const apiPayments: API;
371
+
372
+ export { API, type Balance, BalanceSchema, type Currency, CurrencySchema, type PaginatedPaymentListList, PaginatedPaymentListListSchema, type PaginatedWithdrawalListList, PaginatedWithdrawalListListSchema, PaymentCreateRequest, PaymentCreateResponse, type PaymentDetail, PaymentDetailSchema, PaymentList, type Transaction, TransactionSchema, WithdrawalCancelResponse, WithdrawalCreateRequest, WithdrawalCreateResponse, type WithdrawalDetail, WithdrawalDetailSchema, type WithdrawalList, WithdrawalListSchema, apiPayments, createPaymentsPaymentsConfirmCreate, createPaymentsPaymentsCreateCreate, createPaymentsWithdrawalsCancelCreate, createPaymentsWithdrawalsCreateCreate, getPaymentsBalanceRetrieve, getPaymentsCurrenciesEstimateRetrieve, getPaymentsCurrenciesList, getPaymentsCurrenciesWithdrawalEstimateRetrieve, getPaymentsPaymentsList, getPaymentsPaymentsRetrieve, getPaymentsPaymentsStatusRetrieve, getPaymentsTransactionsList, getPaymentsWithdrawalsList, getPaymentsWithdrawalsRetrieve };