@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
@@ -37,8 +37,8 @@ export interface VaultV2Actions {
37
37
  * two hours from handle creation.
38
38
  * @returns Lazy token prerequisite resolution and a synchronous deep-frozen VaultBundlesV1
39
39
  * transaction builder.
40
- * @throws {UnsupportedBlueMarketIrmError} when required interest projection encounters an unsupported IRM.
41
40
  * @throws {ChainIdMismatchError} when the connected client targets another chain.
41
+ * @throws {UnsupportedBlueMarketIrmError} when an underlying market with positive debt uses an unsupported IRM.
42
42
  * @throws {VaultAddressMismatchError} when `vaultData` belongs to another vault.
43
43
  * @throws {ExpiredDeadlineError} when the deadline is stale at creation or requirement resolution.
44
44
  * @throws {MixedBundlesFundingError} when ERC-20 and native funding are both supplied.
@@ -115,9 +115,10 @@ export interface VaultV2Actions {
115
115
  * defaults to two hours from handle creation.
116
116
  * @returns A frozen handle with lazy `getRequirements()` and synchronous `buildTx(signatures?)`,
117
117
  * which returns a deep-frozen `Transaction<VaultV2WithdrawAction>`. Requirements are empty
118
- * when the allowance equals the cap; otherwise they contain an exact approval or, with
119
- * signature support, an ERC-2612 request. The cap stays pinned to the first resolution while
120
- * each call re-reads the allowance. Confirm the approval or pass its signed permit to `buildTx`.
118
+ * when the allowance equals the cap; an oversized allowance is always reset with an exact
119
+ * onchain approval, and an insufficient one is raised by an approval or, with signature
120
+ * support, an ERC-2612 request. The cap stays pinned to the first resolution while each call
121
+ * re-reads the allowance. Confirm the approval or pass its signed permit to `buildTx`.
121
122
  * @throws {ChainIdMismatchError} when the connected client targets another chain.
122
123
  * @throws {NonPositiveInputError} when `amount` or the computed share cap is not positive.
123
124
  * @throws {ExpiredDeadlineError} when `deadline` is not in the future at handle creation or
@@ -233,6 +234,10 @@ export interface VaultV2Actions {
233
234
  * Idle balance, penalty, and adapter positions can drift after the snapshot, so an on-chain
234
235
  * under-coverage panic remains possible if vault state changes between preparation and inclusion.
235
236
  *
237
+ * In-kind exits require an exact vault-share allowance for the computed cap. An ERC-2612 permit
238
+ * is emitted only to raise an insufficient allowance; an oversized allowance is always reset
239
+ * with an onchain approval before the exit.
240
+ *
236
241
  * @param params - In-kind redemption parameters.
237
242
  * @param params.amount - Penalty-inclusive, asset-denominated amount to exit.
238
243
  * @param params.marketParamsList - Ordered adapter markets consumed greedily after idle assets;
@@ -262,7 +267,9 @@ export interface VaultV2Actions {
262
267
  * @throws {InsufficientBlueBalanceForInKindRedeemError} from `getRequirements()` when Blue cannot fund the largest callback.
263
268
  * @throws {AmbiguousRequirementSignaturesError} from `buildTx()` when more than one permit signature is supplied.
264
269
  * @throws {UnexpectedRequirementSignatureError} from `buildTx()` when a non-permit signature is supplied.
265
- * @throws {VaultExitBundlesV1PermitMismatchError} from `buildTx()` when the requirement has the wrong permit kind, asset, or signature encoding.
270
+ * @throws {BundlesPermitMismatchError} from `buildTx()` when the supplied permit is not ERC-2612, has
271
+ * the wrong asset, owner, or signature encoding, or names another spender, amount, or deadline
272
+ * than the prepared cap.
266
273
  * @example
267
274
  * ```ts
268
275
  * import { isRequirementSignature } from "@morpho-org/morpho-sdk";
@@ -313,26 +320,36 @@ export interface VaultV2Actions {
313
320
  * adapter or none at all. Call `getRequirements()` before `buildTx()` so the vault-share allowance
314
321
  * and permit nonce are read on-chain.
315
322
  *
316
- * Unless `minSharePriceE27` is overridden, the SDK derives a conservative lower bound on the
317
- * realized exit share price from the snapshot and `slippageTolerance`. The bound rejects a share
318
- * price drop, a penalty increase, and liquidity shifting from the penalty-free leg to the
319
- * penalised leg. It does **not** cover the referral fee, which the contract deducts afterwards.
323
+ * The SDK derives a conservative lower bound on the realized exit share price from the snapshot
324
+ * and `slippageTolerance`: the floor is priced off whichever of the raw snapshot or its accrual
325
+ * to `now` burns more shares, so neither pending fee mints nor interest the chain has not yet
326
+ * accrued can lift it above the realized price. A supplied `minSharePriceE27` replaces the
327
+ * tolerance-derived bound (it may be tighter or looser) but must be at least the floor derived
328
+ * at `MAX_SLIPPAGE_TOLERANCE`, so an override can never disable meaningful protection.
329
+ * The bound rejects a share price drop, a penalty increase, and liquidity shifting from the
330
+ * penalty-free leg to the penalised leg. It does **not** cover the referral fee, which the
331
+ * contract deducts afterwards.
320
332
  *
321
333
  * Vault gates are enforced by the final transaction and are not preflighted: the receive-assets
322
334
  * gate must allow VaultExitBundlesV1 and may depend on its transient initiator, while a
323
335
  * send-shares gate is arbitrary code re-evaluated after each penalty burn. The SDK also does not
324
336
  * validate the user's share balance. Per-market penalties and each vault withdrawal round the
325
337
  * share burn up independently, so the exit can burn marginally more shares than `exitAssets` alone
326
- * implies; size `exitAssets` a small buffer below `vault.previewRedeem(sharesHeld)` — the approved
327
- * share allowance this handle returns is the exact upper bound on the burn — so a full-balance
328
- * exit does not revert for insufficient shares.
338
+ * implies; size `exitAssets` a small buffer below `vault.previewRedeem(sharesHeld)` so a
339
+ * full-balance exit does not revert for insufficient shares. The approved share allowance this
340
+ * handle returns covers a burn at least one `slippageTolerance` step below the price floor
341
+ * whenever the floor exceeds one RAY unit and, in any case, at least one share above the burn
342
+ * at the floor, so a price within that headroom below the floor reverts on the contract's
343
+ * `minSharePriceE27` check rather than on the allowance; a deeper drop can still surface as an
344
+ * ERC-20 allowance underflow.
329
345
  *
330
346
  * Idle balance, penalty, adapter positions, and market liquidity can drift after the snapshot, so
331
347
  * an on-chain revert remains possible if vault state changes between preparation and inclusion.
332
- * A fee-recipient `userAddress` gets a floor from the net share burn after fee mints at `now`,
333
- * and a guard against fee mints reaching the lower burn bound by the deadline. Its allowance
334
- * includes the projected fee shares through that same deadline. Deadlines beyond one year after
335
- * handle creation are rejected, so the guard and allowance cover the whole accepted window.
348
+ * A fee-recipient `userAddress` gets a floor from the larger of the raw snapshot burn and the
349
+ * `now` burn net of its own fee mints, and a guard against fee mints reaching the lower burn
350
+ * bound by the deadline. Its allowance includes the projected fee shares through that same
351
+ * deadline. Deadlines beyond one year after handle creation are rejected, so the guard and
352
+ * allowance cover the whole accepted window.
336
353
  *
337
354
  * @param params - Force withdrawal parameters.
338
355
  * @param params.exitAssets - Penalty-inclusive, asset-denominated amount to exit.
@@ -343,8 +360,10 @@ export interface VaultV2Actions {
343
360
  * Deadlines more than one year after handle creation are rejected.
344
361
  * @param params.slippageTolerance - Optional WAD-scaled tolerance applied to the derived share
345
362
  * price bound. Defaults to `DEFAULT_SLIPPAGE_TOLERANCE`, capped at `MAX_SLIPPAGE_TOLERANCE`.
346
- * @param params.minSharePriceE27 - Optional RAY-scaled override of the derived bound. Must be
347
- * positive: the contract reads `0` as "no bound", so it cannot be used to opt out.
363
+ * @param params.minSharePriceE27 - Optional RAY-scaled override of the derived bound. It replaces
364
+ * the tolerance-derived bound and may be tighter or looser, but must be at least the floor
365
+ * derived at `MAX_SLIPPAGE_TOLERANCE`. When that floor rounds down to zero (dust exits) it is
366
+ * clamped to `1`, so any positive override is accepted.
348
367
  * @param params.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
349
368
  * `referralFeeRecipient`. Defaults to `0n`.
350
369
  * @param params.referralFeeRecipient - Optional referral fee recipient, required when
@@ -373,6 +392,8 @@ export interface VaultV2Actions {
373
392
  * which would overrun the contract's unbounded loop.
374
393
  * @throws {VaultV2ForceWithdrawZeroSharePriceError} when the derived share-price floor rounds down
375
394
  * to zero, which the contract would read as no bound at all.
395
+ * @throws {VaultV2ForceWithdrawSharePriceBelowFloorError} when a supplied `minSharePriceE27`
396
+ * is below the floor derived at `MAX_SLIPPAGE_TOLERANCE`.
376
397
  * @throws {VaultV2ForceWithdrawFeeSharesExceedBurnError} when fee shares are minted to a
377
398
  * fee-recipient `userAddress` and reach the lower-bound share burn at the deadline.
378
399
  * @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
@@ -384,7 +405,7 @@ export interface VaultV2Actions {
384
405
  * @throws {BundlesPermitMismatchError} from `buildTx()` when the permit's spender, amount, or
385
406
  * deadline differs from this operation. Any handle built from the same inputs accepts the
386
407
  * permit; the nonce is verified onchain by the vault's `permit`.
387
- * @throws {VaultExitBundlesV1PermitMismatchError} from `buildTx()` when the requirement has the wrong permit kind, asset, or signature encoding.
408
+ * @throws {BundlesPermitMismatchError} from `buildTx()` when the requirement has the wrong permit kind, asset, or signature encoding.
388
409
  * @example
389
410
  * ```ts
390
411
  * import { isRequirementSignature } from "@morpho-org/morpho-sdk";
@@ -1,13 +1,13 @@
1
- import { AccrualVaultV2MorphoMarketV1AdapterV2, DEFAULT_SLIPPAGE_TOLERANCE, getChainAddresses, MarketUtils, MathLib, } from "@morpho-org/blue-sdk";
1
+ import { AccrualVaultV2MorphoMarketV1AdapterV2, DEFAULT_SLIPPAGE_TOLERANCE, MarketUtils, MathLib, } from "@morpho-org/blue-sdk";
2
2
  import { erc2612Abi, fetchAccrualVaultV2 } from "@morpho-org/blue-sdk-viem";
3
- import { getChainAddress, Time } from "@morpho-org/morpho-ts";
3
+ import { _try, getChainAddress, Time } from "@morpho-org/morpho-ts";
4
4
  import { erc20Abi, isAddressEqual, maxUint256 } from "viem";
5
5
  import { multicall } from "viem/actions";
6
6
  import { getBundlesReferralFeeAssets, normalizeBundlesCommonParams, resolveBundlesFunding, selectBundlesSharesPermitSignature, selectBundlesSharesRequirementSignature, selectBundlesTokenRequirementSignature, } from "../../actions/bundles/common.js";
7
7
  import { encodeErc20Approval, encodeVaultSharesPermit, vaultV2Deposit, vaultV2ForceRedeem, vaultV2ForceWithdraw, vaultV2InKindRedeem, vaultV2Redeem, vaultV2Withdraw, } from "../../actions/index.js";
8
- import { computeMinForceWithdrawSharePrice, computeVaultMaxShareAllowance, computeVaultMaxSharePrice, computeVaultV2ForceWithdrawFeeSharesMinted, computeVaultV2ForceWithdrawMinSharesBurnt, computeVaultV2ForceWithdrawPlan, computeVaultV2ForceWithdrawSharesBurnt, resolveVaultV2ForceWithdrawEligibility, validateChainId, validateSlippageTolerance, } from "../../helpers/index.js";
8
+ import { computeMinForceWithdrawSharePrice, computeVaultMaxShareAllowance, computeVaultMaxSharePrice, computeVaultV2ForceWithdrawFeeSharesMinted, computeVaultV2ForceWithdrawMinSharesBurnt, computeVaultV2ForceWithdrawPlan, computeVaultV2ForceWithdrawSharesBurnt, MAX_SLIPPAGE_TOLERANCE, resolveVaultV2ForceWithdrawEligibility, validateChainId, validateSlippageTolerance, } from "../../helpers/index.js";
9
9
  import { validateDeadline, validateNativeVaultAsset, validateReferralFee, validateUint256Field, } from "../../helpers/validate.js";
10
- import { AdapterNotPartOfVaultError, ChainIdMismatchError, EmptyMarketParamsListError, ExpiredDeadlineError, InKindRedeemCoverageError, InKindRedeemZeroDeallocationError, InputExceedsMaxError, InsufficientBlueBalanceForInKindRedeemError, isRequirementSignature, NonPositiveInputError, selectRequirementSignatures, VaultAddressMismatchError, VaultV2ForceWithdrawCoverageError, VaultV2ForceWithdrawFeeSharesExceedBurnError, VaultV2ForceWithdrawZeroWithdrawalError, VaultV2SingleAdapterRequiredError, VaultV2UndecodableLiquidityDataError, VaultV2UnsupportedExitAdapterError, VaultV2UnsupportedLiquidityAdapterError, } from "../../types/index.js";
10
+ import { AdapterNotPartOfVaultError, ChainIdMismatchError, EmptyMarketParamsListError, ExpiredDeadlineError, InKindRedeemCoverageError, InKindRedeemZeroDeallocationError, InputExceedsMaxError, InsufficientBlueBalanceForInKindRedeemError, isRequirementSignature, NonPositiveInputError, VaultAddressMismatchError, VaultV2ForceWithdrawCoverageError, VaultV2ForceWithdrawFeeSharesExceedBurnError, VaultV2ForceWithdrawSharePriceBelowFloorError, VaultV2ForceWithdrawZeroSharePriceError, VaultV2ForceWithdrawZeroWithdrawalError, VaultV2SingleAdapterRequiredError, VaultV2UndecodableLiquidityDataError, VaultV2UnsupportedExitAdapterError, VaultV2UnsupportedLiquidityAdapterError, } from "../../types/index.js";
11
11
  import { getVaultBundlesSharesRequirements } from "../requirements/getVaultBundlesSharesRequirements.js";
12
12
  import { getBundlesTokenRequirements } from "../requirements/index.js";
13
13
  // Maximum accepted deadline horizon; the on-chain management fee is capped at 5%/yr so the
@@ -30,7 +30,6 @@ export class MorphoVaultV2 {
30
30
  }
31
31
  return fetchAccrualVaultV2(this.vault, this.client.viemClient, {
32
32
  ...parameters,
33
- chainId: this.chainId,
34
33
  deployless: this.client.options.supportDeployless,
35
34
  });
36
35
  }
@@ -188,9 +187,10 @@ export class MorphoVaultV2 {
188
187
  supportSignature: this.client.options.supportSignature,
189
188
  });
190
189
  const signatureRequirement = requirements.find(isRequirementSignature);
191
- if (signatureRequirement?.action.type === "permit") {
192
- expectedRequirement = signatureRequirement.action;
193
- }
190
+ expectedRequirement =
191
+ signatureRequirement?.action.type === "permit"
192
+ ? signatureRequirement.action
193
+ : undefined;
194
194
  return requirements;
195
195
  },
196
196
  buildTx: (signatures) => {
@@ -366,8 +366,7 @@ export class MorphoVaultV2 {
366
366
  remaining -= chunk;
367
367
  }
368
368
  const vaultExitBundlesV1 = getChainAddress(this.chainId, "bundles.vaultExitBundlesV1");
369
- const addresses = getChainAddresses(this.chainId);
370
- const blue = addresses.blue ?? addresses.morpho;
369
+ const blue = getChainAddress(this.chainId, "blue");
371
370
  return {
372
371
  getRequirements: async () => {
373
372
  const requirementsTimestamp = Time.timestamp();
@@ -410,9 +409,14 @@ export class MorphoVaultV2 {
410
409
  required: peak,
411
410
  });
412
411
  }
413
- if (allowance >= requiredShareAllowance)
412
+ // In-kind withdrawals carry no onchain share cap, so the allowance itself is the cap. A
413
+ // larger leftover allowance would let a share-price loss burn past `requiredShareAllowance`.
414
+ if (allowance === requiredShareAllowance)
414
415
  return [];
415
- if (this.client.options.supportSignature) {
416
+ // A lowering permit can be skipped after its nonce is consumed, so oversized allowances
417
+ // must be reset with an onchain approval.
418
+ if (allowance < requiredShareAllowance &&
419
+ this.client.options.supportSignature) {
416
420
  return [
417
421
  encodeVaultSharesPermit({
418
422
  vault: vaultData,
@@ -436,8 +440,10 @@ export class MorphoVaultV2 {
436
440
  ];
437
441
  },
438
442
  buildTx: (signatures) => {
439
- const { permit } = selectRequirementSignatures(signatures, {
440
- permit: true,
443
+ const permit = selectBundlesSharesPermitSignature(signatures, {
444
+ spender: vaultExitBundlesV1,
445
+ amount: requiredShareAllowance,
446
+ deadline,
441
447
  });
442
448
  return vaultV2InKindRedeem({
443
449
  vault: { chainId: this.chainId, address: this.vault },
@@ -542,10 +548,19 @@ export class MorphoVaultV2 {
542
548
  }
543
549
  const projectionTimestamp = deadline;
544
550
  // VaultExitBundlesV1 measures shares as `sharesBefore - balanceAfter`; its first withdrawal
545
- // accrues the vault before burning. Use the `now` accrual for the floor and the projected
546
- // deadline accrual for the fee-mint guard.
551
+ // accrues the vault before burning. The realized price sits between the raw snapshot price
552
+ // (pending fee mints not yet diluting it) and the `now` projection (interest the chain may not
553
+ // have accrued yet, e.g. when the wall clock runs ahead of the chain). Price the floor off the
554
+ // larger *net* burn of the two endpoints — the raw snapshot mints no fee shares, the `now`
555
+ // accrual mints `feeSharesNow` — so it never exceeds either, and use the projected deadline
556
+ // accrual for the fee-mint guard.
547
557
  const { vault: nowVaultData } = vaultData.accrueInterest(MathLib.max(now, vaultData.lastUpdate));
548
558
  const { vault: projectedVaultData } = vaultData.accrueInterest(MathLib.max(projectionTimestamp, vaultData.lastUpdate));
559
+ const sharesBurntRaw = computeVaultV2ForceWithdrawSharesBurnt({
560
+ vaultData,
561
+ deadlineVaultData: vaultData,
562
+ plan,
563
+ });
549
564
  const sharesBurntNow = computeVaultV2ForceWithdrawSharesBurnt({
550
565
  vaultData: nowVaultData,
551
566
  deadlineVaultData: nowVaultData,
@@ -576,30 +591,46 @@ export class MorphoVaultV2 {
576
591
  });
577
592
  }
578
593
  // sharesBurntNow ≥ minSharesBurntNow ≥ minSharesBurntProjected > feeSharesProjected ≥ feeSharesNow
579
- const netSharesBurntNow = sharesBurntNow - feeSharesNow;
594
+ const sharesBurntForFloor = MathLib.max(sharesBurntRaw, sharesBurntNow - feeSharesNow);
595
+ if (minSharePriceE27Override != null) {
596
+ // The maximum-slippage threshold only bounds the override; unlike the transaction floor it
597
+ // may round to zero, in which case every positive override is acceptable.
598
+ const minAllowedSharePriceE27 = _try(() => computeMinForceWithdrawSharePrice({
599
+ withdrawnAssets: plan.withdrawnAssets,
600
+ sharesBurnt: sharesBurntForFloor,
601
+ slippageTolerance: MAX_SLIPPAGE_TOLERANCE,
602
+ }), VaultV2ForceWithdrawZeroSharePriceError) ?? 1n;
603
+ if (minSharePriceE27Override < minAllowedSharePriceE27) {
604
+ throw new VaultV2ForceWithdrawSharePriceBelowFloorError({
605
+ minSharePriceE27: minSharePriceE27Override,
606
+ floorE27: minAllowedSharePriceE27,
607
+ });
608
+ }
609
+ }
580
610
  const minSharePriceE27 = minSharePriceE27Override ??
581
611
  computeMinForceWithdrawSharePrice({
582
612
  withdrawnAssets: plan.withdrawnAssets,
583
- sharesBurnt: netSharesBurntNow,
613
+ sharesBurnt: sharesBurntForFloor,
584
614
  slippageTolerance,
585
615
  });
586
616
  // The floor is deliberately *not* capped at `MAX_ABSOLUTE_SHARE_PRICE` (100 assets/share):
587
617
  // lowering a lower bound weakens it, so any vault whose share price grew past that would be left
588
618
  // with no real protection. Its two sibling `computeMin*SharePrice` helpers cap nothing either —
589
619
  // only the `computeMax*` ones do, where capping relaxes an upper bound and is safe.
590
- //
591
- // It still has to fit the ABI slot though. Defense-in-depth rather than a reachable input error:
592
- // with `exitAssets` bounded above, the derived floor only exceeds `uint256` on a vault whose
593
- // share price passed ~1e50 assets/share, which no fixture here can construct.
594
620
  validateUint256Field("minSharePriceE27", minSharePriceE27);
595
- // VaultExitBundlesV1's burn bound includes fee shares minted by the first withdrawal. Add the
596
- // projected fee shares to the price-floor ceiling so the approval covers that mint.
597
- // Saturated at `maxUint256`: a tiny accepted floor scales this above the ABI slot, and the
598
- // approval encoder clamps what it emits — so an uncapped requirement would sit permanently above
599
- // any allowance the user can actually grant and `getRequirements()` would return the same
600
- // approval forever. No account can hold or burn more shares than that anyway.
601
- const requiredShareAllowance = MathLib.min(MathLib.mulDivUp(exitAssets, MathLib.RAY, minSharePriceE27) +
602
- feeSharesProjected, maxUint256);
621
+ // The allowance is only a spend cap, never the price protection: the bundle checks
622
+ // `minSharePriceE27` after its last withdrawal, so an allowance sized exactly to the floor
623
+ // underflows `_spendAllowance` (panic 0x11) on a below-floor price before that check runs. Size
624
+ // it for a price at least one tolerance step below the floor so the miss surfaces as the
625
+ // bundle's own revert instead, and, in any case, for at least one share above the at-floor
626
+ // burn — a burn of `atFloor + 1` shares prices strictly below the floor since
627
+ // `atFloor >= exitAssets * RAY / floor`. The `minSharePriceE27 - 1` branch keeps the
628
+ // denominator strictly below the floor whenever the floor exceeds 1, so even
629
+ // `slippageTolerance: 0n` leaves price-space headroom; a deeper drop still exhausts the
630
+ // allowance first. Add the fee shares the first withdrawal mints since the burn measured
631
+ // on-chain includes them. Saturated at `maxUint256` as an ABI-slot guard.
632
+ const allowanceSharePriceE27 = MathLib.max(MathLib.min(MathLib.mulDivDown(minSharePriceE27, MathLib.WAD - slippageTolerance, MathLib.WAD), minSharePriceE27 - 1n), 1n);
633
+ const requiredShareAllowance = MathLib.min(MathLib.max(MathLib.mulDivUp(exitAssets, MathLib.RAY, allowanceSharePriceE27), MathLib.mulDivUp(exitAssets, MathLib.RAY, minSharePriceE27) + 1n) + feeSharesProjected, maxUint256);
603
634
  const vaultExitBundlesV1 = getChainAddress(this.chainId, "bundles.vaultExitBundlesV1");
604
635
  return {
605
636
  getRequirements: async () => {
@@ -1,7 +1,8 @@
1
1
  import { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, Market, MarketUtils, MathLib, UnsupportedVaultV2AdapterError, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
2
2
  import { _try, bigIntComparator } from "@morpho-org/morpho-ts";
3
3
  import { isAddressEqual } from "viem";
4
- import { DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_REALLOCATION_PENALTY, } from "../helpers/constant.js";
4
+ import { DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, MAX_REALLOCATION_PENALTY, } from "../helpers/constant.js";
5
+ import { resolveMaxWithdrawalUtilization } from "../helpers/utilization.js";
5
6
  import { InputExceedsMaxError, InsufficientSharedLiquidityError, NegativeInputError, NonPositiveInputError, ReallocationAdapterSupplySharesUnderflowError, ReallocationAllocationUnderflowError, ReallocationWithdrawExceedsMarketSupplyError, UnknownReallocationActiveAdaptersError, UnknownReallocationAdapterError, UnknownReallocationAllocationError, UnknownReallocationMarketError, UnknownReallocationMarketPublicAllocatorConfigError, UnknownReallocationPublicAllocatorConfigError, UnknownReallocationVaultError, } from "../types/index.js";
6
7
  const MAX_SHARED_CAP_SEARCH_STEPS = 1024n;
7
8
  /** Creates isolated transaction-scoped state for one simulation. @internal */
@@ -41,18 +42,6 @@ const getAdapterIds = (cache, adapter, market) => {
41
42
  cache.set(key, ids);
42
43
  return ids;
43
44
  };
44
- const resolveMaxWithdrawalUtilization = (value) => {
45
- const utilization = value ?? DEFAULT_WITHDRAWAL_TARGET_UTILIZATION;
46
- if (utilization < 0n)
47
- throw new NegativeInputError("maxWithdrawalUtilization", utilization);
48
- if (utilization > MathLib.WAD)
49
- throw new InputExceedsMaxError({
50
- field: "maxWithdrawalUtilization",
51
- value: utilization,
52
- max: MathLib.WAD,
53
- });
54
- return utilization;
55
- };
56
45
  const resolveMaxPenalty = (value) => {
57
46
  const penalty = value ?? DEFAULT_MAX_REALLOCATION_PENALTY;
58
47
  if (penalty < 0n)
@@ -72,16 +61,10 @@ const cloneAccrualVault = (vault, markets) => new AccrualVault({
72
61
  pendingTimelock: { ...vault.pendingTimelock },
73
62
  pendingGuardian: { ...vault.pendingGuardian },
74
63
  supplyQueue: [...vault.supplyQueue],
75
- publicAllocatorConfig: vault.publicAllocatorConfig == null
76
- ? undefined
77
- : { ...vault.publicAllocatorConfig },
78
64
  }, [...vault.allocations.values()].map(({ config, position }) => ({
79
65
  config: {
80
66
  ...config,
81
67
  pendingCap: { ...config.pendingCap },
82
- publicAllocatorConfig: config.publicAllocatorConfig == null
83
- ? undefined
84
- : { ...config.publicAllocatorConfig },
85
68
  },
86
69
  position: clonePosition(position, markets),
87
70
  })));
@@ -1,49 +1,7 @@
1
- export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
2
- /** @deprecated Use InvalidBlueMarketParamsError or the raw protocol subpath. */
3
- InvalidMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError,
4
- /** @deprecated Use UnknownBlueDataError or the raw protocol subpath. */
5
- UnknownDataError, UnknownFactory as UnknownBlueFactory,
6
- /** @deprecated Use UnknownBlueFactory or the raw protocol subpath. */
7
- UnknownFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError,
8
- /** @deprecated Use UnknownBlueMarketParamsError or the raw protocol subpath. */
9
- UnknownMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory,
10
- /** @deprecated Use UnknownBlueOfFactory or the raw protocol subpath. */
11
- UnknownOfFactory, UnknownTokenError as UnknownBlueTokenError,
12
- /** @deprecated Use UnknownBlueTokenError or the raw protocol subpath. */
13
- UnknownTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError,
14
- /** @deprecated Use UnknownBlueTokenPriceError or the raw protocol subpath. */
15
- UnknownTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError,
16
- /** @deprecated Use UnknownBlueVaultConfigError or the raw protocol subpath. */
17
- UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError, UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError,
18
- /** @deprecated Use UnsupportedBluePreLiquidationParamsError or the raw protocol subpath. */
19
- UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError,
20
- /** @deprecated Use UnsupportedBlueVaultV2AdapterError or the raw protocol subpath. */
21
- UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
22
- export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
23
- export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError,
24
- /** @deprecated Use InvalidMidnightOfferGroupError or the raw protocol subpath. */
25
- InvalidOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError,
26
- /** @deprecated Use InvalidMidnightOfferParameterError or the raw protocol subpath. */
27
- InvalidOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError,
28
- /** @deprecated Use InvalidMidnightPositionAccrualStateError or the raw protocol subpath. */
29
- InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError,
30
- /** @deprecated Use InvalidMidnightPositionAccrualTimestampError or the raw protocol subpath. */
31
- InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError,
32
- /** @deprecated Use InvalidMidnightPositionLossFactorError or the raw protocol subpath. */
33
- InvalidPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError,
34
- /** @deprecated Use InvalidMidnightTickSpacingError or the raw protocol subpath. */
35
- InvalidTickSpacingError, InvalidTreeError as InvalidMidnightTreeError,
36
- /** @deprecated Use InvalidMidnightTreeError or the raw protocol subpath. */
37
- InvalidTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError,
38
- /** @deprecated Use InvalidMidnightTreeHeightError or the raw protocol subpath. */
39
- InvalidTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError,
40
- /** @deprecated Use MidnightPriceGreaterThanOneError or the raw protocol subpath. */
41
- PriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError,
42
- /** @deprecated Use MidnightSettlementFeeExceedsPriceError or the raw protocol subpath. */
43
- SettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError,
44
- /** @deprecated Use MidnightTickOutOfRangeError or the raw protocol subpath. */
45
- TickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError,
46
- /** @deprecated Use UnknownMidnightCollateralIndexError or the raw protocol subpath. */
47
- UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
2
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
+ UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
5
+ export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
48
6
  export type { ErrorClass } from "@morpho-org/morpho-ts";
49
7
  export { _try, DivisionByZeroError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
package/lib/esm/errors.js CHANGED
@@ -1,48 +1,6 @@
1
- export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError,
2
- /** @deprecated Use InvalidBlueMarketParamsError or the raw protocol subpath. */
3
- InvalidMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError,
4
- /** @deprecated Use UnknownBlueDataError or the raw protocol subpath. */
5
- UnknownDataError, UnknownFactory as UnknownBlueFactory,
6
- /** @deprecated Use UnknownBlueFactory or the raw protocol subpath. */
7
- UnknownFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError,
8
- /** @deprecated Use UnknownBlueMarketParamsError or the raw protocol subpath. */
9
- UnknownMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory,
10
- /** @deprecated Use UnknownBlueOfFactory or the raw protocol subpath. */
11
- UnknownOfFactory, UnknownTokenError as UnknownBlueTokenError,
12
- /** @deprecated Use UnknownBlueTokenError or the raw protocol subpath. */
13
- UnknownTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError,
14
- /** @deprecated Use UnknownBlueTokenPriceError or the raw protocol subpath. */
15
- UnknownTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError,
16
- /** @deprecated Use UnknownBlueVaultConfigError or the raw protocol subpath. */
17
- UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError, UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError,
18
- /** @deprecated Use UnsupportedBluePreLiquidationParamsError or the raw protocol subpath. */
19
- UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError,
20
- /** @deprecated Use UnsupportedBlueVaultV2AdapterError or the raw protocol subpath. */
21
- UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
22
- export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
23
- export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError,
24
- /** @deprecated Use InvalidMidnightOfferGroupError or the raw protocol subpath. */
25
- InvalidOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError,
26
- /** @deprecated Use InvalidMidnightOfferParameterError or the raw protocol subpath. */
27
- InvalidOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError,
28
- /** @deprecated Use InvalidMidnightPositionAccrualStateError or the raw protocol subpath. */
29
- InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError,
30
- /** @deprecated Use InvalidMidnightPositionAccrualTimestampError or the raw protocol subpath. */
31
- InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError,
32
- /** @deprecated Use InvalidMidnightPositionLossFactorError or the raw protocol subpath. */
33
- InvalidPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError,
34
- /** @deprecated Use InvalidMidnightTickSpacingError or the raw protocol subpath. */
35
- InvalidTickSpacingError, InvalidTreeError as InvalidMidnightTreeError,
36
- /** @deprecated Use InvalidMidnightTreeError or the raw protocol subpath. */
37
- InvalidTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError,
38
- /** @deprecated Use InvalidMidnightTreeHeightError or the raw protocol subpath. */
39
- InvalidTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError,
40
- /** @deprecated Use MidnightPriceGreaterThanOneError or the raw protocol subpath. */
41
- PriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError,
42
- /** @deprecated Use MidnightSettlementFeeExceedsPriceError or the raw protocol subpath. */
43
- SettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError,
44
- /** @deprecated Use MidnightTickOutOfRangeError or the raw protocol subpath. */
45
- TickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError,
46
- /** @deprecated Use UnknownMidnightCollateralIndexError or the raw protocol subpath. */
47
- UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
1
+ export { BlueErrors, IncompleteChainRegistryError, InvalidMarketParamsError as InvalidBlueMarketParamsError, UnknownAddressError, UnknownDataError as UnknownBlueDataError, UnknownFactory as UnknownBlueFactory, UnknownMarketAllocationError as UnknownBlueMarketAllocationError, UnknownMarketParamsError as UnknownBlueMarketParamsError, UnknownOfFactory as UnknownBlueOfFactory, UnknownTokenError as UnknownBlueTokenError, UnknownTokenPriceError as UnknownBlueTokenPriceError, UnknownVaultConfigError as UnknownBlueVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError as UnsupportedBlueMarketIrmError,
2
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
+ UnsupportedPreLiquidationParamsError as UnsupportedBluePreLiquidationParamsError, UnsupportedVaultV2AdapterError as UnsupportedBlueVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
4
+ export { getUnsupportedVaultV2Adapter as getBlueUnsupportedVaultV2Adapter, InvalidNumberError, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError as isBlueUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
5
+ export { ChainIdMismatchError as MidnightChainIdMismatchError, InvalidEcrecoverSignatureVError as InvalidMidnightEcrecoverSignatureVError, InvalidMarketParameterError as InvalidMidnightMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError as InvalidMidnightOfferGroupError, InvalidOfferParameterError as InvalidMidnightOfferParameterError, InvalidPositionAccrualStateError as InvalidMidnightPositionAccrualStateError, InvalidPositionAccrualTimestampError as InvalidMidnightPositionAccrualTimestampError, InvalidPositionLossFactorError as InvalidMidnightPositionLossFactorError, InvalidTickSpacingError as InvalidMidnightTickSpacingError, InvalidTreeError as InvalidMidnightTreeError, InvalidTreeHeightError as InvalidMidnightTreeHeightError, InvalidTypedDataSignatureError as InvalidMidnightTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError as MidnightPayloadDecodeError, PriceGreaterThanOneError as MidnightPriceGreaterThanOneError, SettlementFeeExceedsPriceError as MidnightSettlementFeeExceedsPriceError, TickOutOfRangeError as MidnightTickOutOfRangeError, UnknownCollateralIndexError as UnknownMidnightCollateralIndexError, } from "@morpho-org/midnight-sdk";
48
6
  export { _try, DivisionByZeroError, InvalidBitLengthError, NegativeValueError, RegistryValueAlreadyRegisteredError, } from "@morpho-org/morpho-ts";
@@ -1,18 +1,6 @@
1
- export { fetchAccrualPosition as fetchBlueAccrualPosition,
2
- /** @deprecated Use `fetchBlueAccrualPosition` or the raw `/blue/fetch` subpath. */
3
- fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket,
4
- /** @deprecated Use `fetchBlueMarket` or the raw `/blue/fetch` subpath. */
5
- fetchMarket, fetchMarketParams as fetchBlueMarketParams,
6
- /** @deprecated Use `fetchBlueMarketParams` or the raw `/blue/fetch` subpath. */
7
- fetchMarketParams, fetchPosition as fetchBluePosition,
8
- /** @deprecated Use `fetchBluePosition` or the raw `/blue/fetch` subpath. */
9
- fetchPosition, fetchPreLiquidationParams as fetchBluePreLiquidationParams,
10
- /** @deprecated Use `fetchBluePreLiquidationParams` or the raw `/blue/fetch` subpath. */
11
- fetchPreLiquidationParams, fetchPreLiquidationPosition as fetchBluePreLiquidationPosition,
12
- /** @deprecated Use `fetchBluePreLiquidationPosition` or the raw `/blue/fetch` subpath. */
13
- fetchPreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser,
14
- /** @deprecated Use `fetchBlueUser` or the raw `/blue/fetch` subpath. */
15
- fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig,
16
- /** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `fetchVaultV2BlueMarketPublicAllocatorConfig`. */
17
- fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
1
+ export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
2
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
+ fetchPreLiquidationParams as fetchBluePreLiquidationParams,
4
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
+ fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
18
6
  export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
package/lib/esm/fetch.js CHANGED
@@ -1,18 +1,6 @@
1
- export { fetchAccrualPosition as fetchBlueAccrualPosition,
2
- /** @deprecated Use `fetchBlueAccrualPosition` or the raw `/blue/fetch` subpath. */
3
- fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket,
4
- /** @deprecated Use `fetchBlueMarket` or the raw `/blue/fetch` subpath. */
5
- fetchMarket, fetchMarketParams as fetchBlueMarketParams,
6
- /** @deprecated Use `fetchBlueMarketParams` or the raw `/blue/fetch` subpath. */
7
- fetchMarketParams, fetchPosition as fetchBluePosition,
8
- /** @deprecated Use `fetchBluePosition` or the raw `/blue/fetch` subpath. */
9
- fetchPosition, fetchPreLiquidationParams as fetchBluePreLiquidationParams,
10
- /** @deprecated Use `fetchBluePreLiquidationParams` or the raw `/blue/fetch` subpath. */
11
- fetchPreLiquidationParams, fetchPreLiquidationPosition as fetchBluePreLiquidationPosition,
12
- /** @deprecated Use `fetchBluePreLiquidationPosition` or the raw `/blue/fetch` subpath. */
13
- fetchPreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser,
14
- /** @deprecated Use `fetchBlueUser` or the raw `/blue/fetch` subpath. */
15
- fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig,
16
- /** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `fetchVaultV2BlueMarketPublicAllocatorConfig`. */
17
- fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
1
+ export { fetchAccrualPosition as fetchBlueAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket as fetchBlueMarket, fetchMarketParams as fetchBlueMarketParams, fetchPosition as fetchBluePosition,
2
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
3
+ fetchPreLiquidationParams as fetchBluePreLiquidationParams,
4
+ /** @deprecated Pre-liquidation support is deprecated and will be removed in the next major. */
5
+ fetchPreLiquidationPosition as fetchBluePreLiquidationPosition, fetchToken, fetchUser as fetchBlueUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
18
6
  export { fetchAccrualPosition as fetchMidnightAccrualPosition, fetchMarket as fetchMidnightMarket, fetchMarketParams as fetchMidnightMarketParams, fetchPosition as fetchMidnightPosition, fetchRatifierInfo as fetchMidnightRatifierInfo, } from "@morpho-org/midnight-sdk";
@@ -17,8 +17,6 @@ export declare const DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = 900000000000000000n
17
17
  /**
18
18
  * The default target utilization above which shared liquidity reallocations are
19
19
  * triggered (and the level the target market is brought back to), scaled by WAD.
20
- * Still overridable through the deprecated `supplyTargetUtilization` /
21
- * `defaultSupplyTargetUtilization` options until the next major.
22
20
  */
23
21
  export declare const DEFAULT_SUPPLY_TARGET_UTILIZATION = 900000000000000000n;
24
22
  /**
@@ -18,8 +18,6 @@ export const DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = 900000000000000000n;
18
18
  /**
19
19
  * The default target utilization above which shared liquidity reallocations are
20
20
  * triggered (and the level the target market is brought back to), scaled by WAD.
21
- * Still overridable through the deprecated `supplyTargetUtilization` /
22
- * `defaultSupplyTargetUtilization` options until the next major.
23
21
  */
24
22
  export const DEFAULT_SUPPLY_TARGET_UTILIZATION = 900000000000000000n;
25
23
  /**
@@ -1,12 +1,11 @@
1
- export { computeReallocations, computeVaultV1Reallocations, } from "./computeVaultV1Reallocations.js";
2
1
  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 "./constant.js";
3
2
  export { addTransactionMetadata } from "./metadata.js";
4
3
  export { type PreviewVaultV2ForceWithdrawParams, previewVaultV2ForceWithdraw, type VaultV2ForceWithdrawPreview, } from "./previewVaultV2ForceWithdraw.js";
5
4
  export { type PreviewVaultV2InKindRedeemParams, previewVaultV2InKindRedeem, type VaultV2InKindRedeemMarketPreview, } from "./previewVaultV2InKindRedeem.js";
6
5
  export { grossFromNetAssets } from "./referralFee.js";
7
6
  export { signAndVerifyTypedData } from "./signAndVerifyTypedData.js";
8
- export { computeMaxRepaySharePrice, computeMaxSupplySharePrice, computeMinBorrowSharePrice, computeMinForceWithdrawSharePrice, computeMinWithdrawSharePrice, computeVaultMaxShareAllowance, computeVaultMaxSharePrice, } from "./slippage.js";
9
- export { validateAccrualPosition, validateChainId, validateMidnightMarketChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateReallocations, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, validateWithdrawAmount, validateWithdrawShares, } from "./validate.js";
7
+ export { computeMinForceWithdrawSharePrice, computeVaultMaxShareAllowance, computeVaultMaxSharePrice, } from "./slippage.js";
8
+ export { validateAccrualPosition, validateChainId, validateMidnightMarketChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, validateWithdrawAmount, validateWithdrawShares, } from "./validate.js";
10
9
  export { validateOfferSides } from "./validateOfferSides.js";
11
10
  export { type RequirementSpenderKey, validateRequirementSpender, } from "./validateRequirementSpender.js";
12
11
  export { computeVaultV2ForceWithdrawFeeSharesMinted, computeVaultV2ForceWithdrawMinSharesBurnt, computeVaultV2ForceWithdrawPlan, computeVaultV2ForceWithdrawSharesBurnt, resolveVaultV2ForceWithdrawEligibility, type VaultV2ForceWithdrawEligibility, type VaultV2ForceWithdrawPlan, } from "./vaultV2ForceWithdrawPlan.js";
@@ -1,12 +1,11 @@
1
- export { computeReallocations, computeVaultV1Reallocations, } from "./computeVaultV1Reallocations.js";
2
1
  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 "./constant.js";
3
2
  export { addTransactionMetadata } from "./metadata.js";
4
3
  export { previewVaultV2ForceWithdraw, } from "./previewVaultV2ForceWithdraw.js";
5
4
  export { previewVaultV2InKindRedeem, } from "./previewVaultV2InKindRedeem.js";
6
5
  export { grossFromNetAssets } from "./referralFee.js";
7
6
  export { signAndVerifyTypedData } from "./signAndVerifyTypedData.js";
8
- export { computeMaxRepaySharePrice, computeMaxSupplySharePrice, computeMinBorrowSharePrice, computeMinForceWithdrawSharePrice, computeMinWithdrawSharePrice, computeVaultMaxShareAllowance, computeVaultMaxSharePrice, } from "./slippage.js";
9
- export { validateAccrualPosition, validateChainId, validateMidnightMarketChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateReallocations, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, validateWithdrawAmount, validateWithdrawShares, } from "./validate.js";
7
+ export { computeMinForceWithdrawSharePrice, computeVaultMaxShareAllowance, computeVaultMaxSharePrice, } from "./slippage.js";
8
+ export { validateAccrualPosition, validateChainId, validateMidnightMarketChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, validateWithdrawAmount, validateWithdrawShares, } from "./validate.js";
10
9
  export { validateOfferSides } from "./validateOfferSides.js";
11
10
  export { validateRequirementSpender, } from "./validateRequirementSpender.js";
12
11
  export { computeVaultV2ForceWithdrawFeeSharesMinted, computeVaultV2ForceWithdrawMinSharesBurnt, computeVaultV2ForceWithdrawPlan, computeVaultV2ForceWithdrawSharesBurnt, resolveVaultV2ForceWithdrawEligibility, } from "./vaultV2ForceWithdrawPlan.js";