squarefi-bff-api-module 1.0.0

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.
Files changed (58) hide show
  1. package/README.md +36 -0
  2. package/dist/api/auth.d.ts +27 -0
  3. package/dist/api/auth.js +38 -0
  4. package/dist/api/config.d.ts +37 -0
  5. package/dist/api/config.js +40 -0
  6. package/dist/api/developer.d.ts +12 -0
  7. package/dist/api/developer.js +15 -0
  8. package/dist/api/exchange.d.ts +35 -0
  9. package/dist/api/exchange.js +27 -0
  10. package/dist/api/fetch_api.d.ts +1 -0
  11. package/dist/api/fetch_api.js +122 -0
  12. package/dist/api/fiat_accounts.d.ts +32 -0
  13. package/dist/api/fiat_accounts.js +51 -0
  14. package/dist/api/index.d.ts +12 -0
  15. package/dist/api/index.js +17 -0
  16. package/dist/api/issuing.d.ts +31 -0
  17. package/dist/api/issuing.js +68 -0
  18. package/dist/api/kyc.d.ts +6 -0
  19. package/dist/api/kyc.js +9 -0
  20. package/dist/api/list.d.ts +10 -0
  21. package/dist/api/list.js +13 -0
  22. package/dist/api/orders.d.ts +12 -0
  23. package/dist/api/orders.js +34 -0
  24. package/dist/api/types.d.ts +945 -0
  25. package/dist/api/types.js +2 -0
  26. package/dist/api/user.d.ts +18 -0
  27. package/dist/api/user.js +21 -0
  28. package/dist/api/wallets.d.ts +18 -0
  29. package/dist/api/wallets.js +42 -0
  30. package/dist/constants.d.ts +149 -0
  31. package/dist/constants.js +172 -0
  32. package/dist/index.d.ts +5 -0
  33. package/dist/index.js +22 -0
  34. package/dist/utils/apiClientFactory.d.ts +13 -0
  35. package/dist/utils/apiClientFactory.js +132 -0
  36. package/dist/utils/storage.d.ts +3 -0
  37. package/dist/utils/storage.js +30 -0
  38. package/dist/utils/tokensFactory.d.ts +12 -0
  39. package/dist/utils/tokensFactory.js +53 -0
  40. package/package.json +35 -0
  41. package/src/api/auth.ts +50 -0
  42. package/src/api/developer.ts +18 -0
  43. package/src/api/exchange.ts +32 -0
  44. package/src/api/fiat_accounts.ts +69 -0
  45. package/src/api/index.ts +16 -0
  46. package/src/api/issuing.ts +66 -0
  47. package/src/api/kyc.ts +10 -0
  48. package/src/api/list.ts +18 -0
  49. package/src/api/orders.ts +32 -0
  50. package/src/api/types.ts +1141 -0
  51. package/src/api/user.ts +24 -0
  52. package/src/api/wallets.ts +39 -0
  53. package/src/constants.ts +180 -0
  54. package/src/index.ts +7 -0
  55. package/src/utils/apiClientFactory.ts +154 -0
  56. package/src/utils/storage.ts +29 -0
  57. package/src/utils/tokensFactory.ts +50 -0
  58. package/tsconfig.json +15 -0
