@riocrypto/common-server 1.0.760 → 1.0.763
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.
|
@@ -35,7 +35,7 @@ const calculateAggregateVolumeAndRevenue = (mongoose, days, user) => __awaiter(v
|
|
|
35
35
|
orders.forEach((order) => {
|
|
36
36
|
var _a;
|
|
37
37
|
const fiatAmount = order.amountFiat || 0;
|
|
38
|
-
const conversionRate = order.
|
|
38
|
+
const conversionRate = order.conversionRateUSD || 0;
|
|
39
39
|
const platformFee = ((_a = order.fees) === null || _a === void 0 ? void 0 : _a.platformFeeFiat) || 0;
|
|
40
40
|
const price = order.price || 0;
|
|
41
41
|
const amountCrypto = order.amountCrypto || 0;
|
|
@@ -155,10 +155,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
155
155
|
if (!user) {
|
|
156
156
|
throw new Error();
|
|
157
157
|
}
|
|
158
|
-
if ((user
|
|
159
|
-
(user === null || user === void 0 ? void 0 : user.kycStatus) !== common_1.KYCStatus.Passed) ||
|
|
160
|
-
(user.type === common_1.UserType.Business &&
|
|
161
|
-
(user === null || user === void 0 ? void 0 : user.kycStatus) !== common_1.KYCStatus.businessApproved)) {
|
|
158
|
+
if ((user === null || user === void 0 ? void 0 : user.kycStatus) !== common_1.KYCStatus.Approved) {
|
|
162
159
|
missingKYC = true;
|
|
163
160
|
throw new Error();
|
|
164
161
|
}
|
|
@@ -181,7 +178,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
181
178
|
if (!brokerUser) {
|
|
182
179
|
throw new Error();
|
|
183
180
|
}
|
|
184
|
-
if ((brokerUser === null || brokerUser === void 0 ? void 0 : brokerUser.kycStatus) !== common_1.KYCStatus.
|
|
181
|
+
if ((brokerUser === null || brokerUser === void 0 ? void 0 : brokerUser.kycStatus) !== common_1.KYCStatus.Approved) {
|
|
185
182
|
missingKYC = true;
|
|
186
183
|
throw new Error();
|
|
187
184
|
}
|
|
@@ -13,15 +13,8 @@ exports.validateKYC = void 0;
|
|
|
13
13
|
const common_1 = require("@riocrypto/common");
|
|
14
14
|
const validateKYC = (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
15
|
const user = req.user;
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
throw new common_1.MissingKYCApprovalError();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if ((user === null || user === void 0 ? void 0 : user.type) === common_1.UserType.Business) {
|
|
22
|
-
if (user.kycStatus !== common_1.KYCStatus.businessApproved) {
|
|
23
|
-
throw new common_1.MissingKYCApprovalError();
|
|
24
|
-
}
|
|
16
|
+
if (!user || user.kycStatus !== common_1.KYCStatus.Approved) {
|
|
17
|
+
throw new common_1.MissingKYCApprovalError();
|
|
25
18
|
}
|
|
26
19
|
next();
|
|
27
20
|
});
|
package/build/models/order.d.ts
CHANGED
|
@@ -51,7 +51,8 @@ interface OrderDoc extends Document {
|
|
|
51
51
|
depositTxId?: string;
|
|
52
52
|
withdrawalTxId?: string;
|
|
53
53
|
brokerId?: string;
|
|
54
|
-
|
|
54
|
+
conversionRateUSD?: number;
|
|
55
|
+
actualConversionRateUSD?: number;
|
|
55
56
|
notes?: string;
|
|
56
57
|
discount?: number;
|
|
57
58
|
}
|
package/build/models/order.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.763",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
25
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
26
26
|
"@google-cloud/storage": "^6.9.5",
|
|
27
|
-
"@riocrypto/common": "^1.0.
|
|
27
|
+
"@riocrypto/common": "^1.0.678",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|