@morpho-org/morpho-sdk 5.9.0 → 6.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/MIGRATION-v5-to-v6.md +404 -0
  2. package/README.md +127 -69
  3. package/lib/cjs/abis.d.ts +210 -0
  4. package/lib/cjs/abis.js +142 -2
  5. package/lib/cjs/actions/blue/borrow.d.ts +62 -61
  6. package/lib/cjs/actions/blue/borrow.js +48 -80
  7. package/lib/cjs/actions/blue/common.d.ts +86 -0
  8. package/lib/cjs/actions/blue/common.js +205 -0
  9. package/lib/cjs/actions/blue/refinance.d.ts +72 -112
  10. package/lib/cjs/actions/blue/refinance.js +97 -199
  11. package/lib/cjs/actions/blue/repay.d.ts +72 -68
  12. package/lib/cjs/actions/blue/repay.js +56 -118
  13. package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +85 -90
  14. package/lib/cjs/actions/blue/repayWithdrawCollateral.js +148 -137
  15. package/lib/cjs/actions/blue/supply.d.ts +62 -45
  16. package/lib/cjs/actions/blue/supply.js +94 -70
  17. package/lib/cjs/actions/blue/supplyCollateral.d.ts +63 -40
  18. package/lib/cjs/actions/blue/supplyCollateral.js +52 -69
  19. package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +82 -90
  20. package/lib/cjs/actions/blue/supplyCollateralBorrow.js +133 -120
  21. package/lib/cjs/actions/blue/withdraw.d.ts +68 -79
  22. package/lib/cjs/actions/blue/withdraw.js +101 -97
  23. package/lib/cjs/actions/blue/withdrawCollateral.d.ts +56 -28
  24. package/lib/cjs/actions/blue/withdrawCollateral.js +45 -50
  25. package/lib/cjs/actions/bundles/common.d.ts +200 -0
  26. package/lib/cjs/actions/bundles/common.js +469 -0
  27. package/lib/cjs/actions/bundles/index.d.ts +3 -0
  28. package/lib/cjs/actions/bundles/index.js +23 -0
  29. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  30. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
  31. package/lib/cjs/actions/index.d.ts +2 -1
  32. package/lib/cjs/actions/index.js +1 -0
  33. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  34. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  35. package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
  36. package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
  37. package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
  38. package/lib/cjs/actions/midnight/takeLend.js +2 -2
  39. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +29 -17
  40. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +60 -19
  41. package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
  42. package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.js +72 -0
  43. package/lib/cjs/actions/requirements/blue/index.d.ts +1 -0
  44. package/lib/cjs/actions/requirements/blue/index.js +1 -0
  45. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
  46. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +30 -5
  47. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
  48. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +8 -2
  49. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
  50. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +39 -6
  51. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +61 -0
  52. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +123 -0
  53. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
  54. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
  55. package/lib/cjs/actions/requirements/encode/index.d.ts +1 -0
  56. package/lib/cjs/actions/requirements/encode/index.js +1 -0
  57. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
  58. package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +6 -4
  59. package/lib/cjs/actions/requirements/getRequirementsApproval.js +6 -4
  60. package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +1 -0
  61. package/lib/cjs/actions/signatures/getTokenRequirementActions.js +4 -0
  62. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
  63. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +18 -66
  64. package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
  65. package/lib/cjs/actions/vaultV1/deposit.js +110 -109
  66. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
  67. package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
  68. package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
  69. package/lib/cjs/actions/vaultV1/redeem.js +56 -33
  70. package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
  71. package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
  72. package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
  73. package/lib/cjs/actions/vaultV2/deposit.js +111 -109
  74. package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
  75. package/lib/cjs/actions/vaultV2/redeem.js +56 -34
  76. package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
  77. package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
  78. package/lib/cjs/bundler/actions.d.ts +4 -4
  79. package/lib/cjs/bundler/actions.js +4 -4
  80. package/lib/cjs/client/morphoViemExtension.d.ts +2 -1
  81. package/lib/cjs/client/morphoViemExtension.js +2 -1
  82. package/lib/cjs/entities/blue/blue.d.ts +806 -374
  83. package/lib/cjs/entities/blue/blue.js +449 -696
  84. package/lib/cjs/entities/index.d.ts +2 -0
  85. package/lib/cjs/entities/index.js +15 -0
  86. package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
  87. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +87 -0
  88. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +203 -0
  89. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  90. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
  91. package/lib/cjs/entities/requirements/index.d.ts +1 -0
  92. package/lib/cjs/entities/requirements/index.js +17 -0
  93. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +348 -98
  94. package/lib/cjs/entities/vaultV1/vaultV1.js +322 -120
  95. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +221 -68
  96. package/lib/cjs/entities/vaultV2/vaultV2.js +219 -77
  97. package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +3 -9
  98. package/lib/cjs/helpers/computeVaultV1Reallocations.js +3 -9
  99. package/lib/cjs/helpers/index.d.ts +2 -1
  100. package/lib/cjs/helpers/index.js +5 -1
  101. package/lib/cjs/helpers/referralFee.d.ts +21 -0
  102. package/lib/cjs/helpers/referralFee.js +35 -0
  103. package/lib/cjs/helpers/slippage.d.ts +90 -1
  104. package/lib/cjs/helpers/slippage.js +123 -0
  105. package/lib/cjs/helpers/validate.d.ts +16 -23
  106. package/lib/cjs/helpers/validate.js +41 -48
  107. package/lib/cjs/helpers/validateRequirementSpender.d.ts +2 -1
  108. package/lib/cjs/helpers/validateRequirementSpender.js +3 -0
  109. package/lib/cjs/index.d.ts +1 -0
  110. package/lib/cjs/index.js +1 -0
  111. package/lib/cjs/types/action.d.ts +303 -210
  112. package/lib/cjs/types/action.js +29 -2
  113. package/lib/cjs/types/client.d.ts +9 -0
  114. package/lib/cjs/types/error.d.ts +193 -18
  115. package/lib/cjs/types/error.js +267 -24
  116. package/lib/cjs/types/sharedLiquidity.d.ts +0 -7
  117. package/lib/esm/abis.d.ts +210 -0
  118. package/lib/esm/abis.js +140 -0
  119. package/lib/esm/actions/blue/borrow.d.ts +62 -61
  120. package/lib/esm/actions/blue/borrow.js +48 -80
  121. package/lib/esm/actions/blue/common.d.ts +86 -0
  122. package/lib/esm/actions/blue/common.js +193 -0
  123. package/lib/esm/actions/blue/refinance.d.ts +72 -112
  124. package/lib/esm/actions/blue/refinance.js +98 -200
  125. package/lib/esm/actions/blue/repay.d.ts +72 -68
  126. package/lib/esm/actions/blue/repay.js +56 -118
  127. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +85 -90
  128. package/lib/esm/actions/blue/repayWithdrawCollateral.js +149 -138
  129. package/lib/esm/actions/blue/supply.d.ts +62 -45
  130. package/lib/esm/actions/blue/supply.js +94 -70
  131. package/lib/esm/actions/blue/supplyCollateral.d.ts +63 -40
  132. package/lib/esm/actions/blue/supplyCollateral.js +52 -69
  133. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +82 -90
  134. package/lib/esm/actions/blue/supplyCollateralBorrow.js +134 -121
  135. package/lib/esm/actions/blue/withdraw.d.ts +68 -79
  136. package/lib/esm/actions/blue/withdraw.js +100 -96
  137. package/lib/esm/actions/blue/withdrawCollateral.d.ts +56 -28
  138. package/lib/esm/actions/blue/withdrawCollateral.js +45 -50
  139. package/lib/esm/actions/bundles/common.d.ts +200 -0
  140. package/lib/esm/actions/bundles/common.js +457 -0
  141. package/lib/esm/actions/bundles/index.d.ts +3 -0
  142. package/lib/esm/actions/bundles/index.js +2 -0
  143. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  144. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
  145. package/lib/esm/actions/index.d.ts +2 -1
  146. package/lib/esm/actions/index.js +1 -0
  147. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  148. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  149. package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
  150. package/lib/esm/actions/midnight/takeBorrow.js +2 -2
  151. package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
  152. package/lib/esm/actions/midnight/takeLend.js +2 -2
  153. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +29 -17
  154. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +63 -22
  155. package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +48 -0
  156. package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.js +68 -0
  157. package/lib/esm/actions/requirements/blue/index.d.ts +1 -0
  158. package/lib/esm/actions/requirements/blue/index.js +1 -0
  159. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -7
  160. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +31 -6
  161. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
  162. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +9 -3
  163. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +16 -7
  164. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +40 -7
  165. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +61 -0
  166. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +119 -0
  167. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
  168. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
  169. package/lib/esm/actions/requirements/encode/index.d.ts +1 -0
  170. package/lib/esm/actions/requirements/encode/index.js +1 -0
  171. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +1 -1
  172. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +6 -4
  173. package/lib/esm/actions/requirements/getRequirementsApproval.js +6 -4
  174. package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +1 -0
  175. package/lib/esm/actions/signatures/getTokenRequirementActions.js +5 -1
  176. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
  177. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +19 -67
  178. package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
  179. package/lib/esm/actions/vaultV1/deposit.js +112 -111
  180. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
  181. package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
  182. package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
  183. package/lib/esm/actions/vaultV1/redeem.js +56 -33
  184. package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
  185. package/lib/esm/actions/vaultV1/withdraw.js +86 -34
  186. package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
  187. package/lib/esm/actions/vaultV2/deposit.js +113 -111
  188. package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
  189. package/lib/esm/actions/vaultV2/redeem.js +56 -34
  190. package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
  191. package/lib/esm/actions/vaultV2/withdraw.js +86 -35
  192. package/lib/esm/bundler/actions.d.ts +4 -4
  193. package/lib/esm/bundler/actions.js +4 -4
  194. package/lib/esm/client/morphoViemExtension.d.ts +2 -1
  195. package/lib/esm/client/morphoViemExtension.js +2 -1
  196. package/lib/esm/entities/blue/blue.d.ts +806 -374
  197. package/lib/esm/entities/blue/blue.js +455 -702
  198. package/lib/esm/entities/index.d.ts +2 -0
  199. package/lib/esm/entities/index.js +1 -0
  200. package/lib/esm/entities/midnight/midnight.d.ts +2 -2
  201. package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +87 -0
  202. package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +199 -0
  203. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  204. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
  205. package/lib/esm/entities/requirements/index.d.ts +1 -0
  206. package/lib/esm/entities/requirements/index.js +1 -0
  207. package/lib/esm/entities/vaultV1/vaultV1.d.ts +348 -98
  208. package/lib/esm/entities/vaultV1/vaultV1.js +326 -124
  209. package/lib/esm/entities/vaultV2/vaultV2.d.ts +221 -68
  210. package/lib/esm/entities/vaultV2/vaultV2.js +222 -80
  211. package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +3 -9
  212. package/lib/esm/helpers/computeVaultV1Reallocations.js +3 -9
  213. package/lib/esm/helpers/index.d.ts +2 -1
  214. package/lib/esm/helpers/index.js +2 -1
  215. package/lib/esm/helpers/referralFee.d.ts +21 -0
  216. package/lib/esm/helpers/referralFee.js +31 -0
  217. package/lib/esm/helpers/slippage.d.ts +90 -1
  218. package/lib/esm/helpers/slippage.js +122 -2
  219. package/lib/esm/helpers/validate.d.ts +16 -23
  220. package/lib/esm/helpers/validate.js +40 -48
  221. package/lib/esm/helpers/validateRequirementSpender.d.ts +2 -1
  222. package/lib/esm/helpers/validateRequirementSpender.js +3 -0
  223. package/lib/esm/index.d.ts +1 -0
  224. package/lib/esm/index.js +1 -0
  225. package/lib/esm/types/action.d.ts +303 -210
  226. package/lib/esm/types/action.js +28 -2
  227. package/lib/esm/types/client.d.ts +9 -0
  228. package/lib/esm/types/error.d.ts +193 -18
  229. package/lib/esm/types/error.js +252 -21
  230. package/lib/esm/types/sharedLiquidity.d.ts +0 -7
  231. package/package.json +6 -5
  232. package/lib/cjs/actions/blue/buildAssetFundingActions.d.ts +0 -47
  233. package/lib/cjs/actions/blue/buildAssetFundingActions.js +0 -63
  234. package/lib/cjs/actions/blue/buildReallocationActions.d.ts +0 -69
  235. package/lib/cjs/actions/blue/buildReallocationActions.js +0 -141
  236. package/lib/cjs/actions/blue/resolveRepayFunding.d.ts +0 -66
  237. package/lib/cjs/actions/blue/resolveRepayFunding.js +0 -85
  238. package/lib/esm/actions/blue/buildAssetFundingActions.d.ts +0 -47
  239. package/lib/esm/actions/blue/buildAssetFundingActions.js +0 -59
  240. package/lib/esm/actions/blue/buildReallocationActions.d.ts +0 -69
  241. package/lib/esm/actions/blue/buildReallocationActions.js +0 -135
  242. package/lib/esm/actions/blue/resolveRepayFunding.d.ts +0 -66
  243. package/lib/esm/actions/blue/resolveRepayFunding.js +0 -81
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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 = exports.ZeroSupplyAmountError = exports.NonPositiveWithdrawCollateralAmountError = exports.NonPositiveRepayMaxSharePriceError = exports.NonPositiveRepayAmountError = exports.NonPositiveReallocationAmountError = exports.ZeroCollateralAmountError = exports.NonPositiveBorrowAmountError = exports.ZeroDepositAmountError = exports.NonPositiveMaxSharePriceError = exports.NonPositiveSharesAmountError = exports.NonPositiveAssetAmountError = exports.VaultExitBundlesV1PermitMismatchError = exports.VaultIsBlueFeeRecipientError = exports.VaultMorphoMismatchError = exports.InsufficientBlueBalanceForInKindRedeemError = exports.InKindRedeemCoverageError = exports.InKindRedeemZeroDeallocationError = exports.UnsupportedInKindAdapterError = exports.AdapterNotPartOfVaultError = exports.InKindRedeemRequiresSingleAdapterError = exports.ExpiredDeadlineError = exports.EmptyMarketParamsListError = exports.InputExceedsMaxError = exports.NonPositiveInputError = exports.NegativeInputError = void 0;
4
- 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 = 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 = void 0;
5
- exports.RefinanceSharesMissingBorrowAssetsError = exports.RefinanceExceedsBorrowAssetsError = exports.RefinanceExceedsBorrowSharesError = exports.RefinanceExceedsCollateralError = exports.RefinanceTokenMismatchError = exports.RefinanceSameMarketError = exports.BorrowAmountAndSharesExclusiveError = 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 = void 0;
3
+ exports.NegativeSupplyAmountError = exports.NonPositiveMinBorrowSharePriceError = exports.NegativeReallocationFeeError = exports.NegativeNativeAmountError = exports.NegativeSlippageToleranceError = exports.NonPositiveWithdrawAmountError = 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.MissingPermit2TransferFromNonceError = exports.MissingPermit2SignatureTransferNonceError = exports.BlueBundlesV1RequirementSignatureMismatchError = exports.BundlesRequirementSignatureMismatchError = exports.VaultExitBundlesV1PermitMismatchError = exports.BundlesPermitMismatchError = exports.VaultIsBlueFeeRecipientError = exports.VaultMorphoMismatchError = exports.InsufficientBlueBalanceForInKindRedeemError = exports.InKindRedeemCoverageError = exports.InKindRedeemZeroDeallocationError = exports.UnsupportedInKindAdapterError = exports.AdapterNotPartOfVaultError = exports.InKindRedeemRequiresSingleAdapterError = exports.ExpiredDeadlineError = exports.EmptyMarketParamsListError = exports.InputExceedsMaxError = exports.NonPositiveInputError = exports.NegativeInputError = void 0;
4
+ exports.DisabledReallocationMarketError = exports.MissingPublicAllocatorConfigError = exports.RepaySharesExceedDebtError = exports.InvalidSignatureError = exports.RepayExceedsDebtError = exports.ShareDivideByZeroError = 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 = 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 = 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.
@@ -91,7 +91,7 @@ class EmptyMarketParamsListError extends Error {
91
91
  }
