squarefi-bff-api-module 1.26.14 → 1.27.1
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/.prettierignore +5 -0
- package/.prettierrc +7 -0
- package/dist/api/auth.js +18 -6
- package/dist/api/exchange.js +9 -3
- package/dist/api/issuing.js +14 -3
- package/dist/api/orders.d.ts +4 -1
- package/dist/api/orders.js +12 -3
- package/dist/api/types/types.d.ts +198 -441
- package/dist/constants.d.ts +15 -2
- package/dist/constants.js +13 -0
- package/package.json +5 -2
- package/src/api/auth.ts +18 -5
- package/src/api/bank-data.ts +1 -1
- package/src/api/counterparties.ts +7 -7
- package/src/api/exchange.ts +16 -7
- package/src/api/frontend.ts +1 -1
- package/src/api/issuing.ts +31 -17
- package/src/api/kyc.ts +1 -1
- package/src/api/orders.ts +79 -48
- package/src/api/persona.ts +1 -1
- package/src/api/totp.ts +2 -2
- package/src/api/types/types.ts +214 -521
- package/src/api/wallets.ts +5 -5
- package/src/constants.ts +13 -0
- package/src/hooks/useCalc.ts +3 -3
- package/src/hooks/useSupabaseSubscription/useSupabaseSubscription.ts +1 -1
- package/src/utils/apiClientFactory.ts +13 -4
package/dist/constants.d.ts
CHANGED
|
@@ -73,7 +73,16 @@ export declare enum OrderType {
|
|
|
73
73
|
OMNIBUS_CRYPTO_TRANSFER = "OMNIBUS_CRYPTO_TRANSFER",
|
|
74
74
|
RN_CARDS_OFFRAMP = "RN_CARDS_OFFRAMP",
|
|
75
75
|
TBD_SWIFT_WITHDRAWAL = "TBD_SWIFT_WITHDRAWAL",// not implemented yet
|
|
76
|
-
SEGREGATED_CRYPTO_TRANSFER = "SEGREGATED_CRYPTO_TRANSFER"
|
|
76
|
+
SEGREGATED_CRYPTO_TRANSFER = "SEGREGATED_CRYPTO_TRANSFER",
|
|
77
|
+
L2F_ACH_ONRAMP = "L2F_ACH_ONRAMP",
|
|
78
|
+
L2F_WIRE_ONRAMP = "L2F_WIRE_ONRAMP",
|
|
79
|
+
L2F_SWIFT_ONRAMP = "L2F_SWIFT_ONRAMP",
|
|
80
|
+
L2F_SEPA_ONRAMP = "L2F_SEPA_ONRAMP",
|
|
81
|
+
L2F_ACH_OFFRAMP = "L2F_ACH_OFFRAMP",
|
|
82
|
+
L2F_WIRE_OFFRAMP = "L2F_WIRE_OFFRAMP",
|
|
83
|
+
L2F_SWIFT_OFFRAMP = "L2F_SWIFT_OFFRAMP",
|
|
84
|
+
L2F_SEPA_OFFRAMP = "L2F_SEPA_OFFRAMP",
|
|
85
|
+
OMNIBUS_CRYPTO_WITHDRAWAL = "OMNIBUS_CRYPTO_WITHDRAWAL"
|
|
77
86
|
}
|
|
78
87
|
export declare enum WalletTransactionRecordType {
|
|
79
88
|
CARD_PROVIDER_DEPOSIT = "CARD_PROVIDER_DEPOSIT",
|
|
@@ -110,7 +119,11 @@ export declare enum WalletTransactionRecordType {
|
|
|
110
119
|
WITHDRAWAL = "WITHDRAWAL",
|
|
111
120
|
WITHDRAWAL_CRYPTO_EXTERNAL = "WITHDRAWAL_CRYPTO_EXTERNAL",
|
|
112
121
|
WITHDRAWAL_CRYPTO_INTERNAL = "WITHDRAWAL_CRYPTO_INTERNAL",
|
|
113
|
-
WITHDRAWAL_INTERNAL = "WITHDRAWAL_INTERNAL"
|
|
122
|
+
WITHDRAWAL_INTERNAL = "WITHDRAWAL_INTERNAL",
|
|
123
|
+
L2F_ACH_OFFRAMP = "L2F_ACH_OFFRAMP",
|
|
124
|
+
L2F_WIRE_OFFRAMP = "L2F_WIRE_OFFRAMP",
|
|
125
|
+
L2F_SWIFT_OFFRAMP = "L2F_SWIFT_OFFRAMP",
|
|
126
|
+
L2F_SEPA_OFFRAMP = "L2F_SEPA_OFFRAMP"
|
|
114
127
|
}
|
|
115
128
|
export declare enum RequestStatus {
|
|
116
129
|
NONE = "none",
|
package/dist/constants.js
CHANGED
|
@@ -79,6 +79,15 @@ var OrderType;
|
|
|
79
79
|
OrderType["RN_CARDS_OFFRAMP"] = "RN_CARDS_OFFRAMP";
|
|
80
80
|
OrderType["TBD_SWIFT_WITHDRAWAL"] = "TBD_SWIFT_WITHDRAWAL";
|
|
81
81
|
OrderType["SEGREGATED_CRYPTO_TRANSFER"] = "SEGREGATED_CRYPTO_TRANSFER";
|
|
82
|
+
OrderType["L2F_ACH_ONRAMP"] = "L2F_ACH_ONRAMP";
|
|
83
|
+
OrderType["L2F_WIRE_ONRAMP"] = "L2F_WIRE_ONRAMP";
|
|
84
|
+
OrderType["L2F_SWIFT_ONRAMP"] = "L2F_SWIFT_ONRAMP";
|
|
85
|
+
OrderType["L2F_SEPA_ONRAMP"] = "L2F_SEPA_ONRAMP";
|
|
86
|
+
OrderType["L2F_ACH_OFFRAMP"] = "L2F_ACH_OFFRAMP";
|
|
87
|
+
OrderType["L2F_WIRE_OFFRAMP"] = "L2F_WIRE_OFFRAMP";
|
|
88
|
+
OrderType["L2F_SWIFT_OFFRAMP"] = "L2F_SWIFT_OFFRAMP";
|
|
89
|
+
OrderType["L2F_SEPA_OFFRAMP"] = "L2F_SEPA_OFFRAMP";
|
|
90
|
+
OrderType["OMNIBUS_CRYPTO_WITHDRAWAL"] = "OMNIBUS_CRYPTO_WITHDRAWAL";
|
|
82
91
|
})(OrderType || (exports.OrderType = OrderType = {}));
|
|
83
92
|
var WalletTransactionRecordType;
|
|
84
93
|
(function (WalletTransactionRecordType) {
|
|
@@ -117,6 +126,10 @@ var WalletTransactionRecordType;
|
|
|
117
126
|
WalletTransactionRecordType["WITHDRAWAL_CRYPTO_EXTERNAL"] = "WITHDRAWAL_CRYPTO_EXTERNAL";
|
|
118
127
|
WalletTransactionRecordType["WITHDRAWAL_CRYPTO_INTERNAL"] = "WITHDRAWAL_CRYPTO_INTERNAL";
|
|
119
128
|
WalletTransactionRecordType["WITHDRAWAL_INTERNAL"] = "WITHDRAWAL_INTERNAL";
|
|
129
|
+
WalletTransactionRecordType["L2F_ACH_OFFRAMP"] = "L2F_ACH_OFFRAMP";
|
|
130
|
+
WalletTransactionRecordType["L2F_WIRE_OFFRAMP"] = "L2F_WIRE_OFFRAMP";
|
|
131
|
+
WalletTransactionRecordType["L2F_SWIFT_OFFRAMP"] = "L2F_SWIFT_OFFRAMP";
|
|
132
|
+
WalletTransactionRecordType["L2F_SEPA_OFFRAMP"] = "L2F_SEPA_OFFRAMP";
|
|
120
133
|
})(WalletTransactionRecordType || (exports.WalletTransactionRecordType = WalletTransactionRecordType = {}));
|
|
121
134
|
var RequestStatus;
|
|
122
135
|
(function (RequestStatus) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "squarefi-bff-api-module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.1",
|
|
4
4
|
"description": "Squarefi BFF API client module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"prepare": "husky",
|
|
14
14
|
"test": "jest",
|
|
15
|
-
"generate:openapi-types": "ts-node scripts/generate-openapi-types.ts"
|
|
15
|
+
"generate:openapi-types": "ts-node scripts/generate-openapi-types.ts",
|
|
16
|
+
"format": "prettier --write .",
|
|
17
|
+
"format:check": "prettier --check ."
|
|
16
18
|
},
|
|
17
19
|
"keywords": [
|
|
18
20
|
"squarefi",
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
"husky": "^9.1.7",
|
|
40
42
|
"jest": "^29.x.x",
|
|
41
43
|
"openapi-typescript": "^7.8.0",
|
|
44
|
+
"prettier": "^3.6.2",
|
|
42
45
|
"ts-jest": "^29.x.x",
|
|
43
46
|
"ts-node": "^10.9.2",
|
|
44
47
|
"typescript": "^5.x.x"
|
package/src/api/auth.ts
CHANGED
|
@@ -19,7 +19,11 @@ export const auth = {
|
|
|
19
19
|
}),
|
|
20
20
|
phone: (phone: string, token: string): Promise<API.Auth.VerifyOtp.Response> =>
|
|
21
21
|
apiClientV2.postRequest<API.Auth.VerifyOtp.Response>('/auth/verify/phone/otp', {
|
|
22
|
-
data: {
|
|
22
|
+
data: {
|
|
23
|
+
phone: convertPhoneToSupabaseFormat(phone),
|
|
24
|
+
token,
|
|
25
|
+
type: 'sms',
|
|
26
|
+
},
|
|
23
27
|
context: { bypassUnauthorizedHandler: true },
|
|
24
28
|
}),
|
|
25
29
|
},
|
|
@@ -27,7 +31,10 @@ export const auth = {
|
|
|
27
31
|
signin: {
|
|
28
32
|
omni: {
|
|
29
33
|
email: (data: API.Auth.SignIn.Omni.Email.OTP.Request): Promise<API.Auth.Tokens> =>
|
|
30
|
-
apiClientV2.postRequest('/auth/sign-in/omni/email/otp', {
|
|
34
|
+
apiClientV2.postRequest('/auth/sign-in/omni/email/otp', {
|
|
35
|
+
data,
|
|
36
|
+
context: { bypassUnauthorizedHandler: true },
|
|
37
|
+
}),
|
|
31
38
|
phone: ({ phone, ...data }: API.Auth.SignIn.Omni.Phone.OTP.Request): Promise<API.Auth.Tokens> =>
|
|
32
39
|
apiClientV2.postRequest('/auth/sign-in/omni/phone/otp', {
|
|
33
40
|
data: { phone: convertPhoneToSupabaseFormat(phone), ...data },
|
|
@@ -35,12 +42,15 @@ export const auth = {
|
|
|
35
42
|
}),
|
|
36
43
|
},
|
|
37
44
|
byType: (data: API.Auth.SignIn.ByType.Request): Promise<API.Auth.Tokens> =>
|
|
38
|
-
apiClientV2.postRequest('/auth/sign-in', {
|
|
45
|
+
apiClientV2.postRequest('/auth/sign-in', {
|
|
46
|
+
data,
|
|
47
|
+
context: { bypassUnauthorizedHandler: true },
|
|
48
|
+
}),
|
|
39
49
|
telegram: (data: API.Auth.Telegram.Signin.Request): Promise<API.Auth.Telegram.Signin.Response> =>
|
|
40
50
|
apiClientV2.postRequest<API.Auth.Telegram.Signin.Response>(telegramSignInPath, { data }),
|
|
41
51
|
password: (
|
|
42
52
|
email: string,
|
|
43
|
-
password: string // check on backend V2
|
|
53
|
+
password: string, // check on backend V2
|
|
44
54
|
): Promise<API.Auth.Tokens> =>
|
|
45
55
|
apiClientV2.postRequest<API.Auth.Tokens>('/auth/sign-in/password/email', {
|
|
46
56
|
data: { email, password },
|
|
@@ -49,7 +59,10 @@ export const auth = {
|
|
|
49
59
|
},
|
|
50
60
|
signup: {
|
|
51
61
|
byType: (data: API.Auth.SignUp.ByType.Request): Promise<API.Auth.Tokens> =>
|
|
52
|
-
apiClientV2.postRequest('/auth/sign-up', {
|
|
62
|
+
apiClientV2.postRequest('/auth/sign-up', {
|
|
63
|
+
data,
|
|
64
|
+
context: { bypassUnauthorizedHandler: true },
|
|
65
|
+
}),
|
|
53
66
|
password: (email: string, password: string): Promise<API.Auth.Tokens> =>
|
|
54
67
|
apiClientV2.postRequest<API.Auth.Tokens>('/auth/sign-up/password/email', {
|
|
55
68
|
data: { email, password },
|
package/src/api/bank-data.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { API } from './types/types';
|
|
|
3
3
|
|
|
4
4
|
export const bankData = {
|
|
5
5
|
getBankDataByAccountNumber: (
|
|
6
|
-
params: API.BankData.GetBankDataByAccountNumber.Request
|
|
6
|
+
params: API.BankData.GetBankDataByAccountNumber.Request,
|
|
7
7
|
): Promise<API.BankData.GetBankDataByAccountNumber.Response> =>
|
|
8
8
|
apiClientV2.getRequest<API.BankData.GetBankDataByAccountNumber.Response>(`/bank-data`, {
|
|
9
9
|
params,
|
|
@@ -11,7 +11,7 @@ export const counterparties = {
|
|
|
11
11
|
counterparty_account_id,
|
|
12
12
|
}: API.Counterparties.GetById.Request): Promise<API.Counterparties.GetById.Response> =>
|
|
13
13
|
apiClientV2.getRequest<API.Counterparties.GetById.Response>(
|
|
14
|
-
`/counterparties/${wallet_id}/${counterparty_account_id}
|
|
14
|
+
`/counterparties/${wallet_id}/${counterparty_account_id}`,
|
|
15
15
|
),
|
|
16
16
|
create: ({ wallet_id, ...data }: API.Counterparties.Create.Request): Promise<API.Counterparties.Create.Response> =>
|
|
17
17
|
apiClientV2.postRequest<API.Counterparties.Create.Response>(`/counterparties/${wallet_id}`, { data }),
|
|
@@ -22,7 +22,7 @@ export const counterparties = {
|
|
|
22
22
|
}: API.Counterparties.Update.Request): Promise<API.Counterparties.Update.Response> =>
|
|
23
23
|
apiClientV2.patchRequest<API.Counterparties.Update.Response>(
|
|
24
24
|
`/counterparties/${wallet_id}/${counterparty_account_id}`,
|
|
25
|
-
{ data }
|
|
25
|
+
{ data },
|
|
26
26
|
),
|
|
27
27
|
destinations: {
|
|
28
28
|
getAll: ({
|
|
@@ -32,7 +32,7 @@ export const counterparties = {
|
|
|
32
32
|
}: API.Counterparties.Destination.List.Request): Promise<API.Counterparties.Destination.List.Response> =>
|
|
33
33
|
apiClientV2.getRequest<API.Counterparties.Destination.List.Response>(
|
|
34
34
|
`/counterparties/${wallet_id}/${counterparty_account_id}/destinations`,
|
|
35
|
-
{ params }
|
|
35
|
+
{ params },
|
|
36
36
|
),
|
|
37
37
|
getById: ({
|
|
38
38
|
wallet_id,
|
|
@@ -40,7 +40,7 @@ export const counterparties = {
|
|
|
40
40
|
counterparty_destination_id,
|
|
41
41
|
}: API.Counterparties.Destination.Detail.Request): Promise<API.Counterparties.Destination.Detail.Response> =>
|
|
42
42
|
apiClientV2.getRequest<API.Counterparties.Destination.Detail.Response>(
|
|
43
|
-
`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}
|
|
43
|
+
`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`,
|
|
44
44
|
),
|
|
45
45
|
create: ({
|
|
46
46
|
wallet_id,
|
|
@@ -49,7 +49,7 @@ export const counterparties = {
|
|
|
49
49
|
}: API.Counterparties.Destination.Create.Request): Promise<API.Counterparties.Destination.Create.Response> =>
|
|
50
50
|
apiClientV2.postRequest<API.Counterparties.Destination.Create.Response>(
|
|
51
51
|
`/counterparties/${wallet_id}/${counterparty_account_id}/destinations`,
|
|
52
|
-
{ data }
|
|
52
|
+
{ data },
|
|
53
53
|
),
|
|
54
54
|
update: ({
|
|
55
55
|
wallet_id,
|
|
@@ -59,7 +59,7 @@ export const counterparties = {
|
|
|
59
59
|
}: API.Counterparties.Destination.Update.Request): Promise<API.Counterparties.Destination.Update.Response> =>
|
|
60
60
|
apiClientV2.patchRequest<API.Counterparties.Destination.Update.Response>(
|
|
61
61
|
`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`,
|
|
62
|
-
{ data }
|
|
62
|
+
{ data },
|
|
63
63
|
),
|
|
64
64
|
delete: ({
|
|
65
65
|
wallet_id,
|
|
@@ -67,7 +67,7 @@ export const counterparties = {
|
|
|
67
67
|
counterparty_destination_id,
|
|
68
68
|
}: API.Counterparties.Destination.Delete.Request): Promise<void> =>
|
|
69
69
|
apiClientV2.deleteRequest(
|
|
70
|
-
`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}
|
|
70
|
+
`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`,
|
|
71
71
|
),
|
|
72
72
|
},
|
|
73
73
|
};
|
package/src/api/exchange.ts
CHANGED
|
@@ -18,18 +18,27 @@ type IExchangeModule = {
|
|
|
18
18
|
|
|
19
19
|
const createOrderTypeMethods = (orderType: OrderType): IExchangeByOrderType => ({
|
|
20
20
|
getByFromCurrency: (from_uuid: string): Promise<API.Exchange.Exchange[]> =>
|
|
21
|
-
apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', {
|
|
21
|
+
apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', {
|
|
22
|
+
params: { from_uuid, order_type: orderType },
|
|
23
|
+
}),
|
|
22
24
|
getByToCurrency: (to_uuid: string): Promise<API.Exchange.Exchange[]> =>
|
|
23
|
-
apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', {
|
|
25
|
+
apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', {
|
|
26
|
+
params: { to_uuid, order_type: orderType },
|
|
27
|
+
}),
|
|
24
28
|
getByOrderType: (): Promise<API.Exchange.Exchange[]> =>
|
|
25
|
-
apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', {
|
|
29
|
+
apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', {
|
|
30
|
+
params: { order_type: orderType },
|
|
31
|
+
}),
|
|
26
32
|
});
|
|
27
33
|
|
|
28
34
|
const orderTypes = Object.values(OrderType);
|
|
29
35
|
|
|
30
36
|
export const exchange: IExchangeModule = {
|
|
31
|
-
byOrderType: orderTypes.reduce(
|
|
32
|
-
acc
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
byOrderType: orderTypes.reduce(
|
|
38
|
+
(acc, orderType) => {
|
|
39
|
+
acc[orderType] = createOrderTypeMethods(orderType);
|
|
40
|
+
return acc;
|
|
41
|
+
},
|
|
42
|
+
{} as Record<OrderType, IExchangeByOrderType>,
|
|
43
|
+
),
|
|
35
44
|
};
|
package/src/api/frontend.ts
CHANGED
|
@@ -11,7 +11,7 @@ export const frontend = {
|
|
|
11
11
|
apiClientV1.getRequest<API.Frontend.Access.Keys.List.Response>('/frontend/access/keys'),
|
|
12
12
|
regenerate: (key_id: string): Promise<API.Frontend.Access.Keys.Regenerate.Response> =>
|
|
13
13
|
apiClientV1.postRequest<API.Frontend.Access.Keys.Regenerate.Response>(
|
|
14
|
-
`/frontend/access/keys/${key_id}/regenerate
|
|
14
|
+
`/frontend/access/keys/${key_id}/regenerate`,
|
|
15
15
|
),
|
|
16
16
|
revoke: (key_id: string): Promise<API.Frontend.Access.Keys.Revoke.Response> =>
|
|
17
17
|
apiClientV1.deleteRequest(`/frontend/access/keys/${key_id}`),
|
package/src/api/issuing.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const issuing = {
|
|
|
10
10
|
prepaid: (data: API.Cards.Create.StandAloneRequest): Promise<API.Cards.Create.StandAloneResponse> =>
|
|
11
11
|
apiClientV1.postRequest<API.Cards.Create.StandAloneResponse>('/issuing/cards/create', { data }),
|
|
12
12
|
balance: async (
|
|
13
|
-
data: API.Cards.Create.StandAloneRequest
|
|
13
|
+
data: API.Cards.Create.StandAloneRequest,
|
|
14
14
|
): Promise<API.Cards.Create.ExtendedSubAccountResponse> => {
|
|
15
15
|
const { id: sub_account_id } = await issuing.sub_accounts.create(data.wallet_id, data.program_id);
|
|
16
16
|
|
|
@@ -21,7 +21,7 @@ export const issuing = {
|
|
|
21
21
|
...data,
|
|
22
22
|
sub_account_id,
|
|
23
23
|
},
|
|
24
|
-
}
|
|
24
|
+
},
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
return {
|
|
@@ -31,7 +31,7 @@ export const issuing = {
|
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
subAccountCard: async (
|
|
34
|
-
data: API.Cards.Create.SubAccountRequest
|
|
34
|
+
data: API.Cards.Create.SubAccountRequest,
|
|
35
35
|
): Promise<API.Cards.Create.ExtendedSubAccountResponse> => {
|
|
36
36
|
const response = await apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', {
|
|
37
37
|
data,
|
|
@@ -44,23 +44,30 @@ export const issuing = {
|
|
|
44
44
|
},
|
|
45
45
|
byWalletUuid: {
|
|
46
46
|
getAll: (params: API.Cards.CardsList.Request.ByWalletUuid): Promise<API.Cards.CardsList.Response> =>
|
|
47
|
-
apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', {
|
|
47
|
+
apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', {
|
|
48
|
+
params,
|
|
49
|
+
}),
|
|
48
50
|
getBySubaccountType: (
|
|
49
|
-
params: API.Cards.CardsList.Request.BySubaccountAndWalletUuid
|
|
51
|
+
params: API.Cards.CardsList.Request.BySubaccountAndWalletUuid,
|
|
50
52
|
): Promise<API.Cards.CardsList.Response> =>
|
|
51
53
|
apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', {
|
|
52
54
|
params,
|
|
53
55
|
}),
|
|
54
56
|
getBySubAccount: (
|
|
55
|
-
params: API.Cards.CardsList.Request.BySubAccountAndWalletId
|
|
57
|
+
params: API.Cards.CardsList.Request.BySubAccountAndWalletId,
|
|
56
58
|
): Promise<API.Cards.CardsList.Response> =>
|
|
57
|
-
apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', {
|
|
59
|
+
apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', {
|
|
60
|
+
params,
|
|
61
|
+
}),
|
|
58
62
|
},
|
|
59
63
|
// getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
|
|
60
64
|
getById: async (card_id: string): Promise<API.Cards.IssuingCardDetailItem> => {
|
|
61
65
|
const card = await apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`);
|
|
62
66
|
const subAccountData = await issuing.sub_accounts.getByUuid(card.fiat_account.id);
|
|
63
|
-
return {
|
|
67
|
+
return {
|
|
68
|
+
...card,
|
|
69
|
+
fiat_account: { ...subAccountData, type: card.fiat_account.type },
|
|
70
|
+
};
|
|
64
71
|
},
|
|
65
72
|
sensitiveData: {
|
|
66
73
|
// get: (card_id: string) => apiClientV1.getRequest<API.Cards.SensitiveData>(`/issuing/cards/${card_id}/sensitive`), deprecated from v1.13.1
|
|
@@ -110,7 +117,7 @@ export const issuing = {
|
|
|
110
117
|
getByCardId: (
|
|
111
118
|
card_id: string,
|
|
112
119
|
limit = defaultPaginationParams.limit,
|
|
113
|
-
offset = defaultPaginationParams.offset
|
|
120
|
+
offset = defaultPaginationParams.offset,
|
|
114
121
|
): Promise<API.Cards.TransactionsList> =>
|
|
115
122
|
apiClientV1.getRequest<API.Cards.TransactionsList>(`/issuing/transactions/`, {
|
|
116
123
|
params: { limit, offset, card_id, new_scheme: true },
|
|
@@ -118,7 +125,7 @@ export const issuing = {
|
|
|
118
125
|
getBySubAccountId: (
|
|
119
126
|
fiat_account_id: string,
|
|
120
127
|
limit = defaultPaginationParams.limit,
|
|
121
|
-
offset = defaultPaginationParams.offset
|
|
128
|
+
offset = defaultPaginationParams.offset,
|
|
122
129
|
): Promise<API.Cards.TransactionsList> =>
|
|
123
130
|
apiClientV1.getRequest<API.Cards.TransactionsList>(`/issuing/transactions/`, {
|
|
124
131
|
params: { limit, offset, fiat_account_id, new_scheme: true },
|
|
@@ -138,24 +145,31 @@ export const issuing = {
|
|
|
138
145
|
getSinglecards: (
|
|
139
146
|
wallet_uuid: string,
|
|
140
147
|
limit: number,
|
|
141
|
-
offset: number
|
|
148
|
+
offset: number,
|
|
142
149
|
): Promise<API.Issuing.SubAccounts.WithCards.Response> =>
|
|
143
150
|
apiClientV1.getRequest<API.Issuing.SubAccounts.WithCards.Response>(
|
|
144
151
|
`/issuing/sub_account/list/${wallet_uuid}`,
|
|
145
152
|
{
|
|
146
|
-
params: {
|
|
147
|
-
|
|
153
|
+
params: {
|
|
154
|
+
limit,
|
|
155
|
+
offset,
|
|
156
|
+
lt_cards_limit: 2,
|
|
157
|
+
gt_cards_limit: 0,
|
|
158
|
+
show_cards: true,
|
|
159
|
+
pagination: true,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
148
162
|
),
|
|
149
163
|
getAll: (
|
|
150
164
|
wallet_uuid: string,
|
|
151
165
|
limit: number,
|
|
152
|
-
offset: number
|
|
166
|
+
offset: number,
|
|
153
167
|
): Promise<API.Issuing.SubAccounts.WithCards.Response> =>
|
|
154
168
|
apiClientV1.getRequest<API.Issuing.SubAccounts.WithCards.Response>(
|
|
155
169
|
`/issuing/sub_account/list/${wallet_uuid}`,
|
|
156
170
|
{
|
|
157
171
|
params: { limit, offset, show_cards: true, pagination: true },
|
|
158
|
-
}
|
|
172
|
+
},
|
|
159
173
|
),
|
|
160
174
|
},
|
|
161
175
|
withoutCards: {
|
|
@@ -167,7 +181,7 @@ export const issuing = {
|
|
|
167
181
|
`/issuing/sub_account/list/${wallet_uuid}`,
|
|
168
182
|
{
|
|
169
183
|
params: { ...params, pagination: true },
|
|
170
|
-
}
|
|
184
|
+
},
|
|
171
185
|
),
|
|
172
186
|
},
|
|
173
187
|
},
|
|
@@ -187,7 +201,7 @@ export const issuing = {
|
|
|
187
201
|
`/issuing/sub_account/${sub_account_id}/transactions`,
|
|
188
202
|
{
|
|
189
203
|
params,
|
|
190
|
-
}
|
|
204
|
+
},
|
|
191
205
|
),
|
|
192
206
|
},
|
|
193
207
|
},
|
package/src/api/kyc.ts
CHANGED
|
@@ -34,7 +34,7 @@ export const kyc = {
|
|
|
34
34
|
rail_id,
|
|
35
35
|
}: API.KYC.Rails.Terms.Confirm.Request): Promise<API.KYC.Rails.Terms.Confirm.Response> =>
|
|
36
36
|
apiClientV2.postRequest<API.KYC.Rails.Terms.Confirm.Response>(
|
|
37
|
-
`/kyc/${wallet_id}/rails/${rail_id}/terms-and-conditions
|
|
37
|
+
`/kyc/${wallet_id}/rails/${rail_id}/terms-and-conditions`,
|
|
38
38
|
),
|
|
39
39
|
},
|
|
40
40
|
},
|