@gearbox-protocol/sdk 0.0.52 → 0.0.55
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 +30 -17
- package/lib/core/contracts.js +48 -7
- package/lib/core/contractsRegister.js +24 -6
- package/lib/core/creditAccount.js +26 -20
- package/lib/core/events.d.ts +10 -10
- package/lib/core/events.js +22 -22
- package/lib/core/priceFeeds.js +61 -0
- package/lib/core/token.d.ts +42 -15
- package/lib/core/token.js +523 -46
- package/lib/core/tradeTypes.d.ts +21 -6
- package/lib/core/tradeTypes.js +5 -2
- package/lib/core/transactions.d.ts +2 -2
- package/lib/core/transactions.js +10 -10
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -1
- package/lib/utils/mappers.d.ts +6 -0
- package/lib/utils/mappers.js +33 -0
- package/package.json +1 -1
- package/src/core/adapters.ts +13 -15
- package/src/core/contracts.ts +98 -45
- package/src/core/contractsRegister.ts +16 -8
- package/src/core/creditAccount.ts +33 -19
- package/src/core/events.ts +30 -22
- package/src/core/priceFeeds.ts +66 -0
- package/src/core/token.ts +685 -106
- package/src/core/tradeTypes.ts +24 -6
- package/src/core/transactions.ts +10 -10
- package/src/index.ts +2 -0
- package/src/utils/mappers.ts +23 -0
package/lib/core/priceFeeds.js
CHANGED
|
@@ -427,5 +427,66 @@ exports.priceFeedsByNetwork = {
|
|
|
427
427
|
type: oracles_1.OracleType.LIKE_CURVE_LP_ORACLE,
|
|
428
428
|
curveSymbol: "gusd3CRV"
|
|
429
429
|
}
|
|
430
|
+
},
|
|
431
|
+
//GEARBOX
|
|
432
|
+
dDAI: {
|
|
433
|
+
priceFeedETH: {
|
|
434
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
435
|
+
address: "",
|
|
436
|
+
kovan: ""
|
|
437
|
+
},
|
|
438
|
+
priceFeedUSD: {
|
|
439
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
440
|
+
address: "",
|
|
441
|
+
kovan: ""
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
dUSDC: {
|
|
445
|
+
priceFeedETH: {
|
|
446
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
447
|
+
address: "",
|
|
448
|
+
kovan: ""
|
|
449
|
+
},
|
|
450
|
+
priceFeedUSD: {
|
|
451
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
452
|
+
address: "",
|
|
453
|
+
kovan: ""
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
dWBTC: {
|
|
457
|
+
priceFeedETH: {
|
|
458
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
459
|
+
address: "",
|
|
460
|
+
kovan: ""
|
|
461
|
+
},
|
|
462
|
+
priceFeedUSD: {
|
|
463
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
464
|
+
address: "",
|
|
465
|
+
kovan: ""
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
dWETH: {
|
|
469
|
+
priceFeedETH: {
|
|
470
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
471
|
+
address: "",
|
|
472
|
+
kovan: ""
|
|
473
|
+
},
|
|
474
|
+
priceFeedUSD: {
|
|
475
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
476
|
+
address: "",
|
|
477
|
+
kovan: ""
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
GEAR: {
|
|
481
|
+
priceFeedETH: {
|
|
482
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
483
|
+
address: "",
|
|
484
|
+
kovan: ""
|
|
485
|
+
},
|
|
486
|
+
priceFeedUSD: {
|
|
487
|
+
type: oracles_1.OracleType.CHAINLINK_ORACLE,
|
|
488
|
+
address: "",
|
|
489
|
+
kovan: ""
|
|
490
|
+
}
|
|
430
491
|
}
|
|
431
492
|
};
|
package/lib/core/token.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ export declare enum TokenType {
|
|
|
10
10
|
YEARN_VAULT_OF_CURVE_LP = 5,
|
|
11
11
|
YEARN_VAULT_OF_META_CURVE_LP = 6,
|
|
12
12
|
CONVEX_LP_TOKEN = 7,
|
|
13
|
-
CONVEX_STAKED_PHANTOM_TOKEN = 8
|
|
13
|
+
CONVEX_STAKED_PHANTOM_TOKEN = 8,
|
|
14
|
+
DIESEL_LP_TOKEN = 9
|
|
14
15
|
}
|
|
15
16
|
export declare const priority: Record<TokenType, number>;
|
|
16
17
|
export declare type NormalToken = "1INCH" | "AAVE" | "COMP" | "CRV" | "DAI" | "DPI" | "FEI" | "LINK" | "SNX" | "SUSHI" | "UNI" | "USDC" | "USDT" | "WBTC" | "WETH" | "YFI" | "STETH" | "FTM" | "CVX" | "FRAX" | "FXS" | "LDO" | "SPELL" | "LUSD" | "sUSD" | "GUSD" | "LUNA" | "LQTY";
|
|
@@ -18,55 +19,81 @@ export declare type CurveLPToken = "3Crv" | "steCRV" | "FRAX3CRV" | "LUSD3CRV" |
|
|
|
18
19
|
export declare type YearnLPToken = "yvDAI" | "yvUSDC" | "yvWETH" | "yvWBTC" | "yvCurve_stETH" | "yvCURVE_FRAX_POOL";
|
|
19
20
|
export declare type ConvexLPToken = "cvx3Crv" | "cvxsteCRV" | "cvxFRAX3CRV" | "cvxcrvPlain3andSUSD" | "cvxgusd3CRV";
|
|
20
21
|
export declare type ConvexStakedPhantomToken = "stkcvx3Crv" | "stkcvxsteCRV" | "stkcvxFRAX3CRV" | "stkcvxcrvPlain3andSUSD" | "stkcvxgusd3CRV";
|
|
21
|
-
export declare type
|
|
22
|
-
export declare type
|
|
22
|
+
export declare type DieselTokenTypes = "dDAI" | "dUSDC" | "dWBTC" | "dWETH";
|
|
23
|
+
export declare type GearboxToken = "GEAR";
|
|
24
|
+
export declare type SupportedToken = NormalToken | YearnLPToken | CurveLPToken | ConvexLPToken | ConvexStakedPhantomToken | DieselTokenTypes | GearboxToken;
|
|
25
|
+
export interface TokenBase {
|
|
26
|
+
name: string;
|
|
27
|
+
symbol: string;
|
|
28
|
+
decimals: number;
|
|
29
|
+
}
|
|
30
|
+
declare type NormalConnectorTokenData = {
|
|
23
31
|
symbol: NormalToken;
|
|
24
32
|
type: TokenType.CONNECTOR;
|
|
25
33
|
swapActions: Array<TradeAction>;
|
|
26
34
|
lpActions?: Array<TradeAction>;
|
|
27
|
-
}
|
|
35
|
+
} & TokenBase;
|
|
36
|
+
declare type NormalTokenData = {
|
|
28
37
|
symbol: NormalToken;
|
|
29
38
|
type: TokenType.NORMAL_TOKEN;
|
|
30
39
|
swapActions: Array<TradeAction>;
|
|
31
40
|
lpActions?: Array<TradeAction>;
|
|
32
|
-
}
|
|
41
|
+
} & TokenBase;
|
|
42
|
+
declare type CurveLPTokenData = {
|
|
33
43
|
symbol: CurveLPToken;
|
|
34
44
|
type: TokenType.CURVE_LP;
|
|
35
45
|
swapActions?: Array<TradeAction>;
|
|
36
46
|
lpActions: Array<TradeAction>;
|
|
37
|
-
}
|
|
47
|
+
} & TokenBase;
|
|
48
|
+
declare type MetaCurveLPTokenData = {
|
|
49
|
+
symbol: CurveLPToken;
|
|
50
|
+
type: TokenType.META_CURVE_LP;
|
|
51
|
+
lpActions: Array<TradeAction>;
|
|
52
|
+
} & TokenBase;
|
|
53
|
+
declare type YearnVaultTokenData = {
|
|
38
54
|
symbol: YearnLPToken;
|
|
39
55
|
type: TokenType.YEARN_VAULT;
|
|
40
56
|
underlying: NormalToken;
|
|
41
57
|
lpActions: Array<TradeAction>;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
type: TokenType.META_CURVE_LP;
|
|
45
|
-
lpActions: Array<TradeAction>;
|
|
46
|
-
} | {
|
|
58
|
+
} & TokenBase;
|
|
59
|
+
declare type YearnVaultOfCurveLPTokenData = {
|
|
47
60
|
symbol: YearnLPToken;
|
|
48
61
|
type: TokenType.YEARN_VAULT_OF_CURVE_LP;
|
|
49
62
|
underlying: CurveLPToken;
|
|
50
63
|
lpActions: Array<TradeAction>;
|
|
51
|
-
}
|
|
64
|
+
} & TokenBase;
|
|
65
|
+
declare type YearnVaultOfMetaCurveLPTokenData = {
|
|
52
66
|
symbol: YearnLPToken;
|
|
53
67
|
type: TokenType.YEARN_VAULT_OF_META_CURVE_LP;
|
|
54
68
|
underlying: CurveLPToken;
|
|
55
69
|
lpActions: Array<TradeAction>;
|
|
56
|
-
}
|
|
70
|
+
} & TokenBase;
|
|
71
|
+
declare type ConvexLPTokenData = {
|
|
57
72
|
symbol: ConvexLPToken;
|
|
58
73
|
type: TokenType.CONVEX_LP_TOKEN;
|
|
59
74
|
pool: ConvexPoolContract;
|
|
60
75
|
underlying: CurveLPToken;
|
|
61
76
|
stakedToken: ConvexStakedPhantomToken;
|
|
62
77
|
lpActions: Array<TradeAction>;
|
|
63
|
-
}
|
|
78
|
+
} & TokenBase;
|
|
79
|
+
declare type ConvexPhantomTokenData = {
|
|
64
80
|
symbol: ConvexStakedPhantomToken;
|
|
65
81
|
type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN;
|
|
66
82
|
pool: ConvexPoolContract;
|
|
67
83
|
underlying: CurveLPToken;
|
|
68
84
|
lpToken: ConvexLPToken;
|
|
69
85
|
lpActions: Array<TradeAction>;
|
|
70
|
-
};
|
|
86
|
+
} & TokenBase;
|
|
87
|
+
declare type DieselTokenData = {
|
|
88
|
+
symbol: DieselTokenTypes;
|
|
89
|
+
type: TokenType.DIESEL_LP_TOKEN;
|
|
90
|
+
} & TokenBase;
|
|
91
|
+
declare type GearboxTokenData = {
|
|
92
|
+
symbol: GearboxToken;
|
|
93
|
+
type: TokenType.NORMAL_TOKEN;
|
|
94
|
+
} & TokenBase;
|
|
95
|
+
export declare type TokenDataI = NormalConnectorTokenData | NormalTokenData | CurveLPTokenData | MetaCurveLPTokenData | YearnVaultTokenData | YearnVaultOfCurveLPTokenData | YearnVaultOfMetaCurveLPTokenData | ConvexLPTokenData | ConvexPhantomTokenData | DieselTokenData | GearboxTokenData;
|
|
71
96
|
export declare const supportedTokens: Record<SupportedToken, TokenDataI>;
|
|
72
97
|
export declare const tokenDataByNetwork: Record<NetworkType, Record<SupportedToken, string>>;
|
|
98
|
+
export declare const tokenDataByAddress: Record<string, SupportedToken>;
|
|
99
|
+
export {};
|