@riocrypto/common-server 1.0.594 → 1.0.596

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.
@@ -33,6 +33,7 @@ class FireblocksClient {
33
33
  amount: amountCrypto,
34
34
  operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
35
35
  });
36
+ console.log("estimate", estimate);
36
37
  return estimate.medium.networkFee;
37
38
  });
38
39
  }
@@ -31,15 +31,16 @@ class FixerClient {
31
31
  },
32
32
  });
33
33
  const exchangeRate = fixerResponse.data.rates[to];
34
- cache.set(`fixer/latest?base=${from}&symbols=${to}`, fixerResponse.data, 60);
35
- return exchangeRate;
34
+ 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
37
  }
37
38
  catch (e) {
38
39
  const cachedResponse = cache.get(`fixer/latest?base=${from}&symbols=${to}`);
39
40
  if (!cachedResponse) {
40
41
  throw new Error(`Unable to get exchange rate from Fixer for ${from} to ${to}`);
41
42
  }
42
- return cachedResponse.rates[to];
43
+ return cachedResponse.rates[to] * 1.0015;
43
44
  }
44
45
  });
45
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.594",
3
+ "version": "1.0.596",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@aws-sdk/client-s3": "^3.297.0",
25
25
  "@google-cloud/storage": "^6.9.5",
26
- "@riocrypto/common": "^1.0.572",
26
+ "@riocrypto/common": "^1.0.574",
27
27
  "@types/express": "^4.17.13",
28
28
  "axios": "^0.27.2",
29
29
  "ccxt": "^3.0.30",