Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,775 changes: 2,064 additions & 711 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "2.67.7",
"version": "2.67.8",
"description": "JavaScript library for curve.finance",
"main": "lib/index.js",
"author": "Macket",
Expand Down
2 changes: 1 addition & 1 deletion src/constants/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {IDict, IPoolData} from "../interfaces.js";
import {BigNumberish, ethers, Numeric} from "ethers";
import memoize from "memoizee";
import {Curve} from "../curve";
import {type Curve} from "../curve.js";

export const formatUnits = (value: BigNumberish, unit?: string | Numeric): string => ethers.formatUnits(value, unit);
export const parseUnits = (value: string, unit?: string | Numeric) => ethers.parseUnits(value, unit)
Expand Down
2 changes: 1 addition & 1 deletion src/curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import {_getHiddenPools} from "./external-api.js";
import {L2Networks} from "./constants/L2Networks.js";
import {getTwocryptoFactoryPoolData} from "./factory/factory-twocrypto.js";
import {getNetworkConstants} from "./utils.js";
import {_setPoolsFromApi} from "./cached";
import {_setPoolsFromApi} from "./cached.js";

export const OLD_CHAINS = [1, 10, 56, 100, 137, 250, 1284, 2222, 8453, 42161, 42220, 43114, 1313161554]; // these chains have non-ng pools

Expand Down
2 changes: 1 addition & 1 deletion src/factory/common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ICurve, IPoolDataShort } from "../interfaces";
import { getPoolIdBySwapAddress } from "../utils.js";
import {Curve} from "../curve";
import {type Curve} from "../curve.js";

