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

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 (277) hide show
  1. package/MIGRATION-v5-to-v6.md +88 -32
  2. package/README.md +9 -7
  3. package/lib/cjs/abis.d.ts +7 -2844
  4. package/lib/cjs/abis.js +3 -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 +31 -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 +7 -5
  45. package/lib/cjs/actions/vaultV1/inKindRedeem.js +11 -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 +7 -5
  51. package/lib/cjs/actions/vaultV2/inKindRedeem.js +11 -7
  52. package/lib/cjs/augment/AccrualPosition.d.ts +1 -0
  53. package/lib/cjs/augment.d.ts +0 -1
  54. package/lib/cjs/augment.js +0 -1
  55. package/lib/cjs/blue/abis.d.ts +5 -5
  56. package/lib/cjs/blue/abis.js +3 -7
  57. package/lib/cjs/blue/entities.d.ts +10 -8
  58. package/lib/cjs/blue/entities.js +3 -3
  59. package/lib/cjs/blue/errors.d.ts +4 -2
  60. package/lib/cjs/blue/errors.js +3 -1
  61. package/lib/cjs/blue/fetch.d.ts +5 -3
  62. package/lib/cjs/blue/fetch.js +3 -3
  63. package/lib/cjs/blue/types.d.ts +2 -4
  64. package/lib/cjs/blue/utils.d.ts +6 -4
  65. package/lib/cjs/blue/utils.js +3 -3
  66. package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
  67. package/lib/cjs/client/morphoViemExtension.js +1 -1
  68. package/lib/cjs/constants.d.ts +3 -37
  69. package/lib/cjs/constants.js +1 -39
  70. package/lib/cjs/entities/blue/blue.d.ts +30 -265
  71. package/lib/cjs/entities/blue/blue.js +1 -205
  72. package/lib/cjs/entities/index.d.ts +11 -66
  73. package/lib/cjs/entities/index.js +3 -21
  74. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
  75. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
  76. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +13 -5
  77. package/lib/cjs/entities/vaultV1/vaultV1.js +16 -10
  78. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +40 -19
  79. package/lib/cjs/entities/vaultV2/vaultV2.js +57 -26
  80. package/lib/cjs/entities/vaultV2BlueReallocationData.js +4 -21
  81. package/lib/cjs/errors.d.ts +5 -47
  82. package/lib/cjs/errors.js +4 -46
  83. package/lib/cjs/fetch.d.ts +5 -17
  84. package/lib/cjs/fetch.js +3 -17
  85. package/lib/cjs/helpers/constant.d.ts +0 -2
  86. package/lib/cjs/helpers/constant.js +0 -2
  87. package/lib/cjs/helpers/index.d.ts +2 -3
  88. package/lib/cjs/helpers/index.js +1 -9
  89. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +11 -5
  90. package/lib/cjs/helpers/slippage.d.ts +1 -103
  91. package/lib/cjs/helpers/slippage.js +0 -150
  92. package/lib/cjs/helpers/utilization.d.ts +12 -10
  93. package/lib/cjs/helpers/utilization.js +27 -12
  94. package/lib/cjs/helpers/validate.d.ts +1 -24
  95. package/lib/cjs/helpers/validate.js +2 -49
  96. package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
  97. package/lib/cjs/helpers/validateRequirementSpender.js +1 -3
  98. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
  99. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +48 -15
  100. package/lib/cjs/midnight/errors.d.ts +1 -1
  101. package/lib/cjs/midnight/errors.js +2 -1
  102. package/lib/cjs/types/action.d.ts +17 -65
  103. package/lib/cjs/types/action.js +11 -4
  104. package/lib/cjs/types/error.d.ts +50 -381
  105. package/lib/cjs/types/error.js +64 -395
  106. package/lib/cjs/types/sharedLiquidity.d.ts +1 -117
  107. package/lib/cjs/types.d.ts +2 -18
  108. package/lib/cjs/utils.d.ts +10 -35
  109. package/lib/cjs/utils.js +4 -36
  110. package/lib/esm/abis.d.ts +7 -2844
  111. package/lib/esm/abis.js +7 -1950
  112. package/lib/esm/actions/blue/borrow.d.ts +3 -2
  113. package/lib/esm/actions/blue/borrow.js +3 -2
  114. package/lib/esm/actions/blue/common.js +1 -9
  115. package/lib/esm/actions/blue/refinance.d.ts +2 -2
  116. package/lib/esm/actions/blue/refinance.js +2 -2
  117. package/lib/esm/actions/blue/repay.d.ts +1 -1
  118. package/lib/esm/actions/blue/repay.js +1 -1
  119. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +2 -2
  120. package/lib/esm/actions/blue/repayWithdrawCollateral.js +2 -2
  121. package/lib/esm/actions/blue/supply.d.ts +2 -2
  122. package/lib/esm/actions/blue/supply.js +2 -2
  123. package/lib/esm/actions/blue/supplyCollateral.d.ts +2 -2
  124. package/lib/esm/actions/blue/supplyCollateral.js +2 -2
  125. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -2
  126. package/lib/esm/actions/blue/supplyCollateralBorrow.js +3 -2
  127. package/lib/esm/actions/blue/withdraw.d.ts +3 -3
  128. package/lib/esm/actions/blue/withdraw.js +3 -3
  129. package/lib/esm/actions/blue/withdrawCollateral.d.ts +2 -2
  130. package/lib/esm/actions/blue/withdrawCollateral.js +2 -2
  131. package/lib/esm/actions/bundles/common.d.ts +6 -2
  132. package/lib/esm/actions/bundles/common.js +32 -6
  133. package/lib/esm/actions/index.d.ts +0 -1
  134. package/lib/esm/actions/index.js +0 -1
  135. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +6 -8
  136. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +12 -17
  137. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +5 -6
  138. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +4 -5
  139. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
  140. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +4 -5
  141. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +5 -5
  142. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +6 -11
  143. package/lib/esm/actions/requirements/encode/index.d.ts +0 -1
  144. package/lib/esm/actions/requirements/encode/index.js +0 -1
  145. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +5 -6
  146. package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -6
  147. package/lib/esm/actions/requirements/index.d.ts +0 -1
  148. package/lib/esm/actions/requirements/index.js +0 -1
  149. package/lib/esm/actions/vaultV1/deposit.d.ts +1 -2
  150. package/lib/esm/actions/vaultV1/deposit.js +1 -2
  151. package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +7 -5
  152. package/lib/esm/actions/vaultV1/inKindRedeem.js +11 -7
  153. package/lib/esm/actions/vaultV2/deposit.d.ts +1 -2
  154. package/lib/esm/actions/vaultV2/deposit.js +1 -2
  155. package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +1 -1
  156. package/lib/esm/actions/vaultV2/forceWithdraw.js +3 -3
  157. package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +7 -5
  158. package/lib/esm/actions/vaultV2/inKindRedeem.js +11 -7
  159. package/lib/esm/augment/AccrualPosition.d.ts +1 -0
  160. package/lib/esm/augment.d.ts +0 -1
  161. package/lib/esm/augment.js +0 -1
  162. package/lib/esm/blue/abis.d.ts +5 -5
  163. package/lib/esm/blue/abis.js +5 -5
  164. package/lib/esm/blue/entities.d.ts +10 -8
  165. package/lib/esm/blue/entities.js +5 -3
  166. package/lib/esm/blue/errors.d.ts +4 -2
  167. package/lib/esm/blue/errors.js +4 -2
  168. package/lib/esm/blue/fetch.d.ts +5 -3
  169. package/lib/esm/blue/fetch.js +5 -3
  170. package/lib/esm/blue/types.d.ts +2 -4
  171. package/lib/esm/blue/utils.d.ts +6 -4
  172. package/lib/esm/blue/utils.js +6 -4
  173. package/lib/esm/client/morphoViemExtension.d.ts +1 -1
  174. package/lib/esm/client/morphoViemExtension.js +1 -1
  175. package/lib/esm/constants.d.ts +3 -37
  176. package/lib/esm/constants.js +3 -37
  177. package/lib/esm/entities/blue/blue.d.ts +30 -265
  178. package/lib/esm/entities/blue/blue.js +4 -208
  179. package/lib/esm/entities/index.d.ts +11 -66
  180. package/lib/esm/entities/index.js +5 -18
  181. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +5 -2
  182. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +8 -3
  183. package/lib/esm/entities/vaultV1/vaultV1.d.ts +13 -5
  184. package/lib/esm/entities/vaultV1/vaultV1.js +19 -13
  185. package/lib/esm/entities/vaultV2/vaultV2.d.ts +40 -19
  186. package/lib/esm/entities/vaultV2/vaultV2.js +61 -30
  187. package/lib/esm/entities/vaultV2BlueReallocationData.js +2 -19
  188. package/lib/esm/errors.d.ts +5 -47
  189. package/lib/esm/errors.js +5 -47
  190. package/lib/esm/fetch.d.ts +5 -17
  191. package/lib/esm/fetch.js +5 -17
  192. package/lib/esm/helpers/constant.d.ts +0 -2
  193. package/lib/esm/helpers/constant.js +0 -2
  194. package/lib/esm/helpers/index.d.ts +2 -3
  195. package/lib/esm/helpers/index.js +2 -3
  196. package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +11 -5
  197. package/lib/esm/helpers/slippage.d.ts +1 -103
  198. package/lib/esm/helpers/slippage.js +1 -147
  199. package/lib/esm/helpers/utilization.d.ts +12 -10
  200. package/lib/esm/helpers/utilization.js +26 -11
  201. package/lib/esm/helpers/validate.d.ts +1 -24
  202. package/lib/esm/helpers/validate.js +2 -48
  203. package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
  204. package/lib/esm/helpers/validateRequirementSpender.js +1 -3
  205. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +48 -15
  206. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +48 -15
  207. package/lib/esm/midnight/errors.d.ts +1 -1
  208. package/lib/esm/midnight/errors.js +1 -1
  209. package/lib/esm/types/action.d.ts +17 -65
  210. package/lib/esm/types/action.js +12 -5
  211. package/lib/esm/types/error.d.ts +50 -381
  212. package/lib/esm/types/error.js +58 -377
  213. package/lib/esm/types/sharedLiquidity.d.ts +1 -117
  214. package/lib/esm/types.d.ts +2 -18
  215. package/lib/esm/utils.d.ts +10 -35
  216. package/lib/esm/utils.js +9 -34
  217. package/package.json +6 -17
  218. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
  219. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -88
  220. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
  221. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -152
  222. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
  223. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -53
  224. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
  225. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -74
  226. package/lib/cjs/actions/requirements/generalAdapter/index.d.ts +0 -3
  227. package/lib/cjs/actions/requirements/generalAdapter/index.js +0 -19
  228. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
  229. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.js +0 -48
  230. package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +0 -58
  231. package/lib/cjs/actions/signatures/getTokenRequirementActions.js +0 -119
  232. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -50
  233. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -45
  234. package/lib/cjs/actions/signatures/index.d.ts +0 -3
  235. package/lib/cjs/actions/signatures/index.js +0 -19
  236. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -11
  237. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.js +0 -8
  238. package/lib/cjs/bundler/actions.d.ts +0 -797
  239. package/lib/cjs/bundler/actions.js +0 -1371
  240. package/lib/cjs/bundler/index.d.ts +0 -2
  241. package/lib/cjs/bundler/index.js +0 -18
  242. package/lib/cjs/bundler/types.d.ts +0 -235
  243. package/lib/cjs/bundler/types.js +0 -2
  244. package/lib/cjs/entities/vaultV1ReallocationData.d.ts +0 -332
  245. package/lib/cjs/entities/vaultV1ReallocationData.js +0 -557
  246. package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +0 -80
  247. package/lib/cjs/helpers/computeVaultV1Reallocations.js +0 -245
  248. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -44
  249. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -84
  250. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
  251. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -148
  252. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -40
  253. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -49
  254. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
  255. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -70
  256. package/lib/esm/actions/requirements/generalAdapter/index.d.ts +0 -3
  257. package/lib/esm/actions/requirements/generalAdapter/index.js +0 -3
  258. package/lib/esm/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
  259. package/lib/esm/actions/signatures/getBlueAuthorizationAction.js +0 -44
  260. package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +0 -58
  261. package/lib/esm/actions/signatures/getTokenRequirementActions.js +0 -115
  262. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -50
  263. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -41
  264. package/lib/esm/actions/signatures/index.d.ts +0 -3
  265. package/lib/esm/actions/signatures/index.js +0 -3
  266. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -11
  267. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +0 -7
  268. package/lib/esm/bundler/actions.d.ts +0 -797
  269. package/lib/esm/bundler/actions.js +0 -1368
  270. package/lib/esm/bundler/index.d.ts +0 -2
  271. package/lib/esm/bundler/index.js +0 -2
  272. package/lib/esm/bundler/types.d.ts +0 -235
  273. package/lib/esm/bundler/types.js +0 -1
  274. package/lib/esm/entities/vaultV1ReallocationData.d.ts +0 -332
  275. package/lib/esm/entities/vaultV1ReallocationData.js +0 -559
  276. package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +0 -80
  277. package/lib/esm/helpers/computeVaultV1Reallocations.js +0 -241
@@ -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
  *