@riocrypto/common-server 1.0.1282 → 1.0.1283
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.
|
@@ -39,11 +39,13 @@ class CurrencyAPIClient {
|
|
|
39
39
|
catch (e) {
|
|
40
40
|
const cachedResponse = cache.get(`v3/latest?apikey=${this.apiKey}&base_currency=${from}¤cies=${to}`);
|
|
41
41
|
if (!cachedResponse) {
|
|
42
|
+
console.log(`Unable to get exchange rate from currencyAPI for ${from} to ${to}`);
|
|
42
43
|
throw new common_1.GenericInternalError(`Unable to get exchange rate from currencyAPI for ${from} to ${to}`);
|
|
43
44
|
}
|
|
44
45
|
const exchangeRate = cachedResponse.data[to].value;
|
|
45
46
|
}
|
|
46
47
|
if (!exchangeRate) {
|
|
48
|
+
console.log("Unable to get exchange rate");
|
|
47
49
|
throw new common_1.GenericInternalError("Unable to get exchange rate");
|
|
48
50
|
}
|
|
49
51
|
return exchangeRate;
|
|
@@ -67,6 +69,7 @@ class CurrencyAPIClient {
|
|
|
67
69
|
catch (e) {
|
|
68
70
|
const cachedResponse = cache.get(`v3/range?apikey=${this.apiKey}&datetime_start=${start}&datetime_end=${end}&accuracy=minute¤cies=${to}&base_currency=${from}`);
|
|
69
71
|
if (!cachedResponse) {
|
|
72
|
+
console.log(`Unable to get hsitorical exchange rates from currencyAPI for ${from} to ${to}`);
|
|
70
73
|
throw new common_1.GenericInternalError(`Unable to get hsitorical exchange rates from currencyAPI for ${from} to ${to}`);
|
|
71
74
|
}
|
|
72
75
|
const exchangeRates = cachedResponse.data;
|
|
@@ -22,6 +22,7 @@ const getNetworkFees = (crypto, conversionRateToUSD) => __awaiter(void 0, void 0
|
|
|
22
22
|
const cryptoToWithdraw = crypto === common_1.Crypto.USDTTron ? common_1.Crypto.USDCPolygon : crypto;
|
|
23
23
|
const withdrawFee = yield fireblocksClient.estimateWithdrawFee(cryptoToWithdraw, address, 100);
|
|
24
24
|
if (!withdrawFee) {
|
|
25
|
+
console.log("No withdraw fee");
|
|
25
26
|
throw new common_1.GenericInternalError();
|
|
26
27
|
}
|
|
27
28
|
// Hacky way bc ccxt doesn't support TRON, so quote in MATIC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1283",
|
|
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.1157",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|