@defisaver/sdk 0.3.20 → 0.3.22
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/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Action = require("../../Action");
|
|
2
|
+
const { getAddr } = require('../../addresses.js');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Gets a flashloan from Euler using their low-level one token only flashloan option
|
|
6
|
+
*/
|
|
7
|
+
class EulerFlashLoanAction extends Action {
|
|
8
|
+
/**
|
|
9
|
+
* @param tokenAddr {EthAddress}
|
|
10
|
+
* @param amount {string}
|
|
11
|
+
* @param flParamGetterAddr {EthAddress}
|
|
12
|
+
* @param flParamGetterData {bytes}
|
|
13
|
+
*/
|
|
14
|
+
constructor(tokenAddr, amount, flParamGetterAddr = getAddr('Empty'), flParamGetterData= []) {
|
|
15
|
+
super(
|
|
16
|
+
'FLEuler',
|
|
17
|
+
getAddr('FLEuler'),
|
|
18
|
+
['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'],
|
|
19
|
+
[[tokenAddr], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = EulerFlashLoanAction;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const SendTokenAction = require("../basic/SendTokenAction");
|
|
2
|
+
const { getAddr } = require('../../addresses.js');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pays back a flashloan from Euler
|
|
6
|
+
*/
|
|
7
|
+
class EulerFlashLoanPaybackAction extends SendTokenAction {
|
|
8
|
+
/**
|
|
9
|
+
* @param loanAmount {string}
|
|
10
|
+
*/
|
|
11
|
+
constructor(loanAmount, tokenAddr) {
|
|
12
|
+
super(tokenAddr, getAddr('FLEuler'), loanAmount);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = EulerFlashLoanPaybackAction;
|
|
@@ -9,6 +9,9 @@ const MakerFlashLoanPaybackAction = require('./MakerFlashLoanPaybackAction');
|
|
|
9
9
|
const BalancerFlashLoanAction = require('./BalancerFlashLoanAction');
|
|
10
10
|
const BalancerFlashLoanPaybackAction = require('./BalancerFlashLoanPaybackAction');
|
|
11
11
|
|
|
12
|
+
const EulerFlashLoanAction = require('./EulerFlashLoanAction');
|
|
13
|
+
const EulerFlashLoanPaybackAction = require('./EulerFlashLoanPaybackAction')
|
|
14
|
+
|
|
12
15
|
module.exports = {
|
|
13
16
|
DyDxFlashLoanAction,
|
|
14
17
|
DyDxFlashLoanPaybackAction,
|
|
@@ -20,4 +23,6 @@ module.exports = {
|
|
|
20
23
|
MakerFlashLoanPaybackAction,
|
|
21
24
|
BalancerFlashLoanAction,
|
|
22
25
|
BalancerFlashLoanPaybackAction,
|
|
26
|
+
EulerFlashLoanPaybackAction,
|
|
27
|
+
EulerFlashLoanAction,
|
|
23
28
|
};
|
package/src/addresses.js
CHANGED
|
@@ -58,10 +58,10 @@ const actionAddresses = {
|
|
|
58
58
|
CompCollateralSwitch: '0xC3d89139508A3883775D3d1E62E2A0fea363b448',
|
|
59
59
|
|
|
60
60
|
// flashloan
|
|
61
|
-
FLAaveV2: '
|
|
61
|
+
FLAaveV2: '0xEA55576383C96A69B3E8beD51Ce0d0294001bc5F',
|
|
62
62
|
FLDyDx: '0x08AC78B418fCB0DDF1096533856A757C28d430d7',
|
|
63
|
-
FLMaker: '
|
|
64
|
-
FLBalancer: '
|
|
63
|
+
FLMaker: '0x672DE08e36A1698fD5e9E34045F81558dB4c1AFE',
|
|
64
|
+
FLBalancer: '0x540a83E36E5E6Aa916A6c591934d800e17115048',
|
|
65
65
|
|
|
66
66
|
// uniswap
|
|
67
67
|
UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
|
|
@@ -132,6 +132,9 @@ const actionAddresses = {
|
|
|
132
132
|
CurveDeposit: '0x160225c24300bD9fAA03Bc007D5e72bDbbcA9257',
|
|
133
133
|
CurveWithdraw: '0xA2A6D75417807ebAf8364613018D697f88021771',
|
|
134
134
|
|
|
135
|
+
// Euler
|
|
136
|
+
FLEuler: '0xaf591afeCbAa4026Be377AA3cF02dA366f18DE07',
|
|
137
|
+
|
|
135
138
|
TrailingStopTrigger: '0x0000000000000000000000000000000000000000',
|
|
136
139
|
|
|
137
140
|
// Convex
|
|
@@ -145,7 +148,7 @@ const actionAddresses = {
|
|
|
145
148
|
CompV3Claim: '0x4CEa369B63daAc0dA3423c5038a57483c5150986',
|
|
146
149
|
CompV3Payback: '0x6d14b9d69aADcb0d31a3e5d89fba75AB053fc9f0',
|
|
147
150
|
CompV3Supply: '0xAB53342d922Cc52b33486B92dC5dc361b7E4B436',
|
|
148
|
-
CompV3Transfer: '
|
|
151
|
+
CompV3Transfer: '0xeD7450e9C17146476137b77198DFfB17857906c4',
|
|
149
152
|
CompV3Withdraw: '0x59fED9975cd3bb07bB75490e86751D6025ce0bC2',
|
|
150
153
|
},
|
|
151
154
|
[NETWORKS.optimism.chainId]: {
|
|
@@ -167,12 +170,15 @@ const actionAddresses = {
|
|
|
167
170
|
AaveV3CollateralSwitch: '0x20D1388Ffa0A2D6ff6328AD014C67051542ca3a8',
|
|
168
171
|
AaveV3Payback: '0x88eb4050e89FecE4DF940109B0e58daF9B59e551',
|
|
169
172
|
AaveV3SetEMode: '0x7F264737066b9b7D9729Fe9715abB97423D8b35B',
|
|
170
|
-
AaveV3Supply: '
|
|
173
|
+
AaveV3Supply: '0x85C20f47B8dF7eD41b85cA613d9c4208CE00326B',
|
|
171
174
|
AaveV3SwapBorrowRateMode: '0xB8f0243b492f0e80feF5315Ba8692e7635481845',
|
|
172
175
|
AaveV3Withdraw: '0xf19d045f6cFc04A5Ee5E0e8837b565b9f276e3F7',
|
|
173
176
|
AaveV3ClaimRewards: '0xBE8e8cea67085F869C1C0040fD52F9F3115E962e',
|
|
174
177
|
|
|
175
|
-
|
|
178
|
+
// flashloan
|
|
179
|
+
FLAaveV3: '0xfbcF23D2BeF8A2C491cfa4dD409D8dF12d431c85',
|
|
180
|
+
FLBalancer: '0x79d6bf536b8DD65909a3174C87eA6395310d5c41',
|
|
181
|
+
|
|
176
182
|
AaveV3RatioTrigger: '0xB76e3f7694589D0f34ba43b17AD0D15350Ab5f85',
|
|
177
183
|
GasFeeTakerL2: '0xB3dB299622A9DB0E944ccda2Ef899d6fF365B082',
|
|
178
184
|
AaveV3RatioCheck: '0x7A36779a7b5F1128B28932604057d5b63361297c',
|
|
@@ -202,11 +208,14 @@ const actionAddresses = {
|
|
|
202
208
|
AaveV3CollateralSwitch: '0x7AcdD66C13f87b1cBcE7B106a8C34E426475BADd',
|
|
203
209
|
AaveV3Payback: '0xd88D5356e08dAd84E1576F89f4BF43C79a8BF0b2',
|
|
204
210
|
AaveV3SetEMode: '0x99D5068d9520316e8D3B5136c0B6EA33C5E0c27e',
|
|
205
|
-
AaveV3Supply: '
|
|
211
|
+
AaveV3Supply: '0x18a1e6775A4fF6F07C4b9aA46f82D13c593c17d2',
|
|
206
212
|
AaveV3SwapBorrowRateMode: '0x738042389A8d6B0F6D6ab009c42dfF84ebB737C0',
|
|
207
213
|
AaveV3Withdraw: '0xbf492F869DdB1A18BB4F41b6c3059D9f882Fe7ff',
|
|
208
214
|
|
|
209
|
-
|
|
215
|
+
// flashloan
|
|
216
|
+
FLAaveV3: '0x219ac6dA971dE6d943cffD1BD62abde71525d382',
|
|
217
|
+
FLBalancer: '0xdb28fE77709D88badC86868B27937428C3F48E73',
|
|
218
|
+
|
|
210
219
|
GasFeeTakerL2: '0x2F64f73B222B4978CAfd0295c0fa106cE5f34996',
|
|
211
220
|
AaveV3RatioCheck: '0x4a5c2cbCFB921b596Dec049389899CC8Eb4678ED',
|
|
212
221
|
|
|
@@ -259,7 +268,7 @@ const otherAddresses = {
|
|
|
259
268
|
DefisaverLogger: '0xE6f9A5C850dbcD12bc64f40d692F537250aDEC38',
|
|
260
269
|
Empty: '0x0000000000000000000000000000000000000000',
|
|
261
270
|
|
|
262
|
-
UniswapV3PositionManager
|
|
271
|
+
UniswapV3PositionManager: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',
|
|
263
272
|
},
|
|
264
273
|
};
|
|
265
274
|
|