@riocrypto/common-server 1.0.1422 → 1.0.1424
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.
|
@@ -32,6 +32,8 @@ class InvopopClient {
|
|
|
32
32
|
const operationDay = String(operationDate.getDate()).padStart(2, "0");
|
|
33
33
|
const operationDateFormatted = `${operationYear}-${operationMonth}-${operationDay}`;
|
|
34
34
|
const issueDate = new Date();
|
|
35
|
+
const mexicoCityOffset = -6;
|
|
36
|
+
issueDate.setUTCHours(issueDate.getUTCHours() + mexicoCityOffset);
|
|
35
37
|
const issueYear = issueDate.getFullYear();
|
|
36
38
|
const issueMonth = String(issueDate.getMonth() + 1).padStart(2, "0"); // Month is zero-indexed
|
|
37
39
|
const issueDay = String(issueDate.getDate()).padStart(2, "0");
|
|
@@ -11,16 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getExchangeRates = void 0;
|
|
13
13
|
const common_1 = require("@riocrypto/common");
|
|
14
|
-
const kapstar_client_1 = require("../clients/kapstar-client");
|
|
15
14
|
const polygon_client_1 = require("../clients/polygon-client");
|
|
16
15
|
const getExchangeRates = (fiat) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
16
|
const polygonClient = yield (0, polygon_client_1.buildPolygonClient)();
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
: fiat === common_1.Fiat.PEN
|
|
22
|
-
? (yield polygonClient.getExchangeRateData(fiat, common_1.Fiat.USD)).bid
|
|
23
|
-
: (yield polygonClient.getExchangeRateData(fiat, common_1.Fiat.USD)).ask;
|
|
17
|
+
const conversionRateToUSD = fiat === common_1.Fiat.PEN
|
|
18
|
+
? (yield polygonClient.getExchangeRateData(fiat, common_1.Fiat.USD)).bid
|
|
19
|
+
: (yield polygonClient.getExchangeRateData(fiat, common_1.Fiat.USD)).ask;
|
|
24
20
|
let conversionRateFromUSD = fiat === common_1.Fiat.BRL
|
|
25
21
|
? 1 / conversionRateToUSD
|
|
26
22
|
: (yield polygonClient.getExchangeRateData(common_1.Fiat.USD, fiat)).bid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1424",
|
|
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.1272",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|