@morpho-org/morpho-sdk 8.2.0-next.0 → 8.3.0

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.
Files changed (83) hide show
  1. package/MIGRATION-v7-to-v8.md +7 -3
  2. package/README.md +11 -1
  3. package/lib/cjs/abis.d.ts +1 -1
  4. package/lib/cjs/abis.js +1 -5
  5. package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -0
  6. package/lib/cjs/actions/blue/supply.js +7 -5
  7. package/lib/cjs/actions/blue/supplyCollateralBorrow.js +10 -8
  8. package/lib/cjs/actions/blue/withdraw.js +10 -6
  9. package/lib/cjs/actions/midnight/redeem.d.ts +1 -0
  10. package/lib/cjs/actions/midnight/redeem.js +4 -0
  11. package/lib/cjs/actions/midnight/supplyCollateral.d.ts +1 -0
  12. package/lib/cjs/actions/midnight/supplyCollateral.js +4 -0
  13. package/lib/cjs/blue/abis.d.ts +1 -1
  14. package/lib/cjs/blue/abis.js +1 -5
  15. package/lib/cjs/blue/entities.d.ts +4 -4
  16. package/lib/cjs/blue/entities.js +1 -3
  17. package/lib/cjs/blue/errors.d.ts +2 -2
  18. package/lib/cjs/blue/errors.js +1 -5
  19. package/lib/cjs/blue/fetch.d.ts +2 -2
  20. package/lib/cjs/blue/fetch.js +1 -3
  21. package/lib/cjs/blue/utils.d.ts +1 -1
  22. package/lib/cjs/blue/utils.js +1 -2
  23. package/lib/cjs/entities/index.d.ts +4 -4
  24. package/lib/cjs/entities/index.js +1 -3
  25. package/lib/cjs/entities/midnight/midnight.d.ts +3 -1
  26. package/lib/cjs/entities/midnight/midnight.js +3 -1
  27. package/lib/cjs/entities/midnight/types.d.ts +4 -3
  28. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +9 -33
  29. package/lib/cjs/entities/vaultV2/vaultV2.js +1 -33
  30. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +3 -5
  31. package/lib/cjs/entities/vaultV2BlueReallocationData.js +3 -9
  32. package/lib/cjs/errors.d.ts +4 -4
  33. package/lib/cjs/errors.js +5 -10
  34. package/lib/cjs/fetch.d.ts +2 -2
  35. package/lib/cjs/fetch.js +1 -3
  36. package/lib/cjs/midnight/errors.d.ts +1 -2
  37. package/lib/cjs/midnight/errors.js +4 -5
  38. package/lib/cjs/types/action.d.ts +22 -0
  39. package/lib/cjs/types/error.d.ts +8 -0
  40. package/lib/cjs/types/error.js +15 -2
  41. package/lib/cjs/utils.d.ts +2 -2
  42. package/lib/cjs/utils.js +2 -4
  43. package/lib/esm/abis.d.ts +1 -1
  44. package/lib/esm/abis.js +1 -1
  45. package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -0
  46. package/lib/esm/actions/blue/supply.js +2 -0
  47. package/lib/esm/actions/blue/supplyCollateralBorrow.js +2 -0
  48. package/lib/esm/actions/blue/withdraw.js +4 -0
  49. package/lib/esm/actions/midnight/redeem.d.ts +1 -0
  50. package/lib/esm/actions/midnight/redeem.js +6 -2
  51. package/lib/esm/actions/midnight/supplyCollateral.d.ts +1 -0
  52. package/lib/esm/actions/midnight/supplyCollateral.js +6 -2
  53. package/lib/esm/blue/abis.d.ts +1 -1
  54. package/lib/esm/blue/abis.js +1 -1
  55. package/lib/esm/blue/entities.d.ts +4 -4
  56. package/lib/esm/blue/entities.js +2 -2
  57. package/lib/esm/blue/errors.d.ts +2 -2
  58. package/lib/esm/blue/errors.js +2 -2
  59. package/lib/esm/blue/fetch.d.ts +2 -2
  60. package/lib/esm/blue/fetch.js +2 -2
  61. package/lib/esm/blue/utils.d.ts +1 -1
  62. package/lib/esm/blue/utils.js +1 -1
  63. package/lib/esm/entities/index.d.ts +4 -4
  64. package/lib/esm/entities/index.js +2 -2
  65. package/lib/esm/entities/midnight/midnight.d.ts +3 -1
  66. package/lib/esm/entities/midnight/midnight.js +3 -1
  67. package/lib/esm/entities/midnight/types.d.ts +4 -3
  68. package/lib/esm/entities/vaultV2/vaultV2.d.ts +9 -33
  69. package/lib/esm/entities/vaultV2/vaultV2.js +1 -33
  70. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +3 -5
  71. package/lib/esm/entities/vaultV2BlueReallocationData.js +3 -9
  72. package/lib/esm/errors.d.ts +4 -4
  73. package/lib/esm/errors.js +4 -4
  74. package/lib/esm/fetch.d.ts +2 -2
  75. package/lib/esm/fetch.js +2 -2
  76. package/lib/esm/midnight/errors.d.ts +1 -2
  77. package/lib/esm/midnight/errors.js +1 -2
  78. package/lib/esm/types/action.d.ts +22 -0
  79. package/lib/esm/types/error.d.ts +8 -0
  80. package/lib/esm/types/error.js +12 -0
  81. package/lib/esm/utils.d.ts +2 -2
  82. package/lib/esm/utils.js +2 -2
  83. package/package.json +7 -7
