@gearbox-protocol/sdk 1.16.2 → 1.16.4
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.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { NetworkType } from "../core/constants";
|
|
2
2
|
export declare const stEthPoolWrapper: Record<NetworkType, string>;
|
|
3
|
-
export declare const CREDIT_MANAGER_DAI_V2_MAINNET
|
|
4
|
-
export declare const CREDIT_MANAGER_USDC_V2_MAINNET
|
|
5
|
-
export declare const CREDIT_MANAGER_WETH_V2_MAINNET
|
|
6
|
-
export declare const CREDIT_MANAGER_WSTETH_V2_MAINNET
|
|
7
|
-
export declare const CREDIT_MANAGER_WBTC_V2_MAINNET
|
|
8
|
-
export declare const CREDIT_MANAGER_DAI_V2_GOERLI
|
|
9
|
-
export declare const CREDIT_MANAGER_USDC_V2_GOERLI
|
|
10
|
-
export declare const CREDIT_MANAGER_WETH_V2_GOERLI
|
|
11
|
-
export declare const CREDIT_MANAGER_WSTETH_V2_GOERLI
|
|
12
|
-
export declare const CREDIT_MANAGER_WBTC_V2_GOERLI
|
|
3
|
+
export declare const CREDIT_MANAGER_DAI_V2_MAINNET: string;
|
|
4
|
+
export declare const CREDIT_MANAGER_USDC_V2_MAINNET: string;
|
|
5
|
+
export declare const CREDIT_MANAGER_WETH_V2_MAINNET: string;
|
|
6
|
+
export declare const CREDIT_MANAGER_WSTETH_V2_MAINNET: string;
|
|
7
|
+
export declare const CREDIT_MANAGER_WBTC_V2_MAINNET: string;
|
|
8
|
+
export declare const CREDIT_MANAGER_DAI_V2_GOERLI: string;
|
|
9
|
+
export declare const CREDIT_MANAGER_USDC_V2_GOERLI: string;
|
|
10
|
+
export declare const CREDIT_MANAGER_WETH_V2_GOERLI: string;
|
|
11
|
+
export declare const CREDIT_MANAGER_WSTETH_V2_GOERLI: string;
|
|
12
|
+
export declare const CREDIT_MANAGER_WBTC_V2_GOERLI: string;
|
|
13
13
|
export declare type CreditManagersV2 = typeof CREDIT_MANAGER_DAI_V2_MAINNET | typeof CREDIT_MANAGER_USDC_V2_MAINNET | typeof CREDIT_MANAGER_WETH_V2_MAINNET | typeof CREDIT_MANAGER_WSTETH_V2_MAINNET | typeof CREDIT_MANAGER_WBTC_V2_MAINNET | typeof CREDIT_MANAGER_DAI_V2_GOERLI | typeof CREDIT_MANAGER_USDC_V2_GOERLI | typeof CREDIT_MANAGER_WETH_V2_GOERLI | typeof CREDIT_MANAGER_WSTETH_V2_GOERLI | typeof CREDIT_MANAGER_WBTC_V2_GOERLI;
|
|
14
14
|
export declare const deployedContracts: Record<string, string>;
|
|
15
15
|
export declare function getContractName(address: string): string;
|
|
@@ -20,17 +20,17 @@ exports.stEthPoolWrapper = {
|
|
|
20
20
|
Mainnet: "0x5a97e3E43dCBFe620ccF7865739075f92E93F5E4",
|
|
21
21
|
Goerli: "0x3fe62a62C022A069952069b32C9d56718D30B7ec",
|
|
22
22
|
};
|
|
23
|
-
exports.CREDIT_MANAGER_DAI_V2_MAINNET = "0x672461bfc20dd783444a830ad4c38b345ab6e2f7";
|
|
24
|
-
exports.CREDIT_MANAGER_USDC_V2_MAINNET = "0x95357303f995e184A7998dA6C6eA35cC728A1900";
|
|
25
|
-
exports.CREDIT_MANAGER_WETH_V2_MAINNET = "0x5887ad4cb2352e7f01527035faa3ae0ef2ce2b9b";
|
|
26
|
-
exports.CREDIT_MANAGER_WSTETH_V2_MAINNET = "0xe0bce4460795281d39c91da9b0275bca968293de";
|
|
27
|
-
exports.CREDIT_MANAGER_WBTC_V2_MAINNET = "0xc62bf8a7889adf1c5dc4665486c7683ae6e74e0f";
|
|
23
|
+
exports.CREDIT_MANAGER_DAI_V2_MAINNET = "0x672461bfc20dd783444a830ad4c38b345ab6e2f7".toLowerCase();
|
|
24
|
+
exports.CREDIT_MANAGER_USDC_V2_MAINNET = "0x95357303f995e184A7998dA6C6eA35cC728A1900".toLowerCase();
|
|
25
|
+
exports.CREDIT_MANAGER_WETH_V2_MAINNET = "0x5887ad4cb2352e7f01527035faa3ae0ef2ce2b9b".toLowerCase();
|
|
26
|
+
exports.CREDIT_MANAGER_WSTETH_V2_MAINNET = "0xe0bce4460795281d39c91da9b0275bca968293de".toLowerCase();
|
|
27
|
+
exports.CREDIT_MANAGER_WBTC_V2_MAINNET = "0xc62bf8a7889adf1c5dc4665486c7683ae6e74e0f".toLowerCase();
|
|
28
28
|
// GOERLI
|
|
29
|
-
exports.CREDIT_MANAGER_DAI_V2_GOERLI = "0xf7ba434952acaa2e12035a2c3643ca327914a470";
|
|
30
|
-
exports.CREDIT_MANAGER_USDC_V2_GOERLI = "0x2144a7785baecbab32295188285717cad6c1a11c";
|
|
31
|
-
exports.CREDIT_MANAGER_WETH_V2_GOERLI = "0x2ad4a2f1bdd815e285a22cdcc072fbb43818b09b";
|
|
32
|
-
exports.CREDIT_MANAGER_WSTETH_V2_GOERLI = "0x40d542a5c15b2c0c65af047984c285c2c30847af";
|
|
33
|
-
exports.CREDIT_MANAGER_WBTC_V2_GOERLI = "0x6546dd4e8d507e3e45bb924818c0bad2a3aa2c5f";
|
|
29
|
+
exports.CREDIT_MANAGER_DAI_V2_GOERLI = "0xf7ba434952acaa2e12035a2c3643ca327914a470".toLowerCase();
|
|
30
|
+
exports.CREDIT_MANAGER_USDC_V2_GOERLI = "0x2144a7785baecbab32295188285717cad6c1a11c".toLowerCase();
|
|
31
|
+
exports.CREDIT_MANAGER_WETH_V2_GOERLI = "0x2ad4a2f1bdd815e285a22cdcc072fbb43818b09b".toLowerCase();
|
|
32
|
+
exports.CREDIT_MANAGER_WSTETH_V2_GOERLI = "0x40d542a5c15b2c0c65af047984c285c2c30847af".toLowerCase();
|
|
33
|
+
exports.CREDIT_MANAGER_WBTC_V2_GOERLI = "0x6546dd4e8d507e3e45bb924818c0bad2a3aa2c5f".toLowerCase();
|
|
34
34
|
exports.deployedContracts = (_a = {
|
|
35
35
|
// MAINNET
|
|
36
36
|
"0x777E23A2AcB2fCbB35f6ccF98272d03C722Ba6EB": "DAI",
|
|
@@ -86,15 +86,15 @@ var CreditRewards = /** @class */ (function () {
|
|
|
86
86
|
query = _b.sent();
|
|
87
87
|
borrowedRange = {};
|
|
88
88
|
totalSupplyRange = new range_1.RangedValue();
|
|
89
|
-
rewardPerBlock = CreditRewards.getRewardsRange(creditManagerData.
|
|
89
|
+
rewardPerBlock = CreditRewards.getRewardsRange(creditManagerData.address);
|
|
90
90
|
borrowed = {};
|
|
91
91
|
totalBorrowed = ethers_1.BigNumber.from(0);
|
|
92
92
|
cfi = types_1.ICreditFacade__factory.connect(creditManagerData.creditFacade, provider).interface;
|
|
93
93
|
query.forEach(function (e) {
|
|
94
|
+
var event = cfi.parseLog(e);
|
|
94
95
|
switch (e.topics[0]) {
|
|
95
96
|
case cfi.getEventTopic("OpenCreditAccount"): {
|
|
96
|
-
var _a =
|
|
97
|
-
.args, onBehalfOf = _a.onBehalfOf, borrowAmount = _a.borrowAmount;
|
|
97
|
+
var _a = event.args, onBehalfOf = _a.onBehalfOf, borrowAmount = _a.borrowAmount;
|
|
98
98
|
totalBorrowed = totalBorrowed.add(borrowAmount);
|
|
99
99
|
borrowed[onBehalfOf] = borrowAmount;
|
|
100
100
|
if (!borrowedRange[onBehalfOf]) {
|
|
@@ -107,28 +107,29 @@ var CreditRewards = /** @class */ (function () {
|
|
|
107
107
|
case cfi.getEventTopic("LiquidateCreditAccount"):
|
|
108
108
|
case cfi.getEventTopic("LiquidateExpiredCreditAccount"): {
|
|
109
109
|
// We need { borrower} only so, we can use any event to get it from args
|
|
110
|
-
var borrower =
|
|
110
|
+
var borrower = event
|
|
111
|
+
.args.borrower;
|
|
111
112
|
totalBorrowed = totalBorrowed.sub(borrowed[borrower]);
|
|
112
113
|
borrowed[borrower] = ethers_1.BigNumber.from(0);
|
|
113
114
|
borrowedRange[borrower].addValue(e.blockNumber, ethers_1.BigNumber.from(0));
|
|
114
115
|
break;
|
|
115
116
|
}
|
|
116
117
|
case cfi.getEventTopic("IncreaseBorrowedAmount"): {
|
|
117
|
-
var _b =
|
|
118
|
+
var _b = event.args, borrower = _b.borrower, amount = _b.amount;
|
|
118
119
|
totalBorrowed = totalBorrowed.add(amount);
|
|
119
120
|
borrowed[borrower] = borrowed[borrower].add(amount);
|
|
120
121
|
borrowedRange[borrower].addValue(e.blockNumber, borrowed[borrower]);
|
|
121
122
|
break;
|
|
122
123
|
}
|
|
123
124
|
case cfi.getEventTopic("DecreaseBorrowedAmount"): {
|
|
124
|
-
var _c =
|
|
125
|
+
var _c = event.args, borrower = _c.borrower, amount = _c.amount;
|
|
125
126
|
totalBorrowed = totalBorrowed.sub(amount);
|
|
126
127
|
borrowed[borrower] = borrowed[borrower].sub(amount);
|
|
127
128
|
borrowedRange[borrower].addValue(e.blockNumber, borrowed[borrower]);
|
|
128
129
|
break;
|
|
129
130
|
}
|
|
130
131
|
case cfi.getEventTopic("TransferAccount"): {
|
|
131
|
-
var _d =
|
|
132
|
+
var _d = event.args, newOwner = _d.newOwner, oldOwner = _d.oldOwner;
|
|
132
133
|
borrowed[newOwner] = borrowed[oldOwner];
|
|
133
134
|
if (!borrowed[newOwner]) {
|
|
134
135
|
borrowedRange[newOwner] = new range_1.RangedValue();
|