@riocrypto/common 1.0.1707 → 1.0.1712

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.
@@ -1,1113 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RioAdminClient = void 0;
13
- const IdentityVerificationType_1 = require("../types/IdentityVerificationType");
14
- class RioAdminClient {
15
- constructor(axios) {
16
- this.axios = axios;
17
- if (process.env.NEXT_PUBLIC_RUNNING_LOCAL === "true") {
18
- this.axios.defaults.withCredentials = true;
19
- }
20
- if (process.env.NEXT_PUBLIC_FORCE_SANDBOX === "true") {
21
- this.axios.defaults.baseURL = "https://sandbox.riotransfer.co";
22
- this.axios.defaults.withCredentials = true;
23
- }
24
- axios.interceptors.request.use((config) => {
25
- // Exclude specific cookies from being sent
26
- if (config.headers && config.headers.Cookie) {
27
- config.headers.Cookie = String(config.headers.Cookie)
28
- .replace(/accessToken=[^;]+(; )?/, "")
29
- .replace(/refreshToken=[^;]+(; )?/, "");
30
- }
31
- return config;
32
- });
33
- }
34
- getLiquidityAvailable() {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- const { data } = yield this.axios.get(`/api/liquidity/usd/total`);
37
- return data;
38
- });
39
- }
40
- exportOrders(page, startDate, endDate, query) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const { data } = yield this.axios.get(`/api/orders/export?`, {
43
- params: Object.assign({ page,
44
- startDate,
45
- endDate }, query),
46
- });
47
- return data;
48
- });
49
- }
50
- getOrders(page, limit, query, startDate, endDate) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const { data } = yield this.axios.get(`/api/orders?`, {
53
- params: Object.assign({ page,
54
- limit,
55
- startDate,
56
- endDate }, query),
57
- });
58
- return data;
59
- });
60
- }
61
- updateOrder(id, update) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- const { data } = yield this.axios.patch(`/api/orders/${id}`, update);
64
- return data;
65
- });
66
- }
67
- createQuote(input) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const { data } = yield this.axios.post(`/api/quotes`, input);
70
- return data;
71
- });
72
- }
73
- updateQuote(id, update) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- const { data } = yield this.axios.patch(`/api/quotes/${id}`, update);
76
- return data;
77
- });
78
- }
79
- getQuote(id) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- const { data } = yield this.axios.get(`/api/quotes/${id}`);
82
- return data;
83
- });
84
- }
85
- createBid(input) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- const { data } = yield this.axios.post(`/api/bids`, input);
88
- return data;
89
- });
90
- }
91
- getBid(id) {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- const { data } = yield this.axios.get(`/api/bids/${id}`);
94
- return data;
95
- });
96
- }
97
- getUsers(page, limit, query) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- const { data } = yield this.axios.get(`/api/users?`, {
100
- params: Object.assign({ page,
101
- limit }, query),
102
- });
103
- return data;
104
- });
105
- }
106
- signinAdmin(email, password, authenticatorCode) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- const { data } = yield this.axios.post(`/api/auth/admin/signin`, {
109
- email,
110
- password,
111
- authenticatorCode,
112
- });
113
- return data;
114
- });
115
- }
116
- updateUser(update, userId) {
117
- return __awaiter(this, void 0, void 0, function* () {
118
- const { data } = yield this.axios.patch(`/api/users/${userId || ""}`, update);
119
- return data;
120
- });
121
- }
122
- uploadCOI(id, formData) {
123
- return __awaiter(this, void 0, void 0, function* () {
124
- const { data } = yield this.axios.post(`/api/users/${id}/coi`, formData);
125
- return data;
126
- });
127
- }
128
- createTemporaryVerification(phoneNumber) {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- const { data } = yield this.axios.post("/api/auth/temporary-verifications", {
131
- phoneNumber,
132
- });
133
- return data;
134
- });
135
- }
136
- createAlert({ userId, type, priceTrigger, liquidityTrigger, destinationType, telegramDestination, }) {
137
- return __awaiter(this, void 0, void 0, function* () {
138
- const { data } = yield this.axios.post("/api/alerts", {
139
- userId,
140
- type,
141
- priceTrigger: priceTrigger ? priceTrigger : undefined,
142
- liquidityTrigger: liquidityTrigger ? liquidityTrigger : undefined,
143
- destinationType,
144
- telegramDestination,
145
- });
146
- return data;
147
- });
148
- }
149
- getAlerts() {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- const { data } = yield this.axios.get("/api/alerts");
152
- return data;
153
- });
154
- }
155
- getAlert(id) {
156
- return __awaiter(this, void 0, void 0, function* () {
157
- const { data } = yield this.axios.get(`/api/alerts/${id}`);
158
- return data;
159
- });
160
- }
161
- deleteAlert(id) {
162
- return __awaiter(this, void 0, void 0, function* () {
163
- yield this.axios.delete(`/api/alerts/${id}`);
164
- });
165
- }
166
- deleteTemporaryVerification(id) {
167
- return __awaiter(this, void 0, void 0, function* () {
168
- const { data } = yield this.axios.delete(`/api/auth/temporary-verifications/${id}`);
169
- return data;
170
- });
171
- }
172
- getTemporaryVerifications() {
173
- return __awaiter(this, void 0, void 0, function* () {
174
- const response = yield this.axios.get("/api/auth/temporary-verifications");
175
- return response.data;
176
- });
177
- }
178
- requestOnboardingReview(country, userId) {
179
- return __awaiter(this, void 0, void 0, function* () {
180
- const url = userId
181
- ? `/api/users/${userId}/onboarding-review`
182
- : `/api/users/onboarding-review`;
183
- const { data } = yield this.axios.post(url, { country });
184
- return data;
185
- });
186
- }
187
- getOnboardingRequirements(userType, country, countryOfOrigin) {
188
- return __awaiter(this, void 0, void 0, function* () {
189
- const { data } = yield this.axios.get(`/api/users/requirements`, {
190
- params: {
191
- type: userType,
192
- country,
193
- countryOfOrigin,
194
- },
195
- });
196
- return data;
197
- });
198
- }
199
- uploadFile(id, country, fileType, formData) {
200
- return __awaiter(this, void 0, void 0, function* () {
201
- const { data } = yield this.axios.post(`/api/users/${id}/files/${country}/${fileType}`, formData);
202
- return data;
203
- });
204
- }
205
- getUBO(id) {
206
- return __awaiter(this, void 0, void 0, function* () {
207
- let url = `/api/ubos/${id}`;
208
- const { data } = yield this.axios.get(url);
209
- return data;
210
- });
211
- }
212
- sendUBOOnboardingEmail(email, associatedUserId, country) {
213
- return __awaiter(this, void 0, void 0, function* () {
214
- yield this.axios.post("/api/ubos/onboarding-email", {
215
- associatedUserId,
216
- country,
217
- email,
218
- });
219
- });
220
- }
221
- getUBOS(page, limit) {
222
- return __awaiter(this, void 0, void 0, function* () {
223
- const { data } = yield this.axios.get(`/api/ubos?`, {
224
- params: {
225
- page,
226
- limit,
227
- },
228
- });
229
- return data;
230
- });
231
- }
232
- updateUBO(update, uboId) {
233
- return __awaiter(this, void 0, void 0, function* () {
234
- const { data } = yield this.axios.patch(`/api/ubos/${uboId}`, update);
235
- return data;
236
- });
237
- }
238
- getUBOOnboardingRequirements(country, countryOfOrigin) {
239
- return __awaiter(this, void 0, void 0, function* () {
240
- const { data } = yield this.axios.get(`/api/ubos/requirements`, {
241
- params: {
242
- country,
243
- countryOfOrigin,
244
- },
245
- });
246
- return data;
247
- });
248
- }
249
- uploadUBOFile(id, country, fileType, formData) {
250
- return __awaiter(this, void 0, void 0, function* () {
251
- const { data } = yield this.axios.post(`/api/ubos/${id}/files/${country}/${fileType}`, formData);
252
- return data;
253
- });
254
- }
255
- uploadKYCReport(id, formData) {
256
- return __awaiter(this, void 0, void 0, function* () {
257
- const { data } = yield this.axios.post(`/api/users/${id}/kyc-report`, formData);
258
- return data;
259
- });
260
- }
261
- uploadCSF(id, formData) {
262
- return __awaiter(this, void 0, void 0, function* () {
263
- const { data } = yield this.axios.post(`/api/users/${id}/csf`, formData);
264
- return data;
265
- });
266
- }
267
- uploadProofOfAddress(id, formData) {
268
- return __awaiter(this, void 0, void 0, function* () {
269
- const { data } = yield this.axios.post(`/api/users/${id}/proof-of-address`, formData);
270
- return data;
271
- });
272
- }
273
- createVerificationLink(userId, firstName, lastName) {
274
- return __awaiter(this, void 0, void 0, function* () {
275
- const { data } = yield this.axios.post("/api/kyc/link", {
276
- userId,
277
- firstName,
278
- lastName,
279
- });
280
- return data.link;
281
- });
282
- }
283
- createOnboardingByLink(userType, countryOfOperation, brokerId, referrerId) {
284
- return __awaiter(this, void 0, void 0, function* () {
285
- const { data } = yield this.axios.post(`/api/onboardings/${countryOfOperation}/link`, {
286
- userType,
287
- countryOfOperation,
288
- brokerId,
289
- referrerId,
290
- });
291
- return data;
292
- });
293
- }
294
- createUSOnboardingByLink({ userType, businessName, firstName, middleName, lastName, secondLastName, email, brokerId, referrerId, }) {
295
- return __awaiter(this, void 0, void 0, function* () {
296
- const { data } = yield this.axios.post("/api/onboardings/US/link", {
297
- userType,
298
- businessName,
299
- firstName,
300
- middleName,
301
- lastName,
302
- secondLastName,
303
- email,
304
- brokerId,
305
- referrerId,
306
- });
307
- return data;
308
- });
309
- }
310
- createIncrementalOnboardingByLink(userId, countryOfOperation) {
311
- return __awaiter(this, void 0, void 0, function* () {
312
- const { data } = yield this.axios.post(`/api/onboardings/${countryOfOperation}/incremental/link`, {
313
- userId,
314
- });
315
- return data;
316
- });
317
- }
318
- createIncrementalUSOnboardingByLink(userId) {
319
- return __awaiter(this, void 0, void 0, function* () {
320
- const { data } = yield this.axios.post(`/api/onboardings/us/incremental/link`, {
321
- userId,
322
- });
323
- return data;
324
- });
325
- }
326
- getOnboarding(id) {
327
- return __awaiter(this, void 0, void 0, function* () {
328
- const { data } = yield this.axios.get(`/api/onboardings/${id}`);
329
- return data;
330
- });
331
- }
332
- sendVerificationEmail(type, id, country) {
333
- return __awaiter(this, void 0, void 0, function* () {
334
- yield this.axios.post("/api/kyc/email", {
335
- type,
336
- userId: type === IdentityVerificationType_1.IdentityVerificationType.user ||
337
- type === IdentityVerificationType_1.IdentityVerificationType.legalRepresentative
338
- ? id
339
- : undefined,
340
- uboId: type === IdentityVerificationType_1.IdentityVerificationType.UBO ? id : undefined,
341
- country,
342
- });
343
- });
344
- }
345
- sendBridgeOnboardingEmail(userId) {
346
- return __awaiter(this, void 0, void 0, function* () {
347
- yield this.axios.post(`/api/users/${userId}/us/onboarding-email`);
348
- });
349
- }
350
- createUBO(user) {
351
- return __awaiter(this, void 0, void 0, function* () {
352
- const { data } = yield this.axios.post("/api/ubos", user);
353
- return data;
354
- });
355
- }
356
- updateAdminAuth(id, update) {
357
- return __awaiter(this, void 0, void 0, function* () {
358
- const { data } = yield this.axios.patch(`/api/auth/admin/${id}`, update);
359
- return data;
360
- });
361
- }
362
- getBridgeOnboardingLinks(userId) {
363
- return __awaiter(this, void 0, void 0, function* () {
364
- const { data } = yield this.axios.get(`/api/users/${userId}/us/onboarding-links`);
365
- return data;
366
- });
367
- }
368
- getAdminAuth(id) {
369
- return __awaiter(this, void 0, void 0, function* () {
370
- const { data } = yield this.axios.get(`/api/auth/admin/${id}`);
371
- return data;
372
- });
373
- }
374
- deleteAdminAuth(id) {
375
- return __awaiter(this, void 0, void 0, function* () {
376
- yield this.axios.delete(`/api/auth/admin/${id}`);
377
- });
378
- }
379
- getAdminAuthWithoutId() {
380
- return __awaiter(this, void 0, void 0, function* () {
381
- const { data } = yield this.axios.get(`/api/auth/admin/self`);
382
- return data;
383
- });
384
- }
385
- getAdminAuths() {
386
- return __awaiter(this, void 0, void 0, function* () {
387
- const { data } = yield this.axios.get(`/api/auth/admin`);
388
- return data;
389
- });
390
- }
391
- signoutAdmin() {
392
- return __awaiter(this, void 0, void 0, function* () {
393
- yield this.axios.post("/api/auth/admin/signout", {});
394
- });
395
- }
396
- getRioSettings() {
397
- return __awaiter(this, void 0, void 0, function* () {
398
- const { data } = yield this.axios.get(`/api/settings/rio`);
399
- return data;
400
- });
401
- }
402
- createRioSettings(rioSettings) {
403
- return __awaiter(this, void 0, void 0, function* () {
404
- yield this.axios.post(`/api/settings/rio`, rioSettings);
405
- });
406
- }
407
- updateRioSettings(update) {
408
- return __awaiter(this, void 0, void 0, function* () {
409
- const { data } = yield this.axios.patch(`/api/settings/rio`, update);
410
- return data;
411
- });
412
- }
413
- confirmBankPayment(orderId, amountFiat) {
414
- return __awaiter(this, void 0, void 0, function* () {
415
- const { data } = yield this.axios.post(`/api/payments/bank/confirm`, {
416
- orderId,
417
- amountFiat,
418
- });
419
- return data;
420
- });
421
- }
422
- confirmBankPayout(orderId) {
423
- return __awaiter(this, void 0, void 0, function* () {
424
- const { data } = yield this.axios.post(`/api/payouts/bank/confirm`, {
425
- orderId,
426
- });
427
- return data;
428
- });
429
- }
430
- confirmLiquiditySourced(orderId) {
431
- return __awaiter(this, void 0, void 0, function* () {
432
- const { data } = yield this.axios.post(`/api/liquidity/confirm`, {
433
- orderId,
434
- });
435
- return data;
436
- });
437
- }
438
- getUser(userId) {
439
- return __awaiter(this, void 0, void 0, function* () {
440
- let url = "/api/users";
441
- if (userId) {
442
- url += `/${userId}`;
443
- }
444
- const { data } = yield this.axios.get(url);
445
- return data;
446
- });
447
- }
448
- acceptAdminTasks(adminId) {
449
- return __awaiter(this, void 0, void 0, function* () {
450
- const { data } = yield this.axios.post("/api/admin/tasks/accept", {
451
- adminId: adminId ? adminId : undefined,
452
- });
453
- return data;
454
- });
455
- }
456
- grantAdminAccessToUser(userId) {
457
- return __awaiter(this, void 0, void 0, function* () {
458
- const { data } = yield this.axios.patch(`/api/users/${userId}/grant-admin-access`);
459
- return data;
460
- });
461
- }
462
- stopAdminTasks(adminId) {
463
- return __awaiter(this, void 0, void 0, function* () {
464
- const { data } = yield this.axios.post("/api/admin/tasks/stop", {
465
- adminId: adminId ? adminId : undefined,
466
- });
467
- return data;
468
- });
469
- }
470
- getAdminTasks(taskTypes) {
471
- return __awaiter(this, void 0, void 0, function* () {
472
- const { data } = yield this.axios.get("/api/admin/tasks", {
473
- params: { taskTypes: taskTypes ? taskTypes.join(",") : undefined },
474
- });
475
- return data;
476
- });
477
- }
478
- markAdminTaskComplete(id) {
479
- return __awaiter(this, void 0, void 0, function* () {
480
- const { data } = yield this.axios.patch(`/api/admin/tasks/${id}/complete`);
481
- return data;
482
- });
483
- }
484
- createAdminAuth(adminAuth) {
485
- return __awaiter(this, void 0, void 0, function* () {
486
- const { data } = yield this.axios.post("/api/auth/admin", adminAuth);
487
- return data;
488
- });
489
- }
490
- createUser(user) {
491
- return __awaiter(this, void 0, void 0, function* () {
492
- const { data } = yield this.axios.post("/api/users", user);
493
- return data;
494
- });
495
- }
496
- getBankPayment(orderId) {
497
- return __awaiter(this, void 0, void 0, function* () {
498
- const { data } = yield this.axios.get("/api/payments/bank?orderId=" + orderId);
499
- return data;
500
- });
501
- }
502
- verifyBankPayment(orderId) {
503
- return __awaiter(this, void 0, void 0, function* () {
504
- yield this.axios.post("/api/payments/bank/check", {
505
- orderId,
506
- });
507
- });
508
- }
509
- sendPhoneAuthCode(phoneNumber) {
510
- return __awaiter(this, void 0, void 0, function* () {
511
- const response = yield this.axios.post("/api/auth/send-code", {
512
- phoneNumber,
513
- });
514
- return response.data;
515
- });
516
- }
517
- createAdminAuthenticatorSecret(id) {
518
- return __awaiter(this, void 0, void 0, function* () {
519
- const response = yield this.axios.post(`/api/auth/admin/${id}/authenticator`);
520
- return response.data;
521
- });
522
- }
523
- getAuth(id) {
524
- return __awaiter(this, void 0, void 0, function* () {
525
- const response = yield this.axios.get(`/api/auth/${id}`);
526
- return response.data;
527
- });
528
- }
529
- getAuths(userId) {
530
- return __awaiter(this, void 0, void 0, function* () {
531
- const response = yield this.axios.get(`/api/auth`, {
532
- params: userId
533
- ? {
534
- userId,
535
- }
536
- : undefined,
537
- });
538
- return response.data;
539
- });
540
- }
541
- authHasSecurityQuestion() {
542
- return __awaiter(this, void 0, void 0, function* () {
543
- const response = yield this.axios.get(`/api/auth?checkSecurityQuestion=true`);
544
- return response.data.hasSecurityQuestion;
545
- });
546
- }
547
- createBridgePlaidLink(userId) {
548
- return __awaiter(this, void 0, void 0, function* () {
549
- const response = yield this.axios.post(`/api/bank/us/accounts/link`, {
550
- userId,
551
- });
552
- return response.data.url;
553
- });
554
- }
555
- refreshAdminToken() {
556
- return __awaiter(this, void 0, void 0, function* () {
557
- yield this.axios.post("/api/auth/admin/refresh");
558
- });
559
- }
560
- createOrder(order) {
561
- return __awaiter(this, void 0, void 0, function* () {
562
- const response = yield this.axios.post("/api/orders", order);
563
- return response.data;
564
- });
565
- }
566
- getChainedOrders(page, limit, query) {
567
- return __awaiter(this, void 0, void 0, function* () {
568
- const { data } = yield this.axios.get(`/api/orders/chained?`, {
569
- params: Object.assign({ page,
570
- limit }, query),
571
- });
572
- return data;
573
- });
574
- }
575
- getChainedQuote(id) {
576
- return __awaiter(this, void 0, void 0, function* () {
577
- const { data } = yield this.axios.get(`/api/quotes/chained/${id}`);
578
- return data;
579
- });
580
- }
581
- getChainedOrder(id) {
582
- return __awaiter(this, void 0, void 0, function* () {
583
- const response = yield this.axios.get(`/api/orders/chained/${id}`);
584
- return response.data;
585
- });
586
- }
587
- importOrder(order) {
588
- return __awaiter(this, void 0, void 0, function* () {
589
- const response = yield this.axios.post("/api/orders/import", order);
590
- return response.data;
591
- });
592
- }
593
- registerExchangeRate(orderId, amount, price, provider) {
594
- return __awaiter(this, void 0, void 0, function* () {
595
- yield this.axios.post(`/api/fx/orders`, {
596
- orderId,
597
- amount,
598
- price,
599
- provider,
600
- });
601
- });
602
- }
603
- cancelOrder(id) {
604
- return __awaiter(this, void 0, void 0, function* () {
605
- const response = yield this.axios.post(`/api/orders${id ? `/${id}/cancel` : "/cancel"}`);
606
- return response.data;
607
- });
608
- }
609
- cancelChainedOrder(id) {
610
- return __awaiter(this, void 0, void 0, function* () {
611
- yield this.axios.post(`/api/orders/chained/${id}/cancel`);
612
- });
613
- }
614
- getOrder(id) {
615
- return __awaiter(this, void 0, void 0, function* () {
616
- const response = yield this.axios.get(`/api/orders/${id}`);
617
- return response.data;
618
- });
619
- }
620
- createBankPayout(oid, bankAccountId) {
621
- return __awaiter(this, void 0, void 0, function* () {
622
- const response = yield this.axios.post(`/api/payouts/bank`, {
623
- orderId: oid,
624
- bankAccountId,
625
- });
626
- return response.data;
627
- });
628
- }
629
- updateBankPayout(id, { speiTrackingNumber, spidTrackingNumber, reference, }) {
630
- return __awaiter(this, void 0, void 0, function* () {
631
- const response = yield this.axios.patch(`/api/payouts/bank/${id}`, {
632
- speiTrackingNumber: speiTrackingNumber ? speiTrackingNumber : undefined,
633
- spidTrackingNumber: spidTrackingNumber ? spidTrackingNumber : undefined,
634
- reference: reference ? reference : undefined,
635
- });
636
- return response.data;
637
- });
638
- }
639
- createInternalSwap(originCrypto, destinationCrypto, amount, origin, destination, provider) {
640
- return __awaiter(this, void 0, void 0, function* () {
641
- yield this.axios.post(`/api/liquidity/swaps`, {
642
- originCrypto,
643
- destinationCrypto,
644
- amount,
645
- origin,
646
- destination,
647
- provider,
648
- });
649
- });
650
- }
651
- expediteInternalSwap(id) {
652
- return __awaiter(this, void 0, void 0, function* () {
653
- yield this.axios.post(`/api/liquidity/swaps/${id}/expedite`);
654
- });
655
- }
656
- getInternalSwaps(page, limit) {
657
- return __awaiter(this, void 0, void 0, function* () {
658
- const { data } = yield this.axios.get(`/api/liquidity/swaps`, {
659
- params: {
660
- page,
661
- limit,
662
- },
663
- });
664
- return data;
665
- });
666
- }
667
- createMultipartOrder(amount, recipe, amountUSDToLeaveAtCoinbase) {
668
- return __awaiter(this, void 0, void 0, function* () {
669
- const { data } = yield this.axios.post(`/api/liquidity/multipart-orders`, {
670
- amount,
671
- recipe,
672
- amountUSDToLeaveAtCoinbase,
673
- });
674
- return data;
675
- });
676
- }
677
- updateMultipartOrder(id, amount, recipe, amountUSDToLeaveAtCoinbase) {
678
- return __awaiter(this, void 0, void 0, function* () {
679
- const { data } = yield this.axios.patch(`/api/liquidity/multipart-orders/${id}`, {
680
- amount,
681
- recipe,
682
- amountUSDToLeaveAtCoinbase,
683
- });
684
- return data;
685
- });
686
- }
687
- getMultipartOrders(page, limit) {
688
- return __awaiter(this, void 0, void 0, function* () {
689
- const { data } = yield this.axios.get(`/api/liquidity/multipart-orders`, {
690
- params: {
691
- page,
692
- limit,
693
- },
694
- });
695
- return data;
696
- });
697
- }
698
- getAddressVerification(cryptoAddressId) {
699
- return __awaiter(this, void 0, void 0, function* () {
700
- const { data } = yield this.axios.get(`/api/addresses/verification?`, {
701
- params: {
702
- cryptoAddressId,
703
- },
704
- });
705
- return data;
706
- });
707
- }
708
- getBankAccountVerification(bankAccountId) {
709
- return __awaiter(this, void 0, void 0, function* () {
710
- const { data } = yield this.axios.get(`/api/bank/accounts/verification?`, {
711
- params: {
712
- bankAccountId,
713
- },
714
- });
715
- return data;
716
- });
717
- }
718
- getBankPayout(orderId) {
719
- return __awaiter(this, void 0, void 0, function* () {
720
- const response = yield this.axios.get(`/api/payouts/bank?orderId=${orderId}`);
721
- return response.data;
722
- });
723
- }
724
- startAddressVerification(addressId) {
725
- return __awaiter(this, void 0, void 0, function* () {
726
- const response = yield this.axios.post(`/api/addresses/${addressId}/start-verification`);
727
- return response.data;
728
- });
729
- }
730
- completeAddressVerification(addressId, amount) {
731
- return __awaiter(this, void 0, void 0, function* () {
732
- const response = yield this.axios.post(`/api/addresses/${addressId}/complete-verification`, {
733
- amount,
734
- });
735
- return response.data;
736
- });
737
- }
738
- startBankAccountVerification(bankAccountId) {
739
- return __awaiter(this, void 0, void 0, function* () {
740
- const response = yield this.axios.post(`/api/bank/accounts/${bankAccountId}/start-verification`);
741
- return response.data;
742
- });
743
- }
744
- completeBankAccountVerification(bankAccountId, amount) {
745
- return __awaiter(this, void 0, void 0, function* () {
746
- const response = yield this.axios.post(`/api/bank/accounts/${bankAccountId}/complete-verification`, {
747
- amount,
748
- });
749
- return response.data;
750
- });
751
- }
752
- getCryptoAddresses(page, limit, query) {
753
- return __awaiter(this, void 0, void 0, function* () {
754
- const { data } = yield this.axios.get(`/api/addresses?`, {
755
- params: Object.assign({ page,
756
- limit }, query),
757
- });
758
- return data;
759
- });
760
- }
761
- getCryptoAddress(id) {
762
- return __awaiter(this, void 0, void 0, function* () {
763
- const { data } = yield this.axios.get(`/api/addresses/${id}`);
764
- return data;
765
- });
766
- }
767
- createChainedOrder(order) {
768
- return __awaiter(this, void 0, void 0, function* () {
769
- const response = yield this.axios.post("/api/orders/chained", order);
770
- return response.data;
771
- });
772
- }
773
- createCryptoAddress(address, crypto, userId, label) {
774
- return __awaiter(this, void 0, void 0, function* () {
775
- const response = yield this.axios.post(`/api/addresses`, {
776
- address,
777
- crypto,
778
- userId,
779
- label,
780
- });
781
- return response.data;
782
- });
783
- }
784
- createChainedQuote(input) {
785
- return __awaiter(this, void 0, void 0, function* () {
786
- const { data } = yield this.axios.post(`/api/quotes/chained`, input);
787
- return data;
788
- });
789
- }
790
- createBankAccount(userId, country, fiat, bankName, accountHolderName, accountNumber, routingNumber, CLABE, CCI, notes, address) {
791
- return __awaiter(this, void 0, void 0, function* () {
792
- const response = yield this.axios.post(`/api/bank/accounts`, {
793
- userId,
794
- country,
795
- fiat,
796
- bankName,
797
- accountHolderName,
798
- accountNumber,
799
- routingNumber,
800
- CLABE,
801
- CCI,
802
- notes,
803
- address,
804
- });
805
- return response.data;
806
- });
807
- }
808
- updateBankAccount(id, data) {
809
- return __awaiter(this, void 0, void 0, function* () {
810
- const response = yield this.axios.patch(`/api/bank/accounts/${id}`, data);
811
- return response.data;
812
- });
813
- }
814
- deleteBankAccount(id) {
815
- return __awaiter(this, void 0, void 0, function* () {
816
- yield this.axios.delete(`/api/bank/accounts/${id}`);
817
- });
818
- }
819
- createRioBankAccount(country, fiat, bankName, bankAddress, companyName, companyAddress, accountNumber, CLABE, CCI, RUC, RFC) {
820
- return __awaiter(this, void 0, void 0, function* () {
821
- const response = yield this.axios.post(`/api/bank/accounts/rio`, {
822
- country,
823
- fiat,
824
- bankName,
825
- bankAddress,
826
- accountNumber,
827
- CLABE,
828
- CCI,
829
- RUC,
830
- RFC,
831
- companyName,
832
- companyAddress,
833
- });
834
- return response.data;
835
- });
836
- }
837
- updateRioBankAccount(id, country, fiat, bankName, bankAddress, companyName, companyAddress, accountNumber, CLABE, CCI, RUC, RFC) {
838
- return __awaiter(this, void 0, void 0, function* () {
839
- const response = yield this.axios.patch(`/api/bank/accounts/rio/${id}`, {
840
- country,
841
- fiat,
842
- bankName,
843
- bankAddress,
844
- accountNumber,
845
- CLABE,
846
- CCI,
847
- RUC,
848
- RFC,
849
- companyName,
850
- companyAddress,
851
- });
852
- return response.data;
853
- });
854
- }
855
- getRioBankAccounts(page, limit, query) {
856
- return __awaiter(this, void 0, void 0, function* () {
857
- const response = yield this.axios.get(`/api/bank/accounts/rio`, {
858
- params: Object.assign({ page,
859
- limit }, query),
860
- });
861
- return response.data;
862
- });
863
- }
864
- deleteRioBankAccount(id) {
865
- return __awaiter(this, void 0, void 0, function* () {
866
- yield this.axios.delete(`/api/bank/accounts/rio/${id}`);
867
- });
868
- }
869
- deleteAddress(id) {
870
- return __awaiter(this, void 0, void 0, function* () {
871
- yield this.axios.delete(`/api/addresses/${id}`);
872
- });
873
- }
874
- getFeesByVolume() {
875
- return __awaiter(this, void 0, void 0, function* () {
876
- const response = yield this.axios.get(`/api/quotes/fees/by-volume`);
877
- return response.data;
878
- });
879
- }
880
- getTransactionLimits(userId) {
881
- return __awaiter(this, void 0, void 0, function* () {
882
- const response = yield this.axios.get(`/api/users/${userId}/limits`);
883
- return response.data;
884
- });
885
- }
886
- getWeeklyVolume() {
887
- return __awaiter(this, void 0, void 0, function* () {
888
- const response = yield this.axios.get(`/api/data/volume/rio`, {
889
- params: {
890
- days: 7,
891
- },
892
- });
893
- return response.data;
894
- });
895
- }
896
- getVolumeAndRevenueByDays(days, userId) {
897
- return __awaiter(this, void 0, void 0, function* () {
898
- const response = yield this.axios.get(`/api/data/volume`, {
899
- params: {
900
- days,
901
- userId: userId ? userId : undefined,
902
- },
903
- });
904
- return response.data;
905
- });
906
- }
907
- getPastMonthsVolumeAndRevenue(months, userId) {
908
- return __awaiter(this, void 0, void 0, function* () {
909
- const response = yield this.axios.get(`/api/data/volume`, {
910
- params: {
911
- months,
912
- userId: userId ? userId : undefined,
913
- },
914
- });
915
- return response.data;
916
- });
917
- }
918
- returnOrderToNotPaid(id) {
919
- return __awaiter(this, void 0, void 0, function* () {
920
- const response = yield this.axios.post(`/api/orders/${id}/return-to-not-paid`, {});
921
- });
922
- }
923
- getTotalUsers(months) {
924
- return __awaiter(this, void 0, void 0, function* () {
925
- const response = yield this.axios.get(`/api/data/users/total`, {
926
- params: {
927
- months,
928
- },
929
- });
930
- return response.data;
931
- });
932
- }
933
- getAverageMonthlyVolumes(userId) {
934
- return __awaiter(this, void 0, void 0, function* () {
935
- const response = yield this.axios.get(`/api/data/volume/average`, {
936
- params: {
937
- type: "month",
938
- userId: userId ? userId : undefined,
939
- },
940
- });
941
- return response.data;
942
- });
943
- }
944
- getBitsoX(bidPrice, bidAmount) {
945
- return __awaiter(this, void 0, void 0, function* () {
946
- const response = yield this.axios.get(`/api/admin/bitso/x`, {
947
- params: { bidPrice, bidAmount },
948
- });
949
- return response.data;
950
- });
951
- }
952
- getPaymentMethods(fiat, country) {
953
- return __awaiter(this, void 0, void 0, function* () {
954
- const response = yield this.axios.get(`/api/payment-methods?fiat=${fiat}&country=${country}`);
955
- return response.data;
956
- });
957
- }
958
- getBankAccounts(page, limit, query) {
959
- return __awaiter(this, void 0, void 0, function* () {
960
- const response = yield this.axios.get(`/api/bank/accounts`, {
961
- params: Object.assign({ page,
962
- limit }, query),
963
- });
964
- return response.data;
965
- });
966
- }
967
- getBankAccount(id) {
968
- return __awaiter(this, void 0, void 0, function* () {
969
- const response = yield this.axios.get(`/api/bank/accounts/${id}`);
970
- return response.data;
971
- });
972
- }
973
- getSupportedPayoutMethods(fiat, country) {
974
- return __awaiter(this, void 0, void 0, function* () {
975
- const response = yield this.axios.get(`/api/payout-methods?fiat=${fiat}&country=${country}`);
976
- return response.data;
977
- });
978
- }
979
- createKushkiPayment(orderId, token) {
980
- return __awaiter(this, void 0, void 0, function* () {
981
- const { data } = yield this.axios.post(`/api/payments/card/kushki`, {
982
- orderId,
983
- token,
984
- });
985
- return data;
986
- });
987
- }
988
- addAuthorizedPhoneNumber(id, phoneNumber) {
989
- return __awaiter(this, void 0, void 0, function* () {
990
- const { data } = yield this.axios.post(`/api/users/${id}/authorized-phone-numbers`, {
991
- phoneNumber,
992
- });
993
- return data;
994
- });
995
- }
996
- deleteAuthorizedPhoneNumber(phoneNumber, userId) {
997
- return __awaiter(this, void 0, void 0, function* () {
998
- const { data } = yield this.axios.delete(`/api/users/${userId}/authorized-phone-numbers/${phoneNumber}`);
999
- return data;
1000
- });
1001
- }
1002
- createKushkiBankPayment(orderId) {
1003
- return __awaiter(this, void 0, void 0, function* () {
1004
- const { data } = yield this.axios.post(`/api/payments/bank/kushki`, {
1005
- orderId,
1006
- });
1007
- return data;
1008
- });
1009
- }
1010
- updateAuth(update, id) {
1011
- return __awaiter(this, void 0, void 0, function* () {
1012
- const { data } = yield this.axios.patch(`/api/auth/${id}`, update);
1013
- return data;
1014
- });
1015
- }
1016
- deleteAuth(id) {
1017
- return __awaiter(this, void 0, void 0, function* () {
1018
- yield this.axios.delete(`/api/auth/${id}`);
1019
- });
1020
- }
1021
- getInvoice(orderId) {
1022
- return __awaiter(this, void 0, void 0, function* () {
1023
- const response = yield this.axios.get(`/api/invoices?orderId=${orderId}`);
1024
- return response.data;
1025
- });
1026
- }
1027
- createWebhookRegistration({ userId, brokerId, type, url, }) {
1028
- return __awaiter(this, void 0, void 0, function* () {
1029
- const { data } = yield this.axios.post(`/api/webhooks/${type}`, {
1030
- userId,
1031
- brokerId,
1032
- url,
1033
- });
1034
- return data;
1035
- });
1036
- }
1037
- getWebhookRegistrations(page, query) {
1038
- return __awaiter(this, void 0, void 0, function* () {
1039
- const { data } = yield this.axios.get("/api/webhooks", {
1040
- params: Object.assign({ page }, query),
1041
- });
1042
- return data;
1043
- });
1044
- }
1045
- getWebhookRegistration(id) {
1046
- return __awaiter(this, void 0, void 0, function* () {
1047
- const { data } = yield this.axios.get(`/api/webhooks/${id}`);
1048
- return data;
1049
- });
1050
- }
1051
- deleteWebhookRegistration(id) {
1052
- return __awaiter(this, void 0, void 0, function* () {
1053
- yield this.axios.delete(`/api/webhooks/${id}`);
1054
- });
1055
- }
1056
- createAdminAction({ type, }, formData) {
1057
- return __awaiter(this, void 0, void 0, function* () {
1058
- const { data } = yield this.axios.post(`/api/admin/actions/${type}`, formData);
1059
- return data;
1060
- });
1061
- }
1062
- getAdminActions(page) {
1063
- return __awaiter(this, void 0, void 0, function* () {
1064
- const { data } = yield this.axios.get("/api/admin/actions", {
1065
- params: {
1066
- page,
1067
- },
1068
- });
1069
- return data;
1070
- });
1071
- }
1072
- getAdminAction(id) {
1073
- return __awaiter(this, void 0, void 0, function* () {
1074
- const { data } = yield this.axios.get(`/api/admin/actions/${id}`);
1075
- return data;
1076
- });
1077
- }
1078
- cancelAdminAction(id) {
1079
- return __awaiter(this, void 0, void 0, function* () {
1080
- yield this.axios.put(`/api/admin/actions/${id}/cancel`);
1081
- });
1082
- }
1083
- createArbitrageSettings(arbitrageSettings) {
1084
- return __awaiter(this, void 0, void 0, function* () {
1085
- const { data } = yield this.axios.post(`/api/arbitrage/settings`, arbitrageSettings);
1086
- return data;
1087
- });
1088
- }
1089
- getArbitrageSettings() {
1090
- return __awaiter(this, void 0, void 0, function* () {
1091
- const { data } = yield this.axios.get("/api/arbitrage/settings");
1092
- return data;
1093
- });
1094
- }
1095
- updateArbitrageSettings(arbitrageSettings) {
1096
- return __awaiter(this, void 0, void 0, function* () {
1097
- const { data } = yield this.axios.patch(`/api/arbitrage/settings`, arbitrageSettings);
1098
- return data;
1099
- });
1100
- }
1101
- getArbitrageOpportunities(page, limit) {
1102
- return __awaiter(this, void 0, void 0, function* () {
1103
- const { data } = yield this.axios.get("/api/arbitrage/opportunities", {
1104
- params: {
1105
- page,
1106
- limit,
1107
- },
1108
- });
1109
- return data;
1110
- });
1111
- }
1112
- }
1113
- exports.RioAdminClient = RioAdminClient;