@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "0.0.42",
3
+ "version": "0.0.45",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -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 CurvePoolContract = | "CURVE_3POOL"
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 ConvexPoolContract =
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 knownContracts: Record<SupportedContract, ContractParams> = {
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,