@riocrypto/common-server 1.0.599 → 1.0.601
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.
|
@@ -30,17 +30,23 @@ class FixerClient {
|
|
|
30
30
|
"Accept-Encoding": "gzip,deflate,compress",
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
const exchangeRate = fixerResponse.data.rates[to];
|
|
33
|
+
const exchangeRate = fixerResponse.data.rates[to] * 0.9987;
|
|
34
|
+
console.log("Exchange rate of " + from + " to " + to + " is " + exchangeRate);
|
|
34
35
|
cache.set(`fixer/latest?base=${from}&symbols=${to}`, fixerResponse.data);
|
|
35
|
-
|
|
36
|
-
return exchangeRate * 1.0015;
|
|
36
|
+
return exchangeRate;
|
|
37
37
|
}
|
|
38
38
|
catch (e) {
|
|
39
39
|
const cachedResponse = cache.get(`fixer/latest?base=${from}&symbols=${to}`);
|
|
40
40
|
if (!cachedResponse) {
|
|
41
41
|
throw new Error(`Unable to get exchange rate from Fixer for ${from} to ${to}`);
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
console.log("Exchange rate of " +
|
|
44
|
+
from +
|
|
45
|
+
" to " +
|
|
46
|
+
to +
|
|
47
|
+
" is " +
|
|
48
|
+
cachedResponse.rates[to] * 0.9987);
|
|
49
|
+
return cachedResponse.rates[to] * 0.9987;
|
|
44
50
|
}
|
|
45
51
|
});
|
|
46
52
|
}
|
package/build/models/order.js
CHANGED
|
@@ -111,10 +111,6 @@ const buildOrder = (mongoose) => {
|
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
113
|
});
|
|
114
|
-
orderSchema.pre("updateOne", function (next) {
|
|
115
|
-
console.log("Order updated: ", this.getFilter());
|
|
116
|
-
next();
|
|
117
|
-
});
|
|
118
114
|
orderSchema.statics.build = (attrs) => {
|
|
119
115
|
return new Order(attrs);
|
|
120
116
|
};
|