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/.prettierignore
ADDED
package/.prettierrc
ADDED
package/dist/api/auth.js
CHANGED
|
@@ -26,14 +26,21 @@ exports.auth = {
|
|
|
26
26
|
context: { bypassUnauthorizedHandler: true },
|
|
27
27
|
}),
|
|
28
28
|
phone: (phone, token) => apiClientFactory_1.apiClientV2.postRequest('/auth/verify/phone/otp', {
|
|
29
|
-
data: {
|
|
29
|
+
data: {
|
|
30
|
+
phone: (0, converters_1.convertPhoneToSupabaseFormat)(phone),
|
|
31
|
+
token,
|
|
32
|
+
type: 'sms',
|
|
33
|
+
},
|
|
30
34
|
context: { bypassUnauthorizedHandler: true },
|
|
31
35
|
}),
|
|
32
36
|
},
|
|
33
37
|
},
|
|
34
38
|
signin: {
|
|
35
39
|
omni: {
|
|
36
|
-
email: (data) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in/omni/email/otp', {
|
|
40
|
+
email: (data) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in/omni/email/otp', {
|
|
41
|
+
data,
|
|
42
|
+
context: { bypassUnauthorizedHandler: true },
|
|
43
|
+
}),
|
|
37
44
|
phone: (_a) => {
|
|
38
45
|
var { phone } = _a, data = __rest(_a, ["phone"]);
|
|
39
46
|
return apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in/omni/phone/otp', {
|
|
@@ -42,16 +49,21 @@ exports.auth = {
|
|
|
42
49
|
});
|
|
43
50
|
},
|
|
44
51
|
},
|
|
45
|
-
byType: (data) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in', {
|
|
52
|
+
byType: (data) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in', {
|
|
53
|
+
data,
|
|
54
|
+
context: { bypassUnauthorizedHandler: true },
|
|
55
|
+
}),
|
|
46
56
|
telegram: (data) => apiClientFactory_1.apiClientV2.postRequest(exports.telegramSignInPath, { data }),
|
|
47
|
-
password: (email, password
|
|
48
|
-
) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in/password/email', {
|
|
57
|
+
password: (email, password) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in/password/email', {
|
|
49
58
|
data: { email, password },
|
|
50
59
|
context: { bypassUnauthorizedHandler: true },
|
|
51
60
|
}),
|
|
52
61
|
},
|
|
53
62
|
signup: {
|
|
54
|
-
byType: (data) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-up', {
|
|
63
|
+
byType: (data) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-up', {
|
|
64
|
+
data,
|
|
65
|
+
context: { bypassUnauthorizedHandler: true },
|
|
66
|
+
}),
|
|
55
67
|
password: (email, password) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-up/password/email', {
|
|
56
68
|
data: { email, password },
|
|
57
69
|
context: { bypassUnauthorizedHandler: true },
|
package/dist/api/exchange.js
CHANGED
|
@@ -4,9 +4,15 @@ exports.exchange = void 0;
|
|
|
4
4
|
const apiClientFactory_1 = require("../utils/apiClientFactory");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const createOrderTypeMethods = (orderType) => ({
|
|
7
|
-
getByFromCurrency: (from_uuid) => apiClientFactory_1.apiClientV1.getRequest('/exchange/', {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
getByFromCurrency: (from_uuid) => apiClientFactory_1.apiClientV1.getRequest('/exchange/', {
|
|
8
|
+
params: { from_uuid, order_type: orderType },
|
|
9
|
+
}),
|
|
10
|
+
getByToCurrency: (to_uuid) => apiClientFactory_1.apiClientV1.getRequest('/exchange/', {
|
|
11
|
+
params: { to_uuid, order_type: orderType },
|
|
12
|
+
}),
|
|
13
|
+
getByOrderType: () => apiClientFactory_1.apiClientV1.getRequest('/exchange/', {
|
|
14
|
+
params: { order_type: orderType },
|
|
15
|
+
}),
|
|
10
16
|
});
|
|
11
17
|
const orderTypes = Object.values(constants_1.OrderType);
|
|
12
18
|
exports.exchange = {
|
package/dist/api/issuing.js
CHANGED
|
@@ -45,11 +45,15 @@ exports.issuing = {
|
|
|
45
45
|
}),
|
|
46
46
|
},
|
|
47
47
|
byWalletUuid: {
|
|
48
|
-
getAll: (params) => apiClientFactory_1.apiClientV1.getRequest('/issuing/cards', {
|
|
48
|
+
getAll: (params) => apiClientFactory_1.apiClientV1.getRequest('/issuing/cards', {
|
|
49
|
+
params,
|
|
50
|
+
}),
|
|
49
51
|
getBySubaccountType: (params) => apiClientFactory_1.apiClientV1.getRequest('/issuing/cards', {
|
|
50
52
|
params,
|
|
51
53
|
}),
|
|
52
|
-
getBySubAccount: (params) => apiClientFactory_1.apiClientV1.getRequest('/issuing/cards', {
|
|
54
|
+
getBySubAccount: (params) => apiClientFactory_1.apiClientV1.getRequest('/issuing/cards', {
|
|
55
|
+
params,
|
|
56
|
+
}),
|
|
53
57
|
},
|
|
54
58
|
// getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
|
|
55
59
|
getById: (card_id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -110,7 +114,14 @@ exports.issuing = {
|
|
|
110
114
|
list: {
|
|
111
115
|
withCards: {
|
|
112
116
|
getSinglecards: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/sub_account/list/${wallet_uuid}`, {
|
|
113
|
-
params: {
|
|
117
|
+
params: {
|
|
118
|
+
limit,
|
|
119
|
+
offset,
|
|
120
|
+
lt_cards_limit: 2,
|
|
121
|
+
gt_cards_limit: 0,
|
|
122
|
+
show_cards: true,
|
|
123
|
+
pagination: true,
|
|
124
|
+
},
|
|
114
125
|
}),
|
|
115
126
|
getAll: (wallet_uuid, limit, offset) => apiClientFactory_1.apiClientV1.getRequest(`/issuing/sub_account/list/${wallet_uuid}`, {
|
|
116
127
|
params: { limit, offset, show_cards: true, pagination: true },
|
package/dist/api/orders.d.ts
CHANGED
|
@@ -36,10 +36,13 @@ export declare const orders: {
|
|
|
36
36
|
HIFI_ACH_OFFRAMP: (data: API.Orders.V2.Create.ByOrderType.HIFI_ACH_OFFRAMP.Request) => Promise<API.Orders.V2.Create.ByOrderType.HIFI_ACH_OFFRAMP.Response>;
|
|
37
37
|
HIFI_SEPA_OFFRAMP: (data: API.Orders.V2.Create.ByOrderType.HIFI_SEPA_OFFRAMP.Request) => Promise<API.Orders.V2.Create.ByOrderType.HIFI_SEPA_OFFRAMP.Response>;
|
|
38
38
|
OMNIBUS_CRYPTO_TRANSFER: (data: API.Orders.V2.Create.ByOrderType.OMNIBUS_CRYPTO_TRANSFER.Request) => Promise<API.Orders.V2.Create.ByOrderType.OMNIBUS_CRYPTO_TRANSFER.Response>;
|
|
39
|
-
HIFI_CRYPTO_TRANSFER: (data: API.Orders.V2.Create.ByOrderType.HIFI_CRYPTO_TRANSFER.Request) => Promise<API.Orders.V2.Create.ByOrderType.HIFI_CRYPTO_TRANSFER.Response>;
|
|
40
39
|
SEGREGATED_CRYPTO_TRANSFER: (data: API.Orders.V2.Create.ByOrderType.SEGREGATED_CRYPTO_TRANSFER.Request) => Promise<API.Orders.V2.Create.ByOrderType.SEGREGATED_CRYPTO_TRANSFER.Response>;
|
|
41
40
|
RN_CARDS_OFFRAMP: (data: API.Orders.V2.Create.ByOrderType.RN_CARDS_OFFRAMP.Request) => Promise<API.Orders.V2.Create.ByOrderType.RN_CARDS_OFFRAMP.Response>;
|
|
42
41
|
TBD_SWIFT_WITHDRAWAL: (data: API.Orders.V2.Create.ByOrderType.TBD_SWIFT_WITHDRAWAL.Request) => Promise<API.Orders.V2.Create.ByOrderType.TBD_SWIFT_WITHDRAWAL.Response>;
|
|
42
|
+
L2F_SEPA_OFFRAMP: (data: API.Orders.V2.Create.ByOrderType.L2F_SEPA_OFFRAMP.Request) => Promise<API.Orders.V2.Create.ByOrderType.L2F_SEPA_OFFRAMP.Response>;
|
|
43
|
+
L2F_SWIFT_OFFRAMP: (data: API.Orders.V2.Create.ByOrderType.L2F_SWIFT_OFFRAMP.Request) => Promise<API.Orders.V2.Create.ByOrderType.L2F_SWIFT_OFFRAMP.Response>;
|
|
44
|
+
L2F_ACH_OFFRAMP: (data: API.Orders.V2.Create.ByOrderType.L2F_ACH_OFFRAMP.Request) => Promise<API.Orders.V2.Create.ByOrderType.L2F_ACH_OFFRAMP.Response>;
|
|
45
|
+
L2F_WIRE_OFFRAMP: (data: API.Orders.V2.Create.ByOrderType.L2F_WIRE_OFFRAMP.Request) => Promise<API.Orders.V2.Create.ByOrderType.L2F_WIRE_OFFRAMP.Response>;
|
|
43
46
|
};
|
|
44
47
|
};
|
|
45
48
|
};
|
package/dist/api/orders.js
CHANGED
|
@@ -17,7 +17,10 @@ const constants_1 = require("../constants");
|
|
|
17
17
|
exports.orders = {
|
|
18
18
|
calc: (_a) => {
|
|
19
19
|
var { signal } = _a, params = __rest(_a, ["signal"]);
|
|
20
|
-
return apiClientFactory_1.apiClientV1.getRequest('/orders/calc', {
|
|
20
|
+
return apiClientFactory_1.apiClientV1.getRequest('/orders/calc', {
|
|
21
|
+
params,
|
|
22
|
+
signal,
|
|
23
|
+
});
|
|
21
24
|
},
|
|
22
25
|
orderTypes: {
|
|
23
26
|
list: () => apiClientFactory_1.apiClientV1.getRequest('/orders/order_types'),
|
|
@@ -66,7 +69,10 @@ exports.orders = {
|
|
|
66
69
|
v2: {
|
|
67
70
|
calc: (_a) => {
|
|
68
71
|
var { signal } = _a, params = __rest(_a, ["signal"]);
|
|
69
|
-
return apiClientFactory_1.apiClientV1.getRequest('/v2/orders/calc', {
|
|
72
|
+
return apiClientFactory_1.apiClientV1.getRequest('/v2/orders/calc', {
|
|
73
|
+
params,
|
|
74
|
+
signal,
|
|
75
|
+
});
|
|
70
76
|
},
|
|
71
77
|
orderTypes: {
|
|
72
78
|
list: () => apiClientFactory_1.apiClientV1.getRequest('/v2/orders/order_types'),
|
|
@@ -93,12 +99,15 @@ exports.orders = {
|
|
|
93
99
|
}),
|
|
94
100
|
[constants_1.OrderType.HIFI_SEPA_OFFRAMP]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/HIFI_SEPA_OFFRAMP', { data }),
|
|
95
101
|
[constants_1.OrderType.OMNIBUS_CRYPTO_TRANSFER]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/OMNIBUS_CRYPTO_TRANSFER', { data }),
|
|
96
|
-
[constants_1.OrderType.HIFI_CRYPTO_TRANSFER]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/HIFI_CRYPTO_TRANSFER', { data }),
|
|
97
102
|
[constants_1.OrderType.SEGREGATED_CRYPTO_TRANSFER]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/SEGREGATED_CRYPTO_TRANSFER', { data }),
|
|
98
103
|
[constants_1.OrderType.RN_CARDS_OFFRAMP]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/RN_CARDS_OFFRAMP', { data }),
|
|
99
104
|
[constants_1.OrderType.TBD_SWIFT_WITHDRAWAL]: (
|
|
100
105
|
// TODO: ITS MOCK ORDER TYPE
|
|
101
106
|
data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/TBD_SWIFT_WITHDRAWAL', { data }),
|
|
107
|
+
[constants_1.OrderType.L2F_SEPA_OFFRAMP]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/L2F_SEPA_OFFRAMP', { data }),
|
|
108
|
+
[constants_1.OrderType.L2F_SWIFT_OFFRAMP]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/L2F_SWIFT_OFFRAMP', { data }),
|
|
109
|
+
[constants_1.OrderType.L2F_ACH_OFFRAMP]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/L2F_ACH_OFFRAMP', { data }),
|
|
110
|
+
[constants_1.OrderType.L2F_WIRE_OFFRAMP]: (data) => apiClientFactory_1.apiClientV1.postRequest('/v2/orders/L2F_WIRE_OFFRAMP', { data }),
|
|
102
111
|
},
|
|
103
112
|
},
|
|
104
113
|
},
|