@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
@@ -1,130 +1,131 @@
1
- import { getChainAddresses } from "@morpho-org/blue-sdk";
2
- import { deepFreeze, isDefined } from "@morpho-org/morpho-ts";
3
- import { isAddressEqual } from "viem";
4
- import { BundlerAction } from "../../bundler/index.js";
5
- import { addTransactionMetadata } from "../../helpers/index.js";
6
- import { ChainWNativeMissingError, NativeAmountOnNonWNativeVaultError, NegativeInputError, NonPositiveInputError, } from "../../types/index.js";
7
- import { getTokenRequirementActions } from "../signatures/getTokenRequirementActions.js";
1
+ import { getChainAddress } from "@morpho-org/morpho-ts";
2
+ import { encodeFunctionData } from "viem";
3
+ import { vaultBundlesV1Abi } from "../../abis.js";
4
+ import { validateNativeVaultAsset, validateUint256Field, } from "../../helpers/validate.js";
5
+ import { NonPositiveInputError, UnexpectedRequirementSignatureError, } from "../../types/index.js";
6
+ import { finalizeVaultBundlesV1Transaction, getBundlesReferralFeeAssets, getBundlesTokenPermit, normalizeBundlesCommonParams, resolveBundlesFunding, } from "../bundles/common.js";
8
7
  /**
9
- * Prepares a deposit transaction for a VaultV1 (MetaMorpho) contract.
8
+ * Encodes a Vault V1 deposit through the registered VaultBundlesV1 contract.
10
9
  *
11
- * Routed through bundler3 to atomically execute the asset transfer and vault deposit. The
12
- * `GeneralAdapter1` enforces `maxSharePrice` on-chain to prevent inflation attacks. Never bypass
13
- * the general adapter.
14
- *
15
- * When `nativeAmount > 0`, that amount of native ETH is sent as `msg.value` to the bundler3
16
- * multicall and wrapped into wNative via `GeneralAdapter1.wrapNative()`. The vault's underlying
17
- * asset must be the chain's wrapped native token.
18
- *
19
- * @param params.vault.chainId - The chain the vault lives on.
20
- * @param params.vault.address - The VaultV1 (MetaMorpho) address.
21
- * @param params.vault.asset - The vault's underlying ERC-20 asset.
22
- * @param params.args.amount - Amount of ERC-20 assets to deposit. At least one of `amount` or
23
- * `nativeAmount` must be positive. Defaults to `0n`.
24
- * @param params.args.maxSharePrice - Maximum acceptable share price (in RAY, slippage
25
- * protection enforced on-chain by `GeneralAdapter1`).
26
- * @param params.args.recipient - Address that receives the minted vault shares.
27
- * @param params.args.requirementSignature - Optional pre-signed permit/permit2 approval.
28
- * @param params.args.nativeAmount - Optional amount of native token to wrap into wNative for the
29
- * deposit. Requires the vault asset to be the chain's wNative.
30
- * @param params.metadata - Optional analytics metadata attached to the bundle.
31
- * @returns A deep-frozen `Transaction<VaultV1DepositAction>` with `to`, `value`, `data`, and the
32
- * typed `action` discriminator the simulation layer consumes.
33
- * @throws {NegativeInputError} when `amount < 0n` or `nativeAmount < 0n`.
34
- * @throws {NonPositiveInputError} when `maxSharePrice <= 0n`, or when both `amount` and
35
- * `nativeAmount` resolve to zero.
36
- * @throws {ChainWNativeMissingError} when `nativeAmount` is provided but the chain has no
37
- * configured wNative.
38
- * @throws {NativeAmountOnNonWNativeVaultError} when `nativeAmount` is provided but the vault
39
- * asset is not the chain's wNative.
40
- * @throws {DepositAssetMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
41
- * `requirementSignature` is provided and the signed asset differs from `vault.asset`. The
42
- * signature is ignored on the native-only path (`amount === 0n` with `nativeAmount > 0n`).
43
- * @throws {DepositAmountMismatchError} from `getTokenRequirementActions` when `amount > 0n` and
44
- * `requirementSignature` is provided and the signed amount differs from `args.amount`.
45
- * @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when `amount > 0n` and a
46
- * Permit2 requirement signature is missing its expiration.
10
+ * @param params.vault.chainId - Chain containing the vault and its registered VaultBundlesV1 contract.
11
+ * @param params.vault.address - Vault V1 contract receiving the net deposit.
12
+ * @param params.vault.asset - Underlying ERC-20 asset; must be the chain's wNative for native funding.
13
+ * @param params.args.amount - Positive gross ERC-20 amount in asset base units, exclusive with `nativeAmount`.
14
+ * @param params.args.nativeAmount - Positive gross native amount in wei, exclusive with `amount` and
15
+ * `requirementSignature`; sent as `tx.value` and wrapped by VaultBundlesV1.
16
+ * @param params.args.maxSharePrice - Positive maximum asset base units per share base unit, scaled
17
+ * by RAY (1e27). Compute it for the net deposit after referral fees to bound slippage.
18
+ * @param params.args.userAddress - Permit owner and transaction sender; VaultBundlesV1 mints shares to this account.
19
+ * @param params.args.recipient - Unsupported; shares are always minted to the transaction sender.
20
+ * @param params.args.requirementSignature - Optional ERC-2612 or Permit2 SignatureTransfer signature
21
+ * for the gross amount, vault asset, `userAddress`, and VaultBundlesV1 spender.
22
+ * @param params.args.referralFeePct - Optional WAD-scaled fee in [0, 1e18), defaulting to zero.
23
+ * The fee is rounded down and deducted from gross assets before depositing.
24
+ * @param params.args.referralFeeRecipient - Optional fee recipient; a nonzero address is required
25
+ * when `referralFeePct > 0n`.
26
+ * @param params.args.deadline - Positive uint256 Unix timestamp in seconds after which execution
27
+ * reverts. The caller must supply it; the builder chooses no default.
28
+ * @param params.metadata - Optional analytics metadata appended to the transaction calldata.
29
+ * @param params.metadata.origin - Hex origin identifier of at most four bytes, with an optional `0x` prefix.
30
+ * @param params.metadata.timestamp - Optional flag to append the current timestamp; defaults to false.
31
+ * @returns A deep-frozen `Transaction<VaultV1DepositAction>` targeting VaultBundlesV1, with
32
+ * `to`, `value`, `data`, and gross/fee/net deposit action metadata.
33
+ * @throws {MixedBundlesFundingError} when ERC-20 and native funding are both supplied.
34
+ * @throws {NegativeInputError} when the selected funding amount or `referralFeePct` is negative.
35
+ * @throws {NonPositiveInputError} when funding, `maxSharePrice`, or `deadline` is not positive.
36
+ * @throws {ChainWNativeMissingError} when native funding is requested on a chain without wNative.
37
+ * @throws {NativeAmountOnNonWNativeVaultError} when native funding targets a non-wNative vault.
38
+ * @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD; it extends
39
+ * {@link InputExceedsMaxError}, so either class catches it.
40
+ * @throws {ReferralFeeRecipientMissingError} when a positive `referralFeePct` has no recipient.
41
+ * @throws {UnexpectedRequirementSignatureError} when native funding carries a token permit or a
42
+ * Permit2 AllowanceTransfer signature is supplied.
43
+ * @throws {InputExceedsMaxError} when funding, `maxSharePrice`, or `deadline` exceeds uint256.
44
+ * @throws {DepositOwnerMismatchError} when the signed owner differs from `userAddress`.
45
+ * @throws {DepositAssetMismatchError} when the signed asset differs from the vault asset.
46
+ * @throws {DepositAmountMismatchError} when the signed amount differs from the gross funding amount.
47
+ * @throws {DepositSpenderMismatchError} when the signed spender is not VaultBundlesV1.
48
+ * @throws {BundlesRequirementSignatureMismatchError} when the signature deadline, nonce, or encoding is invalid.
49
+ * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
50
+ * @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
47
51
  * @example
48
52
  * ```ts
53
+ * import { vaults } from "@morpho-org/morpho-test";
49
54
  * import { vaultV1Deposit } from "@morpho-org/morpho-sdk";
55
+ * import type { Address } from "viem";
56
+ * import { mainnet } from "viem/chains";
50
57
  *
51
- * const tx = vaultV1Deposit({
52
- * vault: { chainId: 1, address: vaultAddress, asset: USDC },
53
- * args: {
54
- * amount: 1_000_000n,
55
- * maxSharePrice: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
56
- * recipient: depositor,
57
- * },
58
- * });
59
- * // tx satisfies Readonly<Transaction<VaultV1DepositAction>>
58
+ * export function buildSteakUsdcDeposit(
59
+ * userAddress: Address,
60
+ * maxSharePrice: bigint,
61
+ * deadline: bigint,
62
+ * ) {
63
+ * const vault = vaults[mainnet.id].steakUsdc;
64
+ * const tx = vaultV1Deposit({
65
+ * vault: { chainId: mainnet.id, address: vault.address, asset: vault.asset },
66
+ * args: { amount: 1_000_000n, maxSharePrice, userAddress, deadline },
67
+ * });
68
+ * // tx satisfies Readonly<Transaction<VaultV1DepositAction>>
69
+ * return tx;
70
+ * }
60
71
  * ```
61
72
  */
