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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/MIGRATION-v5-to-v6.md +199 -34
  2. package/README.md +23 -15
  3. package/lib/cjs/abis.d.ts +3 -2829
  4. package/lib/cjs/abis.js +1 -1938
  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 +6 -35
  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 +4 -9
  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 +38 -4
  25. package/lib/cjs/actions/bundles/common.js +91 -35
  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 +9 -8
  29. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +17 -26
  30. package/lib/cjs/actions/requirements/blue/index.d.ts +0 -1
  31. package/lib/cjs/actions/requirements/blue/index.js +0 -1
  32. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +20 -14
  33. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +24 -25
  34. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
  35. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +4 -5
  36. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +21 -12
  37. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +39 -38
  38. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +4 -2
  39. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +14 -9
  40. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +9 -6
  41. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +22 -17
  42. package/lib/cjs/actions/requirements/encode/index.d.ts +0 -1
  43. package/lib/cjs/actions/requirements/encode/index.js +0 -1
  44. package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +5 -6
  45. package/lib/cjs/actions/requirements/getRequirementsApproval.js +5 -6
  46. package/lib/cjs/actions/requirements/index.d.ts +0 -1
  47. package/lib/cjs/actions/requirements/index.js +0 -1
  48. package/lib/cjs/actions/vaultV1/deposit.d.ts +1 -2
  49. package/lib/cjs/actions/vaultV1/deposit.js +1 -2
  50. package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +6 -4
  51. package/lib/cjs/actions/vaultV1/inKindRedeem.js +12 -8
  52. package/lib/cjs/actions/vaultV2/deposit.d.ts +1 -2
  53. package/lib/cjs/actions/vaultV2/deposit.js +1 -2
  54. package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +58 -39
  55. package/lib/cjs/actions/vaultV2/forceWithdraw.js +87 -60
  56. package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +6 -4
  57. package/lib/cjs/actions/vaultV2/inKindRedeem.js +12 -8
  58. package/lib/cjs/augment.d.ts +0 -1
  59. package/lib/cjs/augment.js +0 -1
  60. package/lib/cjs/blue/abis.d.ts +1 -1
  61. package/lib/cjs/blue/abis.js +1 -5
  62. package/lib/cjs/blue/entities.d.ts +2 -2
  63. package/lib/cjs/blue/entities.js +1 -2
  64. package/lib/cjs/blue/errors.d.ts +1 -1
  65. package/lib/cjs/blue/errors.js +2 -1
  66. package/lib/cjs/blue/fetch.d.ts +1 -1
  67. package/lib/cjs/blue/fetch.js +1 -2
  68. package/lib/cjs/blue/types.d.ts +2 -4
  69. package/lib/cjs/blue/utils.d.ts +1 -3
  70. package/lib/cjs/blue/utils.js +1 -3
  71. package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
  72. package/lib/cjs/client/morphoViemExtension.js +1 -1
  73. package/lib/cjs/constants.d.ts +3 -37
  74. package/lib/cjs/constants.js +1 -39
  75. package/lib/cjs/entities/blue/blue.d.ts +38 -264
  76. package/lib/cjs/entities/blue/blue.js +2 -203
  77. package/lib/cjs/entities/index.d.ts +3 -60
  78. package/lib/cjs/entities/index.js +1 -20
  79. package/lib/cjs/entities/midnight/midnight.js +20 -24
  80. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +7 -6
  81. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +19 -14
  82. package/lib/cjs/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +3 -3
  83. package/lib/cjs/entities/requirements/index.d.ts +1 -0
  84. package/lib/cjs/entities/requirements/index.js +1 -0
  85. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +18 -6
  86. package/lib/cjs/entities/vaultV1/vaultV1.js +25 -8
  87. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +154 -35
  88. package/lib/cjs/entities/vaultV2/vaultV2.js +249 -23
  89. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +8 -1
  90. package/lib/cjs/entities/vaultV2BlueReallocationData.js +50 -34
  91. package/lib/cjs/errors.d.ts +2 -46
  92. package/lib/cjs/errors.js +2 -46
  93. package/lib/cjs/fetch.d.ts +1 -15
  94. package/lib/cjs/fetch.js +1 -16
  95. package/lib/cjs/helpers/constant.d.ts +0 -2
  96. package/lib/cjs/helpers/constant.js +0 -2
  97. package/lib/cjs/helpers/index.d.ts +4 -3
  98. package/lib/cjs/helpers/index.js +10 -9
  99. package/lib/cjs/helpers/metadata.d.ts +3 -5
  100. package/lib/cjs/helpers/metadata.js +4 -6
  101. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
  102. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +164 -0
  103. package/lib/cjs/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
  104. package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +2 -0
  105. package/lib/cjs/helpers/slippage.d.ts +34 -90
  106. package/lib/cjs/helpers/slippage.js +52 -137
  107. package/lib/cjs/helpers/utilization.d.ts +12 -10
  108. package/lib/cjs/helpers/utilization.js +27 -12
  109. package/lib/cjs/helpers/validate.d.ts +66 -32
  110. package/lib/cjs/helpers/validate.js +84 -57
  111. package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
  112. package/lib/cjs/helpers/validateRequirementSpender.js +1 -3
  113. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
  114. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +369 -0
  115. package/lib/cjs/types/action.d.ts +102 -68
  116. package/lib/cjs/types/action.js +11 -4
  117. package/lib/cjs/types/error.d.ts +332 -385
  118. package/lib/cjs/types/error.js +369 -412
  119. package/lib/cjs/types/sharedLiquidity.d.ts +1 -117
  120. package/lib/cjs/types.d.ts +2 -18
  121. package/lib/cjs/utils.d.ts +8 -35
  122. package/lib/cjs/utils.js +11 -36
  123. package/lib/esm/abis.d.ts +3 -2829
  124. package/lib/esm/abis.js +3 -1935
  125. package/lib/esm/actions/blue/borrow.d.ts +3 -2
  126. package/lib/esm/actions/blue/borrow.js +3 -2
  127. package/lib/esm/actions/blue/common.js +8 -37
  128. package/lib/esm/actions/blue/refinance.d.ts +2 -2
  129. package/lib/esm/actions/blue/refinance.js +2 -2
  130. package/lib/esm/actions/blue/repay.d.ts +1 -1
  131. package/lib/esm/actions/blue/repay.js +1 -1
  132. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +2 -2
  133. package/lib/esm/actions/blue/repayWithdrawCollateral.js +2 -2
  134. package/lib/esm/actions/blue/supply.d.ts +2 -2
  135. package/lib/esm/actions/blue/supply.js +6 -11
  136. package/lib/esm/actions/blue/supplyCollateral.d.ts +2 -2
  137. package/lib/esm/actions/blue/supplyCollateral.js +2 -2
  138. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -2
  139. package/lib/esm/actions/blue/supplyCollateralBorrow.js +3 -2
  140. package/lib/esm/actions/blue/withdraw.d.ts +3 -3
  141. package/lib/esm/actions/blue/withdraw.js +3 -3
  142. package/lib/esm/actions/blue/withdrawCollateral.d.ts +2 -2
  143. package/lib/esm/actions/blue/withdrawCollateral.js +2 -2
  144. package/lib/esm/actions/bundles/common.d.ts +38 -4
  145. package/lib/esm/actions/bundles/common.js +91 -36
  146. package/lib/esm/actions/index.d.ts +0 -1
  147. package/lib/esm/actions/index.js +0 -1
  148. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +9 -8
  149. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +20 -29
  150. package/lib/esm/actions/requirements/blue/index.d.ts +0 -1
  151. package/lib/esm/actions/requirements/blue/index.js +0 -1
  152. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +20 -14
  153. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +25 -26
  154. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +4 -4
  155. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +4 -5
  156. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +21 -12
  157. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +40 -39
  158. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +4 -2
  159. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +14 -9
  160. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +9 -6
  161. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +22 -17
  162. package/lib/esm/actions/requirements/encode/index.d.ts +0 -1
  163. package/lib/esm/actions/requirements/encode/index.js +0 -1
  164. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +5 -6
  165. package/lib/esm/actions/requirements/getRequirementsApproval.js +5 -6
  166. package/lib/esm/actions/requirements/index.d.ts +0 -1
  167. package/lib/esm/actions/requirements/index.js +0 -1
  168. package/lib/esm/actions/vaultV1/deposit.d.ts +1 -2
  169. package/lib/esm/actions/vaultV1/deposit.js +1 -2
  170. package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +6 -4
  171. package/lib/esm/actions/vaultV1/inKindRedeem.js +12 -8
  172. package/lib/esm/actions/vaultV2/deposit.d.ts +1 -2
  173. package/lib/esm/actions/vaultV2/deposit.js +1 -2
  174. package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +58 -39
  175. package/lib/esm/actions/vaultV2/forceWithdraw.js +89 -62
  176. package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +6 -4
  177. package/lib/esm/actions/vaultV2/inKindRedeem.js +12 -8
  178. package/lib/esm/augment.d.ts +0 -1
  179. package/lib/esm/augment.js +0 -1
  180. package/lib/esm/blue/abis.d.ts +1 -1
  181. package/lib/esm/blue/abis.js +1 -1
  182. package/lib/esm/blue/entities.d.ts +2 -2
  183. package/lib/esm/blue/entities.js +1 -1
  184. package/lib/esm/blue/errors.d.ts +1 -1
  185. package/lib/esm/blue/errors.js +1 -1
  186. package/lib/esm/blue/fetch.d.ts +1 -1
  187. package/lib/esm/blue/fetch.js +1 -1
  188. package/lib/esm/blue/types.d.ts +2 -4
  189. package/lib/esm/blue/utils.d.ts +1 -3
  190. package/lib/esm/blue/utils.js +1 -3
  191. package/lib/esm/client/morphoViemExtension.d.ts +1 -1
  192. package/lib/esm/client/morphoViemExtension.js +1 -1
  193. package/lib/esm/constants.d.ts +3 -37
  194. package/lib/esm/constants.js +3 -37
  195. package/lib/esm/entities/blue/blue.d.ts +38 -264
  196. package/lib/esm/entities/blue/blue.js +5 -206
  197. package/lib/esm/entities/index.d.ts +3 -60
  198. package/lib/esm/entities/index.js +1 -16
  199. package/lib/esm/entities/midnight/midnight.js +20 -24
  200. package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +7 -6
  201. package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +20 -15
  202. package/lib/esm/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +3 -3
  203. package/lib/esm/entities/requirements/index.d.ts +1 -0
  204. package/lib/esm/entities/requirements/index.js +1 -0
  205. package/lib/esm/entities/vaultV1/vaultV1.d.ts +18 -6
  206. package/lib/esm/entities/vaultV1/vaultV1.js +29 -12
  207. package/lib/esm/entities/vaultV2/vaultV2.d.ts +154 -35
  208. package/lib/esm/entities/vaultV2/vaultV2.js +256 -30
  209. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +8 -1
  210. package/lib/esm/entities/vaultV2BlueReallocationData.js +48 -32
  211. package/lib/esm/errors.d.ts +2 -46
  212. package/lib/esm/errors.js +2 -46
  213. package/lib/esm/fetch.d.ts +1 -15
  214. package/lib/esm/fetch.js +1 -15
  215. package/lib/esm/helpers/constant.d.ts +0 -2
  216. package/lib/esm/helpers/constant.js +0 -2
  217. package/lib/esm/helpers/index.d.ts +4 -3
  218. package/lib/esm/helpers/index.js +4 -3
  219. package/lib/esm/helpers/metadata.d.ts +3 -5
  220. package/lib/esm/helpers/metadata.js +4 -6
  221. package/lib/esm/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
  222. package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +161 -0
  223. package/lib/esm/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
  224. package/lib/esm/helpers/previewVaultV2InKindRedeem.js +2 -0
  225. package/lib/esm/helpers/slippage.d.ts +34 -90
  226. package/lib/esm/helpers/slippage.js +52 -134
  227. package/lib/esm/helpers/utilization.d.ts +12 -10
  228. package/lib/esm/helpers/utilization.js +26 -11
  229. package/lib/esm/helpers/validate.d.ts +66 -32
  230. package/lib/esm/helpers/validate.js +83 -57
  231. package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
  232. package/lib/esm/helpers/validateRequirementSpender.js +1 -3
  233. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
  234. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +362 -0
  235. package/lib/esm/types/action.d.ts +102 -68
  236. package/lib/esm/types/action.js +12 -5
  237. package/lib/esm/types/error.d.ts +332 -385
  238. package/lib/esm/types/error.js +355 -392
  239. package/lib/esm/types/sharedLiquidity.d.ts +1 -117
  240. package/lib/esm/types.d.ts +2 -18
  241. package/lib/esm/utils.d.ts +8 -35
  242. package/lib/esm/utils.js +7 -34
  243. package/package.json +7 -15
  244. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -42
  245. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -83
  246. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
  247. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -151
  248. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -37
  249. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -50
  250. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
  251. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -74
  252. package/lib/cjs/actions/requirements/generalAdapter/index.d.ts +0 -3
  253. package/lib/cjs/actions/requirements/generalAdapter/index.js +0 -19
  254. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
  255. package/lib/cjs/actions/signatures/getBlueAuthorizationAction.js +0 -48
  256. package/lib/cjs/actions/signatures/getTokenRequirementActions.d.ts +0 -58
  257. package/lib/cjs/actions/signatures/getTokenRequirementActions.js +0 -119
  258. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -44
  259. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -43
  260. package/lib/cjs/actions/signatures/index.d.ts +0 -3
  261. package/lib/cjs/actions/signatures/index.js +0 -19
  262. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -8
  263. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.js +0 -8
  264. package/lib/cjs/bundler/actions.d.ts +0 -797
  265. package/lib/cjs/bundler/actions.js +0 -1371
  266. package/lib/cjs/bundler/index.d.ts +0 -2
  267. package/lib/cjs/bundler/index.js +0 -18
  268. package/lib/cjs/bundler/types.d.ts +0 -235
  269. package/lib/cjs/bundler/types.js +0 -2
  270. package/lib/cjs/entities/vaultV1ReallocationData.d.ts +0 -326
  271. package/lib/cjs/entities/vaultV1ReallocationData.js +0 -542
  272. package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +0 -78
  273. package/lib/cjs/helpers/computeVaultV1Reallocations.js +0 -243
  274. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +0 -42
  275. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +0 -79
  276. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.d.ts +0 -88
  277. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +0 -147
  278. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +0 -37
  279. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +0 -46
  280. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.d.ts +0 -57
  281. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit2.js +0 -70
  282. package/lib/esm/actions/requirements/generalAdapter/index.d.ts +0 -3
  283. package/lib/esm/actions/requirements/generalAdapter/index.js +0 -3
  284. package/lib/esm/actions/signatures/getBlueAuthorizationAction.d.ts +0 -29
  285. package/lib/esm/actions/signatures/getBlueAuthorizationAction.js +0 -44
  286. package/lib/esm/actions/signatures/getTokenRequirementActions.d.ts +0 -58
  287. package/lib/esm/actions/signatures/getTokenRequirementActions.js +0 -115
  288. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +0 -44
  289. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +0 -39
  290. package/lib/esm/actions/signatures/index.d.ts +0 -3
  291. package/lib/esm/actions/signatures/index.js +0 -3
  292. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +0 -8
  293. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +0 -5
  294. package/lib/esm/bundler/actions.d.ts +0 -797
  295. package/lib/esm/bundler/actions.js +0 -1368
  296. package/lib/esm/bundler/index.d.ts +0 -2
  297. package/lib/esm/bundler/index.js +0 -2
  298. package/lib/esm/bundler/types.d.ts +0 -235
  299. package/lib/esm/bundler/types.js +0 -1
  300. package/lib/esm/entities/vaultV1ReallocationData.d.ts +0 -326
  301. package/lib/esm/entities/vaultV1ReallocationData.js +0 -544
  302. package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +0 -78
  303. package/lib/esm/helpers/computeVaultV1Reallocations.js +0 -239
  304. /package/lib/cjs/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.d.ts +0 -0
  305. /package/lib/esm/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import { type MarketId, UnknownDataError } from "@morpho-org/blue-sdk";
