@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
@@ -12,7 +12,7 @@ import { type Metadata, type MorphoClientType } from "../types/index.js";
12
12
  * @param _options.metadata - Optional analytics metadata applied to every transaction the
13
13
  * `morpho` namespace builds.
14
14
  * @param _options.supportSignature - Whether the integrator can collect EIP-712 signatures for
15
- * ERC-2612, Permit2 AllowanceTransfer or SignatureTransfer, and Morpho authorization.
15
+ * ERC-2612, Permit2 SignatureTransfer, and Morpho authorization.
16
16
  * Defaults to `false` (standalone approvals and authorization calls only).
17
17
  * @param _options.supportDeployless - Whether entity fetchers may use deployless multicall.
18
18
  * @returns A viem extension function — `client.extend(morphoViemExtension(...))` adds
@@ -52,7 +52,7 @@ function createMorphoNamespace(viemClient, options) {
52
52
  * @param _options.metadata - Optional analytics metadata applied to every transaction the
53
53
  * `morpho` namespace builds.
54
54
  * @param _options.supportSignature - Whether the integrator can collect EIP-712 signatures for
55
- * ERC-2612, Permit2 AllowanceTransfer or SignatureTransfer, and Morpho authorization.
55
+ * ERC-2612, Permit2 SignatureTransfer, and Morpho authorization.
56
56
  * Defaults to `false` (standalone approvals and authorization calls only).
57
57
  * @param _options.supportDeployless - Whether entity fetchers may use deployless multicall.
58
58
  * @returns A viem extension function — `client.extend(morphoViemExtension(...))` adds
@@ -1,38 +1,4 @@
1
- export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, ERC20_ALLOWANCE_RECIPIENTS, isMarketId as isBlueMarketId,
2
- /** @deprecated Use `isBlueMarketId` or the raw `/blue/constants` subpath. */
3
- isMarketId, LIQUIDATION_CURSOR as BLUE_LIQUIDATION_CURSOR,
4
- /** @deprecated Use `BLUE_LIQUIDATION_CURSOR` or the raw `/blue/constants` subpath. */
5
- LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR as BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR,
6
- /** @deprecated Use `BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR` or the raw `/blue/constants` subpath. */
7
- MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType as BlueTransactionType,
8
- /** @deprecated Use `BlueTransactionType` or the raw `/blue/constants` subpath. */
9
- TransactionType, } from "@morpho-org/blue-sdk";
10
- export { CBP as MIDNIGHT_CBP,
11
- /** @deprecated Use `MIDNIGHT_CBP` or the raw `/midnight/constants` subpath. */
12
- CBP, COLLATERAL_PARAMS_TYPEHASH as MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH,
13
- /** @deprecated Use `MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH` or the raw `/midnight/constants` subpath. */
14
- COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING as MIDNIGHT_DEFAULT_TICK_SPACING,
15
- /** @deprecated Use `MIDNIGHT_DEFAULT_TICK_SPACING` or the raw `/midnight/constants` subpath. */
16
- DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH as MIDNIGHT_EIP712_DOMAIN_TYPEHASH,
17
- /** @deprecated Use `MIDNIGHT_EIP712_DOMAIN_TYPEHASH` or the raw `/midnight/constants` subpath. */
18
- EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH as MIDNIGHT_MARKET_TYPEHASH,
19
- /** @deprecated Use `MIDNIGHT_MARKET_TYPEHASH` or the raw `/midnight/constants` subpath. */
20
- MARKET_TYPEHASH, MAX_COLLATERALS as MIDNIGHT_MAX_COLLATERALS,
21
- /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS` or the raw `/midnight/constants` subpath. */
22
- MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER as MIDNIGHT_MAX_COLLATERALS_PER_BORROWER,
23
- /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS_PER_BORROWER` or the raw `/midnight/constants` subpath. */
24
- MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE as MIDNIGHT_MAX_CONTINUOUS_FEE,
25
- /** @deprecated Use `MIDNIGHT_MAX_CONTINUOUS_FEE` or the raw `/midnight/constants` subpath. */
26
- MAX_CONTINUOUS_FEE, MAX_OFFER_CAP as MIDNIGHT_MAX_OFFER_CAP, MAX_SETTLEMENT_FEES as MIDNIGHT_MAX_SETTLEMENT_FEES,
27
- /** @deprecated Use `MIDNIGHT_MAX_SETTLEMENT_FEES` or the raw `/midnight/constants` subpath. */
28
- MAX_SETTLEMENT_FEES, MAX_TICK as MIDNIGHT_MAX_TICK,
29
- /** @deprecated Use `MIDNIGHT_MAX_TICK` or the raw `/midnight/constants` subpath. */
30
- MAX_TICK, OFFER_TYPEHASH as MIDNIGHT_OFFER_TYPEHASH,
31
- /** @deprecated Use `MIDNIGHT_OFFER_TYPEHASH` or the raw `/midnight/constants` subpath. */
32
- OFFER_TYPEHASH, PRICE_ROUNDING_STEP as MIDNIGHT_PRICE_ROUNDING_STEP,
33
- /** @deprecated Use `MIDNIGHT_PRICE_ROUNDING_STEP` or the raw `/midnight/constants` subpath. */
34
- PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS as MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS,
35
- /** @deprecated Use `MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS` or the raw `/midnight/constants` subpath. */
36
- SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF as MIDNIGHT_TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
37
- export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, CDN_BASE_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, OPTIMIZERS_API_BASE_URL, OPTIMIZERS_BASE_URL, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
1
+ export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, ERC20_ALLOWANCE_RECIPIENTS, isMarketId as isBlueMarketId, LIQUIDATION_CURSOR as BLUE_LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR as BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType as BlueTransactionType, } from "@morpho-org/blue-sdk";
2
+ export { CBP as MIDNIGHT_CBP, COLLATERAL_PARAMS_TYPEHASH as MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING as MIDNIGHT_DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH as MIDNIGHT_EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH as MIDNIGHT_MARKET_TYPEHASH, MAX_COLLATERALS as MIDNIGHT_MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER as MIDNIGHT_MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE as MIDNIGHT_MAX_CONTINUOUS_FEE, MAX_OFFER_CAP as MIDNIGHT_MAX_OFFER_CAP, MAX_SETTLEMENT_FEES as MIDNIGHT_MAX_SETTLEMENT_FEES, MAX_TICK as MIDNIGHT_MAX_TICK, OFFER_TYPEHASH as MIDNIGHT_OFFER_TYPEHASH, PRICE_ROUNDING_STEP as MIDNIGHT_PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS as MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF as MIDNIGHT_TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
3
+ export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
38
4
  export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, } from "./helpers/constant.js";
