@morpho-org/morpho-sdk 6.0.0-next.2 → 6.0.0-next.3

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 (257) hide show
  1. package/MIGRATION-v5-to-v6.md +83 -29
  2. package/README.md +9 -7
  3. package/lib/cjs/abis.d.ts +3 -2844
  4. package/lib/cjs/abis.js +1 -1951
  5. package/lib/cjs/actions/blue/borrow.d.ts +3 -2
  6. package/lib/cjs/actions/blue/borrow.js +3 -2
  7. package/lib/cjs/actions/blue/common.js +1 -9
  8. package/lib/cjs/actions/blue/refinance.d.ts +2 -2
  9. package/lib/cjs/actions/blue/refinance.js +2 -2
  10. package/lib/cjs/actions/blue/repay.d.ts +1 -1
  11. package/lib/cjs/actions/blue/repay.js +1 -1
  12. package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +2 -2
  13. package/lib/cjs/actions/blue/repayWithdrawCollateral.js +2 -2
  14. package/lib/cjs/actions/blue/supply.d.ts +2 -2
  15. package/lib/cjs/actions/blue/supply.js +2 -2
  16. package/lib/cjs/actions/blue/supplyCollateral.d.ts +2 -2
  17. package/lib/cjs/actions/blue/supplyCollateral.js +2 -2
  18. package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -2
  19. package/lib/cjs/actions/blue/supplyCollateralBorrow.js +3 -2
  20. package/lib/cjs/actions/blue/withdraw.d.ts +3 -3
  21. package/lib/cjs/actions/blue/withdraw.js +3 -3
  22. package/lib/cjs/actions/blue/withdrawCollateral.d.ts +2 -2
  23. package/lib/cjs/actions/blue/withdrawCollateral.js +2 -2
  24. package/lib/cjs/actions/bundles/common.d.ts +6 -2
  25. package/lib/cjs/actions/bundles/common.js +23 -5
  26. package/lib/cjs/actions/index.d.ts +0 -1
  27. package/lib/cjs/actions/index.js +0 -1
  28. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +6 -8
  29. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +11 -16
  30. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +5 -6
  31. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +4 -5
  32. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
  33. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +4 -5
  34. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +5 -5
  35. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +6 -11
  36. package/lib/cjs/actions/requirements/encode/index.d.ts +0 -1
  37. package/lib/cjs/actions/requirements/encode/index.js +0 -1
  38. package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +5 -6
  39. package/lib/cjs/actions/requirements/getRequirementsApproval.js +5 -6
  40. package/lib/cjs/actions/requirements/index.d.ts +0 -1
  41. package/lib/cjs/actions/requirements/index.js +0 -1
  42. package/lib/cjs/actions/vaultV1/deposit.d.ts +1 -2
  43. package/lib/cjs/actions/vaultV1/deposit.js +1 -2
  44. package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +6 -5
  45. package/lib/cjs/actions/vaultV1/inKindRedeem.js +10 -7
  46. package/lib/cjs/actions/vaultV2/deposit.d.ts +1 -2
  47. package/lib/cjs/actions/vaultV2/deposit.js +1 -2
  48. package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +1 -1
  49. package/lib/cjs/actions/vaultV2/forceWithdraw.js +3 -3
  50. package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +6 -5
  51. package/lib/cjs/actions/vaultV2/inKindRedeem.js +10 -7
  52. package/lib/cjs/augment.d.ts +0 -1
  53. package/lib/cjs/augment.js +0 -1
  54. package/lib/cjs/blue/abis.d.ts +1 -5
  55. package/lib/cjs/blue/abis.js +1 -7
  56. package/lib/cjs/blue/entities.d.ts +2 -8
  57. package/lib/cjs/blue/entities.js +1 -3
  58. package/lib/cjs/blue/fetch.d.ts +1 -3
  59. package/lib/cjs/blue/fetch.js +1 -3
  60. package/lib/cjs/blue/types.d.ts +2 -4
  61. package/lib/cjs/blue/utils.d.ts +1 -3
  62. package/lib/cjs/blue/utils.js +1 -3
  63. package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
  64. package/lib/cjs/client/morphoViemExtension.js +1 -1
  65. package/lib/cjs/constants.d.ts +3 -37
  66. package/lib/cjs/constants.js +1 -39
  67. package/lib/cjs/entities/blue/blue.d.ts +30 -265
  68. package/lib/cjs/entities/blue/blue.js +1 -205
  69. package/lib/cjs/entities/index.d.ts +3 -66
  70. package/lib/cjs/entities/index.js +1 -21
  71. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +9 -2
  72. package/lib/cjs/entities/vaultV1/vaultV1.js +12 -7
  73. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +22 -9
  74. package/lib/cjs/entities/vaultV2/vaultV2.js +28 -15
  75. package/lib/cjs/entities/vaultV2BlueReallocationData.js +4 -21
  76. package/lib/cjs/errors.d.ts +2 -46
  77. package/lib/cjs/errors.js +1 -46
  78. package/lib/cjs/fetch.d.ts +1 -17
  79. package/lib/cjs/fetch.js +1 -17
  80. package/lib/cjs/helpers/constant.d.ts +0 -2
  81. package/lib/cjs/helpers/constant.js +0 -2
  82. package/lib/cjs/helpers/index.d.ts +2 -3
  83. package/lib/cjs/helpers/index.js +1 -9
  84. package/lib/cjs/helpers/slippage.d.ts +1 -103
  85. package/lib/cjs/helpers/slippage.js +0 -150
  86. package/lib/cjs/helpers/utilization.d.ts +12 -10
  87. package/lib/cjs/helpers/utilization.js +27 -12
  88. package/lib/cjs/helpers/validate.d.ts +1 -24
  89. package/lib/cjs/helpers/validate.js +2 -49
  90. package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
  91. package/lib/cjs/helpers/validateRequirementSpender.js +1 -3
  92. package/lib/cjs/types/action.d.ts +17 -65
  93. package/lib/cjs/types/action.js +11 -4
  94. package/lib/cjs/types/error.d.ts +50 -381
  95. package/lib/cjs/types/error.js +64 -395
  96. package/lib/cjs/types/sharedLiquidity.d.ts +1 -117
  97. package/lib/cjs/types.d.ts +2 -18
  98. package/lib/cjs/utils.d.ts +6 -35
  99. package/lib/cjs/utils.js +2 -36
  100. package/lib/esm/abis.d.ts +3 -2844
  101. package/lib/esm/abis.js +3 -1950
  102. package/lib/esm/actions/blue/borrow.d.ts +3 -2
  103. package/lib/esm/actions/blue/borrow.js +3 -2
  104. package/lib/esm/actions/blue/common.js +1 -9
  105. package/lib/esm/actions/blue/refinance.d.ts +2 -2
  106. package/lib/esm/actions/blue/refinance.js +2 -2
  107. package/lib/esm/actions/blue/repay.d.ts +1 -1
  108. package/lib/esm/actions/blue/repay.js +1 -1
  109. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +2 -2
  110. package/lib/esm/actions/blue/repayWithdrawCollateral.js +2 -2
  111. package/lib/esm/actions/blue/supply.d.ts +2 -2
  112. package/lib/esm/actions/blue/supply.js +2 -2
  113. package/lib/esm/actions/blue/supplyCollateral.d.ts +2 -2
  114. package/lib/esm/actions/blue/supplyCollateral.js +2 -2
  115. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -2
  116. package/lib/esm/actions/blue/supplyCollateralBorrow.js +3 -2
  117. package/lib/esm/actions/blue/withdraw.d.ts +3 -3
  118. package/lib/esm/actions/blue/withdraw.js +3 -3
  119. package/lib/esm/actions/blue/withdrawCollateral.d.ts +2 -2
  120. package/lib/esm/actions/blue/withdrawCollateral.js +2 -2
  121. package/lib/esm/actions/bundles/common.d.ts +6 -2
  122. package/lib/esm/actions/bundles/common.js +24 -6
  123. package/lib/esm/actions/index.d.ts +0 -1
  124. package/lib/esm/actions/index.js +0 -1
  125. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +6 -8
  126. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +12 -17
  127. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +5 -6
  128. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +4 -5
  129. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
  130. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +4 -5
  131. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +5 -5
  132. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +6 -11
  133. package/lib/esm/actions/requirements/encode/index.d.ts +0 -1
  134. package/lib/esm/actions/requirements/encode/index.js +0 -1
  135. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +5 -6
  136. package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -6
  137. package/lib/esm/actions/requirements/index.d.ts +0 -1
  138. package/lib/esm/actions/requirements/index.js +0 -1
  139. package/lib/esm/actions/vaultV1/deposit.d.ts +1 -2
  140. package/lib/esm/actions/vaultV1/deposit.js +1 -2
  141. package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +6 -5
  142. package/lib/esm/actions/vaultV1/inKindRedeem.js +10 -7
  143. package/lib/esm/actions/vaultV2/deposit.d.ts +1 -2
  144. package/lib/esm/actions/vaultV2/deposit.js +1 -2
  145. package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +1 -1
  146. package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -3
  147. package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +6 -5
  148. package/lib/esm/actions/vaultV2/inKindRedeem.js +10 -7
  149. package/lib/esm/augment.d.ts +0 -1
  150. package/lib/esm/augment.js +0 -1
  151. package/lib/esm/blue/abis.d.ts +1 -5
  152. package/lib/esm/blue/abis.js +1 -5
  153. package/lib/esm/blue/entities.d.ts +2 -8
  154. package/lib/esm/blue/entities.js +1 -3
  155. package/lib/esm/blue/fetch.d.ts +1 -3
  156. package/lib/esm/blue/fetch.js +1 -3
  157. package/lib/esm/blue/types.d.ts +2 -4
  158. package/lib/esm/blue/utils.d.ts +1 -3
  159. package/lib/esm/blue/utils.js +1 -3
  160. package/lib/esm/client/morphoViemExtension.d.ts +1 -1
  161. package/lib/esm/client/morphoViemExtension.js +1 -1
  162. package/lib/esm/constants.d.ts +3 -37
  163. package/lib/esm/constants.js +3 -37
  164. package/lib/esm/entities/blue/blue.d.ts +30 -265
  165. package/lib/esm/entities/blue/blue.js +4 -208
  166. package/lib/esm/entities/index.d.ts +3 -66
  167. package/lib/esm/entities/index.js +1 -18
  168. package/lib/esm/entities/vaultV1/vaultV1.d.ts +9 -2
  169. package/lib/esm/entities/vaultV1/vaultV1.js +15 -10
  170. package/lib/esm/entities/vaultV2/vaultV2.d.ts +22 -9
  171. package/lib/esm/entities/vaultV2/vaultV2.js +32 -19
  172. package/lib/esm/entities/vaultV2BlueReallocationData.js +2 -19
  173. package/lib/esm/errors.d.ts +2 -46
  174. package/lib/esm/errors.js +2 -46
  175. package/lib/esm/fetch.d.ts +1 -17
  176. package/lib/esm/fetch.js +1 -17
  177. package/lib/esm/helpers/constant.d.ts +0 -2
  178. package/lib/esm/helpers/constant.js +0 -2
  179. package/lib/esm/helpers/index.d.ts +2 -3
  180. package/lib/esm/helpers/index.js +2 -3
  181. package/lib/esm/helpers/slippage.d.ts +1 -103
  182. package/lib/esm/helpers/slippage.js +1 -147
  183. package/lib/esm/helpers/utilization.d.ts +12 -10
  184. package/lib/esm/helpers/utilization.js +26 -11
  185. package/lib/esm/helpers/validate.d.ts +1 -24
  186. package/lib/esm/helpers/validate.js +2 -48
  187. package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
  188. package/lib/esm/helpers/validateRequirementSpender.js +1 -3
  189. package/lib/esm/types/action.d.ts +17 -65
  190. package/lib/esm/types/action.js +12 -5
  191. package/lib/esm/types/error.d.ts +50 -381
  192. package/lib/esm/types/error.js +58 -377
  193. package/lib/esm/types/sharedLiquidity.d.ts +1 -117
  194. package/lib/esm/types.d.ts +2 -18
  195. package/lib/esm/utils.d.ts +6 -35
  196. package/lib/esm/utils.js +5 -34
  197. package/package.json +5 -13
  198. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
  199. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -88
  200. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
  201. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -152
  202. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
  203. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -53
  204. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
  205. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -74
  206. package/lib/cjs/actions/requirements/generalAdapter/index.d.ts +0 -3
  207. package/lib/cjs/actions/requirements/generalAdapter/index.js +0 -19
  208. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
  209. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.js +0 -48
  210. package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +0 -58
  211. package/lib/cjs/actions/signatures/getTokenRequirementActions.js +0 -119
  212. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -50
  213. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -45
  214. package/lib/cjs/actions/signatures/index.d.ts +0 -3
  215. package/lib/cjs/actions/signatures/index.js +0 -19
  216. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -11
  217. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.js +0 -8
  218. package/lib/cjs/bundler/actions.d.ts +0 -797
  219. package/lib/cjs/bundler/actions.js +0 -1371
  220. package/lib/cjs/bundler/index.d.ts +0 -2
  221. package/lib/cjs/bundler/index.js +0 -18
  222. package/lib/cjs/bundler/types.d.ts +0 -235
  223. package/lib/cjs/bundler/types.js +0 -2
  224. package/lib/cjs/entities/vaultV1ReallocationData.d.ts +0 -332
  225. package/lib/cjs/entities/vaultV1ReallocationData.js +0 -557
  226. package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +0 -80
  227. package/lib/cjs/helpers/computeVaultV1Reallocations.js +0 -245
  228. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
  229. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -84
  230. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
  231. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -148
  232. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
  233. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -49
  234. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
  235. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -70
  236. package/lib/esm/actions/requirements/generalAdapter/index.d.ts +0 -3
  237. package/lib/esm/actions/requirements/generalAdapter/index.js +0 -3
  238. package/lib/esm/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
  239. package/lib/esm/actions/signatures/getBlueAuthorizationAction.js +0 -44
  240. package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +0 -58
  241. package/lib/esm/actions/signatures/getTokenRequirementActions.js +0 -115
  242. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -50
  243. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -41
  244. package/lib/esm/actions/signatures/index.d.ts +0 -3
  245. package/lib/esm/actions/signatures/index.js +0 -3
  246. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -11
  247. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +0 -7
  248. package/lib/esm/bundler/actions.d.ts +0 -797
  249. package/lib/esm/bundler/actions.js +0 -1368
  250. package/lib/esm/bundler/index.d.ts +0 -2
  251. package/lib/esm/bundler/index.js +0 -2
  252. package/lib/esm/bundler/types.d.ts +0 -235
  253. package/lib/esm/bundler/types.js +0 -1
  254. package/lib/esm/entities/vaultV1ReallocationData.d.ts +0 -332
  255. package/lib/esm/entities/vaultV1ReallocationData.js +0 -559
  256. package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +0 -80
  257. package/lib/esm/helpers/computeVaultV1Reallocations.js +0 -241
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZeroSupplyAmountError = exports.NonPositiveWithdrawCollateralAmountError = exports.NonPositiveRepayMaxSharePriceError = exports.NonPositiveRepayAmountError = exports.NonPositiveReallocationAmountError = exports.ZeroCollateralAmountError = exports.NonPositiveBorrowAmountError = exports.ZeroDepositAmountError = exports.NonPositiveMaxSharePriceError = exports.NonPositiveSharesAmountError = exports.NonPositiveAssetAmountError = exports.MaxRepayAssetsBelowRepayAssetsError = exports.ReallocationsRequireBorrowError = exports.UnsupportedAuthorizationOperatorError = exports.ReallocationLoanTokenMismatchError = exports.SameVaultMigrationError = exports.AmountAndSharesExclusiveError = exports.MixedBundlesFundingError = exports.ReferralFeePctExceededError = exports.MissingReferralFeeRecipientError = exports.ReferralFeeRecipientMissingError = exports.NativeFundingAmountMismatchError = exports.Permit2TransferFromNonceAlreadyUsedError = exports.NoUnusedPermit2NonceError = exports.Permit2SignatureTransferNonceAlreadyUsedError = exports.BlueBundlesV1RequirementSignatureMismatchError = exports.BundlesRequirementSignatureMismatchError = exports.VaultExitBundlesV1PermitMismatchError = exports.BundlesPermitMismatchError = exports.VaultIsBlueFeeRecipientError = exports.VaultMorphoMismatchError = exports.InsufficientBlueBalanceForInKindRedeemError = exports.InKindRedeemCoverageError = exports.InKindRedeemZeroDeallocationError = exports.VaultV2ForceWithdrawFeeSharesExceedBurnError = exports.VaultV2ForceWithdrawZeroSharePriceError = exports.VaultV2ForceWithdrawZeroWithdrawalError = exports.VaultV2ForceWithdrawCoverageError = exports.VaultV2UndecodableLiquidityDataError = exports.VaultV2UnsupportedLiquidityAdapterError = exports.UnsupportedInKindAdapterError = exports.VaultV2UnsupportedExitAdapterError = exports.AdapterNotPartOfVaultError = exports.InKindRedeemRequiresSingleAdapterError = exports.VaultV2SingleAdapterRequiredError = exports.ExpiredDeadlineError = exports.EmptyMarketParamsListError = exports.InputExceedsMaxError = exports.NonPositiveInputError = exports.NegativeInputError = void 0;
4
- exports.WithdrawMakesPositionUnhealthyError = exports.WithdrawExceedsCollateralError = exports.MutuallyExclusiveRepayAmountsError = exports.TransferAmountNotEqualToAssetsError = exports.UnsortedReallocationWithdrawalsError = exports.InconsistentReallocationPenaltyError = exports.InvalidReallocationSourceTypeError = exports.InvalidReallocationAddressError = exports.MixedReallocationVersionsError = exports.InvalidReallocationShapeError = exports.ReallocationWithdrawalOnTargetMarketError = exports.EmptyReallocationWithdrawalsError = exports.AccrualPositionUserMismatchError = exports.MarketIdMismatchError = exports.MissingMarketPriceError = exports.BorrowExceedsSafeLtvError = exports.NativeAmountOnNonWNativeCollateralError = exports.NativeAmountOnNonWNativeAssetError = exports.VaultAddressMismatchError = exports.ChainWNativeMissingError = exports.NativeAmountOnNonWNativeVaultError = exports.Permit2ExpirationMissingError = exports.DepositSpenderMismatchError = exports.DepositOwnerMismatchError = exports.DepositAssetMismatchError = exports.DepositAmountMismatchError = exports.EmptyDeallocationsError = exports.ExcessiveSlippageToleranceError = exports.MissingAccrualPositionError = exports.UnsupportedMidnightAuthorizationTargetError = exports.UnsupportedErc20ApprovalSpenderError = exports.ApprovalAmountLessThanSpendAmountError = exports.MissingClientPropertyError = exports.CryptoUnavailableError = exports.ChainIdMismatchError = exports.AddressMismatchError = exports.UnexpectedRequirementSignatureError = exports.AmbiguousRequirementSignaturesError = exports.BundlerErrors = exports.NegativeMaxRepaySharePriceError = exports.NegativeBorrowSharesError = exports.NegativeMinSharePriceError = exports.NegativeWithdrawMinSharePriceError = exports.NegativeSupplyMaxSharePriceError = exports.NegativeSupplyAmountError = exports.NonPositiveMinBorrowSharePriceError = exports.NegativeReallocationFeeError = exports.NegativeNativeAmountError = exports.NegativeSlippageToleranceError = exports.NonPositiveWithdrawAmountError = void 0;
5
- exports.RefinanceSharesMissingBorrowAssetsError = exports.RefinanceExceedsBorrowAssetsError = exports.RefinanceExceedsBorrowSharesError = exports.RefinanceExceedsCollateralError = exports.BorrowAmountAndSharesExclusiveError = exports.RefinanceTokenMismatchError = exports.RefinanceSameMarketError = exports.VaultAssetMismatchError = exports.ReallocationWithdrawExceedsMarketSupplyError = exports.WithdrawSharesExceedSupplyError = exports.WithdrawExceedsSupplyError = exports.MutuallyExclusiveWithdrawAmountsError = exports.InsufficientMidnightWithdrawableLiquidityError = exports.MidnightRedeemExceedsCreditError = exports.NoMidnightCreditToRedeemError = exports.UnpreparedMidnightOfferRootSignatureError = exports.MidnightOfferRootOfferCountMismatchError = exports.MidnightOfferRootRatifierMismatchError = exports.MidnightOfferRootOwnerMismatchError = exports.MidnightOfferRootMismatchError = exports.MissingMidnightOfferRootSignatureError = exports.UnknownMidnightRatifierError = exports.MidnightTakeableOfferMarketMismatchError = exports.MidnightOfferMarketLoanTokenMismatchError = exports.MidnightMarketAddressMismatchError = exports.MidnightOfferMarketAddressMismatchError = exports.MidnightOfferMarketChainMismatchError = exports.MidnightOfferMakerMismatchError = exports.MidnightOfferSideMismatchError = exports.EmptyMidnightTakeableOffersError = exports.MidnightAmountExceedsMaxOfferCapError = exports.ReallocationAdapterSupplySharesUnderflowError = exports.ReallocationAllocationUnderflowError = exports.UnknownReallocationAdapterError = exports.UnknownReallocationMarketPublicAllocatorConfigError = exports.UnknownReallocationActiveAdaptersError = exports.UnknownReallocationPublicAllocatorConfigError = exports.UnknownReallocationAllocationError = exports.UnknownReallocationPositionError = exports.UnknownReallocationVaultMarketConfigError = exports.UnknownReallocationVaultError = exports.UnknownReallocationMarketError = exports.InsufficientSharedLiquidityError = exports.DisabledReallocationMarketError = exports.MissingPublicAllocatorConfigError = exports.RepaySharesExceedDebtError = exports.InvalidSignatureError = exports.RepayExceedsDebtError = exports.ShareDivideByZeroError = void 0;
3
+ exports.DepositOwnerMismatchError = exports.DepositAssetMismatchError = exports.DepositAmountMismatchError = exports.EmptyDeallocationsError = exports.ExcessiveSlippageToleranceError = exports.MissingAccrualPositionError = exports.UnsupportedMidnightAuthorizationTargetError = exports.UnsupportedErc20ApprovalSpenderError = exports.ApprovalAmountLessThanSpendAmountError = exports.MissingClientPropertyError = exports.CryptoUnavailableError = exports.ChainIdMismatchError = exports.AddressMismatchError = exports.UnsupportedRequirementSignatureError = exports.UnexpectedRequirementSignatureError = exports.AmbiguousRequirementSignaturesError = exports.MaxRepayAssetsBelowRepayAssetsError = exports.ReallocationsRequireBorrowError = exports.UnsupportedAuthorizationOperatorError = exports.ReallocationLoanTokenMismatchError = exports.SameVaultMigrationError = exports.AmountAndSharesExclusiveError = exports.MixedBundlesFundingError = exports.ReferralFeePctExceededError = exports.ReferralFeeRecipientMissingError = exports.NativeFundingAmountMismatchError = exports.NoUnusedPermit2NonceError = exports.Permit2SignatureTransferNonceAlreadyUsedError = exports.BundlesRequirementSignatureMismatchError = exports.BundlesPermitMismatchError = exports.VaultIsBlueFeeRecipientError = exports.VaultMorphoMismatchError = exports.InsufficientBlueBalanceForInKindRedeemError = exports.InKindRedeemCoverageError = exports.InKindRedeemZeroDeallocationError = exports.VaultV2ForceWithdrawFeeSharesExceedBurnError = exports.VaultV2ForceWithdrawSharePriceBelowFloorError = exports.VaultV2ForceWithdrawZeroSharePriceError = exports.VaultV2ForceWithdrawZeroWithdrawalError = exports.VaultV2ForceWithdrawCoverageError = exports.VaultV2UndecodableLiquidityDataError = exports.VaultV2UnsupportedLiquidityAdapterError = exports.VaultV2UnsupportedExitAdapterError = exports.AdapterNotPartOfVaultError = exports.VaultV2SingleAdapterRequiredError = exports.ExpiredDeadlineError = exports.EmptyMarketParamsListError = exports.InputExceedsMaxError = exports.NonPositiveInputError = exports.NegativeInputError = void 0;
4
+ exports.MutuallyExclusiveWithdrawAmountsError = exports.InsufficientMidnightWithdrawableLiquidityError = exports.MidnightRedeemExceedsCreditError = exports.NoMidnightCreditToRedeemError = exports.UnpreparedMidnightOfferRootSignatureError = exports.MidnightOfferRootOfferCountMismatchError = exports.MidnightOfferRootRatifierMismatchError = exports.MidnightOfferRootOwnerMismatchError = exports.MidnightOfferRootMismatchError = exports.MissingMidnightOfferRootSignatureError = exports.UnknownMidnightRatifierError = exports.MidnightTakeableOfferMarketMismatchError = exports.MidnightOfferMarketLoanTokenMismatchError = exports.MidnightMarketAddressMismatchError = exports.MidnightOfferMarketAddressMismatchError = exports.MidnightOfferMarketChainMismatchError = exports.MidnightOfferMakerMismatchError = exports.MidnightOfferSideMismatchError = exports.EmptyMidnightTakeableOffersError = exports.MidnightAmountExceedsMaxOfferCapError = exports.ReallocationAdapterSupplySharesUnderflowError = exports.ReallocationAllocationUnderflowError = exports.UnknownReallocationAdapterError = exports.UnknownReallocationMarketPublicAllocatorConfigError = exports.UnknownReallocationActiveAdaptersError = exports.UnknownReallocationPublicAllocatorConfigError = exports.UnknownReallocationAllocationError = exports.UnknownReallocationVaultError = exports.UnknownReallocationMarketError = exports.InsufficientSharedLiquidityError = exports.RepaySharesExceedDebtError = exports.InvalidSignatureError = exports.RepayExceedsDebtError = exports.WithdrawMakesPositionUnhealthyError = exports.WithdrawExceedsCollateralError = exports.MutuallyExclusiveRepayAmountsError = exports.InconsistentReallocationPenaltyError = exports.InvalidReallocationSourceTypeError = exports.InvalidReallocationAddressError = exports.InvalidVaultV2BlueReallocationShapeError = exports.ReallocationWithdrawalOnTargetMarketError = exports.AccrualPositionUserMismatchError = exports.MarketIdMismatchError = exports.MissingMarketPriceError = exports.BorrowExceedsSafeLtvError = exports.NativeAmountOnNonWNativeAssetError = exports.VaultAddressMismatchError = exports.ChainWNativeMissingError = exports.NativeAmountOnNonWNativeVaultError = exports.DepositSpenderMismatchError = void 0;
5
+ exports.RefinanceTokenMismatchError = exports.RefinanceSameMarketError = exports.VaultAssetMismatchError = exports.ReallocationWithdrawExceedsMarketSupplyError = exports.WithdrawSharesExceedSupplyError = exports.WithdrawExceedsSupplyError = void 0;
6
6
  const blue_sdk_1 = require("@morpho-org/blue-sdk");
