@gearbox-protocol/sdk 3.0.0-next.18 → 3.0.0-next.19
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/curveAPY.js +2 -1
- package/lib/core/events.js +14 -14
- package/lib/core/trade.js +1 -2
- package/lib/core/transactions.js +12 -13
- package/lib/parsers/abstractParser.js +1 -2
- package/lib/parsers/curveAdapterParser.js +2 -3
- package/lib/parsers/uniV2AdapterParser.js +2 -2
- package/lib/parsers/uniV3AdapterParser.js +3 -3
- package/lib/types/{IConvexV1BoosterAdapter.d.ts → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter.d.ts} +19 -4
- package/lib/types/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents.d.ts +43 -0
- package/lib/types/IConvexV1BoosterAdapter.sol/index.d.ts +2 -0
- package/lib/types/ICreditFacadeV3.sol/ICreditFacadeV3.d.ts +5 -5
- package/lib/types/ICreditFacadeV3.sol/ICreditFacadeV3Events.d.ts +4 -4
- package/lib/types/ICreditFacadeV3Multicall.d.ts +11 -11
- package/lib/types/IDaiLikePermit.d.ts +59 -0
- package/lib/types/{ILidoV1Adapter.sol/ILidoV1Adapter.d.ts → ILidoV1Adapter.d.ts} +5 -40
- package/lib/types/IPermit2.d.ts +130 -0
- package/lib/types/IPermit2.js +2 -0
- package/lib/types/IPoolV3.sol/IPoolV3.d.ts +2 -2
- package/lib/types/IWERC20Zapper.d.ts +1 -1
- package/lib/types/IWETH.d.ts +197 -0
- package/lib/types/IWETH.js +2 -0
- package/lib/types/IWETHZapper.d.ts +1 -1
- package/lib/types/{ILidoV1Adapter.sol/ILidoV1AdapterExceptions.d.ts → SafeERC20.d.ts} +4 -4
- package/lib/types/SafeERC20.js +2 -0
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents__factory.d.ts +23 -0
- package/lib/types/factories/{ILidoV1Adapter.sol/ILidoV1AdapterEvents__factory.js → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents__factory.js} +12 -6
- package/lib/types/factories/{IConvexV1BoosterAdapter__factory.d.ts → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter__factory.d.ts} +16 -1
- package/lib/types/factories/{IConvexV1BoosterAdapter__factory.js → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter__factory.js} +19 -0
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/index.d.ts +2 -0
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/index.js +10 -0
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3Events__factory.d.ts +2 -2
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3Events__factory.js +2 -2
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3__factory.d.ts +4 -4
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3__factory.js +4 -4
- package/lib/types/factories/ICreditFacadeV3Multicall__factory.d.ts +4 -4
- package/lib/types/factories/ICreditFacadeV3Multicall__factory.js +4 -4
- package/lib/types/factories/IDaiLikePermit__factory.d.ts +46 -0
- package/lib/types/factories/IDaiLikePermit__factory.js +67 -0
- package/lib/types/factories/{ILidoV1Adapter.sol/ILidoV1Adapter__factory.d.ts → ILidoV1Adapter__factory.d.ts} +1 -35
- package/lib/types/factories/{ILidoV1Adapter.sol/ILidoV1Adapter__factory.js → ILidoV1Adapter__factory.js} +0 -44
- package/lib/types/factories/IPermit2__factory.d.ts +113 -0
- package/lib/types/factories/IPermit2__factory.js +155 -0
- package/lib/types/factories/IPoolV3.sol/IPoolV3__factory.d.ts +4 -4
- package/lib/types/factories/IPoolV3.sol/IPoolV3__factory.js +4 -4
- package/lib/types/factories/IWERC20Zapper__factory.d.ts +2 -2
- package/lib/types/factories/IWERC20Zapper__factory.js +2 -2
- package/lib/types/factories/IWETHZapper__factory.d.ts +2 -2
- package/lib/types/factories/IWETHZapper__factory.js +2 -2
- package/lib/types/factories/IWETH__factory.d.ts +194 -0
- package/lib/types/factories/IWETH__factory.js +260 -0
- package/lib/types/factories/SafeERC20__factory.d.ts +49 -0
- package/lib/types/factories/SafeERC20__factory.js +77 -0
- package/lib/types/factories/index.d.ts +6 -2
- package/lib/types/factories/index.js +13 -5
- package/lib/types/index.d.ts +16 -10
- package/lib/types/index.js +14 -8
- package/lib/utils/formatter.d.ts +0 -3
- package/lib/utils/formatter.js +1 -67
- package/package.json +8 -7
- package/lib/types/ILidoV1Adapter.sol/ILidoV1AdapterEvents.d.ts +0 -39
- package/lib/types/ILidoV1Adapter.sol/index.d.ts +0 -3
- package/lib/types/factories/ILidoV1Adapter.sol/ILidoV1AdapterEvents__factory.d.ts +0 -18
- package/lib/types/factories/ILidoV1Adapter.sol/ILidoV1AdapterExceptions__factory.d.ts +0 -12
- package/lib/types/factories/ILidoV1Adapter.sol/ILidoV1AdapterExceptions__factory.js +0 -24
- package/lib/types/factories/ILidoV1Adapter.sol/index.d.ts +0 -3
- package/lib/types/factories/ILidoV1Adapter.sol/index.js +0 -12
- /package/lib/types/{IConvexV1BoosterAdapter.js → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter.js} +0 -0
- /package/lib/types/{ILidoV1Adapter.sol/ILidoV1Adapter.js → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents.js} +0 -0
- /package/lib/types/{ILidoV1Adapter.sol → IConvexV1BoosterAdapter.sol}/index.js +0 -0
- /package/lib/types/{ILidoV1Adapter.sol/ILidoV1AdapterEvents.js → IDaiLikePermit.js} +0 -0
- /package/lib/types/{ILidoV1Adapter.sol/ILidoV1AdapterExceptions.js → ILidoV1Adapter.js} +0 -0
package/lib/apy/curveAPY.js
CHANGED
|
@@ -25,7 +25,8 @@ const APY_DICTIONARY = {
|
|
|
25
25
|
crvUSDUSDC: "factory-crvusd-0",
|
|
26
26
|
crvUSDUSDT: "factory-crvusd-1",
|
|
27
27
|
crvUSDFRAX: "factory-crvusd-4",
|
|
28
|
-
crvUSDETHCRV: "factory-tricrypto-4",
|
|
28
|
+
crvUSDETHCRV: "factory-tricrypto-4",
|
|
29
|
+
rETH_f: "factory-crypto-210", // 0x0f3159811670c117c372428D4E69AC32325e4D0F
|
|
29
30
|
};
|
|
30
31
|
const CRV_APY_RESPONSE_DECIMALS = 100;
|
|
31
32
|
// const CRYPTO = "https://api.curve.fi/api/getPools/ethereum/crypto";
|
package/lib/core/events.js
CHANGED
|
@@ -124,7 +124,7 @@ class EventAddLiquidity extends eventOrTx_1.EVMEvent {
|
|
|
124
124
|
}
|
|
125
125
|
toString() {
|
|
126
126
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
127
|
-
return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)}: Deposit ${(0,
|
|
127
|
+
return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)}: Deposit ${(0, sdk_gov_1.formatBN)(this.amount, decimals)} ${symbol}`;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
exports.EventAddLiquidity = EventAddLiquidity;
|
|
@@ -142,7 +142,7 @@ class EventRemoveLiquidity extends eventOrTx_1.EVMEvent {
|
|
|
142
142
|
}
|
|
143
143
|
toString() {
|
|
144
144
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.dieselToken);
|
|
145
|
-
return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)}: withdraw ${(0,
|
|
145
|
+
return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)}: withdraw ${(0, sdk_gov_1.formatBN)(this.amount, decimals)} ${symbol}`;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
exports.EventRemoveLiquidity = EventRemoveLiquidity;
|
|
@@ -158,7 +158,7 @@ class EventOpenCreditAccount extends eventOrTx_1.EVMEvent {
|
|
|
158
158
|
}
|
|
159
159
|
toString() {
|
|
160
160
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
161
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: opened with debt ${(0,
|
|
161
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: opened with debt ${(0, sdk_gov_1.formatBN)(this.amount, decimals)} ${symbol}`;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
exports.EventOpenCreditAccount = EventOpenCreditAccount;
|
|
@@ -187,7 +187,7 @@ class EventLiquidateCreditAccount extends eventOrTx_1.EVMEvent {
|
|
|
187
187
|
}
|
|
188
188
|
toString() {
|
|
189
189
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
190
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: was liquidated. ${(0,
|
|
190
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: was liquidated. ${(0, sdk_gov_1.formatBN)(this.amount, decimals)} ${symbol} were paid back as remaining funds`;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
exports.EventLiquidateCreditAccount = EventLiquidateCreditAccount;
|
|
@@ -216,7 +216,7 @@ class EventAddCollateral extends eventOrTx_1.EVMEvent {
|
|
|
216
216
|
}
|
|
217
217
|
toString() {
|
|
218
218
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.addedToken);
|
|
219
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: added ${(0,
|
|
219
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: added ${(0, sdk_gov_1.formatBN)(this.amount, decimals)} ${symbol} as collateral`;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
exports.EventAddCollateral = EventAddCollateral;
|
|
@@ -232,7 +232,7 @@ class EventIncreaseBorrowAmount extends eventOrTx_1.EVMEvent {
|
|
|
232
232
|
}
|
|
233
233
|
toString() {
|
|
234
234
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
235
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: borrowed amount was increased for ${(0,
|
|
235
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: borrowed amount was increased for ${(0, sdk_gov_1.formatBN)(this.amount, decimals)} ${symbol}`;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
exports.EventIncreaseBorrowAmount = EventIncreaseBorrowAmount;
|
|
@@ -248,7 +248,7 @@ class EventDecreaseBorrowAmount extends eventOrTx_1.EVMEvent {
|
|
|
248
248
|
}
|
|
249
249
|
toString() {
|
|
250
250
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
251
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: borrowed amount was decreased for ${(0,
|
|
251
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: borrowed amount was decreased for ${(0, sdk_gov_1.formatBN)(this.amount, decimals)} ${symbol}`;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
exports.EventDecreaseBorrowAmount = EventDecreaseBorrowAmount;
|
|
@@ -288,10 +288,10 @@ class EventCMNewParameters extends eventOrTx_1.EVMEvent {
|
|
|
288
288
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
289
289
|
let msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: `;
|
|
290
290
|
if (this.minAmount !== this.prevMinAmount) {
|
|
291
|
-
msg += `min amount: ${(0,
|
|
291
|
+
msg += `min amount: ${(0, sdk_gov_1.formatBN)(this.prevMinAmount, decimals)} => ${(0, sdk_gov_1.formatBN)(this.minAmount, decimals)} ${symbol}, `;
|
|
292
292
|
}
|
|
293
293
|
if (this.maxAmount !== this.prevMaxAmount) {
|
|
294
|
-
msg += `max amount: ${(0,
|
|
294
|
+
msg += `max amount: ${(0, sdk_gov_1.formatBN)(this.prevMaxAmount, decimals)} => ${(0, sdk_gov_1.formatBN)(this.maxAmount, decimals)} ${symbol}, `;
|
|
295
295
|
}
|
|
296
296
|
if (this.maxLeverage !== this.prevMaxLeverage) {
|
|
297
297
|
msg += `max leverage: ${this.prevMaxLeverage / Number(sdk_gov_1.LEVERAGE_DECIMALS) + 1} => ${this.maxLeverage / Number(sdk_gov_1.LEVERAGE_DECIMALS) + 1}, `;
|
|
@@ -501,8 +501,8 @@ class EventNewExpectedLiquidityLimit extends eventOrTx_1.EVMEvent {
|
|
|
501
501
|
toString() {
|
|
502
502
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
503
503
|
return this.prevLimit === 0n
|
|
504
|
-
? `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: expected liquidity limit was set to ${(0,
|
|
505
|
-
: `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: expected liquidity limit was ${this.newLimit > this.prevLimit ? "increased" : "decreased"}: ${(0,
|
|
504
|
+
? `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: expected liquidity limit was set to ${(0, sdk_gov_1.formatBN)(this.newLimit, decimals)} ${symbol}`
|
|
505
|
+
: `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: expected liquidity limit was ${this.newLimit > this.prevLimit ? "increased" : "decreased"}: ${(0, sdk_gov_1.formatBN)(this.prevLimit, decimals)} ${symbol} => ${(0, sdk_gov_1.formatBN)(this.newLimit, decimals)} ${symbol}`;
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
exports.EventNewExpectedLiquidityLimit = EventNewExpectedLiquidityLimit;
|
|
@@ -680,10 +680,10 @@ class EventLimitsUpdated extends eventOrTx_1.EVMEvent {
|
|
|
680
680
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
681
681
|
let msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: `;
|
|
682
682
|
if (this.minBorrowedAmount !== this.prevMinBorrowedAmount) {
|
|
683
|
-
msg += `min amount: ${(0,
|
|
683
|
+
msg += `min amount: ${(0, sdk_gov_1.formatBN)(this.prevMinBorrowedAmount, decimals)} => ${(0, sdk_gov_1.formatBN)(this.minBorrowedAmount, decimals)} ${symbol}, `;
|
|
684
684
|
}
|
|
685
685
|
if (this.maxBorrowedAmount !== this.prevMaxBorrowedAmount) {
|
|
686
|
-
msg += `max amount: ${(0,
|
|
686
|
+
msg += `max amount: ${(0, sdk_gov_1.formatBN)(this.prevMaxBorrowedAmount, decimals)} => ${(0, sdk_gov_1.formatBN)(this.maxBorrowedAmount, decimals)} ${symbol}, `;
|
|
687
687
|
}
|
|
688
688
|
return msg.slice(0, msg.length - 2);
|
|
689
689
|
}
|
|
@@ -838,7 +838,7 @@ class EventLimitPerBlockUpdated extends eventOrTx_1.EVMEvent {
|
|
|
838
838
|
}
|
|
839
839
|
toString() {
|
|
840
840
|
const [symbol, decimals = 18] = (0, sdk_gov_1.extractTokenData)(this.token);
|
|
841
|
-
return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Limit Per Block Updated ${(0,
|
|
841
|
+
return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Limit Per Block Updated ${(0, sdk_gov_1.formatBN)(this.prevLimit, decimals)} => ${(0, sdk_gov_1.formatBN)(this.limit, decimals)} ${symbol}`;
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
844
|
exports.EventLimitPerBlockUpdated = EventLimitPerBlockUpdated;
|
package/lib/core/trade.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.Trade = void 0;
|
|
|
4
4
|
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
5
|
const txParser_1 = require("../parsers/txParser");
|
|
6
6
|
const core_1 = require("../pathfinder/core");
|
|
7
|
-
const formatter_1 = require("../utils/formatter");
|
|
8
7
|
class Trade {
|
|
9
8
|
helper;
|
|
10
9
|
tradePath;
|
|
@@ -38,7 +37,7 @@ class Trade {
|
|
|
38
37
|
throw new Error(`Unknown token: ${this.tokenTo}`);
|
|
39
38
|
const decimalsFrom = sdk_gov_1.decimals[symbolFrom];
|
|
40
39
|
const decimalsTo = sdk_gov_1.decimals[symbolTo];
|
|
41
|
-
return `${this.operationName} ${(0,
|
|
40
|
+
return `${this.operationName} ${(0, sdk_gov_1.formatBN)(this.sourceAmount, decimalsFrom)} ${symbolFrom} ⇒ ${(0, sdk_gov_1.formatBN)(this.expectedAmount, decimalsTo)} ${symbolTo} on ${this.helper.name}`;
|
|
42
41
|
}
|
|
43
42
|
static getTrades({ from, to, amount, results, creditManager, currentContracts, swapType, swapName, }) {
|
|
44
43
|
const trades = results.reduce((acc, tradePath) => {
|
package/lib/core/transactions.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TxUpdateQuota = exports.TxEnableTokens = exports.TxApprove = exports.TxCloseAccount = exports.TxRepayAccount = exports.TxClaimGearRewards = exports.TxClaimNFT = exports.TxClaimReward = exports.TxOpenMultitokenAccount = exports.TxOpenAccount = exports.TxDecreaseBorrowAmount = exports.TxIncreaseBorrowAmount = exports.TxAddCollateral = exports.TXSwap = exports.TxRemoveLiquidity = exports.TxAddLiquidity = exports.TxSerializer = void 0;
|
|
4
4
|
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
5
|
const contractsRegister_1 = require("../contracts/contractsRegister");
|
|
6
|
-
const formatter_1 = require("../utils/formatter");
|
|
7
6
|
const math_1 = require("../utils/math");
|
|
8
7
|
const eventOrTx_1 = require("./eventOrTx");
|
|
9
8
|
class TxSerializer {
|
|
@@ -70,7 +69,7 @@ class TxAddLiquidity extends eventOrTx_1.EVMTx {
|
|
|
70
69
|
}
|
|
71
70
|
toString() {
|
|
72
71
|
const [underlyingSymbol, underlyingDecimals] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
73
|
-
return `${(0, contractsRegister_1.getContractName)(this.pool)}: Deposit ${(0,
|
|
72
|
+
return `${(0, contractsRegister_1.getContractName)(this.pool)}: Deposit ${(0, sdk_gov_1.formatBN)(this.amount, underlyingDecimals || 18)} ${underlyingSymbol}`;
|
|
74
73
|
}
|
|
75
74
|
serialize() {
|
|
76
75
|
return {
|
|
@@ -97,7 +96,7 @@ class TxRemoveLiquidity extends eventOrTx_1.EVMTx {
|
|
|
97
96
|
}
|
|
98
97
|
toString() {
|
|
99
98
|
const [dSymbol, dDecimals] = (0, sdk_gov_1.extractTokenData)(this.dieselToken);
|
|
100
|
-
return `${(0, contractsRegister_1.getContractName)(this.pool)}: Withdraw ${(0,
|
|
99
|
+
return `${(0, contractsRegister_1.getContractName)(this.pool)}: Withdraw ${(0, sdk_gov_1.formatBN)(this.amount, dDecimals || 18)} ${dSymbol}`;
|
|
101
100
|
}
|
|
102
101
|
serialize() {
|
|
103
102
|
return {
|
|
@@ -134,10 +133,10 @@ class TXSwap extends eventOrTx_1.EVMTx {
|
|
|
134
133
|
let toPart = "";
|
|
135
134
|
if (this.tokenTo && this.amountTo) {
|
|
136
135
|
const [toSymbol, toDecimals] = (0, sdk_gov_1.extractTokenData)(this.tokenTo);
|
|
137
|
-
toPart = ` ⇒ ${(0,
|
|
136
|
+
toPart = ` ⇒ ${(0, sdk_gov_1.formatBN)(this.amountTo, toDecimals || 18)} ${toSymbol}`;
|
|
138
137
|
}
|
|
139
138
|
const [fromSymbol, fromDecimals] = (0, sdk_gov_1.extractTokenData)(this.tokenFrom);
|
|
140
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: ${this.operation} ${(0,
|
|
139
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: ${this.operation} ${(0, sdk_gov_1.formatBN)(this.amountFrom, fromDecimals || 18)} ${fromSymbol} ${toPart} on ${(0, contractsRegister_1.getContractName)(this.protocol)}`;
|
|
141
140
|
}
|
|
142
141
|
serialize() {
|
|
143
142
|
return {
|
|
@@ -164,7 +163,7 @@ class TxAddCollateral extends eventOrTx_1.EVMTx {
|
|
|
164
163
|
}
|
|
165
164
|
toString() {
|
|
166
165
|
const [addedSymbol, addedDecimals] = (0, sdk_gov_1.extractTokenData)(this.addedToken);
|
|
167
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Added ${(0,
|
|
166
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Added ${(0, sdk_gov_1.formatBN)(this.amount, addedDecimals || 18)} ${addedSymbol} as collateral`;
|
|
168
167
|
}
|
|
169
168
|
serialize() {
|
|
170
169
|
return {
|
|
@@ -191,7 +190,7 @@ class TxIncreaseBorrowAmount extends eventOrTx_1.EVMTx {
|
|
|
191
190
|
}
|
|
192
191
|
toString() {
|
|
193
192
|
const [tokenSymbol, tokenDecimals] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
194
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Borrowed amount was increased for ${(0,
|
|
193
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Borrowed amount was increased for ${(0, sdk_gov_1.formatBN)(this.amount, tokenDecimals || 18)} ${tokenSymbol}`;
|
|
195
194
|
}
|
|
196
195
|
serialize() {
|
|
197
196
|
return {
|
|
@@ -218,7 +217,7 @@ class TxDecreaseBorrowAmount extends eventOrTx_1.EVMTx {
|
|
|
218
217
|
}
|
|
219
218
|
toString() {
|
|
220
219
|
const [tokenSymbol, tokenDecimals] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
221
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Borrowed amount was decreased for ${(0,
|
|
220
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Borrowed amount was decreased for ${(0, sdk_gov_1.formatBN)(this.amount, tokenDecimals || 18)} ${tokenSymbol}`;
|
|
222
221
|
}
|
|
223
222
|
serialize() {
|
|
224
223
|
return {
|
|
@@ -247,8 +246,8 @@ class TxOpenAccount extends eventOrTx_1.EVMTx {
|
|
|
247
246
|
}
|
|
248
247
|
toString() {
|
|
249
248
|
const [tokenSymbol, tokenDecimals] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
250
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: opening ${(0,
|
|
251
|
-
${(0,
|
|
249
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: opening ${(0, sdk_gov_1.formatBN)(this.amount, tokenDecimals || 18)} ${tokenSymbol} x ${this.leverage.toFixed(2)} ⇒
|
|
250
|
+
${(0, sdk_gov_1.formatBN)((this.amount *
|
|
252
251
|
BigInt(Math.floor(this.leverage * Number(sdk_gov_1.LEVERAGE_DECIMALS)))) /
|
|
253
252
|
sdk_gov_1.LEVERAGE_DECIMALS, tokenDecimals || 18)} ${tokenSymbol}`;
|
|
254
253
|
}
|
|
@@ -285,7 +284,7 @@ class TxOpenMultitokenAccount extends eventOrTx_1.EVMTx {
|
|
|
285
284
|
return acc;
|
|
286
285
|
}, []);
|
|
287
286
|
const [symbol, underlyingDecimals] = (0, sdk_gov_1.extractTokenData)(this.underlyingToken);
|
|
288
|
-
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: opening. Borrowed amount: ${(0,
|
|
287
|
+
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: opening. Borrowed amount: ${(0, sdk_gov_1.formatBN)(this.borrowedAmount, underlyingDecimals || 18)} ${symbol}; assets: ${assetSymbols.join(", ")}`;
|
|
289
288
|
}
|
|
290
289
|
serialize() {
|
|
291
290
|
return {
|
|
@@ -356,7 +355,7 @@ class TxClaimGearRewards extends eventOrTx_1.EVMTx {
|
|
|
356
355
|
}
|
|
357
356
|
toString() {
|
|
358
357
|
const [symbol, decimals] = (0, sdk_gov_1.extractTokenData)(this.token);
|
|
359
|
-
return `GEAR Rewards claimed: ${(0,
|
|
358
|
+
return `GEAR Rewards claimed: ${(0, sdk_gov_1.formatBN)(this.amount, decimals || 18)} ${symbol} `;
|
|
360
359
|
}
|
|
361
360
|
serialize() {
|
|
362
361
|
return {
|
|
@@ -493,7 +492,7 @@ class TxUpdateQuota extends eventOrTx_1.EVMTx {
|
|
|
493
492
|
const quota = this.updatedQuotas.map(({ token, balance }) => {
|
|
494
493
|
const [tokenSymbol] = (0, sdk_gov_1.extractTokenData)(token);
|
|
495
494
|
const sign = balance < 0 ? "-" : "";
|
|
496
|
-
const amountString = (0,
|
|
495
|
+
const amountString = (0, sdk_gov_1.formatBN)(math_1.BigIntMath.abs(balance), underlyingDecimals || 18);
|
|
497
496
|
return `${tokenSymbol} by ${sign}${amountString}`;
|
|
498
497
|
});
|
|
499
498
|
return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)} quota updated: ${quota.join("; ")}`;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AbstractParser = void 0;
|
|
4
4
|
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
5
|
const ethers_1 = require("ethers");
|
|
6
|
-
const formatter_1 = require("../utils/formatter");
|
|
7
6
|
class AbstractParser {
|
|
8
7
|
contract;
|
|
9
8
|
ifc;
|
|
@@ -30,7 +29,7 @@ class AbstractParser {
|
|
|
30
29
|
return symbol;
|
|
31
30
|
}
|
|
32
31
|
formatBN(amount, token) {
|
|
33
|
-
return `${(0,
|
|
32
|
+
return `${(0, sdk_gov_1.formatBN)(amount, sdk_gov_1.decimals[token])} [${(0, sdk_gov_1.toBigInt)(amount).toString()}]`;
|
|
34
33
|
}
|
|
35
34
|
parseToObject(address, calldata) {
|
|
36
35
|
const { functionFragment } = this.parseSelector(calldata);
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CurveAdapterParser = void 0;
|
|
4
4
|
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
-
const formatter_1 = require("../utils/formatter");
|
|
7
6
|
const abstractParser_1 = require("./abstractParser");
|
|
8
7
|
class CurveAdapterParser extends abstractParser_1.AbstractParser {
|
|
9
8
|
lpToken;
|
|
@@ -54,7 +53,7 @@ class CurveAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
54
53
|
const jSym = functionFragment.name === "exchange_all_underlying"
|
|
55
54
|
? this.getUnderlyingTokenByIndex(j)
|
|
56
55
|
: this.getTokenByIndex(j);
|
|
57
|
-
return `${functionName}(i: ${iSym}, j: ${jSym}, rateMinRAY: ${(0,
|
|
56
|
+
return `${functionName}(i: ${iSym}, j: ${jSym}, rateMinRAY: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}`;
|
|
58
57
|
}
|
|
59
58
|
case "add_liquidity_one_coin": {
|
|
60
59
|
const [amount, i, minAmount] = this.decodeFunctionData(functionFragment, calldata);
|
|
@@ -64,7 +63,7 @@ class CurveAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
64
63
|
case "add_all_liquidity_one_coin":
|
|
65
64
|
case "remove_all_liquidity_one_coin": {
|
|
66
65
|
const [i, rateMinRAY] = this.decodeFunctionData(functionFragment, calldata);
|
|
67
|
-
return `${functionName}(i: ${this.getTokenByIndex(i)}, rateMinRAY: ${(0,
|
|
66
|
+
return `${functionName}(i: ${this.getTokenByIndex(i)}, rateMinRAY: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)})`;
|
|
68
67
|
}
|
|
69
68
|
case "add_liquidity": {
|
|
70
69
|
const [amounts, minAmount] = this.decodeFunctionData(functionFragment, calldata);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UniswapV2AdapterParser = void 0;
|
|
4
|
+
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
4
5
|
const types_1 = require("../types");
|
|
5
|
-
const formatter_1 = require("../utils/formatter");
|
|
6
6
|
const abstractParser_1 = require("./abstractParser");
|
|
7
7
|
class UniswapV2AdapterParser extends abstractParser_1.AbstractParser {
|
|
8
8
|
constructor(contract, isContract) {
|
|
@@ -41,7 +41,7 @@ class UniswapV2AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
41
41
|
}
|
|
42
42
|
case "swapAllTokensForTokens": {
|
|
43
43
|
const [rateMinRAY, path] = this.decodeFunctionData(functionFragment, calldata);
|
|
44
|
-
return `${functionName}(rate: ${(0,
|
|
44
|
+
return `${functionName}(rate: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}, path: [${path
|
|
45
45
|
.map(r => this.tokenSymbol(r))
|
|
46
46
|
.join(" => ")}])`;
|
|
47
47
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UniswapV3AdapterParser = void 0;
|
|
4
|
+
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
4
5
|
const types_1 = require("../types");
|
|
5
|
-
const formatter_1 = require("../utils/formatter");
|
|
6
6
|
const abstractParser_1 = require("./abstractParser");
|
|
7
7
|
class UniswapV3AdapterParser extends abstractParser_1.AbstractParser {
|
|
8
8
|
constructor(contract, isContract) {
|
|
@@ -26,7 +26,7 @@ class UniswapV3AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
26
26
|
const { params: { tokenIn, tokenOut, fee, rateMinRAY }, } = this.decodeFunctionData(functionFragment, calldata);
|
|
27
27
|
const tokenInSym = this.tokenSymbol(tokenIn);
|
|
28
28
|
const tokenOutSym = this.tokenSymbol(tokenOut);
|
|
29
|
-
return `${functionName}(rate: ${(0,
|
|
29
|
+
return `${functionName}(rate: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}, path: ${tokenInSym} ==(fee: ${fee})==> ${tokenOutSym})`;
|
|
30
30
|
}
|
|
31
31
|
case "exactInput": {
|
|
32
32
|
const { params: { amountIn, amountOutMinimum, path }, } = this.decodeFunctionData(functionFragment, calldata);
|
|
@@ -38,7 +38,7 @@ class UniswapV3AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
38
38
|
case "exactAllInput": {
|
|
39
39
|
const { params: { rateMinRAY, path }, } = this.decodeFunctionData(functionFragment, calldata);
|
|
40
40
|
const pathStr = this.trackInputPath(path);
|
|
41
|
-
return `${functionName}(rate: ${(0,
|
|
41
|
+
return `${functionName}(rate: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}, path: ${pathStr}`;
|
|
42
42
|
}
|
|
43
43
|
case "exactOutput": {
|
|
44
44
|
const { params: { amountInMaximum, amountOut, path }, } = this.decodeFunctionData(functionFragment, calldata);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers";
|
|
2
|
-
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
|
2
|
+
import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
|
|
3
3
|
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
-
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from "
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from "../common";
|
|
5
5
|
export interface IConvexV1BoosterAdapterInterface extends utils.Interface {
|
|
6
6
|
functions: {
|
|
7
7
|
"_gearboxAdapterType()": FunctionFragment;
|
|
@@ -43,8 +43,20 @@ export interface IConvexV1BoosterAdapterInterface extends utils.Interface {
|
|
|
43
43
|
decodeFunctionResult(functionFragment: "updateStakedPhantomTokensMap", data: BytesLike): Result;
|
|
44
44
|
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
|
|
45
45
|
decodeFunctionResult(functionFragment: "withdrawAll", data: BytesLike): Result;
|
|
46
|
-
events: {
|
|
46
|
+
events: {
|
|
47
|
+
"SetPidToPhantomToken(uint256,address)": EventFragment;
|
|
48
|
+
};
|
|
49
|
+
getEvent(nameOrSignatureOrTopic: "SetPidToPhantomToken"): EventFragment;
|
|
50
|
+
}
|
|
51
|
+
export interface SetPidToPhantomTokenEventObject {
|
|
52
|
+
pid: BigNumber;
|
|
53
|
+
phantomToken: string;
|
|
47
54
|
}
|
|
55
|
+
export type SetPidToPhantomTokenEvent = TypedEvent<[
|
|
56
|
+
BigNumber,
|
|
57
|
+
string
|
|
58
|
+
], SetPidToPhantomTokenEventObject>;
|
|
59
|
+
export type SetPidToPhantomTokenEventFilter = TypedEventFilter<SetPidToPhantomTokenEvent>;
|
|
48
60
|
export interface IConvexV1BoosterAdapter extends BaseContract {
|
|
49
61
|
connect(signerOrProvider: Signer | Provider | string): this;
|
|
50
62
|
attach(addressOrName: string): this;
|
|
@@ -140,7 +152,10 @@ export interface IConvexV1BoosterAdapter extends BaseContract {
|
|
|
140
152
|
tokensToDisable: BigNumber;
|
|
141
153
|
}>;
|
|
142
154
|
};
|
|
143
|
-
filters: {
|
|
155
|
+
filters: {
|
|
156
|
+
"SetPidToPhantomToken(uint256,address)"(pid?: PromiseOrValue<BigNumberish> | null, phantomToken?: PromiseOrValue<string> | null): SetPidToPhantomTokenEventFilter;
|
|
157
|
+
SetPidToPhantomToken(pid?: PromiseOrValue<BigNumberish> | null, phantomToken?: PromiseOrValue<string> | null): SetPidToPhantomTokenEventFilter;
|
|
158
|
+
};
|
|
144
159
|
estimateGas: {
|
|
145
160
|
_gearboxAdapterType(overrides?: CallOverrides): Promise<BigNumber>;
|
|
146
161
|
_gearboxAdapterVersion(overrides?: CallOverrides): Promise<BigNumber>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BaseContract, BigNumber, BigNumberish, Signer, utils } from "ethers";
|
|
2
|
+
import type { EventFragment } from "@ethersproject/abi";
|
|
3
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from "../common";
|
|
5
|
+
export interface IConvexV1BoosterAdapterEventsInterface extends utils.Interface {
|
|
6
|
+
functions: {};
|
|
7
|
+
events: {
|
|
8
|
+
"SetPidToPhantomToken(uint256,address)": EventFragment;
|
|
9
|
+
};
|
|
10
|
+
getEvent(nameOrSignatureOrTopic: "SetPidToPhantomToken"): EventFragment;
|
|
11
|
+
}
|
|
12
|
+
export interface SetPidToPhantomTokenEventObject {
|
|
13
|
+
pid: BigNumber;
|
|
14
|
+
phantomToken: string;
|
|
15
|
+
}
|
|
16
|
+
export type SetPidToPhantomTokenEvent = TypedEvent<[
|
|
17
|
+
BigNumber,
|
|
18
|
+
string
|
|
19
|
+
], SetPidToPhantomTokenEventObject>;
|
|
20
|
+
export type SetPidToPhantomTokenEventFilter = TypedEventFilter<SetPidToPhantomTokenEvent>;
|
|
21
|
+
export interface IConvexV1BoosterAdapterEvents extends BaseContract {
|
|
22
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
23
|
+
attach(addressOrName: string): this;
|
|
24
|
+
deployed(): Promise<this>;
|
|
25
|
+
interface: IConvexV1BoosterAdapterEventsInterface;
|
|
26
|
+
queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
|
|
27
|
+
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
|
|
28
|
+
listeners(eventName?: string): Array<Listener>;
|
|
29
|
+
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
|
|
30
|
+
removeAllListeners(eventName?: string): this;
|
|
31
|
+
off: OnEvent<this>;
|
|
32
|
+
on: OnEvent<this>;
|
|
33
|
+
once: OnEvent<this>;
|
|
34
|
+
removeListener: OnEvent<this>;
|
|
35
|
+
functions: {};
|
|
36
|
+
callStatic: {};
|
|
37
|
+
filters: {
|
|
38
|
+
"SetPidToPhantomToken(uint256,address)"(pid?: PromiseOrValue<BigNumberish> | null, phantomToken?: PromiseOrValue<string> | null): SetPidToPhantomTokenEventFilter;
|
|
39
|
+
SetPidToPhantomToken(pid?: PromiseOrValue<BigNumberish> | null, phantomToken?: PromiseOrValue<string> | null): SetPidToPhantomTokenEventFilter;
|
|
40
|
+
};
|
|
41
|
+
estimateGas: {};
|
|
42
|
+
populateTransaction: {};
|
|
43
|
+
}
|
|
@@ -29,7 +29,7 @@ export interface ICreditFacadeV3Interface extends utils.Interface {
|
|
|
29
29
|
"maxDebtPerBlockMultiplier()": FunctionFragment;
|
|
30
30
|
"maxQuotaMultiplier()": FunctionFragment;
|
|
31
31
|
"multicall(address,(address,bytes)[])": FunctionFragment;
|
|
32
|
-
"openCreditAccount(address,(address,bytes)[],
|
|
32
|
+
"openCreditAccount(address,(address,bytes)[],uint256)": FunctionFragment;
|
|
33
33
|
"setBotList(address)": FunctionFragment;
|
|
34
34
|
"setBotPermissions(address,address,uint192,uint72,uint72)": FunctionFragment;
|
|
35
35
|
"setCumulativeLossParams(uint128,bool)": FunctionFragment;
|
|
@@ -132,7 +132,7 @@ export interface ICreditFacadeV3Interface extends utils.Interface {
|
|
|
132
132
|
"FinishMultiCall()": EventFragment;
|
|
133
133
|
"IncreaseDebt(address,uint256)": EventFragment;
|
|
134
134
|
"LiquidateCreditAccount(address,address,address,address,uint8,uint256)": EventFragment;
|
|
135
|
-
"OpenCreditAccount(address,address,address,
|
|
135
|
+
"OpenCreditAccount(address,address,address,uint256)": EventFragment;
|
|
136
136
|
"SetEnabledTokensMask(address,uint256)": EventFragment;
|
|
137
137
|
"StartMultiCall(address,address)": EventFragment;
|
|
138
138
|
};
|
|
@@ -218,13 +218,13 @@ export interface OpenCreditAccountEventObject {
|
|
|
218
218
|
creditAccount: string;
|
|
219
219
|
onBehalfOf: string;
|
|
220
220
|
caller: string;
|
|
221
|
-
referralCode:
|
|
221
|
+
referralCode: BigNumber;
|
|
222
222
|
}
|
|
223
223
|
export type OpenCreditAccountEvent = TypedEvent<[
|
|
224
224
|
string,
|
|
225
225
|
string,
|
|
226
226
|
string,
|
|
227
|
-
|
|
227
|
+
BigNumber
|
|
228
228
|
], OpenCreditAccountEventObject>;
|
|
229
229
|
export type OpenCreditAccountEventFilter = TypedEventFilter<OpenCreditAccountEvent>;
|
|
230
230
|
export interface SetEnabledTokensMaskEventObject {
|
|
@@ -450,7 +450,7 @@ export interface ICreditFacadeV3 extends BaseContract {
|
|
|
450
450
|
IncreaseDebt(creditAccount?: PromiseOrValue<string> | null, amount?: null): IncreaseDebtEventFilter;
|
|
451
451
|
"LiquidateCreditAccount(address,address,address,address,uint8,uint256)"(creditAccount?: PromiseOrValue<string> | null, borrower?: PromiseOrValue<string> | null, liquidator?: PromiseOrValue<string> | null, to?: null, closureAction?: null, remainingFunds?: null): LiquidateCreditAccountEventFilter;
|
|
452
452
|
LiquidateCreditAccount(creditAccount?: PromiseOrValue<string> | null, borrower?: PromiseOrValue<string> | null, liquidator?: PromiseOrValue<string> | null, to?: null, closureAction?: null, remainingFunds?: null): LiquidateCreditAccountEventFilter;
|
|
453
|
-
"OpenCreditAccount(address,address,address,
|
|
453
|
+
"OpenCreditAccount(address,address,address,uint256)"(creditAccount?: PromiseOrValue<string> | null, onBehalfOf?: PromiseOrValue<string> | null, caller?: PromiseOrValue<string> | null, referralCode?: null): OpenCreditAccountEventFilter;
|
|
454
454
|
OpenCreditAccount(creditAccount?: PromiseOrValue<string> | null, onBehalfOf?: PromiseOrValue<string> | null, caller?: PromiseOrValue<string> | null, referralCode?: null): OpenCreditAccountEventFilter;
|
|
455
455
|
"SetEnabledTokensMask(address,uint256)"(creditAccount?: PromiseOrValue<string> | null, enabledTokensMask?: null): SetEnabledTokensMaskEventFilter;
|
|
456
456
|
SetEnabledTokensMask(creditAccount?: PromiseOrValue<string> | null, enabledTokensMask?: null): SetEnabledTokensMaskEventFilter;
|
|
@@ -12,7 +12,7 @@ export interface ICreditFacadeV3EventsInterface extends utils.Interface {
|
|
|
12
12
|
"FinishMultiCall()": EventFragment;
|
|
13
13
|
"IncreaseDebt(address,uint256)": EventFragment;
|
|
14
14
|
"LiquidateCreditAccount(address,address,address,address,uint8,uint256)": EventFragment;
|
|
15
|
-
"OpenCreditAccount(address,address,address,
|
|
15
|
+
"OpenCreditAccount(address,address,address,uint256)": EventFragment;
|
|
16
16
|
"SetEnabledTokensMask(address,uint256)": EventFragment;
|
|
17
17
|
"StartMultiCall(address,address)": EventFragment;
|
|
18
18
|
};
|
|
@@ -98,13 +98,13 @@ export interface OpenCreditAccountEventObject {
|
|
|
98
98
|
creditAccount: string;
|
|
99
99
|
onBehalfOf: string;
|
|
100
100
|
caller: string;
|
|
101
|
-
referralCode:
|
|
101
|
+
referralCode: BigNumber;
|
|
102
102
|
}
|
|
103
103
|
export type OpenCreditAccountEvent = TypedEvent<[
|
|
104
104
|
string,
|
|
105
105
|
string,
|
|
106
106
|
string,
|
|
107
|
-
|
|
107
|
+
BigNumber
|
|
108
108
|
], OpenCreditAccountEventObject>;
|
|
109
109
|
export type OpenCreditAccountEventFilter = TypedEventFilter<OpenCreditAccountEvent>;
|
|
110
110
|
export interface SetEnabledTokensMaskEventObject {
|
|
@@ -156,7 +156,7 @@ export interface ICreditFacadeV3Events extends BaseContract {
|
|
|
156
156
|
IncreaseDebt(creditAccount?: PromiseOrValue<string> | null, amount?: null): IncreaseDebtEventFilter;
|
|
157
157
|
"LiquidateCreditAccount(address,address,address,address,uint8,uint256)"(creditAccount?: PromiseOrValue<string> | null, borrower?: PromiseOrValue<string> | null, liquidator?: PromiseOrValue<string> | null, to?: null, closureAction?: null, remainingFunds?: null): LiquidateCreditAccountEventFilter;
|
|
158
158
|
LiquidateCreditAccount(creditAccount?: PromiseOrValue<string> | null, borrower?: PromiseOrValue<string> | null, liquidator?: PromiseOrValue<string> | null, to?: null, closureAction?: null, remainingFunds?: null): LiquidateCreditAccountEventFilter;
|
|
159
|
-
"OpenCreditAccount(address,address,address,
|
|
159
|
+
"OpenCreditAccount(address,address,address,uint256)"(creditAccount?: PromiseOrValue<string> | null, onBehalfOf?: PromiseOrValue<string> | null, caller?: PromiseOrValue<string> | null, referralCode?: null): OpenCreditAccountEventFilter;
|
|
160
160
|
OpenCreditAccount(creditAccount?: PromiseOrValue<string> | null, onBehalfOf?: PromiseOrValue<string> | null, caller?: PromiseOrValue<string> | null, referralCode?: null): OpenCreditAccountEventFilter;
|
|
161
161
|
"SetEnabledTokensMask(address,uint256)"(creditAccount?: PromiseOrValue<string> | null, enabledTokensMask?: null): SetEnabledTokensMaskEventFilter;
|
|
162
162
|
SetEnabledTokensMask(creditAccount?: PromiseOrValue<string> | null, enabledTokensMask?: null): SetEnabledTokensMaskEventFilter;
|
|
@@ -2,13 +2,13 @@ import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, C
|
|
|
2
2
|
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
|
3
3
|
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
4
|
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from "./common";
|
|
5
|
-
export type
|
|
5
|
+
export type BalanceDeltaStruct = {
|
|
6
6
|
token: PromiseOrValue<string>;
|
|
7
|
-
|
|
7
|
+
amount: PromiseOrValue<BigNumberish>;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type BalanceDeltaStructOutput = [string, BigNumber] & {
|
|
10
10
|
token: string;
|
|
11
|
-
|
|
11
|
+
amount: BigNumber;
|
|
12
12
|
};
|
|
13
13
|
export type RevocationPairStruct = {
|
|
14
14
|
spender: PromiseOrValue<string>;
|
|
@@ -28,7 +28,7 @@ export interface ICreditFacadeV3MulticallInterface extends utils.Interface {
|
|
|
28
28
|
"increaseDebt(uint256)": FunctionFragment;
|
|
29
29
|
"onDemandPriceUpdate(address,bytes)": FunctionFragment;
|
|
30
30
|
"payBot(uint72)": FunctionFragment;
|
|
31
|
-
"revertIfReceivedLessThan((address,
|
|
31
|
+
"revertIfReceivedLessThan((address,int256)[])": FunctionFragment;
|
|
32
32
|
"revokeAdapterAllowances((address,address)[])": FunctionFragment;
|
|
33
33
|
"scheduleWithdrawal(address,uint256)": FunctionFragment;
|
|
34
34
|
"setFullCheckParams(uint256[],uint16)": FunctionFragment;
|
|
@@ -50,7 +50,7 @@ export interface ICreditFacadeV3MulticallInterface extends utils.Interface {
|
|
|
50
50
|
encodeFunctionData(functionFragment: "increaseDebt", values: [PromiseOrValue<BigNumberish>]): string;
|
|
51
51
|
encodeFunctionData(functionFragment: "onDemandPriceUpdate", values: [PromiseOrValue<string>, PromiseOrValue<BytesLike>]): string;
|
|
52
52
|
encodeFunctionData(functionFragment: "payBot", values: [PromiseOrValue<BigNumberish>]): string;
|
|
53
|
-
encodeFunctionData(functionFragment: "revertIfReceivedLessThan", values: [
|
|
53
|
+
encodeFunctionData(functionFragment: "revertIfReceivedLessThan", values: [BalanceDeltaStruct[]]): string;
|
|
54
54
|
encodeFunctionData(functionFragment: "revokeAdapterAllowances", values: [RevocationPairStruct[]]): string;
|
|
55
55
|
encodeFunctionData(functionFragment: "scheduleWithdrawal", values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]): string;
|
|
56
56
|
encodeFunctionData(functionFragment: "setFullCheckParams", values: [PromiseOrValue<BigNumberish>[], PromiseOrValue<BigNumberish>]): string;
|
|
@@ -113,7 +113,7 @@ export interface ICreditFacadeV3Multicall extends BaseContract {
|
|
|
113
113
|
payBot(paymentAmount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
|
|
114
114
|
from?: PromiseOrValue<string>;
|
|
115
115
|
}): Promise<ContractTransaction>;
|
|
116
|
-
revertIfReceivedLessThan(balanceDeltas:
|
|
116
|
+
revertIfReceivedLessThan(balanceDeltas: BalanceDeltaStruct[], overrides?: Overrides & {
|
|
117
117
|
from?: PromiseOrValue<string>;
|
|
118
118
|
}): Promise<ContractTransaction>;
|
|
119
119
|
revokeAdapterAllowances(revocations: RevocationPairStruct[], overrides?: Overrides & {
|
|
@@ -153,7 +153,7 @@ export interface ICreditFacadeV3Multicall extends BaseContract {
|
|
|
153
153
|
payBot(paymentAmount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
|
|
154
154
|
from?: PromiseOrValue<string>;
|
|
155
155
|
}): Promise<ContractTransaction>;
|
|
156
|
-
revertIfReceivedLessThan(balanceDeltas:
|
|
156
|
+
revertIfReceivedLessThan(balanceDeltas: BalanceDeltaStruct[], overrides?: Overrides & {
|
|
157
157
|
from?: PromiseOrValue<string>;
|
|
158
158
|
}): Promise<ContractTransaction>;
|
|
159
159
|
revokeAdapterAllowances(revocations: RevocationPairStruct[], overrides?: Overrides & {
|
|
@@ -177,7 +177,7 @@ export interface ICreditFacadeV3Multicall extends BaseContract {
|
|
|
177
177
|
increaseDebt(amount: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>;
|
|
178
178
|
onDemandPriceUpdate(token: PromiseOrValue<string>, data: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<void>;
|
|
179
179
|
payBot(paymentAmount: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>;
|
|
180
|
-
revertIfReceivedLessThan(balanceDeltas:
|
|
180
|
+
revertIfReceivedLessThan(balanceDeltas: BalanceDeltaStruct[], overrides?: CallOverrides): Promise<void>;
|
|
181
181
|
revokeAdapterAllowances(revocations: RevocationPairStruct[], overrides?: CallOverrides): Promise<void>;
|
|
182
182
|
scheduleWithdrawal(token: PromiseOrValue<string>, amount: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>;
|
|
183
183
|
setFullCheckParams(collateralHints: PromiseOrValue<BigNumberish>[], minHealthFactor: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>;
|
|
@@ -209,7 +209,7 @@ export interface ICreditFacadeV3Multicall extends BaseContract {
|
|
|
209
209
|
payBot(paymentAmount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
|
|
210
210
|
from?: PromiseOrValue<string>;
|
|
211
211
|
}): Promise<BigNumber>;
|
|
212
|
-
revertIfReceivedLessThan(balanceDeltas:
|
|
212
|
+
revertIfReceivedLessThan(balanceDeltas: BalanceDeltaStruct[], overrides?: Overrides & {
|
|
213
213
|
from?: PromiseOrValue<string>;
|
|
214
214
|
}): Promise<BigNumber>;
|
|
215
215
|
revokeAdapterAllowances(revocations: RevocationPairStruct[], overrides?: Overrides & {
|
|
@@ -250,7 +250,7 @@ export interface ICreditFacadeV3Multicall extends BaseContract {
|
|
|
250
250
|
payBot(paymentAmount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
|
|
251
251
|
from?: PromiseOrValue<string>;
|
|
252
252
|
}): Promise<PopulatedTransaction>;
|
|
253
|
-
revertIfReceivedLessThan(balanceDeltas:
|
|
253
|
+
revertIfReceivedLessThan(balanceDeltas: BalanceDeltaStruct[], overrides?: Overrides & {
|
|
254
254
|
from?: PromiseOrValue<string>;
|
|
255
255
|
}): Promise<PopulatedTransaction>;
|
|
256
256
|
revokeAdapterAllowances(revocations: RevocationPairStruct[], overrides?: Overrides & {
|