@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/README.md +117 -145
- package/dist/api/hooks.cjs +1701 -0
- package/dist/api/hooks.d.cts +4 -0
- package/dist/api/hooks.d.ts +4 -0
- package/dist/api/hooks.js +1681 -0
- package/dist/api/index.cjs +1738 -0
- package/dist/api/index.d.cts +372 -0
- package/dist/api/index.d.ts +372 -0
- package/dist/api/index.js +1688 -0
- package/dist/api-hooks-DG8taGyN.d.cts +1172 -0
- package/dist/api-hooks-DG8taGyN.d.ts +1172 -0
- package/dist/api-hooks.cjs +1701 -0
- package/dist/api-hooks.d.cts +4 -0
- package/dist/api-hooks.d.ts +4 -0
- package/dist/api-hooks.js +1681 -0
- package/dist/config.cjs +11 -1
- package/dist/config.js +11 -1
- package/dist/hooks-DG8taGyN.d.cts +1172 -0
- package/dist/hooks-DG8taGyN.d.ts +1172 -0
- package/dist/index.cjs +15 -5
- package/dist/index.d.cts +23 -1407
- package/dist/index.d.ts +23 -1407
- package/dist/index.js +15 -5
- package/package.json +13 -3
- package/src/api/hooks.ts +16 -0
- package/src/api/index.ts +20 -1
|
@@ -0,0 +1,1738 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var api = require('@djangocfg/ext-base/api');
|
|
4
|
+
var consola = require('consola');
|
|
5
|
+
var pRetry = require('p-retry');
|
|
6
|
+
var zod = require('zod');
|
|
7
|
+
var useSWR = require('swr');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var pRetry__default = /*#__PURE__*/_interopDefault(pRetry);
|
|
12
|
+
var useSWR__default = /*#__PURE__*/_interopDefault(useSWR);
|
|
13
|
+
|
|
14
|
+
// src/api/generated/ext_payments/ext_payments__payments/client.ts
|
|
15
|
+
var ExtPaymentsPayments = class {
|
|
16
|
+
client;
|
|
17
|
+
constructor(client) {
|
|
18
|
+
this.client = client;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get user balance
|
|
22
|
+
*
|
|
23
|
+
* Get current user balance and transaction statistics
|
|
24
|
+
*/
|
|
25
|
+
async balanceRetrieve() {
|
|
26
|
+
const response = await this.client.request("GET", "/cfg/payments/balance/");
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get available currencies
|
|
31
|
+
*
|
|
32
|
+
* Returns list of available currencies with token+network info, popular
|
|
33
|
+
* first
|
|
34
|
+
*/
|
|
35
|
+
async currenciesList() {
|
|
36
|
+
const response = await this.client.request("GET", "/cfg/payments/currencies/");
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get currency estimate
|
|
41
|
+
*
|
|
42
|
+
* Get estimated crypto amount for a given USD amount, including min amount
|
|
43
|
+
*/
|
|
44
|
+
async currenciesEstimateRetrieve(...args) {
|
|
45
|
+
const code = args[0];
|
|
46
|
+
const isParamsObject = args.length === 2 && typeof args[1] === "object" && args[1] !== null && !Array.isArray(args[1]);
|
|
47
|
+
let params;
|
|
48
|
+
if (isParamsObject) {
|
|
49
|
+
params = args[1];
|
|
50
|
+
} else {
|
|
51
|
+
params = { amount: args[1] };
|
|
52
|
+
}
|
|
53
|
+
const response = await this.client.request("GET", `/cfg/payments/currencies/${code}/estimate/`, { params });
|
|
54
|
+
return response;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get withdrawal estimate
|
|
58
|
+
*
|
|
59
|
+
* Get estimated crypto amount for withdrawal with fee breakdown
|
|
60
|
+
*/
|
|
61
|
+
async currenciesWithdrawalEstimateRetrieve(...args) {
|
|
62
|
+
const code = args[0];
|
|
63
|
+
const isParamsObject = args.length === 2 && typeof args[1] === "object" && args[1] !== null && !Array.isArray(args[1]);
|
|
64
|
+
let params;
|
|
65
|
+
if (isParamsObject) {
|
|
66
|
+
params = args[1];
|
|
67
|
+
} else {
|
|
68
|
+
params = { amount: args[1] };
|
|
69
|
+
}
|
|
70
|
+
const response = await this.client.request("GET", `/cfg/payments/currencies/${code}/withdrawal-estimate/`, { params });
|
|
71
|
+
return response;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* ViewSet for payment operations. Endpoints: - GET /payments/ - List
|
|
75
|
+
* user's payments - GET /payments/{id}/ - Get payment details - POST
|
|
76
|
+
* /payments/create/ - Create new payment - GET /payments/{id}/status/ -
|
|
77
|
+
* Check payment status - POST /payments/{id}/confirm/ - Confirm payment
|
|
78
|
+
*/
|
|
79
|
+
async paymentsList(...args) {
|
|
80
|
+
const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
|
|
81
|
+
let params;
|
|
82
|
+
if (isParamsObject) {
|
|
83
|
+
params = args[0];
|
|
84
|
+
} else {
|
|
85
|
+
params = { page: args[0], page_size: args[1] };
|
|
86
|
+
}
|
|
87
|
+
const response = await this.client.request("GET", "/cfg/payments/payments/", { params });
|
|
88
|
+
return response;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* ViewSet for payment operations. Endpoints: - GET /payments/ - List
|
|
92
|
+
* user's payments - GET /payments/{id}/ - Get payment details - POST
|
|
93
|
+
* /payments/create/ - Create new payment - GET /payments/{id}/status/ -
|
|
94
|
+
* Check payment status - POST /payments/{id}/confirm/ - Confirm payment
|
|
95
|
+
*/
|
|
96
|
+
async paymentsRetrieve(id) {
|
|
97
|
+
const response = await this.client.request("GET", `/cfg/payments/payments/${id}/`);
|
|
98
|
+
return response;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* POST /api/v1/payments/{id}/confirm/ Confirm payment (user clicked "I
|
|
102
|
+
* have paid"). Checks status with provider and creates transaction if
|
|
103
|
+
* completed.
|
|
104
|
+
*/
|
|
105
|
+
async paymentsConfirmCreate(id) {
|
|
106
|
+
const response = await this.client.request("POST", `/cfg/payments/payments/${id}/confirm/`);
|
|
107
|
+
return response;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* GET /api/v1/payments/{id}/status/?refresh=true Check payment status
|
|
111
|
+
* (with optional refresh from provider). Query params: - refresh: boolean
|
|
112
|
+
* (default: false) - Force refresh from provider
|
|
113
|
+
*/
|
|
114
|
+
async paymentsStatusRetrieve(id) {
|
|
115
|
+
const response = await this.client.request("GET", `/cfg/payments/payments/${id}/status/`);
|
|
116
|
+
return response.results || response;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Create payment
|
|
120
|
+
*
|
|
121
|
+
* Create a new payment with specified amount and currency
|
|
122
|
+
*/
|
|
123
|
+
async paymentsCreateCreate(data) {
|
|
124
|
+
const response = await this.client.request("POST", "/cfg/payments/payments/create/", { body: data });
|
|
125
|
+
return response;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get user transactions
|
|
129
|
+
*
|
|
130
|
+
* Get user transactions with pagination and filtering
|
|
131
|
+
*/
|
|
132
|
+
async transactionsList(...args) {
|
|
133
|
+
const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
|
|
134
|
+
let params;
|
|
135
|
+
if (isParamsObject) {
|
|
136
|
+
params = args[0];
|
|
137
|
+
} else {
|
|
138
|
+
params = { limit: args[0], offset: args[1], type: args[2] };
|
|
139
|
+
}
|
|
140
|
+
const response = await this.client.request("GET", "/cfg/payments/transactions/", { params });
|
|
141
|
+
return response;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* ViewSet for withdrawal operations. Endpoints: - GET /withdrawals/ - List
|
|
145
|
+
* user's withdrawal requests - GET /withdrawals/{id}/ - Get withdrawal
|
|
146
|
+
* details - POST /withdrawals/create/ - Create withdrawal request - POST
|
|
147
|
+
* /withdrawals/{id}/cancel/ - Cancel pending withdrawal
|
|
148
|
+
*/
|
|
149
|
+
async withdrawalsList(...args) {
|
|
150
|
+
const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
|
|
151
|
+
let params;
|
|
152
|
+
if (isParamsObject) {
|
|
153
|
+
params = args[0];
|
|
154
|
+
} else {
|
|
155
|
+
params = { page: args[0], page_size: args[1] };
|
|
156
|
+
}
|
|
157
|
+
const response = await this.client.request("GET", "/cfg/payments/withdrawals/", { params });
|
|
158
|
+
return response;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* ViewSet for withdrawal operations. Endpoints: - GET /withdrawals/ - List
|
|
162
|
+
* user's withdrawal requests - GET /withdrawals/{id}/ - Get withdrawal
|
|
163
|
+
* details - POST /withdrawals/create/ - Create withdrawal request - POST
|
|
164
|
+
* /withdrawals/{id}/cancel/ - Cancel pending withdrawal
|
|
165
|
+
*/
|
|
166
|
+
async withdrawalsRetrieve(id) {
|
|
167
|
+
const response = await this.client.request("GET", `/cfg/payments/withdrawals/${id}/`);
|
|
168
|
+
return response;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Cancel withdrawal request
|
|
172
|
+
*
|
|
173
|
+
* Cancel a pending withdrawal request
|
|
174
|
+
*/
|
|
175
|
+
async withdrawalsCancelCreate(id) {
|
|
176
|
+
const response = await this.client.request("POST", `/cfg/payments/withdrawals/${id}/cancel/`);
|
|
177
|
+
return response;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Create withdrawal request
|
|
181
|
+
*
|
|
182
|
+
* Create a new withdrawal request (requires admin approval)
|
|
183
|
+
*/
|
|
184
|
+
async withdrawalsCreateCreate(data) {
|
|
185
|
+
const response = await this.client.request("POST", "/cfg/payments/withdrawals/create/", { body: data });
|
|
186
|
+
return response;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// src/api/generated/ext_payments/http.ts
|
|
191
|
+
var FetchAdapter = class {
|
|
192
|
+
async request(request) {
|
|
193
|
+
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
194
|
+
let finalUrl = url;
|
|
195
|
+
if (params) {
|
|
196
|
+
const searchParams = new URLSearchParams();
|
|
197
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
198
|
+
if (value !== null && value !== void 0) {
|
|
199
|
+
searchParams.append(key, String(value));
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
const queryString = searchParams.toString();
|
|
203
|
+
if (queryString) {
|
|
204
|
+
finalUrl = url.includes("?") ? `${url}&${queryString}` : `${url}?${queryString}`;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const finalHeaders = { ...headers };
|
|
208
|
+
let requestBody;
|
|
209
|
+
if (formData) {
|
|
210
|
+
requestBody = formData;
|
|
211
|
+
} else if (binaryBody) {
|
|
212
|
+
finalHeaders["Content-Type"] = "application/octet-stream";
|
|
213
|
+
requestBody = binaryBody;
|
|
214
|
+
} else if (body) {
|
|
215
|
+
finalHeaders["Content-Type"] = "application/json";
|
|
216
|
+
requestBody = JSON.stringify(body);
|
|
217
|
+
}
|
|
218
|
+
const response = await fetch(finalUrl, {
|
|
219
|
+
method,
|
|
220
|
+
headers: finalHeaders,
|
|
221
|
+
body: requestBody,
|
|
222
|
+
credentials: "include"
|
|
223
|
+
// Include Django session cookies
|
|
224
|
+
});
|
|
225
|
+
let data = null;
|
|
226
|
+
const contentType = response.headers.get("content-type");
|
|
227
|
+
if (response.status !== 204 && contentType?.includes("application/json")) {
|
|
228
|
+
data = await response.json();
|
|
229
|
+
} else if (response.status !== 204) {
|
|
230
|
+
data = await response.text();
|
|
231
|
+
}
|
|
232
|
+
const responseHeaders = {};
|
|
233
|
+
response.headers.forEach((value, key) => {
|
|
234
|
+
responseHeaders[key] = value;
|
|
235
|
+
});
|
|
236
|
+
return {
|
|
237
|
+
data,
|
|
238
|
+
status: response.status,
|
|
239
|
+
statusText: response.statusText,
|
|
240
|
+
headers: responseHeaders
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// src/api/generated/ext_payments/errors.ts
|
|
246
|
+
var APIError = class extends Error {
|
|
247
|
+
constructor(statusCode, statusText, response, url, message) {
|
|
248
|
+
super(message || `HTTP ${statusCode}: ${statusText}`);
|
|
249
|
+
this.statusCode = statusCode;
|
|
250
|
+
this.statusText = statusText;
|
|
251
|
+
this.response = response;
|
|
252
|
+
this.url = url;
|
|
253
|
+
this.name = "APIError";
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get error details from response.
|
|
257
|
+
* DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] }
|
|
258
|
+
*/
|
|
259
|
+
get details() {
|
|
260
|
+
if (typeof this.response === "object" && this.response !== null) {
|
|
261
|
+
return this.response;
|
|
262
|
+
}
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Get field-specific validation errors from DRF.
|
|
267
|
+
* Returns: { "field_name": ["error1", "error2"], ... }
|
|
268
|
+
*/
|
|
269
|
+
get fieldErrors() {
|
|
270
|
+
const details = this.details;
|
|
271
|
+
if (!details) return null;
|
|
272
|
+
const fieldErrors = {};
|
|
273
|
+
for (const [key, value] of Object.entries(details)) {
|
|
274
|
+
if (Array.isArray(value)) {
|
|
275
|
+
fieldErrors[key] = value;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return Object.keys(fieldErrors).length > 0 ? fieldErrors : null;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Get single error message from DRF.
|
|
282
|
+
* Checks for "detail", "message", or first field error.
|
|
283
|
+
*/
|
|
284
|
+
get errorMessage() {
|
|
285
|
+
const details = this.details;
|
|
286
|
+
if (!details) return this.message;
|
|
287
|
+
if (details.detail) {
|
|
288
|
+
return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
|
|
289
|
+
}
|
|
290
|
+
if (details.message) {
|
|
291
|
+
return String(details.message);
|
|
292
|
+
}
|
|
293
|
+
const fieldErrors = this.fieldErrors;
|
|
294
|
+
if (fieldErrors) {
|
|
295
|
+
const firstField = Object.keys(fieldErrors)[0];
|
|
296
|
+
if (firstField) {
|
|
297
|
+
return `${firstField}: ${fieldErrors[firstField]?.join(", ")}`;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return this.message;
|
|
301
|
+
}
|
|
302
|
+
// Helper methods for common HTTP status codes
|
|
303
|
+
get isValidationError() {
|
|
304
|
+
return this.statusCode === 400;
|
|
305
|
+
}
|
|
306
|
+
get isAuthError() {
|
|
307
|
+
return this.statusCode === 401;
|
|
308
|
+
}
|
|
309
|
+
get isPermissionError() {
|
|
310
|
+
return this.statusCode === 403;
|
|
311
|
+
}
|
|
312
|
+
get isNotFoundError() {
|
|
313
|
+
return this.statusCode === 404;
|
|
314
|
+
}
|
|
315
|
+
get isServerError() {
|
|
316
|
+
return this.statusCode >= 500 && this.statusCode < 600;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
var NetworkError = class extends Error {
|
|
320
|
+
constructor(message, url, originalError) {
|
|
321
|
+
super(message);
|
|
322
|
+
this.url = url;
|
|
323
|
+
this.originalError = originalError;
|
|
324
|
+
this.name = "NetworkError";
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
var DEFAULT_CONFIG = {
|
|
328
|
+
enabled: process.env.NODE_ENV !== "production",
|
|
329
|
+
logRequests: true,
|
|
330
|
+
logResponses: true,
|
|
331
|
+
logErrors: true,
|
|
332
|
+
logBodies: true,
|
|
333
|
+
logHeaders: false
|
|
334
|
+
};
|
|
335
|
+
var SENSITIVE_HEADERS = [
|
|
336
|
+
"authorization",
|
|
337
|
+
"cookie",
|
|
338
|
+
"set-cookie",
|
|
339
|
+
"x-api-key",
|
|
340
|
+
"x-csrf-token"
|
|
341
|
+
];
|
|
342
|
+
var APILogger = class {
|
|
343
|
+
config;
|
|
344
|
+
consola;
|
|
345
|
+
constructor(config = {}) {
|
|
346
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
347
|
+
this.consola = config.consola || consola.createConsola({
|
|
348
|
+
level: this.config.enabled ? 4 : 0
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Enable logging
|
|
353
|
+
*/
|
|
354
|
+
enable() {
|
|
355
|
+
this.config.enabled = true;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Disable logging
|
|
359
|
+
*/
|
|
360
|
+
disable() {
|
|
361
|
+
this.config.enabled = false;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Update configuration
|
|
365
|
+
*/
|
|
366
|
+
setConfig(config) {
|
|
367
|
+
this.config = { ...this.config, ...config };
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Filter sensitive headers
|
|
371
|
+
*/
|
|
372
|
+
filterHeaders(headers) {
|
|
373
|
+
if (!headers) return {};
|
|
374
|
+
const filtered = {};
|
|
375
|
+
Object.keys(headers).forEach((key) => {
|
|
376
|
+
const lowerKey = key.toLowerCase();
|
|
377
|
+
if (SENSITIVE_HEADERS.includes(lowerKey)) {
|
|
378
|
+
filtered[key] = "***";
|
|
379
|
+
} else {
|
|
380
|
+
filtered[key] = headers[key] || "";
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
return filtered;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Log request
|
|
387
|
+
*/
|
|
388
|
+
logRequest(request) {
|
|
389
|
+
if (!this.config.enabled || !this.config.logRequests) return;
|
|
390
|
+
const { method, url, headers, body } = request;
|
|
391
|
+
this.consola.start(`${method} ${url}`);
|
|
392
|
+
if (this.config.logHeaders && headers) {
|
|
393
|
+
this.consola.debug("Headers:", this.filterHeaders(headers));
|
|
394
|
+
}
|
|
395
|
+
if (this.config.logBodies && body) {
|
|
396
|
+
this.consola.debug("Body:", body);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Log response
|
|
401
|
+
*/
|
|
402
|
+
logResponse(request, response) {
|
|
403
|
+
if (!this.config.enabled || !this.config.logResponses) return;
|
|
404
|
+
const { method, url } = request;
|
|
405
|
+
const { status, statusText, data, duration } = response;
|
|
406
|
+
this.consola.success(
|
|
407
|
+
`${method} ${url} ${status} ${statusText} (${duration}ms)`
|
|
408
|
+
);
|
|
409
|
+
if (this.config.logBodies && data) {
|
|
410
|
+
this.consola.debug("Response:", data);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Log error
|
|
415
|
+
*/
|
|
416
|
+
logError(request, error) {
|
|
417
|
+
if (!this.config.enabled || !this.config.logErrors) return;
|
|
418
|
+
const { method, url } = request;
|
|
419
|
+
const { message, statusCode, fieldErrors, duration } = error;
|
|
420
|
+
this.consola.error(
|
|
421
|
+
`${method} ${url} ${statusCode || "Network"} Error (${duration}ms)`
|
|
422
|
+
);
|
|
423
|
+
this.consola.error("Message:", message);
|
|
424
|
+
if (fieldErrors && Object.keys(fieldErrors).length > 0) {
|
|
425
|
+
this.consola.error("Field Errors:");
|
|
426
|
+
Object.entries(fieldErrors).forEach(([field, errors]) => {
|
|
427
|
+
errors.forEach((err) => {
|
|
428
|
+
this.consola.error(` \u2022 ${field}: ${err}`);
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Log general info
|
|
435
|
+
*/
|
|
436
|
+
info(message, ...args) {
|
|
437
|
+
if (!this.config.enabled) return;
|
|
438
|
+
this.consola.info(message, ...args);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Log warning
|
|
442
|
+
*/
|
|
443
|
+
warn(message, ...args) {
|
|
444
|
+
if (!this.config.enabled) return;
|
|
445
|
+
this.consola.warn(message, ...args);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Log error
|
|
449
|
+
*/
|
|
450
|
+
error(message, ...args) {
|
|
451
|
+
if (!this.config.enabled) return;
|
|
452
|
+
this.consola.error(message, ...args);
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Log debug
|
|
456
|
+
*/
|
|
457
|
+
debug(message, ...args) {
|
|
458
|
+
if (!this.config.enabled) return;
|
|
459
|
+
this.consola.debug(message, ...args);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Log success
|
|
463
|
+
*/
|
|
464
|
+
success(message, ...args) {
|
|
465
|
+
if (!this.config.enabled) return;
|
|
466
|
+
this.consola.success(message, ...args);
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Create a sub-logger with prefix
|
|
470
|
+
*/
|
|
471
|
+
withTag(tag) {
|
|
472
|
+
return this.consola.withTag(tag);
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
new APILogger();
|
|
476
|
+
var DEFAULT_RETRY_CONFIG = {
|
|
477
|
+
retries: 3,
|
|
478
|
+
factor: 2,
|
|
479
|
+
minTimeout: 1e3,
|
|
480
|
+
maxTimeout: 6e4,
|
|
481
|
+
randomize: true,
|
|
482
|
+
onFailedAttempt: () => {
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
function shouldRetry(error) {
|
|
486
|
+
if (error instanceof NetworkError) {
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
if (error instanceof APIError) {
|
|
490
|
+
const status = error.statusCode;
|
|
491
|
+
if (status >= 500 && status < 600) {
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
if (status === 429) {
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
async function withRetry(fn, config) {
|
|
502
|
+
const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };
|
|
503
|
+
return pRetry__default.default(
|
|
504
|
+
async () => {
|
|
505
|
+
try {
|
|
506
|
+
return await fn();
|
|
507
|
+
} catch (error) {
|
|
508
|
+
if (!shouldRetry(error)) {
|
|
509
|
+
throw new pRetry.AbortError(error);
|
|
510
|
+
}
|
|
511
|
+
throw error;
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
retries: finalConfig.retries,
|
|
516
|
+
factor: finalConfig.factor,
|
|
517
|
+
minTimeout: finalConfig.minTimeout,
|
|
518
|
+
maxTimeout: finalConfig.maxTimeout,
|
|
519
|
+
randomize: finalConfig.randomize,
|
|
520
|
+
onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {
|
|
521
|
+
const pRetryError = error;
|
|
522
|
+
finalConfig.onFailedAttempt({
|
|
523
|
+
error: pRetryError,
|
|
524
|
+
attemptNumber: pRetryError.attemptNumber,
|
|
525
|
+
retriesLeft: pRetryError.retriesLeft
|
|
526
|
+
});
|
|
527
|
+
} : void 0
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// src/api/generated/ext_payments/client.ts
|
|
533
|
+
var APIClient = class {
|
|
534
|
+
baseUrl;
|
|
535
|
+
httpClient;
|
|
536
|
+
logger = null;
|
|
537
|
+
retryConfig = null;
|
|
538
|
+
tokenGetter = null;
|
|
539
|
+
// Sub-clients
|
|
540
|
+
ext_payments_payments;
|
|
541
|
+
constructor(baseUrl, options) {
|
|
542
|
+
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
543
|
+
this.httpClient = options?.httpClient || new FetchAdapter();
|
|
544
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
545
|
+
if (options?.loggerConfig !== void 0) {
|
|
546
|
+
this.logger = new APILogger(options.loggerConfig);
|
|
547
|
+
}
|
|
548
|
+
if (options?.retryConfig !== void 0) {
|
|
549
|
+
this.retryConfig = options.retryConfig;
|
|
550
|
+
}
|
|
551
|
+
this.ext_payments_payments = new ExtPaymentsPayments(this);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Get CSRF token from cookies (for SessionAuthentication).
|
|
555
|
+
*
|
|
556
|
+
* Returns null if cookie doesn't exist (JWT-only auth).
|
|
557
|
+
*/
|
|
558
|
+
getCsrfToken() {
|
|
559
|
+
const name = "csrftoken";
|
|
560
|
+
const value = `; ${document.cookie}`;
|
|
561
|
+
const parts = value.split(`; ${name}=`);
|
|
562
|
+
if (parts.length === 2) {
|
|
563
|
+
return parts.pop()?.split(";").shift() || null;
|
|
564
|
+
}
|
|
565
|
+
return null;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Get the base URL for building streaming/download URLs.
|
|
569
|
+
*/
|
|
570
|
+
getBaseUrl() {
|
|
571
|
+
return this.baseUrl;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
575
|
+
* Returns null if no token getter is configured or no token is available.
|
|
576
|
+
*/
|
|
577
|
+
getToken() {
|
|
578
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Make HTTP request with Django CSRF and session handling.
|
|
582
|
+
* Automatically retries on network errors and 5xx server errors.
|
|
583
|
+
*/
|
|
584
|
+
async request(method, path, options) {
|
|
585
|
+
if (this.retryConfig) {
|
|
586
|
+
return withRetry(() => this._makeRequest(method, path, options), {
|
|
587
|
+
...this.retryConfig,
|
|
588
|
+
onFailedAttempt: (info) => {
|
|
589
|
+
if (this.logger) {
|
|
590
|
+
this.logger.warn(
|
|
591
|
+
`Retry attempt ${info.attemptNumber}/${info.retriesLeft + info.attemptNumber} for ${method} ${path}: ${info.error.message}`
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
this.retryConfig?.onFailedAttempt?.(info);
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
return this._makeRequest(method, path, options);
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Internal request method (without retry wrapper).
|
|
602
|
+
* Used by request() method with optional retry logic.
|
|
603
|
+
*/
|
|
604
|
+
async _makeRequest(method, path, options) {
|
|
605
|
+
const url = this.baseUrl ? `${this.baseUrl}${path}` : path;
|
|
606
|
+
const startTime = Date.now();
|
|
607
|
+
const headers = {
|
|
608
|
+
...options?.headers || {}
|
|
609
|
+
};
|
|
610
|
+
if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
|
|
611
|
+
headers["Content-Type"] = "application/json";
|
|
612
|
+
}
|
|
613
|
+
if (this.logger) {
|
|
614
|
+
this.logger.logRequest({
|
|
615
|
+
method,
|
|
616
|
+
url,
|
|
617
|
+
headers,
|
|
618
|
+
body: options?.formData || options?.body,
|
|
619
|
+
timestamp: startTime
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
try {
|
|
623
|
+
const response = await this.httpClient.request({
|
|
624
|
+
method,
|
|
625
|
+
url,
|
|
626
|
+
headers,
|
|
627
|
+
params: options?.params,
|
|
628
|
+
body: options?.body,
|
|
629
|
+
formData: options?.formData,
|
|
630
|
+
binaryBody: options?.binaryBody
|
|
631
|
+
});
|
|
632
|
+
const duration = Date.now() - startTime;
|
|
633
|
+
if (response.status >= 400) {
|
|
634
|
+
const error = new APIError(
|
|
635
|
+
response.status,
|
|
636
|
+
response.statusText,
|
|
637
|
+
response.data,
|
|
638
|
+
url
|
|
639
|
+
);
|
|
640
|
+
if (this.logger) {
|
|
641
|
+
this.logger.logError(
|
|
642
|
+
{
|
|
643
|
+
method,
|
|
644
|
+
url,
|
|
645
|
+
headers,
|
|
646
|
+
body: options?.formData || options?.body,
|
|
647
|
+
timestamp: startTime
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
message: error.message,
|
|
651
|
+
statusCode: response.status,
|
|
652
|
+
duration,
|
|
653
|
+
timestamp: Date.now()
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
throw error;
|
|
658
|
+
}
|
|
659
|
+
if (this.logger) {
|
|
660
|
+
this.logger.logResponse(
|
|
661
|
+
{
|
|
662
|
+
method,
|
|
663
|
+
url,
|
|
664
|
+
headers,
|
|
665
|
+
body: options?.formData || options?.body,
|
|
666
|
+
timestamp: startTime
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
status: response.status,
|
|
670
|
+
statusText: response.statusText,
|
|
671
|
+
data: response.data,
|
|
672
|
+
duration,
|
|
673
|
+
timestamp: Date.now()
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
return response.data;
|
|
678
|
+
} catch (error) {
|
|
679
|
+
const duration = Date.now() - startTime;
|
|
680
|
+
if (error instanceof APIError) {
|
|
681
|
+
throw error;
|
|
682
|
+
}
|
|
683
|
+
const isCORSError = error instanceof TypeError && (error.message.toLowerCase().includes("cors") || error.message.toLowerCase().includes("failed to fetch") || error.message.toLowerCase().includes("network request failed"));
|
|
684
|
+
if (this.logger) {
|
|
685
|
+
if (isCORSError) {
|
|
686
|
+
this.logger.error(`\u{1F6AB} CORS Error: ${method} ${url}`);
|
|
687
|
+
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
688
|
+
this.logger.error(` \u2192 Configure security_domains parameter on the server`);
|
|
689
|
+
} else {
|
|
690
|
+
this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
|
|
691
|
+
this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
if (typeof window !== "undefined") {
|
|
695
|
+
try {
|
|
696
|
+
if (isCORSError) {
|
|
697
|
+
window.dispatchEvent(new CustomEvent("cors-error", {
|
|
698
|
+
detail: {
|
|
699
|
+
url,
|
|
700
|
+
method,
|
|
701
|
+
error: error instanceof Error ? error.message : String(error),
|
|
702
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
703
|
+
},
|
|
704
|
+
bubbles: true,
|
|
705
|
+
cancelable: false
|
|
706
|
+
}));
|
|
707
|
+
} else {
|
|
708
|
+
window.dispatchEvent(new CustomEvent("network-error", {
|
|
709
|
+
detail: {
|
|
710
|
+
url,
|
|
711
|
+
method,
|
|
712
|
+
error: error instanceof Error ? error.message : String(error),
|
|
713
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
714
|
+
},
|
|
715
|
+
bubbles: true,
|
|
716
|
+
cancelable: false
|
|
717
|
+
}));
|
|
718
|
+
}
|
|
719
|
+
} catch (eventError) {
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
const networkError = error instanceof Error ? new NetworkError(error.message, url, error) : new NetworkError("Unknown error", url);
|
|
723
|
+
if (this.logger) {
|
|
724
|
+
this.logger.logError(
|
|
725
|
+
{
|
|
726
|
+
method,
|
|
727
|
+
url,
|
|
728
|
+
headers,
|
|
729
|
+
body: options?.formData || options?.body,
|
|
730
|
+
timestamp: startTime
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
message: networkError.message,
|
|
734
|
+
duration,
|
|
735
|
+
timestamp: Date.now()
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
throw networkError;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
// src/api/generated/ext_payments/storage.ts
|
|
745
|
+
var LocalStorageAdapter = class {
|
|
746
|
+
logger;
|
|
747
|
+
constructor(logger) {
|
|
748
|
+
this.logger = logger;
|
|
749
|
+
}
|
|
750
|
+
getItem(key) {
|
|
751
|
+
try {
|
|
752
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
753
|
+
const value = localStorage.getItem(key);
|
|
754
|
+
this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? "found" : "not found"}`);
|
|
755
|
+
return value;
|
|
756
|
+
}
|
|
757
|
+
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
758
|
+
} catch (error) {
|
|
759
|
+
this.logger?.error("LocalStorage.getItem failed:", error);
|
|
760
|
+
}
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
763
|
+
setItem(key, value) {
|
|
764
|
+
try {
|
|
765
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
766
|
+
localStorage.setItem(key, value);
|
|
767
|
+
this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
|
|
768
|
+
} else {
|
|
769
|
+
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
770
|
+
}
|
|
771
|
+
} catch (error) {
|
|
772
|
+
this.logger?.error("LocalStorage.setItem failed:", error);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
removeItem(key) {
|
|
776
|
+
try {
|
|
777
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
778
|
+
localStorage.removeItem(key);
|
|
779
|
+
this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
|
|
780
|
+
} else {
|
|
781
|
+
this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
|
|
782
|
+
}
|
|
783
|
+
} catch (error) {
|
|
784
|
+
this.logger?.error("LocalStorage.removeItem failed:", error);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
// src/api/generated/ext_payments/enums.ts
|
|
790
|
+
var PaymentDetailStatus = /* @__PURE__ */ ((PaymentDetailStatus2) => {
|
|
791
|
+
PaymentDetailStatus2["PENDING"] = "pending";
|
|
792
|
+
PaymentDetailStatus2["CONFIRMING"] = "confirming";
|
|
793
|
+
PaymentDetailStatus2["CONFIRMED"] = "confirmed";
|
|
794
|
+
PaymentDetailStatus2["COMPLETED"] = "completed";
|
|
795
|
+
PaymentDetailStatus2["PARTIALLY_PAID"] = "partially_paid";
|
|
796
|
+
PaymentDetailStatus2["FAILED"] = "failed";
|
|
797
|
+
PaymentDetailStatus2["EXPIRED"] = "expired";
|
|
798
|
+
PaymentDetailStatus2["CANCELLED"] = "cancelled";
|
|
799
|
+
return PaymentDetailStatus2;
|
|
800
|
+
})(PaymentDetailStatus || {});
|
|
801
|
+
var PaymentListStatus = /* @__PURE__ */ ((PaymentListStatus2) => {
|
|
802
|
+
PaymentListStatus2["PENDING"] = "pending";
|
|
803
|
+
PaymentListStatus2["CONFIRMING"] = "confirming";
|
|
804
|
+
PaymentListStatus2["CONFIRMED"] = "confirmed";
|
|
805
|
+
PaymentListStatus2["COMPLETED"] = "completed";
|
|
806
|
+
PaymentListStatus2["PARTIALLY_PAID"] = "partially_paid";
|
|
807
|
+
PaymentListStatus2["FAILED"] = "failed";
|
|
808
|
+
PaymentListStatus2["EXPIRED"] = "expired";
|
|
809
|
+
PaymentListStatus2["CANCELLED"] = "cancelled";
|
|
810
|
+
return PaymentListStatus2;
|
|
811
|
+
})(PaymentListStatus || {});
|
|
812
|
+
var TransactionTransactionType = /* @__PURE__ */ ((TransactionTransactionType2) => {
|
|
813
|
+
TransactionTransactionType2["DEPOSIT"] = "deposit";
|
|
814
|
+
TransactionTransactionType2["WITHDRAWAL"] = "withdrawal";
|
|
815
|
+
TransactionTransactionType2["PAYMENT"] = "payment";
|
|
816
|
+
TransactionTransactionType2["REFUND"] = "refund";
|
|
817
|
+
TransactionTransactionType2["FEE"] = "fee";
|
|
818
|
+
TransactionTransactionType2["BONUS"] = "bonus";
|
|
819
|
+
TransactionTransactionType2["ADJUSTMENT"] = "adjustment";
|
|
820
|
+
return TransactionTransactionType2;
|
|
821
|
+
})(TransactionTransactionType || {});
|
|
822
|
+
var WithdrawalDetailStatus = /* @__PURE__ */ ((WithdrawalDetailStatus2) => {
|
|
823
|
+
WithdrawalDetailStatus2["PENDING"] = "pending";
|
|
824
|
+
WithdrawalDetailStatus2["APPROVED"] = "approved";
|
|
825
|
+
WithdrawalDetailStatus2["PROCESSING"] = "processing";
|
|
826
|
+
WithdrawalDetailStatus2["COMPLETED"] = "completed";
|
|
827
|
+
WithdrawalDetailStatus2["REJECTED"] = "rejected";
|
|
828
|
+
WithdrawalDetailStatus2["CANCELLED"] = "cancelled";
|
|
829
|
+
return WithdrawalDetailStatus2;
|
|
830
|
+
})(WithdrawalDetailStatus || {});
|
|
831
|
+
var WithdrawalListStatus = /* @__PURE__ */ ((WithdrawalListStatus2) => {
|
|
832
|
+
WithdrawalListStatus2["PENDING"] = "pending";
|
|
833
|
+
WithdrawalListStatus2["APPROVED"] = "approved";
|
|
834
|
+
WithdrawalListStatus2["PROCESSING"] = "processing";
|
|
835
|
+
WithdrawalListStatus2["COMPLETED"] = "completed";
|
|
836
|
+
WithdrawalListStatus2["REJECTED"] = "rejected";
|
|
837
|
+
WithdrawalListStatus2["CANCELLED"] = "cancelled";
|
|
838
|
+
return WithdrawalListStatus2;
|
|
839
|
+
})(WithdrawalListStatus || {});
|
|
840
|
+
var BalanceSchema = zod.z.object({
|
|
841
|
+
balance_usd: zod.z.string(),
|
|
842
|
+
balance_display: zod.z.string(),
|
|
843
|
+
total_deposited: zod.z.string(),
|
|
844
|
+
total_withdrawn: zod.z.string(),
|
|
845
|
+
last_transaction_at: zod.z.string().datetime({ offset: true }).nullable()
|
|
846
|
+
});
|
|
847
|
+
var CurrencySchema = zod.z.object({
|
|
848
|
+
code: zod.z.string(),
|
|
849
|
+
name: zod.z.string(),
|
|
850
|
+
token: zod.z.string(),
|
|
851
|
+
network: zod.z.string().nullable(),
|
|
852
|
+
display_name: zod.z.string(),
|
|
853
|
+
symbol: zod.z.string(),
|
|
854
|
+
decimal_places: zod.z.int(),
|
|
855
|
+
is_active: zod.z.boolean(),
|
|
856
|
+
min_amount_usd: zod.z.string(),
|
|
857
|
+
sort_order: zod.z.int()
|
|
858
|
+
});
|
|
859
|
+
var PaymentListSchema = zod.z.object({
|
|
860
|
+
id: zod.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
861
|
+
internal_payment_id: zod.z.string(),
|
|
862
|
+
amount_usd: zod.z.string(),
|
|
863
|
+
currency_code: zod.z.string(),
|
|
864
|
+
currency_token: zod.z.string(),
|
|
865
|
+
status: zod.z.nativeEnum(PaymentListStatus),
|
|
866
|
+
status_display: zod.z.string(),
|
|
867
|
+
created_at: zod.z.string().datetime({ offset: true }),
|
|
868
|
+
completed_at: zod.z.string().datetime({ offset: true }).nullable()
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
// src/api/generated/ext_payments/_utils/schemas/PaginatedPaymentListList.schema.ts
|
|
872
|
+
var PaginatedPaymentListListSchema = zod.z.object({
|
|
873
|
+
count: zod.z.int(),
|
|
874
|
+
page: zod.z.int(),
|
|
875
|
+
pages: zod.z.int(),
|
|
876
|
+
page_size: zod.z.int(),
|
|
877
|
+
has_next: zod.z.boolean(),
|
|
878
|
+
has_previous: zod.z.boolean(),
|
|
879
|
+
next_page: zod.z.int().nullable().optional(),
|
|
880
|
+
previous_page: zod.z.int().nullable().optional(),
|
|
881
|
+
results: zod.z.array(PaymentListSchema)
|
|
882
|
+
});
|
|
883
|
+
var WithdrawalListSchema = zod.z.object({
|
|
884
|
+
id: zod.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
885
|
+
internal_withdrawal_id: zod.z.string(),
|
|
886
|
+
amount_usd: zod.z.string(),
|
|
887
|
+
final_amount_usd: zod.z.string(),
|
|
888
|
+
currency_code: zod.z.string(),
|
|
889
|
+
currency_token: zod.z.string(),
|
|
890
|
+
status: zod.z.nativeEnum(WithdrawalListStatus),
|
|
891
|
+
status_display: zod.z.string(),
|
|
892
|
+
created_at: zod.z.string().datetime({ offset: true }),
|
|
893
|
+
completed_at: zod.z.string().datetime({ offset: true }).nullable()
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
// src/api/generated/ext_payments/_utils/schemas/PaginatedWithdrawalListList.schema.ts
|
|
897
|
+
var PaginatedWithdrawalListListSchema = zod.z.object({
|
|
898
|
+
count: zod.z.int(),
|
|
899
|
+
page: zod.z.int(),
|
|
900
|
+
pages: zod.z.int(),
|
|
901
|
+
page_size: zod.z.int(),
|
|
902
|
+
has_next: zod.z.boolean(),
|
|
903
|
+
has_previous: zod.z.boolean(),
|
|
904
|
+
next_page: zod.z.int().nullable().optional(),
|
|
905
|
+
previous_page: zod.z.int().nullable().optional(),
|
|
906
|
+
results: zod.z.array(WithdrawalListSchema)
|
|
907
|
+
});
|
|
908
|
+
var PaymentCreateRequestSchema = zod.z.object({
|
|
909
|
+
amount_usd: zod.z.string(),
|
|
910
|
+
currency_code: zod.z.string().min(1).max(20),
|
|
911
|
+
description: zod.z.string().max(500).optional()
|
|
912
|
+
});
|
|
913
|
+
var PaymentDetailSchema = zod.z.object({
|
|
914
|
+
id: zod.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
915
|
+
internal_payment_id: zod.z.string(),
|
|
916
|
+
amount_usd: zod.z.string(),
|
|
917
|
+
currency_code: zod.z.string(),
|
|
918
|
+
currency_name: zod.z.string(),
|
|
919
|
+
currency_token: zod.z.string(),
|
|
920
|
+
currency_network: zod.z.string(),
|
|
921
|
+
pay_amount: zod.z.string().nullable(),
|
|
922
|
+
actual_amount: zod.z.string().nullable(),
|
|
923
|
+
actual_amount_usd: zod.z.string().nullable(),
|
|
924
|
+
status: zod.z.nativeEnum(PaymentDetailStatus),
|
|
925
|
+
status_display: zod.z.string(),
|
|
926
|
+
pay_address: zod.z.string().nullable(),
|
|
927
|
+
qr_code_url: zod.z.string().nullable(),
|
|
928
|
+
payment_url: zod.z.union([zod.z.url(), zod.z.literal("")]).nullable(),
|
|
929
|
+
transaction_hash: zod.z.string().nullable(),
|
|
930
|
+
explorer_link: zod.z.string().nullable(),
|
|
931
|
+
confirmations_count: zod.z.int(),
|
|
932
|
+
expires_at: zod.z.string().datetime({ offset: true }).nullable(),
|
|
933
|
+
completed_at: zod.z.string().datetime({ offset: true }).nullable(),
|
|
934
|
+
created_at: zod.z.string().datetime({ offset: true }),
|
|
935
|
+
is_completed: zod.z.boolean(),
|
|
936
|
+
is_failed: zod.z.boolean(),
|
|
937
|
+
is_expired: zod.z.boolean(),
|
|
938
|
+
description: zod.z.string()
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
// src/api/generated/ext_payments/_utils/schemas/PaymentCreateResponse.schema.ts
|
|
942
|
+
var PaymentCreateResponseSchema = zod.z.object({
|
|
943
|
+
success: zod.z.boolean(),
|
|
944
|
+
payment: PaymentDetailSchema,
|
|
945
|
+
qr_code_url: zod.z.union([zod.z.url(), zod.z.literal("")]).nullable()
|
|
946
|
+
});
|
|
947
|
+
var TransactionSchema = zod.z.object({
|
|
948
|
+
id: zod.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
949
|
+
transaction_type: zod.z.nativeEnum(TransactionTransactionType),
|
|
950
|
+
type_display: zod.z.string(),
|
|
951
|
+
amount_usd: zod.z.string(),
|
|
952
|
+
amount_display: zod.z.string(),
|
|
953
|
+
balance_after: zod.z.string(),
|
|
954
|
+
payment_id: zod.z.string().nullable(),
|
|
955
|
+
description: zod.z.string(),
|
|
956
|
+
created_at: zod.z.string().datetime({ offset: true })
|
|
957
|
+
});
|
|
958
|
+
var WithdrawalDetailSchema = zod.z.object({
|
|
959
|
+
id: zod.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
960
|
+
internal_withdrawal_id: zod.z.string(),
|
|
961
|
+
amount_usd: zod.z.string(),
|
|
962
|
+
currency_code: zod.z.string(),
|
|
963
|
+
currency_name: zod.z.string(),
|
|
964
|
+
currency_token: zod.z.string(),
|
|
965
|
+
currency_network: zod.z.string(),
|
|
966
|
+
wallet_address: zod.z.string(),
|
|
967
|
+
network_fee_usd: zod.z.string(),
|
|
968
|
+
service_fee_usd: zod.z.string(),
|
|
969
|
+
total_fee_usd: zod.z.string(),
|
|
970
|
+
final_amount_usd: zod.z.string(),
|
|
971
|
+
crypto_amount: zod.z.string().nullable(),
|
|
972
|
+
status: zod.z.nativeEnum(WithdrawalDetailStatus),
|
|
973
|
+
status_display: zod.z.string(),
|
|
974
|
+
transaction_hash: zod.z.string().nullable(),
|
|
975
|
+
explorer_link: zod.z.string().nullable(),
|
|
976
|
+
admin_notes: zod.z.string(),
|
|
977
|
+
created_at: zod.z.string().datetime({ offset: true }),
|
|
978
|
+
approved_at: zod.z.string().datetime({ offset: true }).nullable(),
|
|
979
|
+
completed_at: zod.z.string().datetime({ offset: true }).nullable(),
|
|
980
|
+
rejected_at: zod.z.string().datetime({ offset: true }).nullable(),
|
|
981
|
+
cancelled_at: zod.z.string().datetime({ offset: true }).nullable()
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
// src/api/generated/ext_payments/_utils/schemas/WithdrawalCancelResponse.schema.ts
|
|
985
|
+
var WithdrawalCancelResponseSchema = zod.z.object({
|
|
986
|
+
success: zod.z.boolean(),
|
|
987
|
+
withdrawal: WithdrawalDetailSchema,
|
|
988
|
+
message: zod.z.string()
|
|
989
|
+
});
|
|
990
|
+
var WithdrawalCreateRequestSchema = zod.z.object({
|
|
991
|
+
amount_usd: zod.z.string(),
|
|
992
|
+
currency_code: zod.z.string().min(1).max(20),
|
|
993
|
+
wallet_address: zod.z.string().min(1).max(255)
|
|
994
|
+
});
|
|
995
|
+
var WithdrawalCreateResponseSchema = zod.z.object({
|
|
996
|
+
success: zod.z.boolean(),
|
|
997
|
+
withdrawal: WithdrawalDetailSchema,
|
|
998
|
+
message: zod.z.string()
|
|
999
|
+
});
|
|
1000
|
+
|
|
1001
|
+
// src/api/generated/ext_payments/api-instance.ts
|
|
1002
|
+
var globalAPI = null;
|
|
1003
|
+
var autoConfigAttempted = false;
|
|
1004
|
+
function tryAutoConfigureFromEnv() {
|
|
1005
|
+
if (autoConfigAttempted) return;
|
|
1006
|
+
autoConfigAttempted = true;
|
|
1007
|
+
if (globalAPI) return;
|
|
1008
|
+
if (typeof process === "undefined" || !process.env) return;
|
|
1009
|
+
const baseUrl = process.env.NEXT_PUBLIC_API_URL || process.env.VITE_API_URL || process.env.REACT_APP_API_URL || process.env.API_URL;
|
|
1010
|
+
if (baseUrl) {
|
|
1011
|
+
globalAPI = new API(baseUrl);
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
function getAPIInstance() {
|
|
1015
|
+
tryAutoConfigureFromEnv();
|
|
1016
|
+
if (!globalAPI) {
|
|
1017
|
+
throw new Error(
|
|
1018
|
+
'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })\n\nOr set environment variable: NEXT_PUBLIC_API_URL, VITE_API_URL, or REACT_APP_API_URL'
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
return globalAPI;
|
|
1022
|
+
}
|
|
1023
|
+
function configureAPI(config) {
|
|
1024
|
+
globalAPI = new API(config.baseUrl, config.options);
|
|
1025
|
+
if (config.token) {
|
|
1026
|
+
globalAPI.setToken(config.token, config.refreshToken);
|
|
1027
|
+
}
|
|
1028
|
+
return globalAPI;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// src/api/generated/ext_payments/_utils/fetchers/ext_payments__payments.ts
|
|
1032
|
+
async function getPaymentsBalanceRetrieve(client) {
|
|
1033
|
+
const api = client || getAPIInstance();
|
|
1034
|
+
const response = await api.ext_payments_payments.balanceRetrieve();
|
|
1035
|
+
try {
|
|
1036
|
+
return BalanceSchema.parse(response);
|
|
1037
|
+
} catch (error) {
|
|
1038
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1039
|
+
consola.consola.box(`getPaymentsBalanceRetrieve
|
|
1040
|
+
Path: /cfg/payments/balance/
|
|
1041
|
+
Method: GET`);
|
|
1042
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1043
|
+
consola.consola.error("Validation Issues:");
|
|
1044
|
+
error.issues.forEach((issue, index) => {
|
|
1045
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1046
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1047
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1048
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
consola.consola.error("Response data:", response);
|
|
1052
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1053
|
+
try {
|
|
1054
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1055
|
+
detail: {
|
|
1056
|
+
operation: "getPaymentsBalanceRetrieve",
|
|
1057
|
+
path: "/cfg/payments/balance/",
|
|
1058
|
+
method: "GET",
|
|
1059
|
+
error,
|
|
1060
|
+
response,
|
|
1061
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1062
|
+
},
|
|
1063
|
+
bubbles: true,
|
|
1064
|
+
cancelable: false
|
|
1065
|
+
});
|
|
1066
|
+
window.dispatchEvent(event);
|
|
1067
|
+
} catch (eventError) {
|
|
1068
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
throw error;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
async function getPaymentsCurrenciesList(client) {
|
|
1075
|
+
const api = client || getAPIInstance();
|
|
1076
|
+
const response = await api.ext_payments_payments.currenciesList();
|
|
1077
|
+
return response;
|
|
1078
|
+
}
|
|
1079
|
+
async function getPaymentsCurrenciesEstimateRetrieve(code, params, client) {
|
|
1080
|
+
const api = client || getAPIInstance();
|
|
1081
|
+
const response = await api.ext_payments_payments.currenciesEstimateRetrieve(code, params?.amount);
|
|
1082
|
+
return response;
|
|
1083
|
+
}
|
|
1084
|
+
async function getPaymentsCurrenciesWithdrawalEstimateRetrieve(code, params, client) {
|
|
1085
|
+
const api = client || getAPIInstance();
|
|
1086
|
+
const response = await api.ext_payments_payments.currenciesWithdrawalEstimateRetrieve(code, params?.amount);
|
|
1087
|
+
return response;
|
|
1088
|
+
}
|
|
1089
|
+
async function getPaymentsPaymentsList(params, client) {
|
|
1090
|
+
const api = client || getAPIInstance();
|
|
1091
|
+
const response = await api.ext_payments_payments.paymentsList(params?.page, params?.page_size);
|
|
1092
|
+
try {
|
|
1093
|
+
return PaginatedPaymentListListSchema.parse(response);
|
|
1094
|
+
} catch (error) {
|
|
1095
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1096
|
+
consola.consola.box(`getPaymentsPaymentsList
|
|
1097
|
+
Path: /cfg/payments/payments/
|
|
1098
|
+
Method: GET`);
|
|
1099
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1100
|
+
consola.consola.error("Validation Issues:");
|
|
1101
|
+
error.issues.forEach((issue, index) => {
|
|
1102
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1103
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1104
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1105
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
consola.consola.error("Response data:", response);
|
|
1109
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1110
|
+
try {
|
|
1111
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1112
|
+
detail: {
|
|
1113
|
+
operation: "getPaymentsPaymentsList",
|
|
1114
|
+
path: "/cfg/payments/payments/",
|
|
1115
|
+
method: "GET",
|
|
1116
|
+
error,
|
|
1117
|
+
response,
|
|
1118
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1119
|
+
},
|
|
1120
|
+
bubbles: true,
|
|
1121
|
+
cancelable: false
|
|
1122
|
+
});
|
|
1123
|
+
window.dispatchEvent(event);
|
|
1124
|
+
} catch (eventError) {
|
|
1125
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
throw error;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
async function getPaymentsPaymentsRetrieve(id, client) {
|
|
1132
|
+
const api = client || getAPIInstance();
|
|
1133
|
+
const response = await api.ext_payments_payments.paymentsRetrieve(id);
|
|
1134
|
+
try {
|
|
1135
|
+
return PaymentDetailSchema.parse(response);
|
|
1136
|
+
} catch (error) {
|
|
1137
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1138
|
+
consola.consola.box(`getPaymentsPaymentsRetrieve
|
|
1139
|
+
Path: /cfg/payments/payments/{id}/
|
|
1140
|
+
Method: GET`);
|
|
1141
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1142
|
+
consola.consola.error("Validation Issues:");
|
|
1143
|
+
error.issues.forEach((issue, index) => {
|
|
1144
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1145
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1146
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1147
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
consola.consola.error("Response data:", response);
|
|
1151
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1152
|
+
try {
|
|
1153
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1154
|
+
detail: {
|
|
1155
|
+
operation: "getPaymentsPaymentsRetrieve",
|
|
1156
|
+
path: "/cfg/payments/payments/{id}/",
|
|
1157
|
+
method: "GET",
|
|
1158
|
+
error,
|
|
1159
|
+
response,
|
|
1160
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1161
|
+
},
|
|
1162
|
+
bubbles: true,
|
|
1163
|
+
cancelable: false
|
|
1164
|
+
});
|
|
1165
|
+
window.dispatchEvent(event);
|
|
1166
|
+
} catch (eventError) {
|
|
1167
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
throw error;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
async function createPaymentsPaymentsConfirmCreate(id, client) {
|
|
1174
|
+
const api = client || getAPIInstance();
|
|
1175
|
+
const response = await api.ext_payments_payments.paymentsConfirmCreate(id);
|
|
1176
|
+
try {
|
|
1177
|
+
return PaymentListSchema.parse(response);
|
|
1178
|
+
} catch (error) {
|
|
1179
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1180
|
+
consola.consola.box(`createPaymentsPaymentsConfirmCreate
|
|
1181
|
+
Path: /cfg/payments/payments/{id}/confirm/
|
|
1182
|
+
Method: POST`);
|
|
1183
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1184
|
+
consola.consola.error("Validation Issues:");
|
|
1185
|
+
error.issues.forEach((issue, index) => {
|
|
1186
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1187
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1188
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1189
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
consola.consola.error("Response data:", response);
|
|
1193
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1194
|
+
try {
|
|
1195
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1196
|
+
detail: {
|
|
1197
|
+
operation: "createPaymentsPaymentsConfirmCreate",
|
|
1198
|
+
path: "/cfg/payments/payments/{id}/confirm/",
|
|
1199
|
+
method: "POST",
|
|
1200
|
+
error,
|
|
1201
|
+
response,
|
|
1202
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1203
|
+
},
|
|
1204
|
+
bubbles: true,
|
|
1205
|
+
cancelable: false
|
|
1206
|
+
});
|
|
1207
|
+
window.dispatchEvent(event);
|
|
1208
|
+
} catch (eventError) {
|
|
1209
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
throw error;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
async function getPaymentsPaymentsStatusRetrieve(id, client) {
|
|
1216
|
+
const api = client || getAPIInstance();
|
|
1217
|
+
const response = await api.ext_payments_payments.paymentsStatusRetrieve(id);
|
|
1218
|
+
try {
|
|
1219
|
+
return PaymentListSchema.parse(response);
|
|
1220
|
+
} catch (error) {
|
|
1221
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1222
|
+
consola.consola.box(`getPaymentsPaymentsStatusRetrieve
|
|
1223
|
+
Path: /cfg/payments/payments/{id}/status/
|
|
1224
|
+
Method: GET`);
|
|
1225
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1226
|
+
consola.consola.error("Validation Issues:");
|
|
1227
|
+
error.issues.forEach((issue, index) => {
|
|
1228
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1229
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1230
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1231
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
consola.consola.error("Response data:", response);
|
|
1235
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1236
|
+
try {
|
|
1237
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1238
|
+
detail: {
|
|
1239
|
+
operation: "getPaymentsPaymentsStatusRetrieve",
|
|
1240
|
+
path: "/cfg/payments/payments/{id}/status/",
|
|
1241
|
+
method: "GET",
|
|
1242
|
+
error,
|
|
1243
|
+
response,
|
|
1244
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1245
|
+
},
|
|
1246
|
+
bubbles: true,
|
|
1247
|
+
cancelable: false
|
|
1248
|
+
});
|
|
1249
|
+
window.dispatchEvent(event);
|
|
1250
|
+
} catch (eventError) {
|
|
1251
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
throw error;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
async function createPaymentsPaymentsCreateCreate(data, client) {
|
|
1258
|
+
const api = client || getAPIInstance();
|
|
1259
|
+
const response = await api.ext_payments_payments.paymentsCreateCreate(data);
|
|
1260
|
+
try {
|
|
1261
|
+
return PaymentCreateResponseSchema.parse(response);
|
|
1262
|
+
} catch (error) {
|
|
1263
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1264
|
+
consola.consola.box(`createPaymentsPaymentsCreateCreate
|
|
1265
|
+
Path: /cfg/payments/payments/create/
|
|
1266
|
+
Method: POST`);
|
|
1267
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1268
|
+
consola.consola.error("Validation Issues:");
|
|
1269
|
+
error.issues.forEach((issue, index) => {
|
|
1270
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1271
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1272
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1273
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
consola.consola.error("Response data:", response);
|
|
1277
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1278
|
+
try {
|
|
1279
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1280
|
+
detail: {
|
|
1281
|
+
operation: "createPaymentsPaymentsCreateCreate",
|
|
1282
|
+
path: "/cfg/payments/payments/create/",
|
|
1283
|
+
method: "POST",
|
|
1284
|
+
error,
|
|
1285
|
+
response,
|
|
1286
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1287
|
+
},
|
|
1288
|
+
bubbles: true,
|
|
1289
|
+
cancelable: false
|
|
1290
|
+
});
|
|
1291
|
+
window.dispatchEvent(event);
|
|
1292
|
+
} catch (eventError) {
|
|
1293
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
throw error;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
async function getPaymentsTransactionsList(params, client) {
|
|
1300
|
+
const api = client || getAPIInstance();
|
|
1301
|
+
const response = await api.ext_payments_payments.transactionsList(params?.limit, params?.offset, params?.type);
|
|
1302
|
+
return response;
|
|
1303
|
+
}
|
|
1304
|
+
async function getPaymentsWithdrawalsList(params, client) {
|
|
1305
|
+
const api = client || getAPIInstance();
|
|
1306
|
+
const response = await api.ext_payments_payments.withdrawalsList(params?.page, params?.page_size);
|
|
1307
|
+
try {
|
|
1308
|
+
return PaginatedWithdrawalListListSchema.parse(response);
|
|
1309
|
+
} catch (error) {
|
|
1310
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1311
|
+
consola.consola.box(`getPaymentsWithdrawalsList
|
|
1312
|
+
Path: /cfg/payments/withdrawals/
|
|
1313
|
+
Method: GET`);
|
|
1314
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1315
|
+
consola.consola.error("Validation Issues:");
|
|
1316
|
+
error.issues.forEach((issue, index) => {
|
|
1317
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1318
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1319
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1320
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
consola.consola.error("Response data:", response);
|
|
1324
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1325
|
+
try {
|
|
1326
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1327
|
+
detail: {
|
|
1328
|
+
operation: "getPaymentsWithdrawalsList",
|
|
1329
|
+
path: "/cfg/payments/withdrawals/",
|
|
1330
|
+
method: "GET",
|
|
1331
|
+
error,
|
|
1332
|
+
response,
|
|
1333
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1334
|
+
},
|
|
1335
|
+
bubbles: true,
|
|
1336
|
+
cancelable: false
|
|
1337
|
+
});
|
|
1338
|
+
window.dispatchEvent(event);
|
|
1339
|
+
} catch (eventError) {
|
|
1340
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
throw error;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
async function getPaymentsWithdrawalsRetrieve(id, client) {
|
|
1347
|
+
const api = client || getAPIInstance();
|
|
1348
|
+
const response = await api.ext_payments_payments.withdrawalsRetrieve(id);
|
|
1349
|
+
try {
|
|
1350
|
+
return WithdrawalDetailSchema.parse(response);
|
|
1351
|
+
} catch (error) {
|
|
1352
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1353
|
+
consola.consola.box(`getPaymentsWithdrawalsRetrieve
|
|
1354
|
+
Path: /cfg/payments/withdrawals/{id}/
|
|
1355
|
+
Method: GET`);
|
|
1356
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1357
|
+
consola.consola.error("Validation Issues:");
|
|
1358
|
+
error.issues.forEach((issue, index) => {
|
|
1359
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1360
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1361
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1362
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
consola.consola.error("Response data:", response);
|
|
1366
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1367
|
+
try {
|
|
1368
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1369
|
+
detail: {
|
|
1370
|
+
operation: "getPaymentsWithdrawalsRetrieve",
|
|
1371
|
+
path: "/cfg/payments/withdrawals/{id}/",
|
|
1372
|
+
method: "GET",
|
|
1373
|
+
error,
|
|
1374
|
+
response,
|
|
1375
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1376
|
+
},
|
|
1377
|
+
bubbles: true,
|
|
1378
|
+
cancelable: false
|
|
1379
|
+
});
|
|
1380
|
+
window.dispatchEvent(event);
|
|
1381
|
+
} catch (eventError) {
|
|
1382
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
throw error;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
async function createPaymentsWithdrawalsCancelCreate(id, client) {
|
|
1389
|
+
const api = client || getAPIInstance();
|
|
1390
|
+
const response = await api.ext_payments_payments.withdrawalsCancelCreate(id);
|
|
1391
|
+
try {
|
|
1392
|
+
return WithdrawalCancelResponseSchema.parse(response);
|
|
1393
|
+
} catch (error) {
|
|
1394
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1395
|
+
consola.consola.box(`createPaymentsWithdrawalsCancelCreate
|
|
1396
|
+
Path: /cfg/payments/withdrawals/{id}/cancel/
|
|
1397
|
+
Method: POST`);
|
|
1398
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1399
|
+
consola.consola.error("Validation Issues:");
|
|
1400
|
+
error.issues.forEach((issue, index) => {
|
|
1401
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1402
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1403
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1404
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
consola.consola.error("Response data:", response);
|
|
1408
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1409
|
+
try {
|
|
1410
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1411
|
+
detail: {
|
|
1412
|
+
operation: "createPaymentsWithdrawalsCancelCreate",
|
|
1413
|
+
path: "/cfg/payments/withdrawals/{id}/cancel/",
|
|
1414
|
+
method: "POST",
|
|
1415
|
+
error,
|
|
1416
|
+
response,
|
|
1417
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1418
|
+
},
|
|
1419
|
+
bubbles: true,
|
|
1420
|
+
cancelable: false
|
|
1421
|
+
});
|
|
1422
|
+
window.dispatchEvent(event);
|
|
1423
|
+
} catch (eventError) {
|
|
1424
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
throw error;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
async function createPaymentsWithdrawalsCreateCreate(data, client) {
|
|
1431
|
+
const api = client || getAPIInstance();
|
|
1432
|
+
const response = await api.ext_payments_payments.withdrawalsCreateCreate(data);
|
|
1433
|
+
try {
|
|
1434
|
+
return WithdrawalCreateResponseSchema.parse(response);
|
|
1435
|
+
} catch (error) {
|
|
1436
|
+
consola.consola.error("\u274C Zod Validation Failed");
|
|
1437
|
+
consola.consola.box(`createPaymentsWithdrawalsCreateCreate
|
|
1438
|
+
Path: /cfg/payments/withdrawals/create/
|
|
1439
|
+
Method: POST`);
|
|
1440
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1441
|
+
consola.consola.error("Validation Issues:");
|
|
1442
|
+
error.issues.forEach((issue, index) => {
|
|
1443
|
+
consola.consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1444
|
+
consola.consola.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1445
|
+
if (issue.expected) consola.consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1446
|
+
if (issue.received) consola.consola.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
consola.consola.error("Response data:", response);
|
|
1450
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1451
|
+
try {
|
|
1452
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1453
|
+
detail: {
|
|
1454
|
+
operation: "createPaymentsWithdrawalsCreateCreate",
|
|
1455
|
+
path: "/cfg/payments/withdrawals/create/",
|
|
1456
|
+
method: "POST",
|
|
1457
|
+
error,
|
|
1458
|
+
response,
|
|
1459
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1460
|
+
},
|
|
1461
|
+
bubbles: true,
|
|
1462
|
+
cancelable: false
|
|
1463
|
+
});
|
|
1464
|
+
window.dispatchEvent(event);
|
|
1465
|
+
} catch (eventError) {
|
|
1466
|
+
consola.consola.warn("Failed to dispatch validation error event:", eventError);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
throw error;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
// src/api/generated/ext_payments/index.ts
|
|
1474
|
+
var TOKEN_KEY = "auth_token";
|
|
1475
|
+
var REFRESH_TOKEN_KEY = "refresh_token";
|
|
1476
|
+
var API = class {
|
|
1477
|
+
baseUrl;
|
|
1478
|
+
_client;
|
|
1479
|
+
_token = null;
|
|
1480
|
+
_refreshToken = null;
|
|
1481
|
+
storage;
|
|
1482
|
+
options;
|
|
1483
|
+
// Sub-clients
|
|
1484
|
+
ext_payments_payments;
|
|
1485
|
+
constructor(baseUrl, options) {
|
|
1486
|
+
this.baseUrl = baseUrl;
|
|
1487
|
+
this.options = options;
|
|
1488
|
+
const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : void 0;
|
|
1489
|
+
this.storage = options?.storage || new LocalStorageAdapter(logger);
|
|
1490
|
+
this._loadTokensFromStorage();
|
|
1491
|
+
this._client = new APIClient(this.baseUrl, {
|
|
1492
|
+
retryConfig: this.options?.retryConfig,
|
|
1493
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1494
|
+
tokenGetter: () => this.getToken()
|
|
1495
|
+
});
|
|
1496
|
+
this._injectAuthHeader();
|
|
1497
|
+
this.ext_payments_payments = this._client.ext_payments_payments;
|
|
1498
|
+
}
|
|
1499
|
+
_loadTokensFromStorage() {
|
|
1500
|
+
this._token = this.storage.getItem(TOKEN_KEY);
|
|
1501
|
+
this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY);
|
|
1502
|
+
}
|
|
1503
|
+
_reinitClients() {
|
|
1504
|
+
this._client = new APIClient(this.baseUrl, {
|
|
1505
|
+
retryConfig: this.options?.retryConfig,
|
|
1506
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1507
|
+
tokenGetter: () => this.getToken()
|
|
1508
|
+
});
|
|
1509
|
+
this._injectAuthHeader();
|
|
1510
|
+
this.ext_payments_payments = this._client.ext_payments_payments;
|
|
1511
|
+
}
|
|
1512
|
+
_injectAuthHeader() {
|
|
1513
|
+
const originalRequest = this._client.request.bind(this._client);
|
|
1514
|
+
this._client.request = async (method, path, options) => {
|
|
1515
|
+
const token = this.getToken();
|
|
1516
|
+
const mergedOptions = {
|
|
1517
|
+
...options,
|
|
1518
|
+
headers: {
|
|
1519
|
+
...options?.headers || {},
|
|
1520
|
+
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
return originalRequest(method, path, mergedOptions);
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Get current JWT token
|
|
1528
|
+
*/
|
|
1529
|
+
getToken() {
|
|
1530
|
+
return this.storage.getItem(TOKEN_KEY);
|
|
1531
|
+
}
|
|
1532
|
+
/**
|
|
1533
|
+
* Get current refresh token
|
|
1534
|
+
*/
|
|
1535
|
+
getRefreshToken() {
|
|
1536
|
+
return this.storage.getItem(REFRESH_TOKEN_KEY);
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Set JWT token and refresh token
|
|
1540
|
+
* @param token - JWT access token
|
|
1541
|
+
* @param refreshToken - JWT refresh token (optional)
|
|
1542
|
+
*/
|
|
1543
|
+
setToken(token, refreshToken) {
|
|
1544
|
+
this._token = token;
|
|
1545
|
+
this.storage.setItem(TOKEN_KEY, token);
|
|
1546
|
+
if (refreshToken) {
|
|
1547
|
+
this._refreshToken = refreshToken;
|
|
1548
|
+
this.storage.setItem(REFRESH_TOKEN_KEY, refreshToken);
|
|
1549
|
+
}
|
|
1550
|
+
this._reinitClients();
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Clear all tokens
|
|
1554
|
+
*/
|
|
1555
|
+
clearTokens() {
|
|
1556
|
+
this._token = null;
|
|
1557
|
+
this._refreshToken = null;
|
|
1558
|
+
this.storage.removeItem(TOKEN_KEY);
|
|
1559
|
+
this.storage.removeItem(REFRESH_TOKEN_KEY);
|
|
1560
|
+
this._reinitClients();
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Check if user is authenticated
|
|
1564
|
+
*/
|
|
1565
|
+
isAuthenticated() {
|
|
1566
|
+
return !!this.getToken();
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Update base URL and reinitialize clients
|
|
1570
|
+
* @param url - New base URL
|
|
1571
|
+
*/
|
|
1572
|
+
setBaseUrl(url) {
|
|
1573
|
+
this.baseUrl = url;
|
|
1574
|
+
this._reinitClients();
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Get current base URL
|
|
1578
|
+
*/
|
|
1579
|
+
getBaseUrl() {
|
|
1580
|
+
return this.baseUrl;
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* Get OpenAPI schema path
|
|
1584
|
+
* @returns Path to the OpenAPI schema JSON file
|
|
1585
|
+
*
|
|
1586
|
+
* Note: The OpenAPI schema is available in the schema.json file.
|
|
1587
|
+
* You can load it dynamically using:
|
|
1588
|
+
* ```typescript
|
|
1589
|
+
* const schema = await fetch('./schema.json').then(r => r.json());
|
|
1590
|
+
* // or using fs in Node.js:
|
|
1591
|
+
* // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
|
|
1592
|
+
* ```
|
|
1593
|
+
*/
|
|
1594
|
+
getSchemaPath() {
|
|
1595
|
+
return "./schema.json";
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
function usePaymentsBalanceRetrieve(client) {
|
|
1599
|
+
return useSWR__default.default(
|
|
1600
|
+
"cfg-payments-balance",
|
|
1601
|
+
() => getPaymentsBalanceRetrieve(client)
|
|
1602
|
+
);
|
|
1603
|
+
}
|
|
1604
|
+
function usePaymentsCurrenciesList(client) {
|
|
1605
|
+
return useSWR__default.default(
|
|
1606
|
+
"cfg-payments-currencies",
|
|
1607
|
+
() => getPaymentsCurrenciesList(client)
|
|
1608
|
+
);
|
|
1609
|
+
}
|
|
1610
|
+
function usePaymentsCurrenciesEstimateRetrieve(code, params, client) {
|
|
1611
|
+
return useSWR__default.default(
|
|
1612
|
+
["cfg-payments-currencies-estimate", code],
|
|
1613
|
+
() => getPaymentsCurrenciesEstimateRetrieve(code, params, client)
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1616
|
+
function usePaymentsCurrenciesWithdrawalEstimateRetrieve(code, params, client) {
|
|
1617
|
+
return useSWR__default.default(
|
|
1618
|
+
["cfg-payments-currencies-withdrawal-estimate", code],
|
|
1619
|
+
() => getPaymentsCurrenciesWithdrawalEstimateRetrieve(code, params, client)
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
function usePaymentsPaymentsList(params, client) {
|
|
1623
|
+
return useSWR__default.default(
|
|
1624
|
+
params ? ["cfg-payments-payments", params] : "cfg-payments-payments",
|
|
1625
|
+
() => getPaymentsPaymentsList(params, client)
|
|
1626
|
+
);
|
|
1627
|
+
}
|
|
1628
|
+
function usePaymentsPaymentsRetrieve(id, client) {
|
|
1629
|
+
return useSWR__default.default(
|
|
1630
|
+
["cfg-payments-payment", id],
|
|
1631
|
+
() => getPaymentsPaymentsRetrieve(id, client)
|
|
1632
|
+
);
|
|
1633
|
+
}
|
|
1634
|
+
function useCreatePaymentsPaymentsConfirmCreate() {
|
|
1635
|
+
const { mutate } = useSWR.useSWRConfig();
|
|
1636
|
+
return async (id, client) => {
|
|
1637
|
+
const result = await createPaymentsPaymentsConfirmCreate(id, client);
|
|
1638
|
+
mutate("cfg-payments-payments-confirm");
|
|
1639
|
+
return result;
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
function usePaymentsPaymentsStatusRetrieve(id, client) {
|
|
1643
|
+
return useSWR__default.default(
|
|
1644
|
+
["cfg-payments-payments-statu", id],
|
|
1645
|
+
() => getPaymentsPaymentsStatusRetrieve(id, client)
|
|
1646
|
+
);
|
|
1647
|
+
}
|
|
1648
|
+
function useCreatePaymentsPaymentsCreateCreate() {
|
|
1649
|
+
const { mutate } = useSWR.useSWRConfig();
|
|
1650
|
+
return async (data, client) => {
|
|
1651
|
+
const result = await createPaymentsPaymentsCreateCreate(data, client);
|
|
1652
|
+
mutate("cfg-payments-payments");
|
|
1653
|
+
return result;
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
function usePaymentsTransactionsList(params, client) {
|
|
1657
|
+
return useSWR__default.default(
|
|
1658
|
+
params ? ["cfg-payments-transactions", params] : "cfg-payments-transactions",
|
|
1659
|
+
() => getPaymentsTransactionsList(params, client)
|
|
1660
|
+
);
|
|
1661
|
+
}
|
|
1662
|
+
function usePaymentsWithdrawalsList(params, client) {
|
|
1663
|
+
return useSWR__default.default(
|
|
1664
|
+
params ? ["cfg-payments-withdrawals", params] : "cfg-payments-withdrawals",
|
|
1665
|
+
() => getPaymentsWithdrawalsList(params, client)
|
|
1666
|
+
);
|
|
1667
|
+
}
|
|
1668
|
+
function usePaymentsWithdrawalsRetrieve(id, client) {
|
|
1669
|
+
return useSWR__default.default(
|
|
1670
|
+
["cfg-payments-withdrawal", id],
|
|
1671
|
+
() => getPaymentsWithdrawalsRetrieve(id, client)
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1674
|
+
function useCreatePaymentsWithdrawalsCancelCreate() {
|
|
1675
|
+
const { mutate } = useSWR.useSWRConfig();
|
|
1676
|
+
return async (id, client) => {
|
|
1677
|
+
const result = await createPaymentsWithdrawalsCancelCreate(id, client);
|
|
1678
|
+
mutate("cfg-payments-withdrawals-cancel");
|
|
1679
|
+
return result;
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
function useCreatePaymentsWithdrawalsCreateCreate() {
|
|
1683
|
+
const { mutate } = useSWR.useSWRConfig();
|
|
1684
|
+
return async (data, client) => {
|
|
1685
|
+
const result = await createPaymentsWithdrawalsCreateCreate(data, client);
|
|
1686
|
+
mutate("cfg-payments-withdrawals");
|
|
1687
|
+
return result;
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
// src/api/index.ts
|
|
1692
|
+
api.initializeExtensionAPI(configureAPI);
|
|
1693
|
+
var apiPayments = api.createExtensionAPI(API);
|
|
1694
|
+
|
|
1695
|
+
exports.API = API;
|
|
1696
|
+
exports.BalanceSchema = BalanceSchema;
|
|
1697
|
+
exports.CurrencySchema = CurrencySchema;
|
|
1698
|
+
exports.PaginatedPaymentListListSchema = PaginatedPaymentListListSchema;
|
|
1699
|
+
exports.PaginatedWithdrawalListListSchema = PaginatedWithdrawalListListSchema;
|
|
1700
|
+
exports.PaymentCreateRequestSchema = PaymentCreateRequestSchema;
|
|
1701
|
+
exports.PaymentCreateResponseSchema = PaymentCreateResponseSchema;
|
|
1702
|
+
exports.PaymentDetailSchema = PaymentDetailSchema;
|
|
1703
|
+
exports.PaymentListSchema = PaymentListSchema;
|
|
1704
|
+
exports.TransactionSchema = TransactionSchema;
|
|
1705
|
+
exports.WithdrawalCancelResponseSchema = WithdrawalCancelResponseSchema;
|
|
1706
|
+
exports.WithdrawalCreateRequestSchema = WithdrawalCreateRequestSchema;
|
|
1707
|
+
exports.WithdrawalCreateResponseSchema = WithdrawalCreateResponseSchema;
|
|
1708
|
+
exports.WithdrawalDetailSchema = WithdrawalDetailSchema;
|
|
1709
|
+
exports.WithdrawalListSchema = WithdrawalListSchema;
|
|
1710
|
+
exports.apiPayments = apiPayments;
|
|
1711
|
+
exports.createPaymentsPaymentsConfirmCreate = createPaymentsPaymentsConfirmCreate;
|
|
1712
|
+
exports.createPaymentsPaymentsCreateCreate = createPaymentsPaymentsCreateCreate;
|
|
1713
|
+
exports.createPaymentsWithdrawalsCancelCreate = createPaymentsWithdrawalsCancelCreate;
|
|
1714
|
+
exports.createPaymentsWithdrawalsCreateCreate = createPaymentsWithdrawalsCreateCreate;
|
|
1715
|
+
exports.getPaymentsBalanceRetrieve = getPaymentsBalanceRetrieve;
|
|
1716
|
+
exports.getPaymentsCurrenciesEstimateRetrieve = getPaymentsCurrenciesEstimateRetrieve;
|
|
1717
|
+
exports.getPaymentsCurrenciesList = getPaymentsCurrenciesList;
|
|
1718
|
+
exports.getPaymentsCurrenciesWithdrawalEstimateRetrieve = getPaymentsCurrenciesWithdrawalEstimateRetrieve;
|
|
1719
|
+
exports.getPaymentsPaymentsList = getPaymentsPaymentsList;
|
|
1720
|
+
exports.getPaymentsPaymentsRetrieve = getPaymentsPaymentsRetrieve;
|
|
1721
|
+
exports.getPaymentsPaymentsStatusRetrieve = getPaymentsPaymentsStatusRetrieve;
|
|
1722
|
+
exports.getPaymentsTransactionsList = getPaymentsTransactionsList;
|
|
1723
|
+
exports.getPaymentsWithdrawalsList = getPaymentsWithdrawalsList;
|
|
1724
|
+
exports.getPaymentsWithdrawalsRetrieve = getPaymentsWithdrawalsRetrieve;
|
|
1725
|
+
exports.useCreatePaymentsPaymentsConfirmCreate = useCreatePaymentsPaymentsConfirmCreate;
|
|
1726
|
+
exports.useCreatePaymentsPaymentsCreateCreate = useCreatePaymentsPaymentsCreateCreate;
|
|
1727
|
+
exports.useCreatePaymentsWithdrawalsCancelCreate = useCreatePaymentsWithdrawalsCancelCreate;
|
|
1728
|
+
exports.useCreatePaymentsWithdrawalsCreateCreate = useCreatePaymentsWithdrawalsCreateCreate;
|
|
1729
|
+
exports.usePaymentsBalanceRetrieve = usePaymentsBalanceRetrieve;
|
|
1730
|
+
exports.usePaymentsCurrenciesEstimateRetrieve = usePaymentsCurrenciesEstimateRetrieve;
|
|
1731
|
+
exports.usePaymentsCurrenciesList = usePaymentsCurrenciesList;
|
|
1732
|
+
exports.usePaymentsCurrenciesWithdrawalEstimateRetrieve = usePaymentsCurrenciesWithdrawalEstimateRetrieve;
|
|
1733
|
+
exports.usePaymentsPaymentsList = usePaymentsPaymentsList;
|
|
1734
|
+
exports.usePaymentsPaymentsRetrieve = usePaymentsPaymentsRetrieve;
|
|
1735
|
+
exports.usePaymentsPaymentsStatusRetrieve = usePaymentsPaymentsStatusRetrieve;
|
|
1736
|
+
exports.usePaymentsTransactionsList = usePaymentsTransactionsList;
|
|
1737
|
+
exports.usePaymentsWithdrawalsList = usePaymentsWithdrawalsList;
|
|
1738
|
+
exports.usePaymentsWithdrawalsRetrieve = usePaymentsWithdrawalsRetrieve;
|