7
7
  /**
8
8
  * Thrown when a morpho-sdk input that must be non-negative is negative.
@@ -138,8 +138,6 @@ class VaultV2SingleAdapterRequiredError extends Error {
138
138
  }
139
139
  }
140
140
  exports.VaultV2SingleAdapterRequiredError = VaultV2SingleAdapterRequiredError;
141
- /** @deprecated Use {@link VaultV2SingleAdapterRequiredError}. */
142
- exports.InKindRedeemRequiresSingleAdapterError = VaultV2SingleAdapterRequiredError;
143
141
  /** Thrown when a requested in-kind redemption adapter is not part of the Vault V2 snapshot. */
144
142
  class AdapterNotPartOfVaultError extends Error {
145
143
  vault;
@@ -184,8 +182,6 @@ class VaultV2UnsupportedExitAdapterError extends Error {
184
182
  }
185
183
  }
186
184
  exports.VaultV2UnsupportedExitAdapterError = VaultV2UnsupportedExitAdapterError;
187
- /** @deprecated Use {@link VaultV2UnsupportedExitAdapterError}. */
188
- exports.UnsupportedInKindAdapterError = VaultV2UnsupportedExitAdapterError;
189
185
  /**
190
186
  * Thrown when a Vault V2 exit cannot resolve the vault's configured liquidity adapter.
191
187
  *
@@ -402,6 +398,44 @@ class VaultV2ForceWithdrawZeroSharePriceError extends Error {
402
398
  }
403
399
  }
404
400
  exports.VaultV2ForceWithdrawZeroSharePriceError = VaultV2ForceWithdrawZeroSharePriceError;
401
+ /**
402
+ * Thrown when a supplied force-withdraw share-price floor is below the SDK safety floor.
403
+ *
404
+ * An override below the floor derived at `MAX_SLIPPAGE_TOLERANCE` would weaken the on-chain
405
+ * share-price protection and let the required share allowance grow without bound, so the entity
406
+ * rejects it instead of encoding it.
407
+ *
408
+ * @example
409
+ * ```ts
410
+ * import { VaultV2ForceWithdrawSharePriceBelowFloorError } from "@morpho-org/morpho-sdk";
411
+ *
412
+ * try {
413
+ * vault.forceWithdraw({ exitAssets, vaultData, userAddress, minSharePriceE27 });
414
+ * } catch (error) {
415
+ * if (error instanceof VaultV2ForceWithdrawSharePriceBelowFloorError) {
416
+ * console.error(error.minSharePriceE27, error.floorE27);
417
+ * }
418
+ * }
419
+ * ```
420
+ */
421
+ class VaultV2ForceWithdrawSharePriceBelowFloorError extends Error {
422
+ /** Supplied force-withdraw share-price floor. */
423
+ minSharePriceE27;
424
+ /** Minimum share-price floor allowed at maximum SDK slippage tolerance. */
425
+ floorE27;
426
+ /**
427
+ * @param params - Supplied and minimum allowed share-price floors.
428
+ * @param params.minSharePriceE27 - Supplied force-withdraw share-price floor.
429
+ * @param params.floorE27 - Minimum floor derived at maximum SDK slippage tolerance.
430
+ */
431
+ constructor(params) {
432
+ super(`Force-withdraw share price floor "${params.minSharePriceE27}" is below the minimum allowed "${params.floorE27}" (max slippage tolerance). Raise minSharePriceE27 or use slippageTolerance.`);
433
+ this.minSharePriceE27 = params.minSharePriceE27;
434
+ this.floorE27 = params.floorE27;
435
+ this.name = "VaultV2ForceWithdrawSharePriceBelowFloorError";
436
+ }
437
+ }
438
+ exports.VaultV2ForceWithdrawSharePriceBelowFloorError = VaultV2ForceWithdrawSharePriceBelowFloorError;
405
439
  /**
406
440
  * Thrown when fee shares projected to the accepted deadline reach the lower force-withdraw
407
441
  * burn bound at that time.
@@ -566,19 +600,6 @@ class BundlesPermitMismatchError extends Error {
566
600
  }
567
601
  }
568
602
  exports.BundlesPermitMismatchError = BundlesPermitMismatchError;
569
- /**
570
- * Thrown by the deprecated VaultExitBundlesV1 permit compatibility helper.
571
- *
572
- * @deprecated Use {@link BundlesPermitMismatchError} with `getBundlesSharesPermit`.
573
- */
574
- class VaultExitBundlesV1PermitMismatchError extends BundlesPermitMismatchError {
575
- constructor(params) {
576
- super(params);
577
- this.message = `VaultExitBundlesV1 permit ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Rebuild and sign the vault-exit permit.`;
578
- this.name = "VaultExitBundlesV1PermitMismatchError";
579
- }
580
- }
581
- exports.VaultExitBundlesV1PermitMismatchError = VaultExitBundlesV1PermitMismatchError;
582
603
  /** Thrown when a signed requirement cannot be safely encoded for a fixed bundles call. */
