@gearbox-protocol/sdk 3.0.0-vfour.225 → 3.0.0-vfour.227
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/dist/cjs/dev/index.cjs +7 -4
- package/dist/cjs/sdk/index.cjs +567 -523
- package/dist/cjs/sdk/index.d.ts +273 -230
- package/dist/esm/dev/index.mjs +7 -4
- package/dist/esm/sdk/index.d.mts +273 -230
- package/dist/esm/sdk/index.mjs +481 -437
- package/package.json +1 -1
package/dist/cjs/dev/index.cjs
CHANGED
|
@@ -118,7 +118,7 @@ var AccountOpener = class extends sdk.SDKConstruct {
|
|
|
118
118
|
const { minDebt, underlying } = cm.creditFacade;
|
|
119
119
|
const expectedBalances = [];
|
|
120
120
|
const leftoverBalances = [];
|
|
121
|
-
for (const t of
|
|
121
|
+
for (const t of cm.creditManager.collateralTokens) {
|
|
122
122
|
const token = t;
|
|
123
123
|
expectedBalances.push({
|
|
124
124
|
token,
|
|
@@ -351,12 +351,15 @@ var AccountOpener = class extends sdk.SDKConstruct {
|
|
|
351
351
|
return this.#borrower;
|
|
352
352
|
}
|
|
353
353
|
#getCollateralQuota(cm, collateral, amount, debt) {
|
|
354
|
-
const {
|
|
354
|
+
const {
|
|
355
|
+
underlying,
|
|
356
|
+
creditManager: { liquidationThresholds }
|
|
357
|
+
} = cm;
|
|
355
358
|
const inUnderlying = collateral.toLowerCase() === underlying.toLowerCase();
|
|
356
359
|
if (inUnderlying) {
|
|
357
360
|
return [];
|
|
358
361
|
}
|
|
359
|
-
const collateralLT = BigInt(
|
|
362
|
+
const collateralLT = BigInt(liquidationThresholds.mustGet(collateral));
|
|
360
363
|
const market = this.sdk.marketRegister.findByCreditManager(
|
|
361
364
|
cm.creditManager.address
|
|
362
365
|
);
|
|
@@ -388,7 +391,7 @@ async function calcLiquidatableLTs(sdk$1, ca, factor = 9990n, logger) {
|
|
|
388
391
|
const weightedBalances = ca.tokens.map((t) => {
|
|
389
392
|
const { token, balance } = t;
|
|
390
393
|
const balanceU = market.priceOracle.convertToUnderlying(token, balance);
|
|
391
|
-
const lt = BigInt(cm.
|
|
394
|
+
const lt = BigInt(cm.creditManager.liquidationThresholds.mustGet(token));
|
|
392
395
|
return {
|
|
393
396
|
token,
|
|
394
397
|
weightedBalance: balanceU * lt / sdk.PERCENTAGE_FACTOR,
|