@@ -1,38 +1,4 @@
1
- export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, ERC20_ALLOWANCE_RECIPIENTS, isMarketId as isBlueMarketId,
2
- /** @deprecated Use `isBlueMarketId` or the raw `/blue/constants` subpath. */
3
- isMarketId, LIQUIDATION_CURSOR as BLUE_LIQUIDATION_CURSOR,
4
- /** @deprecated Use `BLUE_LIQUIDATION_CURSOR` or the raw `/blue/constants` subpath. */
5
- LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR as BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR,
6
- /** @deprecated Use `BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR` or the raw `/blue/constants` subpath. */
7
- MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType as BlueTransactionType,
8
- /** @deprecated Use `BlueTransactionType` or the raw `/blue/constants` subpath. */
9
- TransactionType, } from "@morpho-org/blue-sdk";
10
- export { CBP as MIDNIGHT_CBP,
11
- /** @deprecated Use `MIDNIGHT_CBP` or the raw `/midnight/constants` subpath. */
12
- CBP, COLLATERAL_PARAMS_TYPEHASH as MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH,
13
- /** @deprecated Use `MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH` or the raw `/midnight/constants` subpath. */
14
- COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING as MIDNIGHT_DEFAULT_TICK_SPACING,
15
- /** @deprecated Use `MIDNIGHT_DEFAULT_TICK_SPACING` or the raw `/midnight/constants` subpath. */
16
- DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH as MIDNIGHT_EIP712_DOMAIN_TYPEHASH,
17
- /** @deprecated Use `MIDNIGHT_EIP712_DOMAIN_TYPEHASH` or the raw `/midnight/constants` subpath. */
18
- EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH as MIDNIGHT_MARKET_TYPEHASH,
19
- /** @deprecated Use `MIDNIGHT_MARKET_TYPEHASH` or the raw `/midnight/constants` subpath. */
20
- MARKET_TYPEHASH, MAX_COLLATERALS as MIDNIGHT_MAX_COLLATERALS,
21
- /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS` or the raw `/midnight/constants` subpath. */
22
- MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER as MIDNIGHT_MAX_COLLATERALS_PER_BORROWER,
23
- /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS_PER_BORROWER` or the raw `/midnight/constants` subpath. */
24
- MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE as MIDNIGHT_MAX_CONTINUOUS_FEE,
25
- /** @deprecated Use `MIDNIGHT_MAX_CONTINUOUS_FEE` or the raw `/midnight/constants` subpath. */
26
- MAX_CONTINUOUS_FEE, MAX_OFFER_CAP as MIDNIGHT_MAX_OFFER_CAP, MAX_SETTLEMENT_FEES as MIDNIGHT_MAX_SETTLEMENT_FEES,
27
- /** @deprecated Use `MIDNIGHT_MAX_SETTLEMENT_FEES` or the raw `/midnight/constants` subpath. */
28
- MAX_SETTLEMENT_FEES, MAX_TICK as MIDNIGHT_MAX_TICK,
29
- /** @deprecated Use `MIDNIGHT_MAX_TICK` or the raw `/midnight/constants` subpath. */
30
- MAX_TICK, OFFER_TYPEHASH as MIDNIGHT_OFFER_TYPEHASH,
31
- /** @deprecated Use `MIDNIGHT_OFFER_TYPEHASH` or the raw `/midnight/constants` subpath. */
32
- OFFER_TYPEHASH, PRICE_ROUNDING_STEP as MIDNIGHT_PRICE_ROUNDING_STEP,
33
- /** @deprecated Use `MIDNIGHT_PRICE_ROUNDING_STEP` or the raw `/midnight/constants` subpath. */
34
- PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS as MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS,
35
- /** @deprecated Use `MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS` or the raw `/midnight/constants` subpath. */
36
- SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF as MIDNIGHT_TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
37
- export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, CDN_BASE_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, OPTIMIZERS_API_BASE_URL, OPTIMIZERS_BASE_URL, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
1
+ export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, ERC20_ALLOWANCE_RECIPIENTS, isMarketId as isBlueMarketId, LIQUIDATION_CURSOR as BLUE_LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR as BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType as BlueTransactionType, } from "@morpho-org/blue-sdk";
2
+ export { CBP as MIDNIGHT_CBP, COLLATERAL_PARAMS_TYPEHASH as MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING as MIDNIGHT_DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH as MIDNIGHT_EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH as MIDNIGHT_MARKET_TYPEHASH, MAX_COLLATERALS as MIDNIGHT_MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER as MIDNIGHT_MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE as MIDNIGHT_MAX_CONTINUOUS_FEE, MAX_OFFER_CAP as MIDNIGHT_MAX_OFFER_CAP, MAX_SETTLEMENT_FEES as MIDNIGHT_MAX_SETTLEMENT_FEES, MAX_TICK as MIDNIGHT_MAX_TICK, OFFER_TYPEHASH as MIDNIGHT_OFFER_TYPEHASH, PRICE_ROUNDING_STEP as MIDNIGHT_PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS as MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF as MIDNIGHT_TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
3
+ export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
38
4
  export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, } from "./helpers/constant.js";