583
604
  class BundlesRequirementSignatureMismatchError extends Error {
584
605
  /** Field whose signed value or encoding is invalid for the fixed bundles call. */
@@ -603,7 +624,6 @@ class BundlesRequirementSignatureMismatchError extends Error {
603
624
  }
604
625
  }
605
626
  exports.BundlesRequirementSignatureMismatchError = BundlesRequirementSignatureMismatchError;
606
- exports.BlueBundlesV1RequirementSignatureMismatchError = BundlesRequirementSignatureMismatchError;
607
627
  /** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
608
628
  class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
609
629
  owner;
@@ -620,7 +640,6 @@ class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
620
640
  }
621
641
  }
622
642
  exports.Permit2SignatureTransferNonceAlreadyUsedError = Permit2SignatureTransferNonceAlreadyUsedError;
623
- exports.Permit2TransferFromNonceAlreadyUsedError = Permit2SignatureTransferNonceAlreadyUsedError;
624
643
  /** Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce. */
625
644
  class NoUnusedPermit2NonceError extends Error {
626
645
  owner;
@@ -661,8 +680,6 @@ class ReferralFeeRecipientMissingError extends Error {
661
680
  }
662
681
  }
663
682
  exports.ReferralFeeRecipientMissingError = ReferralFeeRecipientMissingError;
