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

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 (296) hide show
  1. package/MIGRATION-v5-to-v6.md +329 -15
  2. package/README.md +93 -47
  3. package/lib/cjs/abis.d.ts +227 -2
  4. package/lib/cjs/abis.js +156 -3
  5. package/lib/cjs/actions/blue/borrow.d.ts +1 -1
  6. package/lib/cjs/actions/blue/borrow.js +1 -1
  7. package/lib/cjs/actions/blue/common.d.ts +6 -19
  8. package/lib/cjs/actions/blue/common.js +28 -162
  9. package/lib/cjs/actions/blue/refinance.d.ts +1 -1
  10. package/lib/cjs/actions/blue/refinance.js +1 -1
  11. package/lib/cjs/actions/blue/repay.d.ts +3 -3
  12. package/lib/cjs/actions/blue/repay.js +1 -1
  13. package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -3
  14. package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -1
  15. package/lib/cjs/actions/blue/supply.d.ts +3 -3
  16. package/lib/cjs/actions/blue/supply.js +3 -8
  17. package/lib/cjs/actions/blue/supplyCollateral.d.ts +3 -3
  18. package/lib/cjs/actions/blue/supplyCollateral.js +1 -1
  19. package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -3
  20. package/lib/cjs/actions/blue/supplyCollateralBorrow.js +1 -1
  21. package/lib/cjs/actions/blue/withdraw.d.ts +1 -1
  22. package/lib/cjs/actions/blue/withdraw.js +1 -1
  23. package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
  24. package/lib/cjs/actions/blue/withdrawCollateral.js +1 -1
  25. package/lib/cjs/actions/bundles/common.d.ts +230 -0
  26. package/lib/cjs/actions/bundles/common.js +507 -0
  27. package/lib/cjs/actions/bundles/index.d.ts +3 -0
  28. package/lib/cjs/actions/bundles/index.js +23 -0
  29. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  30. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
  31. package/lib/cjs/actions/index.d.ts +1 -0
  32. package/lib/cjs/actions/index.js +1 -0
  33. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  34. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  35. package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
  36. package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
  37. package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
  38. package/lib/cjs/actions/midnight/takeLend.js +2 -2
  39. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -0
  40. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +6 -10
  41. package/lib/cjs/actions/requirements/blue/index.d.ts +0 -2
  42. package/lib/cjs/actions/requirements/blue/index.js +0 -2
  43. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +15 -8
  44. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +21 -21
  45. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
  46. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +2 -1
  47. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +19 -10
  48. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +43 -31
  49. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +4 -2
  50. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2Approve.js +15 -10
  51. package/lib/{esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +16 -14
  52. package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +27 -22
  53. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +12 -9
  54. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +27 -21
  55. package/lib/cjs/actions/requirements/encode/index.d.ts +1 -1
  56. package/lib/cjs/actions/requirements/encode/index.js +1 -1
  57. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +1 -0
  58. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +4 -1
  59. package/lib/cjs/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +5 -2
  60. package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +4 -3
  61. package/lib/cjs/actions/requirements/getRequirementsApproval.js +4 -3
  62. package/lib/cjs/actions/signatures/getTokenRequirementActions.js +2 -2
  63. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +28 -30
  64. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +20 -66
  65. package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
  66. package/lib/cjs/actions/vaultV1/deposit.js +110 -109
  67. package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +1 -0
  68. package/lib/cjs/actions/vaultV1/inKindRedeem.js +3 -2
  69. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
  70. package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
  71. package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
  72. package/lib/cjs/actions/vaultV1/redeem.js +56 -33
  73. package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
  74. package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
  75. package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
  76. package/lib/cjs/actions/vaultV2/deposit.js +111 -109
  77. package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +58 -39
  78. package/lib/cjs/actions/vaultV2/forceWithdraw.js +87 -60
  79. package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +1 -0
  80. package/lib/cjs/actions/vaultV2/inKindRedeem.js +3 -2
  81. package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
  82. package/lib/cjs/actions/vaultV2/redeem.js +56 -34
  83. package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
  84. package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
  85. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +4 -1
  86. package/lib/cjs/blue/abis.d.ts +5 -1
  87. package/lib/cjs/blue/abis.js +2 -0
  88. package/lib/cjs/blue/entities.d.ts +8 -2
  89. package/lib/cjs/blue/entities.js +1 -0
  90. package/lib/cjs/blue/errors.d.ts +1 -1
  91. package/lib/cjs/blue/errors.js +2 -1
  92. package/lib/cjs/blue/fetch.d.ts +3 -1
  93. package/lib/cjs/blue/fetch.js +1 -0
  94. package/lib/cjs/entities/blue/blue.d.ts +29 -20
  95. package/lib/cjs/entities/blue/blue.js +6 -1
  96. package/lib/cjs/entities/index.d.ts +9 -2
  97. package/lib/cjs/entities/index.js +16 -0
  98. package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
  99. package/lib/cjs/entities/midnight/midnight.js +20 -24
  100. package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +27 -19
  101. package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +76 -75
  102. package/lib/{esm/actions/requirements/blue → cjs/entities/requirements}/getUnusedPermit2Nonce.d.ts +1 -1
  103. package/lib/cjs/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +4 -4
  104. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  105. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
  106. package/lib/cjs/entities/requirements/index.d.ts +2 -0
  107. package/lib/cjs/entities/requirements/index.js +18 -0
  108. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +356 -101
  109. package/lib/cjs/entities/vaultV1/vaultV1.js +334 -120
  110. package/lib/cjs/entities/vaultV1ReallocationData.d.ts +6 -0
  111. package/lib/cjs/entities/vaultV1ReallocationData.js +20 -5
  112. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +359 -100
  113. package/lib/cjs/entities/vaultV2/vaultV2.js +448 -93
  114. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +8 -1
  115. package/lib/cjs/entities/vaultV2BlueReallocationData.js +46 -13
  116. package/lib/cjs/errors.d.ts +1 -1
  117. package/lib/cjs/errors.js +3 -2
  118. package/lib/cjs/fetch.d.ts +3 -1
  119. package/lib/cjs/fetch.js +1 -0
  120. package/lib/cjs/helpers/computeVaultV1Reallocations.d.ts +2 -0
  121. package/lib/cjs/helpers/computeVaultV1Reallocations.js +2 -0
  122. package/lib/cjs/helpers/index.d.ts +4 -1
  123. package/lib/cjs/helpers/index.js +14 -1
  124. package/lib/cjs/helpers/metadata.d.ts +3 -5
  125. package/lib/cjs/helpers/metadata.js +4 -6
  126. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
  127. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +164 -0
  128. package/lib/cjs/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
  129. package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +2 -0
  130. package/lib/cjs/helpers/referralFee.d.ts +21 -0
  131. package/lib/cjs/helpers/referralFee.js +35 -0
  132. package/lib/cjs/helpers/slippage.d.ts +136 -1
  133. package/lib/cjs/helpers/slippage.js +188 -0
  134. package/lib/cjs/helpers/validate.d.ts +67 -8
  135. package/lib/cjs/helpers/validate.js +94 -9
  136. package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
  137. package/lib/cjs/helpers/validateRequirementSpender.js +1 -0
  138. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
  139. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +369 -0
  140. package/lib/cjs/index.d.ts +1 -0
  141. package/lib/cjs/index.js +1 -0
  142. package/lib/cjs/types/action.d.ts +273 -82
  143. package/lib/cjs/types/action.js +12 -12
  144. package/lib/cjs/types/error.d.ts +349 -23
  145. package/lib/cjs/types/error.js +393 -39
  146. package/lib/cjs/types/sharedLiquidity.d.ts +2 -2
  147. package/lib/cjs/utils.d.ts +3 -1
  148. package/lib/cjs/utils.js +10 -1
  149. package/lib/esm/abis.d.ts +227 -2
  150. package/lib/esm/abis.js +157 -2
  151. package/lib/esm/actions/blue/borrow.d.ts +1 -1
  152. package/lib/esm/actions/blue/borrow.js +1 -1
  153. package/lib/esm/actions/blue/common.d.ts +6 -19
  154. package/lib/esm/actions/blue/common.js +30 -164
  155. package/lib/esm/actions/blue/refinance.d.ts +1 -1
  156. package/lib/esm/actions/blue/refinance.js +1 -1
  157. package/lib/esm/actions/blue/repay.d.ts +3 -3
  158. package/lib/esm/actions/blue/repay.js +1 -1
  159. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -3
  160. package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -1
  161. package/lib/esm/actions/blue/supply.d.ts +3 -3
  162. package/lib/esm/actions/blue/supply.js +5 -10
  163. package/lib/esm/actions/blue/supplyCollateral.d.ts +3 -3
  164. package/lib/esm/actions/blue/supplyCollateral.js +1 -1
  165. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -3
  166. package/lib/esm/actions/blue/supplyCollateralBorrow.js +1 -1
  167. package/lib/esm/actions/blue/withdraw.d.ts +1 -1
  168. package/lib/esm/actions/blue/withdraw.js +1 -1
  169. package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
  170. package/lib/esm/actions/blue/withdrawCollateral.js +1 -1
  171. package/lib/esm/actions/bundles/common.d.ts +230 -0
  172. package/lib/esm/actions/bundles/common.js +494 -0
  173. package/lib/esm/actions/bundles/index.d.ts +3 -0
  174. package/lib/esm/actions/bundles/index.js +2 -0
  175. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  176. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
  177. package/lib/esm/actions/index.d.ts +1 -0
  178. package/lib/esm/actions/index.js +1 -0
  179. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  180. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  181. package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
  182. package/lib/esm/actions/midnight/takeBorrow.js +2 -2
  183. package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
  184. package/lib/esm/actions/midnight/takeLend.js +2 -2
  185. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -0
  186. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +8 -12
  187. package/lib/esm/actions/requirements/blue/index.d.ts +0 -2
  188. package/lib/esm/actions/requirements/blue/index.js +0 -2
  189. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +15 -8
  190. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +22 -22
  191. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
  192. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +2 -1
  193. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +19 -10
  194. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +44 -32
  195. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.d.ts +4 -2
  196. package/lib/esm/actions/requirements/encode/encodeErc20Permit2Approve.js +15 -10
  197. package/lib/{cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +16 -14
  198. package/lib/esm/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +25 -20
  199. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +12 -9
  200. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +27 -21
  201. package/lib/esm/actions/requirements/encode/index.d.ts +1 -1
  202. package/lib/esm/actions/requirements/encode/index.js +1 -1
  203. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirements.js +1 -0
  204. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.d.ts +4 -1
  205. package/lib/esm/actions/requirements/generalAdapter/getGeneralAdapterRequirementsPermit.js +5 -2
  206. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +4 -3
  207. package/lib/esm/actions/requirements/getRequirementsApproval.js +4 -3
  208. package/lib/esm/actions/signatures/getTokenRequirementActions.js +3 -3
  209. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +28 -30
  210. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +21 -67
  211. package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
  212. package/lib/esm/actions/vaultV1/deposit.js +112 -111
  213. package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +1 -0
  214. package/lib/esm/actions/vaultV1/inKindRedeem.js +3 -2
  215. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
  216. package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
  217. package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
  218. package/lib/esm/actions/vaultV1/redeem.js +56 -33
  219. package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
  220. package/lib/esm/actions/vaultV1/withdraw.js +86 -34
  221. package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
  222. package/lib/esm/actions/vaultV2/deposit.js +113 -111
  223. package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +58 -39
  224. package/lib/esm/actions/vaultV2/forceWithdraw.js +89 -62
  225. package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +1 -0
  226. package/lib/esm/actions/vaultV2/inKindRedeem.js +3 -2
  227. package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
  228. package/lib/esm/actions/vaultV2/redeem.js +56 -34
  229. package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
  230. package/lib/esm/actions/vaultV2/withdraw.js +86 -35
  231. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +4 -1
  232. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +3 -1
  233. package/lib/esm/blue/abis.d.ts +5 -1
  234. package/lib/esm/blue/abis.js +5 -1
  235. package/lib/esm/blue/entities.d.ts +8 -2
  236. package/lib/esm/blue/entities.js +3 -1
  237. package/lib/esm/blue/errors.d.ts +1 -1
  238. package/lib/esm/blue/errors.js +1 -1
  239. package/lib/esm/blue/fetch.d.ts +3 -1
  240. package/lib/esm/blue/fetch.js +3 -1
  241. package/lib/esm/entities/blue/blue.d.ts +29 -20
  242. package/lib/esm/entities/blue/blue.js +7 -2
  243. package/lib/esm/entities/index.d.ts +9 -2
  244. package/lib/esm/entities/index.js +4 -1
  245. package/lib/esm/entities/midnight/midnight.d.ts +2 -2
  246. package/lib/esm/entities/midnight/midnight.js +20 -24
  247. package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +27 -19
  248. package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +67 -66
  249. package/lib/{cjs/actions/requirements/blue → esm/entities/requirements}/getUnusedPermit2Nonce.d.ts +1 -1
  250. package/lib/esm/{actions/requirements/blue → entities/requirements}/getUnusedPermit2Nonce.js +4 -4
  251. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  252. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
  253. package/lib/esm/entities/requirements/index.d.ts +2 -0
  254. package/lib/esm/entities/requirements/index.js +2 -0
  255. package/lib/esm/entities/vaultV1/vaultV1.d.ts +356 -101
  256. package/lib/esm/entities/vaultV1/vaultV1.js +338 -124
  257. package/lib/esm/entities/vaultV1ReallocationData.d.ts +6 -0
  258. package/lib/esm/entities/vaultV1ReallocationData.js +20 -5
  259. package/lib/esm/entities/vaultV2/vaultV2.d.ts +359 -100
  260. package/lib/esm/entities/vaultV2/vaultV2.js +452 -97
  261. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +8 -1
  262. package/lib/esm/entities/vaultV2BlueReallocationData.js +46 -13
  263. package/lib/esm/errors.d.ts +1 -1
  264. package/lib/esm/errors.js +1 -1
  265. package/lib/esm/fetch.d.ts +3 -1
  266. package/lib/esm/fetch.js +3 -1
  267. package/lib/esm/helpers/computeVaultV1Reallocations.d.ts +2 -0
  268. package/lib/esm/helpers/computeVaultV1Reallocations.js +2 -0
  269. package/lib/esm/helpers/index.d.ts +4 -1
  270. package/lib/esm/helpers/index.js +4 -1
  271. package/lib/esm/helpers/metadata.d.ts +3 -5
  272. package/lib/esm/helpers/metadata.js +4 -6
  273. package/lib/esm/helpers/previewVaultV2ForceWithdraw.d.ts +107 -0
  274. package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +161 -0
  275. package/lib/esm/helpers/previewVaultV2InKindRedeem.d.ts +1 -0
  276. package/lib/esm/helpers/previewVaultV2InKindRedeem.js +2 -0
  277. package/lib/esm/helpers/referralFee.d.ts +21 -0
  278. package/lib/esm/helpers/referralFee.js +31 -0
  279. package/lib/esm/helpers/slippage.d.ts +136 -1
  280. package/lib/esm/helpers/slippage.js +186 -2
  281. package/lib/esm/helpers/validate.d.ts +67 -8
  282. package/lib/esm/helpers/validate.js +92 -10
  283. package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
  284. package/lib/esm/helpers/validateRequirementSpender.js +1 -0
  285. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +274 -0
  286. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +362 -0
  287. package/lib/esm/index.d.ts +1 -0
  288. package/lib/esm/index.js +1 -0
  289. package/lib/esm/types/action.d.ts +273 -82
  290. package/lib/esm/types/action.js +11 -11
  291. package/lib/esm/types/error.d.ts +349 -23
  292. package/lib/esm/types/error.js +377 -31
  293. package/lib/esm/types/sharedLiquidity.d.ts +2 -2
  294. package/lib/esm/utils.d.ts +3 -1
  295. package/lib/esm/utils.js +3 -1
  296. package/package.json +7 -7
package/lib/cjs/abis.d.ts CHANGED
@@ -7,7 +7,11 @@ adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoA
7
7
  /** @deprecated Use `bluePreLiquidationAbi` or the raw `/blue/abis` subpath. */
8
8
  preLiquidationAbi, preLiquidationFactoryAbi as bluePreLiquidationFactoryAbi,
9
9
  /** @deprecated Use `bluePreLiquidationFactoryAbi` or the raw `/blue/abis` subpath. */
10
- preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV1PublicAllocatorAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
10
+ preLiquidationFactoryAbi,
11
+ /** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
12
+ publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi,
13
+ /** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
14
+ vaultV1PublicAllocatorAbi, vaultV2Abi, vaultV2BluePublicAllocatorAbi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
11
15
  export { ecrecoverRatifierAbi as midnightEcrecoverRatifierAbi,
12
16
  /** @deprecated Use `midnightEcrecoverRatifierAbi` or the raw `/midnight/abis` subpath. */
13
17
  ecrecoverRatifierAbi, midnightAbi, midnightBundlesAbi, setterRatifierAbi as midnightSetterRatifierAbi,
@@ -326,6 +330,216 @@ export declare const vaultExitBundlesV1Abi: readonly [{
326
330
  readonly outputs: readonly [];
327
331
  readonly stateMutability: "nonpayable";
328
332
  }];
333
+ /**
334
+ * Pinned ABI for the VaultBundlesV1 entrypoints used by Vault V1 and Vault V2 actions.
335
+ *
336
+ * Sourced from `morpho-org/bundles` commit
337
+ * `f27e7bcf744310303e24faa522b71d702e696686`.
338
+ */
339
+ export declare const vaultBundlesV1Abi: readonly [{
340
+ readonly type: "error";
341
+ readonly name: "AlreadyInitiated";
342
+ readonly inputs: readonly [];
343
+ }, {
344
+ readonly type: "error";
345
+ readonly name: "DeadlinePassed";
346
+ readonly inputs: readonly [];
347
+ }, {
348
+ readonly type: "error";
349
+ readonly name: "InconsistentAssets";
350
+ readonly inputs: readonly [];
351
+ }, {
352
+ readonly type: "error";
353
+ readonly name: "NotExactlyOneZero";
354
+ readonly inputs: readonly [];
355
+ }, {
356
+ readonly type: "error";
357
+ readonly name: "PctExceeded";
358
+ readonly inputs: readonly [];
359
+ }, {
360
+ readonly type: "error";
361
+ readonly name: "SlippageExceeded";
362
+ readonly inputs: readonly [];
363
+ }, {
364
+ readonly type: "function";
365
+ readonly name: "initiator";
366
+ readonly inputs: readonly [];
367
+ readonly outputs: readonly [{
368
+ readonly name: "";
369
+ readonly type: "address";
370
+ readonly internalType: "address";
371
+ }];
372
+ readonly stateMutability: "view";
373
+ }, {
374
+ readonly type: "function";
375
+ readonly name: "vaultBundlesV1Deposit";
376
+ readonly inputs: readonly [{
377
+ readonly name: "vault";
378
+ readonly type: "address";
379
+ readonly internalType: "address";
380
+ }, {
381
+ readonly name: "assets";
382
+ readonly type: "uint256";
383
+ readonly internalType: "uint256";
384
+ }, {
385
+ readonly name: "maxSharePriceE27";
386
+ readonly type: "uint256";
387
+ readonly internalType: "uint256";
388
+ }, {
389
+ readonly name: "assetPermit";
390
+ readonly type: "tuple";
391
+ readonly internalType: "struct TokenPermit";
392
+ readonly components: readonly [{
393
+ readonly name: "kind";
394
+ readonly type: "uint8";
395
+ readonly internalType: "enum PermitKind";
396
+ }, {
397
+ readonly name: "data";
398
+ readonly type: "bytes";
399
+ readonly internalType: "bytes";
400
+ }];
401
+ }, {
402
+ readonly name: "referralFeePct";
403
+ readonly type: "uint256";
404
+ readonly internalType: "uint256";
405
+ }, {
406
+ readonly name: "referralFeeRecipient";
407
+ readonly type: "address";
408
+ readonly internalType: "address";
409
+ }, {
410
+ readonly name: "deadline";
411
+ readonly type: "uint256";
412
+ readonly internalType: "uint256";
413
+ }];
414
+ readonly outputs: readonly [];
415
+ readonly stateMutability: "payable";
416
+ }, {
417
+ readonly type: "function";
418
+ readonly name: "vaultBundlesV1Withdraw";
419
+ readonly inputs: readonly [{
420
+ readonly name: "vault";
421
+ readonly type: "address";
422
+ readonly internalType: "address";
423
+ }, {
424
+ readonly name: "assets";
425
+ readonly type: "uint256";
426
+ readonly internalType: "uint256";
427
+ }, {
428
+ readonly name: "shares";
429
+ readonly type: "uint256";
430
+ readonly internalType: "uint256";
431
+ }, {
432
+ readonly name: "sharesPermit";
433
+ readonly type: "tuple";
434
+ readonly internalType: "struct Permit";
435
+ readonly components: readonly [{
436
+ readonly name: "value";
437
+ readonly type: "uint256";
438
+ readonly internalType: "uint256";
439
+ }, {
440
+ readonly name: "nonce";
441
+ readonly type: "uint256";
442
+ readonly internalType: "uint256";
443
+ }, {
444
+ readonly name: "deadline";
445
+ readonly type: "uint256";
446
+ readonly internalType: "uint256";
447
+ }, {
448
+ readonly name: "v";
449
+ readonly type: "uint8";
450
+ readonly internalType: "uint8";
451
+ }, {
452
+ readonly name: "r";
453
+ readonly type: "bytes32";
454
+ readonly internalType: "bytes32";
455
+ }, {
456
+ readonly name: "s";
457
+ readonly type: "bytes32";
458
+ readonly internalType: "bytes32";
459
+ }];
460
+ }, {
461
+ readonly name: "referralFeePct";
462
+ readonly type: "uint256";
463
+ readonly internalType: "uint256";
464
+ }, {
465
+ readonly name: "referralFeeRecipient";
466
+ readonly type: "address";
467
+ readonly internalType: "address";
468
+ }, {
469
+ readonly name: "deadline";
470
+ readonly type: "uint256";
471
+ readonly internalType: "uint256";
472
+ }];
473
+ readonly outputs: readonly [];
474
+ readonly stateMutability: "nonpayable";
475
+ }, {
476
+ readonly type: "function";
477
+ readonly name: "vaultBundlesV1Migrate";
478
+ readonly inputs: readonly [{
479
+ readonly name: "sourceVault";
480
+ readonly type: "address";
481
+ readonly internalType: "address";
482
+ }, {
483
+ readonly name: "destVault";
484
+ readonly type: "address";
485
+ readonly internalType: "address";
486
+ }, {
487
+ readonly name: "assetsWithdrawn";
488
+ readonly type: "uint256";
489
+ readonly internalType: "uint256";
490
+ }, {
491
+ readonly name: "sharesRedeemed";
492
+ readonly type: "uint256";
493
+ readonly internalType: "uint256";
494
+ }, {
495
+ readonly name: "destMaxSharePriceE27";
496
+ readonly type: "uint256";
497
+ readonly internalType: "uint256";
498
+ }, {
499
+ readonly name: "sharesPermit";
500
+ readonly type: "tuple";
501
+ readonly internalType: "struct Permit";
502
+ readonly components: readonly [{
503
+ readonly name: "value";
504
+ readonly type: "uint256";
505
+ readonly internalType: "uint256";
506
+ }, {
507
+ readonly name: "nonce";
508
+ readonly type: "uint256";
509
+ readonly internalType: "uint256";
510
+ }, {
511
+ readonly name: "deadline";
512
+ readonly type: "uint256";
513
+ readonly internalType: "uint256";
514
+ }, {
515
+ readonly name: "v";
516
+ readonly type: "uint8";
517
+ readonly internalType: "uint8";
518
+ }, {
519
+ readonly name: "r";
520
+ readonly type: "bytes32";
521
+ readonly internalType: "bytes32";
522
+ }, {
523
+ readonly name: "s";
524
+ readonly type: "bytes32";
525
+ readonly internalType: "bytes32";
526
+ }];
527
+ }, {
528
+ readonly name: "referralFeePct";
529
+ readonly type: "uint256";
530
+ readonly internalType: "uint256";
531
+ }, {
532
+ readonly name: "referralFeeRecipient";
533
+ readonly type: "address";
534
+ readonly internalType: "address";
535
+ }, {
536
+ readonly name: "deadline";
537
+ readonly type: "uint256";
538
+ readonly internalType: "uint256";
539
+ }];
540
+ readonly outputs: readonly [];
541
+ readonly stateMutability: "nonpayable";
542
+ }];
329
543
  /** ABI for the Bundler3 multicall contract. */
330
544
  export declare const bundler3Abi: readonly [{
331
545
  readonly type: "function";
@@ -1164,7 +1378,12 @@ export declare const generalAdapter1Abi: readonly [{
1164
1378
  readonly name: "ZeroShares";
1165
1379
  readonly inputs: readonly [];
1166
1380
  }];
1167
- /** ABI for the Ethereum-specific Bundler3 GeneralAdapter1 extension. */
1381
+ /**
1382
+ * ABI for the Ethereum-specific Bundler3 GeneralAdapter1 extension.
1383
+ *
1384
+ * MORPHO legacy token wrapping entries are deprecated and will be removed in the next major.
1385
+ * Use the current MORPHO token directly. Native-token and stETH wrapping remain supported.
1386
+ */
1168
1387
  export declare const ethereumGeneralAdapter1Abi: readonly [{
1169
1388
  readonly type: "receive";
1170
1389
  readonly stateMutability: "payable";
@@ -1833,10 +2052,12 @@ export declare const ethereumGeneralAdapter1Abi: readonly [{
1833
2052
  readonly type: "address";
1834
2053
  readonly internalType: "address";
1835
2054
  }, {
2055
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1836
2056
  readonly name: "morphoToken";
1837
2057
  readonly type: "address";
1838
2058
  readonly internalType: "address";
1839
2059
  }, {
2060
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1840
2061
  readonly name: "morphoWrapper";
1841
2062
  readonly type: "address";
1842
2063
  readonly internalType: "address";
@@ -1844,6 +2065,7 @@ export declare const ethereumGeneralAdapter1Abi: readonly [{
1844
2065
  readonly stateMutability: "nonpayable";
1845
2066
  }, {
1846
2067
  readonly type: "function";
2068
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1847
2069
  readonly name: "MORPHO_TOKEN";
1848
2070
  readonly inputs: readonly [];
1849
2071
  readonly outputs: readonly [{
@@ -1854,6 +2076,7 @@ export declare const ethereumGeneralAdapter1Abi: readonly [{
1854
2076
  readonly stateMutability: "view";
1855
2077
  }, {
1856
2078
  readonly type: "function";
2079
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1857
2080
  readonly name: "MORPHO_WRAPPER";
1858
2081
  readonly inputs: readonly [];
1859
2082
  readonly outputs: readonly [{
@@ -1884,6 +2107,7 @@ export declare const ethereumGeneralAdapter1Abi: readonly [{
1884
2107
  readonly stateMutability: "view";
1885
2108
  }, {
1886
2109
  readonly type: "function";
2110
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1887
2111
  readonly name: "morphoWrapperDepositFor";
1888
2112
  readonly inputs: readonly [{
1889
2113
  readonly name: "receiver";
@@ -1898,6 +2122,7 @@ export declare const ethereumGeneralAdapter1Abi: readonly [{
1898
2122
  readonly stateMutability: "nonpayable";
1899
2123
  }, {
1900
2124
  readonly type: "function";
2125
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1901
2126
  readonly name: "morphoWrapperWithdrawTo";
1902
2127
  readonly inputs: readonly [{
1903
2128
  readonly name: "receiver";
package/lib/cjs/abis.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compoundV3MigrationAdapterAbi = exports.compoundV2MigrationAdapterAbi = exports.aaveV3OptimizerMigrationAdapterAbi = exports.aaveV3MigrationAdapterAbi = exports.aaveV2MigrationAdapterAbi = exports.erc20WrapperAdapterAbi = exports.paraswapAdapterAbi = exports.ethereumGeneralAdapter1Abi = exports.generalAdapter1Abi = exports.coreAdapterAbi = exports.bundler3Abi = exports.vaultExitBundlesV1Abi = exports.setterRatifierAbi = exports.midnightSetterRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = exports.ecrecoverRatifierAbi = exports.midnightEcrecoverRatifierAbi = exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.vaultV1PublicAllocatorAbi = exports.vaultV1AdapterFactoryAbi = exports.vaultV1AdapterAbi = exports.publicAllocatorAbi = exports.preLiquidationFactoryAbi = exports.bluePreLiquidationFactoryAbi = exports.preLiquidationAbi = exports.bluePreLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.blueAdaptiveCurveIrmAbi = exports.marketParamsAbi = exports.blueMarketParamsAbi = void 0;
4
- exports.blueBundlesV1Abi = void 0;
3
+ exports.compoundV2MigrationAdapterAbi = exports.aaveV3OptimizerMigrationAdapterAbi = exports.aaveV3MigrationAdapterAbi = exports.aaveV2MigrationAdapterAbi = exports.erc20WrapperAdapterAbi = exports.paraswapAdapterAbi = exports.ethereumGeneralAdapter1Abi = exports.generalAdapter1Abi = exports.coreAdapterAbi = exports.bundler3Abi = exports.vaultBundlesV1Abi = exports.vaultExitBundlesV1Abi = exports.setterRatifierAbi = exports.midnightSetterRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = exports.ecrecoverRatifierAbi = exports.midnightEcrecoverRatifierAbi = exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.vaultV1PublicAllocatorAbi = exports.vaultV1AdapterFactoryAbi = exports.vaultV1AdapterAbi = exports.publicAllocatorAbi = exports.preLiquidationFactoryAbi = exports.bluePreLiquidationFactoryAbi = exports.preLiquidationAbi = exports.bluePreLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.blueAdaptiveCurveIrmAbi = exports.marketParamsAbi = exports.blueMarketParamsAbi = void 0;
4
+ exports.blueBundlesV1Abi = exports.compoundV3MigrationAdapterAbi = void 0;
5
5
  var blue_sdk_1 = require("@morpho-org/blue-sdk");
6
6
  Object.defineProperty(exports, "blueMarketParamsAbi", { enumerable: true, get: function () { return blue_sdk_1.marketParamsAbi; } });
7
7
  /** @deprecated Use `blueMarketParamsAbi` or the raw `/blue/abis` subpath. */
@@ -30,9 +30,11 @@ Object.defineProperty(exports, "preLiquidationAbi", { enumerable: true, get: fun
30
30
  Object.defineProperty(exports, "bluePreLiquidationFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.preLiquidationFactoryAbi; } });
31
31
  /** @deprecated Use `bluePreLiquidationFactoryAbi` or the raw `/blue/abis` subpath. */
32
32
  Object.defineProperty(exports, "preLiquidationFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.preLiquidationFactoryAbi; } });
33
+ /** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
33
34
  Object.defineProperty(exports, "publicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.publicAllocatorAbi; } });
34
35
  Object.defineProperty(exports, "vaultV1AdapterAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1AdapterAbi; } });
35
36
  Object.defineProperty(exports, "vaultV1AdapterFactoryAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1AdapterFactoryAbi; } });
37
+ /** @deprecated Vault V1 PublicAllocator support will be removed in the next major. Use `vaultV2BluePublicAllocatorAbi`. */
36
38
  Object.defineProperty(exports, "vaultV1PublicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV1PublicAllocatorAbi; } });
37
39
  Object.defineProperty(exports, "vaultV2Abi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2Abi; } });
38
40
  Object.defineProperty(exports, "vaultV2BluePublicAllocatorAbi", { enumerable: true, get: function () { return blue_sdk_viem_1.vaultV2BluePublicAllocatorAbi; } });
@@ -215,6 +217,146 @@ exports.vaultExitBundlesV1Abi = [
215
217
  stateMutability: "nonpayable",
216
218
  },
217
219
  ];
220
+ /**
221
+ * Pinned ABI for the VaultBundlesV1 entrypoints used by Vault V1 and Vault V2 actions.
222
+ *
223
+ * Sourced from `morpho-org/bundles` commit
224
+ * `f27e7bcf744310303e24faa522b71d702e696686`.
225
+ */
226
+ exports.vaultBundlesV1Abi = [
227
+ { type: "error", name: "AlreadyInitiated", inputs: [] },
228
+ { type: "error", name: "DeadlinePassed", inputs: [] },
229
+ { type: "error", name: "InconsistentAssets", inputs: [] },
230
+ { type: "error", name: "NotExactlyOneZero", inputs: [] },
231
+ { type: "error", name: "PctExceeded", inputs: [] },
232
+ { type: "error", name: "SlippageExceeded", inputs: [] },
233
+ {
234
+ type: "function",
235
+ name: "initiator",
236
+ inputs: [],
237
+ outputs: [{ name: "", type: "address", internalType: "address" }],
238
+ stateMutability: "view",
239
+ },
240
+ {
241
+ type: "function",
242
+ name: "vaultBundlesV1Deposit",
243
+ inputs: [
244
+ { name: "vault", type: "address", internalType: "address" },
245
+ { name: "assets", type: "uint256", internalType: "uint256" },
246
+ {
247
+ name: "maxSharePriceE27",
248
+ type: "uint256",
249
+ internalType: "uint256",
250
+ },
251
+ {
252
+ name: "assetPermit",
253
+ type: "tuple",
254
+ internalType: "struct TokenPermit",
255
+ components: [
256
+ { name: "kind", type: "uint8", internalType: "enum PermitKind" },
257
+ { name: "data", type: "bytes", internalType: "bytes" },
258
+ ],
259
+ },
260
+ {
261
+ name: "referralFeePct",
262
+ type: "uint256",
263
+ internalType: "uint256",
264
+ },
265
+ {
266
+ name: "referralFeeRecipient",
267
+ type: "address",
268
+ internalType: "address",
269
+ },
270
+ { name: "deadline", type: "uint256", internalType: "uint256" },
271
+ ],
272
+ outputs: [],
273
+ stateMutability: "payable",
274
+ },
275
+ {
276
+ type: "function",
277
+ name: "vaultBundlesV1Withdraw",
278
+ inputs: [
279
+ { name: "vault", type: "address", internalType: "address" },
280
+ { name: "assets", type: "uint256", internalType: "uint256" },
281
+ { name: "shares", type: "uint256", internalType: "uint256" },
282
+ {
283
+ name: "sharesPermit",
284
+ type: "tuple",
285
+ internalType: "struct Permit",
286
+ components: [
287
+ { name: "value", type: "uint256", internalType: "uint256" },
288
+ { name: "nonce", type: "uint256", internalType: "uint256" },
289
+ { name: "deadline", type: "uint256", internalType: "uint256" },
290
+ { name: "v", type: "uint8", internalType: "uint8" },
291
+ { name: "r", type: "bytes32", internalType: "bytes32" },
292
+ { name: "s", type: "bytes32", internalType: "bytes32" },
293
+ ],
294
+ },
295
+ {
296
+ name: "referralFeePct",
297
+ type: "uint256",
298
+ internalType: "uint256",
299
+ },
300
+ {
301
+ name: "referralFeeRecipient",
302
+ type: "address",
303
+ internalType: "address",
304
+ },
305
+ { name: "deadline", type: "uint256", internalType: "uint256" },
306
+ ],
307
+ outputs: [],
308
+ stateMutability: "nonpayable",
309
+ },
310
+ {
311
+ type: "function",
312
+ name: "vaultBundlesV1Migrate",
313
+ inputs: [
314
+ { name: "sourceVault", type: "address", internalType: "address" },
315
+ { name: "destVault", type: "address", internalType: "address" },
316
+ {
317
+ name: "assetsWithdrawn",
318
+ type: "uint256",
319
+ internalType: "uint256",
320
+ },
321
+ {
322
+ name: "sharesRedeemed",
323
+ type: "uint256",
324
+ internalType: "uint256",
325
+ },
326
+ {
327
+ name: "destMaxSharePriceE27",
328
+ type: "uint256",
329
+ internalType: "uint256",
330
+ },
331
+ {
332
+ name: "sharesPermit",
333
+ type: "tuple",
334
+ internalType: "struct Permit",
335
+ components: [
336
+ { name: "value", type: "uint256", internalType: "uint256" },
337
+ { name: "nonce", type: "uint256", internalType: "uint256" },
338
+ { name: "deadline", type: "uint256", internalType: "uint256" },
339
+ { name: "v", type: "uint8", internalType: "uint8" },
340
+ { name: "r", type: "bytes32", internalType: "bytes32" },
341
+ { name: "s", type: "bytes32", internalType: "bytes32" },
342
+ ],
343
+ },
344
+ {
345
+ name: "referralFeePct",
346
+ type: "uint256",
347
+ internalType: "uint256",
348
+ },
349
+ {
350
+ name: "referralFeeRecipient",
351
+ type: "address",
352
+ internalType: "address",
353
+ },
354
+ { name: "deadline", type: "uint256", internalType: "uint256" },
355
+ ],
356
+ outputs: [],
357
+ stateMutability: "nonpayable",
358
+ },
359
+ ];
218
360
  /** ABI for the Bundler3 multicall contract. */
219
361
  exports.bundler3Abi = [
220
362
  {
@@ -1182,7 +1324,12 @@ exports.generalAdapter1Abi = [
1182
1324
  inputs: [],
1183
1325
  },
1184
1326
  ];
1185
- /** ABI for the Ethereum-specific Bundler3 GeneralAdapter1 extension. */
1327
+ /**
1328
+ * ABI for the Ethereum-specific Bundler3 GeneralAdapter1 extension.
1329
+ *
1330
+ * MORPHO legacy token wrapping entries are deprecated and will be removed in the next major.
1331
+ * Use the current MORPHO token directly. Native-token and stETH wrapping remain supported.
1332
+ */
1186
1333
  exports.ethereumGeneralAdapter1Abi = [
1187
1334
  ...exports.generalAdapter1Abi,
1188
1335
  {
@@ -1209,11 +1356,13 @@ exports.ethereumGeneralAdapter1Abi = [
1209
1356
  internalType: "address",
1210
1357
  },
1211
1358
  {
1359
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1212
1360
  name: "morphoToken",
1213
1361
  type: "address",
1214
1362
  internalType: "address",
1215
1363
  },
1216
1364
  {
1365
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1217
1366
  name: "morphoWrapper",
1218
1367
  type: "address",
1219
1368
  internalType: "address",
@@ -1223,6 +1372,7 @@ exports.ethereumGeneralAdapter1Abi = [
1223
1372
  },
1224
1373
  {
1225
1374
  type: "function",
1375
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1226
1376
  name: "MORPHO_TOKEN",
1227
1377
  inputs: [],
1228
1378
  outputs: [
@@ -1236,6 +1386,7 @@ exports.ethereumGeneralAdapter1Abi = [
1236
1386
  },
1237
1387
  {
1238
1388
  type: "function",
1389
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1239
1390
  name: "MORPHO_WRAPPER",
1240
1391
  inputs: [],
1241
1392
  outputs: [
@@ -1275,6 +1426,7 @@ exports.ethereumGeneralAdapter1Abi = [
1275
1426
  },
1276
1427
  {
1277
1428
  type: "function",
1429
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1278
1430
  name: "morphoWrapperDepositFor",
1279
1431
  inputs: [
1280
1432
  {
@@ -1293,6 +1445,7 @@ exports.ethereumGeneralAdapter1Abi = [
1293
1445
  },
1294
1446
  {
1295
1447
  type: "function",
1448
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1296
1449
  name: "morphoWrapperWithdrawTo",
1297
1450
  inputs: [
1298
1451
  {
@@ -60,7 +60,7 @@ export interface BlueBorrowParams {
60
60
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
61
61
  * @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
62
62
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
63
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
63
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
64
64
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
65
65
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
66
66
  * @example
@@ -33,7 +33,7 @@ const supplyCollateralBorrow_js_1 = require("./supplyCollateralBorrow.js");
33
33
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
34
34
  * @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
35
35
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
36
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
36
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
37
37
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
38
38
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
39
39
  * @example
@@ -1,6 +1,7 @@
1
1
  import { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address, type Hex } from "viem";
3
- import { type AuthorizationRequirementSignature, type BaseAction, type BlueBundlesV1TokenRequirementSignature, type Metadata, type RequirementSignature, type TokenRequirementSignature, type Transaction, type VaultV2BlueReallocation } from "../../types/index.js";
3
+ import { type AuthorizationRequirementSignature, type BaseAction, type BundlesTokenRequirementSignature, type Metadata, type RequirementSignature, type Transaction, type VaultV2BlueReallocation } from "../../types/index.js";
4
+ import { type BundlesTokenPermit } from "../bundles/index.js";
4
5
  /** @internal */
5
6
  export interface BlueBundlesV1CommonParams {
6
7
  chainId: number;
@@ -15,21 +16,7 @@ export interface NormalizedBlueBundlesV1CommonParams {
15
16
  referralFeePct: bigint;
16
17
  referralFeeRecipient: Address;
17
18
  }
18
- /**
19
- * BlueBundlesV1 token-permit discriminator carried in the encoded permit struct: `none` (0) skips
20
- * the pull, `erc2612` (1) is an ERC-2612 permit, `permit2TransferFrom` (2) is a Permit2
21
- * SignatureTransfer. Named so a transposed literal can't silently route a permit to the wrong branch.
22
- * @internal
23
- */
24
- declare const BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND: {
25
- readonly none: 0;
26
- readonly erc2612: 1;
27
- readonly permit2TransferFrom: 2;
28
- };
29
- interface BlueBundlesV1TokenPermit {
30
- kind: (typeof BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND)[keyof typeof BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND];
31
- data: Hex;
32
- }
19
+ type BlueBundlesV1TokenPermit = BundlesTokenPermit;
33
20
  interface BlueBundlesV1SignedAuthorization {
34
21
  signature: {
35
22
  v: number;
@@ -47,7 +34,7 @@ export declare const validateBlueBundlesV1NativeFunding: (params: {
47
34
  token: Address;
48
35
  fundedAmount: bigint;
49
36
  nativeAmount?: bigint;
50
- requirementSignature?: BlueBundlesV1TokenRequirementSignature;
37
+ requirementSignature?: BundlesTokenRequirementSignature;
51
38
  }) => bigint;
52
39
  /** @internal */
53
40
  export declare const getBlueBundlesV1TokenPermit: (params: {
@@ -55,7 +42,7 @@ export declare const getBlueBundlesV1TokenPermit: (params: {
55
42
  userAddress: Address;
56
43
  token: Address;
57
44
  amount: bigint;
58
- requirementSignature?: TokenRequirementSignature;
45
+ requirementSignature?: BundlesTokenRequirementSignature;
59
46
  }) => BlueBundlesV1TokenPermit;
60
47
  /** @internal */
61
48
  export declare const getBlueBundlesV1SignedAuthorization: (params: {
@@ -86,7 +73,7 @@ export declare const selectBlueBundlesV1RequirementSignatures: (signatures: read
86
73
  token?: boolean;
87
74
  authorization?: boolean;
88
75
  }) => {
89
- token?: BlueBundlesV1TokenRequirementSignature;
76
+ token?: BundlesTokenRequirementSignature;
90
77
  authorization?: AuthorizationRequirementSignature;
91
78
  };
92
79
  /** @internal */