@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,5 +1,5 @@
1
1
  import { type MarketId, UnknownDataError } from "@morpho-org/blue-sdk";
2
- import type { Address, Hash } from "viem";
2
+ import type { Address, Hash, Hex } from "viem";
3
3
  /**
4
4
  * Thrown when a morpho-sdk input that must be non-negative is negative.
5
5
  *
@@ -78,8 +78,23 @@ export declare class ExpiredDeadlineError extends Error {
78
78
  */
79
79
  constructor(deadline: bigint, timestamp: bigint);
80
80
  }
81
- /** Thrown when Vault V2 in-kind redemption is attempted with anything other than one adapter. */
82
- export declare class InKindRedeemRequiresSingleAdapterError extends Error {
81
+ /**
82
+ * Thrown when a VaultExitBundlesV1 Vault V2 exit targets a vault without exactly one adapter.
83
+ *
84
+ * Both `vaultExitBundlesV1InKindRedemptionVaultV2` and
85
+ * `vaultExitBundlesV1ForceWithdrawVaultV2` require `adaptersLength() == 1`.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * import { VaultV2SingleAdapterRequiredError } from "@morpho-org/morpho-sdk";
90
+ *
91
+ * const error = new VaultV2SingleAdapterRequiredError(vault, 2);
92
+ * if (error instanceof VaultV2SingleAdapterRequiredError) {
93
+ * console.error(error.vault, error.adapters);
94
+ * }
95
+ * ```
96
+ */
97
+ export declare class VaultV2SingleAdapterRequiredError extends Error {
83
98
  readonly vault: Address;
84
99
  readonly adapters: number;
85
100
  /**
@@ -88,6 +103,10 @@ export declare class InKindRedeemRequiresSingleAdapterError extends Error {
88
103
  */
89
104
  constructor(vault: Address, adapters: number);
90
105
  }
106
+ /** @deprecated Use {@link VaultV2SingleAdapterRequiredError}. */
107
+ export declare const InKindRedeemRequiresSingleAdapterError: typeof VaultV2SingleAdapterRequiredError;
108
+ /** @deprecated Use {@link VaultV2SingleAdapterRequiredError}. */
109
+ export type InKindRedeemRequiresSingleAdapterError = VaultV2SingleAdapterRequiredError;
91
110
  /** Thrown when a requested in-kind redemption adapter is not part of the Vault V2 snapshot. */
92
111
  export declare class AdapterNotPartOfVaultError extends Error {
93
112
  readonly vault: Address;
@@ -98,14 +117,279 @@ export declare class AdapterNotPartOfVaultError extends Error {
98
117
  */
99
118
  constructor(vault: Address, adapter: Address);
100
119
  }
101
- /** Thrown when the Vault V2 adapter cannot expose MorphoMarketV1AdapterV2 market shares. */
102
- export declare class UnsupportedInKindAdapterError extends Error {
120
+ /**
121
+ * Thrown when the Vault V2 adapter cannot expose MorphoMarketV1AdapterV2 market shares.
122
+ *
123
+ * VaultExitBundlesV1 casts the adapter to `IMorphoMarketV1AdapterV2`, so a legacy
124
+ * positions-based `MorphoMarketV1Adapter` or a `MorphoVaultV1Adapter` cannot be exited.
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * import { VaultV2UnsupportedExitAdapterError } from "@morpho-org/morpho-sdk";
129
+ *
130
+ * const error = new VaultV2UnsupportedExitAdapterError(adapter);
131
+ * if (error instanceof VaultV2UnsupportedExitAdapterError) {
132
+ * console.error(error.adapter);
133
+ * }
134
+ * ```
135
+ */
136
+ export declare class VaultV2UnsupportedExitAdapterError extends Error {
103
137
  readonly adapter: Address;
104
138
  /**
105
139
  * @param adapter - Unsupported Vault V2 adapter address.
106
140
  */
107
141
  constructor(adapter: Address);
108
142
  }
143
+ /** @deprecated Use {@link VaultV2UnsupportedExitAdapterError}. */
144
+ export declare const UnsupportedInKindAdapterError: typeof VaultV2UnsupportedExitAdapterError;
145
+ /** @deprecated Use {@link VaultV2UnsupportedExitAdapterError}. */
146
+ export type UnsupportedInKindAdapterError = VaultV2UnsupportedExitAdapterError;
147
+ /**
148
+ * Thrown when a Vault V2 exit cannot resolve the vault's configured liquidity adapter.
149
+ *
150
+ * `VaultExitBundlesV1.vaultExitBundlesV1ForceWithdrawVaultV2` casts `liquidityAdapter` to
151
+ * `IMorphoMarketV1AdapterV2` and ABI-decodes `liquidityData` as `MarketParams`. Because the exit
152
+ * also requires `adaptersLength() == 1`, the only resolvable configurations are an unset
153
+ * liquidity adapter or the vault's sole adapter.
154
+ *
155
+ * @example
156
+ * ```ts
157
+ * import { VaultV2UnsupportedLiquidityAdapterError } from "@morpho-org/morpho-sdk";
158
+ *
159
+ * const error = new VaultV2UnsupportedLiquidityAdapterError({
160
+ * vault,
161
+ * liquidityAdapter,
162
+ * adapter,
163
+ * });
164
+ * if (error instanceof VaultV2UnsupportedLiquidityAdapterError) {
165
+ * console.error(error.liquidityAdapter, error.adapter);
166
+ * }
167
+ * ```
168
+ */
169
+ export declare class VaultV2UnsupportedLiquidityAdapterError extends Error {
170
+ /** Vault V2 address. */
171
+ readonly vault: Address;
172
+ /** Liquidity adapter configured on the vault. */
173
+ readonly liquidityAdapter: Address;
174
+ /** Sole adapter the exit targets. */
175
+ readonly adapter: Address;
176
+ /**
177
+ * @param params - Liquidity-adapter mismatch details.
178
+ * @param params.vault - Vault V2 address.
179
+ * @param params.liquidityAdapter - Liquidity adapter configured on the vault.
180
+ * @param params.adapter - Sole adapter the exit targets.
181
+ */
182
+ constructor(params: {
183
+ readonly vault: Address;
184
+ readonly liquidityAdapter: Address;
185
+ readonly adapter: Address;
186
+ });
187
+ }
188
+ /**
189
+ * Thrown when a Vault V2 exit cannot ABI-decode the vault's `liquidityData` as `MarketParams`.
190
+ *
191
+ * Distinct from {@link VaultV2UnsupportedLiquidityAdapterError}: the liquidity adapter *is* the
192
+ * vault's sole adapter, but the market params stored alongside it are unusable, so the contract's
193
+ * `abi.decode` would revert. Only the vault curator can repair this by re-setting the liquidity
194
+ * adapter and data.
195
+ *
196
+ * @example
197
+ * ```ts
198
+ * import { VaultV2UndecodableLiquidityDataError } from "@morpho-org/morpho-sdk";
199
+ *
200
+ * try {
201
+ * vault.forceWithdraw({ exitAssets: 1_000_000n, vaultData, userAddress });
202
+ * } catch (error) {
203
+ * if (error instanceof VaultV2UndecodableLiquidityDataError) {
204
+ * console.error(error.liquidityData, error.cause);
205
+ * }
206
+ * }
207
+ * ```
208
+ */
209
+ export declare class VaultV2UndecodableLiquidityDataError extends Error {
210
+ /** Vault V2 address. */
211
+ readonly vault: Address;
212
+ /** Liquidity adapter configured on the vault. */
213
+ readonly liquidityAdapter: Address;
214
+ /** Raw `liquidityData` that failed to decode. */
215
+ readonly liquidityData: Hex;
216
+ /**
217
+ * @param params - Undecodable liquidity-data details.
218
+ * @param params.vault - Vault V2 address.
219
+ * @param params.liquidityAdapter - Liquidity adapter configured on the vault.
220
+ * @param params.liquidityData - Raw `liquidityData` that failed to decode.
221
+ * @param params.cause - Underlying decode failure.
222
+ */
223
+ constructor(params: {
224
+ readonly vault: Address;
225
+ readonly liquidityAdapter: Address;
226
+ readonly liquidityData: Hex;
227
+ readonly cause?: unknown;
228
+ });
229
+ }
230
+ /**
231
+ * Thrown when the adapter's markets cannot cover a Vault V2 force withdrawal.
232
+ *
233
+ * `vaultExitBundlesV1ForceWithdrawVaultV2` loops over the adapter's market list without a bound,
234
+ * so an under-covered request reverts on-chain with a raw `panic 0x32`. This error surfaces that
235
+ * failure before submission.
236
+ *
237
+ * @example
238
+ * ```ts
239
+ * import { VaultV2ForceWithdrawCoverageError } from "@morpho-org/morpho-sdk";
240
+ *
241
+ * const error = new VaultV2ForceWithdrawCoverageError({
242
+ * required: 100n,
243
+ * covered: 40n,
244
+ * maxExitAssets: 60n,
245
+ * });
246
+ * if (error instanceof VaultV2ForceWithdrawCoverageError) {
247
+ * console.error(error.maxExitAssets);
248
+ * }
249
+ * ```
250
+ */
251
+ export declare class VaultV2ForceWithdrawCoverageError extends Error {
252
+ /** Assets that must be force-deallocated from the adapter's markets. */
253
+ readonly required: bigint;
254
+ /** Assets the adapter's markets can actually release. */
255
+ readonly covered: bigint;
256
+ /** Largest penalty-inclusive `exitAssets` the current vault state supports. */
257
+ readonly maxExitAssets: bigint;
258
+ /**
259
+ * @param params - Coverage values used to explain the rejected exit.
260
+ * @param params.required - Assets that must be force-deallocated.
261
+ * @param params.covered - Assets the adapter's markets can release.
262
+ * @param params.maxExitAssets - Largest supported penalty-inclusive `exitAssets`.
263
+ */
264
+ constructor(params: {
265
+ readonly required: bigint;
266
+ readonly covered: bigint;
267
+ readonly maxExitAssets: bigint;
268
+ });
269
+ }
270
+ /**
271
+ * Thrown when a Vault V2 force withdrawal would withdraw nothing while still consuming its permit.
272
+ *
273
+ * Happens on a dust `exitAssets` when the vault has no penalty-free liquidity and the
274
+ * penalty-adjusted remainder rounds down to zero.
275
+ *
276
+ * @example
277
+ * ```ts
278
+ * import { VaultV2ForceWithdrawZeroWithdrawalError } from "@morpho-org/morpho-sdk";
279
+ *
280
+ * const error = new VaultV2ForceWithdrawZeroWithdrawalError({
281
+ * vault,
282
+ * exitAssets: 1n,
283
+ * penalty: 20_000000000000000n,
284
+ * });
285
+ * if (error instanceof VaultV2ForceWithdrawZeroWithdrawalError) {
286
+ * console.error(error.exitAssets, error.penalty);
287
+ * }
288
+ * ```
289
+ */
290
+ export declare class VaultV2ForceWithdrawZeroWithdrawalError extends Error {
291
+ /** Vault V2 address. */
292
+ readonly vault: Address;
293
+ /** Positive penalty-inclusive amount requested by the caller. */
294
+ readonly exitAssets: bigint;
295
+ /** WAD-scaled force-deallocation penalty applied by the adapter. */
296
+ readonly penalty: bigint;
297
+ /**
298
+ * @param params - Values that caused the exit to withdraw nothing.
299
+ * @param params.vault - Vault V2 address.
300
+ * @param params.exitAssets - Positive penalty-inclusive amount requested by the caller.
301
+ * @param params.penalty - WAD-scaled force-deallocation penalty applied by the adapter.
302
+ */
303
+ constructor(params: {
304
+ readonly vault: Address;
305
+ readonly exitAssets: bigint;
306
+ readonly penalty: bigint;
307
+ });
308
+ }
309
+ /**
310
+ * Thrown when a Vault V2 force withdrawal's derived share-price floor rounds down to zero.
311
+ *
312
+ * VaultExitBundlesV1 reads `minSharePriceE27 == 0` as "no bound at all", so emitting a rounded-down
313
+ * zero would silently ship an exit with none of the slippage protection this path exists to add.
314
+ * Reaching it means the exit burns more shares than `withdrawnAssets` can price at RAY scale — a
315
+ * vault whose share price has collapsed below `1e-27` assets per share, or a dust exit against one.
316
+ *
317
+ * @example
318
+ * ```ts
319
+ * import { VaultV2ForceWithdrawZeroSharePriceError } from "@morpho-org/morpho-sdk";
320
+ *
321
+ * try {
322
+ * vault.forceWithdraw({ exitAssets, vaultData, userAddress });
323
+ * } catch (error) {
324
+ * if (error instanceof VaultV2ForceWithdrawZeroSharePriceError) {
325
+ * console.error(error.withdrawnAssets, error.sharesBurnt);
326
+ * }
327
+ * }
328
+ * ```
329
+ */
330
+ export declare class VaultV2ForceWithdrawZeroSharePriceError extends Error {
331
+ /** Assets the exit withdraws in total, before the referral fee. */
332
+ readonly withdrawnAssets: bigint;
333
+ /** Upper bound of the vault shares the exit burns. */
334
+ readonly sharesBurnt: bigint;
335
+ /** WAD-scaled slippage tolerance applied to the floor. */
336
+ readonly slippageTolerance: bigint;
337
+ /**
338
+ * @param params - Values whose ratio rounded down to a zero share-price floor.
339
+ * @param params.withdrawnAssets - Assets the exit withdraws in total, before the referral fee.
340
+ * @param params.sharesBurnt - Upper bound of the vault shares the exit burns.
341
+ * @param params.slippageTolerance - WAD-scaled slippage tolerance applied to the floor.
342
+ */
343
+ constructor(params: {
344
+ readonly withdrawnAssets: bigint;
345
+ readonly sharesBurnt: bigint;
346
+ readonly slippageTolerance: bigint;
347
+ });
348
+ }
349
+ /**
350
+ * Thrown when fee shares projected to the accepted deadline reach the lower force-withdraw
351
+ * burn bound at that time.
352
+ *
353
+ * VaultExitBundlesV1 measures shares burned after its first withdrawal accrues fees. If the
354
+ * recipient's fee shares are at least the measured burn bound, its share-price check is skipped or
355
+ * reverts due to an underflow.
356
+ *
357
+ * @example
358
+ * ```ts
359
+ * import { VaultV2ForceWithdrawFeeSharesExceedBurnError } from "@morpho-org/morpho-sdk";
360
+ *
361
+ * try {
362
+ * vault.forceWithdraw({ exitAssets, vaultData, userAddress });
363
+ * } catch (error) {
364
+ * if (error instanceof VaultV2ForceWithdrawFeeSharesExceedBurnError) {
365
+ * console.error(error.sharesBurnt, error.feeShares);
366
+ * }
367
+ * }
368
+ * ```
369
+ */
370
+ export declare class VaultV2ForceWithdrawFeeSharesExceedBurnError extends Error {
371
+ /** Vault V2 address being exited. */
372
+ readonly vault: Address;
373
+ /** Fee-recipient account submitting the exit. */
374
+ readonly userAddress: Address;
375
+ /** Lower bound of shares measured as burned by VaultExitBundlesV1. */
376
+ readonly sharesBurnt: bigint;
377
+ /** Fee shares projected for `userAddress` at the accepted deadline. */
378
+ readonly feeShares: bigint;
379
+ /**
380
+ * @param params - Fee-share and burn-bound values that make the exit unsafe.
381
+ * @param params.vault - Vault V2 address being exited.
382
+ * @param params.userAddress - Fee-recipient account submitting the exit.
383
+ * @param params.sharesBurnt - Lower bound of shares measured as burned by VaultExitBundlesV1.
384
+ * @param params.feeShares - Fee shares projected for `userAddress` at the accepted deadline.
385
+ */
386
+ constructor(params: {
387
+ readonly vault: Address;
388
+ readonly userAddress: Address;
389
+ readonly sharesBurnt: bigint;
390
+ readonly feeShares: bigint;
391
+ });
392
+ }
109
393
  /** Thrown when a Vault V2 in-kind redemption rounds to no deallocated assets. */
110
394
  export declare class InKindRedeemZeroDeallocationError extends Error {
111
395
  /**
@@ -184,8 +468,8 @@ export declare class VaultIsBlueFeeRecipientError extends Error {
184
468
  */
185
469
  constructor(vault: Address, blue: Address);
186
470
  }
187
- /** Thrown when a vault-shares requirement cannot be safely encoded as an ERC-2612 permit. */
188
- export declare class VaultExitBundlesV1PermitMismatchError extends Error {
471
+ /** Thrown when a vault-shares requirement cannot be safely encoded as a bundles permit. */
472
+ export declare class BundlesPermitMismatchError extends Error {
189
473
  /**
190
474
  * @param params - Permit mismatch values used to explain the rejection.
191
475
  * @param params.field - Permit field that does not match the exit.
@@ -193,21 +477,34 @@ export declare class VaultExitBundlesV1PermitMismatchError extends Error {
193
477
  * @param params.actual - Value supplied by the signature.
194
478
  * @param params.cause - Original parser failure when signature decoding is wrapped.
195
479
  */
196
- readonly field: "type" | "asset" | "signature";
480
+ readonly field: "type" | "asset" | "owner" | "spender" | "amount" | "nonce" | "deadline" | "signature";
197
481
  readonly expected: string;
198
482
  readonly actual: string;
199
483
  constructor(params: {
200
- readonly field: "type" | "asset" | "signature";
484
+ readonly field: "type" | "asset" | "owner" | "spender" | "amount" | "nonce" | "deadline" | "signature";
201
485
  readonly expected: string;
202
486
  readonly actual: string;
203
487
  readonly cause?: unknown;
204
488
  });
205
489
  }
206
- /** Thrown when a signed requirement cannot be safely encoded for BlueBundlesV1. */
207
- export declare class BlueBundlesV1RequirementSignatureMismatchError extends Error {
208
- /** Field whose signed value or encoding is invalid for the direct BlueBundlesV1 call. */
209
- readonly field: "type" | "authorized" | "isAuthorized" | "deadline" | "signature";
210
- /** Value required by BlueBundlesV1. */
490
+ /**
491
+ * Thrown by the deprecated VaultExitBundlesV1 permit compatibility helper.
492
+ *
493
+ * @deprecated Use {@link BundlesPermitMismatchError} with `getBundlesSharesPermit`.
494
+ */
495
+ export declare class VaultExitBundlesV1PermitMismatchError extends BundlesPermitMismatchError {
496
+ constructor(params: {
497
+ readonly field: "type" | "asset" | "owner" | "spender" | "amount" | "nonce" | "deadline" | "signature";
498
+ readonly expected: string;
499
+ readonly actual: string;
500
+ readonly cause?: unknown;
501
+ });
502
+ }
503
+ /** Thrown when a signed requirement cannot be safely encoded for a fixed bundles call. */
504
+ export declare class BundlesRequirementSignatureMismatchError extends Error {
505
+ /** Field whose signed value or encoding is invalid for the fixed bundles call. */
506
+ readonly field: "type" | "authorized" | "isAuthorized" | "nonce" | "deadline" | "signature";
507
+ /** Value required by the fixed bundles call. */
211
508
  readonly expected: string;
212
509
  /** Value supplied by the signed requirement. */
213
510
  readonly actual: string;
@@ -219,18 +516,16 @@ export declare class BlueBundlesV1RequirementSignatureMismatchError extends Erro
219
516
  * @param params.cause - Original signature parser failure, when applicable.
220
517
  */
221
518
  constructor(params: {
222
- field: "type" | "authorized" | "isAuthorized" | "deadline" | "signature";
519
+ field: "type" | "authorized" | "isAuthorized" | "nonce" | "deadline" | "signature";
223
520
  expected: string;
224
521
  actual: string;
225
522
  cause?: unknown;
226
523
  });
227
524
  }
228
- /** Thrown when Permit2 SignatureTransfer is selected without an explicit unordered nonce. */
229
- export declare class MissingPermit2TransferFromNonceError extends Error {
230
- constructor();
231
- }
525
+ /** @deprecated Use {@link BundlesRequirementSignatureMismatchError}. */
526
+ export { BundlesRequirementSignatureMismatchError as BlueBundlesV1RequirementSignatureMismatchError, };
232
527
  /** Thrown when an explicit Permit2 SignatureTransfer unordered nonce is already consumed. */
233
- export declare class Permit2TransferFromNonceAlreadyUsedError extends Error {
528
+ export declare class Permit2SignatureTransferNonceAlreadyUsedError extends Error {
234
529
  readonly owner: Address;
235
530
  readonly nonce: bigint;
236
531
  /**
@@ -249,6 +544,8 @@ export declare class NoUnusedPermit2NonceError extends Error {
249
544
  */
250
545
  constructor(owner: Address, startNonce: bigint);
251
546
  }
547
+ /** @deprecated Use {@link Permit2SignatureTransferNonceAlreadyUsedError}. */
548
+ export { Permit2SignatureTransferNonceAlreadyUsedError as Permit2TransferFromNonceAlreadyUsedError, };
252
549
  /** Thrown when native funding does not exactly match the contract's gross token pull. */
253
550
  export declare class NativeFundingAmountMismatchError extends Error {
254
551
  readonly nativeAmount: bigint;
@@ -260,9 +557,38 @@ export declare class NativeFundingAmountMismatchError extends Error {
260
557
  constructor(nativeAmount: bigint, requiredAmount: bigint);
261
558
  }
262
559
  /** Thrown when a positive referral fee has no recipient. */
263
- export declare class MissingReferralFeeRecipientError extends Error {
560
+ export declare class ReferralFeeRecipientMissingError extends Error {
561
+ constructor();
562
+ }
563
+ /** @deprecated Use {@link ReferralFeeRecipientMissingError}. */
564
+ export declare const MissingReferralFeeRecipientError: typeof ReferralFeeRecipientMissingError;
565
+ /** @deprecated Use {@link ReferralFeeRecipientMissingError}. */
566
+ export type MissingReferralFeeRecipientError = ReferralFeeRecipientMissingError;
567
+ /**
568
+ * Thrown when a referral fee percentage is outside the contract's `[0, WAD)` range.
569
+ *
570
+ * Extends {@link InputExceedsMaxError} — and reports the same `field`, `value`, and `max` the
571
+ * generic bound error used to carry for this input — so integrators already pattern-matching
572
+ * `InputExceedsMaxError` keep catching this failure.
573
+ */
574
+ export declare class ReferralFeePctExceededError extends InputExceedsMaxError {
575
+ readonly referralFeePct: bigint;
576
+ /** @param referralFeePct - WAD-scaled referral fee percentage supplied by the caller. */
577
+ constructor(referralFeePct: bigint);
578
+ }
579
+ /** Thrown when a fixed bundles call mixes ERC-20 and native funding. */
580
+ export declare class MixedBundlesFundingError extends Error {
264
581
  constructor();
265
582
  }
583
+ /** Thrown when a vault migration specifies both assets and shares, or neither. */
584
+ export declare class AmountAndSharesExclusiveError extends Error {
585
+ constructor();
586
+ }
587
+ /** Thrown when a vault migration selects the same source and destination vault. */
588
+ export declare class SameVaultMigrationError extends Error {
589
+ readonly vault: Address;
590
+ constructor(vault: Address);
591
+ }
266
592
  /** Thrown when a BlueBundlesV1 reallocation source uses another loan token. */
267
593
  export declare class ReallocationLoanTokenMismatchError extends Error {
268
594
  readonly expected: Address;
@@ -473,7 +799,7 @@ export declare namespace BundlerErrors {
473
799
  }
474
800
  }
475
801
  /** Requirement signature kind accepted by action-output transaction builders. */
476
- export type RequirementSignatureKind = "permit" | "permit2TransferFrom" | "authorization" | "midnightOfferRootSignature";
802
+ export type RequirementSignatureKind = "permit" | "permit2SignatureTransfer" | "authorization" | "midnightOfferRootSignature";
477
803
  /**
478
804
  * Thrown when `buildTx` receives more than one requirement signature of the same kind.
479
805
  *
@@ -1068,7 +1394,7 @@ export declare class MidnightOfferRootOfferCountMismatchError extends Error {
1068
1394
  actualOffers: number;
1069
1395
  });
1070
1396
  }
1071
- /** Thrown when a Midnight offer-root signature was not prepared by this maker flow. */
1397
+ /** Thrown when a Midnight offer-root signature carries no encoded payload. */
1072
1398
  export declare class UnpreparedMidnightOfferRootSignatureError extends Error {
1073
1399
  constructor();
1074
1400
  }