@riocrypto/common-server 1.0.600 → 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
- // Add 15 bips to the exchange rate to account for the spread
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
- return cachedResponse.rates[to] * 1.0015;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.600",
3
+ "version": "1.0.601",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",