@defisaver/sdk 1.2.15-dev-allocator-2 → 1.2.16-dev-liquity-v2-1
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/basic/SendTokensAction.d.ts +1 -1
- package/esm/src/actions/basic/SendTokensAction.js +1 -1
- package/esm/src/actions/basic/SendTokensAndUnwrapAction.d.ts +15 -0
- package/esm/src/actions/basic/SendTokensAndUnwrapAction.js +31 -0
- package/esm/src/actions/basic/index.d.ts +1 -0
- package/esm/src/actions/basic/index.js +1 -0
- package/esm/src/actions/checkers/LiquityV2RatioCheckAction.d.ts +16 -0
- package/esm/src/actions/checkers/LiquityV2RatioCheckAction.js +24 -0
- package/esm/src/actions/checkers/index.d.ts +1 -0
- package/esm/src/actions/checkers/index.js +1 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/actions/liquityV2/LiquityV2AdjustAction.d.ts +21 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustAction.js +54 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustInterestRateAction.d.ts +18 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustInterestRateAction.js +42 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustZombieTroveAction.d.ts +23 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustZombieTroveAction.js +62 -0
- package/esm/src/actions/liquityV2/LiquityV2BorrowAction.d.ts +17 -0
- package/esm/src/actions/liquityV2/LiquityV2BorrowAction.js +38 -0
- package/esm/src/actions/liquityV2/LiquityV2ClaimAction.d.ts +14 -0
- package/esm/src/actions/liquityV2/LiquityV2ClaimAction.js +26 -0
- package/esm/src/actions/liquityV2/LiquityV2CloseAction.d.ts +20 -0
- package/esm/src/actions/liquityV2/LiquityV2CloseAction.js +49 -0
- package/esm/src/actions/liquityV2/LiquityV2OpenAction.d.ts +29 -0
- package/esm/src/actions/liquityV2/LiquityV2OpenAction.js +86 -0
- package/esm/src/actions/liquityV2/LiquityV2PaybackAction.d.ts +20 -0
- package/esm/src/actions/liquityV2/LiquityV2PaybackAction.js +49 -0
- package/esm/src/actions/liquityV2/LiquityV2SPClaimCollAction.d.ts +14 -0
- package/esm/src/actions/liquityV2/LiquityV2SPClaimCollAction.js +26 -0
- package/esm/src/actions/liquityV2/LiquityV2SPDepositAction.d.ts +22 -0
- package/esm/src/actions/liquityV2/LiquityV2SPDepositAction.js +57 -0
- package/esm/src/actions/liquityV2/LiquityV2SPWithdrawAction.d.ts +17 -0
- package/esm/src/actions/liquityV2/LiquityV2SPWithdrawAction.js +38 -0
- package/esm/src/actions/liquityV2/LiquityV2SupplyAction.d.ts +22 -0
- package/esm/src/actions/liquityV2/LiquityV2SupplyAction.js +50 -0
- package/esm/src/actions/liquityV2/LiquityV2WithdrawAction.d.ts +16 -0
- package/esm/src/actions/liquityV2/LiquityV2WithdrawAction.js +34 -0
- package/esm/src/actions/liquityV2/index.d.ts +13 -0
- package/esm/src/actions/liquityV2/index.js +13 -0
- package/esm/src/actions/morpho-blue/MorphoBlueReallocateLiquidityAction.js +1 -1
- package/esm/src/addresses.d.ts +54 -2
- package/esm/src/addresses.js +16 -0
- package/esm/src/index.d.ts +216 -8
- package/esm/src/triggers/ClosePriceTrigger.d.ts +10 -0
- package/esm/src/triggers/ClosePriceTrigger.js +12 -0
- package/esm/src/triggers/LiquityRatioTrigger.js +1 -1
- package/esm/src/triggers/LiquityV2RatioTrigger.d.ts +8 -0
- package/esm/src/triggers/LiquityV2RatioTrigger.js +10 -0
- package/esm/src/triggers/index.d.ts +2 -0
- package/esm/src/triggers/index.js +2 -0
- package/package.json +2 -2
- package/src/actions/basic/SendTokensAction.ts +1 -1
- package/src/actions/basic/SendTokensAndUnwrapAction.ts +38 -0
- package/src/actions/basic/index.ts +2 -1
- package/src/actions/checkers/LiquityV2RatioCheckAction.ts +32 -0
- package/src/actions/checkers/index.ts +2 -1
- package/src/actions/index.ts +2 -0
- package/src/actions/liquityV2/LiquityV2AdjustAction.ts +73 -0
- package/src/actions/liquityV2/LiquityV2AdjustInterestRateAction.ts +57 -0
- package/src/actions/liquityV2/LiquityV2AdjustZombieTroveAction.ts +82 -0
- package/src/actions/liquityV2/LiquityV2BorrowAction.ts +52 -0
- package/src/actions/liquityV2/LiquityV2ClaimAction.ts +37 -0
- package/src/actions/liquityV2/LiquityV2CloseAction.ts +53 -0
- package/src/actions/liquityV2/LiquityV2OpenAction.ts +101 -0
- package/src/actions/liquityV2/LiquityV2PaybackAction.ts +52 -0
- package/src/actions/liquityV2/LiquityV2SPClaimCollAction.ts +37 -0
- package/src/actions/liquityV2/LiquityV2SPDepositAction.ts +62 -0
- package/src/actions/liquityV2/LiquityV2SPWithdrawAction.ts +52 -0
- package/src/actions/liquityV2/LiquityV2SupplyAction.ts +57 -0
- package/src/actions/liquityV2/LiquityV2WithdrawAction.ts +47 -0
- package/src/actions/liquityV2/index.ts +13 -0
- package/src/actions/morpho-blue/MorphoBlueReallocateLiquidityAction.ts +1 -1
- package/src/addresses.ts +18 -0
- package/src/triggers/ClosePriceTrigger.ts +19 -0
- package/src/triggers/LiquityRatioTrigger.ts +1 -1
- package/src/triggers/LiquityV2RatioTrigger.ts +17 -0
- package/src/triggers/index.ts +2 -0
- package/test/actions/basic/SendTokensAndUnwrapAction.js +73 -0
- package/umd/index.js +1261 -571
|
@@ -7,7 +7,7 @@ import { EthAddress, uint256 } from '../../types';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class SendTokensAction extends Action {
|
|
9
9
|
/**
|
|
10
|
-
* @param tokens Token
|
|
10
|
+
* @param tokens Token addresses
|
|
11
11
|
* @param receivers Transfer recipients
|
|
12
12
|
* @param amounts Transfer amounts (-1 for whole Recipe (DsProxy) balance)
|
|
13
13
|
*/
|
|
@@ -7,7 +7,7 @@ import { getAddr } from '../../addresses';
|
|
|
7
7
|
*/
|
|
8
8
|
export class SendTokensAction extends Action {
|
|
9
9
|
/**
|
|
10
|
-
* @param tokens Token
|
|
10
|
+
* @param tokens Token addresses
|
|
11
11
|
* @param receivers Transfer recipients
|
|
12
12
|
* @param amounts Transfer amounts (-1 for whole Recipe (DsProxy) balance)
|
|
13
13
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Transfers specified tokens from user's wallet to specified addresses and unwraps for weth address
|
|
5
|
+
*
|
|
6
|
+
* @category BasicActions
|
|
7
|
+
*/
|
|
8
|
+
export declare class SendTokensAndUnwrapAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param tokens Token addresses
|
|
11
|
+
* @param receivers Transfer recipients
|
|
12
|
+
* @param amounts Transfer amounts
|
|
13
|
+
*/
|
|
14
|
+
constructor(tokens: Array<EthAddress>, receivers: Array<EthAddress>, amounts: Array<uint256>);
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* Transfers specified tokens from user's wallet to specified addresses and unwraps for weth address
|
|
5
|
+
*
|
|
6
|
+
* @category BasicActions
|
|
7
|
+
*/
|
|
8
|
+
export class SendTokensAndUnwrapAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param tokens Token addresses
|
|
11
|
+
* @param receivers Transfer recipients
|
|
12
|
+
* @param amounts Transfer amounts
|
|
13
|
+
*/
|
|
14
|
+
constructor(tokens, receivers, amounts) {
|
|
15
|
+
super('SendTokensAndUnwrap', getAddr('Empty'), [
|
|
16
|
+
'address[]',
|
|
17
|
+
'address[]',
|
|
18
|
+
'uint256[]',
|
|
19
|
+
], [tokens, receivers, amounts]);
|
|
20
|
+
this.mappableArgs = [];
|
|
21
|
+
for (let i = 0; i < this.args[0].length; i++) {
|
|
22
|
+
this.mappableArgs.push(this.args[0][i]);
|
|
23
|
+
}
|
|
24
|
+
for (let i = 0; i < this.args[1].length; i++) {
|
|
25
|
+
this.mappableArgs.push(this.args[1][i]);
|
|
26
|
+
}
|
|
27
|
+
for (let i = 0; i < this.args[2].length; i++) {
|
|
28
|
+
this.mappableArgs.push(this.args[2][i]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2RatioCheckAction - Checks liquity ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market Address of the market
|
|
11
|
+
* @param troveId Trove id of the user
|
|
12
|
+
* @param ratioState If it should lower/higher
|
|
13
|
+
* @param targetRatio The ratio user want to be at
|
|
14
|
+
*/
|
|
15
|
+
constructor(market: EthAddress, troveId: uint256, ratioState: uint8, targetRatio: uint256);
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2RatioCheckAction - Checks liquity ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2RatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market Address of the market
|
|
11
|
+
* @param troveId Trove id of the user
|
|
12
|
+
* @param ratioState If it should lower/higher
|
|
13
|
+
* @param targetRatio The ratio user want to be at
|
|
14
|
+
*/
|
|
15
|
+
constructor(market, troveId, ratioState, targetRatio) {
|
|
16
|
+
super('LiquityV2RatioCheck', getAddr('Empty'), ['address', 'uint256', 'uint8', 'uint256'], [market, troveId, ratioState, targetRatio]);
|
|
17
|
+
this.mappableArgs = [
|
|
18
|
+
this.args[0],
|
|
19
|
+
this.args[1],
|
|
20
|
+
this.args[2],
|
|
21
|
+
this.args[3],
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -31,7 +31,8 @@ import * as llamalend from './llamalend';
|
|
|
31
31
|
import * as merkl from './merkl';
|
|
32
32
|
import * as eulerV2 from './eulerV2';
|
|
33
33
|
import * as sky from './sky';
|
|
34
|
+
import * as liquityV2 from './liquityV2';
|
|
34
35
|
import * as stkgho from './stkgho';
|
|
35
36
|
import * as renzo from './renzo';
|
|
36
37
|
import * as etherfi from './etherfi';
|
|
37
|
-
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, renzo, etherfi, };
|
|
38
|
+
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, liquityV2, stkgho, renzo, etherfi, };
|
package/esm/src/actions/index.js
CHANGED
|
@@ -31,7 +31,8 @@ import * as llamalend from './llamalend';
|
|
|
31
31
|
import * as merkl from './merkl';
|
|
32
32
|
import * as eulerV2 from './eulerV2';
|
|
33
33
|
import * as sky from './sky';
|
|
34
|
+
import * as liquityV2 from './liquityV2';
|
|
34
35
|
import * as stkgho from './stkgho';
|
|
35
36
|
import * as renzo from './renzo';
|
|
36
37
|
import * as etherfi from './etherfi';
|
|
37
|
-
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, renzo, etherfi, };
|
|
38
|
+
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, liquityV2, stkgho, renzo, etherfi, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, uint8 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2AdjustAction - Adjusts a trove's collateral and/or debt
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2AdjustAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param from address from which to take the collateral or pay debt
|
|
12
|
+
* @param to address to which to send the collateral or borrowed debt
|
|
13
|
+
* @param troveId id of the trove being adjusted
|
|
14
|
+
* @param collAmount collateral amount to supply/withdraw
|
|
15
|
+
* @param debtAmount debt amount to borrow/payback
|
|
16
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
17
|
+
* @param collAction specify if collateral is supplied or withdrawn
|
|
18
|
+
* @param debtAction specify if debt is borrowed or paid back
|
|
19
|
+
*/
|
|
20
|
+
constructor(market: EthAddress, from: EthAddress, to: EthAddress, troveId: uint256, collAmount: uint256, debtAmount: uint256, maxUpfrontFee: uint256, collAction: uint8, debtAction: uint8);
|
|
21
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2AdjustAction - Adjusts a trove's collateral and/or debt
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2AdjustAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param from address from which to take the collateral or pay debt
|
|
12
|
+
* @param to address to which to send the collateral or borrowed debt
|
|
13
|
+
* @param troveId id of the trove being adjusted
|
|
14
|
+
* @param collAmount collateral amount to supply/withdraw
|
|
15
|
+
* @param debtAmount debt amount to borrow/payback
|
|
16
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
17
|
+
* @param collAction specify if collateral is supplied or withdrawn
|
|
18
|
+
* @param debtAction specify if debt is borrowed or paid back
|
|
19
|
+
*/
|
|
20
|
+
constructor(market, from, to, troveId, collAmount, debtAmount, maxUpfrontFee, collAction, debtAction) {
|
|
21
|
+
super('LiquityV2Adjust', getAddr('LiquityV2Adjust'), [
|
|
22
|
+
'address',
|
|
23
|
+
'address',
|
|
24
|
+
'address',
|
|
25
|
+
'uint256',
|
|
26
|
+
'uint256',
|
|
27
|
+
'uint256',
|
|
28
|
+
'uint256',
|
|
29
|
+
'uint8',
|
|
30
|
+
'uint8',
|
|
31
|
+
], [
|
|
32
|
+
market,
|
|
33
|
+
from,
|
|
34
|
+
to,
|
|
35
|
+
troveId,
|
|
36
|
+
collAmount,
|
|
37
|
+
debtAmount,
|
|
38
|
+
maxUpfrontFee,
|
|
39
|
+
collAction,
|
|
40
|
+
debtAction,
|
|
41
|
+
]);
|
|
42
|
+
this.mappableArgs = [
|
|
43
|
+
this.args[0],
|
|
44
|
+
this.args[1],
|
|
45
|
+
this.args[2],
|
|
46
|
+
this.args[3],
|
|
47
|
+
this.args[4],
|
|
48
|
+
this.args[5],
|
|
49
|
+
this.args[6],
|
|
50
|
+
this.args[7],
|
|
51
|
+
this.args[8],
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2AdjustInterestRateAction - Adjusts the interest rate for a specific trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2AdjustInterestRateAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param troveId id of the trove to adjust the interest rate for
|
|
12
|
+
* @param newAnnualInterestRate the new annual interest rate
|
|
13
|
+
* @param upperHint upper hint for trove positioning
|
|
14
|
+
* @param lowerHint lower hint for trove positioning
|
|
15
|
+
* @param maxUpfrontFee maximum upfront fee the user is willing to pay
|
|
16
|
+
*/
|
|
17
|
+
constructor(market: EthAddress, troveId: uint256, newAnnualInterestRate: uint256, upperHint: uint256, lowerHint: uint256, maxUpfrontFee: uint256);
|
|
18
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2AdjustInterestRateAction - Adjusts the interest rate for a specific trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2AdjustInterestRateAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param troveId id of the trove to adjust the interest rate for
|
|
12
|
+
* @param newAnnualInterestRate the new annual interest rate
|
|
13
|
+
* @param upperHint upper hint for trove positioning
|
|
14
|
+
* @param lowerHint lower hint for trove positioning
|
|
15
|
+
* @param maxUpfrontFee maximum upfront fee the user is willing to pay
|
|
16
|
+
*/
|
|
17
|
+
constructor(market, troveId, newAnnualInterestRate, upperHint, lowerHint, maxUpfrontFee) {
|
|
18
|
+
super('LiquityV2AdjustInterestRate', getAddr('LiquityV2AdjustInterestRate'), [
|
|
19
|
+
'address',
|
|
20
|
+
'uint256',
|
|
21
|
+
'uint256',
|
|
22
|
+
'uint256',
|
|
23
|
+
'uint256',
|
|
24
|
+
'uint256',
|
|
25
|
+
], [
|
|
26
|
+
market,
|
|
27
|
+
troveId,
|
|
28
|
+
newAnnualInterestRate,
|
|
29
|
+
upperHint,
|
|
30
|
+
lowerHint,
|
|
31
|
+
maxUpfrontFee,
|
|
32
|
+
]);
|
|
33
|
+
this.mappableArgs = [
|
|
34
|
+
this.args[0],
|
|
35
|
+
this.args[1],
|
|
36
|
+
this.args[2],
|
|
37
|
+
this.args[3],
|
|
38
|
+
this.args[4],
|
|
39
|
+
this.args[5],
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, uint8 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2AdjustZombieTroveAction - Adjusts a trove's collateral and/or debt for a zombie trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2AdjustZombieTroveAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param from address from which to take the collateral or pay debt
|
|
12
|
+
* @param to address to which to send the collateral or borrowed debt
|
|
13
|
+
* @param troveId id of the trove being adjusted
|
|
14
|
+
* @param collAmount collateral amount to supply/withdraw
|
|
15
|
+
* @param debtAmount debt amount to borrow/payback
|
|
16
|
+
* @param upperHint upper hint for the trove insertion
|
|
17
|
+
* @param lowerHint lower hint for the trove insertion
|
|
18
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
19
|
+
* @param collAction specify if collateral is supplied or withdrawn
|
|
20
|
+
* @param debtAction specify if debt is borrowed or paid back
|
|
21
|
+
*/
|
|
22
|
+
constructor(market: EthAddress, from: EthAddress, to: EthAddress, troveId: uint256, collAmount: uint256, debtAmount: uint256, upperHint: uint256, lowerHint: uint256, maxUpfrontFee: uint256, collAction: uint8, debtAction: uint8);
|
|
23
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2AdjustZombieTroveAction - Adjusts a trove's collateral and/or debt for a zombie trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2AdjustZombieTroveAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param from address from which to take the collateral or pay debt
|
|
12
|
+
* @param to address to which to send the collateral or borrowed debt
|
|
13
|
+
* @param troveId id of the trove being adjusted
|
|
14
|
+
* @param collAmount collateral amount to supply/withdraw
|
|
15
|
+
* @param debtAmount debt amount to borrow/payback
|
|
16
|
+
* @param upperHint upper hint for the trove insertion
|
|
17
|
+
* @param lowerHint lower hint for the trove insertion
|
|
18
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
19
|
+
* @param collAction specify if collateral is supplied or withdrawn
|
|
20
|
+
* @param debtAction specify if debt is borrowed or paid back
|
|
21
|
+
*/
|
|
22
|
+
constructor(market, from, to, troveId, collAmount, debtAmount, upperHint, lowerHint, maxUpfrontFee, collAction, debtAction) {
|
|
23
|
+
super('LiquityV2AdjustZombieTrove', getAddr('LiquityV2AdjustZombieTrove'), [
|
|
24
|
+
'address',
|
|
25
|
+
'address',
|
|
26
|
+
'address',
|
|
27
|
+
'uint256',
|
|
28
|
+
'uint256',
|
|
29
|
+
'uint256',
|
|
30
|
+
'uint256',
|
|
31
|
+
'uint256',
|
|
32
|
+
'uint256',
|
|
33
|
+
'uint8',
|
|
34
|
+
'uint8',
|
|
35
|
+
], [
|
|
36
|
+
market,
|
|
37
|
+
from,
|
|
38
|
+
to,
|
|
39
|
+
troveId,
|
|
40
|
+
collAmount,
|
|
41
|
+
debtAmount,
|
|
42
|
+
upperHint,
|
|
43
|
+
lowerHint,
|
|
44
|
+
maxUpfrontFee,
|
|
45
|
+
collAction,
|
|
46
|
+
debtAction,
|
|
47
|
+
]);
|
|
48
|
+
this.mappableArgs = [
|
|
49
|
+
this.args[0],
|
|
50
|
+
this.args[1],
|
|
51
|
+
this.args[2],
|
|
52
|
+
this.args[3],
|
|
53
|
+
this.args[4],
|
|
54
|
+
this.args[5],
|
|
55
|
+
this.args[6],
|
|
56
|
+
this.args[7],
|
|
57
|
+
this.args[8],
|
|
58
|
+
this.args[9],
|
|
59
|
+
this.args[10],
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2BorrowAction - Borrows BOLD from a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2BorrowAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the borrowed BOLD
|
|
12
|
+
* @param troveId id of the trove to borrow from
|
|
13
|
+
* @param amount BOLD amount to borrow
|
|
14
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
15
|
+
*/
|
|
16
|
+
constructor(market: EthAddress, to: EthAddress, troveId: uint256, amount: uint256, maxUpfrontFee: uint256);
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2BorrowAction - Borrows BOLD from a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2BorrowAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the borrowed BOLD
|
|
12
|
+
* @param troveId id of the trove to borrow from
|
|
13
|
+
* @param amount BOLD amount to borrow
|
|
14
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
15
|
+
*/
|
|
16
|
+
constructor(market, to, troveId, amount, maxUpfrontFee) {
|
|
17
|
+
super('LiquityV2Borrow', getAddr('LiquityV2Borrow'), [
|
|
18
|
+
'address',
|
|
19
|
+
'address',
|
|
20
|
+
'uint256',
|
|
21
|
+
'uint256',
|
|
22
|
+
'uint256',
|
|
23
|
+
], [
|
|
24
|
+
market,
|
|
25
|
+
to,
|
|
26
|
+
troveId,
|
|
27
|
+
amount,
|
|
28
|
+
maxUpfrontFee,
|
|
29
|
+
]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0],
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
35
|
+
this.args[4],
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2ClaimAction - Claims collateral left from liquidation from a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2ClaimAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the claimed collateral
|
|
12
|
+
*/
|
|
13
|
+
constructor(market: EthAddress, to: EthAddress);
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2ClaimAction - Claims collateral left from liquidation from a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2ClaimAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the claimed collateral
|
|
12
|
+
*/
|
|
13
|
+
constructor(market, to) {
|
|
14
|
+
super('LiquityV2Claim', getAddr('LiquityV2Claim'), [
|
|
15
|
+
'address',
|
|
16
|
+
'address',
|
|
17
|
+
], [
|
|
18
|
+
market,
|
|
19
|
+
to,
|
|
20
|
+
]);
|
|
21
|
+
this.mappableArgs = [
|
|
22
|
+
this.args[0],
|
|
23
|
+
this.args[1],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2CloseAction - Closes trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2CloseAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param from address from which to take the BOLD
|
|
12
|
+
* @param to address to which to send the collateralToken and WETH gas compensation
|
|
13
|
+
* @param troveId id of the trove to close
|
|
14
|
+
*/
|
|
15
|
+
constructor(market: EthAddress, from: EthAddress, to: EthAddress, troveId: string);
|
|
16
|
+
getAssetsToApprove(): Promise<{
|
|
17
|
+
asset: string;
|
|
18
|
+
owner: any;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
/**
|
|
14
|
+
* LiquityV2CloseAction - Closes trove
|
|
15
|
+
*
|
|
16
|
+
* @category LiquityV2
|
|
17
|
+
*/
|
|
18
|
+
export class LiquityV2CloseAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param market liquity address registry for the market
|
|
21
|
+
* @param from address from which to take the BOLD
|
|
22
|
+
* @param to address to which to send the collateralToken and WETH gas compensation
|
|
23
|
+
* @param troveId id of the trove to close
|
|
24
|
+
*/
|
|
25
|
+
constructor(market, from, to, troveId) {
|
|
26
|
+
super('LiquityV2Close', getAddr('LiquityV2Close'), [
|
|
27
|
+
'address',
|
|
28
|
+
'address',
|
|
29
|
+
'address',
|
|
30
|
+
'uint256',
|
|
31
|
+
], [
|
|
32
|
+
market,
|
|
33
|
+
from,
|
|
34
|
+
to,
|
|
35
|
+
troveId,
|
|
36
|
+
]);
|
|
37
|
+
this.mappableArgs = [
|
|
38
|
+
this.args[0],
|
|
39
|
+
this.args[1],
|
|
40
|
+
this.args[2],
|
|
41
|
+
this.args[3],
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
getAssetsToApprove() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return [{ asset: getAssetInfo('BOLD').address, owner: this.args[1] }];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2OpenAction - Opens up a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2OpenAction extends Action {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
10
|
+
/**
|
|
11
|
+
* @param market liquity address registry for the market
|
|
12
|
+
* @param from address from which to take the collateralToken and WETH gas compensation
|
|
13
|
+
* @param to address to which to send the borrowed BOLD
|
|
14
|
+
* @param collToken address of the collateral token
|
|
15
|
+
* @param interestBatchManager address of the interest batch manager, or address(0) if this trove will not be part of a batch
|
|
16
|
+
* @param ownerIndex owner index of the trove
|
|
17
|
+
* @param collAmount collateral amount
|
|
18
|
+
* @param boldAmount borrowed BOLD amount
|
|
19
|
+
* @param upperHint upper hint for the trove insertion
|
|
20
|
+
* @param lowerHint lower hint for the trove insertion
|
|
21
|
+
* @param annualInterestRate annual interest rate for the trove or 0 if trove will be part of a batch
|
|
22
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
23
|
+
*/
|
|
24
|
+
constructor(market: EthAddress, from: EthAddress, to: EthAddress, collToken: EthAddress, interestBatchManager: EthAddress, ownerIndex: uint256, collAmount: uint256, boldAmount: uint256, upperHint: uint256, lowerHint: uint256, annualInterestRate: uint256, maxUpfrontFee: uint256);
|
|
25
|
+
getAssetsToApprove(): Promise<{
|
|
26
|
+
asset: string;
|
|
27
|
+
owner: any;
|
|
28
|
+
}[]>;
|
|
29
|
+
}
|