@riocrypto/common-server 1.0.1353 → 1.0.1354
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.
|
@@ -292,7 +292,7 @@ class BitsoClient {
|
|
|
292
292
|
const url = new URL(requestConfig.url || "");
|
|
293
293
|
const requestPath = url.pathname + (url.search || "");
|
|
294
294
|
const payload = JSON.stringify(requestConfig.data) || "";
|
|
295
|
-
const nonce =
|
|
295
|
+
const nonce = (0, common_1.getCurrentMexicoCityDate)().getTime().toString();
|
|
296
296
|
const data = nonce +
|
|
297
297
|
(((_a = requestConfig.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || "") +
|
|
298
298
|
requestPath +
|
|
@@ -14,7 +14,7 @@ const common_1 = require("@riocrypto/common");
|
|
|
14
14
|
const order_1 = require("../models/order");
|
|
15
15
|
const calculateAggregateVolumeAndRevenue = (mongoose, days, user, excludeBrokerCustomerOrders) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
var _a;
|
|
17
|
-
const startDate =
|
|
17
|
+
const startDate = (0, common_1.getCurrentMexicoCityDate)();
|
|
18
18
|
startDate.setDate(startDate.getDate() - days); // Subtract 14 days from current date
|
|
19
19
|
const Order = (0, order_1.buildOrder)(mongoose);
|
|
20
20
|
let orders;
|
|
@@ -14,7 +14,7 @@ const common_1 = require("@riocrypto/common");
|
|
|
14
14
|
const order_1 = require("../models/order");
|
|
15
15
|
const calculateWeeklyVolumeAndRevenue = (mongoose, user) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
var _a;
|
|
17
|
-
const startDate =
|
|
17
|
+
const startDate = (0, common_1.getCurrentMexicoCityDate)();
|
|
18
18
|
startDate.setDate(startDate.getDate() - ((startDate.getDay() + 6) % 7));
|
|
19
19
|
startDate.setHours(12, 0, 0, 0);
|
|
20
20
|
const Order = (0, order_1.buildOrder)(mongoose);
|
|
@@ -26,7 +26,7 @@ const getExchangeRates = (fiat) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
26
26
|
let conversionRateFromUSDWithMarkups = conversionRateFromUSD;
|
|
27
27
|
// Time based markups
|
|
28
28
|
if (fiat === common_1.Fiat.PEN) {
|
|
29
|
-
const now =
|
|
29
|
+
const now = (0, common_1.getCurrentMexicoCityDate)();
|
|
30
30
|
const peruTime = new Date(now.toLocaleString("en-US", { timeZone: "America/Lima" }));
|
|
31
31
|
const hours = peruTime.getHours();
|
|
32
32
|
const minutes = peruTime.getMinutes();
|
|
@@ -37,7 +37,7 @@ const getExchangeRates = (fiat) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
if (fiat === common_1.Fiat.MXN) {
|
|
40
|
-
const now =
|
|
40
|
+
const now = (0, common_1.getCurrentMexicoCityDate)();
|
|
41
41
|
const mexicoCityTime = new Date(now.toLocaleString("en-US", { timeZone: "America/Mexico_City" }));
|
|
42
42
|
const hours = mexicoCityTime.getHours();
|
|
43
43
|
const minutes = mexicoCityTime.getMinutes();
|
|
@@ -61,7 +61,7 @@ const getExchangeRates = (fiat) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
61
61
|
});
|
|
62
62
|
exports.getExchangeRates = getExchangeRates;
|
|
63
63
|
// function getDateRange(): { startDate: Date; endDate: Date } {
|
|
64
|
-
// const endDate =
|
|
64
|
+
// const endDate = getCurrentMexicoCityDate(); // Current time
|
|
65
65
|
// // Subtract 10 minutes from the end_date
|
|
66
66
|
// const startDate = new Date(endDate.getTime() - 10 * 60 * 1000);
|
|
67
67
|
// return { startDate, endDate };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1354",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
|
-
"@riocrypto/common": "^1.0.
|
|
30
|
+
"@riocrypto/common": "^1.0.1190",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|