@curvefi/api 2.66.30 → 2.67.0
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.d.ts +33 -32
- package/lib/boosting.js +320 -252
- package/lib/cached.d.ts +4 -3
- package/lib/cached.js +63 -19
- package/lib/constants/coins/hyperliquid.d.ts +2 -0
- package/lib/constants/coins/hyperliquid.js +5 -0
- package/lib/constants/coins/index.d.ts +2 -1
- package/lib/constants/coins/index.js +2 -1
- package/lib/constants/factory/crypto.d.ts +5 -0
- package/lib/constants/factory/crypto.js +8 -0
- package/lib/constants/factory/stable.js +3 -0
- package/lib/constants/network_constants.js +37 -11
- package/lib/constants/pools/hyperliquid.d.ts +2 -0
- package/lib/constants/pools/hyperliquid.js +2 -0
- package/lib/constants/pools/index.d.ts +2 -1
- package/lib/constants/pools/index.js +2 -1
- package/lib/constants/utils.d.ts +14 -1
- package/lib/constants/utils.js +21 -6
- package/lib/constants/volumeNetworks.js +1 -1
- package/lib/curve.d.ts +5 -5
- package/lib/curve.js +21 -38
- package/lib/dao.d.ts +32 -31
- package/lib/dao.js +420 -350
- package/lib/external-api.d.ts +1 -1
- package/lib/external-api.js +2 -2
- package/lib/factory/common.d.ts +2 -1
- package/lib/factory/common.js +1 -1
- package/lib/factory/deploy.d.ts +46 -45
- package/lib/factory/deploy.js +630 -551
- package/lib/factory/factory-api.d.ts +3 -2
- package/lib/factory/factory-api.js +22 -23
- package/lib/factory/factory-crypto.d.ts +1 -1
- package/lib/factory/factory-crypto.js +12 -15
- package/lib/factory/factory-tricrypto.d.ts +1 -1
- package/lib/factory/factory-tricrypto.js +14 -15
- package/lib/factory/factory-twocrypto.d.ts +1 -1
- package/lib/factory/factory-twocrypto.js +12 -13
- package/lib/factory/factory.d.ts +4 -3
- package/lib/factory/factory.js +21 -24
- package/lib/index.d.ts +413 -104
- package/lib/index.js +253 -257
- package/lib/interfaces.d.ts +2 -0
- package/lib/pools/PoolTemplate.d.ts +13 -12
- package/lib/pools/PoolTemplate.js +279 -285
- package/lib/pools/mixins/common.js +2 -2
- package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +12 -4
- package/lib/pools/mixins/depositBalancedAmountsMixins.js +1 -15
- package/lib/pools/mixins/depositMixins.d.ts +25 -5
- package/lib/pools/mixins/depositMixins.js +38 -76
- package/lib/pools/mixins/depositWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/depositWrappedMixins.js +17 -33
- package/lib/pools/mixins/poolBalancesMixin.d.ts +6 -2
- package/lib/pools/mixins/poolBalancesMixin.js +3 -5
- package/lib/pools/mixins/swapMixins.d.ts +20 -4
- package/lib/pools/mixins/swapMixins.js +36 -70
- package/lib/pools/mixins/swapWrappedMixins.d.ts +19 -4
- package/lib/pools/mixins/swapWrappedMixins.js +32 -60
- package/lib/pools/mixins/withdrawExpectedMixins.d.ts +12 -4
- package/lib/pools/mixins/withdrawExpectedMixins.js +6 -11
- package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +20 -4
- package/lib/pools/mixins/withdrawImbalanceMixins.js +26 -53
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +12 -27
- package/lib/pools/mixins/withdrawMixins.d.ts +25 -5
- package/lib/pools/mixins/withdrawMixins.js +33 -67
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +12 -4
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +8 -13
- package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +25 -5
- package/lib/pools/mixins/withdrawOneCoinMixins.js +32 -66
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +6 -2
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +4 -7
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +13 -29
- package/lib/pools/mixins/withdrawWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawWrappedMixins.js +14 -28
- package/lib/pools/poolConstructor.d.ts +2 -1
- package/lib/pools/poolConstructor.js +27 -28
- package/lib/pools/subClasses/corePool.d.ts +4 -1
- package/lib/pools/subClasses/corePool.js +5 -7
- package/lib/pools/subClasses/gaugePool.d.ts +5 -3
- package/lib/pools/subClasses/gaugePool.js +19 -18
- package/lib/pools/subClasses/statsPool.d.ts +2 -0
- package/lib/pools/subClasses/statsPool.js +22 -10
- package/lib/pools/subClasses/walletPool.d.ts +2 -1
- package/lib/pools/subClasses/walletPool.js +6 -6
- package/lib/pools/utils.d.ts +7 -6
- package/lib/pools/utils.js +316 -297
- package/lib/route-graph.worker.d.ts +2 -2
- package/lib/route-graph.worker.js +4 -6
- package/lib/router.d.ts +12 -11
- package/lib/router.js +331 -295
- package/lib/utils.d.ts +34 -33
- package/lib/utils.js +483 -435
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IChainId, IDict, IPoolData, IRouteStep } from "./interfaces";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Curve } from "./curve";
|
|
3
3
|
export type IRouteGraphInput = {
|
|
4
|
-
constants:
|
|
4
|
+
constants: Curve['constants'];
|
|
5
5
|
chainId: IChainId;
|
|
6
6
|
isLiteChain: boolean;
|
|
7
7
|
allPools: [string, IPoolData][];
|
|
@@ -206,18 +206,16 @@ export function routeGraphWorker() {
|
|
|
206
206
|
}
|
|
207
207
|
// SNX swaps
|
|
208
208
|
if (chainId in SNX) {
|
|
209
|
-
|
|
210
|
-
for (const inCoin of SNX[
|
|
211
|
-
|
|
212
|
-
for (const outCoin of SNX[chainId].coins) {
|
|
209
|
+
const chain = chainId;
|
|
210
|
+
for (const inCoin of SNX[chain].coins) {
|
|
211
|
+
for (const outCoin of SNX[chain].coins) {
|
|
213
212
|
if (inCoin === outCoin)
|
|
214
213
|
continue;
|
|
215
214
|
if (!routerGraph[inCoin])
|
|
216
215
|
routerGraph[inCoin] = {};
|
|
217
216
|
routerGraph[inCoin][outCoin] = [{
|
|
218
217
|
poolId: "SNX exchanger",
|
|
219
|
-
|
|
220
|
-
swapAddress: SNX[chainId].swap,
|
|
218
|
+
swapAddress: SNX[chain].swap,
|
|
221
219
|
inputCoinAddress: inCoin,
|
|
222
220
|
outputCoinAddress: outCoin,
|
|
223
221
|
swapParams: [0, 0, 9, 0, 0],
|
package/lib/router.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
+
import { type Curve } from "./curve.js";
|
|
2
3
|
import { IRoute } from "./interfaces";
|
|
3
|
-
export declare
|
|
4
|
+
export declare function getBestRouteAndOutput(this: Curve, inputCoin: string, outputCoin: string, amount: number | string): Promise<{
|
|
4
5
|
route: IRoute;
|
|
5
6
|
output: string;
|
|
6
7
|
}>;
|
|
7
|
-
export declare
|
|
8
|
+
export declare function getArgs(this: Curve, route: IRoute): {
|
|
8
9
|
_route: string[];
|
|
9
10
|
_swapParams: number[][];
|
|
10
11
|
_pools?: string[];
|
|
@@ -13,12 +14,12 @@ export declare const getArgs: (route: IRoute) => {
|
|
|
13
14
|
_secondBasePools?: string[];
|
|
14
15
|
_secondBaseTokens?: string[];
|
|
15
16
|
};
|
|
16
|
-
export declare
|
|
17
|
-
export declare
|
|
18
|
-
export declare
|
|
19
|
-
export declare
|
|
20
|
-
export declare
|
|
21
|
-
export declare
|
|
22
|
-
export declare
|
|
23
|
-
export declare
|
|
24
|
-
export declare
|
|
17
|
+
export declare function swapExpected(this: Curve, inputCoin: string, outputCoin: string, amount: number | string): Promise<string>;
|
|
18
|
+
export declare function swapRequired(this: Curve, inputCoin: string, outputCoin: string, outAmount: number | string): Promise<string>;
|
|
19
|
+
export declare function swapPriceImpact(this: Curve, inputCoin: string, outputCoin: string, amount: number | string): Promise<number>;
|
|
20
|
+
export declare function swapIsApproved(this: Curve, inputCoin: string, amount: number | string): Promise<boolean>;
|
|
21
|
+
export declare function swapApproveEstimateGas(this: Curve, inputCoin: string, amount: number | string): Promise<number | number[]>;
|
|
22
|
+
export declare function swapApprove(this: Curve, inputCoin: string, amount: number | string): Promise<string[]>;
|
|
23
|
+
export declare function swapEstimateGas(this: Curve, inputCoin: string, outputCoin: string, amount: number | string): Promise<number | number[]>;
|
|
24
|
+
export declare function swap(this: Curve, inputCoin: string, outputCoin: string, amount: number | string, slippage?: number): Promise<ethers.ContractTransactionResponse>;
|
|
25
|
+
export declare function getSwappedAmount(this: Curve, tx: ethers.ContractTransactionResponse, outputCoin: string): Promise<string>;
|