@@ -1,22 +1,8 @@
1
1
  import { type AccrualPosition, type Market, type MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
3
  import type { FetchParameters } from "../../types/data.js";
4
- import { type ActionOutput, type ActionRequirement, type AssetsOrSharesArgs, type BlueBorrowAction, type BlueRefinanceAction, type BlueRepayAction, type BlueRepayWithdrawCollateralAction, type BlueSupplyAction, type BlueSupplyCollateralAction, type BlueSupplyCollateralBorrowAction, type BlueWithdrawAction, type BlueWithdrawCollateralAction, type MorphoClientType, type ReallocationComputeOptions, type RequirementSignature, type VaultV1Reallocation, type VaultV2BluePublicAllocatorOptions, type VaultV2BlueReallocation } from "../../types/index.js";
5
- import { VaultV1ReallocationData } from "../vaultV1ReallocationData.js";
4
+ import { type ActionOutput, type ActionRequirement, type AssetsOrSharesArgs, type BlueBorrowAction, type BlueRefinanceAction, type BlueRepayAction, type BlueRepayWithdrawCollateralAction, type BlueSupplyAction, type BlueSupplyCollateralAction, type BlueSupplyCollateralBorrowAction, type BlueWithdrawAction, type BlueWithdrawCollateralAction, type MorphoClientType, type RequirementSignature, type VaultV2BluePublicAllocatorOptions, type VaultV2BlueReallocation } from "../../types/index.js";
6
5
  import { VaultV2BlueReallocationData } from "../vaultV2BlueReallocationData.js";
7
- type VaultV1ReallocationsParams = {
8
- readonly reallocationData: VaultV1ReallocationData;
9
- readonly options?: ReallocationComputeOptions;
10
- } & ({
11
- readonly operation: "borrow" | "withdraw";
12
- readonly amount: bigint;
13
- readonly borrowAmount?: never;
14
- } | {
15
- /** @deprecated Pass `{ operation: "borrow", amount }` instead. */
16
- readonly borrowAmount: bigint;
17
- readonly operation?: never;
18
- readonly amount?: never;
19
- });
20
6
  type VaultV2BlueReallocationsParams = {
21
7
  readonly reallocationData: VaultV2BlueReallocationData;
22
8
  readonly options?: VaultV2BluePublicAllocatorOptions & {
@@ -76,7 +62,7 @@ export interface BlueActions {
76
62
  * @throws {ChainWNativeMissingError} when native funding is requested without registered wNative.
77
63
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
78
64
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
79
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
65
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
80
66
  * @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
81
67
  * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
82
68
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple token signatures are supplied.
@@ -122,7 +108,7 @@ export interface BlueActions {
122
108
  * `getRequirements()` reads only the loan-token allowance and selected ERC-2612 or Permit2
123
109
  * nonce state. Direct approvals and ERC-2612 name BlueBundlesV1 as spender; Permit2 keeps its
124
110
  * ERC-20 approval on canonical Permit2. Native funding is exclusive and skips token requirements.
125
- * The referral fee is deducted from the gross `assets` supplied. This route exposes no Bundler3
111
+ * The referral fee is deducted from the gross `assets` supplied. This route exposes no
126
112
  * share-price bound or `slippageTolerance`.
127
113
  *
128
114
  * @param params.userAddress - User funding and receiving the supply position.
@@ -140,7 +126,7 @@ export interface BlueActions {
140
126
  * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
141
127
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
142
128
  * @throws {InputExceedsMaxError} when `assets` or `deadline` exceeds `uint256`, when the referral fee is at least WAD, or from `getRequirements()` when an explicit `permit2Nonce` exceeds `uint256`.
143
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
129
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
144
130
  * @throws {NoUnusedPermit2NonceError} from `getRequirements()` when every Permit2 nonce for the owner is consumed and none was passed explicitly.
145
131
  * @throws {Permit2SignatureTransferNonceAlreadyUsedError} from `getRequirements()` when the explicit Permit2 nonce is consumed.
146
132
  * @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when a classic `approvalAmount` is below the funded `assets`.
@@ -189,7 +175,7 @@ export interface BlueActions {
189
175
  * `getRequirements()` reads Morpho authorization state for BlueBundlesV1. Optional reallocations
190
176
  * are Vault V2-only; their penalties and the referral fee reduce withdrawal proceeds. Shares
191
177
  * mode has neither a saturated full-close sentinel nor an onchain minimum-assets guarantee.
192
- * This route exposes no Bundler3 share-price bound or `slippageTolerance`.
178
+ * This route exposes no share-price bound or `slippageTolerance`.
193
179
  *
194
180
  * @param params.userAddress - User whose supply position is withdrawn.
195
181
  * @param params.positionData - Pre-fetched position used for ownership and balance validation.
@@ -211,9 +197,9 @@ export interface BlueActions {
211
197
  * @throws {WithdrawExceedsSupplyError} when assets exceed the supplied balance.
212
198
  * @throws {WithdrawSharesExceedSupplyError} when shares exceed the owned balance.
213
199
  * @throws {InputExceedsMaxError} when a fee or reallocation exceeds its ABI bound.
214
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
200
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
215
201
  * @throws {InvalidReallocationAddressError} when a vault or adapter address is malformed.
216
- * @throws {InvalidReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
202
+ * @throws {InvalidVaultV2BlueReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
217
203
  * @throws {InvalidReallocationSourceTypeError} when a reallocation source is malformed.
218
204
  * @throws {InconsistentReallocationPenaltyError} when one vault uses different penalties.
219
205
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
@@ -276,6 +262,7 @@ export interface BlueActions {
276
262
  * @param params.referralFeeRecipient - Recipient required for a positive fee.
277
263
  * @returns Lazy Blue authorization resolution and a synchronous deep-frozen transaction.
278
264
  * @throws {ChainIdMismatchError} when the client targets another chain.
265
+ * @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
279
266
  * @throws {ExpiredDeadlineError} when the deadline is stale.
280
267
  * @throws {MissingAccrualPositionError} when no position snapshot is provided.
281
268
  * @throws {MarketIdMismatchError} when `positionData` belongs to another market.
@@ -285,9 +272,9 @@ export interface BlueActions {
285
272
  * @throws {NonPositiveInputError} when `borrowAssets` is not positive.
286
273
  * @throws {NegativeInputError} when the borrow, fee, or a reallocation value is negative.
287
274
  * @throws {InputExceedsMaxError} when a fee, penalty, or reallocation exceeds its bound.
288
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
275
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
289
276
  * @throws {InvalidReallocationAddressError} when a vault or adapter address is malformed.
290
- * @throws {InvalidReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
277
+ * @throws {InvalidVaultV2BlueReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
291
278
  * @throws {InvalidReallocationSourceTypeError} when a reallocation source is malformed.
292
279
  * @throws {InconsistentReallocationPenaltyError} when one vault uses different penalties.
293
280
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
@@ -350,8 +337,8 @@ export interface BlueActions {
350
337
  * @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
351
338
  * @param params.referralFeeRecipient - Recipient required for a positive fee.
352
339
  * @returns Lazy token prerequisite resolution and a synchronous deep-frozen transaction.
353
- * @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
354
340
  * @throws {ChainIdMismatchError} when the client targets another chain.
341
+ * @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
355
342
  * @throws {ExpiredDeadlineError} when the deadline is stale.
356
343
  * @throws {MissingAccrualPositionError} when no position snapshot is provided.
357
344
  * @throws {MarketIdMismatchError} when `positionData` belongs to another market.
@@ -362,8 +349,10 @@ export interface BlueActions {
362
349
  * @throws {RepayExceedsDebtError} when an exact asset repay exceeds current debt.
363
350
  * @throws {RepaySharesExceedDebtError} when non-saturated shares exceed current debt shares.
364
351
  * @throws {InputExceedsMaxError} when a fee is out of bounds or a share quote deadline is too far away.
352
+ * @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when a classic
353
+ * `approvalAmount` is below the derived `maxRepayAssets`.
365
354
  * @throws {MaxRepayAssetsBelowRepayAssetsError} when a signed share cap no longer covers the fresh quote.
366
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
355
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
367
356
  * @throws {NativeFundingAmountMismatchError} when native funding is partial or mixed.
368
357
  * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
369
358
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
@@ -434,6 +423,7 @@ export interface BlueActions {
434
423
  * @param params.referralFeeRecipient - Recipient required for a positive fee.
435
424
  * @returns Lazy Blue authorization resolution and a synchronous deep-frozen transaction.
436
425
  * @throws {ChainIdMismatchError} when the client targets another chain.
426
+ * @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
437
427
  * @throws {ExpiredDeadlineError} when the deadline is stale.
438
428
  * @throws {MissingAccrualPositionError} when no position snapshot is provided.
439
429
  * @throws {MarketIdMismatchError} when `positionData` belongs to another market.
@@ -444,7 +434,7 @@ export interface BlueActions {
444
434
  * @throws {NonPositiveInputError} when `collateralAssets` is not positive.
445
435
  * @throws {NegativeInputError} when collateral or the referral fee is negative.
446
436
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
447
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
437
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
448
438
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when multiple authorization signatures are supplied.
449
439
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a token signature is supplied.
450
440
  * @throws {DepositOwnerMismatchError} from `buildTx()` when the signed owner differs from `userAddress`.
@@ -493,11 +483,11 @@ export interface BlueActions {
493
483
  * saturated full close; the entity derives `maxRepayAssets` from debt projected through the
494
484
  * requested deadline plus the referral fee, and the contract refunds unused funding. A
495
485
  * previously signed share-mode cap remains valid when it still covers the fresh derived minimum.
496
- * Saturated full-repay requirements use the token's reusable maximum allowance when signatures
497
- * are disabled, while the transaction itself remains bounded by the derived cap.
486
+ * Full-repay requirements fund exactly the derived `maxRepayAssets`; pass `approvalAmount` to
487
+ * request a reusable allowance instead. The transaction remains bounded by the derived cap.
498
488
  * Share-mode deadlines cannot exceed the two-hour quote horizon. Blue authorization is required
499
489
  * only for collateral withdrawal. Pure repay uses `maxLtv = maxUint256`; withdrawals use buffered
500
- * LLTV. No Bundler3 share-price or `slippageTolerance` input exists.
490
+ * LLTV. No share-price or `slippageTolerance` input exists.
501
491
  *
502
492
  * @param params.userAddress - User whose debt and collateral position changes.
503
493
  * @param params.positionData - Pre-fetched position used for repayment and health validation.
@@ -509,8 +499,8 @@ export interface BlueActions {
509
499
  * @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
510
500
  * @param params.referralFeeRecipient - Recipient required for a positive fee.
511
501
  * @returns Lazy funding/authorization resolution and a synchronous deep-frozen transaction builder.
512
- * @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
513
502
  * @throws {ChainIdMismatchError} when the client targets another chain.
503
+ * @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
514
504
  * @throws {MissingAccrualPositionError} when no position snapshot is provided at runtime.
515
505
  * @throws {MarketIdMismatchError} when `positionData` belongs to another market.
516
506
  * @throws {AccrualPositionUserMismatchError} when `positionData` belongs to another user.
@@ -524,8 +514,10 @@ export interface BlueActions {
524
514
  * @throws {WithdrawMakesPositionUnhealthyError} when the post-repay withdrawal exceeds buffered LLTV.
525
515
  * @throws {ExpiredDeadlineError} when the deadline is stale.
526
516
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD or a share-mode deadline exceeds the funding quote horizon.
517
+ * @throws {ApprovalAmountLessThanSpendAmountError} from `getRequirements()` when a classic
518
+ * `approvalAmount` is below the derived `maxRepayAssets`.
527
519
  * @throws {MaxRepayAssetsBelowRepayAssetsError} from `buildTx()` when a previously signed share-mode cap no longer covers the fresh derived minimum.
528
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
520
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
529
521
  * @throws {NativeFundingAmountMismatchError} when native funding is partial or mixed.
530
522
  * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
531
523
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
@@ -594,7 +586,7 @@ export interface BlueActions {
594
586
  * collateral funding requires token approval/signature unless it is exclusively native. Vault V2
595
587
  * reallocations are accepted only with a borrow. Penalties and referral fees reduce borrow
596
588
  * proceeds. The entity uses `maxUint256` for a pure collateral supply and buffered LLTV otherwise.
597
- * No Bundler3 share-price or `slippageTolerance` input exists.
589
+ * No share-price or `slippageTolerance` input exists.
598
590
  *
599
591
  * @param params.userAddress - User whose collateral and debt position changes.
600
592
  * @param params.collateralAssets - Gross collateral supplied, or zero for pure borrow.
@@ -607,6 +599,7 @@ export interface BlueActions {
607
599
  * @param params.referralFeeRecipient - Recipient required for a positive fee.
608
600
  * @returns Lazy funding/authorization resolution and a synchronous deep-frozen transaction builder.
609
601
  * @throws {ChainIdMismatchError} when the client targets another chain.
602
+ * @throws {UnsupportedBlueMarketIrmError} when positive debt requires an unsupported IRM projection.
610
603
  * @throws {MissingAccrualPositionError} when a borrow has no position snapshot.
611
604
  * @throws {MarketIdMismatchError} when `positionData` belongs to another market.
612
605
  * @throws {AccrualPositionUserMismatchError} when `positionData` belongs to another user.
@@ -620,9 +613,9 @@ export interface BlueActions {
620
613
  * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
621
614
  * @throws {NativeAmountOnNonWNativeAssetError} when native funding targets another token.
622
615
  * @throws {InputExceedsMaxError} when a fee or reallocation exceeds its ABI bound.
623
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
616
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
624
617
  * @throws {InvalidReallocationAddressError} when a vault or adapter address is malformed.
625
- * @throws {InvalidReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
618
+ * @throws {InvalidVaultV2BlueReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
626
619
  * @throws {InvalidReallocationSourceTypeError} when a reallocation source is malformed.
627
620
  * @throws {InconsistentReallocationPenaltyError} when one vault uses different penalties.
628
621
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
@@ -694,8 +687,8 @@ export interface BlueActions {
694
687
  * @param params.referralFeePct - Optional WAD-scaled referral fee below 100%.
695
688
  * @param params.referralFeeRecipient - Recipient required for a positive fee.
696
689
  * @returns Lazy Blue authorization resolution and a synchronous deep-frozen transaction builder.
697
- * @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
698
690
  * @throws {ChainIdMismatchError} when the client targets another chain.
691
+ * @throws {UnsupportedBlueMarketIrmError} when positive source or destination debt requires an unsupported IRM projection.
699
692
  * @throws {MissingAccrualPositionError} when either position snapshot is absent at runtime.
700
693
  * @throws {MarketIdMismatchError} when a position snapshot belongs to another market.
701
694
  * @throws {AccrualPositionUserMismatchError} when a position snapshot belongs to another user.
@@ -707,9 +700,9 @@ export interface BlueActions {
707
700
  * @throws {BorrowExceedsSafeLtvError} when the complete destination exceeds buffered LLTV.
708
701
  * @throws {ExpiredDeadlineError} when the deadline is stale.
709
702
  * @throws {InputExceedsMaxError} when a fee or reallocation exceeds its ABI bound.
710
- * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
703
+ * @throws {ReferralFeeRecipientMissingError} when a positive fee has no recipient.
711
704
  * @throws {InvalidReallocationAddressError} when a vault or adapter address is malformed.
712
- * @throws {InvalidReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
705
+ * @throws {InvalidVaultV2BlueReallocationShapeError} when a reallocation entry is not a valid Vault V2 reallocation.
713
706
  * @throws {InvalidReallocationSourceTypeError} when a reallocation source is malformed.
714
707
  * @throws {InconsistentReallocationPenaltyError} when one vault uses different penalties.
715
708
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the destination market.
@@ -767,54 +760,6 @@ export interface BlueActions {
767
760
  readonly referralFeePct?: bigint;
768
761
  readonly referralFeeRecipient?: Address;
769
762
  }) => ActionOutput<BlueRefinanceAction, readonly RequirementSignature[], undefined>;
770
- /**
771
- * Fetches all on-chain data needed to construct a {@link VaultV1ReallocationData}
772
- * for computing vault reallocations via the public allocator.
773
- *
774
- * The target market is refetched internally at `block.number` so the
775
- * reallocation planner always sees a snapshot from the same block as the
776
- * source vaults. A caller-owned market would let stale or adversarial data
777
- * inject unnecessary `reallocateTo` actions (and their PublicAllocator
778
- * fees) into the resulting bundle.
779
- *
780
- * The returned data can be passed to {@link getVaultV1Reallocations} for explicit low-level
781
- * Bundler3 composition.
782
- *
783
- * **Stale data reverts on-chain (fail-safe).**
784
- *
785
- * @param params.vaultAddresses - Addresses of MetaMorpho vaults that allocate to this market.
786
- * @param params.block - The block to fetch data at (number and timestamp).
787
- * @returns A VaultV1ReallocationData instance populated with all required data.
788
- * @throws {ChainIdMismatchError} when the client chain does not match this market.
789
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
790
- * {@link getVaultV2BlueReallocationData}.
791
- */
792
- getVaultV1ReallocationData: (params: {
793
- vaultAddresses: readonly Address[];
794
- block: {
795
- readonly number: bigint;
796
- readonly timestamp: bigint;
797
- };
798
- }) => Promise<VaultV1ReallocationData>;
799
- /**
800
- * Fetches Vault V1 PublicAllocator state using the deprecated unversioned name.
801
- *
802
- * @param params.vaultAddresses - Addresses of MetaMorpho vaults that allocate to this market.
803
- * @param params.block.number - Block number used for every RPC read.
804
- * @param params.block.timestamp - Timestamp corresponding to the fetched block.
805
- * @returns A `VaultV1ReallocationData` snapshot populated from one block.
806
- * @throws {ChainIdMismatchError} when the client chain does not match this market.
807
- * @deprecated Use {@link getVaultV1ReallocationData} for deprecated low-level Bundler3
808
- * planning. Vault V1 shared-liquidity planning will be removed in the next major; use
809
- * {@link getVaultV2BlueReallocationData} for high-level Blue writes.
810
- */
811
- getReallocationData: (params: {
812
- vaultAddresses: readonly Address[];
813
- block: {
814
- readonly number: bigint;
815
- readonly timestamp: bigint;
816
- };
817
- }) => Promise<VaultV1ReallocationData>;
818
763
  /**
819
764
  * Fetches Vault V2 BluePublicAllocator state for this target market.
820
765
  *
@@ -840,70 +785,6 @@ export interface BlueActions {
840
785
  readonly timestamp: bigint;
841
786
  };
842
787
  }) => Promise<VaultV2BlueReallocationData>;
843
- /**
844
- * Computes Vault V1 PublicAllocator reallocations for this market.
845
- *
846
- * Uses the shared-liquidity algorithm to determine which vaults should reallocate liquidity to
847
- * this market via the PublicAllocator, based on the post-operation utilization target.
848
- *
849
- * Pass `{ borrowAmount }` for a borrow (legacy alias, equivalent to `{ operation: "borrow",
850
- * amount }`) or `{ operation: "withdraw", amount }` for a loan-asset withdraw.
851
- *
852
- * @param params.reallocationData - The current on-chain state (from {@link getVaultV1ReallocationData}).
853
- * @param params.operation - The operation driving the reallocation (`"borrow"` or `"withdraw"`).
854
- * Defaults to `"borrow"` when `borrowAmount` is provided.
855
- * @param params.amount - The borrow or withdraw amount used to compute the post-state utilization.
856
- * @param params.borrowAmount - {@deprecated} Equivalent to `{ operation: "borrow", amount }`. Use the
857
- * `operation` + `amount` form on new code.
858
- * @param params.options - Optional reallocation computation options
859
- * (timestamp, utilization targets, reallocatable vaults filter, etc.).
860
- * Pass the fetched block timestamp to compute reallocations at the same block.
861
- * @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
862
- * @throws {ChainIdMismatchError} when `reallocationData` belongs to a different chain than this market.
863
- * @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
864
- * @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation's absolute shortfall on the target market — preventing fee-bearing reallocations from being attached to a call that would still revert onchain.
865
- * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds the target market supply.
866
- * @throws {MissingPublicAllocatorConfigError} when a selected vault is missing its public allocator config.
867
- * @throws {UnknownReallocationMarketError} when the target market is absent from the reallocation data.
868
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
869
- * {@link getVaultV2BlueReallocations}.
870
- * @example
871
- * ```ts
872
- * const reallocations = market.getVaultV1Reallocations({
873
- * reallocationData,
874
- * operation: "borrow",
875
- * amount: 1_000_000n,
876
- * });
877
- * ```
878
- */
879
- getVaultV1Reallocations: (params: VaultV1ReallocationsParams) => readonly VaultV1Reallocation[];
880
- /**
881
- * Computes Vault V1 PublicAllocator reallocations using the deprecated unversioned name.
882
- *
883
- * @param params.reallocationData - State returned by {@link getVaultV1ReallocationData}.
884
- * @param params.operation - The operation driving the reallocation (`"borrow"` or `"withdraw"`).
885
- * @param params.amount - The borrow or withdraw amount used to compute post-state utilization.
886
- * @param params.borrowAmount - Deprecated borrow amount alias.
887
- * @param params.options - Optional allocator and utilization options.
888
- * @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
889
- * @throws {ChainIdMismatchError} when `reallocationData` belongs to another chain.
890
- * @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
891
- * @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation.
892
- * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
893
- * @throws {MissingPublicAllocatorConfigError} when a selected vault lacks allocator state.
894
- * @throws {UnknownReallocationMarketError} when the target market is absent.
895
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
896
- * {@link getVaultV2BlueReallocations}.
897
- * @example
898
- * ```ts
899
- * const reallocations = market.getReallocations({
900
- * reallocationData,
901
- * operation: "borrow",
902
- * amount: 1_000_000n,
903
- * });
904
- * ```
905
- */
906
- getReallocations: (params: VaultV1ReallocationsParams) => readonly VaultV1Reallocation[];
907
788
  /**
908
789
  * Computes Vault V2 BluePublicAllocator reallocations for this market.
909
790
  *
@@ -1071,64 +952,6 @@ export declare class MorphoBlue implements BlueActions {
1071
952
  getRequirements: () => Promise<readonly ActionRequirement[]>;
1072
953
  buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../types/action.js").Transaction<BlueRefinanceAction>>;
1073
954
  };
1074
- /**
1075
- * Fetches all on-chain inputs needed to compute public allocator reallocations.
1076
- *
1077
- * @param params.vaultAddresses - Vaults to inspect for source-market liquidity.
1078
- * @param params.block.number - Block number used for every RPC read.
1079
- * @param params.block.timestamp - Timestamp corresponding to the fetched block.
1080
- * @returns Reallocation data ready for {@link getVaultV1Reallocations}.
1081
- * @throws {ChainIdMismatchError} when the client chain does not match this market.
1082
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
1083
- * {@link getVaultV2BlueReallocationData}.
1084
- * @example
1085
- * ```ts
1086
- * import { markets, vaults } from "@morpho-org/morpho-test";
1087
- * import { createPublicClient, http } from "viem";
1088
- * import { mainnet } from "viem/chains";
1089
- * import { morphoViemExtension } from "@morpho-org/morpho-sdk";
1090
- * import type { VaultV1ReallocationData } from "@morpho-org/morpho-sdk/entities";
1091
- *
1092
- * const client = createPublicClient({ chain: mainnet, transport: http() })
1093
- * .extend(morphoViemExtension());
1094
- * const market = client.morpho.blue(markets[mainnet.id].usdc_wbtc, mainnet.id);
1095
- * const block = await client.getBlock();
1096
- * const data: VaultV1ReallocationData = await market.getVaultV1ReallocationData({
1097
- * vaultAddresses: [vaults[mainnet.id].steakUsdc.address],
1098
- * block,
1099
- * });
1100
- * ```
1101
- */
1102
- getVaultV1ReallocationData({ vaultAddresses, block, }: {
1103
- vaultAddresses: readonly Address[];
1104
- block: {
1105
- readonly number: bigint;
1106
- readonly timestamp: bigint;
1107
- };
1108
- }): Promise<VaultV1ReallocationData>;
1109
- /**
1110
- * Fetches Vault V1 PublicAllocator state using the deprecated unversioned name.
1111
- *
1112
- * @param params.vaultAddresses - Addresses of MetaMorpho vaults that allocate to this market.
1113
- * @param params.block.number - Block number used for every RPC read.
1114
- * @param params.block.timestamp - Timestamp corresponding to the fetched block.
1115
- * @returns A `VaultV1ReallocationData` snapshot populated from one block.
1116
- * @throws {ChainIdMismatchError} when the client chain does not match this market.
1117
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
1118
- * {@link getVaultV2BlueReallocationData}.
1119
- * @example
1120
- * ```ts
1121
- * const data = await market.getReallocationData({ vaultAddresses, block });
1122
- * // Equivalent to market.getVaultV1ReallocationData({ vaultAddresses, block }).
1123
- * ```
1124
- */
1125
- getReallocationData(params: {
1126
- vaultAddresses: readonly Address[];
1127
- block: {
1128
- readonly number: bigint;
1129
- readonly timestamp: bigint;
1130
- };
1131
- }): Promise<VaultV1ReallocationData>;
1132
955
  /**
1133
956
  * Fetches Vault V2 BluePublicAllocator state for this target market.
1134
957
  *
@@ -1173,64 +996,6 @@ export declare class MorphoBlue implements BlueActions {
1173
996
  readonly timestamp: bigint;
1174
997
  };
1175
998
  }): Promise<VaultV2BlueReallocationData>;
1176
- /**
1177
- * Computes Vault V1 PublicAllocator reallocations for this market.
1178
- *
1179
- * Pass `{ borrowAmount }` for a borrow (legacy alias, equivalent to `{ operation: "borrow", amount }`)
1180
- * or `{ operation, amount }` for a borrow or loan-asset withdraw.
1181
- *
1182
- * @param params - Reallocation computation parameters.
1183
- * @param params.reallocationData - State returned by {@link getVaultV1ReallocationData}.
1184
- * @param params.operation - The operation driving the reallocation (`"borrow"` or `"withdraw"`).
1185
- * @param params.amount - The borrow or withdraw amount used to compute the post-state utilization.
1186
- * @param params.borrowAmount - {@deprecated Pass `{ operation: "borrow", amount }` instead.}
1187
- * @param params.options - Optional allocator and utilization options.
1188
- * @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
1189
- * @throws {ChainIdMismatchError} when `reallocationData` belongs to a different chain than this market.
1190
- * @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
1191
- * @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation's absolute shortfall on the target market.
1192
- * @throws {ReallocationWithdrawExceedsMarketSupplyError} when `operation === "withdraw"` and `amount` exceeds the target market's `totalSupplyAssets`.
1193
- * @throws {MissingPublicAllocatorConfigError} when a selected vault is missing its public allocator config.
1194
- * @throws {UnknownReallocationMarketError} when the target market is absent from the reallocation data.
1195
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
1196
- * {@link getVaultV2BlueReallocations}.
1197
- * @example
1198
- * ```ts
1199
- * const reallocations = market.getVaultV1Reallocations({
1200
- * reallocationData,
1201
- * operation: "borrow",
1202
- * amount: 1_000_000n,
1203
- * });
1204
- * ```
1205
- */
1206
- getVaultV1Reallocations(params: VaultV1ReallocationsParams): readonly VaultV1Reallocation[];
1207
- /**
1208
- * Computes Vault V1 PublicAllocator reallocations using the deprecated unversioned name.
1209
- *
1210
- * @param params.reallocationData - State returned by {@link getVaultV1ReallocationData}.
1211
- * @param params.operation - The operation driving the reallocation (`"borrow"` or `"withdraw"`).
1212
- * @param params.amount - The borrow or withdraw amount used to compute post-state utilization.
1213
- * @param params.borrowAmount - Deprecated borrow amount alias.
1214
- * @param params.options - Optional allocator and utilization options.
1215
- * @returns Vault V1 reallocations for explicit low-level Bundler3 composition.
1216
- * @throws {ChainIdMismatchError} when `reallocationData` belongs to another chain.
1217
- * @throws {UnsupportedBlueMarketIrmError} when a market with positive debt uses an unsupported IRM.
1218
- * @throws {InsufficientSharedLiquidityError} when shared liquidity cannot cover the operation.
1219
- * @throws {ReallocationWithdrawExceedsMarketSupplyError} when a withdrawal exceeds market supply.
1220
- * @throws {MissingPublicAllocatorConfigError} when a selected vault lacks allocator state.
1221
- * @throws {UnknownReallocationMarketError} when the target market is absent.
1222
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major. Use
1223
- * {@link getVaultV2BlueReallocations}.
1224
- * @example
1225
- * ```ts
1226
- * const reallocations = market.getReallocations({
1227
- * reallocationData,
1228
- * operation: "borrow",
1229
- * amount: 1_000_000n,
1230
- * });
1231
- * ```
1232
- */
1233
- getReallocations(params: VaultV1ReallocationsParams): readonly VaultV1Reallocation[];
1234
999
  /**
1235
1000
  * Computes Vault V2 BluePublicAllocator reallocations for this market.
1236
1001
  *