@curvefi/api 2.72.0 → 2.72.1
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/boosting.js +4 -3
- package/lib/pools/poolConstructor.js +2 -2
- package/package.json +1 -1
package/lib/boosting.js
CHANGED
|
@@ -69,9 +69,10 @@ export function getUserBoosts(pools_1) {
|
|
|
69
69
|
return {};
|
|
70
70
|
const poolsData = this.getPoolsData();
|
|
71
71
|
const poolIds = pools.map((poolAddress) => getPoolIdBySwapAddress.call(this, poolAddress));
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
const boosts = yield _getUserBoosts.call(this,
|
|
73
|
+
// If a pool id is empty, the inner function will throw an error when throwOnError is true.
|
|
74
|
+
// If throwOnError is false, we will consider the pool as having no gauge and thus no boost.
|
|
75
|
+
poolIds.map((poolId, index) => { var _a; return (_a = poolsData[poolId]) !== null && _a !== void 0 ? _a : { name: pools[index], gauge_address: this.constants.ZERO_ADDRESS }; }), userAddress, throwOnError);
|
|
75
76
|
return Object.fromEntries(pools.map((poolAddress, index) => [poolAddress, boosts[index]]));
|
|
76
77
|
});
|
|
77
78
|
}
|
|
@@ -16,7 +16,7 @@ import { swapCryptoMetaFactoryMixin, swapMetaFactoryMixin, swapMixin, swapTricry
|
|
|
16
16
|
import { swapWrappedExpectedAndApproveMixin, swapWrappedMixin, swapWrappedRequiredMixin, swapWrappedTricrypto2Mixin, } from "./mixins/swapWrappedMixins.js";
|
|
17
17
|
import { findAbiSignature, getCountArgsOfMethodByAbi, getPoolIdBySwapAddress } from "../utils.js";
|
|
18
18
|
import { StatsPool } from "./subClasses/statsPool.js";
|
|
19
|
-
import {
|
|
19
|
+
import { lowerCasePoolDataAddresses } from "../constants/utils.js";
|
|
20
20
|
import { buildFactoryPoolsData, lowerCasePoolDataAddresses as lowerCaseApiPoolAddresses } from "../factory/factory-api.js";
|
|
21
21
|
export function getPool(poolIdOrAddress) {
|
|
22
22
|
const poolId = poolIdOrAddress.toLowerCase().startsWith('0x') ? getPoolIdBySwapAddress.call(this, poolIdOrAddress.toLowerCase()) : poolIdOrAddress;
|
|
@@ -281,6 +281,6 @@ export function getPoolByData(data) {
|
|
|
281
281
|
throw new Error(`Could not resolve ABI for pool ${id} (poolType=${data.poolType}, implementation=${(_j = data.implementationAddress) !== null && _j !== void 0 ? _j : "none"}). The implementation is unknown to curve for this poolType.`);
|
|
282
282
|
}
|
|
283
283
|
this.constants.EXTERNAL_POOLS_DATA = Object.assign(Object.assign({}, this.constants.EXTERNAL_POOLS_DATA), builtData);
|
|
284
|
-
this.
|
|
284
|
+
this._updateDecimalsAndGauges(builtData);
|
|
285
285
|
return getPool.call(this, id);
|
|
286
286
|
}
|