664
- /** @deprecated Use {@link ReferralFeeRecipientMissingError}. */
665
- exports.MissingReferralFeeRecipientError = ReferralFeeRecipientMissingError;
666
683
  /**
667
684
  * Thrown when a referral fee percentage is outside the contract's `[0, WAD)` range.
668
685
  *
@@ -728,9 +745,7 @@ class ReallocationLoanTokenMismatchError extends Error {
728
745
  }
729
746
  exports.ReallocationLoanTokenMismatchError = ReallocationLoanTokenMismatchError;
730
747
  /**
731
- * Thrown when a Blue authorization operator is not one of the chain's registered Morpho operators
732
- * (GeneralAdapter1 or BlueBundlesV1). Guards the exported authorization builder so a misconfigured
733
- * `authorized` cannot grant an arbitrary address control over the user's Morpho positions.
748
+ * Thrown when a Blue authorization operator is not the chain's registered BlueBundlesV1 contract.
734
749
  */
735
750
  class UnsupportedAuthorizationOperatorError extends Error {
736
751
  authorized;
@@ -740,7 +755,7 @@ class UnsupportedAuthorizationOperatorError extends Error {
740
755
  * @param chainId - Chain whose registry was consulted for the supported operators.
741
756
  */
742
757
  constructor(authorized, chainId) {
743
- super(`Authorization operator "${authorized}" is not a supported Morpho operator on chain ${chainId}. Pass the chain's registered GeneralAdapter1 or BlueBundlesV1 address, or omit \`authorized\` to default to GeneralAdapter1.`);
758
+ super(`Authorization operator "${authorized}" is not supported on chain ${chainId}. Pass the chain's registered BlueBundlesV1 address.`);
744
759
  this.authorized = authorized;
745
760
  this.chainId = chainId;
746
761
  this.name = "UnsupportedAuthorizationOperatorError";
@@ -771,148 +786,6 @@ class MaxRepayAssetsBelowRepayAssetsError extends Error {
771
786
  }
772
787
  }
773
788
  exports.MaxRepayAssetsBelowRepayAssetsError = MaxRepayAssetsBelowRepayAssetsError;
774
- /** @deprecated Use {@link NonPositiveInputError}. */
775
- exports.NonPositiveAssetAmountError = NonPositiveInputError;
776
- /** @deprecated Use {@link NonPositiveInputError}. */
777
- exports.NonPositiveSharesAmountError = NonPositiveInputError;
778
- /** @deprecated Use {@link NonPositiveInputError}. */
779
- exports.NonPositiveMaxSharePriceError = NonPositiveInputError;
780
- /** @deprecated Use {@link NonPositiveInputError}. */
781
- exports.ZeroDepositAmountError = NonPositiveInputError;
782
- /** @deprecated Use {@link NonPositiveInputError}. */
783
- exports.NonPositiveBorrowAmountError = NonPositiveInputError;
784
- /** @deprecated Use {@link NonPositiveInputError}. */
785
- exports.ZeroCollateralAmountError = NonPositiveInputError;
786
- /** @deprecated Use {@link NonPositiveInputError}. */
787
- exports.NonPositiveReallocationAmountError = NonPositiveInputError;
788
- /** @deprecated Use {@link NonPositiveInputError}. */
789
- exports.NonPositiveRepayAmountError = NonPositiveInputError;
790
- /** @deprecated Use {@link NonPositiveInputError}. */
791
- exports.NonPositiveRepayMaxSharePriceError = NonPositiveInputError;
792
- /** @deprecated Use {@link NonPositiveInputError}. */
793
- exports.NonPositiveWithdrawCollateralAmountError = NonPositiveInputError;
794
- /** @deprecated Use {@link NonPositiveInputError}. */
795
- exports.ZeroSupplyAmountError = NonPositiveInputError;
796
- /** @deprecated Use {@link NonPositiveInputError}. */
797
- exports.NonPositiveWithdrawAmountError = NonPositiveInputError;
798
- /** @deprecated Use {@link NegativeInputError}. */
799
- exports.NegativeSlippageToleranceError = NegativeInputError;
800
- /** @deprecated Use {@link NegativeInputError}. */
801
- exports.NegativeNativeAmountError = NegativeInputError;
802
- /** @deprecated Use {@link NegativeInputError}. */
803
- exports.NegativeReallocationFeeError = NegativeInputError;
804
- /** @deprecated Use {@link NegativeInputError}. */
805
- exports.NonPositiveMinBorrowSharePriceError = NegativeInputError;
806
- /** @deprecated Use {@link NegativeInputError}. */
807
- exports.NegativeSupplyAmountError = NegativeInputError;
808
- /** @deprecated Use {@link NegativeInputError}. */
809
- exports.NegativeSupplyMaxSharePriceError = NegativeInputError;
810
- /** @deprecated Use {@link NegativeInputError}. */
811
- exports.NegativeWithdrawMinSharePriceError = NegativeInputError;
812
- /** @deprecated Use {@link NegativeInputError}. */
813
- exports.NegativeMinSharePriceError = NegativeInputError;
814
- /** @deprecated Use {@link NegativeInputError}. */
815
- exports.NegativeBorrowSharesError = NegativeInputError;
816
- /** @deprecated Use {@link NegativeInputError}. */
817
- exports.NegativeMaxRepaySharePriceError = NegativeInputError;
818
- /**
819
- * Typed errors thrown while encoding supported Bundler3 actions.
820
- *
821
- * @remarks
822
- * Import these classes through `@morpho-org/morpho-sdk` when handling
823
- * failures from `BundlerAction`.
824
- */
825
- var BundlerErrors;
826
- (function (BundlerErrors) {
827
- /**
828
- * Thrown when an action that requires an offchain signature is encoded before
829
- * the signature has been attached.
830
- *
831
- * @example
832
- * ```ts
833
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
834
- *
835
- * if (error instanceof BundlerErrors.MissingSignature) {
836
- * // Attach the missing permit or Permit2 signature, then encode again.
837
- * }
838
- * ```
839
- */
840
- class MissingSignature extends Error {
841
- constructor() {
842
- super("missing signature");
843
- }
844
- }
845
- BundlerErrors.MissingSignature = MissingSignature;
846
- /**
847
- * Thrown when an action is unsupported on the requested chain.
848
- *
849
- * @example
850
- * ```ts
851
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
852
- *
853
- * if (error instanceof BundlerErrors.UnexpectedAction) {
854
- * // Remove or replace the action for the selected chain.
855
- * }
856
- * ```
857
- */
858
- class UnexpectedAction extends Error {
859
- /**
860
- * @param type - Unsupported Bundler3 action discriminator or name.
861
- * @param chainId - Chain where the action was requested.
862
- */
863
- constructor(type, chainId) {
864
- super(`unexpected action "${type}" on chain "${chainId}"`);
865
- }
866
- }
867
- BundlerErrors.UnexpectedAction = UnexpectedAction;
868
- /**
869
- * Thrown when a Morpho authorization signature names a forbidden `authorized` account
870
- * (for example Bundler3 itself), which would grant operator rights to an unintended address.
871
- *
872
- * @example
873
- * ```ts
874
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
875
- *
876
- * if (error instanceof BundlerErrors.UnexpectedSignature) {
877
- * // Re-sign the authorization targeting GeneralAdapter1.
878
- * }
879
- * ```
880
- */
881
- class UnexpectedSignature extends Error {
882
- /**
883
- * @param authorized - The forbidden `authorized` address carried by the signature.
884
- */
885
- constructor(authorized) {
886
- super(`unexpected signature authorizing "${authorized}"`);
887
- }
888
- }
889
- BundlerErrors.UnexpectedSignature = UnexpectedSignature;
890
- /**
891
- * Thrown when a skippable Blue Public Allocator call would leave a usable
892
- * token allowance behind after the allocator call reverts.
893
- *
894
- * @example
895
- * ```ts
896
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
897
- *
898
- * if (error instanceof BundlerErrors.SkippableAllocatorPenalty) {
899
- * // Rebuild the allocator call with skipRevert set to false.
900
- * }
901
- * ```
902
- */
903
- class SkippableAllocatorPenalty extends Error {
904
- penaltyAssets;
905
- /**
906
- * @param penaltyAssets - Exact token amount approved to the allocator.
907
- */
908
- constructor(penaltyAssets) {
909
- super(`Blue Public Allocator calls with penalty assets cannot skip reverts. Rebuild with skipRevert false for penalty amount "${penaltyAssets}".`);
910
- this.penaltyAssets = penaltyAssets;
911
- this.name = "SkippableAllocatorPenalty";
912
- }
913
- }
914
- BundlerErrors.SkippableAllocatorPenalty = SkippableAllocatorPenalty;
915
- })(BundlerErrors || (exports.BundlerErrors = BundlerErrors = {}));
916
789
  /**
917
790
  * Thrown when `buildTx` receives more than one requirement signature of the same kind.
918
791
  *
@@ -960,6 +833,18 @@ class UnexpectedRequirementSignatureError extends Error {
960
833
  }
961
834
  }
962
835
  exports.UnexpectedRequirementSignatureError = UnexpectedRequirementSignatureError;
836
+ /** Thrown when `buildTx` receives a requirement signature whose action type is not supported. */
837
+ class UnsupportedRequirementSignatureError extends Error {
838
+ type;
839
+ /**
840
+ * @param type - The unsupported signature action type.
841
+ */
842
+ constructor(type) {
843
+ super(`Received a requirement signature with unsupported action type "${type}". Re-run getRequirements() and sign the current requirements.`);
844
+ this.type = type;
845
+ }
846
+ }
847
+ exports.UnsupportedRequirementSignatureError = UnsupportedRequirementSignatureError;
963
848
  /** Thrown when a viem client's account address does not match the address required by the call. */
964
849
  class AddressMismatchError extends Error {
965
850
  constructor(clientAddress, argsAddress) {
@@ -999,7 +884,6 @@ exports.ApprovalAmountLessThanSpendAmountError = ApprovalAmountLessThanSpendAmou
999
884
  class UnsupportedErc20ApprovalSpenderError extends Error {
1000
885
  constructor(params) {
1001
886
  const supported = (params.supportedSpenders ?? [
1002
- params.generalAdapter1,
1003
887
  params.permit2,
1004
888
  params.midnight,
1005
889
  params.midnightBundles,
@@ -1068,13 +952,6 @@ class DepositSpenderMismatchError extends Error {
1068
952
  }
1069
953
  }
1070
954
  exports.DepositSpenderMismatchError = DepositSpenderMismatchError;
1071
- /** Thrown when a `permit2` requirement signature is missing the `expiration` field. */
1072
- class Permit2ExpirationMissingError extends Error {
1073
- constructor() {
1074
- super('Requirement signature with action.type === "permit2" must include args.expiration. Re-sign using the permit2 flow.');
1075
- }
1076
- }
1077
- exports.Permit2ExpirationMissingError = Permit2ExpirationMissingError;
1078
955
  /** Thrown when a vault deposit uses `nativeAmount` but the vault asset is not the chain's wNative. */
1079
956
  class NativeAmountOnNonWNativeVaultError extends Error {
1080
957
  constructor(vaultAsset, wNative) {
@@ -1103,8 +980,6 @@ class NativeAmountOnNonWNativeAssetError extends Error {
1103
980
  }
1104
981
  }
1105
982
  exports.NativeAmountOnNonWNativeAssetError = NativeAmountOnNonWNativeAssetError;
1106
- /** @deprecated Use {@link NativeAmountOnNonWNativeAssetError}. */
1107
- exports.NativeAmountOnNonWNativeCollateralError = NativeAmountOnNonWNativeAssetError;
1108
983
  /** Thrown when a borrow exceeds the LLTV-buffered safe maximum for the position. */
1109
984
  class BorrowExceedsSafeLtvError extends Error {
1110
985
  constructor(borrowAmount, maxSafeBorrow) {
@@ -1133,17 +1008,6 @@ class AccrualPositionUserMismatchError extends Error {
1133
1008
  }
1134
1009
  }
1135
1010
  exports.AccrualPositionUserMismatchError = AccrualPositionUserMismatchError;
1136
- /**
1137
- * Thrown when a reallocation has no withdrawals.
1138
- *
1139
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
1140
- */
1141
- class EmptyReallocationWithdrawalsError extends Error {
1142
- constructor(vault) {
1143
- super(`Reallocation withdrawals list cannot be empty for vault: ${vault}`);
1144
- }
1145
- }
1146
- exports.EmptyReallocationWithdrawalsError = EmptyReallocationWithdrawalsError;
1147
1011
  /** Thrown when a Public Allocator source references the target Blue market. */
1148
1012
  class ReallocationWithdrawalOnTargetMarketError extends Error {
1149
1013
  constructor(vault, marketId) {
@@ -1158,37 +1022,18 @@ exports.ReallocationWithdrawalOnTargetMarketError = ReallocationWithdrawalOnTarg
1158
1022
  *
1159
1023
  * @example
1160
1024
  * ```ts
1161
- * import { InvalidReallocationShapeError } from "@morpho-org/morpho-sdk";
1162
- *
1163
- * const error = new InvalidReallocationShapeError();
1164
- * ```
1165
- */
1166
- class InvalidReallocationShapeError extends Error {
1167
- constructor() {
1168
- super("Reallocation entry is not a valid Vault V2 reallocation. High-level Blue writes accept only VaultV2BlueReallocation entries (e.g. from getVaultV2BlueReallocations()); compose Vault V1 reallocations via low-level Bundler3 actions.");
1169
- this.name = "InvalidReallocationShapeError";
1170
- }
1171
- }
1172
- exports.InvalidReallocationShapeError = InvalidReallocationShapeError;
1173
- /**
1174
- * Thrown when one reallocation plan contains both Vault V1 and Vault V2 entries.
1175
- *
1176
- * @deprecated Vault V1/V2 mixed-plan support will be removed in the next major. Use Vault V2
1177
- * reallocations.
1178
- * @example
1179
- * ```ts
1180
- * import { MixedReallocationVersionsError } from "@morpho-org/morpho-sdk";
1025
+ * import { InvalidVaultV2BlueReallocationShapeError } from "@morpho-org/morpho-sdk";
1181
1026
  *
1182
- * const error = new MixedReallocationVersionsError();
1027
+ * const error = new InvalidVaultV2BlueReallocationShapeError();
1183
1028
  * ```
1184
1029
  */
1185
- class MixedReallocationVersionsError extends Error {
1030
+ class InvalidVaultV2BlueReallocationShapeError extends Error {
1186
1031
  constructor() {
1187
- super("Reallocation plans cannot mix Vault V1 and Vault V2 entries. Submit one version per transaction.");
1188
- this.name = "MixedReallocationVersionsError";
1032
+ super("Reallocation entry is not a valid Vault V2 reallocation. High-level Blue writes accept only VaultV2BlueReallocation entries (e.g. from getVaultV2BlueReallocations()). Use morpho-sdk v5 if Vault V1 reallocations are required.");
1033
+ this.name = "InvalidVaultV2BlueReallocationShapeError";
1189
1034
  }
1190
1035
  }
1191
- exports.MixedReallocationVersionsError = MixedReallocationVersionsError;
1036
+ exports.InvalidVaultV2BlueReallocationShapeError = InvalidVaultV2BlueReallocationShapeError;
1192
1037
  /**
1193
1038
  * Thrown when a Blue Public Allocator reallocation contains a malformed vault
1194
1039
  * or adapter address.
@@ -1285,28 +1130,6 @@ class InconsistentReallocationPenaltyError extends Error {
1285
1130
  }
1286
1131
  }
1287
1132
  exports.InconsistentReallocationPenaltyError = InconsistentReallocationPenaltyError;
1288
- /**
1289
- * Thrown when reallocation withdrawals within a vault are not strictly sorted by market id.
1290
- *
1291
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
1292
- */
1293
- class UnsortedReallocationWithdrawalsError extends Error {
1294
- constructor(vault, marketId) {
1295
- super(`Reallocation withdrawals must be strictly sorted by market ID for vault ${vault}. Market ${marketId} is out of order.`);
1296
- }
1297
- }
1298
- exports.UnsortedReallocationWithdrawalsError = UnsortedReallocationWithdrawalsError;
1299
- /**
1300
- * Thrown when a market repay in assets mode has `transferAmount !== amount + nativeAmount` — the
1301
- * pre-resolved ERC-20 pull plus the wrapped native must equal the assets repaid, so the bundle
1302
- * neither strands over-pulled loan tokens on `GeneralAdapter1` nor under-funds the repay.
1303
- */
1304
- class TransferAmountNotEqualToAssetsError extends Error {
1305
- constructor(params) {
1306
- super(`Transfer amount ${params.transferAmount} is not equal to repay assets ${params.assets} for market: ${params.market}. In assets mode, transferAmount must equal amount + nativeAmount.`);
1307
- }
1308
- }
1309
- exports.TransferAmountNotEqualToAssetsError = TransferAmountNotEqualToAssetsError;
1310
1133
  /** Thrown when a market repay specifies both `assets` and `shares` as non-zero (modes are mutually exclusive). */
1311
1134
  class MutuallyExclusiveRepayAmountsError extends Error {
1312
1135
  constructor(market) {
@@ -1328,13 +1151,6 @@ class WithdrawMakesPositionUnhealthyError extends Error {
1328
1151
  }
1329
1152
  }
1330
1153
  exports.WithdrawMakesPositionUnhealthyError = WithdrawMakesPositionUnhealthyError;
1331
- /** Thrown when a share-amount conversion would divide by zero (the market has no shares of the relevant kind). */
1332
- class ShareDivideByZeroError extends Error {
1333
- constructor(market) {
1334
- super(`Share divide by zero error for market: ${market}`);
1335
- }
1336
- }
1337
- exports.ShareDivideByZeroError = ShareDivideByZeroError;
1338
1154
  /** Thrown when a repay amount in assets exceeds the borrower's outstanding debt. */
1339
1155
  class RepayExceedsDebtError extends Error {
1340
1156
  constructor(params) {
@@ -1357,33 +1173,7 @@ class RepaySharesExceedDebtError extends Error {
1357
1173
  }
1358
1174
  exports.RepaySharesExceedDebtError = RepaySharesExceedDebtError;
1359
1175
  /**
1360
- * Thrown when a vault selected for reallocation has no configured `PublicAllocator`.
1361
- *
1362
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
1363
- */
1364
- class MissingPublicAllocatorConfigError extends Error {
1365
- constructor(vault) {
1366
- super(`Vault ${vault} has no public allocator configured but was selected for reallocation`);
1367
- }
1368
- }
1369
- exports.MissingPublicAllocatorConfigError = MissingPublicAllocatorConfigError;
1370
- /**
1371
- * Thrown when a reallocation attempts to use a disabled vault market.
1372
- *
1373
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
1374
- */
1375
- class DisabledReallocationMarketError extends Error {
1376
- vault;
1377
- marketId;
1378
- constructor(vault, marketId) {
1379
- super(`Vault ${vault} has disabled market ${marketId}. Remove it from reallocations or re-enable the market before reallocating.`);
1380
- this.vault = vault;
1381
- this.marketId = marketId;
1382
- }
1383
- }
1384
- exports.DisabledReallocationMarketError = DisabledReallocationMarketError;
1385
- /**
1386
- * Thrown when shared liquidity selected by a Vault V1 or Vault V2 reallocation planner cannot
1176
+ * Thrown when shared liquidity selected by a Vault V2 reallocation planner cannot
1387
1177
  * cover the operation's absolute shortfall on the target market — the resulting
1388
1178
  * `morphoBorrow` or `morphoWithdraw` would still revert onchain.
1389
1179
  *
@@ -1421,44 +1211,6 @@ class UnknownReallocationVaultError extends blue_sdk_1.UnknownDataError {
1421
1211
  }
1422
1212
  }
1423
1213
  exports.UnknownReallocationVaultError = UnknownReallocationVaultError;
1424
- /**
1425
- * Thrown when reallocation state does not contain a requested vault-market config.
1426
- *
1427
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major.
1428
- */
1429
- class UnknownReallocationVaultMarketConfigError extends blue_sdk_1.UnknownDataError {
1430
- vault;
1431
- marketId;
1432
- /**
1433
- * @param vault - Vault address for the missing config.
1434
- * @param marketId - Market id for the missing config.
1435
- */
1436
- constructor(vault, marketId) {
1437
- super(`unknown reallocation config for vault "${vault}" on market "${marketId}"`);
1438
- this.vault = vault;
1439
- this.marketId = marketId;
1440
- }
1441
- }
1442
- exports.UnknownReallocationVaultMarketConfigError = UnknownReallocationVaultMarketConfigError;
1443
- /**
1444
- * Thrown when reallocation state does not contain a requested market position.
1445
- *
1446
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major.
1447
- */
1448
- class UnknownReallocationPositionError extends blue_sdk_1.UnknownDataError {
1449
- user;
1450
- marketId;
1451
- /**
1452
- * @param user - Position owner address.
1453
- * @param marketId - Market id for the missing position.
1454
- */
1455
- constructor(user, marketId) {
1456
- super(`unknown reallocation position of "${user}" on market "${marketId}"`);
1457
- this.user = user;
1458
- this.marketId = marketId;
1459
- }
1460
- }
1461
- exports.UnknownReallocationPositionError = UnknownReallocationPositionError;
1462
1214
  /** Thrown when Vault V2 reallocation state does not contain a requested allocation id. */
1463
1215
  class UnknownReallocationAllocationError extends blue_sdk_1.UnknownDataError {
1464
1216
  vault;
@@ -1697,11 +1449,11 @@ class WithdrawSharesExceedSupplyError extends Error {
1697
1449
  }
1698
1450
  exports.WithdrawSharesExceedSupplyError = WithdrawSharesExceedSupplyError;
1699
1451
  /**
1700
- * Thrown when a Vault V1 or Vault V2 reallocation planner receives a withdraw `amount` greater
1452
+ * Thrown when a Vault V2 reallocation planner receives a withdraw `amount` greater
1701
1453
  * than the target market's current `totalSupplyAssets` — the post-withdraw
1702
1454
  * supply would be negative, making the on-chain `morphoWithdraw` revert
1703
1455
  * regardless of any reallocation. Caught here so callers do not pay
1704
- * PublicAllocator fees on an unreachable operation.
1456
+ * allocator penalties on an unreachable operation.
1705
1457
  */
1706
1458
  class ReallocationWithdrawExceedsMarketSupplyError extends Error {
1707
1459
  params;
@@ -1732,86 +1484,3 @@ class RefinanceTokenMismatchError extends Error {
1732
1484
  }
1733
1485
  }
1734
1486
  exports.RefinanceTokenMismatchError = RefinanceTokenMismatchError;
1735
- /**
1736
- * Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive).
1737
- *
1738
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1739
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1740
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1741
- */
1742
- class BorrowAmountAndSharesExclusiveError extends Error {
1743
- constructor(market) {
1744
- super(`Exactly one of borrowAssets or borrowShares must be non-zero for market: ${market}. Both were provided.`);
1745
- }
1746
- }
1747
- exports.BorrowAmountAndSharesExclusiveError = BorrowAmountAndSharesExclusiveError;
1748
- /**
1749
- * Thrown when a refinance's `collateralAmount` exceeds the source position's available collateral.
1750
- *
1751
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1752
- * partial collateral inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1753
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1754
- */
1755
- class RefinanceExceedsCollateralError extends Error {
1756
- market;
1757
- requested;
1758
- available;
1759
- constructor(params) {
1760
- super(`Refinance collateral amount ${params.requested} exceeds available collateral ${params.available} for market: ${params.market}`);
1761
- this.market = params.market;
1762
- this.requested = params.requested;
1763
- this.available = params.available;
1764
- }
1765
- }
1766
- exports.RefinanceExceedsCollateralError = RefinanceExceedsCollateralError;
1767
- /**
1768
- * Thrown when a refinance's `borrowShares` exceeds the source position's outstanding borrow shares.
1769
- *
1770
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1771
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1772
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1773
- */
1774
- class RefinanceExceedsBorrowSharesError extends Error {
1775
- market;
1776
- requested;
1777
- available;
1778
- constructor(params) {
1779
- super(`Refinance borrow shares ${params.requested} exceed outstanding borrow shares ${params.available} for market: ${params.market}`);
1780
- this.market = params.market;
1781
- this.requested = params.requested;
1782
- this.available = params.available;
1783
- }
1784
- }
1785
- exports.RefinanceExceedsBorrowSharesError = RefinanceExceedsBorrowSharesError;
1786
- /**
1787
- * Thrown when a refinance's `borrowAssets` exceeds the source position's outstanding debt assets.
1788
- *
1789
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1790
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1791
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1792
- */
1793
- class RefinanceExceedsBorrowAssetsError extends Error {
1794
- market;
1795
- requested;
1796
- available;
1797
- constructor(params) {
1798
- super(`Refinance borrow assets ${params.requested} exceed outstanding debt assets ${params.available} for market: ${params.market}`);
1799
- this.market = params.market;
1800
- this.requested = params.requested;
1801
- this.available = params.available;
1802
- }
1803
- }
1804
- exports.RefinanceExceedsBorrowAssetsError = RefinanceExceedsBorrowAssetsError;
1805
- /**
1806
- * Thrown when a refinance in shares mode (`borrowShares > 0n`) omits the `borrowAssets` overshoot for the target borrow leg.
1807
- *
1808
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1809
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1810
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1811
- */
1812
- class RefinanceSharesMissingBorrowAssetsError extends Error {
1813
- constructor(market) {
1814
- super(`Refinance shares mode requires a positive borrowAssets overshoot for the target borrow leg (market: ${market}).`);
1815
- }
1816
- }
1817
- exports.RefinanceSharesMissingBorrowAssetsError = RefinanceSharesMissingBorrowAssetsError;