export function setFactoryZapContracts(this: ICurve, isCrypto: boolean): void {
const basePoolIdZapDict = (isCrypto ? this.constants.CRYPTO_FACTORY_CONSTANTS : this.constants.STABLE_FACTORY_CONSTANTS).basePoolIdZapDict ?? {};
Expand Down
4 changes: 2 additions & 2 deletions src/factory/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import gaugeChildABI from "../constants/abis/gauge_child.json" with {type: "json
import StableNgBasePoolZapABI from "../constants/abis/stable-ng-base-pool-zap.json" with {type: "json"};
import {getPoolIdByAddress, setFactoryZapContracts} from "./common.js";
import {getPoolName, isStableNgPool} from "../utils.js";
import {formatUnits} from "../constants/utils";
import {Curve} from "../curve";
import {formatUnits} from "../constants/utils.js";
import {Curve} from "../curve.js";

export const BLACK_LIST: { [index: number]: any } = {
1: [
Expand Down
2 changes: 1 addition & 1 deletion src/pools/PoolTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,12 @@
}

// OVERRIDE
private async depositEstimateGas(amounts: (number | string)[]): Promise<number | number[]> {

Check warning on line 422 in src/pools/PoolTemplate.ts

View workflow job for this annotation

GitHub Actions / test

'amounts' is defined but never used
throw Error(`depositEstimateGas method doesn't exist for pool ${this.name} (id: ${this.name})`);
}

// OVERRIDE
public async deposit(amounts: (number | string)[], slippage = 0.5): Promise<string> {

Check warning on line 427 in src/pools/PoolTemplate.ts

View workflow job for this annotation

GitHub Actions / test

'slippage' is assigned a value but never used
throw Error(`deposit method doesn't exist for pool ${this.name} (id: ${this.name})`);
}

Expand Down Expand Up @@ -479,12 +479,12 @@
}

// OVERRIDE
private async depositWrappedEstimateGas(amounts: (number | string)[]): Promise<number> {

Check warning on line 482 in src/pools/PoolTemplate.ts

View workflow job for this annotation

GitHub Actions / test

'amounts' is defined but never used
throw Error(`depositWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
}

// OVERRIDE
public async depositWrapped(amounts: (number | string)[], slippage = 0.5): Promise<string> {

Check warning on line 487 in src/pools/PoolTemplate.ts

View workflow job for this annotation

GitHub Actions / test

'slippage' is assigned a value but never used
throw Error(`depositWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
}

Expand Down Expand Up @@ -1316,7 +1316,7 @@
// ---------------- WITHDRAW ----------------

// OVERRIDE
public async withdrawExpected(lpTokenAmount: number | string): Promise<string[]> {

Check warning on line 1319 in src/pools/PoolTemplate.ts

View workflow job for this annotation

GitHub Actions / test

'lpTokenAmount' is defined but never used
throw Error(`withdrawExpected method doesn't exist for pool ${this.name} (id: ${this.name})`);
}

Expand All @@ -1336,7 +1336,7 @@
}

// OVERRIDE
private async withdrawEstimateGas(lpTokenAmount: number | string): Promise<number | number[]> {

Check warning on line 1339 in src/pools/PoolTemplate.ts

View workflow job for this annotation

GitHub Actions / test

'lpTokenAmount' is defined but never used
throw Error(`withdraw method doesn't exist for pool ${this.name} (id: ${this.name})`);
}

Expand Down Expand Up @@ -2013,7 +2013,7 @@
public async getStoredRates(useUnderlying = false): Promise<string[]> {
try {
const storedRatesBN = await this._storedRatesBN(useUnderlying);
return storedRatesBN.map(rate => rate.toString());
return storedRatesBN.map((rate) => rate.toString());
} catch (error) {
throw new Error(`Failed to get stored rates for pool ${this.name}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pools/mixins/poolBalancesMixin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PoolTemplate } from "../PoolTemplate.js";
import { _calcExpectedAmounts, _calcExpectedUnderlyingAmountsMeta } from "./common.js";
import {IStatsPool} from "../subClasses/statsPool";
import {type IStatsPool} from "../subClasses/statsPool.js";


export const poolBalancesMetaMixin = {
Expand Down
2 changes: 1 addition & 1 deletion src/pools/mixins/withdrawExpectedMixins.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PoolTemplate } from "../PoolTemplate.js";
import { parseUnits } from "../../utils.js";
import { _calcExpectedAmounts, _calcExpectedUnderlyingAmountsMeta } from "./common.js";
import {formatUnits} from "../../constants/utils";
import {formatUnits} from "../../constants/utils.js";

export const withdrawExpectedMixin = {
async withdrawExpected(this: PoolTemplate, lpTokenAmount: number | string): Promise<string[]> {
Expand Down
2 changes: 1 addition & 1 deletion src/pools/subClasses/walletPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
_prepareAddresses,
_getBalances,
} from '../../utils.js';
import {PoolTemplate} from "../PoolTemplate";
import {type PoolTemplate} from "../PoolTemplate.js";

export interface IWalletPool {
balances: (...addresses: string[] | string[][]) => Promise<IDict<IDict<string>> | IDict<string>>,
Expand Down
2 changes: 1 addition & 1 deletion src/route-graph.worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// important: only type imports, the worker needs to be standalone
import type {IChainId, IDict, IPoolData, IRouteStep, ISwapType} from "./interfaces";
import type {Curve} from "./curve";
import type {Curve} from "./curve.js";

export type IRouteGraphInput = {
constants: Curve['constants'],
Expand Down
2 changes: 1 addition & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {_getAmplificationCoefficientsFromApi} from "./pools/utils.js";
import {L2Networks} from "./constants/L2Networks.js";
import {IRouterWorkerInput, routeFinderWorker, routeFinderWorkerCode} from "./route-finder.worker.js";
import {IRouteGraphInput, routeGraphWorker, routeGraphWorkerCode} from "./route-graph.worker.js";
import {memoizeMethod} from "./constants/utils";
import {memoizeMethod} from "./constants/utils.js";

const MAX_STEPS = 5;
const ROUTE_LENGTH = (MAX_STEPS * 2) + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {L2Networks} from './constants/L2Networks.js';
import {volumeNetworks} from "./constants/volumeNetworks.js";
import {getPool} from "./pools/index.js";
import {NETWORK_CONSTANTS} from "./constants/network_constants.js";
import {formatUnits} from "./constants/utils";
import {formatUnits} from "./constants/utils.js";


export const ETH_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
Expand Down
Loading