92
92
  }
93
93
  exports.EmptyMarketParamsListError = EmptyMarketParamsListError;
94
- /** Thrown when an in-kind redemption deadline has already passed. */
94
+ /** Thrown when an SDK operation deadline has already passed. */
95
95
  class ExpiredDeadlineError extends Error {
96
96
  deadline;
97
97
  timestamp;
@@ -100,7 +100,7 @@ class ExpiredDeadlineError extends Error {
100
100
  * @param timestamp - Current timestamp used for validation.
101
101
  */
102
102
  constructor(deadline, timestamp) {
103
- super(`Deadline "${deadline}" has expired at timestamp "${timestamp}". Choose a future deadline and rebuild the exit.`);
103
+ super(`Deadline "${deadline}" has expired at timestamp "${timestamp}". Choose a future deadline and rebuild the operation.`);
104
104
  this.deadline = deadline;
105
105
  this.timestamp = timestamp;
106
106
  this.name = "ExpiredDeadlineError";
@@ -248,8 +248,8 @@ class VaultIsBlueFeeRecipientError extends Error {
248
248
  }
249
249
  }
250
250
  exports.VaultIsBlueFeeRecipientError = VaultIsBlueFeeRecipientError;
251
- /** Thrown when a vault-shares requirement cannot be safely encoded as an ERC-2612 permit. */
252
- class VaultExitBundlesV1PermitMismatchError extends Error {
251
+ /** Thrown when a vault-shares requirement cannot be safely encoded as a bundles permit. */
252
+ class BundlesPermitMismatchError extends Error {
253
253
  /**
254
254
  * @param params - Permit mismatch values used to explain the rejection.
255
255
  * @param params.field - Permit field that does not match the exit.
@@ -261,14 +261,228 @@ class VaultExitBundlesV1PermitMismatchError extends Error {
261
261
  expected;
262
262
  actual;
263
263
  constructor(params) {
264
- super(`VaultExitBundlesV1 permit ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Rebuild and sign the vault-exit permit.`, { cause: params.cause });
264
+ super(`Bundles permit ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Resolve and sign the requirements returned by this prepared operation.`, { cause: params.cause });
265
265
  this.field = params.field;
266
266
  this.expected = params.expected;
267
267
  this.actual = params.actual;
268
+ this.name = "BundlesPermitMismatchError";
269
+ }
270
+ }
271
+ exports.BundlesPermitMismatchError = BundlesPermitMismatchError;
272
+ /**
273
+ * Thrown by the deprecated VaultExitBundlesV1 permit compatibility helper.
274
+ *
275
+ * @deprecated Use {@link BundlesPermitMismatchError} with `getBundlesSharesPermit`.
276
+ */
277
+ class VaultExitBundlesV1PermitMismatchError extends BundlesPermitMismatchError {
278
+ constructor(params) {
279
+ super(params);
280
+ this.message = `VaultExitBundlesV1 permit ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Rebuild and sign the vault-exit permit.`;
268
281
  this.name = "VaultExitBundlesV1PermitMismatchError";
269
282
  }
270
283
  }
271
284
  exports.VaultExitBundlesV1PermitMismatchError = VaultExitBundlesV1PermitMismatchError;
285
+ /** Thrown when a signed requirement cannot be safely encoded for a fixed bundles call. */
286
+ class BundlesRequirementSignatureMismatchError extends Error {
287
+ /** Field whose signed value or encoding is invalid for the fixed bundles call. */
288
+ field;
289
+ /** Value required by the fixed bundles call. */
290
+ expected;
291
+ /** Value supplied by the signed requirement. */
292
+ actual;
293
+ /**
294
+ * @param params - Signature mismatch details.
295
+ * @param params.field - Field rejected by the converter.
296
+ * @param params.expected - Value required by the direct route.
297
+ * @param params.actual - Value supplied by the requirement.
298
+ * @param params.cause - Original signature parser failure, when applicable.
299
+ */
300
+ constructor(params) {
301
+ super(`Bundles requirement ${params.field} mismatch: expected "${params.expected}", got "${params.actual}". Resolve and sign the requirements returned by this prepared operation.`, { cause: params.cause });
302
+ this.field = params.field;
303
+ this.expected = params.expected;
304
+ this.actual = params.actual;
305
+ this.name = "BundlesRequirementSignatureMismatchError";
306
+ }
307
+ }
308
+ exports.BundlesRequirementSignatureMismatchError = BundlesRequirementSignatureMismatchError;
309
+ exports.BlueBundlesV1RequirementSignatureMismatchError = BundlesRequirementSignatureMismatchError;
310
+ /** Thrown when Permit2 SignatureTransfer is selected without an explicit unordered nonce. */
311
+ class MissingPermit2SignatureTransferNonceError extends Error {
312
+ constructor() {
313
+ super("Permit2 SignatureTransfer requires an explicit unused permit2Nonce. Generate a unique uint256 nonce, pass it to getRequirements(), and resolve the requirements again.");
314
+ this.name = "MissingPermit2SignatureTransferNonceError";
315
+ }
316
+ }
317
+ exports.MissingPermit2SignatureTransferNonceError = MissingPermit2SignatureTransferNonceError;
318
+ exports.MissingPermit2TransferFromNonceError = MissingPermit2SignatureTransferNonceError;
319
+ /** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
320
+ class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
321
+ owner;
322
+ nonce;
323
+ /**
324
+ * @param owner - Permit2 token owner whose nonce is unavailable.
325
+ * @param nonce - Explicit unordered nonce that has already been consumed.
326
+ */
327
+ constructor(owner, nonce) {
328
+ super(`Permit2 nonce "${nonce}" is already used for owner "${owner}". Generate a different uint256 permit2Nonce and resolve the requirements again.`);
329
+ this.owner = owner;
330
+ this.nonce = nonce;
331
+ this.name = "Permit2SignatureTransferNonceAlreadyUsedError";
332
+ }
333
+ }
334
+ exports.Permit2SignatureTransferNonceAlreadyUsedError = Permit2SignatureTransferNonceAlreadyUsedError;
335
+ exports.Permit2TransferFromNonceAlreadyUsedError = Permit2SignatureTransferNonceAlreadyUsedError;
336
+ /** Thrown when no unused Permit2 unordered nonce exists at or after the requested start nonce. */
337
+ class NoUnusedPermit2NonceError extends Error {
338
+ owner;
339
+ startNonce;
340
+ /**
341
+ * @param owner - Permit2 token owner scanned for a free nonce.
342
+ * @param startNonce - Lowest nonce that was considered.
343
+ */
344
+ constructor(owner, startNonce) {
345
+ super(`No unused Permit2 nonce found for owner "${owner}" at or after "${startNonce}". Pass a lower startNonce.`);
346
+ this.owner = owner;
347
+ this.startNonce = startNonce;
348
+ this.name = "NoUnusedPermit2NonceError";
349
+ }
350
+ }
351
+ exports.NoUnusedPermit2NonceError = NoUnusedPermit2NonceError;
352
+ /** Thrown when native funding does not exactly match the contract's gross token pull. */
353
+ class NativeFundingAmountMismatchError extends Error {
354
+ nativeAmount;
355
+ requiredAmount;
356
+ /**
357
+ * @param nativeAmount - Native value supplied with the transaction.
358
+ * @param requiredAmount - Gross amount the BlueBundlesV1 entrypoint funds.
359
+ */
360
+ constructor(nativeAmount, requiredAmount) {
361
+ super(`Native funding must equal the full funded amount: expected "${requiredAmount}", got "${nativeAmount}". Use either native funding or ERC-20 funding, not both.`);
362
+ this.nativeAmount = nativeAmount;
363
+ this.requiredAmount = requiredAmount;
364
+ this.name = "NativeFundingAmountMismatchError";
365
+ }
366
+ }
367
+ exports.NativeFundingAmountMismatchError = NativeFundingAmountMismatchError;
368
+ /** Thrown when a positive referral fee has no recipient. */
369
+ class ReferralFeeRecipientMissingError extends Error {
370
+ constructor() {
371
+ super("A positive referralFeePct requires referralFeeRecipient. Provide the recipient or set referralFeePct to zero.");
372
+ this.name = "ReferralFeeRecipientMissingError";
373
+ }
374
+ }
375
+ exports.ReferralFeeRecipientMissingError = ReferralFeeRecipientMissingError;
376
+ /** @deprecated Use {@link ReferralFeeRecipientMissingError}. */
377
+ exports.MissingReferralFeeRecipientError = ReferralFeeRecipientMissingError;
378
+ /**
379
+ * Thrown when a referral fee percentage is outside the contract's `[0, WAD)` range.
380
+ *
381
+ * Extends {@link InputExceedsMaxError} — and reports the same `field`, `value`, and `max` the
382
+ * generic bound error used to carry for this input — so integrators already pattern-matching
383
+ * `InputExceedsMaxError` keep catching this failure.
384
+ */
385
+ class ReferralFeePctExceededError extends InputExceedsMaxError {
386
+ referralFeePct;
387
+ /** @param referralFeePct - WAD-scaled referral fee percentage supplied by the caller. */
388
+ constructor(referralFeePct) {
389
+ super({
390
+ field: "referralFeePct",
391
+ value: referralFeePct,
392
+ max: blue_sdk_1.MathLib.WAD - 1n,
393
+ });
394
+ this.referralFeePct = referralFeePct;
395
+ this.message = `Referral fee percentage "${referralFeePct}" must be below WAD. Reduce referralFeePct or disable the referral fee.`;
396
+ this.name = "ReferralFeePctExceededError";
397
+ }
398
+ }
399
+ exports.ReferralFeePctExceededError = ReferralFeePctExceededError;
400
+ /** Thrown when a fixed bundles call mixes ERC-20 and native funding. */
401
+ class MixedBundlesFundingError extends Error {
402
+ constructor() {
403
+ super("Bundles funding accepts either amount or nativeAmount, not both. Choose one funding source and rebuild the transaction.");
404
+ this.name = "MixedBundlesFundingError";
405
+ }
406
+ }
407
+ exports.MixedBundlesFundingError = MixedBundlesFundingError;
408
+ /** Thrown when a vault migration specifies both assets and shares, or neither. */
409
+ class AmountAndSharesExclusiveError extends Error {
410
+ constructor() {
411
+ super("Vault migration requires exactly one of assets or shares. Choose the desired withdrawal mode and rebuild the transaction.");
412
+ this.name = "AmountAndSharesExclusiveError";
413
+ }
414
+ }
415
+ exports.AmountAndSharesExclusiveError = AmountAndSharesExclusiveError;
416
+ /** Thrown when a vault migration selects the same source and destination vault. */
417
+ class SameVaultMigrationError extends Error {
418
+ vault;
419
+ constructor(vault) {
420
+ super(`Source and destination vault are both "${vault}". Select a different destination vault.`);
421
+ this.vault = vault;
422
+ this.name = "SameVaultMigrationError";
423
+ }
424
+ }
425
+ exports.SameVaultMigrationError = SameVaultMigrationError;
426
+ /** Thrown when a BlueBundlesV1 reallocation source uses another loan token. */
427
+ class ReallocationLoanTokenMismatchError extends Error {
428
+ expected;
429
+ actual;
430
+ /**
431
+ * @param expected - Loan token of the operation's target market.
432
+ * @param actual - Loan token found in the reallocation source market.
433
+ */
434
+ constructor(expected, actual) {
435
+ super(`Reallocation source loan token "${actual}" does not match target loan token "${expected}". Recompute reallocations for the target market.`);
436
+ this.expected = expected;
437
+ this.actual = actual;
438
+ this.name = "ReallocationLoanTokenMismatchError";
439
+ }
440
+ }
441
+ exports.ReallocationLoanTokenMismatchError = ReallocationLoanTokenMismatchError;
442
+ /**
443
+ * Thrown when a Blue authorization operator is not one of the chain's registered Morpho operators
444
+ * (GeneralAdapter1 or BlueBundlesV1). Guards the exported authorization builder so a misconfigured
445
+ * `authorized` cannot grant an arbitrary address control over the user's Morpho positions.
446
+ */
447
+ class UnsupportedAuthorizationOperatorError extends Error {
448
+ authorized;
449
+ chainId;
450
+ /**
451
+ * @param authorized - The operator address rejected as unsupported.
452
+ * @param chainId - Chain whose registry was consulted for the supported operators.
453
+ */
454
+ constructor(authorized, chainId) {
455
+ 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.`);
456
+ this.authorized = authorized;
457
+ this.chainId = chainId;
458
+ this.name = "UnsupportedAuthorizationOperatorError";
459
+ }
460
+ }
461
+ exports.UnsupportedAuthorizationOperatorError = UnsupportedAuthorizationOperatorError;
462
+ /** Thrown when reallocations are attached to a combined call with no borrow leg. */
463
+ class ReallocationsRequireBorrowError extends Error {
464
+ constructor() {
465
+ super("BlueBundlesV1 reallocations require a positive borrowAssets value. Remove the reallocations or add a borrow leg.");
466
+ this.name = "ReallocationsRequireBorrowError";
467
+ }
468
+ }
469
+ exports.ReallocationsRequireBorrowError = ReallocationsRequireBorrowError;
470
+ /** Thrown when repay funding cannot cover the requested assets and referral fee. */
471
+ class MaxRepayAssetsBelowRepayAssetsError extends Error {
472
+ maxRepayAssets;
473
+ repayAssets;
474
+ /**
475
+ * @param maxRepayAssets - Maximum loan-token funding supplied to the bundle.
476
+ * @param repayAssets - Minimum funding required for the repayment and referral fee.
477
+ */
478
+ constructor(maxRepayAssets, repayAssets) {
479
+ super(`maxRepayAssets "${maxRepayAssets}" cannot cover required repay funding "${repayAssets}". Increase maxRepayAssets to include the repayment and referral fee.`);
480
+ this.maxRepayAssets = maxRepayAssets;
481
+ this.repayAssets = repayAssets;
482
+ this.name = "MaxRepayAssetsBelowRepayAssetsError";
483
+ }
484
+ }
485
+ exports.MaxRepayAssetsBelowRepayAssetsError = MaxRepayAssetsBelowRepayAssetsError;
272
486
  /** @deprecated Use {@link NonPositiveInputError}. */
273
487
  exports.NonPositiveAssetAmountError = NonPositiveInputError;
274
488
  /** @deprecated Use {@link NonPositiveInputError}. */
@@ -650,11 +864,10 @@ class ReallocationWithdrawalOnTargetMarketError extends Error {
650
864
  }
651
865
  exports.ReallocationWithdrawalOnTargetMarketError = ReallocationWithdrawalOnTargetMarketError;
652
866
  /**
653
- * Thrown when a Public Allocator reallocation does not match exactly one V1 or
654
- * V2 input shape.
867
+ * Thrown when a reallocation entry passed to a high-level Blue write is not a valid
868
+ * {@link VaultV2BlueReallocation}: a non-object entry, or an entry carrying Vault V1
869
+ * `withdrawals`/`fee` fields that high-level Blue writes no longer accept.
655
870
  *
656
- * @deprecated Vault V1/V2 reallocation-shape dispatch will be removed in the next major. Use Vault
657
- * V2 reallocations.
658
871
  * @example
659
872
  * ```ts
660
873
  * import { InvalidReallocationShapeError } from "@morpho-org/morpho-sdk";
@@ -664,7 +877,7 @@ exports.ReallocationWithdrawalOnTargetMarketError = ReallocationWithdrawalOnTarg
664
877
  */
665
878
  class InvalidReallocationShapeError extends Error {
666
879
  constructor() {
667
- super('Reallocation must contain either V1 "withdrawals" or V2 "from", but not both.');
880
+ 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.");
668
881
  this.name = "InvalidReallocationShapeError";
669
882
  }
670
883
  }
@@ -1217,13 +1430,6 @@ class VaultAssetMismatchError extends Error {
1217
1430
  }
1218
1431
  }
1219
1432
  exports.VaultAssetMismatchError = VaultAssetMismatchError;
1220
- /** Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive). */
1221
- class BorrowAmountAndSharesExclusiveError extends Error {
1222
- constructor(market) {
1223
- super(`Exactly one of borrowAssets or borrowShares must be non-zero for market: ${market}. Both were provided.`);
1224
- }
1225
- }
1226
- exports.BorrowAmountAndSharesExclusiveError = BorrowAmountAndSharesExclusiveError;
1227
1433
  /** Thrown when a refinance has identical source and target market ids (a refinance to the same market is a costly no-op). */
1228
1434
  class RefinanceSameMarketError extends Error {
1229
1435
  constructor(market) {
@@ -1238,7 +1444,26 @@ class RefinanceTokenMismatchError extends Error {
1238
1444
  }
1239
1445
  }
1240
1446
  exports.RefinanceTokenMismatchError = RefinanceTokenMismatchError;
1241
- /** Thrown when a refinance's `collateralAmount` exceeds the source position's available collateral. */
1447
+ /**
1448
+ * Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive).
1449
+ *
1450
+ * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1451
+ * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1452
+ * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1453
+ */
1454
+ class BorrowAmountAndSharesExclusiveError extends Error {
1455
+ constructor(market) {
1456
+ super(`Exactly one of borrowAssets or borrowShares must be non-zero for market: ${market}. Both were provided.`);
1457
+ }
1458
+ }
1459
+ exports.BorrowAmountAndSharesExclusiveError = BorrowAmountAndSharesExclusiveError;
1460
+ /**
1461
+ * Thrown when a refinance's `collateralAmount` exceeds the source position's available collateral.
1462
+ *
1463
+ * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1464
+ * partial collateral inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1465
+ * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1466
+ */
1242
1467
  class RefinanceExceedsCollateralError extends Error {
1243
1468
  market;
1244
1469
  requested;
@@ -1251,7 +1476,13 @@ class RefinanceExceedsCollateralError extends Error {
1251
1476
  }
1252
1477
  }
1253
1478
  exports.RefinanceExceedsCollateralError = RefinanceExceedsCollateralError;
1254
- /** Thrown when a refinance's `borrowShares` exceeds the source position's outstanding borrow shares. */
1479
+ /**
1480
+ * Thrown when a refinance's `borrowShares` exceeds the source position's outstanding borrow shares.
1481
+ *
1482
+ * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1483
+ * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1484
+ * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1485
+ */
1255
1486
  class RefinanceExceedsBorrowSharesError extends Error {
1256
1487
  market;
1257
1488
  requested;
@@ -1264,7 +1495,13 @@ class RefinanceExceedsBorrowSharesError extends Error {
1264
1495
  }
1265
1496
  }
1266
1497
  exports.RefinanceExceedsBorrowSharesError = RefinanceExceedsBorrowSharesError;
1267
- /** Thrown when a refinance's `borrowAssets` exceeds the source position's outstanding debt assets. */
1498
+ /**
1499
+ * Thrown when a refinance's `borrowAssets` exceeds the source position's outstanding debt assets.
1500
+ *
1501
+ * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1502
+ * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1503
+ * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1504
+ */
1268
1505
  class RefinanceExceedsBorrowAssetsError extends Error {
1269
1506
  market;
1270
1507
  requested;
@@ -1277,7 +1514,13 @@ class RefinanceExceedsBorrowAssetsError extends Error {
1277
1514
  }
1278
1515
  }
1279
1516
  exports.RefinanceExceedsBorrowAssetsError = RefinanceExceedsBorrowAssetsError;
1280
- /** Thrown when a refinance in shares mode (`borrowShares > 0n`) omits the `borrowAssets` overshoot for the target borrow leg. */
1517
+ /**
1518
+ * Thrown when a refinance in shares mode (`borrowShares > 0n`) omits the `borrowAssets` overshoot for the target borrow leg.
1519
+ *
1520
+ * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1521
+ * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1522
+ * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1523
+ */
1281
1524
  class RefinanceSharesMissingBorrowAssetsError extends Error {
1282
1525
  constructor(market) {
1283
1526
  super(`Refinance shares mode requires a positive borrowAssets overshoot for the target borrow leg (market: ${market}).`);
@@ -137,13 +137,6 @@ export interface VaultV2BlueReallocation {
137
137
  /** Vault-configured WAD-scaled penalty rate passed to the allocator. */
138
138
  readonly penalty: bigint;
139
139
  }
140
- /**
141
- * A homogeneous Blue action plan containing only Vault V1 or only Vault V2 reallocations.
142
- *
143
- * Vault V1 members are deprecated for high-level Blue writes and will stop being accepted in the
144
- * next major. Use Vault V2 members for new high-level integrations.
145
- */
146
- export type BlueReallocationPlan = Iterable<VaultV1Reallocation> | Iterable<VaultV2BlueReallocation>;
147
140
  /**
148
141
  * Deprecated name for a Vault V1 reallocation.
149
142
  *
package/lib/esm/abis.d.ts CHANGED
@@ -326,6 +326,216 @@ export declare const vaultExitBundlesV1Abi: readonly [{
326
326
  readonly outputs: readonly [];
327
327
  readonly stateMutability: "nonpayable";
328
328
  }];
329
+ /**
330
+ * Pinned ABI for the VaultBundlesV1 entrypoints used by Vault V1 and Vault V2 actions.
331
+ *
332
+ * Sourced from `morpho-org/bundles` commit
333
+ * `f27e7bcf744310303e24faa522b71d702e696686`.
334
+ */
335
+ export declare const vaultBundlesV1Abi: readonly [{
336
+ readonly type: "error";
337
+ readonly name: "AlreadyInitiated";
338
+ readonly inputs: readonly [];
339
+ }, {
340
+ readonly type: "error";
341
+ readonly name: "DeadlinePassed";
342
+ readonly inputs: readonly [];
343
+ }, {
344
+ readonly type: "error";
345
+ readonly name: "InconsistentAssets";
346
+ readonly inputs: readonly [];
347
+ }, {
348
+ readonly type: "error";
349
+ readonly name: "NotExactlyOneZero";
350
+ readonly inputs: readonly [];
351
+ }, {
352
+ readonly type: "error";
353
+ readonly name: "PctExceeded";
354
+ readonly inputs: readonly [];
355
+ }, {
356
+ readonly type: "error";
357
+ readonly name: "SlippageExceeded";
358
+ readonly inputs: readonly [];
359
+ }, {
360
+ readonly type: "function";
361
+ readonly name: "initiator";
362
+ readonly inputs: readonly [];
363
+ readonly outputs: readonly [{
364
+ readonly name: "";
365
+ readonly type: "address";
366
+ readonly internalType: "address";
367
+ }];
368
+ readonly stateMutability: "view";
369
+ }, {
370
+ readonly type: "function";
371
+ readonly name: "vaultBundlesV1Deposit";
372
+ readonly inputs: readonly [{
373
+ readonly name: "vault";
374
+ readonly type: "address";
375
+ readonly internalType: "address";
376
+ }, {
377
+ readonly name: "assets";
378
+ readonly type: "uint256";
379
+ readonly internalType: "uint256";
380
+ }, {
381
+ readonly name: "maxSharePriceE27";
382
+ readonly type: "uint256";
383
+ readonly internalType: "uint256";
384
+ }, {
385
+ readonly name: "assetPermit";
386
+ readonly type: "tuple";
387
+ readonly internalType: "struct TokenPermit";
388
+ readonly components: readonly [{
389
+ readonly name: "kind";
390
+ readonly type: "uint8";
391
+ readonly internalType: "enum PermitKind";
392
+ }, {
393
+ readonly name: "data";
394
+ readonly type: "bytes";
395
+ readonly internalType: "bytes";
396
+ }];
397
+ }, {
398
+ readonly name: "referralFeePct";
399
+ readonly type: "uint256";
400
+ readonly internalType: "uint256";
401
+ }, {
402
+ readonly name: "referralFeeRecipient";
403
+ readonly type: "address";
404
+ readonly internalType: "address";
405
+ }, {
406
+ readonly name: "deadline";
407
+ readonly type: "uint256";
408
+ readonly internalType: "uint256";
409
+ }];
410
+ readonly outputs: readonly [];
411
+ readonly stateMutability: "payable";
412
+ }, {
413
+ readonly type: "function";
414
+ readonly name: "vaultBundlesV1Withdraw";
415
+ readonly inputs: readonly [{
416
+ readonly name: "vault";
417
+ readonly type: "address";
418
+ readonly internalType: "address";
419
+ }, {
420
+ readonly name: "assets";
421
+ readonly type: "uint256";
422
+ readonly internalType: "uint256";
423
+ }, {
424
+ readonly name: "shares";
425
+ readonly type: "uint256";
426
+ readonly internalType: "uint256";
427
+ }, {
428
+ readonly name: "sharesPermit";
429
+ readonly type: "tuple";
430
+ readonly internalType: "struct Permit";
431
+ readonly components: readonly [{
432
+ readonly name: "value";
433
+ readonly type: "uint256";
434
+ readonly internalType: "uint256";
435
+ }, {
436
+ readonly name: "nonce";
437
+ readonly type: "uint256";
438
+ readonly internalType: "uint256";
439
+ }, {
440
+ readonly name: "deadline";
441
+ readonly type: "uint256";
442
+ readonly internalType: "uint256";
443
+ }, {
444
+ readonly name: "v";
445
+ readonly type: "uint8";
446
+ readonly internalType: "uint8";
447
+ }, {
448
+ readonly name: "r";
449
+ readonly type: "bytes32";
450
+ readonly internalType: "bytes32";
451
+ }, {
452
+ readonly name: "s";
453
+ readonly type: "bytes32";
454
+ readonly internalType: "bytes32";
455
+ }];
456
+ }, {
457
+ readonly name: "referralFeePct";
458
+ readonly type: "uint256";
459
+ readonly internalType: "uint256";
460
+ }, {
461
+ readonly name: "referralFeeRecipient";
462
+ readonly type: "address";
463
+ readonly internalType: "address";
464
+ }, {
465
+ readonly name: "deadline";
466
+ readonly type: "uint256";
467
+ readonly internalType: "uint256";
468
+ }];
469
+ readonly outputs: readonly [];
470
+ readonly stateMutability: "nonpayable";
471
+ }, {
472
+ readonly type: "function";
473
+ readonly name: "vaultBundlesV1Migrate";
474
+ readonly inputs: readonly [{
475
+ readonly name: "sourceVault";
476
+ readonly type: "address";
477
+ readonly internalType: "address";
478
+ }, {
479
+ readonly name: "destVault";
480
+ readonly type: "address";
481
+ readonly internalType: "address";
482
+ }, {
483
+ readonly name: "assetsWithdrawn";
484
+ readonly type: "uint256";
485
+ readonly internalType: "uint256";
486
+ }, {
487
+ readonly name: "sharesRedeemed";
488
+ readonly type: "uint256";
489
+ readonly internalType: "uint256";
490
+ }, {
491
+ readonly name: "destMaxSharePriceE27";
492
+ readonly type: "uint256";
493
+ readonly internalType: "uint256";
494
+ }, {
495
+ readonly name: "sharesPermit";
496
+ readonly type: "tuple";
497
+ readonly internalType: "struct Permit";
498
+ readonly components: readonly [{
499
+ readonly name: "value";
500
+ readonly type: "uint256";
501
+ readonly internalType: "uint256";
502
+ }, {
503
+ readonly name: "nonce";
504
+ readonly type: "uint256";
505
+ readonly internalType: "uint256";
506
+ }, {
507
+ readonly name: "deadline";
508
+ readonly type: "uint256";
509
+ readonly internalType: "uint256";
510
+ }, {
511
+ readonly name: "v";
512
+ readonly type: "uint8";
513
+ readonly internalType: "uint8";
514
+ }, {
515
+ readonly name: "r";
516
+ readonly type: "bytes32";
517
+ readonly internalType: "bytes32";
518
+ }, {
519
+ readonly name: "s";
520
+ readonly type: "bytes32";
521
+ readonly internalType: "bytes32";
522
+ }];
523
+ }, {
524
+ readonly name: "referralFeePct";
525
+ readonly type: "uint256";
526
+ readonly internalType: "uint256";
527
+ }, {
528
+ readonly name: "referralFeeRecipient";
529
+ readonly type: "address";
530
+ readonly internalType: "address";
531
+ }, {
532
+ readonly name: "deadline";
533
+ readonly type: "uint256";
534
+ readonly internalType: "uint256";
535
+ }];
536
+ readonly outputs: readonly [];
537
+ readonly stateMutability: "nonpayable";
538
+ }];
329
539
  /** ABI for the Bundler3 multicall contract. */
330
540
  export declare const bundler3Abi: readonly [{
331
541
  readonly type: "function";