2
- import type { Address, Hash } from "viem";
2
+ import type { Address, Hash, Hex } from "viem";
3
3
  /**
4
4
  * Thrown when a morpho-sdk input that must be non-negative is negative.
5
5
  *
@@ -78,8 +78,23 @@ export declare class ExpiredDeadlineError extends Error {
78
78
  */
79
79
  constructor(deadline: bigint, timestamp: bigint);
80
80
  }
81
- /** Thrown when Vault V2 in-kind redemption is attempted with anything other than one adapter. */
82
- export declare class InKindRedeemRequiresSingleAdapterError extends Error {
81
+ /**
82
+ * Thrown when a VaultExitBundlesV1 Vault V2 exit targets a vault without exactly one adapter.
83
+ *
84
+ * Both `vaultExitBundlesV1InKindRedemptionVaultV2` and
85
+ * `vaultExitBundlesV1ForceWithdrawVaultV2` require `adaptersLength() == 1`.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * import { VaultV2SingleAdapterRequiredError } from "@morpho-org/morpho-sdk";
90
+ *
91
+ * const error = new VaultV2SingleAdapterRequiredError(vault, 2);
92
+ * if (error instanceof VaultV2SingleAdapterRequiredError) {
93
+ * console.error(error.vault, error.adapters);
94
+ * }
95
+ * ```
96
+ */
97
+ export declare class VaultV2SingleAdapterRequiredError extends Error {
83
98
  readonly vault: Address;
84
99
  readonly adapters: number;
85
100
  /**
@@ -98,14 +113,310 @@ export declare class AdapterNotPartOfVaultError extends Error {
98
113
  */
99
114
  constructor(vault: Address, adapter: Address);
100
115
  }
101
- /** Thrown when the Vault V2 adapter cannot expose MorphoMarketV1AdapterV2 market shares. */
102
- export declare class UnsupportedInKindAdapterError extends Error {
116
+ /**
117
+ * Thrown when the Vault V2 adapter cannot expose MorphoMarketV1AdapterV2 market shares.
118
+ *
119
+ * VaultExitBundlesV1 casts the adapter to `IMorphoMarketV1AdapterV2`, so a legacy
120
+ * positions-based `MorphoMarketV1Adapter` or a `MorphoVaultV1Adapter` cannot be exited.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * import { VaultV2UnsupportedExitAdapterError } from "@morpho-org/morpho-sdk";
125
+ *
126
+ * const error = new VaultV2UnsupportedExitAdapterError(adapter);
127
+ * if (error instanceof VaultV2UnsupportedExitAdapterError) {
128
+ * console.error(error.adapter);
129
+ * }
130
+ * ```
131
+ */
132
+ export declare class VaultV2UnsupportedExitAdapterError extends Error {
103
133
  readonly adapter: Address;
104
134
  /**
105
135
  * @param adapter - Unsupported Vault V2 adapter address.
106
136
  */
107
137
  constructor(adapter: Address);
108
138
  }
139
+ /**
140
+ * Thrown when a Vault V2 exit cannot resolve the vault's configured liquidity adapter.
141
+ *
142
+ * `VaultExitBundlesV1.vaultExitBundlesV1ForceWithdrawVaultV2` casts `liquidityAdapter` to
143
+ * `IMorphoMarketV1AdapterV2` and ABI-decodes `liquidityData` as `MarketParams`. Because the exit
144
+ * also requires `adaptersLength() == 1`, the only resolvable configurations are an unset
145
+ * liquidity adapter or the vault's sole adapter.
146
+ *
147
+ * @example
148
+ * ```ts
149
+ * import { VaultV2UnsupportedLiquidityAdapterError } from "@morpho-org/morpho-sdk";
150
+ *
151
+ * const error = new VaultV2UnsupportedLiquidityAdapterError({
152
+ * vault,
153
+ * liquidityAdapter,
154
+ * adapter,
155
+ * });
156
+ * if (error instanceof VaultV2UnsupportedLiquidityAdapterError) {
157
+ * console.error(error.liquidityAdapter, error.adapter);
158
+ * }
159
+ * ```
160
+ */
161
+ export declare class VaultV2UnsupportedLiquidityAdapterError extends Error {
162
+ /** Vault V2 address. */
163
+ readonly vault: Address;
164
+ /** Liquidity adapter configured on the vault. */
165
+ readonly liquidityAdapter: Address;
166
+ /** Sole adapter the exit targets. */
167
+ readonly adapter: Address;
168
+ /**
169
+ * @param params - Liquidity-adapter mismatch details.
170
+ * @param params.vault - Vault V2 address.
171
+ * @param params.liquidityAdapter - Liquidity adapter configured on the vault.
172
+ * @param params.adapter - Sole adapter the exit targets.
173
+ */
174
+ constructor(params: {
175
+ readonly vault: Address;
176
+ readonly liquidityAdapter: Address;
177
+ readonly adapter: Address;
178
+ });
179
+ }
180
+ /**
181
+ * Thrown when a Vault V2 exit cannot ABI-decode the vault's `liquidityData` as `MarketParams`.
182
+ *
183
+ * Distinct from {@link VaultV2UnsupportedLiquidityAdapterError}: the liquidity adapter *is* the
184
+ * vault's sole adapter, but the market params stored alongside it are unusable, so the contract's
185
+ * `abi.decode` would revert. Only the vault curator can repair this by re-setting the liquidity
186
+ * adapter and data.
187
+ *
188
+ * @example
189
+ * ```ts
190
+ * import { VaultV2UndecodableLiquidityDataError } from "@morpho-org/morpho-sdk";
191
+ *
192
+ * try {
193
+ * vault.forceWithdraw({ exitAssets: 1_000_000n, vaultData, userAddress });
194
+ * } catch (error) {
195
+ * if (error instanceof VaultV2UndecodableLiquidityDataError) {
196
+ * console.error(error.liquidityData, error.cause);
197
+ * }
198
+ * }
199
+ * ```
200
+ */
201
+ export declare class VaultV2UndecodableLiquidityDataError extends Error {
202
+ /** Vault V2 address. */
203
+ readonly vault: Address;
204
+ /** Liquidity adapter configured on the vault. */
205
+ readonly liquidityAdapter: Address;
206
+ /** Raw `liquidityData` that failed to decode. */
207
+ readonly liquidityData: Hex;
208
+ /**
209
+ * @param params - Undecodable liquidity-data details.
210
+ * @param params.vault - Vault V2 address.
211
+ * @param params.liquidityAdapter - Liquidity adapter configured on the vault.
212
+ * @param params.liquidityData - Raw `liquidityData` that failed to decode.
213
+ * @param params.cause - Underlying decode failure.
214
+ */
215
+ constructor(params: {
216
+ readonly vault: Address;
217
+ readonly liquidityAdapter: Address;
218
+ readonly liquidityData: Hex;
219
+ readonly cause?: unknown;
220
+ });
221
+ }
222
+ /**
223
+ * Thrown when the adapter's markets cannot cover a Vault V2 force withdrawal.
224
+ *
225
+ * `vaultExitBundlesV1ForceWithdrawVaultV2` loops over the adapter's market list without a bound,
226
+ * so an under-covered request reverts on-chain with a raw `panic 0x32`. This error surfaces that
227
+ * failure before submission.
228
+ *
229
+ * @example
230
+ * ```ts
231
+ * import { VaultV2ForceWithdrawCoverageError } from "@morpho-org/morpho-sdk";
232
+ *
233
+ * const error = new VaultV2ForceWithdrawCoverageError({
234
+ * required: 100n,
235
+ * covered: 40n,
236
+ * maxExitAssets: 60n,
237
+ * });
238
+ * if (error instanceof VaultV2ForceWithdrawCoverageError) {
239
+ * console.error(error.maxExitAssets);
240
+ * }
241
+ * ```
242
+ */
243
+ export declare class VaultV2ForceWithdrawCoverageError extends Error {
244
+ /** Assets that must be force-deallocated from the adapter's markets. */
245
+ readonly required: bigint;
246
+ /** Assets the adapter's markets can actually release. */
247
+ readonly covered: bigint;
248
+ /** Largest penalty-inclusive `exitAssets` the current vault state supports. */
249
+ readonly maxExitAssets: bigint;
250
+ /**
251
+ * @param params - Coverage values used to explain the rejected exit.
252
+ * @param params.required - Assets that must be force-deallocated.
253
+ * @param params.covered - Assets the adapter's markets can release.
254
+ * @param params.maxExitAssets - Largest supported penalty-inclusive `exitAssets`.
255
+ */
256
+ constructor(params: {
257
+ readonly required: bigint;
258
+ readonly covered: bigint;
259
+ readonly maxExitAssets: bigint;
260
+ });
261
+ }
262
+ /**
263
+ * Thrown when a Vault V2 force withdrawal would withdraw nothing while still consuming its permit.
264
+ *
265
+ * Happens on a dust `exitAssets` when the vault has no penalty-free liquidity and the
266
+ * penalty-adjusted remainder rounds down to zero.
267
+ *
268
+ * @example
269
+ * ```ts
270
+ * import { VaultV2ForceWithdrawZeroWithdrawalError } from "@morpho-org/morpho-sdk";
271
+ *
272
+ * const error = new VaultV2ForceWithdrawZeroWithdrawalError({
273
+ * vault,
274
+ * exitAssets: 1n,
275
+ * penalty: 20_000000000000000n,
276
+ * });
277
+ * if (error instanceof VaultV2ForceWithdrawZeroWithdrawalError) {
278
+ * console.error(error.exitAssets, error.penalty);
279
+ * }
280
+ * ```
281
+ */
282
+ export declare class VaultV2ForceWithdrawZeroWithdrawalError extends Error {
283
+ /** Vault V2 address. */
284
+ readonly vault: Address;
285
+ /** Positive penalty-inclusive amount requested by the caller. */
286
+ readonly exitAssets: bigint;
287
+ /** WAD-scaled force-deallocation penalty applied by the adapter. */
288
+ readonly penalty: bigint;
289
+ /**
290
+ * @param params - Values that caused the exit to withdraw nothing.
291
+ * @param params.vault - Vault V2 address.
292
+ * @param params.exitAssets - Positive penalty-inclusive amount requested by the caller.
293
+ * @param params.penalty - WAD-scaled force-deallocation penalty applied by the adapter.
294
+ */
295
+ constructor(params: {
296
+ readonly vault: Address;
297
+ readonly exitAssets: bigint;
298
+ readonly penalty: bigint;
299
+ });
300
+ }
301
+ /**
302
+ * Thrown when a Vault V2 force withdrawal's derived share-price floor rounds down to zero.
303
+ *
304
+ * VaultExitBundlesV1 reads `minSharePriceE27 == 0` as "no bound at all", so emitting a rounded-down
305
+ * zero would silently ship an exit with none of the slippage protection this path exists to add.
306
+ * Reaching it means the exit burns more shares than `withdrawnAssets` can price at RAY scale — a
307
+ * vault whose share price has collapsed below `1e-27` assets per share, or a dust exit against one.
308
+ *
309
+ * @example
310
+ * ```ts
311
+ * import { VaultV2ForceWithdrawZeroSharePriceError } from "@morpho-org/morpho-sdk";
312
+ *
313
+ * try {
314
+ * vault.forceWithdraw({ exitAssets, vaultData, userAddress });
315
+ * } catch (error) {
316
+ * if (error instanceof VaultV2ForceWithdrawZeroSharePriceError) {
317
+ * console.error(error.withdrawnAssets, error.sharesBurnt);
318
+ * }
319
+ * }
320
+ * ```
321
+ */
322
+ export declare class VaultV2ForceWithdrawZeroSharePriceError extends Error {
323
+ /** Assets the exit withdraws in total, before the referral fee. */
324
+ readonly withdrawnAssets: bigint;
325
+ /** Upper bound of the vault shares the exit burns. */
326
+ readonly sharesBurnt: bigint;
327
+ /** WAD-scaled slippage tolerance applied to the floor. */
328
+ readonly slippageTolerance: bigint;
329
+ /**
330
+ * @param params - Values whose ratio rounded down to a zero share-price floor.
331
+ * @param params.withdrawnAssets - Assets the exit withdraws in total, before the referral fee.
332
+ * @param params.sharesBurnt - Upper bound of the vault shares the exit burns.
333
+ * @param params.slippageTolerance - WAD-scaled slippage tolerance applied to the floor.
334
+ */
335
+ constructor(params: {
336
+ readonly withdrawnAssets: bigint;
337
+ readonly sharesBurnt: bigint;
338
+ readonly slippageTolerance: bigint;
339
+ });
340
+ }
341
+ /**
342
+ * Thrown when a supplied force-withdraw share-price floor is below the SDK safety floor.
343
+ *
344
+ * An override below the floor derived at `MAX_SLIPPAGE_TOLERANCE` would weaken the on-chain
345
+ * share-price protection and let the required share allowance grow without bound, so the entity
346
+ * rejects it instead of encoding it.
347
+ *
348
+ * @example
349
+ * ```ts
350
+ * import { VaultV2ForceWithdrawSharePriceBelowFloorError } from "@morpho-org/morpho-sdk";
351
+ *
352
+ * try {
353
+ * vault.forceWithdraw({ exitAssets, vaultData, userAddress, minSharePriceE27 });
354
+ * } catch (error) {
355
+ * if (error instanceof VaultV2ForceWithdrawSharePriceBelowFloorError) {
356
+ * console.error(error.minSharePriceE27, error.floorE27);
357
+ * }
358
+ * }
359
+ * ```
360
+ */
361
+ export declare class VaultV2ForceWithdrawSharePriceBelowFloorError extends Error {
362
+ /** Supplied force-withdraw share-price floor. */
363
+ readonly minSharePriceE27: bigint;
364
+ /** Minimum share-price floor allowed at maximum SDK slippage tolerance. */
365
+ readonly floorE27: bigint;
366
+ /**
367
+ * @param params - Supplied and minimum allowed share-price floors.
368
+ * @param params.minSharePriceE27 - Supplied force-withdraw share-price floor.
369
+ * @param params.floorE27 - Minimum floor derived at maximum SDK slippage tolerance.
370
+ */
371
+ constructor(params: {
372
+ readonly minSharePriceE27: bigint;
373
+ readonly floorE27: bigint;
374
+ });
375
+ }
376
+ /**
377
+ * Thrown when fee shares projected to the accepted deadline reach the lower force-withdraw
378
+ * burn bound at that time.
379
+ *
380
+ * VaultExitBundlesV1 measures shares burned after its first withdrawal accrues fees. If the
381
+ * recipient's fee shares are at least the measured burn bound, its share-price check is skipped or
382
+ * reverts due to an underflow.
383
+ *
384
+ * @example
385
+ * ```ts
386
+ * import { VaultV2ForceWithdrawFeeSharesExceedBurnError } from "@morpho-org/morpho-sdk";
387
+ *
388
+ * try {
389
+ * vault.forceWithdraw({ exitAssets, vaultData, userAddress });
390
+ * } catch (error) {
391
+ * if (error instanceof VaultV2ForceWithdrawFeeSharesExceedBurnError) {
392
+ * console.error(error.sharesBurnt, error.feeShares);
393
+ * }
394
+ * }
395
+ * ```
396
+ */
397
+ export declare class VaultV2ForceWithdrawFeeSharesExceedBurnError extends Error {
398
+ /** Vault V2 address being exited. */
399
+ readonly vault: Address;
400
+ /** Fee-recipient account submitting the exit. */
401
+ readonly userAddress: Address;
402
+ /** Lower bound of shares measured as burned by VaultExitBundlesV1. */
403
+ readonly sharesBurnt: bigint;
404
+ /** Fee shares projected for `userAddress` at the accepted deadline. */
405
+ readonly feeShares: bigint;
406
+ /**
407
+ * @param params - Fee-share and burn-bound values that make the exit unsafe.
408
+ * @param params.vault - Vault V2 address being exited.
409
+ * @param params.userAddress - Fee-recipient account submitting the exit.
410
+ * @param params.sharesBurnt - Lower bound of shares measured as burned by VaultExitBundlesV1.
411
+ * @param params.feeShares - Fee shares projected for `userAddress` at the accepted deadline.
412
+ */
413
+ constructor(params: {
414
+ readonly vault: Address;
415
+ readonly userAddress: Address;
416
+ readonly sharesBurnt: bigint;
417
+ readonly feeShares: bigint;
418
+ });
419
+ }
109
420
  /** Thrown when a Vault V2 in-kind redemption rounds to no deallocated assets. */
110
421
  export declare class InKindRedeemZeroDeallocationError extends Error {
111
422
  /**
@@ -203,19 +514,6 @@ export declare class BundlesPermitMismatchError extends Error {
203
514
  readonly cause?: unknown;
204
515
  });
205
516
  }
206
- /**
207
- * Thrown by the deprecated VaultExitBundlesV1 permit compatibility helper.
208
- *
209
- * @deprecated Use {@link BundlesPermitMismatchError} with `getBundlesSharesPermit`.
210
- */
211
- export declare class VaultExitBundlesV1PermitMismatchError extends BundlesPermitMismatchError {
212
- constructor(params: {
213
- readonly field: "type" | "asset" | "owner" | "spender" | "amount" | "nonce" | "deadline" | "signature";
214
- readonly expected: string;
215
- readonly actual: string;
216
- readonly cause?: unknown;
217
- });
218
- }
219
517
  /** Thrown when a signed requirement cannot be safely encoded for a fixed bundles call. */
220
518
  export declare class BundlesRequirementSignatureMismatchError extends Error {
221
519
  /** Field whose signed value or encoding is invalid for the fixed bundles call. */
@@ -238,14 +536,6 @@ export declare class BundlesRequirementSignatureMismatchError extends Error {
238
536
  cause?: unknown;
239
537
  });
240
538
  }
241
- /** @deprecated Use {@link BundlesRequirementSignatureMismatchError}. */
242
- export { BundlesRequirementSignatureMismatchError as BlueBundlesV1RequirementSignatureMismatchError, };
243
- /** Thrown when Permit2 SignatureTransfer is selected without an explicit unordered nonce. */
244
- export declare class MissingPermit2SignatureTransferNonceError extends Error {
245
- constructor();
246
- }
247
- /** @deprecated Use {@link MissingPermit2SignatureTransferNonceError}. */
248
- export { MissingPermit2SignatureTransferNonceError as MissingPermit2TransferFromNonceError, };
249
539
  /** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
250
540
  export declare class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
251
541
  readonly owner: Address;
@@ -266,8 +556,6 @@ export declare class NoUnusedPermit2NonceError extends Error {
266
556
  */
267
557
  constructor(owner: Address, startNonce: bigint);
268
558
  }
269
- /** @deprecated Use {@link Permit2SignatureTransferNonceAlreadyUsedError}. */
270
- export { Permit2SignatureTransferNonceAlreadyUsedError as Permit2TransferFromNonceAlreadyUsedError, };
271
559
  /** Thrown when native funding does not exactly match the contract's gross token pull. */
272
560
  export declare class NativeFundingAmountMismatchError extends Error {
273
561
  readonly nativeAmount: bigint;
@@ -282,10 +570,6 @@ export declare class NativeFundingAmountMismatchError extends Error {
282
570
  export declare class ReferralFeeRecipientMissingError extends Error {
283
571
  constructor();
284
572
  }
285
- /** @deprecated Use {@link ReferralFeeRecipientMissingError}. */
286
- export declare const MissingReferralFeeRecipientError: typeof ReferralFeeRecipientMissingError;
287
- /** @deprecated Use {@link ReferralFeeRecipientMissingError}. */
288
- export type MissingReferralFeeRecipientError = ReferralFeeRecipientMissingError;
289
573
  /**
290
574
  * Thrown when a referral fee percentage is outside the contract's `[0, WAD)` range.
291
575
  *
@@ -322,9 +606,7 @@ export declare class ReallocationLoanTokenMismatchError extends Error {
322
606
  constructor(expected: Address, actual: Address);
323
607
  }
324
608
  /**
325
- * Thrown when a Blue authorization operator is not one of the chain's registered Morpho operators
326
- * (GeneralAdapter1 or BlueBundlesV1). Guards the exported authorization builder so a misconfigured
327
- * `authorized` cannot grant an arbitrary address control over the user's Morpho positions.
609
+ * Thrown when a Blue authorization operator is not the chain's registered BlueBundlesV1 contract.
328
610
  */
329
611
  export declare class UnsupportedAuthorizationOperatorError extends Error {
330
612
  readonly authorized: Address;
@@ -349,177 +631,6 @@ export declare class MaxRepayAssetsBelowRepayAssetsError extends Error {
349
631
  */
350
632
  constructor(maxRepayAssets: bigint, repayAssets: bigint);
351
633
  }
352
- /** @deprecated Use {@link NonPositiveInputError}. */
353
- export declare const NonPositiveAssetAmountError: typeof NonPositiveInputError;
354
- /** @deprecated Use {@link NonPositiveInputError}. */
355
- export type NonPositiveAssetAmountError = NonPositiveInputError;
356
- /** @deprecated Use {@link NonPositiveInputError}. */
357
- export declare const NonPositiveSharesAmountError: typeof NonPositiveInputError;
358
- /** @deprecated Use {@link NonPositiveInputError}. */
359
- export type NonPositiveSharesAmountError = NonPositiveInputError;
360
- /** @deprecated Use {@link NonPositiveInputError}. */
361
- export declare const NonPositiveMaxSharePriceError: typeof NonPositiveInputError;
362
- /** @deprecated Use {@link NonPositiveInputError}. */
363
- export type NonPositiveMaxSharePriceError = NonPositiveInputError;
364
- /** @deprecated Use {@link NonPositiveInputError}. */
365
- export declare const ZeroDepositAmountError: typeof NonPositiveInputError;
366
- /** @deprecated Use {@link NonPositiveInputError}. */
367
- export type ZeroDepositAmountError = NonPositiveInputError;
368
- /** @deprecated Use {@link NonPositiveInputError}. */
369
- export declare const NonPositiveBorrowAmountError: typeof NonPositiveInputError;
370
- /** @deprecated Use {@link NonPositiveInputError}. */
371
- export type NonPositiveBorrowAmountError = NonPositiveInputError;
372
- /** @deprecated Use {@link NonPositiveInputError}. */
373
- export declare const ZeroCollateralAmountError: typeof NonPositiveInputError;
374
- /** @deprecated Use {@link NonPositiveInputError}. */
375
- export type ZeroCollateralAmountError = NonPositiveInputError;
376
- /** @deprecated Use {@link NonPositiveInputError}. */
377
- export declare const NonPositiveReallocationAmountError: typeof NonPositiveInputError;
378
- /** @deprecated Use {@link NonPositiveInputError}. */
379
- export type NonPositiveReallocationAmountError = NonPositiveInputError;
380
- /** @deprecated Use {@link NonPositiveInputError}. */
381
- export declare const NonPositiveRepayAmountError: typeof NonPositiveInputError;
382
- /** @deprecated Use {@link NonPositiveInputError}. */
383
- export type NonPositiveRepayAmountError = NonPositiveInputError;
384
- /** @deprecated Use {@link NonPositiveInputError}. */
385
- export declare const NonPositiveRepayMaxSharePriceError: typeof NonPositiveInputError;
386
- /** @deprecated Use {@link NonPositiveInputError}. */
387
- export type NonPositiveRepayMaxSharePriceError = NonPositiveInputError;
388
- /** @deprecated Use {@link NonPositiveInputError}. */
389
- export declare const NonPositiveWithdrawCollateralAmountError: typeof NonPositiveInputError;
390
- /** @deprecated Use {@link NonPositiveInputError}. */
391
- export type NonPositiveWithdrawCollateralAmountError = NonPositiveInputError;
392
- /** @deprecated Use {@link NonPositiveInputError}. */
393
- export declare const ZeroSupplyAmountError: typeof NonPositiveInputError;
394
- /** @deprecated Use {@link NonPositiveInputError}. */
395
- export type ZeroSupplyAmountError = NonPositiveInputError;
396
- /** @deprecated Use {@link NonPositiveInputError}. */
397
- export declare const NonPositiveWithdrawAmountError: typeof NonPositiveInputError;
398
- /** @deprecated Use {@link NonPositiveInputError}. */
399
- export type NonPositiveWithdrawAmountError = NonPositiveInputError;
400
- /** @deprecated Use {@link NegativeInputError}. */
401
- export declare const NegativeSlippageToleranceError: typeof NegativeInputError;
402
- /** @deprecated Use {@link NegativeInputError}. */
403
- export type NegativeSlippageToleranceError = NegativeInputError;
404
- /** @deprecated Use {@link NegativeInputError}. */
405
- export declare const NegativeNativeAmountError: typeof NegativeInputError;
406
- /** @deprecated Use {@link NegativeInputError}. */
407
- export type NegativeNativeAmountError = NegativeInputError;
408
- /** @deprecated Use {@link NegativeInputError}. */
409
- export declare const NegativeReallocationFeeError: typeof NegativeInputError;
410
- /** @deprecated Use {@link NegativeInputError}. */
411
- export type NegativeReallocationFeeError = NegativeInputError;
412
- /** @deprecated Use {@link NegativeInputError}. */
413
- export declare const NonPositiveMinBorrowSharePriceError: typeof NegativeInputError;
414
- /** @deprecated Use {@link NegativeInputError}. */
415
- export type NonPositiveMinBorrowSharePriceError = NegativeInputError;
416
- /** @deprecated Use {@link NegativeInputError}. */
417
- export declare const NegativeSupplyAmountError: typeof NegativeInputError;
418
- /** @deprecated Use {@link NegativeInputError}. */
419
- export type NegativeSupplyAmountError = NegativeInputError;
420
- /** @deprecated Use {@link NegativeInputError}. */
421
- export declare const NegativeSupplyMaxSharePriceError: typeof NegativeInputError;
422
- /** @deprecated Use {@link NegativeInputError}. */
423
- export type NegativeSupplyMaxSharePriceError = NegativeInputError;
424
- /** @deprecated Use {@link NegativeInputError}. */
425
- export declare const NegativeWithdrawMinSharePriceError: typeof NegativeInputError;
426
- /** @deprecated Use {@link NegativeInputError}. */
427
- export type NegativeWithdrawMinSharePriceError = NegativeInputError;
428
- /** @deprecated Use {@link NegativeInputError}. */
429
- export declare const NegativeMinSharePriceError: typeof NegativeInputError;
430
- /** @deprecated Use {@link NegativeInputError}. */
431
- export type NegativeMinSharePriceError = NegativeInputError;
432
- /** @deprecated Use {@link NegativeInputError}. */
433
- export declare const NegativeBorrowSharesError: typeof NegativeInputError;
434
- /** @deprecated Use {@link NegativeInputError}. */
435
- export type NegativeBorrowSharesError = NegativeInputError;
436
- /** @deprecated Use {@link NegativeInputError}. */
437
- export declare const NegativeMaxRepaySharePriceError: typeof NegativeInputError;
438
- /** @deprecated Use {@link NegativeInputError}. */
439
- export type NegativeMaxRepaySharePriceError = NegativeInputError;
440
- /**
441
- * Typed errors thrown while encoding supported Bundler3 actions.
442
- *
443
- * @remarks
444
- * Import these classes through `@morpho-org/morpho-sdk` when handling
445
- * failures from `BundlerAction`.
446
- */
447
- export declare namespace BundlerErrors {
448
- /**
449
- * Thrown when an action that requires an offchain signature is encoded before
450
- * the signature has been attached.
451
- *
452
- * @example
453
- * ```ts
454
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
455
- *
456
- * if (error instanceof BundlerErrors.MissingSignature) {
457
- * // Attach the missing permit or Permit2 signature, then encode again.
458
- * }
459
- * ```
460
- */
461
- class MissingSignature extends Error {
462
- constructor();
463
- }
464
- /**
465
- * Thrown when an action is unsupported on the requested chain.
466
- *
467
- * @example
468
- * ```ts
469
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
470
- *
471
- * if (error instanceof BundlerErrors.UnexpectedAction) {
472
- * // Remove or replace the action for the selected chain.
473
- * }
474
- * ```
475
- */
476
- class UnexpectedAction extends Error {
477
- /**
478
- * @param type - Unsupported Bundler3 action discriminator or name.
479
- * @param chainId - Chain where the action was requested.
480
- */
481
- constructor(type: string, chainId: number);
482
- }
483
- /**
484
- * Thrown when a Morpho authorization signature names a forbidden `authorized` account
485
- * (for example Bundler3 itself), which would grant operator rights to an unintended address.
486
- *
487
- * @example
488
- * ```ts
489
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
490
- *
491
- * if (error instanceof BundlerErrors.UnexpectedSignature) {
492
- * // Re-sign the authorization targeting GeneralAdapter1.
493
- * }
494
- * ```
495
- */
496
- class UnexpectedSignature extends Error {
497
- /**
498
- * @param authorized - The forbidden `authorized` address carried by the signature.
499
- */
500
- constructor(authorized: Address);
501
- }
502
- /**
503
- * Thrown when a skippable Blue Public Allocator call would leave a usable
504
- * token allowance behind after the allocator call reverts.
505
- *
506
- * @example
507
- * ```ts
508
- * import { BundlerErrors } from "@morpho-org/morpho-sdk";
509
- *
510
- * if (error instanceof BundlerErrors.SkippableAllocatorPenalty) {
511
- * // Rebuild the allocator call with skipRevert set to false.
512
- * }
513
- * ```
514
- */
515
- class SkippableAllocatorPenalty extends Error {
516
- readonly penaltyAssets: bigint;
517
- /**
518
- * @param penaltyAssets - Exact token amount approved to the allocator.
519
- */
520
- constructor(penaltyAssets: bigint);
521
- }
522
- }
523
634
  /** Requirement signature kind accepted by action-output transaction builders. */
524
635
  export type RequirementSignatureKind = "permit" | "permit2SignatureTransfer" | "authorization" | "midnightOfferRootSignature";
525
636
  /**
@@ -563,6 +674,14 @@ export declare class UnexpectedRequirementSignatureError extends Error {
563
674
  */
564
675
  constructor(kind: RequirementSignatureKind);
565
676
  }
677
+ /** Thrown when `buildTx` receives a requirement signature whose action type is not supported. */
678
+ export declare class UnsupportedRequirementSignatureError extends Error {
679
+ readonly type: string;
680
+ /**
681
+ * @param type - The unsupported signature action type.
682
+ */
683
+ constructor(type: string);
684
+ }
566
685
  /** Thrown when a viem client's account address does not match the address required by the call. */
567
686
  export declare class AddressMismatchError extends Error {
568
687
  constructor(clientAddress: Address, argsAddress: Address);
@@ -588,7 +707,6 @@ export declare class UnsupportedErc20ApprovalSpenderError extends Error {
588
707
  constructor(params: {
589
708
  readonly spender: Address;
590
709
  readonly chainId: number;
591
- readonly generalAdapter1: Address;
592
710
  readonly permit2?: Address;
593
711
  readonly midnight?: Address;
594
712
  readonly midnightBundles?: Address;
@@ -631,10 +749,6 @@ export declare class DepositOwnerMismatchError extends Error {
631
749
  export declare class DepositSpenderMismatchError extends Error {
632
750
  constructor(depositSpender: Address, signatureSpender: Address);
633
751
  }
634
- /** Thrown when a `permit2` requirement signature is missing the `expiration` field. */
635
- export declare class Permit2ExpirationMissingError extends Error {
636
- constructor();
637
- }
638
752
  /** Thrown when a vault deposit uses `nativeAmount` but the vault asset is not the chain's wNative. */
639
753
  export declare class NativeAmountOnNonWNativeVaultError extends Error {
640
754
  constructor(vaultAsset: Address, wNative: Address);
@@ -651,9 +765,6 @@ export declare class VaultAddressMismatchError extends Error {
651
765
  export declare class NativeAmountOnNonWNativeAssetError extends Error {
652
766
  constructor(asset: Address, wNative: Address);
653
767
  }
654
- /** @deprecated Use {@link NativeAmountOnNonWNativeAssetError}. */
655
- export declare const NativeAmountOnNonWNativeCollateralError: typeof NativeAmountOnNonWNativeAssetError;
656
- export type NativeAmountOnNonWNativeCollateralError = NativeAmountOnNonWNativeAssetError;
657
768
  /** Thrown when a borrow exceeds the LLTV-buffered safe maximum for the position. */
658
769
  export declare class BorrowExceedsSafeLtvError extends Error {
659
770
  constructor(borrowAmount: bigint, maxSafeBorrow: bigint);
@@ -670,14 +781,6 @@ export declare class MarketIdMismatchError extends Error {
670
781
  export declare class AccrualPositionUserMismatchError extends Error {
671
782
  constructor(positionUser: string, expectedUser: string);
672
783
  }
673
- /**
674
- * Thrown when a reallocation has no withdrawals.
675
- *
676
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
677
- */
678
- export declare class EmptyReallocationWithdrawalsError extends Error {
679
- constructor(vault: string);
680
- }
681
784
  /** Thrown when a Public Allocator source references the target Blue market. */
682
785
  export declare class ReallocationWithdrawalOnTargetMarketError extends Error {
683
786
  constructor(vault: string, marketId: string);
@@ -689,27 +792,12 @@ export declare class ReallocationWithdrawalOnTargetMarketError extends Error {
689
792
  *
690
793
  * @example
691
794
  * ```ts
692
- * import { InvalidReallocationShapeError } from "@morpho-org/morpho-sdk";
693
- *
694
- * const error = new InvalidReallocationShapeError();
695
- * ```
696
- */
697
- export declare class InvalidReallocationShapeError extends Error {
698
- constructor();
699
- }
700
- /**
701
- * Thrown when one reallocation plan contains both Vault V1 and Vault V2 entries.
702
- *
703
- * @deprecated Vault V1/V2 mixed-plan support will be removed in the next major. Use Vault V2
704
- * reallocations.
705
- * @example
706
- * ```ts
707
- * import { MixedReallocationVersionsError } from "@morpho-org/morpho-sdk";
795
+ * import { InvalidVaultV2BlueReallocationShapeError } from "@morpho-org/morpho-sdk";
708
796
  *
709
- * const error = new MixedReallocationVersionsError();
797
+ * const error = new InvalidVaultV2BlueReallocationShapeError();
710
798
  * ```
711
799
  */
712
- export declare class MixedReallocationVersionsError extends Error {
800
+ export declare class InvalidVaultV2BlueReallocationShapeError extends Error {
713
801
  constructor();
714
802
  }
715
803
  /**
@@ -790,26 +878,6 @@ export declare class InconsistentReallocationPenaltyError extends Error {
790
878
  readonly actual: bigint;
791
879
  });
792
880
  }
793
- /**
794
- * Thrown when reallocation withdrawals within a vault are not strictly sorted by market id.
795
- *
796
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
797
- */
798
- export declare class UnsortedReallocationWithdrawalsError extends Error {
799
- constructor(vault: string, marketId: string);
800
- }
801
- /**
802
- * Thrown when a market repay in assets mode has `transferAmount !== amount + nativeAmount` — the
803
- * pre-resolved ERC-20 pull plus the wrapped native must equal the assets repaid, so the bundle
804
- * neither strands over-pulled loan tokens on `GeneralAdapter1` nor under-funds the repay.
805
- */
806
- export declare class TransferAmountNotEqualToAssetsError extends Error {
807
- constructor(params: {
808
- transferAmount: bigint;
809
- assets: bigint;
810
- market: string;
811
- });
812
- }
813
881
  /** Thrown when a market repay specifies both `assets` and `shares` as non-zero (modes are mutually exclusive). */
814
882
  export declare class MutuallyExclusiveRepayAmountsError extends Error {
815
883
  constructor(market: string);
@@ -830,10 +898,6 @@ export declare class WithdrawMakesPositionUnhealthyError extends Error {
830
898
  maxSafeBorrow: bigint;
831
899
  });
832
900
  }
833
- /** Thrown when a share-amount conversion would divide by zero (the market has no shares of the relevant kind). */
834
- export declare class ShareDivideByZeroError extends Error {
835
- constructor(market: string);
836
- }
837
901
  /** Thrown when a repay amount in assets exceeds the borrower's outstanding debt. */
838
902
  export declare class RepayExceedsDebtError extends Error {
839
903
  constructor(params: {
@@ -855,25 +919,7 @@ export declare class RepaySharesExceedDebtError extends Error {
855
919
  });
856
920
  }
857
921
  /**
858
- * Thrown when a vault selected for reallocation has no configured `PublicAllocator`.
859
- *
860
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
861
- */
862
- export declare class MissingPublicAllocatorConfigError extends Error {
863
- constructor(vault: string);
864
- }
865
- /**
866
- * Thrown when a reallocation attempts to use a disabled vault market.
867
- *
868
- * @deprecated Vault V1 PublicAllocator support will be removed in the next major.
869
- */
870
- export declare class DisabledReallocationMarketError extends Error {
871
- readonly vault: Address;
872
- readonly marketId: MarketId;
873
- constructor(vault: Address, marketId: MarketId);
874
- }
875
- /**
876
- * Thrown when shared liquidity selected by a Vault V1 or Vault V2 reallocation planner cannot
922
+ * Thrown when shared liquidity selected by a Vault V2 reallocation planner cannot
877
923
  * cover the operation's absolute shortfall on the target market — the resulting
878
924
  * `morphoBorrow` or `morphoWithdraw` would still revert onchain.
879
925
  *
@@ -907,34 +953,6 @@ export declare class UnknownReallocationVaultError extends UnknownDataError {
907
953
  */
908
954
  constructor(vault: Address);
909
955
  }
910
- /**
911
- * Thrown when reallocation state does not contain a requested vault-market config.
912
- *
913
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major.
914
- */
915
- export declare class UnknownReallocationVaultMarketConfigError extends UnknownDataError {
916
- readonly vault: Address;
917
- readonly marketId: MarketId;
918
- /**
919
- * @param vault - Vault address for the missing config.
920
- * @param marketId - Market id for the missing config.
921
- */
922
- constructor(vault: Address, marketId: MarketId);
923
- }
924
- /**
925
- * Thrown when reallocation state does not contain a requested market position.
926
- *
927
- * @deprecated Vault V1 shared-liquidity planning will be removed in the next major.
928
- */
929
- export declare class UnknownReallocationPositionError extends UnknownDataError {
930
- readonly user: Address;
931
- readonly marketId: MarketId;
932
- /**
933
- * @param user - Position owner address.
934
- * @param marketId - Market id for the missing position.
935
- */
936
- constructor(user: Address, marketId: MarketId);
937
- }
938
956
  /** Thrown when Vault V2 reallocation state does not contain a requested allocation id. */
939
957
  export declare class UnknownReallocationAllocationError extends UnknownDataError {
940
958
  readonly vault: Address;
@@ -1116,7 +1134,7 @@ export declare class MidnightOfferRootOfferCountMismatchError extends Error {
1116
1134
  actualOffers: number;
1117
1135
  });
1118
1136
  }
1119
- /** Thrown when a Midnight offer-root signature was not prepared by this maker flow. */
1137
+ /** Thrown when a Midnight offer-root signature carries no encoded payload. */
1120
1138
  export declare class UnpreparedMidnightOfferRootSignatureError extends Error {
1121
1139
  constructor();
1122
1140
  }
@@ -1161,11 +1179,11 @@ export declare class WithdrawSharesExceedSupplyError extends Error {
1161
1179
  });
1162
1180
  }
1163
1181
  /**
1164
- * Thrown when a Vault V1 or Vault V2 reallocation planner receives a withdraw `amount` greater
1182
+ * Thrown when a Vault V2 reallocation planner receives a withdraw `amount` greater
1165
1183
  * than the target market's current `totalSupplyAssets` — the post-withdraw
1166
1184
  * supply would be negative, making the on-chain `morphoWithdraw` revert
1167
1185
  * regardless of any reallocation. Caught here so callers do not pay
1168
- * PublicAllocator fees on an unreachable operation.
1186
+ * allocator penalties on an unreachable operation.
1169
1187
  */
1170
1188
  export declare class ReallocationWithdrawExceedsMarketSupplyError extends Error {
1171
1189
  readonly params: {
@@ -1191,74 +1209,3 @@ export declare class RefinanceSameMarketError extends Error {
1191
1209
  export declare class RefinanceTokenMismatchError extends Error {
1192
1210
  constructor(sourceMarket: string, targetMarket: string);
1193
1211
  }
1194
- /**
1195
- * Thrown when a refinance specifies both `borrowAssets` and `borrowShares` as non-zero (modes are mutually exclusive).
1196
- *
1197
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1198
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1199
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1200
- */
1201
- export declare class BorrowAmountAndSharesExclusiveError extends Error {
1202
- constructor(market: string);
1203
- }
1204
- /**
1205
- * Thrown when a refinance's `collateralAmount` exceeds the source position's available collateral.
1206
- *
1207
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1208
- * partial collateral inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1209
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1210
- */
1211
- export declare class RefinanceExceedsCollateralError extends Error {
1212
- readonly market: string;
1213
- readonly requested: bigint;
1214
- readonly available: bigint;
1215
- constructor(params: {
1216
- market: string;
1217
- requested: bigint;
1218
- available: bigint;
1219
- });
1220
- }
1221
- /**
1222
- * Thrown when a refinance's `borrowShares` exceeds the source position's outstanding borrow shares.
1223
- *
1224
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1225
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1226
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1227
- */
1228
- export declare class RefinanceExceedsBorrowSharesError extends Error {
1229
- readonly market: string;
1230
- readonly requested: bigint;
1231
- readonly available: bigint;
1232
- constructor(params: {
1233
- market: string;
1234
- requested: bigint;
1235
- available: bigint;
1236
- });
1237
- }
1238
- /**
1239
- * Thrown when a refinance's `borrowAssets` exceeds the source position's outstanding debt assets.
1240
- *
1241
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1242
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1243
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1244
- */
1245
- export declare class RefinanceExceedsBorrowAssetsError extends Error {
1246
- readonly market: string;
1247
- readonly requested: bigint;
1248
- readonly available: bigint;
1249
- constructor(params: {
1250
- market: string;
1251
- requested: bigint;
1252
- available: bigint;
1253
- });
1254
- }
1255
- /**
1256
- * Thrown when a refinance in shares mode (`borrowShares > 0n`) omits the `borrowAssets` overshoot for the target borrow leg.
1257
- *
1258
- * @deprecated The BlueBundlesV1 refinance route migrates the full live position and no longer accepts
1259
- * partial borrow inputs, so this error is never thrown by `morpho-sdk` v6. It remains exported as a
1260
- * compatibility shim for consumers pattern-matching on the v5 surface and will be removed in the next major.
1261
- */
1262
- export declare class RefinanceSharesMissingBorrowAssetsError extends Error {
1263
- constructor(market: string);
1264
- }