@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
@@ -38,8 +38,7 @@ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getBund
38
38
  * @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
39
39
  * {@link InputExceedsMaxError}, so either class catches it.
40
40
  * @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
41
- * @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit or a
42
- * Permit2 AllowanceTransfer signature is supplied.
41
+ * @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit.
43
42
  * @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
44
43
  * @throws {DepositOwnerMismatchError} when the signed owner differs from `userAddress`.
45
44
  * @throws {DepositAssetMismatchError} when the signed asset differs from the vault asset.
@@ -1,58 +1,77 @@
1
1
  import { type Address } from "viem";
2
- import { type Deallocation, type Metadata, type Transaction, type VaultV2ForceWithdrawAction } from "../../types/index.js";
2
+ import { type Metadata, type PermitRequirementSignature, type Transaction, type VaultV2ForceWithdrawAction } from "../../types/index.js";
3
3
  /** Parameters for {@link vaultV2ForceWithdraw}. */
4
4
  export interface VaultV2ForceWithdrawParams {
5
- vault: {
6
- address: Address;
5
+ readonly vault: {
6
+ readonly chainId: number;
7
+ readonly address: Address;
7
8
  };
8
- args: {
9
- deallocations: readonly Deallocation[];
10
- withdraw: {
11
- amount: bigint;
12
- recipient: Address;
13
- };
14
- onBehalf: Address;
9
+ readonly args: {
10
+ readonly adapter: Address;
11
+ readonly exitAssets: bigint;
12
+ readonly minSharePriceE27: bigint;
13
+ readonly userAddress: Address;
14
+ readonly deadline: bigint;
15
+ readonly referralFeePct?: bigint;
16
+ readonly referralFeeRecipient?: Address;
17
+ readonly requirementSignature?: PermitRequirementSignature;
15
18
  };
16
- metadata?: Metadata;
19
+ readonly metadata?: Metadata;
17
20
  }
18
21
  /**
19
- * Prepares a force-withdraw transaction for a VaultV2 contract via the vault's native `multicall`.
22
+ * Prepares a Vault V2 force withdrawal through VaultExitBundlesV1.
20
23
  *
21
- * Encodes one or more `forceDeallocate` calls followed by a single `withdraw`, executed
22
- * atomically through VaultV2's `multicall`. Frees liquidity from non-liquidity adapters and
23
- * withdraws the resulting assets in one transaction.
24
+ * The contract first withdraws everything the vault can pay without a penalty — its idle assets
25
+ * plus the liquidity available through its liquidity adapter — then force-deallocates the remainder
26
+ * by looping over the adapter's markets.
24
27
  *
25
- * A penalty is taken from `onBehalf` for each deallocation to discourage allocation
26
- * manipulation. The penalty is applied as a share burn where assets are returned to the vault,
27
- * so the share price stays stable (except for rounding).
28
+ * `exitAssets` is **penalty-inclusive**: it is what the contract debits from the user's position,
29
+ * while the assets actually delivered are
30
+ * `assetsToWithdraw + floor((exitAssets - assetsToWithdraw) * WAD / (WAD + penalty))` minus the
31
+ * referral fee. Use `previewVaultV2ForceWithdraw` to quote the split.
28
32
  *
29
- * @param params.vault.address - The VaultV2 address.
30
- * @param params.args.deallocations - The deallocations to perform before withdrawing. Must be
31
- * non-empty.
32
- * @param params.args.withdraw.amount - Amount of underlying assets to withdraw after the
33
- * deallocations complete.
34
- * @param params.args.withdraw.recipient - Address that receives the withdrawn assets.
35
- * @param params.args.onBehalf - Address whose shares are burned and from which the deallocation
36
- * penalty is taken.
37
- * @param params.metadata - Optional analytics metadata attached to the multicall transaction.
38
- * @returns A deep-frozen `Transaction<VaultV2ForceWithdrawAction>` with `to`, `value`, `data`,
39
- * and the typed `action` discriminator the simulation layer consumes.
40
- * @throws {EmptyDeallocationsError} when `deallocations` is empty.
41
- * @throws {NonPositiveInputError} when `withdraw.amount <= 0n`, or when any
42
- * `deallocations[i].amount <= 0n` (raised by `encodeForceDeallocateCall`).
33
+ * Without a signature this embeds the empty-permit sentinel and requires a sufficient vault-share
34
+ * approval to VaultExitBundlesV1.
35
+ *
36
+ * @param params - Force withdrawal parameters.
37
+ * @param params.vault.chainId - Chain containing the target Vault V2 and VaultExitBundlesV1.
38
+ * @param params.vault.address - Target Vault V2 address.
39
+ * @param params.args.adapter - Vault's sole MorphoMarketV1AdapterV2.
40
+ * @param params.args.exitAssets - Penalty-inclusive, asset-denominated amount to exit.
41
+ * @param params.args.minSharePriceE27 - RAY-scaled lower bound on the realized exit share price
42
+ * (withdrawn assets per share burned). `0n` disables the on-chain bound; prefer the value the
43
+ * entity computes.
44
+ * @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
45
+ * VaultExitBundlesV1 burns `msg.sender`'s vault shares and pays out to `msg.sender`, so the
46
+ * submitting account must equal this address.
47
+ * @param params.args.deadline - Permit and bundle deadline.
48
+ * @param params.args.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
49
+ * `referralFeeRecipient`. Defaults to `0n`. Deducted *after* the `minSharePriceE27` check, so it
50
+ * is outside that bound's protection.
51
+ * @param params.args.referralFeeRecipient - Optional referral fee recipient. Defaults to the zero
52
+ * address, which is only valid alongside a zero `referralFeePct`.
53
+ * @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
54
+ * @param params.metadata - Optional analytics metadata.
55
+ * @returns A deep-frozen `Readonly<Transaction<VaultV2ForceWithdrawAction>>` with `to`, `value`,
56
+ * `data`, and the typed action discriminator.
57
+ * @throws {NonPositiveInputError} when `exitAssets` or `deadline` is not positive.
58
+ * @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
59
+ * @throws {InputExceedsMaxError} when `referralFeePct` is not below WAD (the contract rejects it
60
+ * with `PctExceeded`), or when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
61
+ * @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
62
+ * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
63
+ * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
64
+ * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind,
65
+ * asset, owner, spender, or signature encoding.
43
66
  * @example
44
67
  * ```ts
45
68
  * import { vaultV2ForceWithdraw } from "@morpho-org/morpho-sdk";
46
69
  *
47
70
  * const tx = vaultV2ForceWithdraw({
48
- * vault: { address: vaultAddress },
49
- * args: {
50
- * deallocations: [{ adapter, marketParams, amount: 500_000n }],
51
- * withdraw: { amount: 500_000n, recipient },
52
- * onBehalf,
53
- * },
71
+ * vault: { chainId: 1, address: vault },
72
+ * args: { adapter, exitAssets: 1_000_000n, minSharePriceE27, userAddress, deadline },
54
73
  * });
55
74
  * // tx satisfies Readonly<Transaction<VaultV2ForceWithdrawAction>>
56
75
  * ```
57
76
  */
58
- export declare const vaultV2ForceWithdraw: ({ vault: { address: vaultAddress }, args: { deallocations, withdraw, onBehalf }, metadata, }: VaultV2ForceWithdrawParams) => Readonly<Transaction<VaultV2ForceWithdrawAction>>;
77
+ export declare const vaultV2ForceWithdraw: ({ vault, args, metadata, }: VaultV2ForceWithdrawParams) => Readonly<Transaction<VaultV2ForceWithdrawAction>>;
@@ -1,90 +1,117 @@
1
- import { vaultV2Abi } from "@morpho-org/blue-sdk-viem";
2
- import { deepFreeze } from "@morpho-org/morpho-ts";
1
+ import { deepFreeze, getChainAddress } from "@morpho-org/morpho-ts";
3
2
  import { encodeFunctionData } from "viem";
4
- import { encodeForceDeallocateCall } from "../../helpers/encodeDeallocation.js";
3
+ import { vaultExitBundlesV1Abi } from "../../abis.js";
5
4
  import { addTransactionMetadata } from "../../helpers/index.js";
6
- import { EmptyDeallocationsError, NonPositiveInputError, } from "../../types/index.js";
5
+ import { validateDeadline, validateReferralFee, validateUint256Field, } from "../../helpers/validate.js";
6
+ import { NonPositiveInputError, } from "../../types/index.js";
7
+ import { getBundlesSharesPermit } from "../bundles/common.js";
7
8
  /**
8
- * Prepares a force-withdraw transaction for a VaultV2 contract via the vault's native `multicall`.
9
+ * Prepares a Vault V2 force withdrawal through VaultExitBundlesV1.
9
10
  *
10
- * Encodes one or more `forceDeallocate` calls followed by a single `withdraw`, executed
11
- * atomically through VaultV2's `multicall`. Frees liquidity from non-liquidity adapters and
12
- * withdraws the resulting assets in one transaction.
11
+ * The contract first withdraws everything the vault can pay without a penalty — its idle assets
12
+ * plus the liquidity available through its liquidity adapter — then force-deallocates the remainder
13
+ * by looping over the adapter's markets.
13
14
  *
14
- * A penalty is taken from `onBehalf` for each deallocation to discourage allocation
15
- * manipulation. The penalty is applied as a share burn where assets are returned to the vault,
16
- * so the share price stays stable (except for rounding).
15
+ * `exitAssets` is **penalty-inclusive**: it is what the contract debits from the user's position,
16
+ * while the assets actually delivered are
17
+ * `assetsToWithdraw + floor((exitAssets - assetsToWithdraw) * WAD / (WAD + penalty))` minus the
18
+ * referral fee. Use `previewVaultV2ForceWithdraw` to quote the split.
17
19
  *
18
- * @param params.vault.address - The VaultV2 address.
19
- * @param params.args.deallocations - The deallocations to perform before withdrawing. Must be
20
- * non-empty.
21
- * @param params.args.withdraw.amount - Amount of underlying assets to withdraw after the
22
- * deallocations complete.
23
- * @param params.args.withdraw.recipient - Address that receives the withdrawn assets.
24
- * @param params.args.onBehalf - Address whose shares are burned and from which the deallocation
25
- * penalty is taken.
26
- * @param params.metadata - Optional analytics metadata attached to the multicall transaction.
27
- * @returns A deep-frozen `Transaction<VaultV2ForceWithdrawAction>` with `to`, `value`, `data`,
28
- * and the typed `action` discriminator the simulation layer consumes.
29
- * @throws {EmptyDeallocationsError} when `deallocations` is empty.
30
- * @throws {NonPositiveInputError} when `withdraw.amount <= 0n`, or when any
31
- * `deallocations[i].amount <= 0n` (raised by `encodeForceDeallocateCall`).
20
+ * Without a signature this embeds the empty-permit sentinel and requires a sufficient vault-share
21
+ * approval to VaultExitBundlesV1.
22
+ *
23
+ * @param params - Force withdrawal parameters.
24
+ * @param params.vault.chainId - Chain containing the target Vault V2 and VaultExitBundlesV1.
25
+ * @param params.vault.address - Target Vault V2 address.
26
+ * @param params.args.adapter - Vault's sole MorphoMarketV1AdapterV2.
27
+ * @param params.args.exitAssets - Penalty-inclusive, asset-denominated amount to exit.
28
+ * @param params.args.minSharePriceE27 - RAY-scaled lower bound on the realized exit share price
29
+ * (withdrawn assets per share burned). `0n` disables the on-chain bound; prefer the value the
30
+ * entity computes.
31
+ * @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
32
+ * VaultExitBundlesV1 burns `msg.sender`'s vault shares and pays out to `msg.sender`, so the
33
+ * submitting account must equal this address.
34
+ * @param params.args.deadline - Permit and bundle deadline.
35
+ * @param params.args.referralFeePct - Optional WAD-scaled share of the withdrawn assets routed to
36
+ * `referralFeeRecipient`. Defaults to `0n`. Deducted *after* the `minSharePriceE27` check, so it
37
+ * is outside that bound's protection.
38
+ * @param params.args.referralFeeRecipient - Optional referral fee recipient. Defaults to the zero
39
+ * address, which is only valid alongside a zero `referralFeePct`.
40
+ * @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
41
+ * @param params.metadata - Optional analytics metadata.
42
+ * @returns A deep-frozen `Readonly<Transaction<VaultV2ForceWithdrawAction>>` with `to`, `value`,
43
+ * `data`, and the typed action discriminator.
44
+ * @throws {NonPositiveInputError} when `exitAssets` or `deadline` is not positive.
45
+ * @throws {NegativeInputError} when `referralFeePct` or `minSharePriceE27` is negative.
46
+ * @throws {InputExceedsMaxError} when `referralFeePct` is not below WAD (the contract rejects it
47
+ * with `PctExceeded`), or when `exitAssets`, `deadline`, or `minSharePriceE27` exceeds `uint256`.
48
+ * @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
49
+ * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
50
+ * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
51
+ * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind,
52
+ * asset, owner, spender, or signature encoding.
32
53
  * @example
33
54
  * ```ts
34
55
  * import { vaultV2ForceWithdraw } from "@morpho-org/morpho-sdk";
35
56
  *
36
57
  * const tx = vaultV2ForceWithdraw({
37
- * vault: { address: vaultAddress },
38
- * args: {
39
- * deallocations: [{ adapter, marketParams, amount: 500_000n }],
40
- * withdraw: { amount: 500_000n, recipient },
41
- * onBehalf,
42
- * },
58
+ * vault: { chainId: 1, address: vault },
59
+ * args: { adapter, exitAssets: 1_000_000n, minSharePriceE27, userAddress, deadline },
43
60
  * });
44
61
  * // tx satisfies Readonly<Transaction<VaultV2ForceWithdrawAction>>
45
62
  * ```
46
63
  */
47
- export const vaultV2ForceWithdraw = ({ vault: { address: vaultAddress }, args: { deallocations, withdraw, onBehalf }, metadata, }) => {
48
- if (deallocations.length === 0) {
49
- throw new EmptyDeallocationsError(vaultAddress);
50
- }
51
- const { amount: withdrawAmount, recipient: withdrawRecipient } = withdraw;
52
- if (withdrawAmount <= 0n) {
53
- throw new NonPositiveInputError("withdraw.amount", withdrawAmount);
54
- }
55
- const calls = [];
56
- for (const deallocation of deallocations) {
57
- calls.push(encodeForceDeallocateCall(deallocation, onBehalf));
58
- }
59
- calls.push(encodeFunctionData({
60
- abi: vaultV2Abi,
61
- functionName: "withdraw",
62
- args: [withdrawAmount, withdrawRecipient, onBehalf],
63
- }));
64
+ export const vaultV2ForceWithdraw = ({ vault, args, metadata, }) => {
65
+ if (args.exitAssets <= 0n)
66
+ throw new NonPositiveInputError("exitAssets", args.exitAssets);
67
+ validateUint256Field("exitAssets", args.exitAssets);
68
+ validateDeadline(args.deadline);
69
+ // `0n` stays valid — it is the intentional "no on-chain bound" opt-out — but a value the uint256
70
+ // slot cannot hold must fail with a dedicated error instead of viem's `IntegerOutOfRangeError`.
71
+ // The entity never emits these (it forbids a non-positive override); this guards direct callers.
72
+ validateUint256Field("minSharePriceE27", args.minSharePriceE27);
73
+ const { referralFeePct, referralFeeRecipient } = validateReferralFee(args);
74
+ const to = getChainAddress(vault.chainId, "bundles.vaultExitBundlesV1");
75
+ const sharesPermit = getBundlesSharesPermit({
76
+ vault: vault.address,
77
+ deadline: args.deadline,
78
+ owner: args.userAddress,
79
+ spender: to,
80
+ requirementSignature: args.requirementSignature,
81
+ });
64
82
  let tx = {
65
- to: vaultAddress,
83
+ to,
84
+ value: 0n,
66
85
  data: encodeFunctionData({
67
- abi: vaultV2Abi,
68
- functionName: "multicall",
69
- args: [calls],
86
+ abi: vaultExitBundlesV1Abi,
87
+ functionName: "vaultExitBundlesV1ForceWithdrawVaultV2",
88
+ args: [
89
+ vault.address,
90
+ args.adapter,
91
+ args.exitAssets,
92
+ args.minSharePriceE27,
93
+ sharesPermit,
94
+ referralFeePct,
95
+ referralFeeRecipient,
96
+ args.deadline,
97
+ ],
70
98
  }),
71
- value: 0n,
72
99
  };
73
- if (metadata) {
100
+ if (metadata)
74
101
  tx = addTransactionMetadata(tx, metadata);
75
- }
76
102
  return deepFreeze({
77
103
  ...tx,
78
104
  action: {
79
105
  type: "vaultV2ForceWithdraw",
80
106
  args: {
81
- vault: vaultAddress,
82
- deallocations: deallocations.map((d) => ({ ...d })),
83
- withdraw: {
84
- amount: withdrawAmount,
85
- recipient: withdrawRecipient,
86
- },
87
- onBehalf,
107
+ vault: vault.address,
108
+ adapter: args.adapter,
109
+ exitAssets: args.exitAssets,
110
+ minSharePriceE27: args.minSharePriceE27,
111
+ referralFeePct,
112
+ referralFeeRecipient,
113
+ onBehalf: args.userAddress,
114
+ deadline: args.deadline,
88
115
  },
89
116
  },
90
117
  });
@@ -30,18 +30,20 @@ export interface VaultV2InKindRedeemParams {
30
30
  * @param params.args.amount - Penalty-inclusive, asset-denominated amount to exit.
31
31
  * @param params.args.marketParamsList - Ordered markets consumed greedily after idle assets. May be
32
32
  * empty when the vault's idle balance covers `amount`.
33
- * @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
34
- * VaultExitBundlesV1 burns `msg.sender`'s vault shares, so the submitting account must equal this
35
- * address.
33
+ * @param params.args.userAddress - Redeeming account, recorded in action metadata and validated as
34
+ * the expected owner of an optional `requirementSignature` permit. VaultExitBundlesV1 burns
35
+ * `msg.sender`'s vault shares, so the submitting account must equal this address.
36
36
  * @param params.args.deadline - Permit and bundle deadline.
37
37
  * @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
38
38
  * @param params.metadata - Optional analytics metadata.
39
39
  * @returns A deep-frozen `Readonly<Transaction<VaultV2InKindRedeemAction>>` with `to`, `value`,
40
40
  * `data`, and the typed action discriminator.
41
41
  * @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
42
+ * @throws {InputExceedsMaxError} when the bundle or permit deadline exceeds `uint256`.
42
43
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
43
44
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
44
- * @throws {VaultExitBundlesV1PermitMismatchError} when the requirement has the wrong permit kind, asset, or signature encoding.
45
+ * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
46
+ * spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
45
47
  * @example
46
48
  * ```ts
47
49
  * import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
@@ -2,8 +2,9 @@ import { deepFreeze, getChainAddress } from "@morpho-org/morpho-ts";
2
2
  import { encodeFunctionData } from "viem";
3
3
  import { vaultExitBundlesV1Abi } from "../../abis.js";
4
4
  import { addTransactionMetadata } from "../../helpers/index.js";
5
+ import { validateDeadline } from "../../helpers/validate.js";
5
6
  import { NonPositiveInputError, } from "../../types/index.js";
6
- import { getVaultExitBundlesV1PermitStruct } from "../signatures/getVaultExitBundlesV1PermitStruct.js";
7
+ import { getBundlesSharesPermit } from "../bundles/common.js";
7
8
  /**
8
9
  * Prepares a Vault V2 in-kind redemption into idle assets and Morpho Blue supply positions.
9
10
  *
@@ -17,18 +18,20 @@ import { getVaultExitBundlesV1PermitStruct } from "../signatures/getVaultExitBun
17
18
  * @param params.args.amount - Penalty-inclusive, asset-denominated amount to exit.
18
19
  * @param params.args.marketParamsList - Ordered markets consumed greedily after idle assets. May be
19
20
  * empty when the vault's idle balance covers `amount`.
20
- * @param params.args.userAddress - Expected transaction sender, recorded in action metadata only.
21
- * VaultExitBundlesV1 burns `msg.sender`'s vault shares, so the submitting account must equal this
22
- * address.
21
+ * @param params.args.userAddress - Redeeming account, recorded in action metadata and validated as
22
+ * the expected owner of an optional `requirementSignature` permit. VaultExitBundlesV1 burns
23
+ * `msg.sender`'s vault shares, so the submitting account must equal this address.
23
24
  * @param params.args.deadline - Permit and bundle deadline.
24
25
  * @param params.args.requirementSignature - Optional bounded Vault V2 shares permit.
25
26
  * @param params.metadata - Optional analytics metadata.
26
27
  * @returns A deep-frozen `Readonly<Transaction<VaultV2InKindRedeemAction>>` with `to`, `value`,
27
28
  * `data`, and the typed action discriminator.
28
29
  * @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
30
+ * @throws {InputExceedsMaxError} when the bundle or permit deadline exceeds `uint256`.
29
31
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
30
32
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
31
- * @throws {VaultExitBundlesV1PermitMismatchError} when the requirement has the wrong permit kind, asset, or signature encoding.
33
+ * @throws {BundlesPermitMismatchError} when the requirement has the wrong permit kind, asset, owner,
34
+ * spender, or signature encoding, or when its signed and action amounts or deadlines disagree.
32
35
  * @example
33
36
  * ```ts
34
37
  * import { vaultV2InKindRedeem } from "@morpho-org/morpho-sdk";
@@ -43,8 +46,7 @@ import { getVaultExitBundlesV1PermitStruct } from "../signatures/getVaultExitBun
43
46
  export const vaultV2InKindRedeem = ({ vault, args, metadata, }) => {
44
47
  if (args.amount <= 0n)
45
48
  throw new NonPositiveInputError("amount", args.amount);
46
- if (args.deadline <= 0n)
47
- throw new NonPositiveInputError("deadline", args.deadline);
49
+ validateDeadline(args.deadline);
48
50
  const to = getChainAddress(vault.chainId, "bundles.vaultExitBundlesV1");
49
51
  const marketParamsList = args.marketParamsList.map((marketParams) => ({
50
52
  loanToken: marketParams.loanToken,
@@ -53,9 +55,11 @@ export const vaultV2InKindRedeem = ({ vault, args, metadata, }) => {
53
55
  irm: marketParams.irm,
54
56
  lltv: marketParams.lltv,
55
57
  }));
56
- const sharesPermit = getVaultExitBundlesV1PermitStruct({
58
+ const sharesPermit = getBundlesSharesPermit({
57
59
  vault: vault.address,
58
60
  deadline: args.deadline,
61
+ owner: args.userAddress,
62
+ spender: to,
59
63
  requirementSignature: args.requirementSignature,
60
64
  });
61
65
  let tx = {
@@ -10,5 +10,4 @@ import "./augment/Vault.js";
10
10
  import "./augment/VaultConfig.js";
11
11
  import "./augment/VaultMarketAllocation.js";
12
12
  import "./augment/VaultMarketConfig.js";
13
- import "./augment/VaultMarketPublicAllocatorConfig.js";
14
13
  import "./augment/VaultUser.js";
@@ -10,5 +10,4 @@ import "./augment/Vault.js";
10
10
  import "./augment/VaultConfig.js";
11
11
  import "./augment/VaultMarketAllocation.js";
12
12
  import "./augment/VaultMarketConfig.js";
13
- import "./augment/VaultMarketPublicAllocatorConfig.js";
14
13
  import "./augment/VaultUser.js";
@@ -1,2 +1,2 @@
1
1
  export { marketParamsAbi } from "@morpho-org/blue-sdk";
2
- export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV1PublicAllocatorAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
2
+ export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
@@ -1,2 +1,2 @@
1
1
  export { marketParamsAbi } from "@morpho-org/blue-sdk";
2
- export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV1PublicAllocatorAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
2
+ export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
@@ -1,2 +1,2 @@
1
- export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition, IPreLiquidationParams, IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultMarketPublicAllocatorConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, VaultPublicAllocatorConfig, } from "@morpho-org/blue-sdk";
2
- export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultMarketPublicAllocatorConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
1
+ export type { IAccrualPosition, IAccrualVault, IAccrualVaultV2, IAccrualVaultV2Adapter, IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2MorphoVaultV1Adapter, IAssetBalances, IEip5267Domain, IHolding, IMarket, IMarketParams, IPosition, IPreLiquidationParams, IPreLiquidationPosition, IToken, IVault, IVaultConfig, IVaultMarketAllocation, IVaultMarketConfig, IVaultToken, IVaultUser, IVaultV2, IVaultV2Adapter, IVaultV2Allocation, IVaultV2BlueMarketPublicAllocatorConfig, IVaultV2BluePublicAllocatorConfig, IVaultV2MorphoMarketV1Adapter, IVaultV2MorphoMarketV1AdapterV2, IVaultV2MorphoVaultV1Adapter, PeripheralBalance, PeripheralBalanceType, } from "@morpho-org/blue-sdk";
2
+ export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
@@ -1 +1 @@
1
- export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultMarketPublicAllocatorConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
1
+ export { AccrualPosition, AccrualVault, AccrualVaultV2, AccrualVaultV2MorphoMarketV1Adapter, AccrualVaultV2MorphoMarketV1AdapterV2, AccrualVaultV2MorphoVaultV1Adapter, AssetBalances, ConstantWrappedToken, Eip5267Domain, ExchangeRateWrappedToken, Holding, Market, MarketParams, Position, PreLiquidationParams, PreLiquidationPosition, Token, User, Vault, VaultConfig, VaultMarketAllocation, VaultMarketConfig, VaultToken, VaultUser, VaultV2, VaultV2Adapter, VaultV2BlueMarketPublicAllocatorConfig, VaultV2BluePublicAllocatorConfig, VaultV2MorphoMarketV1Adapter, VaultV2MorphoMarketV1AdapterV2, VaultV2MorphoVaultV1Adapter, WrappedToken, } from "@morpho-org/blue-sdk";
@@ -1,2 +1,2 @@
1
- export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
1
+ export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
2
2
  export { getUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
@@ -1,2 +1,2 @@
1
- export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
1
+ export { BlueErrors, DivisionByZeroError, IncompleteChainRegistryError, InvalidBitLengthError, InvalidMarketParamsError, RegistryValueAlreadyRegisteredError, UnknownAddressError, UnknownDataError, UnknownFactory, UnknownMarketAllocationError, UnknownMarketParamsError, UnknownOfFactory, UnknownTokenError, UnknownTokenPriceError, UnknownVaultConfigError, UnsupportedChainIdError, UnsupportedMarketIrmError, UnsupportedPreLiquidationParamsError, UnsupportedVaultV2AdapterError, VaultV2Errors, } from "@morpho-org/blue-sdk";
2
2
  export { getUnsupportedVaultV2Adapter, InvalidPermitDomainChainIdError, InvalidPermitDomainVerifyingContractError, isUnknownOfFactoryError, UnsupportedPermitDomainExtensionsError, } from "@morpho-org/blue-sdk-viem";
@@ -1 +1 @@
1
- export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
1
+ export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
@@ -1 +1 @@
1
- export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultMarketPublicAllocatorConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
1
+ export { fetchAccrualPosition, fetchAccrualVault, fetchAccrualVaultV2, fetchAccrualVaultV2Adapter, fetchAccrualVaultV2MorphoMarketV1Adapter, fetchAccrualVaultV2MorphoMarketV1AdapterV2, fetchAccrualVaultV2MorphoVaultV1Adapter, fetchHolding, fetchMarket, fetchMarketParams, fetchPosition, fetchPreLiquidationParams, fetchPreLiquidationPosition, fetchToken, fetchUser, fetchVault, fetchVaultConfig, fetchVaultMarketAllocation, fetchVaultMarketConfig, fetchVaultUser, fetchVaultV2, fetchVaultV2Adapter, fetchVaultV2BlueMarketPublicAllocatorConfig, fetchVaultV2BluePublicAllocatorConfig, fetchVaultV2BluePublicAllocatorData, fetchVaultV2MorphoMarketV1Adapter, fetchVaultV2MorphoMarketV1AdapterV2, fetchVaultV2MorphoVaultV1Adapter, } from "@morpho-org/blue-sdk-viem";
@@ -1,4 +1,2 @@
1
- export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams, IPermit2Allowance, Loadable, MarketId, MaxBorrowOptions, MaxPositionCapacities, MaxWithdrawCollateralOptions, Pending, Permit2Allowance, } from "@morpho-org/blue-sdk";
2
- export type { AuthorizationArgs,
3
- /** @deprecated Args for the deprecated getDaiPermitTypedData; scheduled for removal in the next major. */
4
- DaiPermitArgs, DeploylessFetchParameters, FetchParameters, InputAllocation, MetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs, } from "@morpho-org/blue-sdk-viem";
1
+ export type { BigIntish, CollateralAllocation, Eip712Field, Erc20AllowanceRecipient, Failable, Fetchable, InputMarketParams, Loadable, MarketId, MaxBorrowOptions, MaxPositionCapacities, MaxWithdrawCollateralOptions, Pending, } from "@morpho-org/blue-sdk";
2
+ export type { AuthorizationArgs, DeploylessFetchParameters, FetchParameters, InputAllocation, MetaMorphoCall, Permit2PermitArgs, Permit2TransferFromArgs, PermitArgs, } from "@morpho-org/blue-sdk-viem";
@@ -1,5 +1,3 @@
1
1
  export type { CapacityLimit, RoundingDirection } from "@morpho-org/blue-sdk";
2
2
  export { AdaptiveCurveIrmLib, CapacityLimitReason, defaultPreLiquidationParamsRegistry, getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
3
- export { decodeBytes32String, getAuthorizationTypedData,
4
- /** @deprecated DAI is routed through Permit2 internally; scheduled for removal in the next major. */
5
- getDaiPermitTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
3
+ export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
@@ -1,4 +1,2 @@
1
1
  export { AdaptiveCurveIrmLib, CapacityLimitReason, defaultPreLiquidationParamsRegistry, getDefaultPreLiquidationParams, MarketUtils, MathLib, SharesMath, VaultUtils, VaultV2BlueMarketPublicAllocatorConfigUtils, VaultV2BluePublicAllocatorConfigUtils, VaultV2Utils, } from "@morpho-org/blue-sdk";
2
- export { decodeBytes32String, getAuthorizationTypedData,
3
- /** @deprecated DAI is routed through Permit2 internally; scheduled for removal in the next major. */
4
- getDaiPermitTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
2
+ export { decodeBytes32String, getAuthorizationTypedData, getPermit2PermitTypedData, getPermit2TransferFromTypedData, getPermitTypedData, MetaMorphoAction, optionalBoolean, readContractRestructured, restructure, safeGetAddress, safeParseNumber, safeParseUnits, } from "@morpho-org/blue-sdk-viem";
@@ -12,7 +12,7 @@ import { type Metadata, type MorphoClientType } from "../types/index.js";
12
12
  * @param _options.metadata - Optional analytics metadata applied to every transaction the
13
13
  * `morpho` namespace builds.
14
14
  * @param _options.supportSignature - Whether the integrator can collect EIP-712 signatures for
15
- * ERC-2612, Permit2 AllowanceTransfer or SignatureTransfer, and Morpho authorization.
15
+ * ERC-2612, Permit2 SignatureTransfer, and Morpho authorization.
16
16
  * Defaults to `false` (standalone approvals and authorization calls only).
17
17
  * @param _options.supportDeployless - Whether entity fetchers may use deployless multicall.
18
18
  * @returns A viem extension function — `client.extend(morphoViemExtension(...))` adds
@@ -52,7 +52,7 @@ function createMorphoNamespace(viemClient, options) {
52
52
  * @param _options.metadata - Optional analytics metadata applied to every transaction the
53
53
  * `morpho` namespace builds.
54
54
  * @param _options.supportSignature - Whether the integrator can collect EIP-712 signatures for
55
- * ERC-2612, Permit2 AllowanceTransfer or SignatureTransfer, and Morpho authorization.
55
+ * ERC-2612, Permit2 SignatureTransfer, and Morpho authorization.
56
56
  * Defaults to `false` (standalone approvals and authorization calls only).
57
57
  * @param _options.supportDeployless - Whether entity fetchers may use deployless multicall.
58
58
  * @returns A viem extension function — `client.extend(morphoViemExtension(...))` adds
@@ -1,38 +1,4 @@
1
- export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, ERC20_ALLOWANCE_RECIPIENTS, isMarketId as isBlueMarketId,
2
- /** @deprecated Use `isBlueMarketId` or the raw `/blue/constants` subpath. */
3
- isMarketId, LIQUIDATION_CURSOR as BLUE_LIQUIDATION_CURSOR,
4
- /** @deprecated Use `BLUE_LIQUIDATION_CURSOR` or the raw `/blue/constants` subpath. */
5
- LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR as BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR,
6
- /** @deprecated Use `BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR` or the raw `/blue/constants` subpath. */
7
- MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType as BlueTransactionType,
8
- /** @deprecated Use `BlueTransactionType` or the raw `/blue/constants` subpath. */
9
- TransactionType, } from "@morpho-org/blue-sdk";
10
- export { CBP as MIDNIGHT_CBP,
11
- /** @deprecated Use `MIDNIGHT_CBP` or the raw `/midnight/constants` subpath. */
12
- CBP, COLLATERAL_PARAMS_TYPEHASH as MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH,
13
- /** @deprecated Use `MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH` or the raw `/midnight/constants` subpath. */
14
- COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING as MIDNIGHT_DEFAULT_TICK_SPACING,
15
- /** @deprecated Use `MIDNIGHT_DEFAULT_TICK_SPACING` or the raw `/midnight/constants` subpath. */
16
- DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH as MIDNIGHT_EIP712_DOMAIN_TYPEHASH,
17
- /** @deprecated Use `MIDNIGHT_EIP712_DOMAIN_TYPEHASH` or the raw `/midnight/constants` subpath. */
18
- EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH as MIDNIGHT_MARKET_TYPEHASH,
19
- /** @deprecated Use `MIDNIGHT_MARKET_TYPEHASH` or the raw `/midnight/constants` subpath. */
20
- MARKET_TYPEHASH, MAX_COLLATERALS as MIDNIGHT_MAX_COLLATERALS,
21
- /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS` or the raw `/midnight/constants` subpath. */
22
- MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER as MIDNIGHT_MAX_COLLATERALS_PER_BORROWER,
23
- /** @deprecated Use `MIDNIGHT_MAX_COLLATERALS_PER_BORROWER` or the raw `/midnight/constants` subpath. */
24
- MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE as MIDNIGHT_MAX_CONTINUOUS_FEE,
25
- /** @deprecated Use `MIDNIGHT_MAX_CONTINUOUS_FEE` or the raw `/midnight/constants` subpath. */
26
- MAX_CONTINUOUS_FEE, MAX_OFFER_CAP as MIDNIGHT_MAX_OFFER_CAP, MAX_SETTLEMENT_FEES as MIDNIGHT_MAX_SETTLEMENT_FEES,
27
- /** @deprecated Use `MIDNIGHT_MAX_SETTLEMENT_FEES` or the raw `/midnight/constants` subpath. */
28
- MAX_SETTLEMENT_FEES, MAX_TICK as MIDNIGHT_MAX_TICK,
29
- /** @deprecated Use `MIDNIGHT_MAX_TICK` or the raw `/midnight/constants` subpath. */
30
- MAX_TICK, OFFER_TYPEHASH as MIDNIGHT_OFFER_TYPEHASH,
31
- /** @deprecated Use `MIDNIGHT_OFFER_TYPEHASH` or the raw `/midnight/constants` subpath. */
32
- OFFER_TYPEHASH, PRICE_ROUNDING_STEP as MIDNIGHT_PRICE_ROUNDING_STEP,
33
- /** @deprecated Use `MIDNIGHT_PRICE_ROUNDING_STEP` or the raw `/midnight/constants` subpath. */
34
- PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS as MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS,
35
- /** @deprecated Use `MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS` or the raw `/midnight/constants` subpath. */
36
- SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF as MIDNIGHT_TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
37
- export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, CDN_BASE_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, OPTIMIZERS_API_BASE_URL, OPTIMIZERS_BASE_URL, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
1
+ export { DEFAULT_SLIPPAGE_TOLERANCE, EIP_712_FIELDS, ERC20_ALLOWANCE_RECIPIENTS, isMarketId as isBlueMarketId, LIQUIDATION_CURSOR as BLUE_LIQUIDATION_CURSOR, MAX_LIQUIDATION_INCENTIVE_FACTOR as BLUE_MAX_LIQUIDATION_INCENTIVE_FACTOR, ORACLE_PRICE_SCALE, SECONDS_PER_YEAR, TransactionType as BlueTransactionType, } from "@morpho-org/blue-sdk";
2
+ export { CBP as MIDNIGHT_CBP, COLLATERAL_PARAMS_TYPEHASH as MIDNIGHT_COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING as MIDNIGHT_DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH as MIDNIGHT_EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH as MIDNIGHT_MARKET_TYPEHASH, MAX_COLLATERALS as MIDNIGHT_MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER as MIDNIGHT_MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE as MIDNIGHT_MAX_CONTINUOUS_FEE, MAX_OFFER_CAP as MIDNIGHT_MAX_OFFER_CAP, MAX_SETTLEMENT_FEES as MIDNIGHT_MAX_SETTLEMENT_FEES, MAX_TICK as MIDNIGHT_MAX_TICK, OFFER_TYPEHASH as MIDNIGHT_OFFER_TYPEHASH, PRICE_ROUNDING_STEP as MIDNIGHT_PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS as MIDNIGHT_SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF as MIDNIGHT_TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
3
+ export { BLUE_API_BASE_URL, BLUE_API_GRAPHQL_URL, ChainId, ChainUtils, DOCS_BASE_URL, MORPHO_DOMAIN, REWARDS_BASE_URL, ZERO_ADDRESS, } from "@morpho-org/morpho-ts";
38
4
  export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, } from "./helpers/constant.js";