@defisaver/positions-sdk 0.0.166-dev13-liquity-v2 → 0.0.166-dev14-liquity-v2
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/cjs/liquityV2/index.js +1 -1
- package/cjs/types/liquityV2.d.ts +14 -0
- package/cjs/types/liquityV2.js +16 -1
- package/esm/liquityV2/index.js +2 -2
- package/esm/types/liquityV2.d.ts +14 -0
- package/esm/types/liquityV2.js +15 -0
- package/package.json +1 -1
- package/src/liquityV2/index.ts +2 -2
- package/src/types/liquityV2.ts +16 -0
package/cjs/liquityV2/index.js
CHANGED
|
@@ -131,7 +131,7 @@ const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, mark
|
|
|
131
131
|
troveId,
|
|
132
132
|
interestRate,
|
|
133
133
|
interestBatchManager,
|
|
134
|
-
debtInFront, troveStatus: types_1.
|
|
134
|
+
debtInFront, troveStatus: types_1.LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, (0, liquityV2Helpers_1.getLiquityV2AggregatedPositionData)({
|
|
135
135
|
usedAssets, assetsData, minCollRatio, interestRate,
|
|
136
136
|
})), { collRatio });
|
|
137
137
|
return payload;
|
package/cjs/types/liquityV2.d.ts
CHANGED
|
@@ -3,6 +3,20 @@ export declare enum LiquityV2Versions {
|
|
|
3
3
|
LiquityV2Eth = "liquityv2eth",
|
|
4
4
|
LiquityV2WstEth = "liquityv2wsteth"
|
|
5
5
|
}
|
|
6
|
+
export declare enum LIQUITY_V2_TROVE_STATUS_ENUM {
|
|
7
|
+
nonExistent = 0,
|
|
8
|
+
active = 1,
|
|
9
|
+
closedByOwner = 2,
|
|
10
|
+
closedByLiquidation = 3,
|
|
11
|
+
zombie = 4
|
|
12
|
+
}
|
|
13
|
+
export declare const LIQUITY_V2_STATUS_MAPPING: {
|
|
14
|
+
nonExistent: string;
|
|
15
|
+
active: string;
|
|
16
|
+
closedByOwner: string;
|
|
17
|
+
closedByLiquidation: string;
|
|
18
|
+
zombie: string;
|
|
19
|
+
};
|
|
6
20
|
export interface LiquityV2MarketInfo {
|
|
7
21
|
chainIds: NetworkNumber[];
|
|
8
22
|
label: string;
|
package/cjs/types/liquityV2.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LiquityV2Versions = void 0;
|
|
3
|
+
exports.LIQUITY_V2_STATUS_MAPPING = exports.LIQUITY_V2_TROVE_STATUS_ENUM = exports.LiquityV2Versions = void 0;
|
|
4
4
|
var LiquityV2Versions;
|
|
5
5
|
(function (LiquityV2Versions) {
|
|
6
6
|
LiquityV2Versions["LiquityV2Eth"] = "liquityv2eth";
|
|
7
7
|
LiquityV2Versions["LiquityV2WstEth"] = "liquityv2wsteth";
|
|
8
8
|
})(LiquityV2Versions || (exports.LiquityV2Versions = LiquityV2Versions = {}));
|
|
9
|
+
var LIQUITY_V2_TROVE_STATUS_ENUM;
|
|
10
|
+
(function (LIQUITY_V2_TROVE_STATUS_ENUM) {
|
|
11
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["nonExistent"] = 0] = "nonExistent";
|
|
12
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["active"] = 1] = "active";
|
|
13
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByOwner"] = 2] = "closedByOwner";
|
|
14
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByLiquidation"] = 3] = "closedByLiquidation";
|
|
15
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["zombie"] = 4] = "zombie";
|
|
16
|
+
})(LIQUITY_V2_TROVE_STATUS_ENUM || (exports.LIQUITY_V2_TROVE_STATUS_ENUM = LIQUITY_V2_TROVE_STATUS_ENUM = {}));
|
|
17
|
+
exports.LIQUITY_V2_STATUS_MAPPING = {
|
|
18
|
+
nonExistent: 'Non existent',
|
|
19
|
+
active: 'Active',
|
|
20
|
+
closedByOwner: 'Closed',
|
|
21
|
+
closedByLiquidation: 'Liquidated',
|
|
22
|
+
zombie: 'Zombie',
|
|
23
|
+
};
|
package/esm/liquityV2/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import Dec from 'decimal.js';
|
|
11
11
|
import { assetAmountInEth, getAssetInfo } from '@defisaver/tokens';
|
|
12
12
|
import { LiquityV2ViewContract } from '../contracts';
|
|
13
|
-
import {
|
|
13
|
+
import { LIQUITY_V2_TROVE_STATUS_ENUM, } from '../types';
|
|
14
14
|
import { getStakingApy, STAKING_ASSETS } from '../staking';
|
|
15
15
|
import { getLiquityV2AggregatedPositionData } from '../helpers/liquityV2Helpers';
|
|
16
16
|
import { ethToWeth } from '../services/utils';
|
|
@@ -122,7 +122,7 @@ export const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsDat
|
|
|
122
122
|
troveId,
|
|
123
123
|
interestRate,
|
|
124
124
|
interestBatchManager,
|
|
125
|
-
debtInFront, troveStatus:
|
|
125
|
+
debtInFront, troveStatus: LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, getLiquityV2AggregatedPositionData({
|
|
126
126
|
usedAssets, assetsData, minCollRatio, interestRate,
|
|
127
127
|
})), { collRatio });
|
|
128
128
|
return payload;
|
package/esm/types/liquityV2.d.ts
CHANGED
|
@@ -3,6 +3,20 @@ export declare enum LiquityV2Versions {
|
|
|
3
3
|
LiquityV2Eth = "liquityv2eth",
|
|
4
4
|
LiquityV2WstEth = "liquityv2wsteth"
|
|
5
5
|
}
|
|
6
|
+
export declare enum LIQUITY_V2_TROVE_STATUS_ENUM {
|
|
7
|
+
nonExistent = 0,
|
|
8
|
+
active = 1,
|
|
9
|
+
closedByOwner = 2,
|
|
10
|
+
closedByLiquidation = 3,
|
|
11
|
+
zombie = 4
|
|
12
|
+
}
|
|
13
|
+
export declare const LIQUITY_V2_STATUS_MAPPING: {
|
|
14
|
+
nonExistent: string;
|
|
15
|
+
active: string;
|
|
16
|
+
closedByOwner: string;
|
|
17
|
+
closedByLiquidation: string;
|
|
18
|
+
zombie: string;
|
|
19
|
+
};
|
|
6
20
|
export interface LiquityV2MarketInfo {
|
|
7
21
|
chainIds: NetworkNumber[];
|
|
8
22
|
label: string;
|
package/esm/types/liquityV2.js
CHANGED
|
@@ -3,3 +3,18 @@ export var LiquityV2Versions;
|
|
|
3
3
|
LiquityV2Versions["LiquityV2Eth"] = "liquityv2eth";
|
|
4
4
|
LiquityV2Versions["LiquityV2WstEth"] = "liquityv2wsteth";
|
|
5
5
|
})(LiquityV2Versions || (LiquityV2Versions = {}));
|
|
6
|
+
export var LIQUITY_V2_TROVE_STATUS_ENUM;
|
|
7
|
+
(function (LIQUITY_V2_TROVE_STATUS_ENUM) {
|
|
8
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["nonExistent"] = 0] = "nonExistent";
|
|
9
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["active"] = 1] = "active";
|
|
10
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByOwner"] = 2] = "closedByOwner";
|
|
11
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByLiquidation"] = 3] = "closedByLiquidation";
|
|
12
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["zombie"] = 4] = "zombie";
|
|
13
|
+
})(LIQUITY_V2_TROVE_STATUS_ENUM || (LIQUITY_V2_TROVE_STATUS_ENUM = {}));
|
|
14
|
+
export const LIQUITY_V2_STATUS_MAPPING = {
|
|
15
|
+
nonExistent: 'Non existent',
|
|
16
|
+
active: 'Active',
|
|
17
|
+
closedByOwner: 'Closed',
|
|
18
|
+
closedByLiquidation: 'Liquidated',
|
|
19
|
+
zombie: 'Zombie',
|
|
20
|
+
};
|
package/package.json
CHANGED
package/src/liquityV2/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { LiquityV2ViewContract } from '../contracts';
|
|
|
5
5
|
import { EthAddress, NetworkNumber } from '../types/common';
|
|
6
6
|
import {
|
|
7
7
|
InnerLiquityV2MarketData,
|
|
8
|
-
|
|
8
|
+
LIQUITY_V2_TROVE_STATUS_ENUM,
|
|
9
9
|
LiquityV2AssetsData, LiquityV2MarketData, LiquityV2MarketInfo, LiquityV2TroveData, LiquityV2UsedAssets,
|
|
10
10
|
} from '../types';
|
|
11
11
|
import { getStakingApy, STAKING_ASSETS } from '../staking';
|
|
@@ -148,7 +148,7 @@ export const getLiquityV2TroveData = async (
|
|
|
148
148
|
interestRate,
|
|
149
149
|
interestBatchManager,
|
|
150
150
|
debtInFront,
|
|
151
|
-
troveStatus:
|
|
151
|
+
troveStatus: LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)],
|
|
152
152
|
...getLiquityV2AggregatedPositionData({
|
|
153
153
|
usedAssets, assetsData, minCollRatio, interestRate,
|
|
154
154
|
}),
|
package/src/types/liquityV2.ts
CHANGED
|
@@ -5,6 +5,22 @@ export enum LiquityV2Versions {
|
|
|
5
5
|
LiquityV2WstEth = 'liquityv2wsteth',
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export enum LIQUITY_V2_TROVE_STATUS_ENUM {
|
|
9
|
+
nonExistent,
|
|
10
|
+
active,
|
|
11
|
+
closedByOwner,
|
|
12
|
+
closedByLiquidation,
|
|
13
|
+
zombie,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const LIQUITY_V2_STATUS_MAPPING = {
|
|
17
|
+
nonExistent: 'Non existent',
|
|
18
|
+
active: 'Active',
|
|
19
|
+
closedByOwner: 'Closed',
|
|
20
|
+
closedByLiquidation: 'Liquidated',
|
|
21
|
+
zombie: 'Zombie',
|
|
22
|
+
};
|
|
23
|
+
|
|
8
24
|
export interface LiquityV2MarketInfo {
|
|
9
25
|
chainIds: NetworkNumber[],
|
|
10
26
|
label: string,
|