@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/esm/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/esm/abis.js 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,
@@ -179,6 +183,146 @@ export const vaultExitBundlesV1Abi = [
179
183
  stateMutability: "nonpayable",
180
184
  },
181
185
  ];
186
+ /**
187
+ * Pinned ABI for the VaultBundlesV1 entrypoints used by Vault V1 and Vault V2 actions.
188
+ *
189
+ * Sourced from `morpho-org/bundles` commit
190
+ * `f27e7bcf744310303e24faa522b71d702e696686`.
191
+ */
192
+ export const vaultBundlesV1Abi = [
193
+ { type: "error", name: "AlreadyInitiated", inputs: [] },
194
+ { type: "error", name: "DeadlinePassed", inputs: [] },
195
+ { type: "error", name: "InconsistentAssets", inputs: [] },
196
+ { type: "error", name: "NotExactlyOneZero", inputs: [] },
197
+ { type: "error", name: "PctExceeded", inputs: [] },
198
+ { type: "error", name: "SlippageExceeded", inputs: [] },
199
+ {
200
+ type: "function",
201
+ name: "initiator",
202
+ inputs: [],
203
+ outputs: [{ name: "", type: "address", internalType: "address" }],
204
+ stateMutability: "view",
205
+ },
206
+ {
207
+ type: "function",
208
+ name: "vaultBundlesV1Deposit",
209
+ inputs: [
210
+ { name: "vault", type: "address", internalType: "address" },
211
+ { name: "assets", type: "uint256", internalType: "uint256" },
212
+ {
213
+ name: "maxSharePriceE27",
214
+ type: "uint256",
215
+ internalType: "uint256",
216
+ },
217
+ {
218
+ name: "assetPermit",
219
+ type: "tuple",
220
+ internalType: "struct TokenPermit",
221
+ components: [
222
+ { name: "kind", type: "uint8", internalType: "enum PermitKind" },
223
+ { name: "data", type: "bytes", internalType: "bytes" },
224
+ ],
225
+ },
226
+ {
227
+ name: "referralFeePct",
228
+ type: "uint256",
229
+ internalType: "uint256",
230
+ },
231
+ {
232
+ name: "referralFeeRecipient",
233
+ type: "address",
234
+ internalType: "address",
235
+ },
236
+ { name: "deadline", type: "uint256", internalType: "uint256" },
237
+ ],
238
+ outputs: [],
239
+ stateMutability: "payable",
240
+ },
241
+ {
242
+ type: "function",
243
+ name: "vaultBundlesV1Withdraw",
244
+ inputs: [
245
+ { name: "vault", type: "address", internalType: "address" },
246
+ { name: "assets", type: "uint256", internalType: "uint256" },
247
+ { name: "shares", type: "uint256", internalType: "uint256" },
248
+ {
249
+ name: "sharesPermit",
250
+ type: "tuple",
251
+ internalType: "struct Permit",
252
+ components: [
253
+ { name: "value", type: "uint256", internalType: "uint256" },
254
+ { name: "nonce", type: "uint256", internalType: "uint256" },
255
+ { name: "deadline", type: "uint256", internalType: "uint256" },
256
+ { name: "v", type: "uint8", internalType: "uint8" },
257
+ { name: "r", type: "bytes32", internalType: "bytes32" },
258
+ { name: "s", type: "bytes32", internalType: "bytes32" },
259
+ ],
260
+ },
261
+ {
262
+ name: "referralFeePct",
263
+ type: "uint256",
264
+ internalType: "uint256",
265
+ },
266
+ {
267
+ name: "referralFeeRecipient",
268
+ type: "address",
269
+ internalType: "address",
270
+ },
271
+ { name: "deadline", type: "uint256", internalType: "uint256" },
272
+ ],
273
+ outputs: [],
274
+ stateMutability: "nonpayable",
275
+ },
276
+ {
277
+ type: "function",
278
+ name: "vaultBundlesV1Migrate",
279
+ inputs: [
280
+ { name: "sourceVault", type: "address", internalType: "address" },
281
+ { name: "destVault", type: "address", internalType: "address" },
282
+ {
283
+ name: "assetsWithdrawn",
284
+ type: "uint256",
285
+ internalType: "uint256",
286
+ },
287
+ {
288
+ name: "sharesRedeemed",
289
+ type: "uint256",
290
+ internalType: "uint256",
291
+ },
292
+ {
293
+ name: "destMaxSharePriceE27",
294
+ type: "uint256",
295
+ internalType: "uint256",
296
+ },
297
+ {
298
+ name: "sharesPermit",
299
+ type: "tuple",
300
+ internalType: "struct Permit",
301
+ components: [
302
+ { name: "value", type: "uint256", internalType: "uint256" },
303
+ { name: "nonce", type: "uint256", internalType: "uint256" },
304
+ { name: "deadline", type: "uint256", internalType: "uint256" },
305
+ { name: "v", type: "uint8", internalType: "uint8" },
306
+ { name: "r", type: "bytes32", internalType: "bytes32" },
307
+ { name: "s", type: "bytes32", internalType: "bytes32" },
308
+ ],
309
+ },
310
+ {
311
+ name: "referralFeePct",
312
+ type: "uint256",
313
+ internalType: "uint256",
314
+ },
315
+ {
316
+ name: "referralFeeRecipient",
317
+ type: "address",
318
+ internalType: "address",
319
+ },
320
+ { name: "deadline", type: "uint256", internalType: "uint256" },
321
+ ],
322
+ outputs: [],
323
+ stateMutability: "nonpayable",
324
+ },
325
+ ];
182
326
  /** ABI for the Bundler3 multicall contract. */
