@defisaver/sdk 1.2.9-dev-2-morpho → 1.2.9-dev-ether-fi
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/esm/src/actions/etherfi/EtherFiStakeAction.d.ts +20 -0
- package/esm/src/actions/etherfi/EtherFiStakeAction.js +41 -0
- package/esm/src/actions/etherfi/EtherFiUnwrapAction.d.ts +19 -0
- package/esm/src/actions/etherfi/EtherFiUnwrapAction.js +39 -0
- package/esm/src/actions/etherfi/EtherFiWrapAction.d.ts +19 -0
- package/esm/src/actions/etherfi/EtherFiWrapAction.js +39 -0
- package/esm/src/actions/etherfi/index.d.ts +3 -0
- package/esm/src/actions/etherfi/index.js +3 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/actions/morpho-blue/index.d.ts +0 -1
- package/esm/src/actions/morpho-blue/index.js +0 -1
- package/esm/src/addresses.d.ts +12 -4
- package/esm/src/addresses.js +5 -2
- package/esm/src/index.d.ts +48 -16
- package/package.json +1 -1
- package/src/actions/etherfi/EtherFiStakeAction.ts +38 -0
- package/src/actions/etherfi/EtherFiUnwrapAction.ts +31 -0
- package/src/actions/etherfi/EtherFiWrapAction.ts +36 -0
- package/src/actions/etherfi/index.ts +3 -0
- package/src/actions/index.ts +2 -0
- package/src/actions/morpho-blue/index.ts +1 -2
- package/src/addresses.ts +6 -2
- package/test/actions/etherFi/EtherFiStakeAction.js +66 -0
- package/test/actions/etherFi/EtherFiUnwrapAction.js +35 -0
- package/test/actions/etherFi/EtherFiWrapAction.js +35 -0
- package/umd/index.js +287 -153
- package/esm/src/actions/morpho-blue/MorphoTokenWrapAction.d.ts +0 -14
- package/esm/src/actions/morpho-blue/MorphoTokenWrapAction.js +0 -20
- package/src/actions/morpho-blue/MorphoTokenWrapAction.ts +0 -23
- package/test/actions/morpho-blue/MorphoTokenWrapAction.js +0 -37
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* EtherFiStakeAction - Receives WETH, transforms it to ETH then sends it to EtherFi staking contract receiving eETH in return or weETH if wrapping is enabled
|
|
5
|
+
*
|
|
6
|
+
* @category EtherFi
|
|
7
|
+
*/
|
|
8
|
+
export declare class EtherFiStakeAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param amount - amount of WETH to pull
|
|
11
|
+
* @param from - address from which to pull WETH from
|
|
12
|
+
* @param to - address where received eETH will be sent to
|
|
13
|
+
* @param shouldWrap - true if received eETH should be wrapped to weETH
|
|
14
|
+
*/
|
|
15
|
+
constructor(amount: uint256, from: EthAddress, to: EthAddress, shouldWrap: boolean);
|
|
16
|
+
getAssetsToApprove(): Promise<{
|
|
17
|
+
asset: string;
|
|
18
|
+
owner: any;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
import { requireAddress } from '../../utils/general';
|
|
14
|
+
/**
|
|
15
|
+
* EtherFiStakeAction - Receives WETH, transforms it to ETH then sends it to EtherFi staking contract receiving eETH in return or weETH if wrapping is enabled
|
|
16
|
+
*
|
|
17
|
+
* @category EtherFi
|
|
18
|
+
*/
|
|
19
|
+
export class EtherFiStakeAction extends Action {
|
|
20
|
+
/**
|
|
21
|
+
* @param amount - amount of WETH to pull
|
|
22
|
+
* @param from - address from which to pull WETH from
|
|
23
|
+
* @param to - address where received eETH will be sent to
|
|
24
|
+
* @param shouldWrap - true if received eETH should be wrapped to weETH
|
|
25
|
+
*/
|
|
26
|
+
constructor(amount, from, to, shouldWrap) {
|
|
27
|
+
requireAddress(to);
|
|
28
|
+
super('EtherFiStake', getAddr('EtherFiStake'), ['uint256', 'address', 'address', 'bool'], [amount, from, to, shouldWrap]);
|
|
29
|
+
this.mappableArgs = [
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
32
|
+
this.args[2],
|
|
33
|
+
this.args[3],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
getAssetsToApprove() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return [{ asset: getAssetInfo('WETH').address, owner: this.args[1] }];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* EtherFiUnwrapAction - Unwrap weETH and receive eETH
|
|
5
|
+
*
|
|
6
|
+
* @category EtherFi
|
|
7
|
+
*/
|
|
8
|
+
export declare class EtherFiUnwrapAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param amount - amount of weETH to pull
|
|
11
|
+
* @param from - address from which to pull weETH from
|
|
12
|
+
* @param to - address where received eETH will be sent to
|
|
13
|
+
*/
|
|
14
|
+
constructor(amount: uint256, from: EthAddress, to: EthAddress);
|
|
15
|
+
getAssetsToApprove(): Promise<{
|
|
16
|
+
asset: string;
|
|
17
|
+
owner: any;
|
|
18
|
+
}[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
import { requireAddress } from '../../utils/general';
|
|
14
|
+
/**
|
|
15
|
+
* EtherFiUnwrapAction - Unwrap weETH and receive eETH
|
|
16
|
+
*
|
|
17
|
+
* @category EtherFi
|
|
18
|
+
*/
|
|
19
|
+
export class EtherFiUnwrapAction extends Action {
|
|
20
|
+
/**
|
|
21
|
+
* @param amount - amount of weETH to pull
|
|
22
|
+
* @param from - address from which to pull weETH from
|
|
23
|
+
* @param to - address where received eETH will be sent to
|
|
24
|
+
*/
|
|
25
|
+
constructor(amount, from, to) {
|
|
26
|
+
requireAddress(to);
|
|
27
|
+
super('EtherFiUnwrap', getAddr('EtherFiUnwrap'), ['uint256', 'address', 'address'], [amount, from, to]);
|
|
28
|
+
this.mappableArgs = [
|
|
29
|
+
this.args[0],
|
|
30
|
+
this.args[1],
|
|
31
|
+
this.args[2],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
getAssetsToApprove() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return [{ asset: getAssetInfo('weETH').address, owner: this.args[1] }];
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* EtherFiWrapAction - Wraps eETH into Wrapped eETH (weETH)
|
|
5
|
+
*
|
|
6
|
+
* @category EtherFi
|
|
7
|
+
*/
|
|
8
|
+
export declare class EtherFiWrapAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param amount - amount of eETH to pull
|
|
11
|
+
* @param from - address from which to pull eETH from
|
|
12
|
+
* @param to - address where received weETH will be sent to
|
|
13
|
+
*/
|
|
14
|
+
constructor(amount: uint256, from: EthAddress, to: EthAddress);
|
|
15
|
+
getAssetsToApprove(): Promise<{
|
|
16
|
+
asset: string;
|
|
17
|
+
owner: any;
|
|
18
|
+
}[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
import { requireAddress } from '../../utils/general';
|
|
14
|
+
/**
|
|
15
|
+
* EtherFiWrapAction - Wraps eETH into Wrapped eETH (weETH)
|
|
16
|
+
*
|
|
17
|
+
* @category EtherFi
|
|
18
|
+
*/
|
|
19
|
+
export class EtherFiWrapAction extends Action {
|
|
20
|
+
/**
|
|
21
|
+
* @param amount - amount of eETH to pull
|
|
22
|
+
* @param from - address from which to pull eETH from
|
|
23
|
+
* @param to - address where received weETH will be sent to
|
|
24
|
+
*/
|
|
25
|
+
constructor(amount, from, to) {
|
|
26
|
+
requireAddress(to);
|
|
27
|
+
super('EtherFiWrap', getAddr('EtherFiWrap'), ['uint256', 'address', 'address'], [amount, from, to]);
|
|
28
|
+
this.mappableArgs = [
|
|
29
|
+
this.args[0],
|
|
30
|
+
this.args[1],
|
|
31
|
+
this.args[2],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
getAssetsToApprove() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return [{ asset: getAssetInfo('eETH').address, owner: this.args[1] }];
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -32,4 +32,5 @@ import * as merkl from './merkl';
|
|
|
32
32
|
import * as eulerV2 from './eulerV2';
|
|
33
33
|
import * as sky from './sky';
|
|
34
34
|
import * as stkgho from './stkgho';
|
|
35
|
-
|
|
35
|
+
import * as etherfi from './etherfi';
|
|
36
|
+
export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, lsv, spark, curveusd, morphoblue, llamalend, merkl, eulerV2, sky, stkgho, etherfi, };
|
package/esm/src/actions/index.js
CHANGED
|
@@ -32,4 +32,5 @@ import * as merkl from './merkl';
|
|
|
32
32
|
import * as eulerV2 from './eulerV2';
|
|
33
33
|
import * as sky from './sky';
|
|
34
34
|
import * as stkgho from './stkgho';
|
|
35
|
-
|
|
35
|
+
import * as etherfi from './etherfi';
|
|
36
|
+
export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, lsv, spark, curveusd, morphoblue, llamalend, merkl, eulerV2, sky, stkgho, etherfi, };
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -203,7 +203,6 @@ export declare const actionAddresses: {
|
|
|
203
203
|
MorphoBluePayback: string;
|
|
204
204
|
MorphoBlueSetAuth: string;
|
|
205
205
|
MorphoBlueSetAuthWithSig: string;
|
|
206
|
-
MorphoTokenWrap: string;
|
|
207
206
|
LlamaLendCreate: string;
|
|
208
207
|
LlamaLendSupply: string;
|
|
209
208
|
LlamaLendBorrow: string;
|
|
@@ -222,6 +221,9 @@ export declare const actionAddresses: {
|
|
|
222
221
|
EulerV2CollateralSwitch: string;
|
|
223
222
|
EulerV2View: string;
|
|
224
223
|
MerklClaim: string;
|
|
224
|
+
EtherFiStake: string;
|
|
225
|
+
EtherFiWrap: string;
|
|
226
|
+
EtherFiUnwrap: string;
|
|
225
227
|
AaveV3DelegateCredit?: undefined;
|
|
226
228
|
AaveV3RatioTrigger?: undefined;
|
|
227
229
|
GasFeeTakerL2?: undefined;
|
|
@@ -434,7 +436,6 @@ export declare const actionAddresses: {
|
|
|
434
436
|
MorphoBluePayback?: undefined;
|
|
435
437
|
MorphoBlueSetAuth?: undefined;
|
|
436
438
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
437
|
-
MorphoTokenWrap?: undefined;
|
|
438
439
|
LlamaLendCreate?: undefined;
|
|
439
440
|
LlamaLendSupply?: undefined;
|
|
440
441
|
LlamaLendBorrow?: undefined;
|
|
@@ -453,6 +454,9 @@ export declare const actionAddresses: {
|
|
|
453
454
|
EulerV2CollateralSwitch?: undefined;
|
|
454
455
|
EulerV2View?: undefined;
|
|
455
456
|
MerklClaim?: undefined;
|
|
457
|
+
EtherFiStake?: undefined;
|
|
458
|
+
EtherFiWrap?: undefined;
|
|
459
|
+
EtherFiUnwrap?: undefined;
|
|
456
460
|
MorphoBlueView?: undefined;
|
|
457
461
|
} | {
|
|
458
462
|
DFSSell: string;
|
|
@@ -670,7 +674,6 @@ export declare const actionAddresses: {
|
|
|
670
674
|
MorphoBluePayback?: undefined;
|
|
671
675
|
MorphoBlueSetAuth?: undefined;
|
|
672
676
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
673
|
-
MorphoTokenWrap?: undefined;
|
|
674
677
|
EulerV2Supply?: undefined;
|
|
675
678
|
EulerV2Withdraw?: undefined;
|
|
676
679
|
EulerV2Borrow?: undefined;
|
|
@@ -678,6 +681,9 @@ export declare const actionAddresses: {
|
|
|
678
681
|
EulerV2CollateralSwitch?: undefined;
|
|
679
682
|
EulerV2View?: undefined;
|
|
680
683
|
MerklClaim?: undefined;
|
|
684
|
+
EtherFiStake?: undefined;
|
|
685
|
+
EtherFiWrap?: undefined;
|
|
686
|
+
EtherFiUnwrap?: undefined;
|
|
681
687
|
AaveV3DelegateCredit?: undefined;
|
|
682
688
|
AaveV3RatioTrigger?: undefined;
|
|
683
689
|
MorphoBlueView?: undefined;
|
|
@@ -885,7 +891,6 @@ export declare const actionAddresses: {
|
|
|
885
891
|
CurveUsdGetDebt?: undefined;
|
|
886
892
|
CurveUsdCollRatioTrigger?: undefined;
|
|
887
893
|
CurveUsdCollRatioCheck?: undefined;
|
|
888
|
-
MorphoTokenWrap?: undefined;
|
|
889
894
|
LlamaLendCreate?: undefined;
|
|
890
895
|
LlamaLendSupply?: undefined;
|
|
891
896
|
LlamaLendBorrow?: undefined;
|
|
@@ -904,6 +909,9 @@ export declare const actionAddresses: {
|
|
|
904
909
|
EulerV2CollateralSwitch?: undefined;
|
|
905
910
|
EulerV2View?: undefined;
|
|
906
911
|
MerklClaim?: undefined;
|
|
912
|
+
EtherFiStake?: undefined;
|
|
913
|
+
EtherFiWrap?: undefined;
|
|
914
|
+
EtherFiUnwrap?: undefined;
|
|
907
915
|
AaveV3DelegateCredit?: undefined;
|
|
908
916
|
AaveV3RatioTrigger?: undefined;
|
|
909
917
|
GasFeeTakerL2?: undefined;
|
package/esm/src/addresses.js
CHANGED
|
@@ -80,7 +80,7 @@ export const actionAddresses = {
|
|
|
80
80
|
LSVBorrow: '0x7dFB434527Fdb39854156cDBa9bF4799E36E7e82',
|
|
81
81
|
LSVSupply: '0x984c00DC098c98bed1CDfe2Ed786Fe1443da6671',
|
|
82
82
|
LSVPayback: '0x10749CE97583dBcEb54a083386CC8438C4e0FE65',
|
|
83
|
-
LSVSell: '
|
|
83
|
+
LSVSell: '0x10B748Dc504C2515Bb6A9e23CB2F686090b6c584',
|
|
84
84
|
// morpho aave v2
|
|
85
85
|
MorphoAaveV2Borrow: '0xa85C3E41Bf9F75a381927e1Aa9b00f77C4631109',
|
|
86
86
|
MorphoAaveV2Payback: '0x5dd0E0835acbb08aa4A4599d70fB2d93969fa7b7',
|
|
@@ -234,7 +234,6 @@ export const actionAddresses = {
|
|
|
234
234
|
MorphoBluePayback: '0x9f437E5F705E02d77adC2e72C34926978776b085',
|
|
235
235
|
MorphoBlueSetAuth: '0xf30935e20c6357c7bcecd5e58ad6de26d54b9f64',
|
|
236
236
|
MorphoBlueSetAuthWithSig: '0xE2d5fCDBf73BAd24A0FCAf6B2733933A98021808',
|
|
237
|
-
MorphoTokenWrap: '0x10B748Dc504C2515Bb6A9e23CB2F686090b6c584',
|
|
238
237
|
// llamalend
|
|
239
238
|
LlamaLendCreate: '0x4349be191ea63173eD98b7fC1b0DeC1ef9Bc6c11',
|
|
240
239
|
LlamaLendSupply: '0x1900eF943bD1b038c58d9F35C3825F119F9BB730',
|
|
@@ -255,6 +254,10 @@ export const actionAddresses = {
|
|
|
255
254
|
EulerV2CollateralSwitch: '0x38950b50Fb38aC19D06e8CE5AAE632D6dF1EEb1a',
|
|
256
255
|
EulerV2View: '0x8932E46Ecf96b5Fe033F5e27Ab6dC755Cb668967',
|
|
257
256
|
MerklClaim: '0xE88036F3F0D7e216D63726356cA2bC334e305fe5',
|
|
257
|
+
// etherFi
|
|
258
|
+
EtherFiStake: '0x8D9cDA62DC7Bf75f687c6C8729ABB51ac82E20d5',
|
|
259
|
+
EtherFiWrap: '0x2b10B000292745099Deb15304A247c0816bd8b73',
|
|
260
|
+
EtherFiUnwrap: '0xDd5F7bf1009Edc3EE55AfcD70D417968bf4647C6',
|
|
258
261
|
},
|
|
259
262
|
[NETWORKS.optimism.chainId]: {
|
|
260
263
|
DFSSell: '0x9f234af5c10c136863a20865ba00b26951ab8269',
|
package/esm/src/index.d.ts
CHANGED
|
@@ -214,7 +214,6 @@ declare const actionAddressesAllChains: {
|
|
|
214
214
|
MorphoBluePayback: string;
|
|
215
215
|
MorphoBlueSetAuth: string;
|
|
216
216
|
MorphoBlueSetAuthWithSig: string;
|
|
217
|
-
MorphoTokenWrap: string;
|
|
218
217
|
LlamaLendCreate: string;
|
|
219
218
|
LlamaLendSupply: string;
|
|
220
219
|
LlamaLendBorrow: string;
|
|
@@ -233,6 +232,9 @@ declare const actionAddressesAllChains: {
|
|
|
233
232
|
EulerV2CollateralSwitch: string;
|
|
234
233
|
EulerV2View: string;
|
|
235
234
|
MerklClaim: string;
|
|
235
|
+
EtherFiStake: string;
|
|
236
|
+
EtherFiWrap: string;
|
|
237
|
+
EtherFiUnwrap: string;
|
|
236
238
|
AaveV3DelegateCredit?: undefined;
|
|
237
239
|
AaveV3RatioTrigger?: undefined;
|
|
238
240
|
GasFeeTakerL2?: undefined;
|
|
@@ -445,7 +447,6 @@ declare const actionAddressesAllChains: {
|
|
|
445
447
|
MorphoBluePayback?: undefined;
|
|
446
448
|
MorphoBlueSetAuth?: undefined;
|
|
447
449
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
448
|
-
MorphoTokenWrap?: undefined;
|
|
449
450
|
LlamaLendCreate?: undefined;
|
|
450
451
|
LlamaLendSupply?: undefined;
|
|
451
452
|
LlamaLendBorrow?: undefined;
|
|
@@ -464,6 +465,9 @@ declare const actionAddressesAllChains: {
|
|
|
464
465
|
EulerV2CollateralSwitch?: undefined;
|
|
465
466
|
EulerV2View?: undefined;
|
|
466
467
|
MerklClaim?: undefined;
|
|
468
|
+
EtherFiStake?: undefined;
|
|
469
|
+
EtherFiWrap?: undefined;
|
|
470
|
+
EtherFiUnwrap?: undefined;
|
|
467
471
|
MorphoBlueView?: undefined;
|
|
468
472
|
} | {
|
|
469
473
|
DFSSell: string;
|
|
@@ -681,7 +685,6 @@ declare const actionAddressesAllChains: {
|
|
|
681
685
|
MorphoBluePayback?: undefined;
|
|
682
686
|
MorphoBlueSetAuth?: undefined;
|
|
683
687
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
684
|
-
MorphoTokenWrap?: undefined;
|
|
685
688
|
EulerV2Supply?: undefined;
|
|
686
689
|
EulerV2Withdraw?: undefined;
|
|
687
690
|
EulerV2Borrow?: undefined;
|
|
@@ -689,6 +692,9 @@ declare const actionAddressesAllChains: {
|
|
|
689
692
|
EulerV2CollateralSwitch?: undefined;
|
|
690
693
|
EulerV2View?: undefined;
|
|
691
694
|
MerklClaim?: undefined;
|
|
695
|
+
EtherFiStake?: undefined;
|
|
696
|
+
EtherFiWrap?: undefined;
|
|
697
|
+
EtherFiUnwrap?: undefined;
|
|
692
698
|
AaveV3DelegateCredit?: undefined;
|
|
693
699
|
AaveV3RatioTrigger?: undefined;
|
|
694
700
|
MorphoBlueView?: undefined;
|
|
@@ -896,7 +902,6 @@ declare const actionAddressesAllChains: {
|
|
|
896
902
|
CurveUsdGetDebt?: undefined;
|
|
897
903
|
CurveUsdCollRatioTrigger?: undefined;
|
|
898
904
|
CurveUsdCollRatioCheck?: undefined;
|
|
899
|
-
MorphoTokenWrap?: undefined;
|
|
900
905
|
LlamaLendCreate?: undefined;
|
|
901
906
|
LlamaLendSupply?: undefined;
|
|
902
907
|
LlamaLendBorrow?: undefined;
|
|
@@ -915,6 +920,9 @@ declare const actionAddressesAllChains: {
|
|
|
915
920
|
EulerV2CollateralSwitch?: undefined;
|
|
916
921
|
EulerV2View?: undefined;
|
|
917
922
|
MerklClaim?: undefined;
|
|
923
|
+
EtherFiStake?: undefined;
|
|
924
|
+
EtherFiWrap?: undefined;
|
|
925
|
+
EtherFiUnwrap?: undefined;
|
|
918
926
|
AaveV3DelegateCredit?: undefined;
|
|
919
927
|
AaveV3RatioTrigger?: undefined;
|
|
920
928
|
GasFeeTakerL2?: undefined;
|
|
@@ -1124,7 +1132,6 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1124
1132
|
MorphoBluePayback: string;
|
|
1125
1133
|
MorphoBlueSetAuth: string;
|
|
1126
1134
|
MorphoBlueSetAuthWithSig: string;
|
|
1127
|
-
MorphoTokenWrap: string;
|
|
1128
1135
|
LlamaLendCreate: string;
|
|
1129
1136
|
LlamaLendSupply: string;
|
|
1130
1137
|
LlamaLendBorrow: string;
|
|
@@ -1143,6 +1150,9 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1143
1150
|
EulerV2CollateralSwitch: string;
|
|
1144
1151
|
EulerV2View: string;
|
|
1145
1152
|
MerklClaim: string;
|
|
1153
|
+
EtherFiStake: string;
|
|
1154
|
+
EtherFiWrap: string;
|
|
1155
|
+
EtherFiUnwrap: string;
|
|
1146
1156
|
AaveV3DelegateCredit?: undefined;
|
|
1147
1157
|
AaveV3RatioTrigger?: undefined;
|
|
1148
1158
|
GasFeeTakerL2?: undefined;
|
|
@@ -1355,7 +1365,6 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1355
1365
|
MorphoBluePayback?: undefined;
|
|
1356
1366
|
MorphoBlueSetAuth?: undefined;
|
|
1357
1367
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
1358
|
-
MorphoTokenWrap?: undefined;
|
|
1359
1368
|
LlamaLendCreate?: undefined;
|
|
1360
1369
|
LlamaLendSupply?: undefined;
|
|
1361
1370
|
LlamaLendBorrow?: undefined;
|
|
@@ -1374,6 +1383,9 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1374
1383
|
EulerV2CollateralSwitch?: undefined;
|
|
1375
1384
|
EulerV2View?: undefined;
|
|
1376
1385
|
MerklClaim?: undefined;
|
|
1386
|
+
EtherFiStake?: undefined;
|
|
1387
|
+
EtherFiWrap?: undefined;
|
|
1388
|
+
EtherFiUnwrap?: undefined;
|
|
1377
1389
|
MorphoBlueView?: undefined;
|
|
1378
1390
|
} | {
|
|
1379
1391
|
DFSSell: string;
|
|
@@ -1591,7 +1603,6 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1591
1603
|
MorphoBluePayback?: undefined;
|
|
1592
1604
|
MorphoBlueSetAuth?: undefined;
|
|
1593
1605
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
1594
|
-
MorphoTokenWrap?: undefined;
|
|
1595
1606
|
EulerV2Supply?: undefined;
|
|
1596
1607
|
EulerV2Withdraw?: undefined;
|
|
1597
1608
|
EulerV2Borrow?: undefined;
|
|
@@ -1599,6 +1610,9 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1599
1610
|
EulerV2CollateralSwitch?: undefined;
|
|
1600
1611
|
EulerV2View?: undefined;
|
|
1601
1612
|
MerklClaim?: undefined;
|
|
1613
|
+
EtherFiStake?: undefined;
|
|
1614
|
+
EtherFiWrap?: undefined;
|
|
1615
|
+
EtherFiUnwrap?: undefined;
|
|
1602
1616
|
AaveV3DelegateCredit?: undefined;
|
|
1603
1617
|
AaveV3RatioTrigger?: undefined;
|
|
1604
1618
|
MorphoBlueView?: undefined;
|
|
@@ -1806,7 +1820,6 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1806
1820
|
CurveUsdGetDebt?: undefined;
|
|
1807
1821
|
CurveUsdCollRatioTrigger?: undefined;
|
|
1808
1822
|
CurveUsdCollRatioCheck?: undefined;
|
|
1809
|
-
MorphoTokenWrap?: undefined;
|
|
1810
1823
|
LlamaLendCreate?: undefined;
|
|
1811
1824
|
LlamaLendSupply?: undefined;
|
|
1812
1825
|
LlamaLendBorrow?: undefined;
|
|
@@ -1825,6 +1838,9 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1825
1838
|
EulerV2CollateralSwitch?: undefined;
|
|
1826
1839
|
EulerV2View?: undefined;
|
|
1827
1840
|
MerklClaim?: undefined;
|
|
1841
|
+
EtherFiStake?: undefined;
|
|
1842
|
+
EtherFiWrap?: undefined;
|
|
1843
|
+
EtherFiUnwrap?: undefined;
|
|
1828
1844
|
AaveV3DelegateCredit?: undefined;
|
|
1829
1845
|
AaveV3RatioTrigger?: undefined;
|
|
1830
1846
|
GasFeeTakerL2?: undefined;
|
|
@@ -2177,7 +2193,6 @@ declare const _default: {
|
|
|
2177
2193
|
MorphoBluePayback: string;
|
|
2178
2194
|
MorphoBlueSetAuth: string;
|
|
2179
2195
|
MorphoBlueSetAuthWithSig: string;
|
|
2180
|
-
MorphoTokenWrap: string;
|
|
2181
2196
|
LlamaLendCreate: string;
|
|
2182
2197
|
LlamaLendSupply: string;
|
|
2183
2198
|
LlamaLendBorrow: string;
|
|
@@ -2196,6 +2211,9 @@ declare const _default: {
|
|
|
2196
2211
|
EulerV2CollateralSwitch: string;
|
|
2197
2212
|
EulerV2View: string;
|
|
2198
2213
|
MerklClaim: string;
|
|
2214
|
+
EtherFiStake: string;
|
|
2215
|
+
EtherFiWrap: string;
|
|
2216
|
+
EtherFiUnwrap: string;
|
|
2199
2217
|
AaveV3DelegateCredit?: undefined;
|
|
2200
2218
|
AaveV3RatioTrigger?: undefined;
|
|
2201
2219
|
GasFeeTakerL2?: undefined;
|
|
@@ -2408,7 +2426,6 @@ declare const _default: {
|
|
|
2408
2426
|
MorphoBluePayback?: undefined;
|
|
2409
2427
|
MorphoBlueSetAuth?: undefined;
|
|
2410
2428
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
2411
|
-
MorphoTokenWrap?: undefined;
|
|
2412
2429
|
LlamaLendCreate?: undefined;
|
|
2413
2430
|
LlamaLendSupply?: undefined;
|
|
2414
2431
|
LlamaLendBorrow?: undefined;
|
|
@@ -2427,6 +2444,9 @@ declare const _default: {
|
|
|
2427
2444
|
EulerV2CollateralSwitch?: undefined;
|
|
2428
2445
|
EulerV2View?: undefined;
|
|
2429
2446
|
MerklClaim?: undefined;
|
|
2447
|
+
EtherFiStake?: undefined;
|
|
2448
|
+
EtherFiWrap?: undefined;
|
|
2449
|
+
EtherFiUnwrap?: undefined;
|
|
2430
2450
|
MorphoBlueView?: undefined;
|
|
2431
2451
|
} | {
|
|
2432
2452
|
DFSSell: string;
|
|
@@ -2644,7 +2664,6 @@ declare const _default: {
|
|
|
2644
2664
|
MorphoBluePayback?: undefined;
|
|
2645
2665
|
MorphoBlueSetAuth?: undefined;
|
|
2646
2666
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
2647
|
-
MorphoTokenWrap?: undefined;
|
|
2648
2667
|
EulerV2Supply?: undefined;
|
|
2649
2668
|
EulerV2Withdraw?: undefined;
|
|
2650
2669
|
EulerV2Borrow?: undefined;
|
|
@@ -2652,6 +2671,9 @@ declare const _default: {
|
|
|
2652
2671
|
EulerV2CollateralSwitch?: undefined;
|
|
2653
2672
|
EulerV2View?: undefined;
|
|
2654
2673
|
MerklClaim?: undefined;
|
|
2674
|
+
EtherFiStake?: undefined;
|
|
2675
|
+
EtherFiWrap?: undefined;
|
|
2676
|
+
EtherFiUnwrap?: undefined;
|
|
2655
2677
|
AaveV3DelegateCredit?: undefined;
|
|
2656
2678
|
AaveV3RatioTrigger?: undefined;
|
|
2657
2679
|
MorphoBlueView?: undefined;
|
|
@@ -2859,7 +2881,6 @@ declare const _default: {
|
|
|
2859
2881
|
CurveUsdGetDebt?: undefined;
|
|
2860
2882
|
CurveUsdCollRatioTrigger?: undefined;
|
|
2861
2883
|
CurveUsdCollRatioCheck?: undefined;
|
|
2862
|
-
MorphoTokenWrap?: undefined;
|
|
2863
2884
|
LlamaLendCreate?: undefined;
|
|
2864
2885
|
LlamaLendSupply?: undefined;
|
|
2865
2886
|
LlamaLendBorrow?: undefined;
|
|
@@ -2878,6 +2899,9 @@ declare const _default: {
|
|
|
2878
2899
|
EulerV2CollateralSwitch?: undefined;
|
|
2879
2900
|
EulerV2View?: undefined;
|
|
2880
2901
|
MerklClaim?: undefined;
|
|
2902
|
+
EtherFiStake?: undefined;
|
|
2903
|
+
EtherFiWrap?: undefined;
|
|
2904
|
+
EtherFiUnwrap?: undefined;
|
|
2881
2905
|
AaveV3DelegateCredit?: undefined;
|
|
2882
2906
|
AaveV3RatioTrigger?: undefined;
|
|
2883
2907
|
GasFeeTakerL2?: undefined;
|
|
@@ -3087,7 +3111,6 @@ declare const _default: {
|
|
|
3087
3111
|
MorphoBluePayback: string;
|
|
3088
3112
|
MorphoBlueSetAuth: string;
|
|
3089
3113
|
MorphoBlueSetAuthWithSig: string;
|
|
3090
|
-
MorphoTokenWrap: string;
|
|
3091
3114
|
LlamaLendCreate: string;
|
|
3092
3115
|
LlamaLendSupply: string;
|
|
3093
3116
|
LlamaLendBorrow: string;
|
|
@@ -3106,6 +3129,9 @@ declare const _default: {
|
|
|
3106
3129
|
EulerV2CollateralSwitch: string;
|
|
3107
3130
|
EulerV2View: string;
|
|
3108
3131
|
MerklClaim: string;
|
|
3132
|
+
EtherFiStake: string;
|
|
3133
|
+
EtherFiWrap: string;
|
|
3134
|
+
EtherFiUnwrap: string;
|
|
3109
3135
|
AaveV3DelegateCredit?: undefined;
|
|
3110
3136
|
AaveV3RatioTrigger?: undefined;
|
|
3111
3137
|
GasFeeTakerL2?: undefined;
|
|
@@ -3318,7 +3344,6 @@ declare const _default: {
|
|
|
3318
3344
|
MorphoBluePayback?: undefined;
|
|
3319
3345
|
MorphoBlueSetAuth?: undefined;
|
|
3320
3346
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
3321
|
-
MorphoTokenWrap?: undefined;
|
|
3322
3347
|
LlamaLendCreate?: undefined;
|
|
3323
3348
|
LlamaLendSupply?: undefined;
|
|
3324
3349
|
LlamaLendBorrow?: undefined;
|
|
@@ -3337,6 +3362,9 @@ declare const _default: {
|
|
|
3337
3362
|
EulerV2CollateralSwitch?: undefined;
|
|
3338
3363
|
EulerV2View?: undefined;
|
|
3339
3364
|
MerklClaim?: undefined;
|
|
3365
|
+
EtherFiStake?: undefined;
|
|
3366
|
+
EtherFiWrap?: undefined;
|
|
3367
|
+
EtherFiUnwrap?: undefined;
|
|
3340
3368
|
MorphoBlueView?: undefined;
|
|
3341
3369
|
} | {
|
|
3342
3370
|
DFSSell: string;
|
|
@@ -3554,7 +3582,6 @@ declare const _default: {
|
|
|
3554
3582
|
MorphoBluePayback?: undefined;
|
|
3555
3583
|
MorphoBlueSetAuth?: undefined;
|
|
3556
3584
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
3557
|
-
MorphoTokenWrap?: undefined;
|
|
3558
3585
|
EulerV2Supply?: undefined;
|
|
3559
3586
|
EulerV2Withdraw?: undefined;
|
|
3560
3587
|
EulerV2Borrow?: undefined;
|
|
@@ -3562,6 +3589,9 @@ declare const _default: {
|
|
|
3562
3589
|
EulerV2CollateralSwitch?: undefined;
|
|
3563
3590
|
EulerV2View?: undefined;
|
|
3564
3591
|
MerklClaim?: undefined;
|
|
3592
|
+
EtherFiStake?: undefined;
|
|
3593
|
+
EtherFiWrap?: undefined;
|
|
3594
|
+
EtherFiUnwrap?: undefined;
|
|
3565
3595
|
AaveV3DelegateCredit?: undefined;
|
|
3566
3596
|
AaveV3RatioTrigger?: undefined;
|
|
3567
3597
|
MorphoBlueView?: undefined;
|
|
@@ -3769,7 +3799,6 @@ declare const _default: {
|
|
|
3769
3799
|
CurveUsdGetDebt?: undefined;
|
|
3770
3800
|
CurveUsdCollRatioTrigger?: undefined;
|
|
3771
3801
|
CurveUsdCollRatioCheck?: undefined;
|
|
3772
|
-
MorphoTokenWrap?: undefined;
|
|
3773
3802
|
LlamaLendCreate?: undefined;
|
|
3774
3803
|
LlamaLendSupply?: undefined;
|
|
3775
3804
|
LlamaLendBorrow?: undefined;
|
|
@@ -3788,6 +3817,9 @@ declare const _default: {
|
|
|
3788
3817
|
EulerV2CollateralSwitch?: undefined;
|
|
3789
3818
|
EulerV2View?: undefined;
|
|
3790
3819
|
MerklClaim?: undefined;
|
|
3820
|
+
EtherFiStake?: undefined;
|
|
3821
|
+
EtherFiWrap?: undefined;
|
|
3822
|
+
EtherFiUnwrap?: undefined;
|
|
3791
3823
|
AaveV3DelegateCredit?: undefined;
|
|
3792
3824
|
AaveV3RatioTrigger?: undefined;
|
|
3793
3825
|
GasFeeTakerL2?: undefined;
|
package/package.json
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
2
|
+
import { Action } from '../../Action';
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
import { EthAddress, uint256 } from '../../types';
|
|
5
|
+
import { requireAddress } from '../../utils/general';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* EtherFiStakeAction - Receives WETH, transforms it to ETH then sends it to EtherFi staking contract receiving eETH in return or weETH if wrapping is enabled
|
|
9
|
+
*
|
|
10
|
+
* @category EtherFi
|
|
11
|
+
*/
|
|
12
|
+
export class EtherFiStakeAction extends Action {
|
|
13
|
+
/**
|
|
14
|
+
* @param amount - amount of WETH to pull
|
|
15
|
+
* @param from - address from which to pull WETH from
|
|
16
|
+
* @param to - address where received eETH will be sent to
|
|
17
|
+
* @param shouldWrap - true if received eETH should be wrapped to weETH
|
|
18
|
+
*/
|
|
19
|
+
constructor(amount:uint256, from:EthAddress, to:EthAddress, shouldWrap:boolean) {
|
|
20
|
+
requireAddress(to);
|
|
21
|
+
super(
|
|
22
|
+
'EtherFiStake',
|
|
23
|
+
getAddr('EtherFiStake'),
|
|
24
|
+
['uint256', 'address', 'address', 'bool'],
|
|
25
|
+
[amount, from, to, shouldWrap],
|
|
26
|
+
);
|
|
27
|
+
this.mappableArgs = [
|
|
28
|
+
this.args[0],
|
|
29
|
+
this.args[1],
|
|
30
|
+
this.args[2],
|
|
31
|
+
this.args[3],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getAssetsToApprove() {
|
|
36
|
+
return [{ asset: getAssetInfo('WETH').address, owner: this.args[1] }];
|
|
37
|
+
}
|
|
38
|
+
}
|