@defisaver/sdk 1.2.7 → 1.2.8
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/eulerV2/EulerV2BorrowAction.d.ts +16 -0
- package/esm/src/actions/eulerV2/EulerV2BorrowAction.js +24 -0
- package/esm/src/actions/eulerV2/EulerV2CollateralSwitchAction.d.ts +15 -0
- package/esm/src/actions/eulerV2/EulerV2CollateralSwitchAction.js +22 -0
- package/esm/src/actions/eulerV2/EulerV2PaybackAction.d.ts +22 -0
- package/esm/src/actions/eulerV2/EulerV2PaybackAction.js +40 -0
- package/esm/src/actions/eulerV2/EulerV2PaybackWithSharesAction.d.ts +16 -0
- package/esm/src/actions/eulerV2/EulerV2PaybackWithSharesAction.js +24 -0
- package/esm/src/actions/eulerV2/EulerV2PullDebtAction.d.ts +16 -0
- package/esm/src/actions/eulerV2/EulerV2PullDebtAction.js +24 -0
- package/esm/src/actions/eulerV2/EulerV2ReorderCollateralsAction.d.ts +14 -0
- package/esm/src/actions/eulerV2/EulerV2ReorderCollateralsAction.js +20 -0
- package/esm/src/actions/eulerV2/EulerV2SupplyAction.d.ts +23 -0
- package/esm/src/actions/eulerV2/EulerV2SupplyAction.js +42 -0
- package/esm/src/actions/eulerV2/EulerV2WithdrawAction.d.ts +16 -0
- package/esm/src/actions/eulerV2/EulerV2WithdrawAction.js +24 -0
- package/esm/src/actions/eulerV2/index.d.ts +8 -0
- package/esm/src/actions/eulerV2/index.js +8 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/addresses.d.ts +25 -1
- package/esm/src/addresses.js +7 -1
- package/esm/src/index.d.ts +100 -4
- package/package.json +1 -1
- package/src/actions/eulerV2/EulerV2BorrowAction.ts +37 -0
- package/src/actions/eulerV2/EulerV2CollateralSwitchAction.ts +34 -0
- package/src/actions/eulerV2/EulerV2PaybackAction.ts +47 -0
- package/src/actions/eulerV2/EulerV2PaybackWithSharesAction.ts +37 -0
- package/src/actions/eulerV2/EulerV2PullDebtAction.ts +37 -0
- package/src/actions/eulerV2/EulerV2ReorderCollateralsAction.ts +31 -0
- package/src/actions/eulerV2/EulerV2SupplyAction.ts +49 -0
- package/src/actions/eulerV2/EulerV2WithdrawAction.ts +37 -0
- package/src/actions/eulerV2/index.ts +9 -0
- package/src/actions/index.ts +2 -0
- package/src/addresses.ts +8 -1
- package/umd/index.js +380 -67
- package/yarn-error.log +3976 -0
package/esm/src/index.d.ts
CHANGED
|
@@ -223,6 +223,12 @@ declare const actionAddressesAllChains: {
|
|
|
223
223
|
LlamaLendRepay: string;
|
|
224
224
|
LlamaLendLevCreate: string;
|
|
225
225
|
LlamaLendSelfLiquidateWithColl: string;
|
|
226
|
+
EulerV2Supply: string;
|
|
227
|
+
EulerV2Withdraw: string;
|
|
228
|
+
EulerV2Borrow: string;
|
|
229
|
+
EulerV2Payback: string;
|
|
230
|
+
EulerV2CollateralSwitch: string;
|
|
231
|
+
EulerV2View: string;
|
|
226
232
|
MerklClaim: string;
|
|
227
233
|
AaveV3DelegateCredit?: undefined;
|
|
228
234
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -445,6 +451,12 @@ declare const actionAddressesAllChains: {
|
|
|
445
451
|
LlamaLendRepay?: undefined;
|
|
446
452
|
LlamaLendLevCreate?: undefined;
|
|
447
453
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
454
|
+
EulerV2Supply?: undefined;
|
|
455
|
+
EulerV2Withdraw?: undefined;
|
|
456
|
+
EulerV2Borrow?: undefined;
|
|
457
|
+
EulerV2Payback?: undefined;
|
|
458
|
+
EulerV2CollateralSwitch?: undefined;
|
|
459
|
+
EulerV2View?: undefined;
|
|
448
460
|
MerklClaim?: undefined;
|
|
449
461
|
MorphoBlueView?: undefined;
|
|
450
462
|
} | {
|
|
@@ -661,6 +673,12 @@ declare const actionAddressesAllChains: {
|
|
|
661
673
|
MorphoBluePayback?: undefined;
|
|
662
674
|
MorphoBlueSetAuth?: undefined;
|
|
663
675
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
676
|
+
EulerV2Supply?: undefined;
|
|
677
|
+
EulerV2Withdraw?: undefined;
|
|
678
|
+
EulerV2Borrow?: undefined;
|
|
679
|
+
EulerV2Payback?: undefined;
|
|
680
|
+
EulerV2CollateralSwitch?: undefined;
|
|
681
|
+
EulerV2View?: undefined;
|
|
664
682
|
MerklClaim?: undefined;
|
|
665
683
|
AaveV3DelegateCredit?: undefined;
|
|
666
684
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -678,7 +696,6 @@ declare const actionAddressesAllChains: {
|
|
|
678
696
|
ChangeProxyOwner: string;
|
|
679
697
|
PermitToken: string;
|
|
680
698
|
HandleAuth: string;
|
|
681
|
-
ToggleSub: string;
|
|
682
699
|
FLAaveV3: string;
|
|
683
700
|
FLBalancer: string;
|
|
684
701
|
FLUniV3: string;
|
|
@@ -713,6 +730,7 @@ declare const actionAddressesAllChains: {
|
|
|
713
730
|
MorphoBlueView: string;
|
|
714
731
|
AutomationV2Unsub?: undefined;
|
|
715
732
|
SendTokenAndUnwrap?: undefined;
|
|
733
|
+
ToggleSub?: undefined;
|
|
716
734
|
UpdateSub?: undefined;
|
|
717
735
|
TransferNFT?: undefined;
|
|
718
736
|
CreateSub?: undefined;
|
|
@@ -878,6 +896,12 @@ declare const actionAddressesAllChains: {
|
|
|
878
896
|
LlamaLendRepay?: undefined;
|
|
879
897
|
LlamaLendLevCreate?: undefined;
|
|
880
898
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
899
|
+
EulerV2Supply?: undefined;
|
|
900
|
+
EulerV2Withdraw?: undefined;
|
|
901
|
+
EulerV2Borrow?: undefined;
|
|
902
|
+
EulerV2Payback?: undefined;
|
|
903
|
+
EulerV2CollateralSwitch?: undefined;
|
|
904
|
+
EulerV2View?: undefined;
|
|
881
905
|
MerklClaim?: undefined;
|
|
882
906
|
AaveV3DelegateCredit?: undefined;
|
|
883
907
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -1097,6 +1121,12 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1097
1121
|
LlamaLendRepay: string;
|
|
1098
1122
|
LlamaLendLevCreate: string;
|
|
1099
1123
|
LlamaLendSelfLiquidateWithColl: string;
|
|
1124
|
+
EulerV2Supply: string;
|
|
1125
|
+
EulerV2Withdraw: string;
|
|
1126
|
+
EulerV2Borrow: string;
|
|
1127
|
+
EulerV2Payback: string;
|
|
1128
|
+
EulerV2CollateralSwitch: string;
|
|
1129
|
+
EulerV2View: string;
|
|
1100
1130
|
MerklClaim: string;
|
|
1101
1131
|
AaveV3DelegateCredit?: undefined;
|
|
1102
1132
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -1319,6 +1349,12 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1319
1349
|
LlamaLendRepay?: undefined;
|
|
1320
1350
|
LlamaLendLevCreate?: undefined;
|
|
1321
1351
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
1352
|
+
EulerV2Supply?: undefined;
|
|
1353
|
+
EulerV2Withdraw?: undefined;
|
|
1354
|
+
EulerV2Borrow?: undefined;
|
|
1355
|
+
EulerV2Payback?: undefined;
|
|
1356
|
+
EulerV2CollateralSwitch?: undefined;
|
|
1357
|
+
EulerV2View?: undefined;
|
|
1322
1358
|
MerklClaim?: undefined;
|
|
1323
1359
|
MorphoBlueView?: undefined;
|
|
1324
1360
|
} | {
|
|
@@ -1535,6 +1571,12 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1535
1571
|
MorphoBluePayback?: undefined;
|
|
1536
1572
|
MorphoBlueSetAuth?: undefined;
|
|
1537
1573
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
1574
|
+
EulerV2Supply?: undefined;
|
|
1575
|
+
EulerV2Withdraw?: undefined;
|
|
1576
|
+
EulerV2Borrow?: undefined;
|
|
1577
|
+
EulerV2Payback?: undefined;
|
|
1578
|
+
EulerV2CollateralSwitch?: undefined;
|
|
1579
|
+
EulerV2View?: undefined;
|
|
1538
1580
|
MerklClaim?: undefined;
|
|
1539
1581
|
AaveV3DelegateCredit?: undefined;
|
|
1540
1582
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -1552,7 +1594,6 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1552
1594
|
ChangeProxyOwner: string;
|
|
1553
1595
|
PermitToken: string;
|
|
1554
1596
|
HandleAuth: string;
|
|
1555
|
-
ToggleSub: string;
|
|
1556
1597
|
FLAaveV3: string;
|
|
1557
1598
|
FLBalancer: string;
|
|
1558
1599
|
FLUniV3: string;
|
|
@@ -1587,6 +1628,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1587
1628
|
MorphoBlueView: string;
|
|
1588
1629
|
AutomationV2Unsub?: undefined;
|
|
1589
1630
|
SendTokenAndUnwrap?: undefined;
|
|
1631
|
+
ToggleSub?: undefined;
|
|
1590
1632
|
UpdateSub?: undefined;
|
|
1591
1633
|
TransferNFT?: undefined;
|
|
1592
1634
|
CreateSub?: undefined;
|
|
@@ -1752,6 +1794,12 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1752
1794
|
LlamaLendRepay?: undefined;
|
|
1753
1795
|
LlamaLendLevCreate?: undefined;
|
|
1754
1796
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
1797
|
+
EulerV2Supply?: undefined;
|
|
1798
|
+
EulerV2Withdraw?: undefined;
|
|
1799
|
+
EulerV2Borrow?: undefined;
|
|
1800
|
+
EulerV2Payback?: undefined;
|
|
1801
|
+
EulerV2CollateralSwitch?: undefined;
|
|
1802
|
+
EulerV2View?: undefined;
|
|
1755
1803
|
MerklClaim?: undefined;
|
|
1756
1804
|
AaveV3DelegateCredit?: undefined;
|
|
1757
1805
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -2114,6 +2162,12 @@ declare const _default: {
|
|
|
2114
2162
|
LlamaLendRepay: string;
|
|
2115
2163
|
LlamaLendLevCreate: string;
|
|
2116
2164
|
LlamaLendSelfLiquidateWithColl: string;
|
|
2165
|
+
EulerV2Supply: string;
|
|
2166
|
+
EulerV2Withdraw: string;
|
|
2167
|
+
EulerV2Borrow: string;
|
|
2168
|
+
EulerV2Payback: string;
|
|
2169
|
+
EulerV2CollateralSwitch: string;
|
|
2170
|
+
EulerV2View: string;
|
|
2117
2171
|
MerklClaim: string;
|
|
2118
2172
|
AaveV3DelegateCredit?: undefined;
|
|
2119
2173
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -2336,6 +2390,12 @@ declare const _default: {
|
|
|
2336
2390
|
LlamaLendRepay?: undefined;
|
|
2337
2391
|
LlamaLendLevCreate?: undefined;
|
|
2338
2392
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
2393
|
+
EulerV2Supply?: undefined;
|
|
2394
|
+
EulerV2Withdraw?: undefined;
|
|
2395
|
+
EulerV2Borrow?: undefined;
|
|
2396
|
+
EulerV2Payback?: undefined;
|
|
2397
|
+
EulerV2CollateralSwitch?: undefined;
|
|
2398
|
+
EulerV2View?: undefined;
|
|
2339
2399
|
MerklClaim?: undefined;
|
|
2340
2400
|
MorphoBlueView?: undefined;
|
|
2341
2401
|
} | {
|
|
@@ -2552,6 +2612,12 @@ declare const _default: {
|
|
|
2552
2612
|
MorphoBluePayback?: undefined;
|
|
2553
2613
|
MorphoBlueSetAuth?: undefined;
|
|
2554
2614
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
2615
|
+
EulerV2Supply?: undefined;
|
|
2616
|
+
EulerV2Withdraw?: undefined;
|
|
2617
|
+
EulerV2Borrow?: undefined;
|
|
2618
|
+
EulerV2Payback?: undefined;
|
|
2619
|
+
EulerV2CollateralSwitch?: undefined;
|
|
2620
|
+
EulerV2View?: undefined;
|
|
2555
2621
|
MerklClaim?: undefined;
|
|
2556
2622
|
AaveV3DelegateCredit?: undefined;
|
|
2557
2623
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -2569,7 +2635,6 @@ declare const _default: {
|
|
|
2569
2635
|
ChangeProxyOwner: string;
|
|
2570
2636
|
PermitToken: string;
|
|
2571
2637
|
HandleAuth: string;
|
|
2572
|
-
ToggleSub: string;
|
|
2573
2638
|
FLAaveV3: string;
|
|
2574
2639
|
FLBalancer: string;
|
|
2575
2640
|
FLUniV3: string;
|
|
@@ -2604,6 +2669,7 @@ declare const _default: {
|
|
|
2604
2669
|
MorphoBlueView: string;
|
|
2605
2670
|
AutomationV2Unsub?: undefined;
|
|
2606
2671
|
SendTokenAndUnwrap?: undefined;
|
|
2672
|
+
ToggleSub?: undefined;
|
|
2607
2673
|
UpdateSub?: undefined;
|
|
2608
2674
|
TransferNFT?: undefined;
|
|
2609
2675
|
CreateSub?: undefined;
|
|
@@ -2769,6 +2835,12 @@ declare const _default: {
|
|
|
2769
2835
|
LlamaLendRepay?: undefined;
|
|
2770
2836
|
LlamaLendLevCreate?: undefined;
|
|
2771
2837
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
2838
|
+
EulerV2Supply?: undefined;
|
|
2839
|
+
EulerV2Withdraw?: undefined;
|
|
2840
|
+
EulerV2Borrow?: undefined;
|
|
2841
|
+
EulerV2Payback?: undefined;
|
|
2842
|
+
EulerV2CollateralSwitch?: undefined;
|
|
2843
|
+
EulerV2View?: undefined;
|
|
2772
2844
|
MerklClaim?: undefined;
|
|
2773
2845
|
AaveV3DelegateCredit?: undefined;
|
|
2774
2846
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -2988,6 +3060,12 @@ declare const _default: {
|
|
|
2988
3060
|
LlamaLendRepay: string;
|
|
2989
3061
|
LlamaLendLevCreate: string;
|
|
2990
3062
|
LlamaLendSelfLiquidateWithColl: string;
|
|
3063
|
+
EulerV2Supply: string;
|
|
3064
|
+
EulerV2Withdraw: string;
|
|
3065
|
+
EulerV2Borrow: string;
|
|
3066
|
+
EulerV2Payback: string;
|
|
3067
|
+
EulerV2CollateralSwitch: string;
|
|
3068
|
+
EulerV2View: string;
|
|
2991
3069
|
MerklClaim: string;
|
|
2992
3070
|
AaveV3DelegateCredit?: undefined;
|
|
2993
3071
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -3210,6 +3288,12 @@ declare const _default: {
|
|
|
3210
3288
|
LlamaLendRepay?: undefined;
|
|
3211
3289
|
LlamaLendLevCreate?: undefined;
|
|
3212
3290
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
3291
|
+
EulerV2Supply?: undefined;
|
|
3292
|
+
EulerV2Withdraw?: undefined;
|
|
3293
|
+
EulerV2Borrow?: undefined;
|
|
3294
|
+
EulerV2Payback?: undefined;
|
|
3295
|
+
EulerV2CollateralSwitch?: undefined;
|
|
3296
|
+
EulerV2View?: undefined;
|
|
3213
3297
|
MerklClaim?: undefined;
|
|
3214
3298
|
MorphoBlueView?: undefined;
|
|
3215
3299
|
} | {
|
|
@@ -3426,6 +3510,12 @@ declare const _default: {
|
|
|
3426
3510
|
MorphoBluePayback?: undefined;
|
|
3427
3511
|
MorphoBlueSetAuth?: undefined;
|
|
3428
3512
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
3513
|
+
EulerV2Supply?: undefined;
|
|
3514
|
+
EulerV2Withdraw?: undefined;
|
|
3515
|
+
EulerV2Borrow?: undefined;
|
|
3516
|
+
EulerV2Payback?: undefined;
|
|
3517
|
+
EulerV2CollateralSwitch?: undefined;
|
|
3518
|
+
EulerV2View?: undefined;
|
|
3429
3519
|
MerklClaim?: undefined;
|
|
3430
3520
|
AaveV3DelegateCredit?: undefined;
|
|
3431
3521
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -3443,7 +3533,6 @@ declare const _default: {
|
|
|
3443
3533
|
ChangeProxyOwner: string;
|
|
3444
3534
|
PermitToken: string;
|
|
3445
3535
|
HandleAuth: string;
|
|
3446
|
-
ToggleSub: string;
|
|
3447
3536
|
FLAaveV3: string;
|
|
3448
3537
|
FLBalancer: string;
|
|
3449
3538
|
FLUniV3: string;
|
|
@@ -3478,6 +3567,7 @@ declare const _default: {
|
|
|
3478
3567
|
MorphoBlueView: string;
|
|
3479
3568
|
AutomationV2Unsub?: undefined;
|
|
3480
3569
|
SendTokenAndUnwrap?: undefined;
|
|
3570
|
+
ToggleSub?: undefined;
|
|
3481
3571
|
UpdateSub?: undefined;
|
|
3482
3572
|
TransferNFT?: undefined;
|
|
3483
3573
|
CreateSub?: undefined;
|
|
@@ -3643,6 +3733,12 @@ declare const _default: {
|
|
|
3643
3733
|
LlamaLendRepay?: undefined;
|
|
3644
3734
|
LlamaLendLevCreate?: undefined;
|
|
3645
3735
|
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
3736
|
+
EulerV2Supply?: undefined;
|
|
3737
|
+
EulerV2Withdraw?: undefined;
|
|
3738
|
+
EulerV2Borrow?: undefined;
|
|
3739
|
+
EulerV2Payback?: undefined;
|
|
3740
|
+
EulerV2CollateralSwitch?: undefined;
|
|
3741
|
+
EulerV2View?: undefined;
|
|
3646
3742
|
MerklClaim?: undefined;
|
|
3647
3743
|
AaveV3DelegateCredit?: undefined;
|
|
3648
3744
|
AaveV3RatioTrigger?: undefined;
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2BorrowAction - Borrow assets from an Euler vault
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2BorrowAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the Euler vault
|
|
13
|
+
* @param account The address of the Euler account, defaults to user's wallet
|
|
14
|
+
* @param receiver The address to receive the borrowed assets
|
|
15
|
+
* @param amount The amount of assets to borrow
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
vault: EthAddress,
|
|
19
|
+
account: EthAddress,
|
|
20
|
+
receiver: EthAddress,
|
|
21
|
+
amount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'EulerV2Borrow',
|
|
25
|
+
getAddr('EulerV2Borrow'),
|
|
26
|
+
['address', 'address', 'address', 'uint256'],
|
|
27
|
+
[vault, account, receiver, amount],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0],
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2CollateralSwitchAction - Switch if vault will be used as collateral or not
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2CollateralSwitchAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the vault
|
|
13
|
+
* @param account The address of the Euler account, defaults to user's wallet
|
|
14
|
+
* @param enableAsColl Whether to enable or disable the vault as collateral
|
|
15
|
+
*/
|
|
16
|
+
constructor(
|
|
17
|
+
vault: EthAddress,
|
|
18
|
+
account: EthAddress,
|
|
19
|
+
enableAsColl: boolean,
|
|
20
|
+
) {
|
|
21
|
+
super(
|
|
22
|
+
'EulerV2CollateralSwitch',
|
|
23
|
+
getAddr('EulerV2CollateralSwitch'),
|
|
24
|
+
['address', 'address', 'bool'],
|
|
25
|
+
[vault, account, enableAsColl],
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
this.mappableArgs = [
|
|
29
|
+
this.args[0],
|
|
30
|
+
this.args[1],
|
|
31
|
+
this.args[2],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2PaybackAction - Payback debt assets to a Euler vault
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2PaybackAction extends Action {
|
|
11
|
+
tokenForApproval: EthAddress;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param vault The address of the vault
|
|
15
|
+
* @param tokenAddress Underlying token address
|
|
16
|
+
* @param account The address of the Euler account, defaults to user's wallet
|
|
17
|
+
* @param from The address from which to pull tokens to be paid back
|
|
18
|
+
* @param amount The amount of assets to pay back (uint256.max for full debt repayment)
|
|
19
|
+
*/
|
|
20
|
+
constructor(
|
|
21
|
+
vault: EthAddress,
|
|
22
|
+
tokenAddress: EthAddress,
|
|
23
|
+
account: EthAddress,
|
|
24
|
+
from: EthAddress,
|
|
25
|
+
amount: uint256,
|
|
26
|
+
) {
|
|
27
|
+
super(
|
|
28
|
+
'EulerV2Payback',
|
|
29
|
+
getAddr('EulerV2Payback'),
|
|
30
|
+
['address', 'address', 'address', 'uint256'],
|
|
31
|
+
[vault, account, from, amount],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
this.mappableArgs = [
|
|
35
|
+
this.args[0],
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
38
|
+
this.args[3],
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
this.tokenForApproval = tokenAddress;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async getAssetsToApprove() {
|
|
45
|
+
return [{ asset: this.tokenForApproval, owner: this.args[2] }];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2PaybackWithSharesAction - Payback debt asset to a Euler vault using share tokens
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2PaybackWithSharesAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the vault
|
|
13
|
+
* @param account The address of the Euler account for which debt is paid back, defaults to user's wallet
|
|
14
|
+
* @param from The address of the Euler account for which shares are burned to pay back debt for 'account', defaults to user's wallet
|
|
15
|
+
* @param amount The amount of asset tokens to be paid back (uint256.max for full debt repayment or up to the available deposit shares in 'from' account)
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
vault: EthAddress,
|
|
19
|
+
account: EthAddress,
|
|
20
|
+
from: EthAddress,
|
|
21
|
+
amount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'EulerV2PaybackWithShares',
|
|
25
|
+
getAddr('EulerV2PaybackWithShares'),
|
|
26
|
+
['address', 'address', 'address', 'uint256'],
|
|
27
|
+
[vault, account, from, amount],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0],
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2PullDebtAction - Pull debt from one Euler account to another
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2PullDebtAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the Euler vault
|
|
13
|
+
* @param account The address of the Euler account taking the debt, defaults to user's wallet
|
|
14
|
+
* @param from The address of the Euler account from which debt is pulled
|
|
15
|
+
* @param amount The amount of debt to be pulled (uint256.max for full debt pull)
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
vault: EthAddress,
|
|
19
|
+
account: EthAddress,
|
|
20
|
+
from: EthAddress,
|
|
21
|
+
amount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'EulerV2PullDebt',
|
|
25
|
+
getAddr('EulerV2PullDebt'),
|
|
26
|
+
['address', 'address', 'address', 'uint256'],
|
|
27
|
+
[vault, account, from, amount],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0],
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint8 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2ReorderCollateralsAction - Reorder account collaterals. Can be used to optimize gas costs when checking account health status
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2ReorderCollateralsAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param account The address of the Euler account, defaults to user's wallet
|
|
13
|
+
* @param indexes The array of swap steps to reorder collaterals
|
|
14
|
+
*/
|
|
15
|
+
constructor(
|
|
16
|
+
account: EthAddress,
|
|
17
|
+
indexes: Array<Array<uint8>>,
|
|
18
|
+
) {
|
|
19
|
+
super(
|
|
20
|
+
'EulerV2ReorderCollaterals',
|
|
21
|
+
getAddr('EulerV2ReorderCollaterals'),
|
|
22
|
+
['address', 'uint8[][]'],
|
|
23
|
+
[account, indexes],
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
this.mappableArgs = [
|
|
27
|
+
this.args[0],
|
|
28
|
+
this.args[1],
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2SupplyAction - Supply assets to a Euler vault and gets eTokens vault shares
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2SupplyAction extends Action {
|
|
11
|
+
tokenForApproval: EthAddress;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param vault The address of the supply vault
|
|
15
|
+
* @param tokenAddress Underlying token address
|
|
16
|
+
* @param account The address of the Euler account, defaults to user's wallet
|
|
17
|
+
* @param from The address from which to pull tokens to be supplied
|
|
18
|
+
* @param amount The amount of assets to supply
|
|
19
|
+
* @param enableAsColl Whether to enable supply vault as collateral
|
|
20
|
+
*/
|
|
21
|
+
constructor(
|
|
22
|
+
vault:EthAddress,
|
|
23
|
+
tokenAddress:EthAddress,
|
|
24
|
+
account:EthAddress,
|
|
25
|
+
from:EthAddress,
|
|
26
|
+
amount:uint256,
|
|
27
|
+
enableAsColl:boolean,
|
|
28
|
+
) {
|
|
29
|
+
super(
|
|
30
|
+
'EulerV2Supply',
|
|
31
|
+
getAddr('EulerV2Supply'),
|
|
32
|
+
['address', 'address', 'address', 'uint256', 'bool'],
|
|
33
|
+
[vault, account, from, amount, enableAsColl],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
this.mappableArgs = [
|
|
37
|
+
this.args[0],
|
|
38
|
+
this.args[1],
|
|
39
|
+
this.args[2],
|
|
40
|
+
this.args[3],
|
|
41
|
+
this.args[4],
|
|
42
|
+
];
|
|
43
|
+
this.tokenForApproval = tokenAddress;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async getAssetsToApprove() {
|
|
47
|
+
return [{ asset: this.tokenForApproval, owner: this.args[2] }];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EulerV2WithdrawAction - Withdraws assets from Euler vault
|
|
7
|
+
*
|
|
8
|
+
* @category EulerV2
|
|
9
|
+
*/
|
|
10
|
+
export class EulerV2WithdrawAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the Euler vault
|
|
13
|
+
* @param account The address of the Euler account, defaults to user's wallet
|
|
14
|
+
* @param receiver The address to receive the withdrawn assets
|
|
15
|
+
* @param amount The amount of assets to withdraw (uint256.max for max withdrawal)
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
vault:EthAddress,
|
|
19
|
+
account:EthAddress,
|
|
20
|
+
receiver:EthAddress,
|
|
21
|
+
amount:uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'EulerV2Withdraw',
|
|
25
|
+
getAddr('EulerV2Withdraw'),
|
|
26
|
+
['address', 'address', 'address', 'uint256'],
|
|
27
|
+
[vault, account, receiver, amount],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0],
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './EulerV2SupplyAction';
|
|
2
|
+
export * from './EulerV2WithdrawAction';
|
|
3
|
+
export * from './EulerV2BorrowAction';
|
|
4
|
+
export * from './EulerV2PaybackAction';
|
|
5
|
+
export * from './EulerV2PaybackWithSharesAction';
|
|
6
|
+
export * from './EulerV2PullDebtAction';
|
|
7
|
+
export * from './EulerV2ReorderCollateralsAction';
|
|
8
|
+
export * from './EulerV2CollateralSwitchAction';
|
|
9
|
+
|
package/src/actions/index.ts
CHANGED
|
@@ -29,6 +29,7 @@ import * as spark from './spark';
|
|
|
29
29
|
import * as morphoblue from './morpho-blue';
|
|
30
30
|
import * as llamalend from './llamalend';
|
|
31
31
|
import * as merkl from './merkl';
|
|
32
|
+
import * as eulerV2 from './eulerV2';
|
|
32
33
|
import * as sky from './sky';
|
|
33
34
|
|
|
34
35
|
export {
|
|
@@ -63,5 +64,6 @@ export {
|
|
|
63
64
|
morphoblue,
|
|
64
65
|
llamalend,
|
|
65
66
|
merkl,
|
|
67
|
+
eulerV2,
|
|
66
68
|
sky,
|
|
67
69
|
};
|
package/src/addresses.ts
CHANGED
|
@@ -283,6 +283,14 @@ export const actionAddresses = {
|
|
|
283
283
|
LlamaLendLevCreate: '0x534b704a62385cfe5EEB8d9605419743d4fe105E',
|
|
284
284
|
LlamaLendSelfLiquidateWithColl: '0xA99DD1D91141cA63C423DB763dE75078336803B2',
|
|
285
285
|
|
|
286
|
+
// eulerV2
|
|
287
|
+
EulerV2Supply: '0xa067787D086841437D112e0C847dDB3e5D95173f',
|
|
288
|
+
EulerV2Withdraw: '0x5bf1a54fe1e65B134E7920e53A5eB0D14b9e6aD1',
|
|
289
|
+
EulerV2Borrow: '0x38d66ecD38b7800D8FD0Bc29489c2306170a9Ede',
|
|
290
|
+
EulerV2Payback: '0x738b1df6b6962D8795Bda5bc5EFCd8b0B8c74d01',
|
|
291
|
+
EulerV2CollateralSwitch: '0x38950b50Fb38aC19D06e8CE5AAE632D6dF1EEb1a',
|
|
292
|
+
EulerV2View: '0x25eCA04532C085F77Ea6CE92C94E9e69896686E6',
|
|
293
|
+
|
|
286
294
|
MerklClaim: '0xE88036F3F0D7e216D63726356cA2bC334e305fe5',
|
|
287
295
|
},
|
|
288
296
|
[NETWORKS.optimism.chainId]: {
|
|
@@ -428,7 +436,6 @@ export const actionAddresses = {
|
|
|
428
436
|
ChangeProxyOwner: '0x1947a44d3717a47556175d64fdc208619aa08874',
|
|
429
437
|
PermitToken: '0x57c8ae94a5A11dA33e0518054102488b604628D0',
|
|
430
438
|
HandleAuth: '0x18a90e6db79199ace00140631ef931e0bd97837c',
|
|
431
|
-
ToggleSub: '0x5F16C0a08d52b67fc73706c494F7535Dd3382b58',
|
|
432
439
|
|
|
433
440
|
// Flashloan
|
|
434
441
|
FLAaveV3: '0x79Eb9cEe432Cd3e7b09A9eFdB21A733A6d7b4c3A',
|