@gearbox-protocol/sdk 0.0.42 → 0.0.45
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/contracts.d.ts +6 -3
- package/lib/core/contracts.js +12 -7
- package/lib/core/token.d.ts +14 -2
- package/lib/core/token.js +522 -43
- package/lib/core/tokenData.d.ts +0 -4
- package/lib/core/tradeTypes.d.ts +59 -0
- package/lib/core/tradeTypes.js +18 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/package.json +1 -1
- package/src/core/contracts.ts +36 -25
- package/src/core/token.ts +533 -42
- package/src/core/tokenData.ts +0 -6
- package/src/core/tradeTypes.ts +83 -0
- package/src/index.ts +0 -1
- package/lib/devops/loggedDeployer.d.ts +0 -7
- package/lib/devops/loggedDeployer.js +0 -22
- package/lib/devops/verifierDeployer.d.ts +0 -13
- package/lib/devops/verifierDeployer.js +0 -161
- package/src/devops/loggedDeployer.ts +0 -22
- package/src/devops/verifierDeployer.ts +0 -79
package/lib/core/tokenData.d.ts
CHANGED
|
@@ -19,10 +19,6 @@ export interface TokenAllowance {
|
|
|
19
19
|
id: string;
|
|
20
20
|
allowance: BigNumber;
|
|
21
21
|
}
|
|
22
|
-
export declare type TokenType = "core" | "stable" | "volatile" | "lp";
|
|
23
|
-
export interface TokenSavedData {
|
|
24
|
-
type: TokenType;
|
|
25
|
-
}
|
|
26
22
|
export declare const WETHToken: Record<NetworkType, string>;
|
|
27
23
|
export declare const connectors: Record<NetworkType, Array<SupportedToken>>;
|
|
28
24
|
export declare function getConnectors(networkType: NetworkType): string[];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ConvexPoolContract, CurvePoolContract, UniswapV2Contract, YearnVaultContract } from "./contracts";
|
|
2
|
+
import { NormalToken, CurveLPToken, YearnLPToken, ConvexLPToken, ConvexStakedPhantomToken } from "./token";
|
|
3
|
+
export declare enum TradeType {
|
|
4
|
+
UniswapV2Swap = 0,
|
|
5
|
+
UniswapV3Swap = 1,
|
|
6
|
+
CurveExchange = 2,
|
|
7
|
+
CurveExchangeUnderlying = 3,
|
|
8
|
+
CurveDepositLP = 4,
|
|
9
|
+
CurveWithdrawLP = 5,
|
|
10
|
+
YearnDeposit = 6,
|
|
11
|
+
YearnWithdraw = 7,
|
|
12
|
+
LidoStake = 8,
|
|
13
|
+
ConvexDeposit = 9,
|
|
14
|
+
ConvexStake = 10,
|
|
15
|
+
ConvexDepositAndStake = 11
|
|
16
|
+
}
|
|
17
|
+
export declare type TradeAction = {
|
|
18
|
+
type: TradeType.UniswapV2Swap;
|
|
19
|
+
contract: UniswapV2Contract;
|
|
20
|
+
} | {
|
|
21
|
+
type: TradeType.UniswapV3Swap;
|
|
22
|
+
contract: "UNISWAP_V3_ROUTER";
|
|
23
|
+
} | {
|
|
24
|
+
type: TradeType.CurveExchange;
|
|
25
|
+
contract: CurvePoolContract;
|
|
26
|
+
tokenOut: Array<NormalToken | CurveLPToken>;
|
|
27
|
+
} | {
|
|
28
|
+
type: TradeType.CurveDepositLP;
|
|
29
|
+
contract: CurvePoolContract;
|
|
30
|
+
tokenOut: CurveLPToken;
|
|
31
|
+
} | {
|
|
32
|
+
type: TradeType.CurveWithdrawLP;
|
|
33
|
+
contract: CurvePoolContract;
|
|
34
|
+
tokenOut: Array<CurveLPToken | NormalToken>;
|
|
35
|
+
} | {
|
|
36
|
+
type: TradeType.YearnDeposit;
|
|
37
|
+
contract: YearnVaultContract;
|
|
38
|
+
tokenOut: YearnLPToken;
|
|
39
|
+
} | {
|
|
40
|
+
type: TradeType.YearnWithdraw;
|
|
41
|
+
contract: YearnVaultContract;
|
|
42
|
+
tokenOut: NormalToken | CurveLPToken;
|
|
43
|
+
} | {
|
|
44
|
+
type: TradeType.LidoStake;
|
|
45
|
+
contract: "LIDO_STETH_GATEWAY";
|
|
46
|
+
tokenOut: NormalToken;
|
|
47
|
+
} | {
|
|
48
|
+
type: TradeType.ConvexDeposit;
|
|
49
|
+
contract: ConvexPoolContract;
|
|
50
|
+
tokenOut: ConvexLPToken;
|
|
51
|
+
} | {
|
|
52
|
+
type: TradeType.ConvexStake;
|
|
53
|
+
contract: ConvexPoolContract;
|
|
54
|
+
tokenOut: ConvexStakedPhantomToken;
|
|
55
|
+
} | {
|
|
56
|
+
type: TradeType.ConvexDepositAndStake;
|
|
57
|
+
contract: ConvexPoolContract;
|
|
58
|
+
tokenOut: ConvexStakedPhantomToken;
|
|
59
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TradeType = void 0;
|
|
4
|
+
var TradeType;
|
|
5
|
+
(function (TradeType) {
|
|
6
|
+
TradeType[TradeType["UniswapV2Swap"] = 0] = "UniswapV2Swap";
|
|
7
|
+
TradeType[TradeType["UniswapV3Swap"] = 1] = "UniswapV3Swap";
|
|
8
|
+
TradeType[TradeType["CurveExchange"] = 2] = "CurveExchange";
|
|
9
|
+
TradeType[TradeType["CurveExchangeUnderlying"] = 3] = "CurveExchangeUnderlying";
|
|
10
|
+
TradeType[TradeType["CurveDepositLP"] = 4] = "CurveDepositLP";
|
|
11
|
+
TradeType[TradeType["CurveWithdrawLP"] = 5] = "CurveWithdrawLP";
|
|
12
|
+
TradeType[TradeType["YearnDeposit"] = 6] = "YearnDeposit";
|
|
13
|
+
TradeType[TradeType["YearnWithdraw"] = 7] = "YearnWithdraw";
|
|
14
|
+
TradeType[TradeType["LidoStake"] = 8] = "LidoStake";
|
|
15
|
+
TradeType[TradeType["ConvexDeposit"] = 9] = "ConvexDeposit";
|
|
16
|
+
TradeType[TradeType["ConvexStake"] = 10] = "ConvexStake";
|
|
17
|
+
TradeType[TradeType["ConvexDepositAndStake"] = 11] = "ConvexDepositAndStake";
|
|
18
|
+
})(TradeType = exports.TradeType || (exports.TradeType = {}));
|
package/lib/index.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ export * from "./utils/math";
|
|
|
28
28
|
export * from "./core/creditCard";
|
|
29
29
|
export * from "./payload/graphPayload";
|
|
30
30
|
export * from "./types/index";
|
|
31
|
-
export * from "./devops/verifierDeployer";
|
|
32
31
|
export type { IAppPoolService, IAppCreditManager, IAppERC20, IAppAddressProvider, IDataCompressor, IWETHGateway } from "./types";
|
|
33
32
|
export * from "./core/history";
|
|
34
33
|
export { MultiCallContract } from "./utils/multicall";
|
package/lib/index.js
CHANGED
|
@@ -45,7 +45,6 @@ __exportStar(require("./utils/math"), exports);
|
|
|
45
45
|
__exportStar(require("./core/creditCard"), exports);
|
|
46
46
|
__exportStar(require("./payload/graphPayload"), exports);
|
|
47
47
|
__exportStar(require("./types/index"), exports);
|
|
48
|
-
__exportStar(require("./devops/verifierDeployer"), exports);
|
|
49
48
|
__exportStar(require("./core/history"), exports);
|
|
50
49
|
var multicall_1 = require("./utils/multicall");
|
|
51
50
|
Object.defineProperty(exports, "MultiCallContract", { enumerable: true, get: function () { return multicall_1.MultiCallContract; } });
|
package/package.json
CHANGED
package/src/core/contracts.ts
CHANGED
|
@@ -8,37 +8,42 @@ import { AdapterInterface } from "./adapters";
|
|
|
8
8
|
import { NetworkType } from "./constants";
|
|
9
9
|
import { Protocols } from "./protocols";
|
|
10
10
|
import {
|
|
11
|
+
ConvexStakedPhantomToken,
|
|
11
12
|
CurveLPToken,
|
|
12
13
|
NormalToken,
|
|
13
14
|
tokenDataByNetwork
|
|
14
15
|
} from "./token";
|
|
15
16
|
|
|
16
|
-
export type
|
|
17
|
-
| "CURVE_STETH_GATEWAY"
|
|
18
|
-
| "CURVE_FRAX"
|
|
19
|
-
| "CURVE_LUSD"
|
|
20
|
-
| "CURVE_GUSD"
|
|
21
|
-
| "CURVE_SUSD"
|
|
17
|
+
export type UniswapV2Contract = "UNISWAP_V2_ROUTER" | "SUSHISWAP_ROUTER";
|
|
22
18
|
|
|
19
|
+
export type CurvePoolContract =
|
|
20
|
+
| "CURVE_3POOL"
|
|
21
|
+
| "CURVE_STETH_GATEWAY"
|
|
22
|
+
| "CURVE_FRAX"
|
|
23
|
+
| "CURVE_LUSD"
|
|
24
|
+
| "CURVE_GUSD"
|
|
25
|
+
| "CURVE_SUSD";
|
|
23
26
|
|
|
24
|
-
export type
|
|
25
|
-
| "CONVEX_3CRV"
|
|
26
|
-
| "CONVEX_GUSD"
|
|
27
|
-
| "CONVEX_SUSD"
|
|
28
|
-
| "CONVEX_STECRV"
|
|
29
|
-
| "CONVEX_FRAX3CRV"
|
|
30
|
-
|
|
31
|
-
export type SupportedContract =
|
|
32
|
-
| "UNISWAP_V2_ROUTER"
|
|
33
|
-
| "UNISWAP_V3_ROUTER"
|
|
34
|
-
| "SUSHISWAP_ROUTER"
|
|
35
|
-
| CurvePoolContract
|
|
27
|
+
export type YearnVaultContract =
|
|
36
28
|
| "YEARN_DAI"
|
|
37
29
|
| "YEARN_USDC"
|
|
38
30
|
| "YEARN_WETH"
|
|
39
31
|
| "YEARN_WBTC"
|
|
40
32
|
| "YEARN_CURVE_FRAX"
|
|
41
|
-
| "YEARN_CURVE_STETH"
|
|
33
|
+
| "YEARN_CURVE_STETH";
|
|
34
|
+
|
|
35
|
+
export type ConvexPoolContract =
|
|
36
|
+
| "CONVEX_3CRV"
|
|
37
|
+
| "CONVEX_GUSD"
|
|
38
|
+
| "CONVEX_SUSD"
|
|
39
|
+
| "CONVEX_STECRV"
|
|
40
|
+
| "CONVEX_FRAX3CRV";
|
|
41
|
+
|
|
42
|
+
export type SupportedContract =
|
|
43
|
+
| UniswapV2Contract
|
|
44
|
+
| "UNISWAP_V3_ROUTER"
|
|
45
|
+
| CurvePoolContract
|
|
46
|
+
| YearnVaultContract
|
|
42
47
|
| "CONVEX_BOOSTER"
|
|
43
48
|
| ConvexPoolContract
|
|
44
49
|
| "CONVEX_CLAIM_ZAP"
|
|
@@ -156,13 +161,14 @@ export type ContractParams =
|
|
|
156
161
|
| {
|
|
157
162
|
protocol: Protocols.Convex;
|
|
158
163
|
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL;
|
|
164
|
+
stakedToken: ConvexStakedPhantomToken;
|
|
159
165
|
}
|
|
160
166
|
| {
|
|
161
167
|
protocol: Protocols.Lido;
|
|
162
168
|
type: AdapterInterface.LIDO_V1;
|
|
163
169
|
};
|
|
164
170
|
|
|
165
|
-
export const
|
|
171
|
+
export const contractParams: Record<SupportedContract, ContractParams> = {
|
|
166
172
|
UNISWAP_V2_ROUTER: {
|
|
167
173
|
protocol: Protocols.Uniswap,
|
|
168
174
|
type: AdapterInterface.UNISWAP_V2_ROUTER
|
|
@@ -243,23 +249,28 @@ export const knownContracts: Record<SupportedContract, ContractParams> = {
|
|
|
243
249
|
},
|
|
244
250
|
CONVEX_3CRV: {
|
|
245
251
|
protocol: Protocols.Convex,
|
|
246
|
-
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
|
|
252
|
+
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL,
|
|
253
|
+
stakedToken: "stkcvx3Crv"
|
|
247
254
|
},
|
|
248
255
|
CONVEX_GUSD: {
|
|
249
256
|
protocol: Protocols.Convex,
|
|
250
|
-
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
|
|
257
|
+
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL,
|
|
258
|
+
stakedToken: "stkcvxgusd3CRV"
|
|
251
259
|
},
|
|
252
260
|
CONVEX_SUSD: {
|
|
253
261
|
protocol: Protocols.Convex,
|
|
254
|
-
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
|
|
262
|
+
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL,
|
|
263
|
+
stakedToken: "stkcvxcrvPlain3andSUSD"
|
|
255
264
|
},
|
|
256
265
|
CONVEX_STECRV: {
|
|
257
266
|
protocol: Protocols.Convex,
|
|
258
|
-
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
|
|
267
|
+
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL,
|
|
268
|
+
stakedToken: "stkcvxsteCRV"
|
|
259
269
|
},
|
|
260
270
|
CONVEX_FRAX3CRV: {
|
|
261
271
|
protocol: Protocols.Convex,
|
|
262
|
-
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
|
|
272
|
+
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL,
|
|
273
|
+
stakedToken: "stkcvxFRAX3CRV"
|
|
263
274
|
},
|
|
264
275
|
CONVEX_CLAIM_ZAP: {
|
|
265
276
|
protocol: Protocols.Convex,
|