@defisaver/positions-sdk 0.0.166-dev5-liquity-v2 → 0.0.166-dev6-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.
@@ -24,6 +24,7 @@ const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb3) => _
24
24
  const viewContract = (0, contracts_1.LiquityV2ViewContract)(web3, network);
25
25
  const { marketAddress, debtToken, collateralToken } = selectedMarket;
26
26
  const data = yield viewContract.methods.getMarketData(marketAddress).call();
27
+ const hintHelperAddress = data.hintHelpers;
27
28
  const assetsData = {};
28
29
  assetsData[debtToken] = {
29
30
  symbol: debtToken,
@@ -48,7 +49,7 @@ const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb3) => _
48
49
  assetsData[collateralToken].incentiveSupplyToken = collateralToken;
49
50
  }
50
51
  const minCollRatio = new decimal_js_1.default(data.MCR).div(1e16).toString();
51
- return { assetsData, marketData: { minCollRatio } };
52
+ return { assetsData, marketData: { minCollRatio, hintHelperAddress } };
52
53
  });
53
54
  exports.getLiquityV2MarketData = getLiquityV2MarketData;
54
55
  const _getDebtInFront = (viewContract, marketAddress, troveId, accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () { return viewContract.methods.getDebtInFront(marketAddress, troveId, accumulatedSum, iterations).call(); });
@@ -30,6 +30,7 @@ export type LiquityV2AssetsData = {
30
30
  };
31
31
  export interface InnerLiquityV2MarketData {
32
32
  minCollRatio: string;
33
+ hintHelperAddress: EthAddress;
33
34
  }
34
35
  export interface LiquityV2MarketData {
35
36
  assetsData: LiquityV2AssetsData;
@@ -18,6 +18,7 @@ export const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb
18
18
  const viewContract = LiquityV2ViewContract(web3, network);
19
19
  const { marketAddress, debtToken, collateralToken } = selectedMarket;
20
20
  const data = yield viewContract.methods.getMarketData(marketAddress).call();
21
+ const hintHelperAddress = data.hintHelpers;
21
22
  const assetsData = {};
22
23
  assetsData[debtToken] = {
23
24
  symbol: debtToken,
@@ -42,7 +43,7 @@ export const getLiquityV2MarketData = (web3, network, selectedMarket, mainnetWeb
42
43
  assetsData[collateralToken].incentiveSupplyToken = collateralToken;
43
44
  }
44
45
  const minCollRatio = new Dec(data.MCR).div(1e16).toString();
45
- return { assetsData, marketData: { minCollRatio } };
46
+ return { assetsData, marketData: { minCollRatio, hintHelperAddress } };
46
47
  });
47
48
  const _getDebtInFront = (viewContract, marketAddress, troveId, accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () { return viewContract.methods.getDebtInFront(marketAddress, troveId, accumulatedSum, iterations).call(); });
48
49
  export const getDebtInFrontLiquityV2 = (viewContract, marketAddress, troveId, accumulatedSum = '0', iterations = 2000) => __awaiter(void 0, void 0, void 0, function* () {
@@ -30,6 +30,7 @@ export type LiquityV2AssetsData = {
30
30
  };
31
31
  export interface InnerLiquityV2MarketData {
32
32
  minCollRatio: string;
33
+ hintHelperAddress: EthAddress;
33
34
  }
34
35
  export interface LiquityV2MarketData {
35
36
  assetsData: LiquityV2AssetsData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "0.0.166-dev5-liquity-v2",
3
+ "version": "0.0.166-dev6-liquity-v2",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -18,6 +18,7 @@ export const getLiquityV2MarketData = async (web3: Web3, network: NetworkNumber,
18
18
  const viewContract = LiquityV2ViewContract(web3, network);
19
19
  const { marketAddress, debtToken, collateralToken } = selectedMarket;
20
20
  const data = await viewContract.methods.getMarketData(marketAddress).call();
21
+ const hintHelperAddress = data.hintHelpers;
21
22
  const assetsData: LiquityV2AssetsData = {};
22
23
  assetsData[debtToken] = {
23
24
  symbol: debtToken,
@@ -43,7 +44,7 @@ export const getLiquityV2MarketData = async (web3: Web3, network: NetworkNumber,
43
44
  }
44
45
 
45
46
  const minCollRatio = new Dec(data.MCR).div(1e16).toString();
46
- return { assetsData, marketData: { minCollRatio } };
47
+ return { assetsData, marketData: { minCollRatio, hintHelperAddress } };
47
48
  };
48
49
 
49
50
  const _getDebtInFront = async (viewContract: any, marketAddress: EthAddress, troveId: string, accumulatedSum = '0', iterations = 2000) => viewContract.methods.getDebtInFront(marketAddress, troveId, accumulatedSum, iterations).call();
@@ -33,6 +33,7 @@ export type LiquityV2AssetsData = { [key: string]: LiquityV2AssetData };
33
33
 
34
34
  export interface InnerLiquityV2MarketData {
35
35
  minCollRatio: string,
36
+ hintHelperAddress: EthAddress,
36
37
  }
37
38
 
38
39
  export interface LiquityV2MarketData {