@riocrypto/common-server 1.0.2731 → 1.0.2734
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.
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getExchangeRatesWithMarkups = void 0;
|
|
4
4
|
const common_1 = require("@riocrypto/common");
|
|
5
5
|
const getExchangeRatesWithMarkups = ({ fiat, side, marketData, rioSettings, noAfterHoursMarkup = false, }) => {
|
|
6
|
-
var _a, _b;
|
|
6
|
+
var _a, _b, _c;
|
|
7
7
|
const afterHoursExchangeRateMarkup = side === common_1.Side.Buy
|
|
8
8
|
? rioSettings.buyOrderAfterHoursExchangeRateMarkup
|
|
9
9
|
: rioSettings.sellOrderAfterHoursExchangeRateMarkup;
|
|
@@ -21,7 +21,8 @@ const getExchangeRatesWithMarkups = ({ fiat, side, marketData, rioSettings, noAf
|
|
|
21
21
|
conversionRateFromUSD * (1 - generalExchangeRateMarkup[fiat]);
|
|
22
22
|
}
|
|
23
23
|
if (((((_a = rioSettings.isAfterHours[common_1.Country.Mexico]) === null || _a === void 0 ? void 0 : _a.value) && fiat === common_1.Fiat.MXN) ||
|
|
24
|
-
(((_b = rioSettings.isAfterHours[common_1.Country.Peru]) === null || _b === void 0 ? void 0 : _b.value) && fiat === common_1.Fiat.PEN)
|
|
24
|
+
(((_b = rioSettings.isAfterHours[common_1.Country.Peru]) === null || _b === void 0 ? void 0 : _b.value) && fiat === common_1.Fiat.PEN) ||
|
|
25
|
+
(((_c = rioSettings.isAfterHours[common_1.Country.Colombia]) === null || _c === void 0 ? void 0 : _c.value) && fiat === common_1.Fiat.COP)) &&
|
|
25
26
|
afterHoursExchangeRateMarkup &&
|
|
26
27
|
!noAfterHoursMarkup) {
|
|
27
28
|
conversionRateToUSDWithMarkups =
|
|
@@ -31,6 +31,9 @@ const getProcessorFees = (processor, amountFiat, conversionRateFromUSD, side, fi
|
|
|
31
31
|
}
|
|
32
32
|
return baseFee;
|
|
33
33
|
}
|
|
34
|
+
else if (processor === common_1.Processor.Coltefinanciera) {
|
|
35
|
+
return 3000;
|
|
36
|
+
}
|
|
34
37
|
else if (processor === common_1.Processor.SWIFT) {
|
|
35
38
|
return 25 * conversionRateFromUSD;
|
|
36
39
|
}
|
|
@@ -7,7 +7,15 @@ const getProcessor = ({ country, fiat, user, activeProcessors, side, isBinanceRF
|
|
|
7
7
|
if (isBinanceRFQ === true) {
|
|
8
8
|
return common_1.Processor.BinanceRFQ;
|
|
9
9
|
}
|
|
10
|
-
if (fiat === common_1.Fiat.
|
|
10
|
+
if (fiat === common_1.Fiat.COP) {
|
|
11
|
+
if (country === common_1.Country.Colombia) {
|
|
12
|
+
return common_1.Processor.Coltefinanciera;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
throw new common_1.GenericInputError("COP is not supported in your country");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else if (fiat === common_1.Fiat.PEN) {
|
|
11
19
|
if (country === common_1.Country.Peru) {
|
|
12
20
|
return common_1.Processor.Interbank;
|
|
13
21
|
}
|
package/build/models/auth.js
CHANGED
|
@@ -168,6 +168,12 @@ const buildAuth = (mongoose) => {
|
|
|
168
168
|
});
|
|
169
169
|
AuthSchema.pre("save", function (done) {
|
|
170
170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
if (this.isModified("email")) {
|
|
172
|
+
const email = this.get("email");
|
|
173
|
+
if (email) {
|
|
174
|
+
this.set("email", email.toLowerCase());
|
|
175
|
+
}
|
|
176
|
+
}
|
|
171
177
|
if (this.isModified("password")) {
|
|
172
178
|
const hashed = yield password_1.Password.toHash(this.get("password"));
|
|
173
179
|
this.set("password", hashed);
|
package/build/models/order.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ interface OrderAttrs {
|
|
|
101
101
|
RUC?: string;
|
|
102
102
|
RFC?: string;
|
|
103
103
|
CCI?: string;
|
|
104
|
+
NIT?: string;
|
|
104
105
|
};
|
|
105
106
|
paymentsReceived?: {
|
|
106
107
|
amount: number;
|
|
@@ -240,6 +241,7 @@ interface OrderDoc extends Document {
|
|
|
240
241
|
RUC?: string;
|
|
241
242
|
RFC?: string;
|
|
242
243
|
CCI?: string;
|
|
244
|
+
NIT?: string;
|
|
243
245
|
};
|
|
244
246
|
paymentsReceived?: {
|
|
245
247
|
amount: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2734",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2529",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|