squarefi-bff-api-module 1.16.0 → 1.17.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.
- package/CHANGELOG.md +54 -0
- package/dist/api/index.d.ts +0 -2
- package/dist/api/index.js +0 -2
- package/dist/api/issuing.d.ts +16 -0
- package/dist/api/issuing.js +27 -2
- package/dist/api/types.d.ts +51 -51
- package/package.json +1 -1
- package/src/api/index.ts +0 -3
- package/src/api/issuing.ts +43 -2
- package/src/api/types.ts +52 -52
- package/src/api/fiat_accounts.ts +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,60 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.17.0] - 2025-04-18
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Removed fiat_accounts API and integrated functionality into sub_accounts module
|
|
13
|
+
|
|
14
|
+
## [1.16.1] - 2025-04-16
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Updated changelog documentation
|
|
19
|
+
|
|
20
|
+
## [1.16.0] - 2025-04-16
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Added support for fetching transactions by fiat account ID
|
|
25
|
+
|
|
26
|
+
## [1.15.1] - 2025-04-16
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Simplified logout logic in API client
|
|
31
|
+
|
|
32
|
+
## [1.15.0] - 2025-04-14
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Added CSV export functionality for transactions
|
|
37
|
+
|
|
38
|
+
## [1.14.0] - 2025-04-11
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Added delete functionality for counterparties destinations
|
|
43
|
+
|
|
44
|
+
## [1.13.5] - 2025-04-11
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- Added optional memo field to external crypto data type
|
|
49
|
+
|
|
50
|
+
## [1.13.4] - 2025-04-11
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- Added optional memo field to external crypto data type
|
|
55
|
+
|
|
56
|
+
## [1.13.3] - 2025-04-10
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
|
|
60
|
+
- Moved search parameter to filter object in API types
|
|
61
|
+
|
|
8
62
|
## [1.13.2] - 2025-04-08
|
|
9
63
|
|
|
10
64
|
### Changed
|
package/dist/api/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { auth } from './auth';
|
|
|
2
2
|
import { counterparties } from './counterparties';
|
|
3
3
|
import { developer } from './developer';
|
|
4
4
|
import { exchange } from './exchange';
|
|
5
|
-
import { fiat_accounts } from './fiat_accounts';
|
|
6
5
|
import { issuing } from './issuing';
|
|
7
6
|
import { kyc } from './kyc';
|
|
8
7
|
import { list } from './list';
|
|
@@ -16,7 +15,6 @@ type Api = {
|
|
|
16
15
|
counterparties: typeof counterparties;
|
|
17
16
|
developer: typeof developer;
|
|
18
17
|
exchange: typeof exchange;
|
|
19
|
-
fiat_accounts: typeof fiat_accounts;
|
|
20
18
|
issuing: typeof issuing;
|
|
21
19
|
kyc: typeof kyc;
|
|
22
20
|
list: typeof list;
|
package/dist/api/index.js
CHANGED
|
@@ -5,7 +5,6 @@ const auth_1 = require("./auth");
|
|
|
5
5
|
const counterparties_1 = require("./counterparties");
|
|
6
6
|
const developer_1 = require("./developer");
|
|
7
7
|
const exchange_1 = require("./exchange");
|
|
8
|
-
const fiat_accounts_1 = require("./fiat_accounts");
|
|
9
8
|
const issuing_1 = require("./issuing");
|
|
10
9
|
const kyc_1 = require("./kyc");
|
|
11
10
|
const list_1 = require("./list");
|
|
@@ -19,7 +18,6 @@ exports.squarefi_bff_api_client = {
|
|
|
19
18
|
counterparties: counterparties_1.counterparties,
|
|
20
19
|
developer: developer_1.developer,
|
|
21
20
|
exchange: exchange_1.exchange,
|
|
22
|
-
fiat_accounts: fiat_accounts_1.fiat_accounts,
|
|
23
21
|
issuing: issuing_1.issuing,
|
|
24
22
|
kyc: kyc_1.kyc,
|
|
25
23
|
list: list_1.list,
|
package/dist/api/issuing.d.ts
CHANGED
|
@@ -37,6 +37,22 @@ export declare const issuing: {
|
|
|
37
37
|
getByFiatAccountId: (fiat_account_id: string) => Promise<string>;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
+
sub_accounts: {
|
|
41
|
+
list: {
|
|
42
|
+
withCards: {
|
|
43
|
+
getSinglecards: (wallet_uuid: string, limit: number, offset: number) => Promise<API.Issuing.SubAccounts.SubAccountWithCards[]>;
|
|
44
|
+
getAll: (wallet_uuid: string, limit: number, offset: number) => Promise<API.Issuing.SubAccounts.SubAccountWithCards[]>;
|
|
45
|
+
};
|
|
46
|
+
withoutCards: {
|
|
47
|
+
getAll: (wallet_uuid: string, limit: number, offset: number) => Promise<API.Issuing.SubAccounts.SubAccount[]>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
getByUuid: (uuid: string) => Promise<API.Issuing.SubAccounts.SubAccount>;
|
|
51
|
+
create: (wallet_id: string, program_id: string) => Promise<API.Issuing.SubAccounts.SubAccount>;
|
|
52
|
+
transactions: {
|
|
53
|
+
get: (fiat_account_id: string, limit?: number, offset?: number) => Promise<API.Issuing.SubAccounts.TransactionList>;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
40
56
|
config: {
|
|
41
57
|
programs: {
|
|
42
58
|
getAll: () => Promise<API.Cards.Config.Program[]>;
|
package/dist/api/issuing.js
CHANGED
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.issuing = void 0;
|
|
13
13
|
const apiClientFactory_1 = require("../utils/apiClientFactory");
|
|
14
14
|
const constants_1 = require("../constants");
|
|
15
|
-
const fiat_accounts_1 = require("./fiat_accounts");
|
|
16
15
|
const encrypt_1 = require("../utils/encrypt");
|
|
17
16
|
exports.issuing = {
|
|
18
17
|
cards: {
|
|
@@ -30,7 +29,7 @@ exports.issuing = {
|
|
|
30
29
|
// getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
|
|
31
30
|
getById: (card_id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
31
|
const card = yield apiClientFactory_1.apiClientV1.getRequest(`/issuing/cards/${card_id}`);
|
|
33
|
-
const fiatAccountData = yield
|
|
32
|
+
const fiatAccountData = yield exports.issuing.sub_accounts.getByUuid(card.fiat_account.id);
|
|
34
33
|
return Object.assign(Object.assign({}, card), { fiat_account: Object.assign(Object.assign({}, fiatAccountData), { type: card.fiat_account.type }) });
|
|
35
34
|
}),
|
|
36
35
|
sensitiveData: {
|
|
@@ -84,6 +83,32 @@ exports.issuing = {
|
|
|
84
83
|
}),
|
|
85
84
|
},
|
|
86
85
|
},
|
|
86
|
+
sub_accounts: {
|
|
87
|
+
list: {
|
|
88
|
+
withCards: {
|
|
89
|
+
getSinglecards: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/sub_account/list/${wallet_uuid}`, {
|
|
90
|
+
params: { limit, offset, lt_cards_limit: 2, gt_cards_limit: 0, show_cards: true },
|
|
91
|
+
}),
|
|
92
|
+
getAll: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/sub_account/list/${wallet_uuid}`, {
|
|
93
|
+
params: { limit, offset, show_cards: true },
|
|
94
|
+
}),
|
|
95
|
+
},
|
|
96
|
+
withoutCards: {
|
|
97
|
+
getAll: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/sub_account/list/${wallet_uuid}`, {
|
|
98
|
+
params: { limit, offset },
|
|
99
|
+
}),
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
getByUuid: (uuid) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/sub_account/${uuid}`),
|
|
103
|
+
create: (wallet_id, program_id) => apiClientFactory_1.apiClientV1.postRequest(`/issuing/sub_account`, {
|
|
104
|
+
data: { wallet_id, program_id },
|
|
105
|
+
}),
|
|
106
|
+
transactions: {
|
|
107
|
+
get: (fiat_account_id, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/sub_account/${fiat_account_id}/transactions`, {
|
|
108
|
+
params: { limit, offset },
|
|
109
|
+
}),
|
|
110
|
+
},
|
|
111
|
+
},
|
|
87
112
|
config: {
|
|
88
113
|
programs: {
|
|
89
114
|
getAll: () => apiClientFactory_1.apiClientV1.getRequest('/issuing/config/programs').then(({ data }) => data),
|
package/dist/api/types.d.ts
CHANGED
|
@@ -185,7 +185,7 @@ export declare namespace API {
|
|
|
185
185
|
nick_name: string | null;
|
|
186
186
|
wallet_id: string;
|
|
187
187
|
program_id: string;
|
|
188
|
-
fiat_account: API.
|
|
188
|
+
fiat_account: API.Issuing.SubAccounts.SubAccount;
|
|
189
189
|
last4: string;
|
|
190
190
|
request_id: string;
|
|
191
191
|
name_on_card: string | null;
|
|
@@ -197,7 +197,7 @@ export declare namespace API {
|
|
|
197
197
|
id: string;
|
|
198
198
|
brand: string;
|
|
199
199
|
card_id: string;
|
|
200
|
-
fiat_account: API.
|
|
200
|
+
fiat_account: API.Issuing.SubAccounts.SubAccount;
|
|
201
201
|
last4: string;
|
|
202
202
|
card_status: string;
|
|
203
203
|
form_factor: string;
|
|
@@ -623,55 +623,6 @@ export declare namespace API {
|
|
|
623
623
|
onramp_enabled: boolean;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
namespace FiatAccounts {
|
|
627
|
-
type Transaction = API.Cards.TransactionItem;
|
|
628
|
-
type FiatAccountDetails = {
|
|
629
|
-
iban: string;
|
|
630
|
-
bank_name: string;
|
|
631
|
-
swift_code: string;
|
|
632
|
-
bank_address: string;
|
|
633
|
-
receiver_name: string;
|
|
634
|
-
payment_details: string;
|
|
635
|
-
reference_number: string;
|
|
636
|
-
registration_number: string;
|
|
637
|
-
};
|
|
638
|
-
type TransactionList = {
|
|
639
|
-
count: number;
|
|
640
|
-
data: Transaction[];
|
|
641
|
-
has_more: boolean;
|
|
642
|
-
};
|
|
643
|
-
interface FiatAccount {
|
|
644
|
-
balance: number;
|
|
645
|
-
cards_count: number;
|
|
646
|
-
created_at: string;
|
|
647
|
-
currency: API.Currencies.FiatCurrency;
|
|
648
|
-
fiat_balance: number;
|
|
649
|
-
type: SubAccountType | string;
|
|
650
|
-
id: string;
|
|
651
|
-
issuing_program: API.Cards.Config.Program;
|
|
652
|
-
nick_name: string;
|
|
653
|
-
program_id: string;
|
|
654
|
-
payment_types: Array<{
|
|
655
|
-
order_type: OrderType;
|
|
656
|
-
}>;
|
|
657
|
-
realtime_auth: [
|
|
658
|
-
{
|
|
659
|
-
crypto_token: string;
|
|
660
|
-
fiat_account: string;
|
|
661
|
-
id: string;
|
|
662
|
-
priority: number;
|
|
663
|
-
}
|
|
664
|
-
];
|
|
665
|
-
realtimeauth_balance: number;
|
|
666
|
-
status: string;
|
|
667
|
-
total_balance: number;
|
|
668
|
-
wallet_id: string;
|
|
669
|
-
account_details?: FiatAccountDetails;
|
|
670
|
-
}
|
|
671
|
-
interface FiatAccountWithCards extends FiatAccount {
|
|
672
|
-
cards: API.Cards.IssuingCardListItem[];
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
626
|
namespace FiatAccountsV2 {
|
|
676
627
|
type FiatAccountDetails = {
|
|
677
628
|
iban: string;
|
|
@@ -809,6 +760,55 @@ export declare namespace API {
|
|
|
809
760
|
data: API.Cards.Config.Program[];
|
|
810
761
|
};
|
|
811
762
|
}
|
|
763
|
+
namespace SubAccounts {
|
|
764
|
+
type Transaction = API.Cards.TransactionItem;
|
|
765
|
+
type SubAccountDetails = {
|
|
766
|
+
iban: string;
|
|
767
|
+
bank_name: string;
|
|
768
|
+
swift_code: string;
|
|
769
|
+
bank_address: string;
|
|
770
|
+
receiver_name: string;
|
|
771
|
+
payment_details: string;
|
|
772
|
+
reference_number: string;
|
|
773
|
+
registration_number: string;
|
|
774
|
+
};
|
|
775
|
+
type TransactionList = {
|
|
776
|
+
count: number;
|
|
777
|
+
data: Transaction[];
|
|
778
|
+
has_more: boolean;
|
|
779
|
+
};
|
|
780
|
+
interface SubAccount {
|
|
781
|
+
balance: number;
|
|
782
|
+
cards_count: number;
|
|
783
|
+
created_at: string;
|
|
784
|
+
currency: API.Currencies.FiatCurrency;
|
|
785
|
+
fiat_balance: number;
|
|
786
|
+
type: SubAccountType | string;
|
|
787
|
+
id: string;
|
|
788
|
+
issuing_program: API.Cards.Config.Program;
|
|
789
|
+
nick_name: string;
|
|
790
|
+
program_id: string;
|
|
791
|
+
payment_types: Array<{
|
|
792
|
+
order_type: OrderType;
|
|
793
|
+
}>;
|
|
794
|
+
realtime_auth: [
|
|
795
|
+
{
|
|
796
|
+
crypto_token: string;
|
|
797
|
+
fiat_account: string;
|
|
798
|
+
id: string;
|
|
799
|
+
priority: number;
|
|
800
|
+
}
|
|
801
|
+
];
|
|
802
|
+
realtimeauth_balance: number;
|
|
803
|
+
status: string;
|
|
804
|
+
total_balance: number;
|
|
805
|
+
wallet_id: string;
|
|
806
|
+
account_details?: SubAccountDetails;
|
|
807
|
+
}
|
|
808
|
+
interface SubAccountWithCards extends SubAccount {
|
|
809
|
+
cards: API.Cards.IssuingCardListItem[];
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
812
|
}
|
|
813
813
|
namespace KYC {
|
|
814
814
|
namespace Sumsub {
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { auth } from './auth';
|
|
|
2
2
|
import { counterparties } from './counterparties';
|
|
3
3
|
import { developer } from './developer';
|
|
4
4
|
import { exchange } from './exchange';
|
|
5
|
-
import { fiat_accounts } from './fiat_accounts';
|
|
6
5
|
import { issuing } from './issuing';
|
|
7
6
|
import { kyc } from './kyc';
|
|
8
7
|
import { list } from './list';
|
|
@@ -17,7 +16,6 @@ type Api = {
|
|
|
17
16
|
counterparties: typeof counterparties;
|
|
18
17
|
developer: typeof developer;
|
|
19
18
|
exchange: typeof exchange;
|
|
20
|
-
fiat_accounts: typeof fiat_accounts;
|
|
21
19
|
issuing: typeof issuing;
|
|
22
20
|
kyc: typeof kyc;
|
|
23
21
|
list: typeof list;
|
|
@@ -33,7 +31,6 @@ export const squarefi_bff_api_client: Api = {
|
|
|
33
31
|
counterparties,
|
|
34
32
|
developer,
|
|
35
33
|
exchange,
|
|
36
|
-
fiat_accounts,
|
|
37
34
|
issuing,
|
|
38
35
|
kyc,
|
|
39
36
|
list,
|
package/src/api/issuing.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { API } from './types';
|
|
2
2
|
import { apiClientV1 } from '../utils/apiClientFactory';
|
|
3
3
|
import { defaultPaginationParams } from '../constants';
|
|
4
|
-
import { fiat_accounts } from './fiat_accounts';
|
|
5
4
|
import { makeSecureRequest } from '../utils/encrypt';
|
|
6
5
|
export const issuing = {
|
|
7
6
|
cards: {
|
|
@@ -24,7 +23,7 @@ export const issuing = {
|
|
|
24
23
|
// getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
|
|
25
24
|
getById: async (card_id: string): Promise<API.Cards.IssuingCardDetailItem> => {
|
|
26
25
|
const card = await apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`);
|
|
27
|
-
const fiatAccountData = await
|
|
26
|
+
const fiatAccountData = await issuing.sub_accounts.getByUuid(card.fiat_account.id);
|
|
28
27
|
return { ...card, fiat_account: { ...fiatAccountData, type: card.fiat_account.type } };
|
|
29
28
|
},
|
|
30
29
|
sensitiveData: {
|
|
@@ -94,6 +93,48 @@ export const issuing = {
|
|
|
94
93
|
}),
|
|
95
94
|
},
|
|
96
95
|
},
|
|
96
|
+
sub_accounts: {
|
|
97
|
+
list: {
|
|
98
|
+
withCards: {
|
|
99
|
+
getSinglecards: (wallet_uuid: string, limit: number, offset: number) =>
|
|
100
|
+
apiClientV1.getRequest<API.Issuing.SubAccounts.SubAccountWithCards[]>(
|
|
101
|
+
`/issuing/sub_account/list/${wallet_uuid}`,
|
|
102
|
+
{
|
|
103
|
+
params: { limit, offset, lt_cards_limit: 2, gt_cards_limit: 0, show_cards: true },
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
getAll: (wallet_uuid: string, limit: number, offset: number) =>
|
|
107
|
+
apiClientV1.getRequest<API.Issuing.SubAccounts.SubAccountWithCards[]>(
|
|
108
|
+
`/issuing/sub_account/list/${wallet_uuid}`,
|
|
109
|
+
{
|
|
110
|
+
params: { limit, offset, show_cards: true },
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
},
|
|
114
|
+
withoutCards: {
|
|
115
|
+
getAll: (wallet_uuid: string, limit: number, offset: number) =>
|
|
116
|
+
apiClientV1.getRequest<API.Issuing.SubAccounts.SubAccount[]>(`/issuing/sub_account/list/${wallet_uuid}`, {
|
|
117
|
+
params: { limit, offset },
|
|
118
|
+
}),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
getByUuid: (uuid: string) =>
|
|
123
|
+
apiClientV1.getRequest<API.Issuing.SubAccounts.SubAccount>(`/issuing/sub_account/${uuid}`),
|
|
124
|
+
create: (wallet_id: string, program_id: string) =>
|
|
125
|
+
apiClientV1.postRequest<API.Issuing.SubAccounts.SubAccount>(`/issuing/sub_account`, {
|
|
126
|
+
data: { wallet_id, program_id },
|
|
127
|
+
}),
|
|
128
|
+
transactions: {
|
|
129
|
+
get: (fiat_account_id: string, limit?: number, offset?: number) =>
|
|
130
|
+
apiClientV1.getRequest<API.Issuing.SubAccounts.TransactionList>(
|
|
131
|
+
`/issuing/sub_account/${fiat_account_id}/transactions`,
|
|
132
|
+
{
|
|
133
|
+
params: { limit, offset },
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
},
|
|
137
|
+
},
|
|
97
138
|
config: {
|
|
98
139
|
programs: {
|
|
99
140
|
getAll: () =>
|
package/src/api/types.ts
CHANGED
|
@@ -217,7 +217,7 @@ export namespace API {
|
|
|
217
217
|
wallet_id: string;
|
|
218
218
|
program_id: string;
|
|
219
219
|
|
|
220
|
-
fiat_account: API.
|
|
220
|
+
fiat_account: API.Issuing.SubAccounts.SubAccount;
|
|
221
221
|
last4: string;
|
|
222
222
|
request_id: string;
|
|
223
223
|
name_on_card: string | null;
|
|
@@ -230,7 +230,7 @@ export namespace API {
|
|
|
230
230
|
id: string;
|
|
231
231
|
brand: string;
|
|
232
232
|
card_id: string;
|
|
233
|
-
fiat_account: API.
|
|
233
|
+
fiat_account: API.Issuing.SubAccounts.SubAccount;
|
|
234
234
|
last4: string;
|
|
235
235
|
card_status: string;
|
|
236
236
|
form_factor: string;
|
|
@@ -766,56 +766,6 @@ export namespace API {
|
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
768
|
|
|
769
|
-
export namespace FiatAccounts {
|
|
770
|
-
export type Transaction = API.Cards.TransactionItem;
|
|
771
|
-
export type FiatAccountDetails = {
|
|
772
|
-
iban: string;
|
|
773
|
-
bank_name: string;
|
|
774
|
-
swift_code: string;
|
|
775
|
-
bank_address: string;
|
|
776
|
-
receiver_name: string;
|
|
777
|
-
payment_details: string;
|
|
778
|
-
reference_number: string;
|
|
779
|
-
registration_number: string;
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
export type TransactionList = {
|
|
783
|
-
count: number;
|
|
784
|
-
data: Transaction[];
|
|
785
|
-
has_more: boolean;
|
|
786
|
-
};
|
|
787
|
-
export interface FiatAccount {
|
|
788
|
-
balance: number;
|
|
789
|
-
cards_count: number;
|
|
790
|
-
created_at: string;
|
|
791
|
-
currency: API.Currencies.FiatCurrency;
|
|
792
|
-
fiat_balance: number;
|
|
793
|
-
type: SubAccountType | string;
|
|
794
|
-
id: string;
|
|
795
|
-
issuing_program: API.Cards.Config.Program;
|
|
796
|
-
nick_name: string;
|
|
797
|
-
program_id: string;
|
|
798
|
-
payment_types: Array<{ order_type: OrderType }>;
|
|
799
|
-
realtime_auth: [
|
|
800
|
-
{
|
|
801
|
-
crypto_token: string;
|
|
802
|
-
fiat_account: string;
|
|
803
|
-
id: string;
|
|
804
|
-
priority: number;
|
|
805
|
-
}
|
|
806
|
-
];
|
|
807
|
-
realtimeauth_balance: number;
|
|
808
|
-
status: string;
|
|
809
|
-
total_balance: number;
|
|
810
|
-
wallet_id: string;
|
|
811
|
-
account_details?: FiatAccountDetails;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
export interface FiatAccountWithCards extends FiatAccount {
|
|
815
|
-
cards: API.Cards.IssuingCardListItem[];
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
|
|
819
769
|
export namespace FiatAccountsV2 {
|
|
820
770
|
export type FiatAccountDetails = {
|
|
821
771
|
iban: string;
|
|
@@ -962,6 +912,56 @@ export namespace API {
|
|
|
962
912
|
data: API.Cards.Config.Program[];
|
|
963
913
|
};
|
|
964
914
|
}
|
|
915
|
+
|
|
916
|
+
export namespace SubAccounts {
|
|
917
|
+
export type Transaction = API.Cards.TransactionItem;
|
|
918
|
+
export type SubAccountDetails = {
|
|
919
|
+
iban: string;
|
|
920
|
+
bank_name: string;
|
|
921
|
+
swift_code: string;
|
|
922
|
+
bank_address: string;
|
|
923
|
+
receiver_name: string;
|
|
924
|
+
payment_details: string;
|
|
925
|
+
reference_number: string;
|
|
926
|
+
registration_number: string;
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
export type TransactionList = {
|
|
930
|
+
count: number;
|
|
931
|
+
data: Transaction[];
|
|
932
|
+
has_more: boolean;
|
|
933
|
+
};
|
|
934
|
+
export interface SubAccount {
|
|
935
|
+
balance: number;
|
|
936
|
+
cards_count: number;
|
|
937
|
+
created_at: string;
|
|
938
|
+
currency: API.Currencies.FiatCurrency;
|
|
939
|
+
fiat_balance: number;
|
|
940
|
+
type: SubAccountType | string;
|
|
941
|
+
id: string;
|
|
942
|
+
issuing_program: API.Cards.Config.Program;
|
|
943
|
+
nick_name: string;
|
|
944
|
+
program_id: string;
|
|
945
|
+
payment_types: Array<{ order_type: OrderType }>;
|
|
946
|
+
realtime_auth: [
|
|
947
|
+
{
|
|
948
|
+
crypto_token: string;
|
|
949
|
+
fiat_account: string;
|
|
950
|
+
id: string;
|
|
951
|
+
priority: number;
|
|
952
|
+
}
|
|
953
|
+
];
|
|
954
|
+
realtimeauth_balance: number;
|
|
955
|
+
status: string;
|
|
956
|
+
total_balance: number;
|
|
957
|
+
wallet_id: string;
|
|
958
|
+
account_details?: SubAccountDetails;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
export interface SubAccountWithCards extends SubAccount {
|
|
962
|
+
cards: API.Cards.IssuingCardListItem[];
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
965
|
}
|
|
966
966
|
|
|
967
967
|
export namespace KYC {
|
package/src/api/fiat_accounts.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { API } from './types';
|
|
2
|
-
|
|
3
|
-
import { apiClientV2, apiClientV1 } from '../utils/apiClientFactory';
|
|
4
|
-
|
|
5
|
-
export const fiat_accounts_v2 = {
|
|
6
|
-
list: {
|
|
7
|
-
withCards: {
|
|
8
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) =>
|
|
9
|
-
apiClientV2.getRequest<API.FiatAccountsV2.FiatAccountsListWithCards>(`/fiat-accounts/${wallet_uuid}`, {
|
|
10
|
-
params: { limit, offset, show_cards: true },
|
|
11
|
-
}),
|
|
12
|
-
},
|
|
13
|
-
withoutCards: {
|
|
14
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) =>
|
|
15
|
-
apiClientV2.getRequest<API.FiatAccountsV2.FiatAccountsListWithoutCards>(`/fiat-accounts/${wallet_uuid}`, {
|
|
16
|
-
params: { limit, offset },
|
|
17
|
-
}),
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
getByUuid: ({ wallet_uuid, fiat_account_id }: API.FiatAccountsV2.ExtendedFiatAccount.Request) =>
|
|
22
|
-
apiClientV2.getRequest<API.FiatAccountsV2.ExtendedFiatAccount.Response>(
|
|
23
|
-
`/fiat-accounts/${wallet_uuid}/${fiat_account_id}`
|
|
24
|
-
),
|
|
25
|
-
create: ({ wallet_id, program_id }: API.FiatAccountsV2.CreateFiatAccount.Request) =>
|
|
26
|
-
apiClientV2.postRequest<API.FiatAccountsV2.CreateFiatAccount.Response>(`/fiat-accounts/${wallet_id}`, {
|
|
27
|
-
data: { program_id },
|
|
28
|
-
}),
|
|
29
|
-
transactions: {
|
|
30
|
-
get: ({ fiat_account_id, wallet_uuid, limit, offset }: API.FiatAccountsV2.Transactions.TransactionList.Request) =>
|
|
31
|
-
apiClientV2.getRequest<API.FiatAccountsV2.Transactions.TransactionList.Response>(
|
|
32
|
-
`/fiat-accounts/${wallet_uuid}/${fiat_account_id}/transactions`,
|
|
33
|
-
{
|
|
34
|
-
params: { limit, offset },
|
|
35
|
-
}
|
|
36
|
-
),
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const fiat_accounts = {
|
|
41
|
-
list: {
|
|
42
|
-
withCards: {
|
|
43
|
-
getSinglecards: (wallet_uuid: string, limit: number, offset: number) =>
|
|
44
|
-
apiClientV1.getRequest<API.FiatAccounts.FiatAccountWithCards[]>(`/fiat_accounts/list/${wallet_uuid}`, {
|
|
45
|
-
params: { limit, offset, lt_cards_limit: 2, gt_cards_limit: 0, show_cards: true },
|
|
46
|
-
}),
|
|
47
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) =>
|
|
48
|
-
apiClientV1.getRequest<API.FiatAccounts.FiatAccountWithCards[]>(`/fiat_accounts/list/${wallet_uuid}`, {
|
|
49
|
-
params: { limit, offset, show_cards: true },
|
|
50
|
-
}),
|
|
51
|
-
},
|
|
52
|
-
withoutCards: {
|
|
53
|
-
getAll: (wallet_uuid: string, limit: number, offset: number) =>
|
|
54
|
-
apiClientV1.getRequest<API.FiatAccounts.FiatAccount[]>(`/fiat_accounts/list/${wallet_uuid}`, {
|
|
55
|
-
params: { limit, offset },
|
|
56
|
-
}),
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
getByUuid: (uuid: string) => apiClientV1.getRequest<API.FiatAccounts.FiatAccount>(`/fiat_accounts/${uuid}`),
|
|
61
|
-
create: (wallet_id: string, program_id: string) =>
|
|
62
|
-
apiClientV1.postRequest<API.FiatAccounts.FiatAccount>(`/fiat_accounts`, { data: { wallet_id, program_id } }),
|
|
63
|
-
transactions: {
|
|
64
|
-
get: (fiat_account_id: string, limit?: number, offset?: number) =>
|
|
65
|
-
apiClientV1.getRequest<API.FiatAccounts.TransactionList>(`/fiat_accounts/${fiat_account_id}/transactions`, {
|
|
66
|
-
params: { limit, offset },
|
|
67
|
-
}),
|
|
68
|
-
},
|
|
69
|
-
};
|