@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.
@@ -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
- let poolId;
21
- const _poolIdOrAddress = poolIdOrAddress.toLowerCase();
22
- if (_poolIdOrAddress.startsWith('0x')) {
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
- else {
29
- poolId = _poolIdOrAddress;
30
- const poolsData = this.getPoolsData();
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.68.28",
3
+ "version": "2.68.29",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",