@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.
package/cjs/liquityV2/index.js
CHANGED
|
@@ -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(); });
|
package/cjs/types/liquityV2.d.ts
CHANGED
package/esm/liquityV2/index.js
CHANGED
|
@@ -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* () {
|
package/esm/types/liquityV2.d.ts
CHANGED
package/package.json
CHANGED
package/src/liquityV2/index.ts
CHANGED
|
@@ -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();
|
package/src/types/liquityV2.ts
CHANGED