@gearbox-protocol/sdk 0.0.55 → 0.0.56
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/core/pathfinder.d.ts +35 -5
- package/lib/core/pathfinder.js +547 -67
- package/lib/core/token.d.ts +5 -0
- package/lib/core/token.js +8 -1
- package/lib/core/tradeTypes.d.ts +2 -0
- package/lib/pathfinder/connectorPathAsset.d.ts +7 -0
- package/lib/pathfinder/connectorPathAsset.js +144 -0
- package/lib/pathfinder/convexLPTokenPathAsset.d.ts +5 -0
- package/lib/pathfinder/convexLPTokenPathAsset.js +77 -0
- package/lib/pathfinder/curveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/curveLPPathAsset.js +72 -0
- package/lib/pathfinder/metaCurveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/metaCurveLPPathAsset.js +72 -0
- package/lib/pathfinder/normalTokenPathAsset.d.ts +5 -0
- package/lib/pathfinder/normalTokenPathAsset.js +136 -0
- package/lib/pathfinder/path.d.ts +41 -0
- package/lib/pathfinder/path.js +302 -0
- package/lib/pathfinder/pathfinder.d.ts +28 -0
- package/lib/pathfinder/pathfinder.js +519 -0
- package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.js +87 -0
- package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.d.ts +5 -0
- package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.js +87 -0
- package/lib/pathfinder/yearnVaultPathAsset.d.ts +5 -0
- package/lib/pathfinder/yearnVaultPathAsset.js +87 -0
- package/lib/utils/types.d.ts +3 -0
- package/lib/utils/types.js +2 -0
- package/package.json +1 -1
- package/src/core/contracts.ts +11 -1
- package/src/core/token.ts +12 -0
- package/src/core/tradeTypes.ts +2 -0
- package/src/pathfinder/connectorPathAsset.ts +69 -0
- package/src/pathfinder/convexLPTokenPathAsset.ts +33 -0
- package/src/pathfinder/curveLPPathAsset.ts +10 -0
- package/src/pathfinder/metaCurveLPPathAsset.ts +12 -0
- package/src/pathfinder/normalTokenPathAsset.ts +68 -0
- package/src/pathfinder/path.ts +259 -0
- package/src/pathfinder/yearnVaultOfCurveLPPathAsset.ts +22 -0
- package/src/pathfinder/yearnVaultOfMetaCurveLPPathAsset.ts +22 -0
- package/src/pathfinder/yearnVaultPathAsset.ts +27 -0
- package/src/utils/types.ts +3 -0
- package/src/core/pathfinder.ts +0 -115
package/lib/core/pathfinder.d.ts
CHANGED
|
@@ -1,24 +1,54 @@
|
|
|
1
|
-
import { BigNumber } from "ethers";
|
|
1
|
+
import { BigNumber, ethers } from "ethers";
|
|
2
2
|
import { CreditManagerData } from "./creditManager";
|
|
3
3
|
import { MultiCall } from "./multicall";
|
|
4
4
|
import { SupportedToken } from "./token";
|
|
5
|
+
import { NetworkType } from "./constants";
|
|
6
|
+
import { CreditAccountData } from "./creditAccount";
|
|
5
7
|
export declare class Path {
|
|
6
8
|
readonly calls: Array<MultiCall>;
|
|
7
9
|
readonly balances: Record<SupportedToken, BigNumber>;
|
|
8
|
-
protected _gasUsed: number;
|
|
9
10
|
readonly pool: SupportedToken;
|
|
10
11
|
readonly creditManager: CreditManagerData;
|
|
12
|
+
readonly creditAccount: CreditAccountData;
|
|
13
|
+
readonly networkType: NetworkType;
|
|
14
|
+
readonly provider: ethers.providers.Provider;
|
|
15
|
+
readonly totalGasLimit: BigNumber;
|
|
11
16
|
constructor(opts: {
|
|
12
|
-
gasUsed: number;
|
|
13
17
|
balances: Record<SupportedToken, BigNumber>;
|
|
14
18
|
pool: SupportedToken;
|
|
15
19
|
creditManager: CreditManagerData;
|
|
20
|
+
creditAccount: CreditAccountData;
|
|
21
|
+
networkType: NetworkType;
|
|
22
|
+
provider: ethers.providers.Provider;
|
|
23
|
+
totalGasLimit: BigNumber;
|
|
16
24
|
});
|
|
17
25
|
getBestPath(): Promise<Path>;
|
|
18
26
|
}
|
|
19
27
|
export interface PathAsset {
|
|
20
|
-
getBestPath(p: Path): Promise<Path>;
|
|
28
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
21
29
|
}
|
|
22
30
|
export declare class ConnectorPathAsset implements PathAsset {
|
|
23
|
-
getBestPath(p: Path): Promise<Path>;
|
|
31
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
32
|
+
getMaxPoolAmount(currentToken: SupportedToken, currentBalance: BigNumber, p: Path): Promise<[BigNumber, BigNumber]>;
|
|
33
|
+
}
|
|
34
|
+
export declare class YearnVaultPathAsset implements PathAsset {
|
|
35
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
36
|
+
}
|
|
37
|
+
export declare class ConvexLPTokenPathAsset implements PathAsset {
|
|
38
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
39
|
+
}
|
|
40
|
+
export declare class CurveLPPathAsset implements PathAsset {
|
|
41
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
42
|
+
}
|
|
43
|
+
export declare class MetaCurveLPPathAsset implements PathAsset {
|
|
44
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
45
|
+
}
|
|
46
|
+
export declare class NormalTokenPathAsset implements PathAsset {
|
|
47
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
48
|
+
}
|
|
49
|
+
export declare class YearnVaultOfCurveLPPathAsset implements PathAsset {
|
|
50
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
51
|
+
}
|
|
52
|
+
export declare class YearnVaultOfMetaCurveLPPathAsset implements PathAsset {
|
|
53
|
+
getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
|
|
24
54
|
}
|