@@ -2,6 +2,7 @@ import { encodeFunctionData } from "viem";
2
2
  import { blueBundlesV1Abi } from "../../abis.js";
3
3
  import { validateUint256Field } from "../../helpers/validate.js";
4
4
  import { InputExceedsMaxError, NonPositiveInputError, ReallocationsRequireBorrowError, UnexpectedRequirementSignatureError, } from "../../types/index.js";
5
+ import { getBundlesReferralFeeAssets } from "../bundles/common.js";
5
6
  import { finalizeBlueBundlesV1Transaction, getBlueBundlesV1PenaltyAssets, getBlueBundlesV1PublicAllocations, getBlueBundlesV1SignedAuthorization, getBlueBundlesV1TokenPermit, normalizeBlueBundlesV1CommonParams, validateBlueBundlesV1NativeFunding, } from "./common.js";
6
7
  /**
7
8
  * Encodes a direct BlueBundlesV1 collateral supply and/or borrow transaction.
@@ -162,6 +163,7 @@ export const blueSupplyCollateralBorrow = (params) => {
162
163
  reallocationPenaltyAssets,
163
164
  referralFeePct,
164
165
  referralFeeRecipient,
166
+ referralFeeAssets: getBundlesReferralFeeAssets(borrowAssets - reallocationPenaltyAssets, referralFeePct),
165
167
  deadline: params.args.deadline,
166
168
  },
167
169
  },
@@ -2,6 +2,7 @@ import { encodeFunctionData } from "viem";
2
2
  import { blueBundlesV1Abi } from "../../abis.js";
3
3
  import { validateUint256Field } from "../../helpers/validate.js";
4
4
  import { InputExceedsMaxError, MutuallyExclusiveWithdrawAmountsError, NonPositiveInputError, } from "../../types/index.js";
5
+ import { getBundlesReferralFeeAssets } from "../bundles/common.js";
5
6
  import { finalizeBlueBundlesV1Transaction, getBlueBundlesV1PenaltyAssets, getBlueBundlesV1PublicAllocations, getBlueBundlesV1SignedAuthorization, normalizeBlueBundlesV1CommonParams, } from "./common.js";
6
7
  /**
7
8
  * Encodes a direct BlueBundlesV1 loan-asset withdrawal transaction.
@@ -122,6 +123,9 @@ export const blueWithdraw = (params) => {
122
123
  reallocationPenaltyAssets,
123
124
  referralFeePct,
124
125
  referralFeeRecipient,
126
+ referralFeeAssets: withdrawAssets > 0n
127
+ ? getBundlesReferralFeeAssets(withdrawAssets - reallocationPenaltyAssets, referralFeePct)
128
+ : undefined,
125
129
  deadline: params.args.deadline,
126
130
  },
127
131
  },
@@ -30,6 +30,7 @@ export interface MidnightRedeemParams {
30
30
  * @returns A deep-frozen `Transaction<MidnightRedeemAction>` targeting `Midnight`.
31
31
  * @throws {NonPositiveInputError} when `units <= 0n`.
32
32
  * @throws {InputExceedsMaxError} when `units` exceeds `uint128`.
33
+ * @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
33
34
  * @throws {ChainIdMismatchError} when the market targets another chain.
34
35
  * @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
35
36
  * @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
@@ -1,11 +1,11 @@
1
1
  import { MarketUtils, midnightAbi, } from "@morpho-org/midnight-sdk";
2
2
  import { deepFreeze, getChainAddress } from "@morpho-org/morpho-ts";
3
- import { encodeFunctionData } from "viem";
3
+ import { encodeFunctionData, isAddressEqual, zeroAddress, } from "viem";
4
4
  import { addTransactionMetadata } from "../../helpers/index.js";
5
5
  import { validateMidnightUint128Field } from "../../helpers/validateMidnightBounds.js";
6
6
  import { validateMidnightMarket } from "../../helpers/validateMidnightMarket.js";
7
7
  import { validateMidnightReceiver } from "../../helpers/validateMidnightReceiver.js";
8
- import { NonPositiveInputError, } from "../../types/index.js";
8
+ import { MidnightZeroOnBehalfError, NonPositiveInputError, } from "../../types/index.js";
9
9
  /**
10
10
  * Encodes a direct Midnight credit redemption.
11
11
  *
@@ -26,6 +26,7 @@ import { NonPositiveInputError, } from "../../types/index.js";
26
26
  * @returns A deep-frozen `Transaction<MidnightRedeemAction>` targeting `Midnight`.
27
27
  * @throws {NonPositiveInputError} when `units <= 0n`.
28
28
  * @throws {InputExceedsMaxError} when `units` exceeds `uint128`.
29
+ * @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
29
30
  * @throws {ChainIdMismatchError} when the market targets another chain.
30
31
  * @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
31
32
  * @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
@@ -48,6 +49,9 @@ export const midnightRedeem = (params) => {
48
49
  throw new NonPositiveInputError("units", params.units);
49
50
  }
50
51
  validateMidnightUint128Field("units", params.units);
52
+ if (isAddressEqual(params.onBehalf, zeroAddress)) {
53
+ throw new MidnightZeroOnBehalfError("onBehalf");
54
+ }
51
55
  // Reject markets from another chain deployment before encoding the call.
52
56
  validateMidnightMarket({ market: params.market, chainId: params.chainId });
53
57
  const marketId = MarketUtils.toId(params.market);
@@ -27,6 +27,7 @@ export interface MidnightSupplyCollateralParams {
27
27
  * @returns A deep-frozen `Transaction<MidnightSupplyCollateralAction>` targeting `Midnight`.
28
28
  * @throws {NonPositiveInputError} when `assets <= 0n`.
29
29
  * @throws {InputExceedsMaxError} when `assets` exceeds `uint128`.
30
+ * @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
30
31
  * @throws {ChainIdMismatchError} when the market targets another chain.
31
32
  * @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
32
33
  * @throws {UnknownCollateralIndexError} when `collateralIndex` is not configured on the market.
@@ -1,10 +1,10 @@
1
1
  import { MarketUtils, midnightAbi, } from "@morpho-org/midnight-sdk";
2
2
  import { deepFreeze, getChainAddress } from "@morpho-org/morpho-ts";
3
- import { encodeFunctionData } from "viem";
3
+ import { encodeFunctionData, isAddressEqual, zeroAddress, } from "viem";
4
4
  import { addTransactionMetadata } from "../../helpers/index.js";
5
5
  import { validateMidnightUint128Field } from "../../helpers/validateMidnightBounds.js";
6
6
  import { validateMidnightMarket } from "../../helpers/validateMidnightMarket.js";
7
- import { NonPositiveInputError, } from "../../types/index.js";
7
+ import { MidnightZeroOnBehalfError, NonPositiveInputError, } from "../../types/index.js";
8
8
  /**
9
9
  * Encodes a direct Midnight collateral supply.
10
10
  *
@@ -22,6 +22,7 @@ import { NonPositiveInputError, } from "../../types/index.js";
22
22
  * @returns A deep-frozen `Transaction<MidnightSupplyCollateralAction>` targeting `Midnight`.
23
23
  * @throws {NonPositiveInputError} when `assets <= 0n`.
24
24
  * @throws {InputExceedsMaxError} when `assets` exceeds `uint128`.
25
+ * @throws {MidnightZeroOnBehalfError} when `onBehalf` is the zero address.
25
26
  * @throws {ChainIdMismatchError} when the market targets another chain.
26
27
  * @throws {MidnightMarketAddressMismatchError} when the market targets another Midnight deployment.
27
28
  * @throws {UnknownCollateralIndexError} when `collateralIndex` is not configured on the market.
@@ -43,6 +44,9 @@ export const midnightSupplyCollateral = (params) => {
43
44
  throw new NonPositiveInputError("assets", params.assets);
44
45
  }
45
46
  validateMidnightUint128Field("assets", params.assets);
47
+ if (isAddressEqual(params.onBehalf, zeroAddress)) {
48
+ throw new MidnightZeroOnBehalfError("onBehalf");
49
+ }
46
50
  // Reject markets from another chain deployment before encoding the call.
47
51
  validateMidnightMarket({ market: params.market, chainId: params.chainId });
48
52
  const marketId = MarketUtils.toId(params.market);
@@ -1,5 +1,5 @@
1
1
  export { marketParamsAbi } from "@morpho-org/blue-sdk";
2
- export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
2
+ export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
3
3
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
4
  preLiquidationAbi,
5
5
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
@@ -1,5 +1,5 @@
1
1
  export { marketParamsAbi } from "@morpho-org/blue-sdk";
2
- export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, midnightAdapterAbi, midnightAdapterFactoryAbi, midnightAdapterPriceRatifierV1Abi, midnightAdapterRateRatifierV1Abi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
2
+ export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi,
3
3
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
4
  preLiquidationAbi,
5
5
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
@@ -1,10 +1,10 @@
1
- export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MidnightAdapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
1
+ export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  IPreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MidnightAdapter, IVaultV2MidnightAdapterAccrualMarket, IVaultV2MidnightAdapterCollateralParams, IVaultV2MidnightAdapterMarket, IVaultV2MidnightAdapterMarketData, IVaultV2MidnightAdapterMarketState, IVaultV2MidnightAdapterPosition, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultV2MidnightAdapterAccrualMarket, VaultV2MidnightAdapterMarketData, } from "@morpho-org/blue-sdk";
6
- export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
5
+ IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
6
+ export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
7
7
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
8
8
  PreLiquidationParams,
9
9
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
10
- PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
10
+ PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
@@ -1,5 +1,5 @@
1
- export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
1
+ export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  PreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
5
+ PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
@@ -1,4 +1,4 @@
1
- export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, InvalidPositionAccrualStateError, InvalidPositionLossFactorError, InvalidVaultV2MidnightAdapterMarketsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
1
+ export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
- export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
4
+ export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
@@ -1,4 +1,4 @@
1
- export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, InvalidPositionAccrualStateError, InvalidPositionLossFactorError, InvalidVaultV2MidnightAdapterMarketsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
1
+ export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidAddressError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
- export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
4
+ export { getUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
@@ -1,5 +1,5 @@
1
- export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MidnightAdapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
1
+ export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  fetchPreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MidnightAdapter, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
5
+ fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
@@ -1,5 +1,5 @@
1
- export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MidnightAdapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
1
+ export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  fetchPreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MidnightAdapter, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
5
+ fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
@@ -3,5 +3,5 @@ export { AdaptiveCurveIrmLib, CapacityLimitReason,
3
3
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
4
4
  defaultPreLiquidationParamsRegistry,
5
5
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
6
- getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2MidnightAdapterUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
6
+ getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
7
7
  export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
@@ -2,5 +2,5 @@ export { AdaptiveCurveIrmLib, CapacityLimitReason,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  defaultPreLiquidationParamsRegistry,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2MidnightAdapterUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
5
+ getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
6
6
  export { catchRevertOnly, decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, isContractRevertError, isTransportError, isUndecodableResultError, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
@@ -1,13 +1,13 @@
1
- export type { IAccrualPosition as IBlueAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MidnightAdapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket as IBlueMarket, IMarketParams as IBlueMarketParams, IPosition as IBluePosition,
1
+ export type { IAccrualPosition as IBlueAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket as IBlueMarket, IMarketParams as IBlueMarketParams, IPosition as IBluePosition,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  IPreLiquidationParams as IBluePreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- IPreLiquidationPosition as IBluePreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MidnightAdapter, IVaultV2MidnightAdapterAccrualMarket, IVaultV2MidnightAdapterCollateralParams, IVaultV2MidnightAdapterMarket, IVaultV2MidnightAdapterMarketData, IVaultV2MidnightAdapterMarketState, IVaultV2MidnightAdapterPosition, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultV2MidnightAdapterAccrualMarket, VaultV2MidnightAdapterMarketData, } from "@morpho-org/blue-sdk";
6
- export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
5
+ IPreLiquidationPosition as IBluePreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
6
+ export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
7
7
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
8
8
  PreLiquidationParams as BluePreLiquidationParams,
9
9
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
10
- PreLiquidationPosition as BluePreLiquidationPosition, Token, User as BlueUser, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
10
+ PreLiquidationPosition as BluePreLiquidationPosition, Token, User as BlueUser, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
11
11
  export type { AnyTree as MidnightAnyTree, AnyTreeSnapshot as MidnightAnyTreeSnapshot, BuildOfferParams as MidnightBuildOfferParams, CollateralParams as MidnightCollateralParams, EcrecoverTreeCreateRequest as MidnightEcrecoverTreeCreateRequest, GroupInput as MidnightGroupInput, IAccrualPosition as IMidnightAccrualPosition, ICollateralParams as IMidnightCollateralParams, IGroup as IMidnightGroup, IMarket as IMidnightMarket, IMarketParams as IMidnightMarketParams, IOffer as IMidnightOffer, IPosition as IMidnightPosition, MarketInput as MidnightMarketInput, OfferStruct as MidnightOfferStruct, PriceRatifierV1TreeCreateRequest as MidnightPriceRatifierV1TreeCreateRequest, RateRatifierV1TreeCreateRequest as MidnightRateRatifierV1TreeCreateRequest, RatifierKind as MidnightRatifierKind, RatifierTreeInput as MidnightRatifierTreeInput, RatifierTypes as MidnightRatifierTypes, SetterTreeCreateRequest as MidnightSetterTreeCreateRequest, SettlementFeeCbps as MidnightSettlementFeeCbps, TreeCreateParams as MidnightTreeCreateParams, TreeCreateRequest as MidnightTreeCreateRequest, TreeData as MidnightTreeData, TreeDescriptor as MidnightTreeDescriptor, TreeEntry as MidnightTreeEntry, TreeInput as MidnightTreeInput, TreeLike as MidnightTreeLike, TreeMempoolValidateParams as MidnightTreeMempoolValidateParams, TreeMempoolValidateRatification as MidnightTreeMempoolValidateRatification, TreeProof as MidnightTreeProof, TreeSnapshot as MidnightTreeSnapshot, TypedRatifierTreeInput as MidnightTypedRatifierTreeInput, TypedTreeMempoolValidateParams as MidnightTypedTreeMempoolValidateParams, } from "@morpho-org/midnight-sdk";
12
12
  export { AccrualPosition as MidnightAccrualPosition, Group as MidnightGroup, Market as MidnightMarket, MarketParams as MidnightMarketParams, Offer as MidnightOffer, Position as MidnightPosition, Tree as MidnightTree, } from "@morpho-org/midnight-sdk";
13
13
  export type { BlueActions, BlueTokenRequirementsParams, } from "./blue/index.js";
@@ -1,8 +1,8 @@
1
- export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MidnightAdapter, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
1
+ export { AccrualPosition as BlueAccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market as BlueMarket, MarketParams as BlueMarketParams, Position as BluePosition,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  PreLiquidationParams as BluePreLiquidationParams,
4
4
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
- PreLiquidationPosition as BluePreLiquidationPosition, Token, User as BlueUser, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MidnightAdapter, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
5
+ PreLiquidationPosition as BluePreLiquidationPosition, Token, User as BlueUser, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
6
6
  export { AccrualPosition as MidnightAccrualPosition, Group as MidnightGroup, Market as MidnightMarket, MarketParams as MidnightMarketParams, Offer as MidnightOffer, Position as MidnightPosition, Tree as MidnightTree, } from "@morpho-org/midnight-sdk";
7
7
  export { MorphoBlue } from "./blue/index.js";
8
8
  export { MorphoMidnight, } from "./midnight/index.js";
@@ -594,6 +594,7 @@ export declare class MorphoMidnight {
594
594
  * @throws {NonPositiveInputError} when `collateralAssets` is non-positive.
595
595
  * @throws {InputExceedsMaxError} when `collateralAssets` exceeds `uint128`.
596
596
  * @throws {NegativeInputError} when `reservedCollateralAssets` is negative.
597
+ * @throws {MidnightZeroOnBehalfError} from `buildTx()` when `accountAddress` is the zero address.
597
598
  * @throws {UnknownCollateralIndexError} when the selected collateral is not configured.
598
599
  * @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when `approvalAmount` is below the pulled collateral assets.
599
600
  * @example
@@ -1080,14 +1081,15 @@ export declare class MorphoMidnight {
1080
1081
  * @throws {MissingAccrualPositionError} when no position snapshot is supplied.
1081
1082
  * @throws {AccrualPositionUserMismatchError} when the position snapshot belongs to another account.
1082
1083
  * @throws {NoMidnightCreditToRedeemError} when the selected unit amount is non-positive.
1084
+ * @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
1083
1085
  * @throws {MidnightRedeemExceedsCreditError} when the selected amount exceeds the accrued
1084
1086
  * position credit.
1085
1087
  * @throws {InvalidMidnightPositionLossFactorError} when the market loss factor is below the
1086
1088
  * position's `lastLossFactor`, which `getPositionData` snapshots never are.
1087
1089
  * @throws {InvalidMidnightPositionAccrualStateError} when the snapshot's credit, pending fee or
1088
1090
  * loss factor are inconsistent, which `getPositionData` snapshots never are.
1089
- * @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
1090
1091
  * @throws {InsufficientMidnightWithdrawableLiquidityError} when market liquidity cannot cover the redemption.
1092
+ * @throws {MidnightZeroOnBehalfError} when `accountAddress` is the zero address.
1091
1093
  * @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
1092
1094
  * @throws {MidnightContractReceiverError} when `receiver` is a Midnight protocol contract or a
1093
1095
  * market token contract.
@@ -1059,6 +1059,7 @@ export class MorphoMidnight {
1059
1059
  * @throws {NonPositiveInputError} when `collateralAssets` is non-positive.
1060
1060
  * @throws {InputExceedsMaxError} when `collateralAssets` exceeds `uint128`.
1061
1061
  * @throws {NegativeInputError} when `reservedCollateralAssets` is negative.
1062
+ * @throws {MidnightZeroOnBehalfError} from `buildTx()` when `accountAddress` is the zero address.
1062
1063
  * @throws {UnknownCollateralIndexError} when the selected collateral is not configured.
1063
1064
  * @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when `approvalAmount` is below the pulled collateral assets.
1064
1065
  * @example
@@ -1860,14 +1861,15 @@ export class MorphoMidnight {
1860
1861
  * @throws {MissingAccrualPositionError} when no position snapshot is supplied.
1861
1862
  * @throws {AccrualPositionUserMismatchError} when the position snapshot belongs to another account.
1862
1863
  * @throws {NoMidnightCreditToRedeemError} when the selected unit amount is non-positive.
1864
+ * @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
1863
1865
  * @throws {MidnightRedeemExceedsCreditError} when the selected amount exceeds the accrued
1864
1866
  * position credit.
1865
1867
  * @throws {InvalidMidnightPositionLossFactorError} when the market loss factor is below the
1866
1868
  * position's `lastLossFactor`, which `getPositionData` snapshots never are.
1867
1869
  * @throws {InvalidMidnightPositionAccrualStateError} when the snapshot's credit, pending fee or
1868
1870
  * loss factor are inconsistent, which `getPositionData` snapshots never are.
1869
- * @throws {InputExceedsMaxError} when the selected units exceed `uint128`.
1870
1871
  * @throws {InsufficientMidnightWithdrawableLiquidityError} when market liquidity cannot cover the redemption.
1872
+ * @throws {MidnightZeroOnBehalfError} when `accountAddress` is the zero address.
1871
1873
  * @throws {MidnightZeroReceiverError} when `receiver` resolves to the zero address.
1872
1874
  * @throws {MidnightContractReceiverError} when `receiver` is a Midnight protocol contract or a
1873
1875
  * market token contract.
@@ -155,9 +155,10 @@ export interface MidnightPositionHealthParams {
155
155
  /** Owner-bound snapshot returned by `getPositionData`. */