@@ -0,0 +1,945 @@
1
+ import { APIKeyRole, CardFormFactor, CardStatus, CardTransactionType, CardType, CurrencyType, KYCStatuses, OrderStatuses, OrderType, SubAccountType, WalletTransactionMethod, WalletTransactionRecordType, WalletTransactionType } from '../constants';
2
+ import { WalletType } from '../';
3
+ export declare namespace API {
4
+ namespace Auth {
5
+ namespace Telegram {
6
+ interface Signin {
7
+ tg_id: number;
8
+ hash: string;
9
+ init_data_raw: string;
10
+ }
11
+ interface Signup {
12
+ phone: string;
13
+ tg_id: number;
14
+ first_name: string;
15
+ last_name?: string;
16
+ hash: string;
17
+ init_data_raw: string;
18
+ referrer?: string;
19
+ invite_code?: string;
20
+ username: string;
21
+ }
22
+ }
23
+ interface Tokens {
24
+ access_token: string;
25
+ refresh_token: string;
26
+ }
27
+ namespace UserData {
28
+ namespace Update {
29
+ interface Request {
30
+ default_currency: string;
31
+ }
32
+ }
33
+ interface UserData {
34
+ id: number;
35
+ created_at: string;
36
+ user_id: string;
37
+ kyc_status: KYCStatuses | string;
38
+ kyc_date: string;
39
+ turnover_limit?: number;
40
+ default_currency: string;
41
+ tenant_id: string;
42
+ user_group_id: string;
43
+ is_developer: boolean;
44
+ can_invite: boolean;
45
+ total_turnover: {
46
+ onramp: number;
47
+ offramp: number;
48
+ total: number;
49
+ };
50
+ }
51
+ }
52
+ namespace Update {
53
+ namespace Phone {
54
+ interface Request {
55
+ phone: string;
56
+ }
57
+ }
58
+ }
59
+ namespace SignIn {
60
+ namespace Email {
61
+ namespace OTP {
62
+ interface Request {
63
+ email: string;
64
+ invite_code?: string;
65
+ referrer?: string;
66
+ redirect_url?: string;
67
+ }
68
+ }
69
+ }
70
+ namespace Phone {
71
+ namespace OTP {
72
+ interface Request {
73
+ phone: string;
74
+ invite_code?: string;
75
+ referrer?: string;
76
+ }
77
+ }
78
+ }
79
+ }
80
+ namespace SignUp {
81
+ namespace Password {
82
+ interface Request {
83
+ email: string;
84
+ password: string;
85
+ invite_code?: string;
86
+ referrer?: string;
87
+ }
88
+ }
89
+ }
90
+ interface SupabaseGetSessionResponse {
91
+ session?: Tokens;
92
+ error?: string;
93
+ }
94
+ namespace VerifyOtp {
95
+ type Response = {
96
+ access_token: string;
97
+ refresh_token: string;
98
+ error?: string;
99
+ };
100
+ }
101
+ }
102
+ namespace Cards {
103
+ namespace Config {
104
+ interface Program {
105
+ id: string;
106
+ account_currency: string;
107
+ brand: string;
108
+ card_issuing_fee: number | null;
109
+ card_monthly_fee: number | null;
110
+ initial_topup: number | null;
111
+ form_factor: CardFormFactor | string;
112
+ name: string;
113
+ card_limit: number;
114
+ realtime_auth: boolean;
115
+ tokenizable: boolean;
116
+ vendor_id: string;
117
+ purposes: string[] | null;
118
+ type: CardType | string;
119
+ sub_account_type: SubAccountType | string;
120
+ description: string | null;
121
+ icon: string | null;
122
+ }
123
+ }
124
+ interface User {
125
+ email: string;
126
+ whitelabel: string;
127
+ id: string;
128
+ nickname: string;
129
+ role: string;
130
+ status: string;
131
+ user_type: string;
132
+ invite_accept: boolean;
133
+ is_new_client: boolean;
134
+ account: {
135
+ first_name: string;
136
+ middle_name: string;
137
+ last_name: string;
138
+ date_of_birth: string;
139
+ phone: string;
140
+ type: string;
141
+ id: string;
142
+ user_id: number;
143
+ tg_account: string;
144
+ company: {
145
+ name: string;
146
+ registration_number: string;
147
+ phone: string;
148
+ primary_contact_email: string;
149
+ id: string;
150
+ };
151
+ };
152
+ }
153
+ interface Limit {
154
+ interval?: string;
155
+ amount: number;
156
+ }
157
+ interface Limits {
158
+ single: Limit;
159
+ daily: Limit;
160
+ weekly: Limit;
161
+ monthly: Limit;
162
+ lifetime: Limit;
163
+ }
164
+ interface CardDetailItem {
165
+ brand: string;
166
+ card_id: string;
167
+ last4: string;
168
+ card_status: CardStatus | string;
169
+ form_factor: string;
170
+ name_on_card: string;
171
+ nick_name: string;
172
+ program_id: string;
173
+ wallet_id: string;
174
+ type: CardType | string;
175
+ transaction_limits: {
176
+ amount: number;
177
+ interval: string;
178
+ }[];
179
+ authorization_controls: {
180
+ id: string;
181
+ card_id: string;
182
+ allowed_transaction_count: string;
183
+ allowed_merchant_categories: string | null;
184
+ };
185
+ fiat_account: {
186
+ id: string;
187
+ currency: API.Currencies.FiatCurrency;
188
+ type: SubAccountType | string;
189
+ balance: number;
190
+ nick_name: string;
191
+ wallet_id: string;
192
+ created_at: string;
193
+ payment_types: Array<{
194
+ order_type: OrderType;
195
+ }>;
196
+ account_details?: API.FiatAccounts.FiatAccountDetails;
197
+ };
198
+ }
199
+ interface IssuingCardListItem {
200
+ brand: string;
201
+ card_id: string;
202
+ card_status: string;
203
+ created_at: string;
204
+ nick_name: string | null;
205
+ wallet_id: string;
206
+ program_id: string;
207
+ fiat_account: API.FiatAccounts.FiatAccount;
208
+ last4: string;
209
+ request_id: string;
210
+ name_on_card: string | null;
211
+ type: CardType | string;
212
+ form_factor: CardFormFactor | string;
213
+ tokenizable: boolean;
214
+ }
215
+ interface FiatAccountCardListItem {
216
+ type: string;
217
+ brand: string;
218
+ last4: string;
219
+ card_id: string;
220
+ nick_name: string;
221
+ vendor_id: string;
222
+ wallet_id: string;
223
+ created_at: string;
224
+ program_id: string;
225
+ request_id: string;
226
+ card_status: string;
227
+ expiry_year: number;
228
+ form_factor: string;
229
+ tokenizable: boolean;
230
+ expiry_month: number;
231
+ fiat_account: string;
232
+ name_on_card: string;
233
+ }
234
+ namespace CardsList {
235
+ namespace Request {
236
+ type ByWalletUuid = {
237
+ wallet_uuid: string;
238
+ limit: number;
239
+ offset: number;
240
+ };
241
+ type ByFiatAccountAndWalletId = ByWalletUuid & {
242
+ fiat_account_id: string;
243
+ };
244
+ }
245
+ type Response = {
246
+ count: number;
247
+ data: IssuingCardListItem[];
248
+ };
249
+ }
250
+ interface TransactionItem {
251
+ vendor_transaction_id: string;
252
+ created_at: string;
253
+ cleared_at: string;
254
+ merchant: {
255
+ name: string;
256
+ category_code: string;
257
+ city: string;
258
+ country: string;
259
+ };
260
+ last4: string;
261
+ title: string;
262
+ billing_amount: number;
263
+ billing_currency: string;
264
+ transaction_amount: number;
265
+ transaction_currency: string;
266
+ vendor_sub_account_id: string;
267
+ failure_reason: string;
268
+ status: string;
269
+ transaction_type: CardTransactionType | string;
270
+ is_credit: boolean;
271
+ has_receipt: boolean;
272
+ adjustment_type: string;
273
+ review_status: string;
274
+ group: string;
275
+ total_amount: number;
276
+ }
277
+ interface TransactionsList {
278
+ data: TransactionItem[];
279
+ has_more: boolean;
280
+ }
281
+ interface SensitiveData {
282
+ card_number: string;
283
+ cvv: string;
284
+ expiry_month: number;
285
+ expiry_year: number;
286
+ security_code?: string | null;
287
+ }
288
+ interface OTP {
289
+ created_at: number;
290
+ internal_card_id: string;
291
+ otp: string;
292
+ valid_to: number;
293
+ }
294
+ type AuthorizationControls = {
295
+ allowed_merchant_categories: string[];
296
+ allowed_transaction_count: string;
297
+ };
298
+ type TransactionLimit = {
299
+ amount: number;
300
+ interval: string;
301
+ };
302
+ namespace Create {
303
+ interface CommonRequest {
304
+ program_id: string;
305
+ request_id: string;
306
+ nick_name: string;
307
+ wallet_id: string;
308
+ initial_topup?: number;
309
+ currency_id?: string;
310
+ }
311
+ interface StandAloneRequest extends CommonRequest {
312
+ authorization_controls: AuthorizationControls;
313
+ transaction_limits: TransactionLimit[];
314
+ purpose?: string;
315
+ }
316
+ interface FiatAccountRequest extends CommonRequest {
317
+ sub_account_id: string;
318
+ }
319
+ type StandAloneResponse = CardDetailItem;
320
+ type FiatAccountResponse = CardDetailItem;
321
+ }
322
+ namespace Update {
323
+ interface DeprecatedRequest {
324
+ status: string;
325
+ cardName: string;
326
+ limits: Limits;
327
+ autoTopUp: {
328
+ thresholdAmount: number;
329
+ topUpAmount: number;
330
+ };
331
+ }
332
+ }
333
+ }
334
+ namespace Developer {
335
+ namespace ApiCode {
336
+ interface ApiCode {
337
+ role: APIKeyRole | string;
338
+ name: string;
339
+ id: string;
340
+ created_at: string;
341
+ updated_at: string;
342
+ }
343
+ namespace Create {
344
+ interface Request {
345
+ name: string;
346
+ role: APIKeyRole;
347
+ }
348
+ interface Response extends ApiCode {
349
+ apiKey: string;
350
+ key_hash: string;
351
+ }
352
+ }
353
+ namespace Update {
354
+ interface Request {
355
+ uuid: string;
356
+ role: APIKeyRole;
357
+ }
358
+ }
359
+ namespace Rotate {
360
+ interface Request {
361
+ uuid: string;
362
+ }
363
+ interface Response {
364
+ apiKey: string;
365
+ }
366
+ }
367
+ }
368
+ namespace Vendors {
369
+ interface Vendor {
370
+ id: string;
371
+ name: string;
372
+ type: string;
373
+ currency: string;
374
+ currency_id: string;
375
+ }
376
+ }
377
+ }
378
+ namespace Exchange {
379
+ interface Exchange {
380
+ updated_at: string;
381
+ from: string;
382
+ to: string;
383
+ rate: number;
384
+ inverted_rate: number;
385
+ rate_source: string;
386
+ from_uuid: string;
387
+ to_uuid: string;
388
+ min_amount: string;
389
+ offramp_enabled: boolean;
390
+ onramp_enabled: boolean;
391
+ }
392
+ }
393
+ namespace FiatAccounts {
394
+ type Transaction = API.Cards.TransactionItem;
395
+ type FiatAccountDetails = {
396
+ iban: string;
397
+ bank_name: string;
398
+ swift_code: string;
399
+ bank_address: string;
400
+ receiver_name: string;
401
+ payment_details: string;
402
+ reference_number: string;
403
+ registration_number: string;
404
+ };
405
+ type TransactionList = {
406
+ count: number;
407
+ data: Transaction[];
408
+ has_more: boolean;
409
+ };
410
+ interface FiatAccount {
411
+ balance: number;
412
+ cards_count: number;
413
+ created_at: string;
414
+ currency: API.Currencies.FiatCurrency;
415
+ fiat_balance: number;
416
+ id: string;
417
+ issuing_program: API.Cards.Config.Program;
418
+ nick_name: string;
419
+ program_id: string;
420
+ payment_types: Array<{
421
+ order_type: OrderType;
422
+ }>;
423
+ realtime_auth: [
424
+ {
425
+ crypto_token: string;
426
+ fiat_account: string;
427
+ id: string;
428
+ priority: number;
429
+ }
430
+ ];
431
+ realtimeauth_balance: number;
432
+ status: string;
433
+ total_balance: number;
434
+ wallet_id: string;
435
+ account_details?: FiatAccountDetails;
436
+ }
437
+ interface FiatAccountWithCards extends FiatAccount {
438
+ cards: API.Cards.IssuingCardListItem[];
439
+ }
440
+ }
441
+ namespace FiatAccountsV2 {
442
+ type FiatAccountDetails = {
443
+ iban: string;
444
+ bank_name: string;
445
+ swift_code: string;
446
+ bank_address: string;
447
+ receiver_name: string;
448
+ payment_details: string;
449
+ reference_number: string;
450
+ registration_number: string;
451
+ };
452
+ interface FiatAccount {
453
+ balance: number;
454
+ cards_count: number;
455
+ created_at: string;
456
+ currency: API.Currencies.FiatCurrency;
457
+ fiat_balance: number;
458
+ id: string;
459
+ issuing_program: API.Cards.Config.Program;
460
+ nick_name: string;
461
+ program_id: string;
462
+ realtimeauth_balance: number;
463
+ status: string;
464
+ total_balance: number;
465
+ wallet_id: string;
466
+ }
467
+ namespace ExtendedFiatAccount {
468
+ interface ExtendedFiatAccount extends FiatAccount {
469
+ account_details?: FiatAccountDetails;
470
+ payment_types: Array<{
471
+ order_type: OrderType;
472
+ }>;
473
+ realtime_auth: [
474
+ {
475
+ crypto_token: string;
476
+ fiat_account: string;
477
+ id: string;
478
+ priority: number;
479
+ }
480
+ ];
481
+ }
482
+ interface Request {
483
+ wallet_uuid: string;
484
+ fiat_account_id: string;
485
+ }
486
+ type Response = ExtendedFiatAccount;
487
+ }
488
+ interface FiatAccountWithCards extends FiatAccount {
489
+ cards: API.Cards.IssuingCardListItem[];
490
+ }
491
+ interface FiatAccountsList<T extends FiatAccount | FiatAccountWithCards> {
492
+ count: number;
493
+ data: T[];
494
+ }
495
+ type FiatAccountsListWithCards = FiatAccountsList<FiatAccountWithCards>;
496
+ type FiatAccountsListWithoutCards = FiatAccountsList<FiatAccount>;
497
+ namespace CreateFiatAccount {
498
+ interface Request {
499
+ wallet_id: string;
500
+ program_id: string;
501
+ }
502
+ type Response = {
503
+ id: string;
504
+ balance: number;
505
+ nick_name: string;
506
+ wallet_id: string;
507
+ created_at: string;
508
+ account_currency: string;
509
+ type: SubAccountType | string;
510
+ program_id: string;
511
+ status: 'ACTIVE';
512
+ fiat: {
513
+ code: string;
514
+ uuid: string;
515
+ symbol: string;
516
+ enabled: boolean;
517
+ coingecko: string;
518
+ };
519
+ issuing_program: {
520
+ id: string;
521
+ form_factor: CardFormFactor | string;
522
+ brand: string;
523
+ tokenizable: boolean;
524
+ type: CardType | string;
525
+ };
526
+ };
527
+ }
528
+ namespace Transactions {
529
+ type Transaction = {
530
+ vendor_transaction_id: string;
531
+ created_at: string;
532
+ cleared_at: string;
533
+ merchant: {
534
+ name: string;
535
+ category_code: string;
536
+ city: string;
537
+ country: string;
538
+ };
539
+ last4: string;
540
+ title: string;
541
+ billing_amount: number;
542
+ billing_currency: string;
543
+ transaction_amount: number;
544
+ transaction_currency: string;
545
+ vendor_sub_account_id: string;
546
+ failure_reason: string;
547
+ status: string;
548
+ transaction_type: string;
549
+ is_credit: boolean;
550
+ has_receipt: boolean;
551
+ adjustment_type: string;
552
+ review_status: string;
553
+ group: string;
554
+ total_amount: number;
555
+ };
556
+ namespace TransactionList {
557
+ interface Request {
558
+ fiat_account_id: string;
559
+ wallet_uuid: string;
560
+ limit?: number;
561
+ offset?: number;
562
+ }
563
+ interface Response {
564
+ count: number;
565
+ data: Transaction[];
566
+ has_more: boolean;
567
+ }
568
+ }
569
+ }
570
+ }
571
+ namespace Issuing {
572
+ namespace Programs {
573
+ type Response = {
574
+ count: number;
575
+ data: API.Cards.Config.Program[];
576
+ };
577
+ }
578
+ }
579
+ namespace KYC {
580
+ namespace Sumsub {
581
+ namespace GenerateToken {
582
+ interface Request {
583
+ user_data_id: number;
584
+ }
585
+ interface Response extends Request {
586
+ token: string;
587
+ }
588
+ }
589
+ }
590
+ }
591
+ namespace Currencies {
592
+ interface CommonCurrencyFields {
593
+ uuid: string;
594
+ decimal: number | null;
595
+ is_memo: boolean | null;
596
+ is_stablecoin: boolean;
597
+ is_enabled: boolean;
598
+ render_decimal: number;
599
+ meta: {
600
+ icon: string;
601
+ name: string;
602
+ symbol: string;
603
+ description: string;
604
+ };
605
+ type: CurrencyType;
606
+ }
607
+ export interface CryptoCurrency extends CommonCurrencyFields {
608
+ is_crypto: true;
609
+ meta: CommonCurrencyFields['meta'] & {
610
+ chain_id: number;
611
+ contract: string;
612
+ chain_name: string;
613
+ };
614
+ }
615
+ export interface FiatCurrency extends CommonCurrencyFields {
616
+ is_crypto: false;
617
+ meta: CommonCurrencyFields['meta'] & {
618
+ code: string;
619
+ iso_code: number;
620
+ sign: string;
621
+ };
622
+ }
623
+ export type Currency = CryptoCurrency | FiatCurrency;
624
+ export type CurrencyList = {
625
+ count: number;
626
+ data: Currency[];
627
+ };
628
+ export {};
629
+ }
630
+ namespace Chains {
631
+ interface Chain {
632
+ id: number;
633
+ name: string;
634
+ symbol: string;
635
+ is_beta: boolean | null;
636
+ }
637
+ type ChainList = {
638
+ count: number;
639
+ data: Chain[];
640
+ };
641
+ }
642
+ namespace Wallets {
643
+ interface WallletBalanceCryptoDetails {
644
+ uuid: string;
645
+ amount: number;
646
+ fiat_amount: number;
647
+ currency: API.Currencies.Currency;
648
+ }
649
+ interface WalletBalanceItem {
650
+ symbol: string;
651
+ icon: string;
652
+ name: string;
653
+ is_crypto: boolean;
654
+ decimal?: number | null;
655
+ amount: number;
656
+ fiat_amount: number;
657
+ details: WallletBalanceCryptoDetails[];
658
+ }
659
+ type WalletBalance = WalletBalanceItem[];
660
+ namespace WalletChain {
661
+ interface WalletChain {
662
+ uuid: string;
663
+ created_ad: string;
664
+ address: string;
665
+ wallet_uuid: string;
666
+ chain: number;
667
+ }
668
+ namespace Create {
669
+ interface Request {
670
+ wallet_uuid: string;
671
+ chain: number;
672
+ label: string;
673
+ }
674
+ type Response = WalletChain;
675
+ }
676
+ }
677
+ interface Wallet {
678
+ uuid: string;
679
+ type: WalletType | string;
680
+ created_at: string;
681
+ fiat_total: number;
682
+ crypto_total: number;
683
+ total_amount: number;
684
+ balance: WalletBalance;
685
+ }
686
+ namespace WalletsList {
687
+ interface WalletsListItem {
688
+ type: WalletType | string;
689
+ uuid: string;
690
+ created_at: string;
691
+ }
692
+ type Response = {
693
+ total: number;
694
+ data: WalletsListItem[];
695
+ };
696
+ }
697
+ namespace WalletTransactions {
698
+ interface WalletTransactionMeta {
699
+ transaction_hash?: string;
700
+ fee?: number;
701
+ order_id?: string;
702
+ from_address?: string;
703
+ to_address?: string;
704
+ network_fee?: number;
705
+ network_fee_currency?: string;
706
+ fee_currency?: string;
707
+ billing_amount?: number;
708
+ utila_transaction?: string;
709
+ transcation_amount?: number;
710
+ transaction_amount?: number;
711
+ billing_amount_currency?: string;
712
+ transcation_amount_currency?: string;
713
+ transaction_amount_currency?: string;
714
+ exchange_rate?: number;
715
+ fiat_account_id?: string;
716
+ txid?: string;
717
+ chain_id?: number;
718
+ from_user_data?: number;
719
+ to_user_data?: number;
720
+ to_card_id?: string;
721
+ to_card_last4?: string;
722
+ to_fiat_account_id?: string;
723
+ to_vendor_id?: string;
724
+ }
725
+ interface Transaction {
726
+ id: number;
727
+ created_at: string;
728
+ type: WalletTransactionType | string;
729
+ method: WalletTransactionMethod | string;
730
+ status: string;
731
+ amount: number;
732
+ from: string | null;
733
+ to: string | null;
734
+ wallet_id: string;
735
+ txid: string;
736
+ info: string;
737
+ currency: API.Currencies.Currency;
738
+ record_type: WalletTransactionRecordType | string;
739
+ meta?: WalletTransactionMeta;
740
+ }
741
+ namespace TransactionList {
742
+ type Response = {
743
+ total: number;
744
+ data: Transaction[];
745
+ };
746
+ }
747
+ }
748
+ }
749
+ namespace Orders {
750
+ namespace Create {
751
+ namespace ByOrderType {
752
+ namespace TRANSFER_CARD_SUBACCOUNT {
753
+ type Request = {
754
+ amount: number;
755
+ wallet_uuid: string;
756
+ from_uuid: string;
757
+ sub_account_id: string;
758
+ };
759
+ type Response = {
760
+ id: number;
761
+ created_at: string;
762
+ order_uuid: string;
763
+ wallet_uuid: string;
764
+ fiat_uuid: string;
765
+ crypto_uuid: string;
766
+ amount_fiat: number;
767
+ payment_method: string;
768
+ redirect_url: string;
769
+ status: string;
770
+ provider_uuid: string;
771
+ };
772
+ }
773
+ namespace WITHDRAWAL_CRYPTO {
774
+ type Request = {
775
+ amount: number;
776
+ is_subsctract: boolean;
777
+ wallet_uuid: string;
778
+ crypto_uuid: string;
779
+ to_address: string;
780
+ memo?: string;
781
+ };
782
+ type Response = {
783
+ id: number;
784
+ created_at: string;
785
+ order_uuid: string;
786
+ wallet_uuid: string;
787
+ crypto_uuid: string;
788
+ amount: number;
789
+ status: string;
790
+ network: string;
791
+ to_address: string;
792
+ txid: string;
793
+ };
794
+ }
795
+ namespace EXCHANGE_CRYPTO_INTERNAL {
796
+ type Request = {
797
+ amount: number;
798
+ wallet_uuid: string;
799
+ from_uuid: string;
800
+ to_uuid: string;
801
+ };
802
+ type Response = {
803
+ id: number;
804
+ };
805
+ }
806
+ namespace TRANSFER_CARD_WHOLESALE {
807
+ type Request = {
808
+ amount: number;
809
+ wallet_id: string;
810
+ currency_id: string;
811
+ vendor_id: string;
812
+ };
813
+ }
814
+ }
815
+ }
816
+ namespace Calc {
817
+ interface CommonRequestParams {
818
+ from_currency: string;
819
+ to_currency: string;
820
+ amount: number;
821
+ is_reverse?: boolean;
822
+ signal?: AbortSignal;
823
+ }
824
+ export interface WithdrawCryptoRequest extends CommonRequestParams {
825
+ order_type: OrderType.WITHDRAWAL_CRYPTO;
826
+ to_address?: string;
827
+ }
828
+ export interface NonWithdrawCryptoRequest extends CommonRequestParams {
829
+ order_type: Exclude<OrderType, OrderType.WITHDRAWAL_CRYPTO>;
830
+ to_address?: never;
831
+ }
832
+ export type Request = NonWithdrawCryptoRequest | WithdrawCryptoRequest;
833
+ export interface Response {
834
+ from_currency: string;
835
+ to_currency: string;
836
+ from_symbol: string;
837
+ to_symbol: string;
838
+ from_amount: number;
839
+ net_amount: number;
840
+ result_amount: number;
841
+ fees: number;
842
+ comission: number;
843
+ base_markup: number;
844
+ network_fee: number;
845
+ transaction_fee: number;
846
+ rate: number;
847
+ direction: 'c2f' | 'f2c' | 'c2c';
848
+ }
849
+ export {};
850
+ }
851
+ namespace Status {
852
+ interface Response {
853
+ id: number;
854
+ created_at: string;
855
+ order_uuid: string;
856
+ wallet_uuid: string;
857
+ crypto_uuid: string;
858
+ status: OrderStatuses | string;
859
+ amount: number;
860
+ comission: number;
861
+ net_amount: number;
862
+ type: OrderType | string;
863
+ }
864
+ }
865
+ }
866
+ namespace User {
867
+ interface User {
868
+ id: string;
869
+ aud: string;
870
+ confirmation_sent_at: string;
871
+ recovery_sent_at: string;
872
+ email_change_sent_at: string;
873
+ new_email: string;
874
+ new_phone: string;
875
+ invited_at: string;
876
+ action_link: string;
877
+ email: string;
878
+ phone: string;
879
+ created_at: string;
880
+ confirmed_at: string;
881
+ email_confirmed_at: string;
882
+ phone_confirmed_at: string;
883
+ last_sign_in_at: string;
884
+ role: string;
885
+ updated_at: string;
886
+ identities: string[];
887
+ is_anonymous: boolean;
888
+ factors: string[];
889
+ }
890
+ namespace UpdateUser {
891
+ namespace Phone {
892
+ namespace RequestOTP {
893
+ type Request = {
894
+ phone: string;
895
+ access_token: string;
896
+ refresh_token: string;
897
+ };
898
+ }
899
+ namespace Confirm {
900
+ type Request = {
901
+ phone: string;
902
+ token: string;
903
+ };
904
+ }
905
+ }
906
+ namespace Email {
907
+ namespace RequestOTP {
908
+ type Request = {
909
+ email: string;
910
+ access_token: string;
911
+ refresh_token: string;
912
+ };
913
+ }
914
+ namespace Confirm {
915
+ type Request = {
916
+ email: string;
917
+ token: string;
918
+ };
919
+ }
920
+ }
921
+ }
922
+ namespace UserData {
923
+ interface UserData {
924
+ can_invite: boolean;
925
+ created_at: string;
926
+ id: number;
927
+ kyc_date: string;
928
+ kyc_status: KYCStatuses | string;
929
+ referral_name: string;
930
+ tenant_id: string;
931
+ turnover_limit: number;
932
+ user_id: string;
933
+ default_currency: string;
934
+ is_developer: boolean;
935
+ user_group_id: string | null;
936
+ }
937
+ namespace UpdateUserData {
938
+ type Request = {
939
+ default_currency: string;
940
+ };
941
+ type Response = API.User.UserData.UserData;
942
+ }
943
+ }
944
+ }
945
+ }