@gearbox-protocol/sdk 2.1.34 → 3.0.0-next.2
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/apy/convexAPY.d.ts +4 -6
- package/lib/apy/convexAPY.js +15 -16
- package/lib/apy/curveAPY.d.ts +2 -2
- package/lib/apy/curveAPY.js +3 -4
- package/lib/apy/index.d.ts +1 -1
- package/lib/apy/index.js +2 -2
- package/lib/apy/lidoAPY.js +2 -2
- package/lib/apy/yearnAPY.d.ts +1 -1
- package/lib/apy/yearnAPY.js +3 -5
- package/lib/contracts/contractsRegister.d.ts +1 -1
- package/lib/contracts/contractsRegister.js +6 -7
- package/lib/core/creditAccount.js +20 -22
- package/lib/core/creditAccount.spec.js +32 -34
- package/lib/core/creditManager.js +16 -17
- package/lib/core/creditSession.js +12 -13
- package/lib/core/events.js +34 -35
- package/lib/core/pool/data.js +22 -23
- package/lib/core/priceOracle.js +3 -3
- package/lib/core/rewardClaimer.d.ts +1 -3
- package/lib/core/rewardConvex.d.ts +1 -4
- package/lib/core/rewardConvex.js +7 -10
- package/lib/core/rewardConvex.spec.js +15 -16
- package/lib/core/strategy.js +14 -16
- package/lib/core/strategy.spec.js +20 -22
- package/lib/core/trade.d.ts +1 -1
- package/lib/core/trade.js +12 -15
- package/lib/core/transactions.d.ts +1 -1
- package/lib/core/transactions.js +18 -20
- package/lib/index.d.ts +2 -20
- package/lib/index.js +27 -24
- package/lib/parsers/ERC20Parser.d.ts +1 -1
- package/lib/parsers/abstractParser.d.ts +1 -1
- package/lib/parsers/abstractParser.js +3 -4
- package/lib/parsers/convexBaseRewardPoolAdapterParser.d.ts +1 -1
- package/lib/parsers/convexBaseRewardPoolAdapterParser.js +2 -2
- package/lib/parsers/convexBaseRewardPoolAdapterParser.spec.js +4 -4
- package/lib/parsers/convexBoosterAdapterParser.d.ts +1 -1
- package/lib/parsers/convexBoosterAdapterParser.js +3 -3
- package/lib/parsers/convexBoosterAdapterParser.spec.js +3 -3
- package/lib/parsers/convextRewardPoolParser.d.ts +1 -1
- package/lib/parsers/creditFacadeParser.d.ts +1 -1
- package/lib/parsers/creditFacadeParser.spec.js +8 -9
- package/lib/parsers/curveAdapterParser.d.ts +1 -2
- package/lib/parsers/curveAdapterParser.js +5 -5
- package/lib/parsers/curveAdapterParser.spec.js +13 -13
- package/lib/parsers/lidoAdapterParser.d.ts +1 -1
- package/lib/parsers/lidoAdapterParser.spec.js +2 -2
- package/lib/parsers/lidoSTETHParser.d.ts +1 -1
- package/lib/parsers/txParser.d.ts +1 -3
- package/lib/parsers/txParser.js +12 -15
- package/lib/parsers/uniV2AdapterParser.d.ts +1 -1
- package/lib/parsers/uniV2AdapterParser.spec.js +15 -16
- package/lib/parsers/uniV3AdapterParser.d.ts +1 -1
- package/lib/parsers/uniV3AdapterParser.spec.js +15 -16
- package/lib/parsers/wstETHAdapterParser.d.ts +1 -1
- package/lib/parsers/wstETHAdapterParser.spec.js +3 -3
- package/lib/parsers/yearnAdapterParser.spec.js +12 -12
- package/lib/parsers/yearnV2AdapterParser.d.ts +1 -1
- package/lib/parsers/yearnV2AdapterParser.js +2 -2
- package/lib/pathfinder/pathOptions.d.ts +1 -2
- package/lib/pathfinder/pathOptions.js +12 -16
- package/lib/pathfinder/pathOptions.spec.js +36 -36
- package/lib/pathfinder/pathfinder.d.ts +1 -2
- package/lib/pathfinder/pathfinder.js +9 -10
- package/lib/pathfinder/pathfinder.spec.js +11 -12
- package/lib/payload/creditAccount.d.ts +1 -1
- package/lib/payload/creditManager.d.ts +1 -1
- package/lib/payload/pool.d.ts +1 -1
- package/lib/tokens/tokenData.d.ts +0 -4
- package/lib/tokens/tokenData.js +1 -16
- package/lib/utils/formatter.js +3 -3
- package/lib/utils/math.js +5 -5
- package/lib/utils/price.js +4 -4
- package/lib/watchers/creditAccountWatcher.js +2 -2
- package/lib/watchers/creditAccountWatcher.spec.js +18 -18
- package/lib/watchers/creditManagerWatcher.spec.js +19 -19
- package/package.json +2 -1
- package/lib/contracts/adapters.d.ts +0 -24
- package/lib/contracts/adapters.js +0 -28
- package/lib/contracts/contracts.d.ts +0 -112
- package/lib/contracts/contracts.js +0 -654
- package/lib/contracts/protocols.d.ts +0 -12
- package/lib/contracts/protocols.js +0 -16
- package/lib/contracts/utilsContracts.d.ts +0 -7
- package/lib/contracts/utilsContracts.js +0 -28
- package/lib/core/chains.d.ts +0 -23
- package/lib/core/chains.js +0 -63
- package/lib/core/constants.d.ts +0 -21
- package/lib/core/constants.js +0 -31
- package/lib/tokens/aave.d.ts +0 -20
- package/lib/tokens/aave.js +0 -62
- package/lib/tokens/balancer.d.ts +0 -12
- package/lib/tokens/balancer.js +0 -36
- package/lib/tokens/compound.d.ts +0 -11
- package/lib/tokens/compound.js +0 -38
- package/lib/tokens/convex.d.ts +0 -30
- package/lib/tokens/convex.js +0 -262
- package/lib/tokens/curveLP.d.ts +0 -27
- package/lib/tokens/curveLP.js +0 -141
- package/lib/tokens/decimals.d.ts +0 -2
- package/lib/tokens/decimals.js +0 -115
- package/lib/tokens/gear.d.ts +0 -14
- package/lib/tokens/gear.js +0 -47
- package/lib/tokens/normal.d.ts +0 -9
- package/lib/tokens/normal.js +0 -194
- package/lib/tokens/quoted.d.ts +0 -3
- package/lib/tokens/quoted.js +0 -7
- package/lib/tokens/token.d.ts +0 -25
- package/lib/tokens/token.js +0 -305
- package/lib/tokens/tokenType.d.ts +0 -15
- package/lib/tokens/tokenType.js +0 -19
- package/lib/tokens/tokens.spec.d.ts +0 -1
- package/lib/tokens/tokens.spec.js +0 -151
- package/lib/tokens/yearn.d.ts +0 -26
- package/lib/tokens/yearn.js +0 -52
- package/lib/utils/mappers.d.ts +0 -8
- package/lib/utils/mappers.js +0 -13
- package/lib/utils/multicall.d.ts +0 -36
- package/lib/utils/multicall.js +0 -90
- package/lib/utils/safeEnum.d.ts +0 -1
- package/lib/utils/safeEnum.js +0 -10
- package/lib/utils/types.d.ts +0 -10
- package/lib/utils/types.js +0 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
3
4
|
const chai_1 = require("chai");
|
|
4
5
|
const ethers_1 = require("ethers");
|
|
5
|
-
const constants_1 = require("../core/constants");
|
|
6
6
|
const types_1 = require("../types");
|
|
7
7
|
const creditManagerWatcher_1 = require("./creditManagerWatcher");
|
|
8
|
-
const CREDIT_MANAGER_ADDRESS =
|
|
8
|
+
const CREDIT_MANAGER_ADDRESS = sdk_gov_1.DUMB_ADDRESS;
|
|
9
9
|
const CREDIT_CONFIGIURATOR_ADDRESS = "0xcb9a588a47dd0393af3d0d5f86e6f1c8fd252c48";
|
|
10
10
|
const cmDumb = {
|
|
11
11
|
address: CREDIT_MANAGER_ADDRESS.toLowerCase(),
|
|
12
12
|
creditConfigurator: CREDIT_CONFIGIURATOR_ADDRESS.toLowerCase(),
|
|
13
13
|
};
|
|
14
14
|
const encode = (abiType, value) => ethers_1.utils.defaultAbiCoder.encode([abiType], [value]);
|
|
15
|
-
const makeLog = (address, topics, data =
|
|
15
|
+
const makeLog = (address, topics, data = sdk_gov_1.ADDRESS_0X0) => {
|
|
16
16
|
return {
|
|
17
17
|
blockNumber: 0,
|
|
18
18
|
blockHash: "",
|
|
@@ -30,13 +30,13 @@ describe("CreditManagerTracker test", () => {
|
|
|
30
30
|
const creditManagerInterface = types_1.ICreditManagerV2__factory.createInterface();
|
|
31
31
|
let log = makeLog(CREDIT_MANAGER_ADDRESS, [
|
|
32
32
|
creditManagerInterface.getEventTopic("NewConfigurator"),
|
|
33
|
-
encode("address",
|
|
33
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
34
34
|
]);
|
|
35
35
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
36
36
|
log = makeLog(CREDIT_MANAGER_ADDRESS, [
|
|
37
37
|
creditManagerInterface.getEventTopic("ExecuteOrder"),
|
|
38
|
-
encode("address",
|
|
39
|
-
encode("address",
|
|
38
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
39
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
40
40
|
]);
|
|
41
41
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(false);
|
|
42
42
|
});
|
|
@@ -44,28 +44,28 @@ describe("CreditManagerTracker test", () => {
|
|
|
44
44
|
const ccInterface = types_1.ICreditConfigurator__factory.createInterface();
|
|
45
45
|
let log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
46
46
|
ccInterface.getEventTopic("TokenLiquidationThresholdUpdated"),
|
|
47
|
-
encode("address",
|
|
47
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
48
48
|
], encode("uint16", 122));
|
|
49
49
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
50
50
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
51
51
|
ccInterface.getEventTopic("TokenAllowed"),
|
|
52
|
-
encode("address",
|
|
52
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
53
53
|
]);
|
|
54
54
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
55
55
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
56
56
|
ccInterface.getEventTopic("TokenForbidden"),
|
|
57
|
-
encode("address",
|
|
57
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
58
58
|
]);
|
|
59
59
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
60
60
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
61
61
|
ccInterface.getEventTopic("ContractAllowed"),
|
|
62
|
-
encode("address",
|
|
63
|
-
encode("address",
|
|
62
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
63
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
64
64
|
]);
|
|
65
65
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
66
66
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
67
67
|
ccInterface.getEventTopic("ContractForbidden"),
|
|
68
|
-
encode("address",
|
|
68
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
69
69
|
]);
|
|
70
70
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
71
71
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("LimitsUpdated")], ethers_1.utils.defaultAbiCoder.encode(["uint256", "uint256"], [50, 200]));
|
|
@@ -74,34 +74,34 @@ describe("CreditManagerTracker test", () => {
|
|
|
74
74
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
75
75
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
76
76
|
ccInterface.getEventTopic("PriceOracleUpgraded"),
|
|
77
|
-
encode("address",
|
|
77
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
78
78
|
]);
|
|
79
79
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
80
80
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
81
81
|
ccInterface.getEventTopic("CreditFacadeUpgraded"),
|
|
82
|
-
encode("address",
|
|
82
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
83
83
|
]);
|
|
84
84
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
85
85
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [
|
|
86
86
|
ccInterface.getEventTopic("CreditConfiguratorUpgraded"),
|
|
87
|
-
encode("address",
|
|
87
|
+
encode("address", sdk_gov_1.DUMB_ADDRESS),
|
|
88
88
|
]);
|
|
89
89
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
90
90
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("IncreaseDebtForbiddenModeChanged")], encode("bool", true));
|
|
91
91
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
92
92
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("LimitPerBlockUpdated")], encode("uint128", 122));
|
|
93
93
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
94
|
-
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("AddedToUpgradeable")], encode("address",
|
|
94
|
+
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("AddedToUpgradeable")], encode("address", sdk_gov_1.DUMB_ADDRESS));
|
|
95
95
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
96
|
-
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("RemovedFromUpgradeable")], encode("address",
|
|
96
|
+
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("RemovedFromUpgradeable")], encode("address", sdk_gov_1.DUMB_ADDRESS));
|
|
97
97
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
98
98
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("ExpirationDateUpdated")], encode("uint40", Math.floor(Date.now() / 1000)));
|
|
99
99
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
100
100
|
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("MaxEnabledTokensUpdated")], encode("uint8", 14));
|
|
101
101
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
102
|
-
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("EmergencyLiquidatorAdded")], encode("address",
|
|
102
|
+
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("EmergencyLiquidatorAdded")], encode("address", sdk_gov_1.DUMB_ADDRESS));
|
|
103
103
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
104
|
-
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("EmergencyLiquidatorRemoved")], encode("address",
|
|
104
|
+
log = makeLog(CREDIT_CONFIGIURATOR_ADDRESS, [ccInterface.getEventTopic("EmergencyLiquidatorRemoved")], encode("address", sdk_gov_1.DUMB_ADDRESS));
|
|
105
105
|
(0, chai_1.expect)(creditManagerWatcher_1.CreditManagerWatcher.detectConfigChanges([log], [cmDumb])).to.be.eq(true);
|
|
106
106
|
});
|
|
107
107
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.2",
|
|
4
4
|
"description": "Gearbox SDK",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"test": "npx mocha -r ts-node/register -r dotenv/config src/**/*.spec.ts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@gearbox-protocol/sdk-gov": "^1.5.24",
|
|
30
31
|
"@types/deep-eql": "^4.0.0",
|
|
31
32
|
"axios": "^1.2.6",
|
|
32
33
|
"decimal.js-light": "^2.5.1",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare enum AdapterInterface {
|
|
2
|
-
ABSTRACT = 0,
|
|
3
|
-
UNISWAP_V2_ROUTER = 1,
|
|
4
|
-
UNISWAP_V3_ROUTER = 2,
|
|
5
|
-
CURVE_V1_EXCHANGE_ONLY = 3,
|
|
6
|
-
YEARN_V2 = 4,
|
|
7
|
-
CURVE_V1_2ASSETS = 5,
|
|
8
|
-
CURVE_V1_3ASSETS = 6,
|
|
9
|
-
CURVE_V1_4ASSETS = 7,
|
|
10
|
-
CURVE_V1_STECRV_POOL = 8,
|
|
11
|
-
CURVE_V1_WRAPPER = 9,
|
|
12
|
-
CONVEX_V1_BASE_REWARD_POOL = 10,
|
|
13
|
-
CONVEX_V1_BOOSTER = 11,
|
|
14
|
-
CONVEX_V1_CLAIM_ZAP = 12,
|
|
15
|
-
LIDO_V1 = 13,
|
|
16
|
-
UNIVERSAL = 14,
|
|
17
|
-
LIDO_WSTETH_V1 = 15,
|
|
18
|
-
BALANCER_VAULT = 16,
|
|
19
|
-
AAVE_V2_LENDING_POOL = 17,
|
|
20
|
-
AAVE_V2_WRAPPED_ATOKEN = 18,
|
|
21
|
-
COMPOUND_V2_CERC20 = 19,
|
|
22
|
-
COMPOUND_V2_CETHER = 20,
|
|
23
|
-
ERC4626_VAULT = 21
|
|
24
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdapterInterface = void 0;
|
|
4
|
-
var AdapterInterface;
|
|
5
|
-
(function (AdapterInterface) {
|
|
6
|
-
AdapterInterface[AdapterInterface["ABSTRACT"] = 0] = "ABSTRACT";
|
|
7
|
-
AdapterInterface[AdapterInterface["UNISWAP_V2_ROUTER"] = 1] = "UNISWAP_V2_ROUTER";
|
|
8
|
-
AdapterInterface[AdapterInterface["UNISWAP_V3_ROUTER"] = 2] = "UNISWAP_V3_ROUTER";
|
|
9
|
-
AdapterInterface[AdapterInterface["CURVE_V1_EXCHANGE_ONLY"] = 3] = "CURVE_V1_EXCHANGE_ONLY";
|
|
10
|
-
AdapterInterface[AdapterInterface["YEARN_V2"] = 4] = "YEARN_V2";
|
|
11
|
-
AdapterInterface[AdapterInterface["CURVE_V1_2ASSETS"] = 5] = "CURVE_V1_2ASSETS";
|
|
12
|
-
AdapterInterface[AdapterInterface["CURVE_V1_3ASSETS"] = 6] = "CURVE_V1_3ASSETS";
|
|
13
|
-
AdapterInterface[AdapterInterface["CURVE_V1_4ASSETS"] = 7] = "CURVE_V1_4ASSETS";
|
|
14
|
-
AdapterInterface[AdapterInterface["CURVE_V1_STECRV_POOL"] = 8] = "CURVE_V1_STECRV_POOL";
|
|
15
|
-
AdapterInterface[AdapterInterface["CURVE_V1_WRAPPER"] = 9] = "CURVE_V1_WRAPPER";
|
|
16
|
-
AdapterInterface[AdapterInterface["CONVEX_V1_BASE_REWARD_POOL"] = 10] = "CONVEX_V1_BASE_REWARD_POOL";
|
|
17
|
-
AdapterInterface[AdapterInterface["CONVEX_V1_BOOSTER"] = 11] = "CONVEX_V1_BOOSTER";
|
|
18
|
-
AdapterInterface[AdapterInterface["CONVEX_V1_CLAIM_ZAP"] = 12] = "CONVEX_V1_CLAIM_ZAP";
|
|
19
|
-
AdapterInterface[AdapterInterface["LIDO_V1"] = 13] = "LIDO_V1";
|
|
20
|
-
AdapterInterface[AdapterInterface["UNIVERSAL"] = 14] = "UNIVERSAL";
|
|
21
|
-
AdapterInterface[AdapterInterface["LIDO_WSTETH_V1"] = 15] = "LIDO_WSTETH_V1";
|
|
22
|
-
AdapterInterface[AdapterInterface["BALANCER_VAULT"] = 16] = "BALANCER_VAULT";
|
|
23
|
-
AdapterInterface[AdapterInterface["AAVE_V2_LENDING_POOL"] = 17] = "AAVE_V2_LENDING_POOL";
|
|
24
|
-
AdapterInterface[AdapterInterface["AAVE_V2_WRAPPED_ATOKEN"] = 18] = "AAVE_V2_WRAPPED_ATOKEN";
|
|
25
|
-
AdapterInterface[AdapterInterface["COMPOUND_V2_CERC20"] = 19] = "COMPOUND_V2_CERC20";
|
|
26
|
-
AdapterInterface[AdapterInterface["COMPOUND_V2_CETHER"] = 20] = "COMPOUND_V2_CETHER";
|
|
27
|
-
AdapterInterface[AdapterInterface["ERC4626_VAULT"] = 21] = "ERC4626_VAULT";
|
|
28
|
-
})(AdapterInterface = exports.AdapterInterface || (exports.AdapterInterface = {}));
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { NetworkType } from "../core/chains";
|
|
2
|
-
import { AaveV2LPToken } from "../tokens/aave";
|
|
3
|
-
import { ConvexStakedPhantomToken } from "../tokens/convex";
|
|
4
|
-
import type { CurveLPToken } from "../tokens/curveLP";
|
|
5
|
-
import { NormalToken } from "../tokens/normal";
|
|
6
|
-
import type { YearnLPToken } from "../tokens/yearn";
|
|
7
|
-
import { AdapterInterface } from "./adapters";
|
|
8
|
-
import { Protocols } from "./protocols";
|
|
9
|
-
export type UniswapV2Contract = "UNISWAP_V2_ROUTER" | "SUSHISWAP_ROUTER";
|
|
10
|
-
export type CurvePoolContract = "CURVE_3CRV_POOL" | "CURVE_FRAX_USDC_POOL" | "CURVE_STETH_GATEWAY" | "CURVE_FRAX_POOL" | "CURVE_LUSD_POOL" | "CURVE_GUSD_POOL" | "CURVE_SUSD_POOL" | "CURVE_SUSD_DEPOSIT" | "CURVE_OHMFRAXBP_POOL" | "CURVE_CRVETH_POOL" | "CURVE_CVXETH_POOL" | "CURVE_3CRYPTO_POOL" | "CURVE_MIM_POOL" | "CURVE_LDOETH_POOL" | "CURVE_CRVUSD_USDC_POOL" | "CURVE_CRVUSD_USDT_POOL" | "CURVE_CRVUSD_FRAX_POOL" | "CURVE_TRI_CRV_POOL";
|
|
11
|
-
export type YearnVaultContract = "YEARN_DAI_VAULT" | "YEARN_USDC_VAULT" | "YEARN_WETH_VAULT" | "YEARN_WBTC_VAULT" | "YEARN_CURVE_FRAX_VAULT" | "YEARN_CURVE_STETH_VAULT";
|
|
12
|
-
export type ConvexPoolContract = "CONVEX_3CRV_POOL" | "CONVEX_FRAX_USDC_POOL" | "CONVEX_GUSD_POOL" | "CONVEX_SUSD_POOL" | "CONVEX_STECRV_POOL" | "CONVEX_FRAX3CRV_POOL" | "CONVEX_LUSD3CRV_POOL" | "CONVEX_OHMFRAXBP_POOL" | "CONVEX_MIM3CRV_POOL" | "CONVEX_CRVETH_POOL" | "CONVEX_CVXETH_POOL" | "CONVEX_3CRYPTO_POOL" | "CONVEX_LDOETH_POOL";
|
|
13
|
-
export type AaveV2PoolContract = "AAVE_V2_DAI_POOL" | "AAVE_V2_USDC_POOL" | "AAVE_V2_USDT_POOL" | "AAVE_V2_WETH_POOL";
|
|
14
|
-
export type AaveV2TokenWrapperContract = "AAVE_V2_DAI_TOKEN_WRAPPER" | "AAVE_V2_USDC_TOKEN_WRAPPER" | "AAVE_V2_USDT_TOKEN_WRAPPER" | "AAVE_V2_WETH_TOKEN_WRAPPER";
|
|
15
|
-
export type CompoundV2PoolContract = "COMPOUND_V2_DAI_POOL" | "COMPOUND_V2_USDC_POOL" | "COMPOUND_V2_USDT_POOL" | "COMPOUND_V2_ETH_POOL" | "COMPOUND_V2_LINK_POOL";
|
|
16
|
-
export type SupportedContract = UniswapV2Contract | "UNISWAP_V3_ROUTER" | CurvePoolContract | "CURVE_GEAR_POOL" | YearnVaultContract | "CONVEX_BOOSTER" | ConvexPoolContract | "CONVEX_CLAIM_ZAP" | "LIDO_STETH_GATEWAY" | "LIDO_WSTETH" | "UNIVERSAL_ADAPTER" | "BALANCER_VAULT" | AaveV2PoolContract | AaveV2TokenWrapperContract | CompoundV2PoolContract;
|
|
17
|
-
export declare const contractsByNetwork: Record<NetworkType, Record<SupportedContract, string>>;
|
|
18
|
-
export declare const UNISWAP_V3_QUOTER = "NOT DEPLOYED";
|
|
19
|
-
export interface BaseContractParams {
|
|
20
|
-
name: string;
|
|
21
|
-
}
|
|
22
|
-
type UniswapV2Params = {
|
|
23
|
-
protocol: Protocols.Uniswap | Protocols.Sushiswap;
|
|
24
|
-
type: AdapterInterface.UNISWAP_V2_ROUTER;
|
|
25
|
-
} & BaseContractParams;
|
|
26
|
-
type UniswapV3Params = {
|
|
27
|
-
protocol: Protocols.Uniswap;
|
|
28
|
-
type: AdapterInterface.UNISWAP_V3_ROUTER;
|
|
29
|
-
quoter: string;
|
|
30
|
-
} & BaseContractParams;
|
|
31
|
-
export type CurveParams = {
|
|
32
|
-
protocol: Protocols.Curve;
|
|
33
|
-
type: AdapterInterface.CURVE_V1_2ASSETS | AdapterInterface.CURVE_V1_3ASSETS | AdapterInterface.CURVE_V1_4ASSETS | AdapterInterface.CURVE_V1_WRAPPER;
|
|
34
|
-
version: number;
|
|
35
|
-
lpToken: CurveLPToken;
|
|
36
|
-
tokens: Array<NormalToken | CurveLPToken>;
|
|
37
|
-
underlyings?: Array<NormalToken>;
|
|
38
|
-
wrapper?: CurvePoolContract;
|
|
39
|
-
} & BaseContractParams;
|
|
40
|
-
export type CurveSteCRVPoolParams = {
|
|
41
|
-
protocol: Protocols.Curve;
|
|
42
|
-
type: AdapterInterface.CURVE_V1_STECRV_POOL;
|
|
43
|
-
version: number;
|
|
44
|
-
pool: Record<NetworkType, string>;
|
|
45
|
-
tokens: ["WETH", "STETH"];
|
|
46
|
-
lpToken: "steCRV";
|
|
47
|
-
} & BaseContractParams;
|
|
48
|
-
export type CurveGEARPoolParams = {
|
|
49
|
-
protocol: Protocols.Curve;
|
|
50
|
-
type: AdapterInterface.CURVE_V1_2ASSETS;
|
|
51
|
-
version: number;
|
|
52
|
-
pool: Record<NetworkType, string>;
|
|
53
|
-
tokens: ["GEAR", "WETH"];
|
|
54
|
-
lpToken: "GEAR";
|
|
55
|
-
} & BaseContractParams;
|
|
56
|
-
export type YearnParams = {
|
|
57
|
-
protocol: Protocols.Yearn;
|
|
58
|
-
type: AdapterInterface.YEARN_V2;
|
|
59
|
-
shareToken: YearnLPToken;
|
|
60
|
-
} & BaseContractParams;
|
|
61
|
-
type ConvexParams = {
|
|
62
|
-
protocol: Protocols.Convex;
|
|
63
|
-
type: AdapterInterface.CONVEX_V1_BOOSTER | AdapterInterface.CONVEX_V1_CLAIM_ZAP;
|
|
64
|
-
} & BaseContractParams;
|
|
65
|
-
interface ConvexExtraPoolParams {
|
|
66
|
-
rewardToken: NormalToken;
|
|
67
|
-
poolAddress: Record<NetworkType, string>;
|
|
68
|
-
}
|
|
69
|
-
export type ConvexPoolParams = {
|
|
70
|
-
protocol: Protocols.Convex;
|
|
71
|
-
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL;
|
|
72
|
-
stakedToken: ConvexStakedPhantomToken;
|
|
73
|
-
extraRewards: Array<ConvexExtraPoolParams>;
|
|
74
|
-
} & BaseContractParams;
|
|
75
|
-
export type LidoParams = {
|
|
76
|
-
protocol: Protocols.Lido;
|
|
77
|
-
type: AdapterInterface.LIDO_V1;
|
|
78
|
-
oracle: Record<NetworkType, string>;
|
|
79
|
-
lpToken: "steCRV";
|
|
80
|
-
} & BaseContractParams;
|
|
81
|
-
export type LidoWsthETHParams = {
|
|
82
|
-
protocol: Protocols.Lido;
|
|
83
|
-
type: AdapterInterface.LIDO_WSTETH_V1;
|
|
84
|
-
} & BaseContractParams;
|
|
85
|
-
export type UniversalParams = {
|
|
86
|
-
protocol: Protocols.Gearbox;
|
|
87
|
-
type: AdapterInterface.UNIVERSAL;
|
|
88
|
-
} & BaseContractParams;
|
|
89
|
-
export type BalancerParams = {
|
|
90
|
-
protocol: Protocols.Balancer;
|
|
91
|
-
type: AdapterInterface.BALANCER_VAULT;
|
|
92
|
-
} & BaseContractParams;
|
|
93
|
-
export type AaveV2Params = {
|
|
94
|
-
protocol: Protocols.AaveV2;
|
|
95
|
-
type: AdapterInterface.AAVE_V2_LENDING_POOL;
|
|
96
|
-
underlying: NormalToken;
|
|
97
|
-
} & BaseContractParams;
|
|
98
|
-
export type WrapperAaveV2Params = {
|
|
99
|
-
protocol: Protocols.AaveV2;
|
|
100
|
-
type: AdapterInterface.AAVE_V2_WRAPPED_ATOKEN;
|
|
101
|
-
underlying: AaveV2LPToken;
|
|
102
|
-
} & BaseContractParams;
|
|
103
|
-
export type CompoundV2Params = {
|
|
104
|
-
protocol: Protocols.CompoundV2;
|
|
105
|
-
type: AdapterInterface.COMPOUND_V2_CERC20 | AdapterInterface.COMPOUND_V2_CETHER;
|
|
106
|
-
underlying: NormalToken;
|
|
107
|
-
} & BaseContractParams;
|
|
108
|
-
export type ContractParams = UniswapV2Params | UniswapV3Params | CurveParams | CurveSteCRVPoolParams | CurveGEARPoolParams | YearnParams | ConvexParams | ConvexPoolParams | LidoParams | LidoWsthETHParams | UniversalParams | BalancerParams | AaveV2Params | WrapperAaveV2Params | CompoundV2Params;
|
|
109
|
-
export declare const contractParams: Record<SupportedContract, ContractParams>;
|
|
110
|
-
export declare const contractsByAddress: Record<string, SupportedContract>;
|
|
111
|
-
export declare const isSupportedContract: (t: unknown) => t is SupportedContract;
|
|
112
|
-
export {};
|