@pyron-finance/pyron-client 2.10.0 → 2.10.1

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/index.cjs CHANGED
@@ -27629,38 +27629,23 @@ var LendrAccountWrapper = class _LendrAccountWrapper {
27629
27629
  return new _LendrAccountWrapper(this.address, this.client, account);
27630
27630
  }
27631
27631
  canBeLiquidated() {
27632
- let { assets, liabilities } = this._lendrAccount.computeHealthComponents(1 /* Maintenance */);
27633
- if (assets.isZero() && liabilities.isZero()) {
27634
- const legacy = this._lendrAccount.computeHealthComponentsLegacy(
27635
- this.banks,
27636
- this.client.oraclePrices,
27637
- 1 /* Maintenance */
27638
- );
27639
- assets = legacy.assets;
27640
- liabilities = legacy.liabilities;
27641
- this.client.logger.debug(
27642
- {
27643
- address: this.address.toBase58(),
27644
- assets,
27645
- liabilities,
27646
- usedLegacy: true
27647
- },
27648
- "[lendr:lendr-account:canBeLiquidated]"
27649
- );
27650
- } else {
27651
- this.client.logger.debug(
27652
- {
27653
- address: this.address.toBase58(),
27654
- assets,
27655
- liabilities
27656
- },
27657
- "[lendr:lendr-account:canBeLiquidated]"
27658
- );
27659
- }
27632
+ const { assets, liabilities } = this.computeHealthComponents(1 /* Maintenance */);
27633
+ this.client.logger.debug(
27634
+ {
27635
+ address: this.address.toBase58(),
27636
+ assets,
27637
+ liabilities
27638
+ },
27639
+ "[lendr:lendr-account:canBeLiquidated]"
27640
+ );
27660
27641
  return assets.lt(liabilities);
27661
27642
  }
27662
27643
  computeHealthComponents(lendrRequirement) {
27663
- return this._lendrAccount.computeHealthComponents(lendrRequirement);
27644
+ const cached = this._lendrAccount.computeHealthComponents(lendrRequirement);
27645
+ if (cached.assets.isZero() && cached.liabilities.isZero()) {
27646
+ return this.computeHealthComponentsLegacy(lendrRequirement);
27647
+ }
27648
+ return cached;
27664
27649
  }
27665
27650
  // TODO)) migrate to computeHealthComponents
27666
27651
  computeHealthComponentsLegacy(lendrRequirement, excludedBanks = []) {
package/dist/index.js CHANGED
@@ -27467,38 +27467,23 @@ var LendrAccountWrapper = class _LendrAccountWrapper {
27467
27467
  return new _LendrAccountWrapper(this.address, this.client, account);
27468
27468
  }
27469
27469
  canBeLiquidated() {
27470
- let { assets, liabilities } = this._lendrAccount.computeHealthComponents(1 /* Maintenance */);
27471
- if (assets.isZero() && liabilities.isZero()) {
27472
- const legacy = this._lendrAccount.computeHealthComponentsLegacy(
27473
- this.banks,
27474
- this.client.oraclePrices,
27475
- 1 /* Maintenance */
27476
- );
27477
- assets = legacy.assets;
27478
- liabilities = legacy.liabilities;
27479
- this.client.logger.debug(
27480
- {
27481
- address: this.address.toBase58(),
27482
- assets,
27483
- liabilities,
27484
- usedLegacy: true
27485
- },
27486
- "[lendr:lendr-account:canBeLiquidated]"
27487
- );
27488
- } else {
27489
- this.client.logger.debug(
27490
- {
27491
- address: this.address.toBase58(),
27492
- assets,
27493
- liabilities
27494
- },
27495
- "[lendr:lendr-account:canBeLiquidated]"
27496
- );
27497
- }
27470
+ const { assets, liabilities } = this.computeHealthComponents(1 /* Maintenance */);
27471
+ this.client.logger.debug(
27472
+ {
27473
+ address: this.address.toBase58(),
27474
+ assets,
27475
+ liabilities
27476
+ },
27477
+ "[lendr:lendr-account:canBeLiquidated]"
27478
+ );
27498
27479
  return assets.lt(liabilities);
27499
27480
  }
27500
27481
  computeHealthComponents(lendrRequirement) {
27501
- return this._lendrAccount.computeHealthComponents(lendrRequirement);
27482
+ const cached = this._lendrAccount.computeHealthComponents(lendrRequirement);
27483
+ if (cached.assets.isZero() && cached.liabilities.isZero()) {
27484
+ return this.computeHealthComponentsLegacy(lendrRequirement);
27485
+ }
27486
+ return cached;
27502
27487
  }
27503
27488
  // TODO)) migrate to computeHealthComponents
27504
27489
  computeHealthComponentsLegacy(lendrRequirement, excludedBanks = []) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyron-finance/pyron-client",
3
- "version": "2.10.0",
3
+ "version": "2.10.1",
4
4
  "keywords": [],
5
5
  "license": "MIT",
6
6
  "type": "module",