156
156
  readonly positionData: AccrualPosition;
157
157
  /** Values from `price()` on each `marketData.params.collateralParams[i].oracle`,
158
- * indexed like `positionData.collateral` and scaled by `ORACLE_PRICE_SCALE`. An empty array is
159
- * safe only when the SDK's conservative post-operation debt is zero, such as after a `full` repay,
160
- * a repayment units target covering `positionData.debt`, or `minUnits`/`repay.assets` covering it.
158
+ * indexed like `positionData.collateral` and scaled by `ORACLE_PRICE_SCALE`. Borrow methods always
159
+ * need prices. `takeRepayWithdrawCollateral` and `repayWithdrawCollateral` need them only when
160
+ * `collateralWithdrawals` is non-empty and the SDK's conservative post-operation debt is positive;
161
+ * otherwise an empty array is safe.
161
162
  */
162
163
  readonly collateralPrices: readonly bigint[];
163
164
  }
@@ -69,9 +69,8 @@ export interface VaultV2Actions {
69
69
  * owner is consumed and none was passed explicitly.
70
70
  * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the
71
71
  * explicit Permit2 nonce is consumed.
72
- * @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256, when the vault's
73
- * liquidity adapter is a Midnight adapter (it cannot receive vault allocations, so no deposit
74
- * fits and `max` is `0n`), or from `getRequirements()` when the Permit2 nonce exceeds uint256.
72
+ * @throws {InputExceedsMaxError} when funding or the deadline exceeds uint256, or from
73
+ * `getRequirements()` when the Permit2 nonce exceeds uint256.
75
74
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
76
75
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when an unsupported signature is supplied.
77
76
  * @throws {BundlesPermitMismatchError} from `buildTx()` when the signature's spender, amount or
@@ -154,9 +153,7 @@ export interface VaultV2Actions {
154
153
  * @throws {NonPositiveInputError} when `amount` or the computed share cap is not positive.
155
154
  * @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
156
155
  * at any `getRequirements()` call.
157
- * @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation,
158
- * or when the vault's liquidity adapter is a Midnight adapter and `amount` exceeds the vault's
159
- * idle assets.
156
+ * @throws {InputExceedsMaxError} when `amount` or `deadline` exceeds uint256 at handle creation.
160
157
  * @throws {NegativeInputError} when `referralFeePct` or `slippageTolerance` is negative.
161
158
  * @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
162
159
  * @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no nonzero recipient.
@@ -221,24 +218,7 @@ export interface VaultV2Actions {
221
218
  * @throws {NonPositiveInputError} when `shares` is not positive.
222
219
  * @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
223
220
  * requirement resolution.
224
- * @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256, or from
225
- * `getRequirements()` when the vault's liquidity adapter is a Midnight adapter and `shares`
226
- * are worth more than the vault's idle assets.
227
- * @throws {UnknownBlueFactory} from `getRequirements()` when the configured chain has no VaultV2 factory.
228
- * @throws {UnknownBlueOfFactory} from `getRequirements()` when the vault is not a VaultV2 from the
229
- * configured factory.
230
- * @throws {UnsupportedBlueVaultV2AdapterError} from `getRequirements()` when the vault or one of its
231
- * adapters uses an unsupported adapter class.
232
- * @throws {UnsupportedBlueMarketIrmError} from `getRequirements()` when the vault's liquidity adapter
233
- * is a Midnight adapter and accrual projects an underlying market with positive debt that uses an
234
- * unsupported IRM.
235
- * @throws {UnknownBlueMarketAllocationError} from `getRequirements()` when the vault's liquidity
236
- * adapter is a Midnight adapter and accrual meets a nested Vault V1 withdraw queue market without
237
- * allocation data.
238
- * @throws {InvalidMidnightPositionLossFactorError} from `getRequirements()` when the vault's liquidity
239
- * adapter is a Midnight adapter and accrual meets a market loss factor below a position's.
240
- * @throws {InvalidMidnightPositionAccrualStateError} from `getRequirements()` when the vault's
241
- * liquidity adapter is a Midnight adapter and accrual meets invalid Midnight position inputs.
221
+ * @throws {InputExceedsMaxError} when `shares` or `deadline` exceeds uint256.
242
222
  * @throws {NegativeInputError} when `referralFeePct` is negative.
243
223
  * @throws {ReferralFeePctExceededError} when `referralFeePct` is not below WAD.
244
224
  * @throws {ReferralFeeRecipientMissingError} when a positive fee has no non-zero recipient.
@@ -246,7 +226,7 @@ export interface VaultV2Actions {
246
226
  * @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
247
227
  * @throws {MissingContractCodeError} from `getRequirements()` when a fixed bundles or protocol
248
228
  * contract has no code at its registered address.
249
- * @throws {viem.BaseError} from `getRequirements()` when a vault-state, allowance, nonce, `eth_chainId`, or
229
+ * @throws {viem.BaseError} from `getRequirements()` when an allowance, nonce, `eth_chainId`, or
250
230
  * `eth_getCode` read fails.
251
231
  * @throws {UnknownTokenError} from `getRequirements()` when the share token fetched by
252
232
  * `getData()` has unusable decimals.
@@ -323,11 +303,9 @@ export interface VaultV2Actions {
323
303
  * @throws {InputExceedsMaxError} when `deadline` exceeds `uint256`.
324
304
  * @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
325
305
  * requirement resolution.
326
- * @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter, including
327
- * a vault that mixes Blue and Midnight adapters.
306
+ * @throws {VaultV2SingleAdapterRequiredError} when the vault does not have one adapter.
328
307
  * @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
329
- * @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2,
330
- * including a Midnight adapter.
308
+ * @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2.
331
309
  * @throws {InKindRedeemCoverageError} when the deduplicated list cannot cover the exit.
332
310
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
333
311
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
@@ -451,11 +429,9 @@ export interface VaultV2Actions {
451
429
  * @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
452
430
  * requirement resolution.
453
431
  * @throws {ExcessiveSlippageToleranceError} when `slippageTolerance` exceeds the SDK maximum.
454
- * @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter,
455
- * including a vault that mixes Blue and Midnight adapters.
432
+ * @throws {VaultV2SingleAdapterRequiredError} when the vault does not have exactly one adapter.
456
433
  * @throws {AdapterNotPartOfVaultError} when `adapter` is not the vault's adapter.
457
- * @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2,
458
- * including a Midnight adapter.
434
+ * @throws {VaultV2UnsupportedExitAdapterError} when the adapter is not a MorphoMarketV1AdapterV2.
459
435
  * @throws {VaultV2UnsupportedLiquidityAdapterError} when the vault routes liquidity through
460
436
  * another adapter.
461
437
  * @throws {VaultV2UndecodableLiquidityDataError} when the vault's `liquidityData` does not decode
@@ -16,11 +16,6 @@ import { getBundlesTokenRequirements } from "../requirements/index.js";
16
16
  // Maximum accepted deadline horizon; the on-chain management fee is capped at 5%/yr so the
17
17
  // accrual model stays well-defined inside it.
18
18
  const VAULT_V2_FEE_PROJECTION_HORIZON = Time.s.from.y(1n);
19
- /**
20
- * Midnight adapters revert vault-initiated `allocate` and `deallocate` (`SelfAllocationOnly`), so a
21
- * vault routing liquidity through one accepts no deposit and serves exits from idle assets only.
22
- */
23
- const isMidnightLiquidityAdapter = (vaultData) => vaultData.accrualLiquidityAdapter?.type === "VaultV2MidnightAdapter";
24
19
  /** Binds a viem client to a Vault V2 vault's action builders. */
25
20
  export class MorphoVaultV2 {
26
21
  client;
@@ -84,13 +79,6 @@ export class MorphoVaultV2 {
84
79
  // The native path must target the chain's registered wrapped-native asset.
85
80
  validateNativeVaultAsset(this.chainId, vaultAsset);
86
81
  }
87
- if (isMidnightLiquidityAdapter(vaultData)) {
88
- throw new InputExceedsMaxError({
89
- field: funding.value > 0n ? "nativeAmount" : "amount",
90
- value: funding.assets,
91
- max: 0n,
92
- });
93
- }
94
82
  const referralFeeAssets = getBundlesReferralFeeAssets(funding.assets, common.referralFeePct);
95
83
  const maxSharePrice = computeVaultMaxSharePrice({
96
84
  vaultData,
@@ -174,14 +162,6 @@ export class MorphoVaultV2 {
174
162
  throw new NonPositiveInputError("amount", amount);
175
163
  // Reject values outside the ABI range before resolving any requirements.
176
164
  validateUint256Field("amount", amount);
177
- if (isMidnightLiquidityAdapter(vaultData) &&
178
- amount > vaultData.assetBalance) {
179
- throw new InputExceedsMaxError({
180
- field: "amount",
181
- value: amount,
182
- max: vaultData.assetBalance,
183
- });
184
- }
185
165
  const createdAt = Time.timestamp();
186
166
  const deadline = params.deadline ?? createdAt + Time.s.from.h(2n);
187
167
  if (deadline <= createdAt)
@@ -272,20 +252,8 @@ export class MorphoVaultV2 {
272
252
  if (deadline <= now)
273
253
  throw new ExpiredDeadlineError(deadline, now);
274
254
  await this.assertWriteTargets(["bundles.vaultBundlesV1"]);
275
- const vaultData = await this.getData();
276
- if (isMidnightLiquidityAdapter(vaultData)) {
277
- // Onchain redeem accrues interest before converting shares to assets.
278
- const { vault: accrued } = vaultData.accrueInterest(now);
279
- if (accrued.toAssets(shares) > accrued.assetBalance) {
280
- throw new InputExceedsMaxError({
281
- field: "shares",
282
- value: shares,
283
- max: accrued.toShares(accrued.assetBalance),
284
- });
285
- }
286
- }
287
255
  return getVaultBundlesSharesRequirements(this.client.viemClient, {
288
- vaultData,
256
+ vaultData: await this.getData(),
289
257
  version: "vaultV2",
290
258
  owner: userAddress,
291
259
  chainId: this.chainId,
@@ -39,9 +39,8 @@ export interface InputVaultV2BlueReallocationData {
39
39
  /**
40
40
  * Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
41
41
  *
42
- * Constructor inputs are cloned, except Midnight adapter snapshots: those are
43
- * shared by reference and must be treated as read-only. Every simulated
44
- * reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
42
+ * Constructor inputs are cloned. Every simulated reallocation returns a new
43
+ * instance. Planning keeps the transaction-scoped `firstTotalAssets`
45
44
  * denominator outside the durable snapshot while applying reallocations in
46
45
  * contract order. Penalty donations update simulated vault accounting but are
47
46
  * excluded from same-plan idle liquidity so round-up dust cannot create
@@ -101,8 +100,7 @@ export declare class VaultV2BlueReallocationData implements InputVaultV2BlueReal
101
100
  /**
102
101
  * Clones the complete simulation snapshot.
103
102
  *
104
- * @returns A deep clone of this simulation state. Midnight adapter snapshots are
105
- * shared by reference and must be treated as read-only.
103
+ * @returns A deep clone of this simulation state.
106
104
  * @example
107
105
  * ```ts
108
106
  * import { markets } from "@morpho-org/morpho-test";
@@ -75,10 +75,6 @@ const cloneAccrualVault = (vault, markets) => new AccrualVault({
75
75
  position: clonePosition(position, markets),
76
76
  })));
77
77
  const cloneAdapter = (adapter, markets) => {
78
- // BluePublicAllocator never moves Midnight liquidity, and reallocation never mutates a Midnight
79
- // adapter, so its read-only snapshot is shared as-is.
80
- if (adapter.type === "VaultV2MidnightAdapter")
81
- return adapter;
82
78
  const base = {
83
79
  address: adapter.address,
84
80
  parentVault: adapter.parentVault,
@@ -126,9 +122,8 @@ const cloneVault = (vault, { markets, adapterKeysToClone, }) => {
126
122
  /**
127
123
  * Immutable-by-convention state container for Vault V2 BluePublicAllocator simulations.
128
124
  *
129
- * Constructor inputs are cloned, except Midnight adapter snapshots: those are
130
- * shared by reference and must be treated as read-only. Every simulated
131
- * reallocation returns a new instance. Planning keeps the transaction-scoped `firstTotalAssets`
125
+ * Constructor inputs are cloned. Every simulated reallocation returns a new
126
+ * instance. Planning keeps the transaction-scoped `firstTotalAssets`
132
127
  * denominator outside the durable snapshot while applying reallocations in
133
128
  * contract order. Penalty donations update simulated vault accounting but are
134
129
  * excluded from same-plan idle liquidity so round-up dust cannot create
@@ -250,8 +245,7 @@ export class VaultV2BlueReallocationData {
250
245
  /**
251
246
  * Clones the complete simulation snapshot.
252
247
  *
253
- * @returns A deep clone of this simulation state. Midnight adapter snapshots are
254
- * shared by reference and must be treated as read-only.
248
+ * @returns A deep clone of this simulation state.
255
249
  * @example
256
250
  * ```ts
257
251
  * import { markets } from "@morpho-org/morpho-test";
@@ -1,7 +1,7 @@
1
- export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, InvalidVaultV2MidnightAdapterMarketsError as InvalidBlueVaultV2MidnightAdapterMarketsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
- export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError as BlueUnresolvedBlockNumberError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
5
- export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
4
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
5
+ export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
6
6
  export type { ErrorClass } from "@morpho-org/morpho-ts";
7
- export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, InvalidPositionAccrualStateError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
7
+ export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
package/lib/esm/errors.js CHANGED
@@ -1,6 +1,6 @@
1
- export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, InvalidVaultV2MidnightAdapterMarketsError as InvalidBlueVaultV2MidnightAdapterMarketsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
2
2
  /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
3
  UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
- export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnresolvedBlockNumberError as BlueUnresolvedBlockNumberError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
5
- export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
6
- export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, InvalidPositionAccrualStateError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
4
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, MalformedTokenMetadataError, MarketParamsIdMismatchError as BlueMarketParamsIdMismatchError, MissingPermitDomainNameError, NonTupleReturnValueError, UnknownAbiFunctionError, UnnamedAbiOutputsError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
5
+ export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidRateRatifierV1RateError as InvalidMidnightRateRatifierV1RateError, InvalidRateRatifierV1TickError as InvalidMidnightRateRatifierV1TickError, InvalidRateRatifierV1TimeError as InvalidMidnightRateRatifierV1TimeError, InvalidRatifierV1AddressError as InvalidMidnightRatifierV1AddressError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, RateRatifierV1BoundOverflowError as MidnightRateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError as MidnightRatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
6
+ export { _try, DivisionByZeroError, InvalidAddressError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";