@curvefi/api 2.68.28 → 2.68.29
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/pools/poolConstructor.js +7 -14
- package/package.json +1 -1
|
@@ -17,22 +17,15 @@ import { swapWrappedExpectedAndApproveMixin, swapWrappedMixin, swapWrappedRequir
|
|
|
17
17
|
import { findAbiSignature, getCountArgsOfMethodByAbi, getPoolIdBySwapAddress } from "../utils.js";
|
|
18
18
|
import { StatsPool } from "./subClasses/statsPool.js";
|
|
19
19
|
export function getPool(poolIdOrAddress) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
poolId = getPoolIdBySwapAddress.call(this, _poolIdOrAddress);
|
|
24
|
-
if (!poolId || !this.getPoolsData()[poolId]) {
|
|
25
|
-
throw new Error(`Pool with address ${_poolIdOrAddress} not found`);
|
|
26
|
-
}
|
|
20
|
+
const poolId = poolIdOrAddress.toLowerCase().startsWith('0x') ? getPoolIdBySwapAddress.call(this, poolIdOrAddress.toLowerCase()) : poolIdOrAddress;
|
|
21
|
+
if (!poolId) {
|
|
22
|
+
throw new Error(`Pool with address ${poolIdOrAddress} not found`);
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!poolsData[poolId]) {
|
|
32
|
-
throw new Error(`Pool with id ${_poolIdOrAddress} not found`);
|
|
33
|
-
}
|
|
24
|
+
const poolData = (this.getPoolsData())[poolId];
|
|
25
|
+
if (!poolData) {
|
|
26
|
+
throw new Error(`Pool with id ${poolIdOrAddress} not found`);
|
|
34
27
|
}
|
|
35
|
-
const poolDummy = new PoolTemplate(poolId, this);
|
|
28
|
+
const poolDummy = new PoolTemplate(poolId, this, poolData);
|
|
36
29
|
class Pool extends PoolTemplate {
|
|
37
30
|
constructor(poolId, curve) {
|
|
38
31
|
super(poolId, curve);
|