@morpho-org/blue-sdk 5.23.0 → 5.23.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.
@@ -110,10 +110,9 @@ class AccrualVaultV2 extends VaultV2 {
110
110
  */
111
111
  maxWithdraw(shares) {
112
112
  const assets = this.toAssets(shares);
113
- if (this.liquidityAdapter === viem_1.zeroAddress)
114
- return { value: BigInt(assets), limiter: utils_js_1.CapacityLimitReason.balance };
115
113
  let liquidity = this.assetBalance;
116
- if (this.accrualLiquidityAdapter != null)
114
+ if (this.liquidityAdapter !== viem_1.zeroAddress &&
115
+ this.accrualLiquidityAdapter != null)
117
116
  liquidity += this.accrualLiquidityAdapter.maxWithdraw(this.liquidityData).value;
118
117
  if (assets > liquidity)
119
118
  return {
@@ -106,10 +106,9 @@ export class AccrualVaultV2 extends VaultV2 {
106
106
  */
107
107
  maxWithdraw(shares) {
108
108
  const assets = this.toAssets(shares);
109
- if (this.liquidityAdapter === zeroAddress)
110
- return { value: BigInt(assets), limiter: CapacityLimitReason.balance };
111
109
  let liquidity = this.assetBalance;
112
- if (this.accrualLiquidityAdapter != null)
110
+ if (this.liquidityAdapter !== zeroAddress &&
111
+ this.accrualLiquidityAdapter != null)
113
112
  liquidity += this.accrualLiquidityAdapter.maxWithdraw(this.liquidityData).value;
114
113
  if (assets > liquidity)
115
114
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/blue-sdk",
3
3
  "description": "Framework-agnostic package that defines Morpho-related entity classes (such as `Market`, `Token`, `Vault`).",
4
- "version": "5.23.0",
4
+ "version": "5.23.1",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"