62
- export const vaultV1Deposit = ({ vault: { chainId, address: vaultAddress, asset }, args: { amount = 0n, maxSharePrice, recipient, requirementSignature, nativeAmount, }, metadata, }) => {
63
- if (amount < 0n) {
64
- throw new NegativeInputError("amount", amount);
73
+ export const vaultV1Deposit = (params) => {
74
+ const funding = resolveBundlesFunding(params.args);
75
+ if (params.args.maxSharePrice <= 0n) {
76
+ throw new NonPositiveInputError("maxSharePrice", params.args.maxSharePrice);
65
77
  }
66
- if (maxSharePrice <= 0n) {
67
- throw new NonPositiveInputError("maxSharePrice", maxSharePrice);
68
- }
69
- const actions = [];
70
- const { bundler3: { generalAdapter1, bundler3 }, wNative, } = getChainAddresses(chainId);
71
- if (nativeAmount) {
72
- if (nativeAmount < 0n) {
73
- throw new NegativeInputError("nativeAmount", nativeAmount);
74
- }
75
- if (!isDefined(wNative)) {
76
- throw new ChainWNativeMissingError(chainId);
78
+ // Reject ABI overflow with SDK errors before calldata encoding.
79
+ validateUint256Field(funding.value > 0n ? "nativeAmount" : "amount", funding.assets);
80
+ validateUint256Field("maxSharePrice", params.args.maxSharePrice);
81
+ if (funding.value > 0n) {
82
+ // Reject native funding unless the vault accepts the chain's wrapped-native asset.
83
+ validateNativeVaultAsset(params.vault.chainId, params.vault.asset);
84
+ if (params.args.requirementSignature != null) {
85
+ throw new UnexpectedRequirementSignatureError(params.args.requirementSignature.action.type);
77
86
  }
78
- if (!isAddressEqual(asset, wNative)) {
79
- throw new NativeAmountOnNonWNativeVaultError(asset, wNative);
80
- }
81
- actions.push(
82
- // Transfers native token from Bundler3 to GeneralAdapter1 for wrapping.
83
- {
84
- type: "nativeTransfer",
85
- args: [bundler3, generalAdapter1, nativeAmount, false /* skipRevert */],
86
- }, {
87
- type: "wrapNative",
88
- args: [nativeAmount, generalAdapter1, false /* skipRevert */],
89
- });
90
- }
91
- if (amount > 0n) {
92
- actions.push(...getTokenRequirementActions({
93
- asset,
94
- amount,
95
- recipient: generalAdapter1,
96
- requirementSignature,
97
- }));
98
87
  }
99
- const totalAssets = amount + (nativeAmount ?? 0n);
100
- if (totalAssets === 0n) {
101
- throw new NonPositiveInputError("totalAssets", totalAssets);
102
- }
103
- actions.push({
104
- type: "erc4626Deposit",
105
- args: [
106
- vaultAddress,
107
- totalAssets,
108
- maxSharePrice,
109
- recipient,
110
- false /* skipRevert */,
111
- ],
88
+ const common = normalizeBundlesCommonParams(params.args);
89
+ const referralFeeAssets = getBundlesReferralFeeAssets(funding.assets, common.referralFeePct);
90
+ const netAssets = funding.assets - referralFeeAssets;
91
+ const spender = getChainAddress(params.vault.chainId, "bundles.vaultBundlesV1");
92
+ const tokenPermit = getBundlesTokenPermit({
93
+ userAddress: params.args.userAddress,
94
+ token: params.vault.asset,
95
+ spender,
96
+ amount: funding.assets,
97
+ requirementSignature: params.args.requirementSignature,
112
98
  });
113
- let tx = BundlerAction.encodeBundle(chainId, actions);
114
- if (metadata) {
115
- tx = addTransactionMetadata(tx, metadata);
116
- }
117
- return deepFreeze({
118
- ...tx,
99
+ return finalizeVaultBundlesV1Transaction({
100
+ chainId: params.vault.chainId,
101
+ value: funding.value,
102
+ data: encodeFunctionData({
103
+ abi: vaultBundlesV1Abi,
104
+ functionName: "vaultBundlesV1Deposit",
105
+ args: [
106
+ params.vault.address,
107
+ funding.assets,
108
+ params.args.maxSharePrice,
109
+ tokenPermit,
110
+ common.referralFeePct,
111
+ common.referralFeeRecipient,
112
+ common.deadline,
113
+ ],
114
+ }),
119
115
  action: {
120
116
  type: "vaultV1Deposit",
121
117
  args: {
122
- vault: vaultAddress,
123
- amount,
124
- maxSharePrice,
125
- recipient,
126
- nativeAmount,
118
+ vault: params.vault.address,
119
+ amount: funding.assets,
120
+ maxSharePrice: params.args.maxSharePrice,
121
+ nativeAmount: funding.value || undefined,
122
+ referralFeePct: common.referralFeePct,
123
+ referralFeeRecipient: common.referralFeeRecipient,
124
+ referralFeeAssets,
125
+ netAssets,
126
+ deadline: common.deadline,
127
127
  },
128
128
  },
129
+ metadata: params.metadata,
129
130
  });
130
131
  };
@@ -36,6 +36,7 @@ export interface VaultV1InKindRedeemParams {
36
36
  * @returns A deep-frozen `Readonly<Transaction<VaultV1InKindRedeemAction>>` with `to`, `value`,
37
37
  * `data`, and the typed action discriminator.
38
38
  * @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
39
+ * @throws {InputExceedsMaxError} when `deadline` exceeds `uint256`.
39
40
  * @throws {EmptyMarketParamsListError} when no markets are supplied.
40
41
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
41
42
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
@@ -2,6 +2,7 @@ import { deepFreeze, getChainAddress } from "@morpho-org/morpho-ts";
2
2
  import { encodeFunctionData } from "viem";
3
3
  import { vaultExitBundlesV1Abi } from "../../abis.js";
4
4
  import { addTransactionMetadata } from "../../helpers/index.js";
5
+ import { validateDeadline } from "../../helpers/validate.js";
5
6
  import { EmptyMarketParamsListError, NonPositiveInputError, } from "../../types/index.js";
6
7
  import { getVaultExitBundlesV1PermitStruct } from "../signatures/getVaultExitBundlesV1PermitStruct.js";
7
8
  /**
@@ -24,6 +25,7 @@ import { getVaultExitBundlesV1PermitStruct } from "../signatures/getVaultExitBun
24
25
  * @returns A deep-frozen `Readonly<Transaction<VaultV1InKindRedeemAction>>` with `to`, `value`,
25
26
  * `data`, and the typed action discriminator.
26
27
  * @throws {NonPositiveInputError} when `amount` or `deadline` is not positive.
28
+ * @throws {InputExceedsMaxError} when `deadline` exceeds `uint256`.
27
29
  * @throws {EmptyMarketParamsListError} when no markets are supplied.
28
30
  * @throws {UnsupportedChainIdError} when no address registry exists for the target chain.
29
31
  * @throws {UnknownAddressError} when VaultExitBundlesV1 is not registered on the target chain.
@@ -42,8 +44,7 @@ import { getVaultExitBundlesV1PermitStruct } from "../signatures/getVaultExitBun
42
44
  export const vaultV1InKindRedeem = ({ vault, args, metadata, }) => {
43
45
  if (args.amount <= 0n)
44
46
  throw new NonPositiveInputError("amount", args.amount);
45
- if (args.deadline <= 0n)
46
- throw new NonPositiveInputError("deadline", args.deadline);
47
+ validateDeadline(args.deadline);
47
48
  if (args.marketParamsList.length === 0)
48
49
  throw new EmptyMarketParamsListError();
49
50
  const to = getChainAddress(vault.chainId, "bundles.vaultExitBundlesV1");
@@ -1,85 +1,62 @@
1
1
  import { type Address } from "viem";
2
- import { type Metadata, type PermitRequirementSignature, type Transaction, type VaultV1MigrateToV2Action } from "../../types/index.js";
2
+ import { type Erc2612RequirementSignature, type Metadata, type Transaction, type VaultV1MigrateToV2Action, type VaultV1MigrateToV2AmountArgs } from "../../types/index.js";
3
3
  /** Parameters for {@link vaultV1MigrateToV2}. */
4
4
  export interface VaultV1MigrateToV2Params {
5
- vault: {
6
- chainId: number;
7
- address: Address;
8
- /** Underlying asset of the source V1 vault. */
9
- asset: Address;
5
+ readonly vault: {
6
+ readonly chainId: number;
7
+ readonly address: Address;
8
+ readonly asset: Address;
10
9
  };
11
- args: {
12
- targetVault: Address;
13
- /** Underlying asset of the target V2 vault. */
14
- targetAsset: Address;
15
- /** Number of V1 shares to migrate. */
16
- shares: bigint;
17
- /** Minimum acceptable share price for V1 redeem (slippage protection, in RAY). */
18
- minSharePriceVaultV1: bigint;
19
- /** Maximum acceptable share price for V2 deposit (inflation protection, in RAY). */
20
- maxSharePriceVaultV2: bigint;
21
- /** Receives the V2 vault shares. */
22
- recipient: Address;
23
- /** Pre-signed permit/permit2 approval for V1 share transfer. */
24
- requirementSignature?: PermitRequirementSignature;
10
+ readonly args: VaultV1MigrateToV2AmountArgs & {
11
+ readonly targetVault: Address;
12
+ readonly targetAsset: Address;
13
+ readonly maxSharePriceVaultV2: bigint;
14
+ readonly userAddress: Address;
15
+ readonly recipient?: never;
16
+ readonly minSharePriceVaultV1?: never;
17
+ readonly requirementSignature?: Erc2612RequirementSignature;
18
+ readonly referralFeePct?: bigint;
19
+ readonly referralFeeRecipient?: Address;
20
+ readonly deadline: bigint;
25
21
  };
26
- metadata?: Metadata;
22
+ readonly metadata?: Metadata;
27
23
  }
28
24
  /**
29
- * Prepares an atomic full-migration transaction from VaultV1 to VaultV2.
25
+ * Encodes an assets-or-shares Vault V1 to Vault V2 migration through VaultBundlesV1.
30
26
  *
31
- * Routed through bundler3: transfers V1 shares to `GeneralAdapter1` (via `erc20TransferFrom` or
32
- * permit/permit2), redeems them via `erc4626Redeem` (GA1 redeems its own shares — no allowance
33
- * check), then deposits the resulting assets into V2 via `erc4626Deposit`. All operations
34
- * execute atomically in a single transaction.
35
- *
36
- * Prerequisite: the user must either approve `GeneralAdapter1` to spend their V1 vault shares
37
- * (classic approve) or provide a pre-signed permit/permit2 via `requirementSignature`. Use
38
- * `getRequirements()` on the entity to resolve the appropriate approval.
39
- *
40
- * @param params.vault.chainId - The chain the source vault lives on (used to resolve bundler
41
- * addresses).
42
- * @param params.vault.address - The source VaultV1 (MetaMorpho) address.
43
- * @param params.vault.asset - The underlying asset of the source V1 vault.
44
- * @param params.args.targetVault - The target VaultV2 address.
45
- * @param params.args.targetAsset - The underlying asset of the target V2 vault. Must equal
46
- * `vault.asset`.
47
- * @param params.args.shares - Number of V1 shares to migrate.
48
- * @param params.args.minSharePriceVaultV1 - Minimum V1 share price in RAY (slippage protection
49
- * for the redeem leg).
50
- * @param params.args.maxSharePriceVaultV2 - Maximum V2 share price in RAY (inflation protection
51
- * for the deposit leg).
52
- * @param params.args.recipient - Address that receives the V2 vault shares.
53
- * @param params.args.requirementSignature - Optional pre-signed permit/permit2 for the V1 share
54
- * transfer.
55
- * @param params.metadata - Optional analytics metadata attached to the bundle.
56
- * @returns A deep-frozen `Transaction<VaultV1MigrateToV2Action>` with `to`, `value`, `data`, and
57
- * the typed `action` discriminator the simulation layer consumes.
58
- * @throws {VaultAssetMismatchError} when `targetAsset` differs from `vault.asset`.
59
- * @throws {NonPositiveInputError} when `shares <= 0n` or `maxSharePriceVaultV2 <= 0n`.
60
- * @throws {NegativeInputError} when `minSharePriceVaultV1 < 0n`.
61
- * @throws {DepositAssetMismatchError} from `getTokenRequirementActions` when `requirementSignature`
62
- * is provided and the signed asset differs from `vault.address` (the V1 share token).
63
- * @throws {DepositAmountMismatchError} from `getTokenRequirementActions` when `requirementSignature`
64
- * is provided and the signed amount differs from `args.shares`.
65
- * @throws {Permit2ExpirationMissingError} from `getTokenRequirementActions` when a Permit2 requirement
66
- * signature is missing its expiration.
27
+ * @param params - Source/destination vaults, exclusive migration amount, fee, permit, and deadline.
28
+ * @returns A deep-frozen VaultBundlesV1 migration transaction.
29
+ * @throws {VaultAssetMismatchError} when source and destination assets differ.
30
+ * @throws {SameVaultMigrationError} when source and destination vaults are identical.
31
+ * @throws {AmountAndSharesExclusiveError} when both amount modes or neither are supplied.
32
+ * @throws {NonPositiveInputError} when the selected amount, destination share-price bound, or deadline is not positive.
33
+ * @throws {InputExceedsMaxError} when the selected amount, `maxSharePriceVaultV2`, or `deadline` exceeds uint256.
34
+ * @throws {NegativeInputError} when `referralFeePct` is negative.
35
+ * @throws {ReferralFeePctExceededError} when `referralFeePct` is at least WAD.
36
+ * @throws {ReferralFeeRecipientMissingError} when a positive referral fee has no non-zero recipient.
37
+ * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
38
+ * @throws {UnknownAddressError} when VaultBundlesV1 is not registered on the target chain.
39
+ * @throws {BundlesPermitMismatchError} when the optional share permit is incompatible.
67
40
  * @example
68
41
  * ```ts
69
42
  * import { vaultV1MigrateToV2 } from "@morpho-org/morpho-sdk";
70
43
  *
71
44
  * const tx = vaultV1MigrateToV2({
72
- * vault: { chainId: 1, address: sourceVault, asset: USDC },
45
+ * vault: {
46
+ * chainId: 1,
47
+ * address: "0x0000000000000000000000000000000000000001",
48
+ * asset: "0x0000000000000000000000000000000000000003",
49
+ * },
73
50
  * args: {
74
- * targetVault,
75
- * targetAsset: USDC,
76
51
  * shares: 1_000_000n,
77
- * minSharePriceVaultV1: 0n, // disables redeem-leg slippage protection — production code should compute from source vault state + slippage tolerance
78
- * maxSharePriceVaultV2: 1_010_000_000_000_000_000_000_000_000n, // RAY-scaled, 1.01x
79
- * recipient,
52
+ * targetVault: "0x0000000000000000000000000000000000000002",
53
+ * targetAsset: "0x0000000000000000000000000000000000000003",
54
+ * maxSharePriceVaultV2: 1_000_000_000_000_000_000_000_000_000n,
55
+ * userAddress: "0x0000000000000000000000000000000000000004",
56
+ * deadline: 1_900_000_000n,
80
57
  * },
81
58
  * });
82
- * // tx satisfies Readonly<Transaction<VaultV1MigrateToV2Action>>
59
+ * // tx.action.type === "vaultV1MigrateToV2"
83
60
  * ```
84
61
  */
85
- export declare const vaultV1MigrateToV2: ({ vault: { chainId, address: sourceVault, asset: sourceAsset }, args: { targetVault, targetAsset, shares, minSharePriceVaultV1, maxSharePriceVaultV2, recipient, requirementSignature, }, metadata, }: VaultV1MigrateToV2Params) => Readonly<Transaction<VaultV1MigrateToV2Action>>;
62
+ export declare const vaultV1MigrateToV2: (params: VaultV1MigrateToV2Params) => Readonly<Transaction<VaultV1MigrateToV2Action>>;