@defisaver/sdk 1.0.56 → 1.0.57
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/Action.d.ts +2 -2
- package/esm/src/actions/checkers/LiquityRatioIncreaseCheckAction.d.ts +13 -0
- package/esm/src/actions/checkers/LiquityRatioIncreaseCheckAction.js +18 -0
- package/esm/src/actions/checkers/MorphoAaveV2RatioCheckAction.d.ts +15 -0
- package/esm/src/actions/checkers/MorphoAaveV2RatioCheckAction.js +22 -0
- package/esm/src/actions/checkers/index.d.ts +2 -0
- package/esm/src/actions/checkers/index.js +2 -0
- package/esm/src/addresses.d.ts +4 -0
- package/esm/src/addresses.js +3 -2
- package/esm/src/index.d.ts +16 -0
- package/esm/src/triggers/LiquityDebtInFrontWithLimitTrigger.d.ts +10 -0
- package/esm/src/triggers/LiquityDebtInFrontWithLimitTrigger.js +12 -0
- package/esm/src/triggers/MorphoAaveV2RatioTrigger.d.ts +10 -0
- package/esm/src/triggers/MorphoAaveV2RatioTrigger.js +12 -0
- package/esm/src/triggers/index.d.ts +2 -0
- package/esm/src/triggers/index.js +2 -0
- package/esm/src/types.d.ts +20 -20
- package/package.json +2 -2
- package/src/actions/checkers/LiquityRatioIncreaseCheckAction.ts +21 -0
- package/src/actions/checkers/MorphoAaveV2RatioCheckAction.ts +25 -0
- package/src/actions/checkers/index.ts +2 -0
- package/src/addresses.ts +3 -2
- package/src/triggers/LiquityDebtInFrontWithLimitTrigger.ts +19 -0
- package/src/triggers/MorphoAaveV2RatioTrigger.ts +15 -0
- package/src/triggers/index.ts +2 -0
- package/umd/index.js +456 -383
- package/yarn-error.log +0 -3976
package/esm/src/Action.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccessListItem, EthAddress } from './types';
|
|
2
|
-
type ParamTypes = Array<string | Array<any>>;
|
|
3
|
-
type Args = Array<any>;
|
|
2
|
+
declare type ParamTypes = Array<string | Array<any>>;
|
|
3
|
+
declare type Args = Array<any>;
|
|
4
4
|
/**
|
|
5
5
|
* Single action that can be executed directly, or combined into a set (ie. supply a vault)
|
|
6
6
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityRatioCheckAction - Checks liquity ratio increase for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityRatioIncreaseCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param targetRatio The ratio user want to be at
|
|
11
|
+
*/
|
|
12
|
+
constructor(targetRatioIncrease: uint256);
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityRatioCheckAction - Checks liquity ratio increase for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityRatioIncreaseCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param targetRatio The ratio user want to be at
|
|
11
|
+
*/
|
|
12
|
+
constructor(targetRatioIncrease) {
|
|
13
|
+
super('LiquityRatioIncreaseCheck', getAddr('LiquityRatioIncreaseCheck'), ['uint256'], [targetRatioIncrease]);
|
|
14
|
+
this.mappableArgs = [
|
|
15
|
+
this.args[0],
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoAaveV2RatioCheckAction - Checks Morpho-AaveV2 ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoAaveV2RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param ratioState If it should lower/higher
|
|
11
|
+
* @param targetRatio The ratio user want to be at
|
|
12
|
+
* @param user Address of the user we are checking the ratio for (default to proxy)
|
|
13
|
+
*/
|
|
14
|
+
constructor(ratioState: uint8, targetRatio: uint256, user: EthAddress);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoAaveV2RatioCheckAction - Checks Morpho-AaveV2 ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export class MorphoAaveV2RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param ratioState If it should lower/higher
|
|
11
|
+
* @param targetRatio The ratio user want to be at
|
|
12
|
+
* @param user Address of the user we are checking the ratio for (default to proxy)
|
|
13
|
+
*/
|
|
14
|
+
constructor(ratioState, targetRatio, user) {
|
|
15
|
+
super('MorphoAaveV2RatioCheck', getAddr('MorphoAaveV2RatioCheck'), ['uint8', 'uint256', 'address'], [ratioState, targetRatio, user]);
|
|
16
|
+
this.mappableArgs = [
|
|
17
|
+
this.args[0],
|
|
18
|
+
this.args[1],
|
|
19
|
+
this.args[2],
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './MakerRatioCheckAction';
|
|
2
2
|
export * from './AaveV3RatioCheckAction';
|
|
3
3
|
export * from './CompoundV3RatioCheckAction';
|
|
4
|
+
export * from './MorphoAaveV2RatioCheckAction';
|
|
4
5
|
export * from './LiquityRatioCheckAction';
|
|
5
6
|
export * from './SparkRatioCheckAction';
|
|
7
|
+
export * from './LiquityRatioIncreaseCheckAction';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './MakerRatioCheckAction';
|
|
2
2
|
export * from './AaveV3RatioCheckAction';
|
|
3
3
|
export * from './CompoundV3RatioCheckAction';
|
|
4
|
+
export * from './MorphoAaveV2RatioCheckAction';
|
|
4
5
|
export * from './LiquityRatioCheckAction';
|
|
5
6
|
export * from './SparkRatioCheckAction';
|
|
7
|
+
export * from './LiquityRatioIncreaseCheckAction';
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare const actionAddresses: {
|
|
|
44
44
|
AaveCollateralSwitch: string;
|
|
45
45
|
AaveUnstake: string;
|
|
46
46
|
AaveClaimAAVE: string;
|
|
47
|
+
AaveClaimStkAave: string;
|
|
47
48
|
AaveV3Withdraw: string;
|
|
48
49
|
AaveV3SwapBorrowRateMode: string;
|
|
49
50
|
AaveV3Supply: string;
|
|
@@ -242,6 +243,7 @@ export declare const actionAddresses: {
|
|
|
242
243
|
AaveCollateralSwitch?: undefined;
|
|
243
244
|
AaveUnstake?: undefined;
|
|
244
245
|
AaveClaimAAVE?: undefined;
|
|
246
|
+
AaveClaimStkAave?: undefined;
|
|
245
247
|
AaveV3View?: undefined;
|
|
246
248
|
MorphoAaveV2Borrow?: undefined;
|
|
247
249
|
MorphoAaveV2Payback?: undefined;
|
|
@@ -413,6 +415,7 @@ export declare const actionAddresses: {
|
|
|
413
415
|
AaveCollateralSwitch?: undefined;
|
|
414
416
|
AaveUnstake?: undefined;
|
|
415
417
|
AaveClaimAAVE?: undefined;
|
|
418
|
+
AaveClaimStkAave?: undefined;
|
|
416
419
|
AaveV3ClaimRewards?: undefined;
|
|
417
420
|
AaveV3View?: undefined;
|
|
418
421
|
MorphoAaveV2Borrow?: undefined;
|
|
@@ -589,6 +592,7 @@ export declare const actionAddresses: {
|
|
|
589
592
|
AaveCollateralSwitch?: undefined;
|
|
590
593
|
AaveUnstake?: undefined;
|
|
591
594
|
AaveClaimAAVE?: undefined;
|
|
595
|
+
AaveClaimStkAave?: undefined;
|
|
592
596
|
MorphoAaveV2Borrow?: undefined;
|
|
593
597
|
MorphoAaveV2Payback?: undefined;
|
|
594
598
|
MorphoAaveV2Supply?: undefined;
|
package/esm/src/addresses.js
CHANGED
|
@@ -50,6 +50,7 @@ export const actionAddresses = {
|
|
|
50
50
|
AaveCollateralSwitch: '0xFf5dfF1B90bd5Aa6E12768AB497dB90cc9DE6F5d',
|
|
51
51
|
AaveUnstake: '0x2FE4024e350cD2c64D2fd0Db5d16F5cE54Ca0E09',
|
|
52
52
|
AaveClaimAAVE: '0xd52855bD011F3D87565f9040DdE2A59fB1b27b15',
|
|
53
|
+
AaveClaimStkAave: '0x5Dcd9Dc0185a6Ab07a31e5284D16Ce9f0A79Ce99',
|
|
53
54
|
// aave v3
|
|
54
55
|
AaveV3Withdraw: '0x9D4e4b26A5E2e6Dad30C5d95F5cE78A8310F04C2',
|
|
55
56
|
AaveV3SwapBorrowRateMode: '0x630F530Ac523C935cf2528E62D0A06F8900C5b1B',
|
|
@@ -157,9 +158,9 @@ export const actionAddresses = {
|
|
|
157
158
|
McdRatioCheck: '0x3f09773e5e945C6Aa1bc8a8B3492f507620DE1e1',
|
|
158
159
|
GasFeeTaker: '0x431F1E1A9859EF99953801dbdeB31d2846ADcc0d',
|
|
159
160
|
CurveStethPoolDeposit: '0x5Ae5870dC0C780e9eb68bE7a223eCd7F3BDad12B',
|
|
160
|
-
CurveStethPoolWithdraw: '
|
|
161
|
+
CurveStethPoolWithdraw: '0x41313695a4829a80c8019Ec8bCC529Fec08F9099',
|
|
161
162
|
CurveDeposit: '0xf46aCCE6d2559971bF5Aea03A10B3679709CE43d',
|
|
162
|
-
CurveWithdraw: '
|
|
163
|
+
CurveWithdraw: '0x7127A1Cd69eC2A1F91661bc0ED40aD5B73898A54',
|
|
163
164
|
McdBoostComposite: '0x0000000000000000000000000000000000000000',
|
|
164
165
|
McdRepayComposite: '0x0000000000000000000000000000000000000000',
|
|
165
166
|
// Euler
|
package/esm/src/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ declare const actionAddressesAllChains: {
|
|
|
55
55
|
AaveCollateralSwitch: string;
|
|
56
56
|
AaveUnstake: string;
|
|
57
57
|
AaveClaimAAVE: string;
|
|
58
|
+
AaveClaimStkAave: string;
|
|
58
59
|
AaveV3Withdraw: string;
|
|
59
60
|
AaveV3SwapBorrowRateMode: string;
|
|
60
61
|
AaveV3Supply: string;
|
|
@@ -253,6 +254,7 @@ declare const actionAddressesAllChains: {
|
|
|
253
254
|
AaveCollateralSwitch?: undefined;
|
|
254
255
|
AaveUnstake?: undefined;
|
|
255
256
|
AaveClaimAAVE?: undefined;
|
|
257
|
+
AaveClaimStkAave?: undefined;
|
|
256
258
|
AaveV3View?: undefined;
|
|
257
259
|
MorphoAaveV2Borrow?: undefined;
|
|
258
260
|
MorphoAaveV2Payback?: undefined;
|
|
@@ -424,6 +426,7 @@ declare const actionAddressesAllChains: {
|
|
|
424
426
|
AaveCollateralSwitch?: undefined;
|
|
425
427
|
AaveUnstake?: undefined;
|
|
426
428
|
AaveClaimAAVE?: undefined;
|
|
429
|
+
AaveClaimStkAave?: undefined;
|
|
427
430
|
AaveV3ClaimRewards?: undefined;
|
|
428
431
|
AaveV3View?: undefined;
|
|
429
432
|
MorphoAaveV2Borrow?: undefined;
|
|
@@ -600,6 +603,7 @@ declare const actionAddressesAllChains: {
|
|
|
600
603
|
AaveCollateralSwitch?: undefined;
|
|
601
604
|
AaveUnstake?: undefined;
|
|
602
605
|
AaveClaimAAVE?: undefined;
|
|
606
|
+
AaveClaimStkAave?: undefined;
|
|
603
607
|
MorphoAaveV2Borrow?: undefined;
|
|
604
608
|
MorphoAaveV2Payback?: undefined;
|
|
605
609
|
MorphoAaveV2Supply?: undefined;
|
|
@@ -757,6 +761,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
757
761
|
AaveCollateralSwitch: string;
|
|
758
762
|
AaveUnstake: string;
|
|
759
763
|
AaveClaimAAVE: string;
|
|
764
|
+
AaveClaimStkAave: string;
|
|
760
765
|
AaveV3Withdraw: string;
|
|
761
766
|
AaveV3SwapBorrowRateMode: string;
|
|
762
767
|
AaveV3Supply: string;
|
|
@@ -955,6 +960,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
955
960
|
AaveCollateralSwitch?: undefined;
|
|
956
961
|
AaveUnstake?: undefined;
|
|
957
962
|
AaveClaimAAVE?: undefined;
|
|
963
|
+
AaveClaimStkAave?: undefined;
|
|
958
964
|
AaveV3View?: undefined;
|
|
959
965
|
MorphoAaveV2Borrow?: undefined;
|
|
960
966
|
MorphoAaveV2Payback?: undefined;
|
|
@@ -1126,6 +1132,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1126
1132
|
AaveCollateralSwitch?: undefined;
|
|
1127
1133
|
AaveUnstake?: undefined;
|
|
1128
1134
|
AaveClaimAAVE?: undefined;
|
|
1135
|
+
AaveClaimStkAave?: undefined;
|
|
1129
1136
|
AaveV3ClaimRewards?: undefined;
|
|
1130
1137
|
AaveV3View?: undefined;
|
|
1131
1138
|
MorphoAaveV2Borrow?: undefined;
|
|
@@ -1302,6 +1309,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1302
1309
|
AaveCollateralSwitch?: undefined;
|
|
1303
1310
|
AaveUnstake?: undefined;
|
|
1304
1311
|
AaveClaimAAVE?: undefined;
|
|
1312
|
+
AaveClaimStkAave?: undefined;
|
|
1305
1313
|
MorphoAaveV2Borrow?: undefined;
|
|
1306
1314
|
MorphoAaveV2Payback?: undefined;
|
|
1307
1315
|
MorphoAaveV2Supply?: undefined;
|
|
@@ -1602,6 +1610,7 @@ declare const _default: {
|
|
|
1602
1610
|
AaveCollateralSwitch: string;
|
|
1603
1611
|
AaveUnstake: string;
|
|
1604
1612
|
AaveClaimAAVE: string;
|
|
1613
|
+
AaveClaimStkAave: string;
|
|
1605
1614
|
AaveV3Withdraw: string;
|
|
1606
1615
|
AaveV3SwapBorrowRateMode: string;
|
|
1607
1616
|
AaveV3Supply: string;
|
|
@@ -1800,6 +1809,7 @@ declare const _default: {
|
|
|
1800
1809
|
AaveCollateralSwitch?: undefined;
|
|
1801
1810
|
AaveUnstake?: undefined;
|
|
1802
1811
|
AaveClaimAAVE?: undefined;
|
|
1812
|
+
AaveClaimStkAave?: undefined;
|
|
1803
1813
|
AaveV3View?: undefined;
|
|
1804
1814
|
MorphoAaveV2Borrow?: undefined;
|
|
1805
1815
|
MorphoAaveV2Payback?: undefined;
|
|
@@ -1971,6 +1981,7 @@ declare const _default: {
|
|
|
1971
1981
|
AaveCollateralSwitch?: undefined;
|
|
1972
1982
|
AaveUnstake?: undefined;
|
|
1973
1983
|
AaveClaimAAVE?: undefined;
|
|
1984
|
+
AaveClaimStkAave?: undefined;
|
|
1974
1985
|
AaveV3ClaimRewards?: undefined;
|
|
1975
1986
|
AaveV3View?: undefined;
|
|
1976
1987
|
MorphoAaveV2Borrow?: undefined;
|
|
@@ -2147,6 +2158,7 @@ declare const _default: {
|
|
|
2147
2158
|
AaveCollateralSwitch?: undefined;
|
|
2148
2159
|
AaveUnstake?: undefined;
|
|
2149
2160
|
AaveClaimAAVE?: undefined;
|
|
2161
|
+
AaveClaimStkAave?: undefined;
|
|
2150
2162
|
MorphoAaveV2Borrow?: undefined;
|
|
2151
2163
|
MorphoAaveV2Payback?: undefined;
|
|
2152
2164
|
MorphoAaveV2Supply?: undefined;
|
|
@@ -2304,6 +2316,7 @@ declare const _default: {
|
|
|
2304
2316
|
AaveCollateralSwitch: string;
|
|
2305
2317
|
AaveUnstake: string;
|
|
2306
2318
|
AaveClaimAAVE: string;
|
|
2319
|
+
AaveClaimStkAave: string;
|
|
2307
2320
|
AaveV3Withdraw: string;
|
|
2308
2321
|
AaveV3SwapBorrowRateMode: string;
|
|
2309
2322
|
AaveV3Supply: string;
|
|
@@ -2502,6 +2515,7 @@ declare const _default: {
|
|
|
2502
2515
|
AaveCollateralSwitch?: undefined;
|
|
2503
2516
|
AaveUnstake?: undefined;
|
|
2504
2517
|
AaveClaimAAVE?: undefined;
|
|
2518
|
+
AaveClaimStkAave?: undefined;
|
|
2505
2519
|
AaveV3View?: undefined;
|
|
2506
2520
|
MorphoAaveV2Borrow?: undefined;
|
|
2507
2521
|
MorphoAaveV2Payback?: undefined;
|
|
@@ -2673,6 +2687,7 @@ declare const _default: {
|
|
|
2673
2687
|
AaveCollateralSwitch?: undefined;
|
|
2674
2688
|
AaveUnstake?: undefined;
|
|
2675
2689
|
AaveClaimAAVE?: undefined;
|
|
2690
|
+
AaveClaimStkAave?: undefined;
|
|
2676
2691
|
AaveV3ClaimRewards?: undefined;
|
|
2677
2692
|
AaveV3View?: undefined;
|
|
2678
2693
|
MorphoAaveV2Borrow?: undefined;
|
|
@@ -2849,6 +2864,7 @@ declare const _default: {
|
|
|
2849
2864
|
AaveCollateralSwitch?: undefined;
|
|
2850
2865
|
AaveUnstake?: undefined;
|
|
2851
2866
|
AaveClaimAAVE?: undefined;
|
|
2867
|
+
AaveClaimStkAave?: undefined;
|
|
2852
2868
|
MorphoAaveV2Borrow?: undefined;
|
|
2853
2869
|
MorphoAaveV2Payback?: undefined;
|
|
2854
2870
|
MorphoAaveV2Supply?: undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityDebtInFrontWithLimitTrigger extends Action {
|
|
9
|
+
constructor(troveOwner: EthAddress, debtInFront: uint256);
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityDebtInFrontWithLimitTrigger extends Action {
|
|
9
|
+
constructor(troveOwner, debtInFront) {
|
|
10
|
+
super('LiquityDebtInFrontWithLimitTrigger', getAddr('LiquityDebtInFrontWithLimitTrigger'), ['address', 'uint256'], [troveOwner, debtInFront]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { EthAddress, uint256, uint8 } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoAaveV2RatioTrigger extends Action {
|
|
9
|
+
constructor(user: EthAddress, ratio: uint256, state: uint8);
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export class MorphoAaveV2RatioTrigger extends Action {
|
|
9
|
+
constructor(user, ratio, state) {
|
|
10
|
+
super('MorphoAaveV2RatioTrigger', getAddr('MorphoAaveV2RatioTrigger'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -11,5 +11,7 @@ export * from './CompV3RatioTrigger';
|
|
|
11
11
|
export * from './TrailingStopTrigger';
|
|
12
12
|
export * from './CBRebondTrigger';
|
|
13
13
|
export * from './AaveV3QuotePriceTrigger';
|
|
14
|
+
export * from './MorphoAaveV2RatioTrigger';
|
|
14
15
|
export * from './SparkRatioTrigger';
|
|
15
16
|
export * from './SparkQuotePriceTrigger';
|
|
17
|
+
export * from './LiquityDebtInFrontWithLimitTrigger';
|
|
@@ -11,5 +11,7 @@ export * from './CompV3RatioTrigger';
|
|
|
11
11
|
export * from './TrailingStopTrigger';
|
|
12
12
|
export * from './CBRebondTrigger';
|
|
13
13
|
export * from './AaveV3QuotePriceTrigger';
|
|
14
|
+
export * from './MorphoAaveV2RatioTrigger';
|
|
14
15
|
export * from './SparkRatioTrigger';
|
|
15
16
|
export * from './SparkQuotePriceTrigger';
|
|
17
|
+
export * from './LiquityDebtInFrontWithLimitTrigger';
|
package/esm/src/types.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
type AccessListItem = {
|
|
1
|
+
declare type AccessListItem = {
|
|
2
2
|
address: EthAddress;
|
|
3
3
|
storageKeys: Array<any>;
|
|
4
4
|
};
|
|
5
|
-
type AccessList = Array<Array<any>>;
|
|
6
|
-
type AccessLists = {
|
|
5
|
+
declare type AccessList = Array<Array<any>>;
|
|
6
|
+
declare type AccessLists = {
|
|
7
7
|
[key: string]: AccessList;
|
|
8
8
|
};
|
|
9
|
-
type Config = {
|
|
9
|
+
declare type Config = {
|
|
10
10
|
chainId: number;
|
|
11
11
|
testingMode: boolean;
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
};
|
|
14
|
-
type Network = {
|
|
14
|
+
declare type Network = {
|
|
15
15
|
chainId: number;
|
|
16
16
|
chainName: string;
|
|
17
17
|
blockExplorerUrls: Array<string>;
|
|
@@ -23,24 +23,24 @@ type Network = {
|
|
|
23
23
|
symbol: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
type Networks = {
|
|
26
|
+
declare type Networks = {
|
|
27
27
|
ethereum: Network;
|
|
28
28
|
optimism: Network;
|
|
29
29
|
arbitrum: Network;
|
|
30
30
|
base: Network;
|
|
31
31
|
};
|
|
32
|
-
type EthAddress = string;
|
|
33
|
-
type bytes32 = string;
|
|
34
|
-
type bytes = string | Array<any>;
|
|
35
|
-
type uint256 = string;
|
|
36
|
-
type uint32 = string;
|
|
37
|
-
type uint160 = string;
|
|
38
|
-
type uint128 = string;
|
|
39
|
-
type uint80 = string;
|
|
40
|
-
type uint64 = string;
|
|
41
|
-
type uint24 = string;
|
|
42
|
-
type uint16 = string;
|
|
43
|
-
type uint8 = string;
|
|
44
|
-
type int256 = string;
|
|
45
|
-
type int24 = string;
|
|
32
|
+
declare type EthAddress = string;
|
|
33
|
+
declare type bytes32 = string;
|
|
34
|
+
declare type bytes = string | Array<any>;
|
|
35
|
+
declare type uint256 = string;
|
|
36
|
+
declare type uint32 = string;
|
|
37
|
+
declare type uint160 = string;
|
|
38
|
+
declare type uint128 = string;
|
|
39
|
+
declare type uint80 = string;
|
|
40
|
+
declare type uint64 = string;
|
|
41
|
+
declare type uint24 = string;
|
|
42
|
+
declare type uint16 = string;
|
|
43
|
+
declare type uint8 = string;
|
|
44
|
+
declare type int256 = string;
|
|
45
|
+
declare type int24 = string;
|
|
46
46
|
export { AccessList, AccessListItem, AccessLists, Config, Network, Networks, EthAddress, bytes32, bytes, uint256, uint160, uint32, uint128, uint80, uint64, uint24, uint16, uint8, int256, int24, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.57",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./umd/index.js",
|
|
6
6
|
"module": "./esm/src/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@defisaver/eslint-config": "^1.0.0",
|
|
23
|
-
"@defisaver/tokens": "^1.5.
|
|
23
|
+
"@defisaver/tokens": "^1.5.2",
|
|
24
24
|
"@ethersproject/address": "^5.0.10",
|
|
25
25
|
"@ethersproject/solidity": "^5.0.9",
|
|
26
26
|
"@types/web3-eth-abi": "^1.2.2",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint8, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* LiquityRatioCheckAction - Checks liquity ratio increase for user position and reverts if faulty
|
|
7
|
+
*
|
|
8
|
+
* @category Checkers
|
|
9
|
+
*/
|
|
10
|
+
export class LiquityRatioIncreaseCheckAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param targetRatio The ratio user want to be at
|
|
13
|
+
*/
|
|
14
|
+
constructor(targetRatioIncrease:uint256) {
|
|
15
|
+
super('LiquityRatioIncreaseCheck', getAddr('LiquityRatioIncreaseCheck'), ['uint256'], [targetRatioIncrease]);
|
|
16
|
+
|
|
17
|
+
this.mappableArgs = [
|
|
18
|
+
this.args[0],
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MorphoAaveV2RatioCheckAction - Checks Morpho-AaveV2 ratio for user position and reverts if faulty
|
|
7
|
+
*
|
|
8
|
+
* @category Checkers
|
|
9
|
+
*/
|
|
10
|
+
export class MorphoAaveV2RatioCheckAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param ratioState If it should lower/higher
|
|
13
|
+
* @param targetRatio The ratio user want to be at
|
|
14
|
+
* @param user Address of the user we are checking the ratio for (default to proxy)
|
|
15
|
+
*/
|
|
16
|
+
constructor(ratioState:uint8, targetRatio:uint256, user:EthAddress) {
|
|
17
|
+
super('MorphoAaveV2RatioCheck', getAddr('MorphoAaveV2RatioCheck'), ['uint8', 'uint256', 'address'], [ratioState, targetRatio, user]);
|
|
18
|
+
|
|
19
|
+
this.mappableArgs = [
|
|
20
|
+
this.args[0],
|
|
21
|
+
this.args[1],
|
|
22
|
+
this.args[2],
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './MakerRatioCheckAction';
|
|
2
2
|
export * from './AaveV3RatioCheckAction';
|
|
3
3
|
export * from './CompoundV3RatioCheckAction';
|
|
4
|
+
export * from './MorphoAaveV2RatioCheckAction';
|
|
4
5
|
export * from './LiquityRatioCheckAction';
|
|
5
6
|
export * from './SparkRatioCheckAction';
|
|
7
|
+
export * from './LiquityRatioIncreaseCheckAction';
|
package/src/addresses.ts
CHANGED
|
@@ -57,6 +57,7 @@ export const actionAddresses = {
|
|
|
57
57
|
AaveCollateralSwitch: '0xFf5dfF1B90bd5Aa6E12768AB497dB90cc9DE6F5d',
|
|
58
58
|
AaveUnstake: '0x2FE4024e350cD2c64D2fd0Db5d16F5cE54Ca0E09',
|
|
59
59
|
AaveClaimAAVE: '0xd52855bD011F3D87565f9040DdE2A59fB1b27b15',
|
|
60
|
+
AaveClaimStkAave: '0x5Dcd9Dc0185a6Ab07a31e5284D16Ce9f0A79Ce99',
|
|
60
61
|
// aave v3
|
|
61
62
|
AaveV3Withdraw: '0x9D4e4b26A5E2e6Dad30C5d95F5cE78A8310F04C2',
|
|
62
63
|
AaveV3SwapBorrowRateMode: '0x630F530Ac523C935cf2528E62D0A06F8900C5b1B',
|
|
@@ -184,10 +185,10 @@ export const actionAddresses = {
|
|
|
184
185
|
GasFeeTaker: '0x431F1E1A9859EF99953801dbdeB31d2846ADcc0d',
|
|
185
186
|
|
|
186
187
|
CurveStethPoolDeposit: '0x5Ae5870dC0C780e9eb68bE7a223eCd7F3BDad12B',
|
|
187
|
-
CurveStethPoolWithdraw: '
|
|
188
|
+
CurveStethPoolWithdraw: '0x41313695a4829a80c8019Ec8bCC529Fec08F9099',
|
|
188
189
|
|
|
189
190
|
CurveDeposit: '0xf46aCCE6d2559971bF5Aea03A10B3679709CE43d',
|
|
190
|
-
CurveWithdraw: '
|
|
191
|
+
CurveWithdraw: '0x7127A1Cd69eC2A1F91661bc0ED40aD5B73898A54',
|
|
191
192
|
|
|
192
193
|
McdBoostComposite: '0x0000000000000000000000000000000000000000',
|
|
193
194
|
McdRepayComposite: '0x0000000000000000000000000000000000000000',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint8 } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @category Triggers
|
|
9
|
+
*/
|
|
10
|
+
export class LiquityDebtInFrontWithLimitTrigger extends Action {
|
|
11
|
+
constructor(troveOwner:EthAddress, debtInFront:uint256) {
|
|
12
|
+
super(
|
|
13
|
+
'LiquityDebtInFrontWithLimitTrigger',
|
|
14
|
+
getAddr('LiquityDebtInFrontWithLimitTrigger'),
|
|
15
|
+
['address', 'uint256'],
|
|
16
|
+
[troveOwner, debtInFront],
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint8 } from '../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* @category Triggers
|
|
10
|
+
*/
|
|
11
|
+
export class MorphoAaveV2RatioTrigger extends Action {
|
|
12
|
+
constructor(user:EthAddress, ratio:uint256, state:uint8) {
|
|
13
|
+
super('MorphoAaveV2RatioTrigger', getAddr('MorphoAaveV2RatioTrigger'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/triggers/index.ts
CHANGED
|
@@ -11,5 +11,7 @@ export * from './CompV3RatioTrigger';
|
|
|
11
11
|
export * from './TrailingStopTrigger';
|
|
12
12
|
export * from './CBRebondTrigger';
|
|
13
13
|
export * from './AaveV3QuotePriceTrigger';
|
|
14
|
+
export * from './MorphoAaveV2RatioTrigger';
|
|
14
15
|
export * from './SparkRatioTrigger';
|
|
15
16
|
export * from './SparkQuotePriceTrigger';
|
|
17
|
+
export * from './LiquityDebtInFrontWithLimitTrigger';
|