@curvefi/api 2.65.2 → 2.65.4
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.
package/lib/external-api.js
CHANGED
|
@@ -242,6 +242,7 @@ export const _getCurveLiteNetworks = memoize(() => __awaiter(void 0, void 0, voi
|
|
|
242
242
|
rpcUrl: metadata.rpcUrl,
|
|
243
243
|
chainId: metadata.chainId,
|
|
244
244
|
explorerUrl: metadata.explorerBaseUrl,
|
|
245
|
+
nativeCurrencySymbol: metadata.nativeCurrencySymbol,
|
|
245
246
|
};
|
|
246
247
|
})
|
|
247
248
|
.filter((network) => network !== null);
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export const poolBalancesLendingMixin = {
|
|
|
36
36
|
const contractCalls = this.pool.wrappedCoins.map((_, i) => swapContract.balances(i));
|
|
37
37
|
const _poolWrappedBalances = yield curve.multicallProvider.all(contractCalls);
|
|
38
38
|
// @ts-ignore
|
|
39
|
-
const _rates = yield this._getRates();
|
|
39
|
+
const _rates = yield this.pool._getRates();
|
|
40
40
|
const _poolUnderlyingBalances = _poolWrappedBalances.map((_b, i) => _b * _rates[i] / curve.parseUnits(String(Math.pow(10, 18)), 0));
|
|
41
41
|
return _poolUnderlyingBalances.map((_b, i) => curve.formatUnits(_b, this.pool.underlyingDecimals[i]));
|
|
42
42
|
});
|
package/lib/utils.js
CHANGED
|
@@ -367,9 +367,6 @@ export const _getRewardsFromApi = () => __awaiter(void 0, void 0, void 0, functi
|
|
|
367
367
|
const _usdRatesCache = {};
|
|
368
368
|
export const _getUsdRate = (assetId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
369
369
|
var _f, _g;
|
|
370
|
-
if (curve.isLiteChain) {
|
|
371
|
-
throw Error('This method is not supported for the lite version');
|
|
372
|
-
}
|
|
373
370
|
if (curve.chainId === 1 && assetId.toLowerCase() === '0x8762db106b2c2a0bccb3a80d1ed41273552616e8')
|
|
374
371
|
return 0; // RSR
|
|
375
372
|
const pricesFromApi = yield _getUsdPricesFromApi();
|
|
@@ -450,9 +447,6 @@ export const _getUsdRate = (assetId) => __awaiter(void 0, void 0, void 0, functi
|
|
|
450
447
|
return _usdRatesCache[assetId]['rate'];
|
|
451
448
|
});
|
|
452
449
|
export const getUsdRate = (coin) => __awaiter(void 0, void 0, void 0, function* () {
|
|
453
|
-
if (curve.isLiteChain) {
|
|
454
|
-
throw Error('This method is not supported for the lite version');
|
|
455
|
-
}
|
|
456
450
|
const [coinAddress] = _getCoinAddressesNoCheck(coin);
|
|
457
451
|
return yield _getUsdRate(coinAddress);
|
|
458
452
|
});
|