@riocrypto/common-server 1.0.1291 → 1.0.1293
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.
|
@@ -17,7 +17,7 @@ const common_1 = require("@riocrypto/common");
|
|
|
17
17
|
const axios_1 = __importDefault(require("axios"));
|
|
18
18
|
const secret_manager_client_1 = require("./secret-manager-client");
|
|
19
19
|
const node_cache_1 = __importDefault(require("node-cache"));
|
|
20
|
-
const cache = new node_cache_1.default({ stdTTL:
|
|
20
|
+
const cache = new node_cache_1.default({ stdTTL: 10 });
|
|
21
21
|
class CurrencyAPIClient {
|
|
22
22
|
constructor(apiKey) {
|
|
23
23
|
this.apiKey = apiKey;
|
|
@@ -44,9 +44,9 @@ const getExchangeRates = (from, to, noMarkups) => __awaiter(void 0, void 0, void
|
|
|
44
44
|
const hours = mexicoCityTime.getHours();
|
|
45
45
|
const minutes = mexicoCityTime.getMinutes();
|
|
46
46
|
// Check if it's between 2:30 PM and 6:00 PM
|
|
47
|
-
if ((hours ===
|
|
48
|
-
(hours >
|
|
49
|
-
(hours ===
|
|
47
|
+
if ((hours === 3 && minutes >= 45) ||
|
|
48
|
+
(hours > 3 && hours < 12) ||
|
|
49
|
+
(hours === 12 && minutes === 0)) {
|
|
50
50
|
conversionRateWithMarkups = conversionRate * 0.997;
|
|
51
51
|
}
|
|
52
52
|
else if (hours >= 0 && hours < 8) {
|