@defisaver/sdk 1.2.16-dev-liquity-v2-1 → 1.2.16-dev-liquity-v2-2
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/LiquityV2TargetRatioCheckAction.d.ts +15 -0
- package/esm/src/actions/checkers/LiquityV2TargetRatioCheckAction.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/addresses.js +1 -1
- package/esm/src/triggers/LiquityV2QuotePriceTrigger.d.ts +8 -0
- package/esm/src/triggers/LiquityV2QuotePriceTrigger.js +10 -0
- package/esm/src/triggers/index.d.ts +1 -0
- package/esm/src/triggers/index.js +1 -0
- package/package.json +2 -2
- package/src/actions/checkers/LiquityV2TargetRatioCheckAction.ts +30 -0
- package/src/actions/checkers/index.ts +1 -0
- package/src/addresses.ts +1 -1
- package/src/triggers/LiquityV2QuotePriceTrigger.ts +17 -0
- package/src/triggers/index.ts +2 -1
- package/umd/index.js +522 -466
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2TargetRatioCheckAction - Checks liquity target ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2TargetRatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market Address of the market
|
|
11
|
+
* @param troveId Trove id of the user
|
|
12
|
+
* @param targetRatio The ratio user want to be at
|
|
13
|
+
*/
|
|
14
|
+
constructor(market: EthAddress, troveId: uint256, ratioState: uint8, targetRatio: uint256);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2TargetRatioCheckAction - Checks liquity target ratio for user position and reverts if faulty
|
|
5
|
+
*
|
|
6
|
+
* @category Checkers
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2TargetRatioCheckAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market Address of the market
|
|
11
|
+
* @param troveId Trove id of the user
|
|
12
|
+
* @param targetRatio The ratio user want to be at
|
|
13
|
+
*/
|
|
14
|
+
constructor(market, troveId, ratioState, targetRatio) {
|
|
15
|
+
super('LiquityV2RatioCheck', getAddr('Empty'), ['address', 'uint256', 'uint256'], [market, troveId, targetRatio]);
|
|
16
|
+
this.mappableArgs = [
|
|
17
|
+
this.args[0],
|
|
18
|
+
this.args[1],
|
|
19
|
+
this.args[2],
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
}
|
package/esm/src/addresses.js
CHANGED
|
@@ -169,7 +169,7 @@ export const actionAddresses = {
|
|
|
169
169
|
LiquityV2SPDeposit: '0x1e533364fE613AaD64B8D46F7A096Ae0c722239D',
|
|
170
170
|
LiquityV2SPWithdraw: '0xb080DC160415Ffe1a4b80d75b0Be92EE38a0b426',
|
|
171
171
|
LiquityV2SPClaimColl: '0xD50B0295C69e3F77BE7d99e7BdeAc442F37b373b',
|
|
172
|
-
LiquityV2AdjustZombieTrove: '
|
|
172
|
+
LiquityV2AdjustZombieTrove: '0x88bBa5Ce5cE20286Cf866b9f310354FFB701A296',
|
|
173
173
|
// b.protocol
|
|
174
174
|
BprotocolLiquitySPDeposit: '0x5A0436c7559e37da8cD24B0f66C155a0a2fd6309',
|
|
175
175
|
BprotocolLiquitySPWithdraw: '0x20Ece7CB4463bB1DbA4C4fA800E321A05dfB028B',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* @category Triggers
|
|
5
|
+
*/
|
|
6
|
+
export class LiquityV2QuotePriceTrigger extends Action {
|
|
7
|
+
constructor(market, price, state) {
|
|
8
|
+
super('LiquityV2QuotePriceTrigger', getAddr('Empty'), ['address', 'uint256', 'uint8'], [market, price, state]);
|
|
9
|
+
}
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/sdk",
|
|
3
|
-
"version": "1.2.16-dev-liquity-v2-
|
|
3
|
+
"version": "1.2.16-dev-liquity-v2-2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./umd/index.js",
|
|
6
6
|
"module": "./esm/src/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@defisaver/eslint-config": "^1.0.0",
|
|
26
|
-
"@defisaver/tokens": "^1.5.52-dev-
|
|
26
|
+
"@defisaver/tokens": "^1.5.52-dev-3",
|
|
27
27
|
"@ethersproject/address": "^5.0.10",
|
|
28
28
|
"@ethersproject/solidity": "^5.0.9",
|
|
29
29
|
"@types/web3-eth-abi": "^1.2.2",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* LiquityV2TargetRatioCheckAction - Checks liquity target ratio for user position and reverts if faulty
|
|
7
|
+
*
|
|
8
|
+
* @category Checkers
|
|
9
|
+
*/
|
|
10
|
+
export class LiquityV2TargetRatioCheckAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param market Address of the market
|
|
13
|
+
* @param troveId Trove id of the user
|
|
14
|
+
* @param targetRatio The ratio user want to be at
|
|
15
|
+
*/
|
|
16
|
+
constructor(market: EthAddress, troveId: uint256, ratioState:uint8, targetRatio:uint256) {
|
|
17
|
+
super(
|
|
18
|
+
'LiquityV2RatioCheck',
|
|
19
|
+
getAddr('Empty'),
|
|
20
|
+
['address', 'uint256', 'uint256'],
|
|
21
|
+
[market, troveId, targetRatio],
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
this.mappableArgs = [
|
|
25
|
+
this.args[0],
|
|
26
|
+
this.args[1],
|
|
27
|
+
this.args[2],
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/addresses.ts
CHANGED
|
@@ -189,7 +189,7 @@ export const actionAddresses = {
|
|
|
189
189
|
LiquityV2SPDeposit: '0x1e533364fE613AaD64B8D46F7A096Ae0c722239D',
|
|
190
190
|
LiquityV2SPWithdraw: '0xb080DC160415Ffe1a4b80d75b0Be92EE38a0b426',
|
|
191
191
|
LiquityV2SPClaimColl: '0xD50B0295C69e3F77BE7d99e7BdeAc442F37b373b',
|
|
192
|
-
LiquityV2AdjustZombieTrove: '
|
|
192
|
+
LiquityV2AdjustZombieTrove: '0x88bBa5Ce5cE20286Cf866b9f310354FFB701A296',
|
|
193
193
|
|
|
194
194
|
// b.protocol
|
|
195
195
|
BprotocolLiquitySPDeposit: '0x5A0436c7559e37da8cD24B0f66C155a0a2fd6309',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../Action';
|
|
2
|
+
import { getAddr } from '../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint8 } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @category Triggers
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2QuotePriceTrigger extends Action {
|
|
9
|
+
constructor(market: EthAddress, price:uint256, state:uint8) {
|
|
10
|
+
super(
|
|
11
|
+
'LiquityV2QuotePriceTrigger',
|
|
12
|
+
getAddr('Empty'),
|
|
13
|
+
['address', 'uint256', 'uint8'],
|
|
14
|
+
[market, price, state],
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/triggers/index.ts
CHANGED
|
@@ -21,4 +21,5 @@ export * from './CurveUsdHealthRatioTrigger';
|
|
|
21
21
|
export * from './MorphoBlueRatioTrigger';
|
|
22
22
|
export * from './OffchainPriceTrigger';
|
|
23
23
|
export * from './LiquityV2RatioTrigger';
|
|
24
|
-
export * from './ClosePriceTrigger';
|
|
24
|
+
export * from './ClosePriceTrigger';
|
|
25
|
+
export * from './LiquityV2QuotePriceTrigger';
|