183
327
  export const bundler3Abi = [
184
328
  {
@@ -1146,7 +1290,12 @@ export const generalAdapter1Abi = [
1146
1290
  inputs: [],
1147
1291
  },
1148
1292
  ];
1149
- /** ABI for the Ethereum-specific Bundler3 GeneralAdapter1 extension. */
1293
+ /**
1294
+ * ABI for the Ethereum-specific Bundler3 GeneralAdapter1 extension.
1295
+ *
1296
+ * MORPHO legacy token wrapping entries are deprecated and will be removed in the next major.
1297
+ * Use the current MORPHO token directly. Native-token and stETH wrapping remain supported.
1298
+ */
1150
1299
  export const ethereumGeneralAdapter1Abi = [
1151
1300
  ...generalAdapter1Abi,
1152
1301
  {
@@ -1173,11 +1322,13 @@ export const ethereumGeneralAdapter1Abi = [
1173
1322
  internalType: "address",
1174
1323
  },
1175
1324
  {
1325
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1176
1326
  name: "morphoToken",
1177
1327
  type: "address",
1178
1328
  internalType: "address",
1179
1329
  },
1180
1330
  {
1331
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1181
1332
  name: "morphoWrapper",
1182
1333
  type: "address",
1183
1334
  internalType: "address",
@@ -1187,6 +1338,7 @@ export const ethereumGeneralAdapter1Abi = [
1187
1338
  },
1188
1339
  {
1189
1340
  type: "function",
1341
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1190
1342
  name: "MORPHO_TOKEN",
1191
1343
  inputs: [],
1192
1344
  outputs: [
@@ -1200,6 +1352,7 @@ export const ethereumGeneralAdapter1Abi = [
1200
1352
  },
1201
1353
  {
1202
1354
  type: "function",
1355
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1203
1356
  name: "MORPHO_WRAPPER",
1204
1357
  inputs: [],
1205
1358
  outputs: [
@@ -1239,6 +1392,7 @@ export const ethereumGeneralAdapter1Abi = [
1239
1392
  },
1240
1393
  {
1241
1394
  type: "function",
1395
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1242
1396
  name: "morphoWrapperDepositFor",
1243
1397
  inputs: [
1244
1398
  {
@@ -1257,6 +1411,7 @@ export const ethereumGeneralAdapter1Abi = [
1257
1411
  },
1258
1412
  {
1259
1413
  type: "function",
1414
+ /** @deprecated MORPHO legacy token wrapping will be removed in the next major. Use the current MORPHO token directly. */
1260
1415
  name: "morphoWrapperWithdrawTo",
1261
1416
  inputs: [
1262
1417
  {
@@ -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
@@ -30,7 +30,7 @@ import { blueSupplyCollateralBorrow } from "./supplyCollateralBorrow.js";
30
30
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
31
31
  * @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
32
32
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
33
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
33
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
34
34
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
35
35
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
36
36
  * @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 */