@defisaver/sdk 1.3.7 → 1.3.9-dev.0
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/checkers/AaveV3OpenRatioCheckAction.d.ts +3 -2
- package/esm/src/actions/checkers/AaveV3OpenRatioCheckAction.js +5 -7
- package/esm/src/actions/checkers/AaveV3RatioCheckAction.d.ts +4 -2
- package/esm/src/actions/checkers/AaveV3RatioCheckAction.js +6 -2
- package/esm/src/actions/checkers/LiquityV2NewInterestRateCheckerAction.d.ts +15 -0
- package/esm/src/actions/checkers/LiquityV2NewInterestRateCheckerAction.js +22 -0
- package/esm/src/actions/checkers/index.d.ts +1 -0
- package/esm/src/actions/checkers/index.js +1 -0
- package/esm/src/actions/fluid/FluidDexOpenAction.d.ts +20 -0
- package/esm/src/actions/fluid/FluidDexOpenAction.js +45 -0
- package/esm/src/actions/fluid/FluidDexRegularBorrowAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexRegularBorrowAction.js +36 -0
- package/esm/src/actions/fluid/FluidDexRegularPaybackAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexRegularPaybackAction.js +34 -0
- package/esm/src/actions/fluid/FluidDexRegularSupplyAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexRegularSupplyAction.js +33 -0
- package/esm/src/actions/fluid/FluidDexRegularWithdrawAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexRegularWithdrawAction.js +37 -0
- package/esm/src/actions/fluid/FluidDexSmartCollSupplyAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexSmartCollSupplyAction.js +33 -0
- package/esm/src/actions/fluid/FluidDexSmartCollWithdrawAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexSmartCollWithdrawAction.js +37 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtBorrowAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtBorrowAction.js +36 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtPaybackAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtPaybackAction.js +34 -0
- package/esm/src/actions/fluid/index.d.ts +9 -0
- package/esm/src/actions/fluid/index.js +9 -0
- package/esm/src/actions/index.d.ts +3 -1
- package/esm/src/actions/index.js +3 -1
- package/esm/src/actions/sky/SkyClaimRewardsAction.d.ts +2 -2
- package/esm/src/actions/sky/SkyClaimRewardsAction.js +2 -2
- package/esm/src/actions/sky/SkyStakingEngineClaimRewards.d.ts +16 -0
- package/esm/src/actions/sky/SkyStakingEngineClaimRewards.js +24 -0
- package/esm/src/actions/sky/SkyStakingEngineOpen.d.ts +13 -0
- package/esm/src/actions/sky/SkyStakingEngineOpen.js +18 -0
- package/esm/src/actions/sky/SkyStakingEngineSelectFarm.d.ts +15 -0
- package/esm/src/actions/sky/SkyStakingEngineSelectFarm.js +22 -0
- package/esm/src/actions/sky/SkyStakingEngineStake.d.ts +16 -0
- package/esm/src/actions/sky/SkyStakingEngineStake.js +24 -0
- package/esm/src/actions/sky/SkyStakingEngineUnstake.d.ts +16 -0
- package/esm/src/actions/sky/SkyStakingEngineUnstake.js +24 -0
- package/esm/src/actions/sky/SkyUnstakeAction.d.ts +1 -1
- package/esm/src/actions/sky/SkyUnstakeAction.js +1 -1
- package/esm/src/actions/sky/index.d.ts +5 -0
- package/esm/src/actions/sky/index.js +6 -0
- package/esm/src/actions/spark/SparkSPKClaimAction.d.ts +20 -0
- package/esm/src/actions/spark/SparkSPKClaimAction.js +25 -0
- package/esm/src/actions/spark/index.d.ts +1 -0
- package/esm/src/actions/spark/index.js +1 -0
- package/esm/src/actions/stkgho/GhoStakeAction.d.ts +15 -0
- package/esm/src/actions/stkgho/GhoStakeAction.js +25 -0
- package/esm/src/actions/stkgho/index.d.ts +1 -0
- package/esm/src/actions/stkgho/index.js +1 -0
- package/esm/src/actions/summerfi/SFApproveTokensAction.d.ts +14 -0
- package/esm/src/actions/summerfi/SFApproveTokensAction.js +17 -0
- package/esm/src/actions/summerfi/index.d.ts +1 -0
- package/esm/src/actions/summerfi/index.js +1 -0
- package/esm/src/actions/umbrella/UmbrellaClaimRewardsAction.d.ts +16 -0
- package/esm/src/actions/umbrella/UmbrellaClaimRewardsAction.js +22 -0
- package/esm/src/actions/umbrella/UmbrellaFinalizeUnstakeAction.d.ts +18 -0
- package/esm/src/actions/umbrella/UmbrellaFinalizeUnstakeAction.js +31 -0
- package/esm/src/actions/umbrella/UmbrellaStakeAction.d.ts +19 -0
- package/esm/src/actions/umbrella/UmbrellaStakeAction.js +29 -0
- package/esm/src/actions/umbrella/UmbrellaStartUnstakeAction.d.ts +13 -0
- package/esm/src/actions/umbrella/UmbrellaStartUnstakeAction.js +18 -0
- package/esm/src/actions/umbrella/index.d.ts +4 -0
- package/esm/src/actions/umbrella/index.js +4 -0
- package/esm/src/addresses.d.ts +737 -71
- package/esm/src/addresses.js +127 -10
- package/esm/src/config.js +18 -2
- package/esm/src/index.d.ts +3855 -1191
- package/esm/src/triggers/AaveV3QuotePriceRangeTrigger.d.ts +13 -0
- package/esm/src/triggers/AaveV3QuotePriceRangeTrigger.js +15 -0
- package/esm/src/triggers/CompV3PriceRangeTrigger.d.ts +10 -0
- package/esm/src/triggers/CompV3PriceRangeTrigger.js +12 -0
- package/esm/src/triggers/CompV3PriceTrigger.d.ts +10 -0
- package/esm/src/triggers/CompV3PriceTrigger.js +12 -0
- package/esm/src/triggers/LiquityV2AdjustRateDebtInFrontTrigger.d.ts +8 -0
- package/esm/src/triggers/LiquityV2AdjustRateDebtInFrontTrigger.js +10 -0
- package/esm/src/triggers/index.d.ts +4 -0
- package/esm/src/triggers/index.js +4 -0
- package/esm/src/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/actions/checkers/AaveV3OpenRatioCheckAction.ts +10 -8
- package/src/actions/checkers/AaveV3RatioCheckAction.ts +18 -4
- package/src/addresses.ts +1 -0
- package/src/triggers/AaveV3QuotePriceRangeTrigger.ts +27 -0
- package/src/triggers/index.ts +1 -0
- package/umd/index.js +1602 -578
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3QuotePriceRangeTrigger
|
|
5
|
+
* @param baseTokenAddr - The address of the base token
|
|
6
|
+
* @param quoteTokenAddr - The address of the quote token
|
|
7
|
+
* @param lowerPrice - The lower price of the range
|
|
8
|
+
* @param upperPrice - The upper price of the range
|
|
9
|
+
* @category Triggers
|
|
10
|
+
*/
|
|
11
|
+
export declare class AaveV3QuotePriceRangeTrigger extends Action {
|
|
12
|
+
constructor(baseTokenAddr: EthAddress, quoteTokenAddr: EthAddress, lowerPrice: uint256, upperPrice: uint256);
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3QuotePriceRangeTrigger
|
|
5
|
+
* @param baseTokenAddr - The address of the base token
|
|
6
|
+
* @param quoteTokenAddr - The address of the quote token
|
|
7
|
+
* @param lowerPrice - The lower price of the range
|
|
8
|
+
* @param upperPrice - The upper price of the range
|
|
9
|
+
* @category Triggers
|
|
10
|
+
*/
|
|
11
|
+
export class AaveV3QuotePriceRangeTrigger extends Action {
|
|
12
|
+
constructor(baseTokenAddr, quoteTokenAddr, lowerPrice, upperPrice) {
|
|
13
|
+
super('AaveV3QuotePriceRangeTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint256']], [[baseTokenAddr, quoteTokenAddr, lowerPrice, upperPrice]]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -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 CompV3PriceRangeTrigger extends Action {
|
|
9
|
+
constructor(market: EthAddress, collToken: EthAddress, lowerPrice: uint256, upperPrice: 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 CompV3PriceRangeTrigger extends Action {
|
|
9
|
+
constructor(market, collToken, lowerPrice, upperPrice) {
|
|
10
|
+
super('CompV3PriceRangeTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint256']], [[market, collToken, lowerPrice, upperPrice]]);
|
|
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 CompV3PriceTrigger extends Action {
|
|
9
|
+
constructor(market: EthAddress, collToken: EthAddress, user: EthAddress, price: 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 CompV3PriceTrigger extends Action {
|
|
9
|
+
constructor(market, collToken, user, price, state) {
|
|
10
|
+
super('CompV3PriceTrigger', getAddr('Empty'), [['address', 'address', 'address', 'uint256', 'uint8']], [[market, collToken, user, price, state]]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* @category Triggers
|
|
5
|
+
*/
|
|
6
|
+
export declare class LiquityV2AdjustRateDebtInFrontTrigger extends Action {
|
|
7
|
+
constructor(market: EthAddress, troveId: uint256, criticalDebtInFrontLimit: uint256, nonCriticalDebtInFrontLimit: uint256);
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* @category Triggers
|
|
5
|
+
*/
|
|
6
|
+
export class LiquityV2AdjustRateDebtInFrontTrigger extends Action {
|
|
7
|
+
constructor(market, troveId, criticalDebtInFrontLimit, nonCriticalDebtInFrontLimit) {
|
|
8
|
+
super('LiquityV2AdjustRateDebtInFrontTrigger', getAddr('Empty'), ['address', 'uint256', 'uint256', 'uint256'], [market, troveId, criticalDebtInFrontLimit, nonCriticalDebtInFrontLimit]);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -25,3 +25,7 @@ export * from './LiquityV2RatioTrigger';
|
|
|
25
25
|
export * from './ClosePriceTrigger';
|
|
26
26
|
export * from './LiquityV2QuotePriceTrigger';
|
|
27
27
|
export * from './FluidRatioTrigger';
|
|
28
|
+
export * from './CompV3PriceTrigger';
|
|
29
|
+
export * from './CompV3PriceRangeTrigger';
|
|
30
|
+
export * from './LiquityV2AdjustRateDebtInFrontTrigger';
|
|
31
|
+
export * from './AaveV3QuotePriceRangeTrigger';
|
|
@@ -25,3 +25,7 @@ export * from './LiquityV2RatioTrigger';
|
|
|
25
25
|
export * from './ClosePriceTrigger';
|
|
26
26
|
export * from './LiquityV2QuotePriceTrigger';
|
|
27
27
|
export * from './FluidRatioTrigger';
|
|
28
|
+
export * from './CompV3PriceTrigger';
|
|
29
|
+
export * from './CompV3PriceRangeTrigger';
|
|
30
|
+
export * from './LiquityV2AdjustRateDebtInFrontTrigger';
|
|
31
|
+
export * from './AaveV3QuotePriceRangeTrigger';
|
package/esm/src/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { getAddr } from '../../addresses';
|
|
|
3
3
|
import { EthAddress, uint256 } from '../../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* AaveV3OpenRatioCheckAction - Checks aave V3 ratio for
|
|
6
|
+
* AaveV3OpenRatioCheckAction - Checks aave V3 ratio for position of `user` and reverts if faulty.
|
|
7
7
|
*
|
|
8
8
|
* @dev This checker action is different from AaveV3RatioCheckAction in that it checks current ratio without checking previous ratio.
|
|
9
9
|
*
|
|
@@ -13,18 +13,20 @@ export class AaveV3OpenRatioCheckAction extends Action {
|
|
|
13
13
|
/**
|
|
14
14
|
* @param targetRatio The ratio user want to be at
|
|
15
15
|
* @param market Address provider for specific market
|
|
16
|
+
* @param user Address of the user (EOA/SW). This param was added later
|
|
16
17
|
*/
|
|
17
|
-
constructor(
|
|
18
|
+
constructor(
|
|
19
|
+
targetRatio: uint256,
|
|
20
|
+
market: EthAddress,
|
|
21
|
+
user: EthAddress = getAddr('Empty'),
|
|
22
|
+
) {
|
|
18
23
|
super(
|
|
19
24
|
'AaveV3OpenRatioCheck',
|
|
20
25
|
getAddr('Empty'),
|
|
21
|
-
['uint256', 'address'],
|
|
22
|
-
[targetRatio, market],
|
|
26
|
+
['uint256', 'address', 'address'],
|
|
27
|
+
[targetRatio, market, user],
|
|
23
28
|
);
|
|
24
29
|
|
|
25
|
-
this.mappableArgs = [
|
|
26
|
-
this.args[0],
|
|
27
|
-
this.args[1],
|
|
28
|
-
];
|
|
30
|
+
this.mappableArgs = [this.args[0], this.args[1], this.args[2]];
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
|
-
import { uint8, uint256 } from '../../types';
|
|
3
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* AaveV3RatioCheckAction - Checks aave V3 ratio for users proxy position and reverts if faulty
|
|
@@ -11,13 +11,27 @@ export class AaveV3RatioCheckAction extends Action {
|
|
|
11
11
|
/**
|
|
12
12
|
* @param ratioState If it should lower/higher
|
|
13
13
|
* @param targetRatio The ratio user want to be at
|
|
14
|
+
* @param market Address provider for specific market. This param was added later
|
|
15
|
+
* @param user Address of the user (EOA/SW). This param was added later
|
|
14
16
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
17
|
+
constructor(
|
|
18
|
+
ratioState: uint8,
|
|
19
|
+
targetRatio: uint256,
|
|
20
|
+
market: EthAddress = getAddr('Empty'),
|
|
21
|
+
user: EthAddress = getAddr('Empty'),
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'AaveV3RatioCheck',
|
|
25
|
+
getAddr('Empty'),
|
|
26
|
+
['uint8', 'uint256', 'address', 'address'],
|
|
27
|
+
[ratioState, targetRatio, market, user],
|
|
28
|
+
);
|
|
17
29
|
|
|
18
30
|
this.mappableArgs = [
|
|
19
31
|
this.args[0],
|
|
20
32
|
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
21
35
|
];
|
|
22
36
|
}
|
|
23
|
-
}
|
|
37
|
+
}
|
package/src/addresses.ts
CHANGED
|
@@ -379,6 +379,7 @@ export const actionAddresses = {
|
|
|
379
379
|
ApproveToken: '0x842a81d2cfe26d401CD63Cc14e9DEf275c197C1a',
|
|
380
380
|
SendTokenAndUnwrap: '0xd4f69250cb4d1f083Dd372FEace391A16ABbfBDc',
|
|
381
381
|
ToggleSub: '0xfc19a12e35bb0b5e6a3d3017be9e9022a6486eee',
|
|
382
|
+
UpdateSub: '0xAe6ea1d13dF2bE60dC7933DB56067Cb89d6A2cDe',
|
|
382
383
|
CreateSub: '0x2daED8030BFC87B3d27c02E2f044B9CF4841Ff3e',
|
|
383
384
|
TokenBalance: '0xC6FF5b01f7c7b35b6e093fF70D2332B361C5Be5A',
|
|
384
385
|
TokenizedVaultAdapter: '0xdf31669FEd440f5BfF658ca0bBF0D22B8abdeb73',
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AaveV3QuotePriceRangeTrigger
|
|
7
|
+
* @param baseTokenAddr - The address of the base token
|
|
8
|
+
* @param quoteTokenAddr - The address of the quote token
|
|
9
|
+
* @param lowerPrice - The lower price of the range
|
|
10
|
+
* @param upperPrice - The upper price of the range
|
|
11
|
+
* @category Triggers
|
|
12
|
+
*/
|
|
13
|
+
export class AaveV3QuotePriceRangeTrigger extends Action {
|
|
14
|
+
constructor(
|
|
15
|
+
baseTokenAddr: EthAddress,
|
|
16
|
+
quoteTokenAddr: EthAddress,
|
|
17
|
+
lowerPrice: uint256,
|
|
18
|
+
upperPrice: uint256,
|
|
19
|
+
) {
|
|
20
|
+
super(
|
|
21
|
+
'AaveV3QuotePriceRangeTrigger',
|
|
22
|
+
getAddr('Empty'),
|
|
23
|
+
[['address', 'address', 'uint256', 'uint256']],
|
|
24
|
+
[[baseTokenAddr, quoteTokenAddr, lowerPrice, upperPrice]],
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/triggers/index.ts
CHANGED