@riocrypto/common-server 1.0.615 → 1.0.617
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.
|
@@ -34,7 +34,8 @@ class CurrencyAPIClient {
|
|
|
34
34
|
exchangeRate = currencyAPIResponse.data.data[to].value;
|
|
35
35
|
cache.set(`v3/latest?apikey=${this.apiKey}&base_currency=${from}¤cies=${to}`, currencyAPIResponse.data);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
const rioExchangeRate = to === from ? exchangeRate : exchangeRate * 0.9987;
|
|
38
|
+
return rioExchangeRate;
|
|
38
39
|
}
|
|
39
40
|
catch (e) {
|
|
40
41
|
const cachedResponse = cache.get(`v3/latest?apikey=${this.apiKey}&base_currency=${from}¤cies=${to}`);
|
|
@@ -42,7 +43,8 @@ class CurrencyAPIClient {
|
|
|
42
43
|
throw new Error(`Unable to get exchange rate from currencyAPI for ${from} to ${to}`);
|
|
43
44
|
}
|
|
44
45
|
const exchangeRate = cachedResponse.data[to].value;
|
|
45
|
-
|
|
46
|
+
const rioExchangeRate = to === from ? exchangeRate : exchangeRate * 0.9987;
|
|
47
|
+
return rioExchangeRate;
|
|
46
48
|
}
|
|
47
49
|
});
|
|
48
50
|
}
|
|
@@ -25,10 +25,10 @@ class GCloudStorageClient {
|
|
|
25
25
|
}
|
|
26
26
|
exports.GCloudStorageClient = GCloudStorageClient;
|
|
27
27
|
const buildGCloudStorageClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
30
|
-
throw new Error("Unable to get
|
|
28
|
+
const S3_BUCKET = yield secret_manager_client_1.secretManagerClient.getSecretValue("S3_BUCKET");
|
|
29
|
+
if (!S3_BUCKET) {
|
|
30
|
+
throw new Error("Unable to get S3_BUCKET");
|
|
31
31
|
}
|
|
32
|
-
return new GCloudStorageClient(
|
|
32
|
+
return new GCloudStorageClient(S3_BUCKET);
|
|
33
33
|
});
|
|
34
34
|
exports.buildGCloudStorageClient = buildGCloudStorageClient;
|