@defisaver/positions-sdk 0.0.166-dev13-liquity-v2 → 0.0.166-dev15-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.
@@ -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.LIQUITY_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, (0, liquityV2Helpers_1.getLiquityV2AggregatedPositionData)({
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;
@@ -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;
@@ -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
+ };
@@ -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 { LIQUITY_TROVE_STATUS_ENUM, } from '../types';
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: LIQUITY_TROVE_STATUS_ENUM[parseInt(data.status, 10)] }, getLiquityV2AggregatedPositionData({
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;
@@ -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;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "0.0.166-dev13-liquity-v2",
3
+ "version": "0.0.166-dev15-liquity-v2",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -23,7 +23,7 @@
23
23
  "author": "",
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
- "@defisaver/tokens": "^1.5.45-dev-5",
26
+ "@defisaver/tokens": "^1.5.45-dev-6",
27
27
  "@ethersproject/bignumber": "^5.7.0",
28
28
  "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
29
29
  "decimal.js": "^10.4.3"
@@ -5,7 +5,7 @@ import { LiquityV2ViewContract } from '../contracts';
5
5
  import { EthAddress, NetworkNumber } from '../types/common';
6
6
  import {
7
7
  InnerLiquityV2MarketData,
8
- LIQUITY_TROVE_STATUS_ENUM,
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: LIQUITY_TROVE_STATUS_ENUM[parseInt(data.status, 10)],
151
+ troveStatus: LIQUITY_V2_TROVE_STATUS_ENUM[parseInt(data.status, 10)],
152
152
  ...getLiquityV2AggregatedPositionData({
153
153
  usedAssets, assetsData, minCollRatio, interestRate,
154
154
  }),
@@ -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,