@morpho-org/morpho-sdk 6.0.0-next.4 → 6.1.0

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 (121) hide show
  1. package/MIGRATION-v5-to-v6.md +21 -15
  2. package/README.md +7 -5
  3. package/lib/cjs/abis.d.ts +1 -1
  4. package/lib/cjs/abis.js +3 -1
  5. package/lib/cjs/actions/bundles/common.d.ts +18 -23
  6. package/lib/cjs/actions/bundles/common.js +36 -83
  7. package/lib/cjs/actions/bundles/index.d.ts +1 -1
  8. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +6 -2
  9. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +6 -2
  10. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +1 -0
  11. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -0
  12. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +11 -3
  13. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +19 -1
  14. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -1
  15. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +12 -0
  16. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +62 -17
  17. package/lib/cjs/actions/vaultV1/migrateToV2.js +48 -17
  18. package/lib/cjs/actions/vaultV1/redeem.d.ts +28 -1
  19. package/lib/cjs/actions/vaultV1/redeem.js +17 -1
  20. package/lib/cjs/actions/vaultV1/withdraw.d.ts +1 -1
  21. package/lib/cjs/actions/vaultV1/withdraw.js +1 -1
  22. package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +19 -7
  23. package/lib/cjs/actions/vaultV2/forceWithdraw.js +19 -7
  24. package/lib/cjs/actions/vaultV2/redeem.d.ts +28 -1
  25. package/lib/cjs/actions/vaultV2/redeem.js +17 -1
  26. package/lib/cjs/actions/vaultV2/withdraw.d.ts +1 -1
  27. package/lib/cjs/actions/vaultV2/withdraw.js +1 -1
  28. package/lib/cjs/constants.d.ts +1 -1
  29. package/lib/cjs/constants.js +4 -1
  30. package/lib/cjs/entities/blue/blue.d.ts +28 -0
  31. package/lib/cjs/entities/blue/blue.js +1 -0
  32. package/lib/cjs/entities/index.d.ts +1 -1
  33. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +38 -22
  34. package/lib/cjs/entities/vaultV1/vaultV1.js +51 -84
  35. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +68 -35
  36. package/lib/cjs/entities/vaultV2/vaultV2.js +45 -72
  37. package/lib/cjs/errors.d.ts +1 -1
  38. package/lib/cjs/errors.js +8 -1
  39. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.d.ts +10 -6
  40. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +10 -6
  41. package/lib/cjs/helpers/slippage.d.ts +3 -2
  42. package/lib/cjs/helpers/slippage.js +3 -2
  43. package/lib/cjs/helpers/validate.d.ts +40 -0
  44. package/lib/cjs/helpers/validate.js +40 -0
  45. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.d.ts +94 -59
  46. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +94 -59
  47. package/lib/cjs/midnight/abis.d.ts +1 -1
  48. package/lib/cjs/midnight/abis.js +3 -1
  49. package/lib/cjs/midnight/constants.d.ts +1 -1
  50. package/lib/cjs/midnight/constants.js +4 -1
  51. package/lib/cjs/midnight/entities.d.ts +1 -1
  52. package/lib/cjs/midnight/errors.d.ts +1 -1
  53. package/lib/cjs/midnight/errors.js +7 -1
  54. package/lib/cjs/midnight/types.d.ts +1 -1
  55. package/lib/cjs/midnight/utils.d.ts +11 -1
  56. package/lib/cjs/midnight/utils.js +13 -1
  57. package/lib/cjs/types/action.d.ts +35 -0
  58. package/lib/cjs/types/action.js +10 -0
  59. package/lib/cjs/types.d.ts +1 -1
  60. package/lib/cjs/utils.d.ts +11 -1
  61. package/lib/cjs/utils.js +14 -2
  62. package/lib/esm/abis.d.ts +1 -1
  63. package/lib/esm/abis.js +1 -1
  64. package/lib/esm/actions/bundles/common.d.ts +18 -23
  65. package/lib/esm/actions/bundles/common.js +34 -80
  66. package/lib/esm/actions/bundles/index.d.ts +1 -1
  67. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +6 -2
  68. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +6 -2
  69. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +1 -0
  70. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -0
  71. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +11 -3
  72. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +21 -3
  73. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -1
  74. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +14 -2
  75. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +62 -17
  76. package/lib/esm/actions/vaultV1/migrateToV2.js +48 -17
  77. package/lib/esm/actions/vaultV1/redeem.d.ts +28 -1
  78. package/lib/esm/actions/vaultV1/redeem.js +17 -1
  79. package/lib/esm/actions/vaultV1/withdraw.d.ts +1 -1
  80. package/lib/esm/actions/vaultV1/withdraw.js +1 -1
  81. package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +19 -7
  82. package/lib/esm/actions/vaultV2/forceWithdraw.js +19 -7
  83. package/lib/esm/actions/vaultV2/redeem.d.ts +28 -1
  84. package/lib/esm/actions/vaultV2/redeem.js +17 -1
  85. package/lib/esm/actions/vaultV2/withdraw.d.ts +1 -1
  86. package/lib/esm/actions/vaultV2/withdraw.js +1 -1
  87. package/lib/esm/constants.d.ts +1 -1
  88. package/lib/esm/constants.js +1 -1
  89. package/lib/esm/entities/blue/blue.d.ts +28 -0
  90. package/lib/esm/entities/blue/blue.js +1 -0
  91. package/lib/esm/entities/index.d.ts +1 -1
  92. package/lib/esm/entities/vaultV1/vaultV1.d.ts +38 -22
  93. package/lib/esm/entities/vaultV1/vaultV1.js +53 -86
  94. package/lib/esm/entities/vaultV2/vaultV2.d.ts +68 -35
  95. package/lib/esm/entities/vaultV2/vaultV2.js +47 -74
  96. package/lib/esm/errors.d.ts +1 -1
  97. package/lib/esm/errors.js +1 -1
  98. package/lib/esm/helpers/previewVaultV2ForceWithdraw.d.ts +10 -6
  99. package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +10 -6
  100. package/lib/esm/helpers/slippage.d.ts +3 -2
  101. package/lib/esm/helpers/slippage.js +3 -2
  102. package/lib/esm/helpers/validate.d.ts +40 -0
  103. package/lib/esm/helpers/validate.js +40 -0
  104. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.d.ts +94 -59
  105. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +94 -59
  106. package/lib/esm/midnight/abis.d.ts +1 -1
  107. package/lib/esm/midnight/abis.js +1 -1
  108. package/lib/esm/midnight/constants.d.ts +1 -1
  109. package/lib/esm/midnight/constants.js +1 -1
  110. package/lib/esm/midnight/entities.d.ts +1 -1
  111. package/lib/esm/midnight/errors.d.ts +1 -1
  112. package/lib/esm/midnight/errors.js +1 -1
  113. package/lib/esm/midnight/types.d.ts +1 -1
  114. package/lib/esm/midnight/utils.d.ts +11 -1
  115. package/lib/esm/midnight/utils.js +11 -1
  116. package/lib/esm/types/action.d.ts +35 -0
  117. package/lib/esm/types/action.js +10 -0
  118. package/lib/esm/types.d.ts +1 -1
  119. package/lib/esm/utils.d.ts +11 -1
  120. package/lib/esm/utils.js +11 -1
  121. package/package.json +5 -5
@@ -263,6 +263,31 @@ exports.validateNativeVaultAsset = validateNativeVaultAsset;
263
263
  * @param params.withdrawAmount - Amount of collateral being withdrawn.
264
264
  * @param params.lltv - The market's liquidation LTV.
265
265
  * @param params.marketId - The market identifier (for error messages).
266
+ * @returns `void` when the post-withdraw position stays within the safe LTV threshold.
267
+ * @throws {MarketIdMismatchError} when `positionData.marketId` differs from `marketId`.
268
+ * @throws {WithdrawExceedsCollateralError} when `withdrawAmount` exceeds the position's collateral.
269
+ * @throws {MissingMarketPriceError} when the position carries debt but the market has no oracle price.
270
+ * @throws {WithdrawMakesPositionUnhealthyError} when the remaining collateral cannot cover the debt
271
+ * at LLTV minus `DEFAULT_LLTV_BUFFER`.
272
+ * @example
273
+ * ```ts
274
+ * import type { AccrualPosition, MarketId } from "@morpho-org/blue-sdk";
275
+ * import { validatePositionHealthAfterWithdraw } from "@morpho-org/morpho-sdk";
276
+ *
277
+ * export function assertSafeWithdraw(
278
+ * positionData: AccrualPosition,
279
+ * withdrawAmount: bigint,
280
+ * lltv: bigint,
281
+ * marketId: MarketId,
282
+ * ): void {
283
+ * validatePositionHealthAfterWithdraw({
284
+ * positionData,
285
+ * withdrawAmount,
286
+ * lltv,
287
+ * marketId,
288
+ * });
289
+ * }
290
+ * ```
266
291
  */
267
292
  const validatePositionHealthAfterWithdraw = (params) => {
268
293
  const { positionData, withdrawAmount, lltv, marketId } = params;
@@ -323,6 +348,21 @@ exports.validateRepayAmount = validateRepayAmount;
323
348
  * @param params.positionData - The current accrual position.
324
349
  * @param params.repayShares - The amount of shares to repay.
325
350
  * @param params.marketId - The market identifier (for error messages).
351
+ * @returns `void` when `repayShares` does not exceed the position's borrow shares.
352
+ * @throws {RepaySharesExceedDebtError} when `repayShares` exceeds the position's borrow shares.
353
+ * @example
354
+ * ```ts
355
+ * import type { AccrualPosition, MarketId } from "@morpho-org/blue-sdk";
356
+ * import { validateRepayShares } from "@morpho-org/morpho-sdk";
357
+ *
358
+ * export function assertRepayable(
359
+ * positionData: AccrualPosition,
360
+ * repayShares: bigint,
361
+ * marketId: MarketId,
362
+ * ): void {
363
+ * validateRepayShares({ positionData, repayShares, marketId });
364
+ * }
365
+ * ```
326
366
  */
327
367
  const validateRepayShares = (params) => {
328
368
  const { positionData, repayShares, marketId } = params;
@@ -51,11 +51,15 @@ export type VaultV2ForceWithdrawEligibility = {
51
51
  * describing which precondition failed.
52
52
  * @example
53
53
  * ```ts
54
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
54
55
  * import { resolveVaultV2ForceWithdrawEligibility } from "@morpho-org/morpho-sdk";
55
56
  *
56
- * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
57
- * if (eligibility.type === "eligible") {
58
- * console.log(eligibility.adapter.address, eligibility.liquidityMarketId);
57
+ * export function checkEligibility(vaultData: AccrualVaultV2) {
58
+ * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
59
+ * if (eligibility.type === "eligible") {
60
+ * console.log(eligibility.adapter.address, eligibility.liquidityMarketId);
61
+ * }
62
+ * return eligibility;
59
63
  * }
60
64
  * ```
61
65
  */
@@ -76,13 +80,21 @@ export declare function resolveVaultV2ForceWithdrawEligibility(vaultData: Accrua
76
80
  * owner is not a fee recipient.
77
81
  * @example
78
82
  * ```ts
83
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
79
84
  * import { computeVaultV2ForceWithdrawFeeSharesMinted } from "@morpho-org/morpho-sdk";
85
+ * import type { Address } from "viem";
80
86
  *
81
- * const feeShares = computeVaultV2ForceWithdrawFeeSharesMinted({
82
- * vaultData,
83
- * owner,
84
- * timestamp,
85
- * });
87
+ * export function feeShares(
88
+ * vaultData: AccrualVaultV2,
89
+ * owner: Address,
90
+ * timestamp: bigint,
91
+ * ) {
92
+ * return computeVaultV2ForceWithdrawFeeSharesMinted({
93
+ * vaultData,
94
+ * owner,
95
+ * timestamp,
96
+ * });
97
+ * }
86
98
  * ```
87
99
  */
88
100
  export declare function computeVaultV2ForceWithdrawFeeSharesMinted(params: {
@@ -155,21 +167,24 @@ export interface VaultV2ForceWithdrawPlan {
155
167
  * @throws {NonPositiveInputError} when `exitAssets` is not positive.
156
168
  * @example
157
169
  * ```ts
170
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
158
171
  * import {
159
172
  * computeVaultV2ForceWithdrawPlan,
160
173
  * resolveVaultV2ForceWithdrawEligibility,
161
174
  * } from "@morpho-org/morpho-sdk";
162
175
  *
163
- * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
164
- * if (eligibility.type === "eligible") {
176
+ * export function planExit(vaultData: AccrualVaultV2, timestamp: bigint) {
177
+ * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
178
+ * if (eligibility.type !== "eligible") return undefined;
165
179
  * const plan = computeVaultV2ForceWithdrawPlan({
166
180
  * vaultData,
167
181
  * adapter: eligibility.adapter,
168
182
  * liquidityMarketId: eligibility.liquidityMarketId,
169
183
  * exitAssets: 1_000_000n,
170
- * timestamp: 1_800_000_000n,
184
+ * timestamp,
171
185
  * });
172
186
  * // plan.withdrawnAssets is what the user receives before the referral fee
187
+ * return plan;
173
188
  * }
174
189
  * ```
175
190
  */
@@ -224,55 +239,69 @@ export declare function computeVaultV2ForceWithdrawPlan(params: {
224
239
  * @returns An upper bound, in vault shares, of what the exit burns.
225
240
  * @example
226
241
  * ```ts
227
- * import { MathLib } from "@morpho-org/blue-sdk";
242
+ * import { MathLib, type AccrualVaultV2 } from "@morpho-org/blue-sdk";
228
243
  * import {
229
244
  * computeVaultV2ForceWithdrawFeeSharesMinted,
230
245
  * computeVaultV2ForceWithdrawSharesBurnt,
246
+ * type VaultV2ForceWithdrawPlan,
231
247
  * } from "@morpho-org/morpho-sdk";
248
+ * import { type Address, maxUint256 } from "viem";
232
249
  *
233
- * const { vault: nowVaultData } = vaultData.accrueInterest(now);
234
- * const sharesBurntRaw = computeVaultV2ForceWithdrawSharesBurnt({
235
- * vaultData,
236
- * deadlineVaultData: vaultData,
237
- * plan,
238
- * });
239
- * const sharesBurntNow = computeVaultV2ForceWithdrawSharesBurnt({
240
- * vaultData: nowVaultData,
241
- * deadlineVaultData: nowVaultData,
242
- * plan,
243
- * });
244
- * const feeSharesNow = computeVaultV2ForceWithdrawFeeSharesMinted({
245
- * vaultData,
246
- * owner,
247
- * timestamp: now,
248
- * });
249
- * const sharesBurntForFloor = MathLib.max(
250
- * sharesBurntRaw,
251
- * sharesBurntNow - feeSharesNow,
252
- * );
253
- * const allowanceSharePriceE27 = MathLib.max(
254
- * MathLib.min(
255
- * MathLib.mulDivDown(
256
- * minSharePriceE27,
257
- * MathLib.WAD - slippageTolerance,
258
- * MathLib.WAD,
250
+ * export function requiredShareAllowance(
251
+ * vaultData: AccrualVaultV2,
252
+ * plan: VaultV2ForceWithdrawPlan,
253
+ * owner: Address,
254
+ * now: bigint,
255
+ * deadline: bigint,
256
+ * exitAssets: bigint,
257
+ * minSharePriceE27: bigint,
258
+ * slippageTolerance: bigint,
259
+ * ) {
260
+ * const { vault: nowVaultData } = vaultData.accrueInterest(now);
261
+ * const sharesBurntRaw = computeVaultV2ForceWithdrawSharesBurnt({
262
+ * vaultData,
263
+ * deadlineVaultData: vaultData,
264
+ * plan,
265
+ * });
266
+ * const sharesBurntNow = computeVaultV2ForceWithdrawSharesBurnt({
267
+ * vaultData: nowVaultData,
268
+ * deadlineVaultData: nowVaultData,
269
+ * plan,
270
+ * });
271
+ * const feeSharesNow = computeVaultV2ForceWithdrawFeeSharesMinted({
272
+ * vaultData,
273
+ * owner,
274
+ * timestamp: now,
275
+ * });
276
+ * const sharesBurntForFloor = MathLib.max(
277
+ * sharesBurntRaw,
278
+ * sharesBurntNow - feeSharesNow,
279
+ * );
280
+ * const allowanceSharePriceE27 = MathLib.max(
281
+ * MathLib.min(
282
+ * MathLib.mulDivDown(
283
+ * minSharePriceE27,
284
+ * MathLib.WAD - slippageTolerance,
285
+ * MathLib.WAD,
286
+ * ),
287
+ * minSharePriceE27 - 1n,
259
288
  * ),
260
- * minSharePriceE27 - 1n,
261
- * ),
262
- * 1n,
263
- * );
264
- * const requiredShareAllowance = MathLib.min(
265
- * MathLib.max(
266
- * MathLib.mulDivUp(exitAssets, MathLib.RAY, allowanceSharePriceE27),
267
- * MathLib.mulDivUp(exitAssets, MathLib.RAY, minSharePriceE27) + 1n,
268
- * ) +
269
- * computeVaultV2ForceWithdrawFeeSharesMinted({
270
- * vaultData,
271
- * owner,
272
- * timestamp: deadline,
273
- * }),
274
- * maxUint256,
275
- * );
289
+ * 1n,
290
+ * );
291
+ * const requiredShareAllowance = MathLib.min(
292
+ * MathLib.max(
293
+ * MathLib.mulDivUp(exitAssets, MathLib.RAY, allowanceSharePriceE27),
294
+ * MathLib.mulDivUp(exitAssets, MathLib.RAY, minSharePriceE27) + 1n,
295
+ * ) +
296
+ * computeVaultV2ForceWithdrawFeeSharesMinted({
297
+ * vaultData,
298
+ * owner,
299
+ * timestamp: deadline,
300
+ * }),
301
+ * maxUint256,
302
+ * );
303
+ * return requiredShareAllowance;
304
+ * }
276
305
  * ```
277
306
  */
278
307
  export declare function computeVaultV2ForceWithdrawSharesBurnt(params: {
@@ -293,12 +322,18 @@ export declare function computeVaultV2ForceWithdrawSharesBurnt(params: {
293
322
  * @returns A lower bound, in vault shares, of the burn measured by the contract.
294
323
  * @example
295
324
  * ```ts
296
- * import { computeVaultV2ForceWithdrawMinSharesBurnt } from "@morpho-org/morpho-sdk";
325
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
326
+ * import {
327
+ * computeVaultV2ForceWithdrawMinSharesBurnt,
328
+ * type VaultV2ForceWithdrawPlan,
329
+ * } from "@morpho-org/morpho-sdk";
297
330
  *
298
- * const minSharesBurnt = computeVaultV2ForceWithdrawMinSharesBurnt({
299
- * vaultData,
300
- * plan,
301
- * });
331
+ * export function minSharesBurnt(
332
+ * vaultData: AccrualVaultV2,
333
+ * plan: VaultV2ForceWithdrawPlan,
334
+ * ) {
335
+ * return computeVaultV2ForceWithdrawMinSharesBurnt({ vaultData, plan });
336
+ * }
302
337
  * ```
303
338
  */
304
339
  export declare function computeVaultV2ForceWithdrawMinSharesBurnt(params: {
@@ -25,11 +25,15 @@ const index_js_1 = require("../types/index.js");
25
25
  * describing which precondition failed.
26
26
  * @example
27
27
  * ```ts
28
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
28
29
  * import { resolveVaultV2ForceWithdrawEligibility } from "@morpho-org/morpho-sdk";
29
30
  *
30
- * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
31
- * if (eligibility.type === "eligible") {
32
- * console.log(eligibility.adapter.address, eligibility.liquidityMarketId);
31
+ * export function checkEligibility(vaultData: AccrualVaultV2) {
32
+ * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
33
+ * if (eligibility.type === "eligible") {
34
+ * console.log(eligibility.adapter.address, eligibility.liquidityMarketId);
35
+ * }
36
+ * return eligibility;
33
37
  * }
34
38
  * ```
35
39
  */
@@ -88,13 +92,21 @@ function resolveVaultV2ForceWithdrawEligibility(vaultData, adapterOverride) {
88
92
  * owner is not a fee recipient.
89
93
  * @example
90
94
  * ```ts
95
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
91
96
  * import { computeVaultV2ForceWithdrawFeeSharesMinted } from "@morpho-org/morpho-sdk";
97
+ * import type { Address } from "viem";
92
98
  *
93
- * const feeShares = computeVaultV2ForceWithdrawFeeSharesMinted({
94
- * vaultData,
95
- * owner,
96
- * timestamp,
97
- * });
99
+ * export function feeShares(
100
+ * vaultData: AccrualVaultV2,
101
+ * owner: Address,
102
+ * timestamp: bigint,
103
+ * ) {
104
+ * return computeVaultV2ForceWithdrawFeeSharesMinted({
105
+ * vaultData,
106
+ * owner,
107
+ * timestamp,
108
+ * });
109
+ * }
98
110
  * ```
99
111
  */
100
112
  function computeVaultV2ForceWithdrawFeeSharesMinted(params) {
@@ -144,21 +156,24 @@ function computeVaultV2ForceWithdrawFeeSharesMinted(params) {
144
156
  * @throws {NonPositiveInputError} when `exitAssets` is not positive.
145
157
  * @example
146
158
  * ```ts
159
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
147
160
  * import {
148
161
  * computeVaultV2ForceWithdrawPlan,
149
162
  * resolveVaultV2ForceWithdrawEligibility,
150
163
  * } from "@morpho-org/morpho-sdk";
151
164
  *
152
- * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
153
- * if (eligibility.type === "eligible") {
165
+ * export function planExit(vaultData: AccrualVaultV2, timestamp: bigint) {
166
+ * const eligibility = resolveVaultV2ForceWithdrawEligibility(vaultData);
167
+ * if (eligibility.type !== "eligible") return undefined;
154
168
  * const plan = computeVaultV2ForceWithdrawPlan({
155
169
  * vaultData,
156
170
  * adapter: eligibility.adapter,
157
171
  * liquidityMarketId: eligibility.liquidityMarketId,
158
172
  * exitAssets: 1_000_000n,
159
- * timestamp: 1_800_000_000n,
173
+ * timestamp,
160
174
  * });
161
175
  * // plan.withdrawnAssets is what the user receives before the referral fee
176
+ * return plan;
162
177
  * }
163
178
  * ```
164
179
  */
@@ -301,55 +316,69 @@ function computeVaultV2ForceWithdrawPlan(params) {
301
316
  * @returns An upper bound, in vault shares, of what the exit burns.
302
317
  * @example
303
318
  * ```ts
304
- * import { MathLib } from "@morpho-org/blue-sdk";
319
+ * import { MathLib, type AccrualVaultV2 } from "@morpho-org/blue-sdk";
305
320
  * import {
306
321
  * computeVaultV2ForceWithdrawFeeSharesMinted,
307
322
  * computeVaultV2ForceWithdrawSharesBurnt,
323
+ * type VaultV2ForceWithdrawPlan,
308
324
  * } from "@morpho-org/morpho-sdk";
325
+ * import { type Address, maxUint256 } from "viem";
309
326
  *
310
- * const { vault: nowVaultData } = vaultData.accrueInterest(now);
311
- * const sharesBurntRaw = computeVaultV2ForceWithdrawSharesBurnt({
312
- * vaultData,
313
- * deadlineVaultData: vaultData,
314
- * plan,
315
- * });
316
- * const sharesBurntNow = computeVaultV2ForceWithdrawSharesBurnt({
317
- * vaultData: nowVaultData,
318
- * deadlineVaultData: nowVaultData,
319
- * plan,
320
- * });
321
- * const feeSharesNow = computeVaultV2ForceWithdrawFeeSharesMinted({
322
- * vaultData,
323
- * owner,
324
- * timestamp: now,
325
- * });
326
- * const sharesBurntForFloor = MathLib.max(
327
- * sharesBurntRaw,
328
- * sharesBurntNow - feeSharesNow,
329
- * );
330
- * const allowanceSharePriceE27 = MathLib.max(
331
- * MathLib.min(
332
- * MathLib.mulDivDown(
333
- * minSharePriceE27,
334
- * MathLib.WAD - slippageTolerance,
335
- * MathLib.WAD,
327
+ * export function requiredShareAllowance(
328
+ * vaultData: AccrualVaultV2,
329
+ * plan: VaultV2ForceWithdrawPlan,
330
+ * owner: Address,
331
+ * now: bigint,
332
+ * deadline: bigint,
333
+ * exitAssets: bigint,
334
+ * minSharePriceE27: bigint,
335
+ * slippageTolerance: bigint,
336
+ * ) {
337
+ * const { vault: nowVaultData } = vaultData.accrueInterest(now);
338
+ * const sharesBurntRaw = computeVaultV2ForceWithdrawSharesBurnt({
339
+ * vaultData,
340
+ * deadlineVaultData: vaultData,
341
+ * plan,
342
+ * });
343
+ * const sharesBurntNow = computeVaultV2ForceWithdrawSharesBurnt({
344
+ * vaultData: nowVaultData,
345
+ * deadlineVaultData: nowVaultData,
346
+ * plan,
347
+ * });
348
+ * const feeSharesNow = computeVaultV2ForceWithdrawFeeSharesMinted({
349
+ * vaultData,
350
+ * owner,
351
+ * timestamp: now,
352
+ * });
353
+ * const sharesBurntForFloor = MathLib.max(
354
+ * sharesBurntRaw,
355
+ * sharesBurntNow - feeSharesNow,
356
+ * );
357
+ * const allowanceSharePriceE27 = MathLib.max(
358
+ * MathLib.min(
359
+ * MathLib.mulDivDown(
360
+ * minSharePriceE27,
361
+ * MathLib.WAD - slippageTolerance,
362
+ * MathLib.WAD,
363
+ * ),
364
+ * minSharePriceE27 - 1n,
336
365
  * ),
337
- * minSharePriceE27 - 1n,
338
- * ),
339
- * 1n,
340
- * );
341
- * const requiredShareAllowance = MathLib.min(
342
- * MathLib.max(
343
- * MathLib.mulDivUp(exitAssets, MathLib.RAY, allowanceSharePriceE27),
344
- * MathLib.mulDivUp(exitAssets, MathLib.RAY, minSharePriceE27) + 1n,
345
- * ) +
346
- * computeVaultV2ForceWithdrawFeeSharesMinted({
347
- * vaultData,
348
- * owner,
349
- * timestamp: deadline,
350
- * }),
351
- * maxUint256,
352
- * );
366
+ * 1n,
367
+ * );
368
+ * const requiredShareAllowance = MathLib.min(
369
+ * MathLib.max(
370
+ * MathLib.mulDivUp(exitAssets, MathLib.RAY, allowanceSharePriceE27),
371
+ * MathLib.mulDivUp(exitAssets, MathLib.RAY, minSharePriceE27) + 1n,
372
+ * ) +
373
+ * computeVaultV2ForceWithdrawFeeSharesMinted({
374
+ * vaultData,
375
+ * owner,
376
+ * timestamp: deadline,
377
+ * }),
378
+ * maxUint256,
379
+ * );
380
+ * return requiredShareAllowance;
381
+ * }
353
382
  * ```
354
383
  */
355
384
  function computeVaultV2ForceWithdrawSharesBurnt(params) {
@@ -384,12 +413,18 @@ function computeVaultV2ForceWithdrawSharesBurnt(params) {
384
413
  * @returns A lower bound, in vault shares, of the burn measured by the contract.
385
414
  * @example
386
415
  * ```ts
387
- * import { computeVaultV2ForceWithdrawMinSharesBurnt } from "@morpho-org/morpho-sdk";
416
+ * import type { AccrualVaultV2 } from "@morpho-org/blue-sdk";
417
+ * import {
418
+ * computeVaultV2ForceWithdrawMinSharesBurnt,
419
+ * type VaultV2ForceWithdrawPlan,
420
+ * } from "@morpho-org/morpho-sdk";
388
421
  *
389
- * const minSharesBurnt = computeVaultV2ForceWithdrawMinSharesBurnt({
390
- * vaultData,
391
- * plan,
392
- * });
422
+ * export function minSharesBurnt(
423
+ * vaultData: AccrualVaultV2,
424
+ * plan: VaultV2ForceWithdrawPlan,
425
+ * ) {
426
+ * return computeVaultV2ForceWithdrawMinSharesBurnt({ vaultData, plan });
427
+ * }
393
428
  * ```
394
429
  */
395
430
  function computeVaultV2ForceWithdrawMinSharesBurnt(params) {
@@ -1 +1 @@
1
- export { ecrecoverRatifierAbi, midnightAbi, midnightBundlesAbi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
1
+ export { ecrecoverRatifierAbi, midnightAbi, midnightBundlesAbi, priceRatifierV1Abi, rateRatifierV1Abi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setterRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = exports.ecrecoverRatifierAbi = void 0;
3
+ exports.setterRatifierAbi = exports.rateRatifierV1Abi = exports.priceRatifierV1Abi = exports.midnightBundlesAbi = exports.midnightAbi = exports.ecrecoverRatifierAbi = void 0;
4
4
  var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
5
5
  Object.defineProperty(exports, "ecrecoverRatifierAbi", { enumerable: true, get: function () { return midnight_sdk_1.ecrecoverRatifierAbi; } });
6
6
  Object.defineProperty(exports, "midnightAbi", { enumerable: true, get: function () { return midnight_sdk_1.midnightAbi; } });
7
7
  Object.defineProperty(exports, "midnightBundlesAbi", { enumerable: true, get: function () { return midnight_sdk_1.midnightBundlesAbi; } });
8
+ Object.defineProperty(exports, "priceRatifierV1Abi", { enumerable: true, get: function () { return midnight_sdk_1.priceRatifierV1Abi; } });
9
+ Object.defineProperty(exports, "rateRatifierV1Abi", { enumerable: true, get: function () { return midnight_sdk_1.rateRatifierV1Abi; } });
8
10
  Object.defineProperty(exports, "setterRatifierAbi", { enumerable: true, get: function () { return midnight_sdk_1.setterRatifierAbi; } });
@@ -1 +1 @@
1
- export { CBP, COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH, MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE, MAX_OFFER_CAP, MAX_SETTLEMENT_FEES, MAX_TICK, OFFER_TYPEHASH, PRICE_ROUNDING_STEP, SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
1
+ export { CBP, COLLATERAL_PARAMS_TYPEHASH, DEFAULT_TICK_SPACING, EIP712_DOMAIN_TYPEHASH, MARKET_TYPEHASH, MAX_COLLATERALS, MAX_COLLATERALS_PER_BORROWER, MAX_CONTINUOUS_FEE, MAX_OFFER_CAP, MAX_SETTLEMENT_FEES, MAX_TICK, MAX_TREE_HEIGHT, OFFER_TYPEHASH, PRICE_RATIFIER_V1_OFFER_TYPEHASH, PRICE_ROUNDING_STEP, RATE_RATIFIER_V1_OFFER_TYPEHASH, SETTLEMENT_FEE_BREAKPOINTS, TIME_TO_MAX_LIF, } from "@morpho-org/midnight-sdk";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TIME_TO_MAX_LIF = exports.SETTLEMENT_FEE_BREAKPOINTS = exports.PRICE_ROUNDING_STEP = exports.OFFER_TYPEHASH = exports.MAX_TICK = exports.MAX_SETTLEMENT_FEES = exports.MAX_OFFER_CAP = exports.MAX_CONTINUOUS_FEE = exports.MAX_COLLATERALS_PER_BORROWER = exports.MAX_COLLATERALS = exports.MARKET_TYPEHASH = exports.EIP712_DOMAIN_TYPEHASH = exports.DEFAULT_TICK_SPACING = exports.COLLATERAL_PARAMS_TYPEHASH = exports.CBP = void 0;
3
+ exports.TIME_TO_MAX_LIF = exports.SETTLEMENT_FEE_BREAKPOINTS = exports.RATE_RATIFIER_V1_OFFER_TYPEHASH = exports.PRICE_ROUNDING_STEP = exports.PRICE_RATIFIER_V1_OFFER_TYPEHASH = exports.OFFER_TYPEHASH = exports.MAX_TREE_HEIGHT = exports.MAX_TICK = exports.MAX_SETTLEMENT_FEES = exports.MAX_OFFER_CAP = exports.MAX_CONTINUOUS_FEE = exports.MAX_COLLATERALS_PER_BORROWER = exports.MAX_COLLATERALS = exports.MARKET_TYPEHASH = exports.EIP712_DOMAIN_TYPEHASH = exports.DEFAULT_TICK_SPACING = exports.COLLATERAL_PARAMS_TYPEHASH = exports.CBP = void 0;
4
4
  var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
5
5
  Object.defineProperty(exports, "CBP", { enumerable: true, get: function () { return midnight_sdk_1.CBP; } });
6
6
  Object.defineProperty(exports, "COLLATERAL_PARAMS_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.COLLATERAL_PARAMS_TYPEHASH; } });
@@ -13,7 +13,10 @@ Object.defineProperty(exports, "MAX_CONTINUOUS_FEE", { enumerable: true, get: fu
13
13
  Object.defineProperty(exports, "MAX_OFFER_CAP", { enumerable: true, get: function () { return midnight_sdk_1.MAX_OFFER_CAP; } });
14
14
  Object.defineProperty(exports, "MAX_SETTLEMENT_FEES", { enumerable: true, get: function () { return midnight_sdk_1.MAX_SETTLEMENT_FEES; } });
15
15
  Object.defineProperty(exports, "MAX_TICK", { enumerable: true, get: function () { return midnight_sdk_1.MAX_TICK; } });
16
+ Object.defineProperty(exports, "MAX_TREE_HEIGHT", { enumerable: true, get: function () { return midnight_sdk_1.MAX_TREE_HEIGHT; } });
16
17
  Object.defineProperty(exports, "OFFER_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.OFFER_TYPEHASH; } });
18
+ Object.defineProperty(exports, "PRICE_RATIFIER_V1_OFFER_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.PRICE_RATIFIER_V1_OFFER_TYPEHASH; } });
17
19
  Object.defineProperty(exports, "PRICE_ROUNDING_STEP", { enumerable: true, get: function () { return midnight_sdk_1.PRICE_ROUNDING_STEP; } });
20
+ Object.defineProperty(exports, "RATE_RATIFIER_V1_OFFER_TYPEHASH", { enumerable: true, get: function () { return midnight_sdk_1.RATE_RATIFIER_V1_OFFER_TYPEHASH; } });
18
21
  Object.defineProperty(exports, "SETTLEMENT_FEE_BREAKPOINTS", { enumerable: true, get: function () { return midnight_sdk_1.SETTLEMENT_FEE_BREAKPOINTS; } });
19
22
  Object.defineProperty(exports, "TIME_TO_MAX_LIF", { enumerable: true, get: function () { return midnight_sdk_1.TIME_TO_MAX_LIF; } });
@@ -1,2 +1,2 @@
1
- export type { BuildOfferParams, CollateralParams, GroupInput, IAccrualPosition, ICollateralParams, IGroup, IMarket, IMarketParams, IOffer, IPosition, MarketInput, OfferStruct, RatifierTreeInput, SettlementFeeCbps, TreeCreateParams, TreeDescriptor, TreeInput, TreeLike, TreeMempoolValidateParams, TreeMempoolValidateRatification, TreeProof, } from "@morpho-org/midnight-sdk";
1
+ export type { AnyTree, AnyTreeSnapshot, BuildOfferParams, CollateralParams, EcrecoverTreeCreateRequest, GroupInput, IAccrualPosition, ICollateralParams, IGroup, IMarket, IMarketParams, IOffer, IPosition, MarketInput, OfferStruct, PriceRatifierV1TreeCreateRequest, RateRatifierV1TreeCreateRequest, RatifierKind, RatifierTreeInput, RatifierTypes, SetterTreeCreateRequest, SettlementFeeCbps, TreeCreateParams, TreeCreateRequest, TreeData, TreeDescriptor, TreeEntry, TreeInput, TreeLike, TreeMempoolValidateParams, TreeMempoolValidateRatification, TreeProof, TreeSnapshot, TypedRatifierTreeInput, TypedTreeMempoolValidateParams, } from "@morpho-org/midnight-sdk";
2
2
  export { AccrualPosition, Group, Market, MarketParams, Offer, Position, Tree, } from "@morpho-org/midnight-sdk";
@@ -1 +1 @@
1
- export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
1
+ export { ChainIdMismatchError, InvalidEcrecoverSignatureVError, InvalidMarketParameterError, InvalidMidnightApiQuoteTargetError, InvalidMidnightApiResponseError, InvalidOfferGroupError, InvalidOfferParameterError, InvalidPositionAccrualStateError, InvalidPositionAccrualTimestampError, InvalidPositionLossFactorError, InvalidRateRatifierV1RateError, InvalidRateRatifierV1TickError, InvalidRateRatifierV1TimeError, InvalidRatifierV1AddressError, InvalidTickSpacingError, InvalidTreeError, InvalidTreeHeightError, InvalidTypedDataSignatureError, MidnightApiError, MidnightMempoolValidationError, PayloadDecodeError, PriceGreaterThanOneError, RateRatifierV1BoundOverflowError, RatifierV1TakerNotAllowedError, SettlementFeeExceedsPriceError, TickOutOfRangeError, UnknownCollateralIndexError, } from "@morpho-org/midnight-sdk";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownCollateralIndexError = exports.TickOutOfRangeError = exports.SettlementFeeExceedsPriceError = exports.PriceGreaterThanOneError = exports.PayloadDecodeError = exports.MidnightMempoolValidationError = exports.MidnightApiError = exports.InvalidTypedDataSignatureError = exports.InvalidTreeHeightError = exports.InvalidTreeError = exports.InvalidTickSpacingError = exports.InvalidPositionLossFactorError = exports.InvalidPositionAccrualTimestampError = exports.InvalidPositionAccrualStateError = exports.InvalidOfferParameterError = exports.InvalidOfferGroupError = exports.InvalidMidnightApiResponseError = exports.InvalidMidnightApiQuoteTargetError = exports.InvalidMarketParameterError = exports.InvalidEcrecoverSignatureVError = exports.ChainIdMismatchError = void 0;
3
+ exports.UnknownCollateralIndexError = exports.TickOutOfRangeError = exports.SettlementFeeExceedsPriceError = exports.RatifierV1TakerNotAllowedError = exports.RateRatifierV1BoundOverflowError = exports.PriceGreaterThanOneError = exports.PayloadDecodeError = exports.MidnightMempoolValidationError = exports.MidnightApiError = exports.InvalidTypedDataSignatureError = exports.InvalidTreeHeightError = exports.InvalidTreeError = exports.InvalidTickSpacingError = exports.InvalidRatifierV1AddressError = exports.InvalidRateRatifierV1TimeError = exports.InvalidRateRatifierV1TickError = exports.InvalidRateRatifierV1RateError = exports.InvalidPositionLossFactorError = exports.InvalidPositionAccrualTimestampError = exports.InvalidPositionAccrualStateError = exports.InvalidOfferParameterError = exports.InvalidOfferGroupError = exports.InvalidMidnightApiResponseError = exports.InvalidMidnightApiQuoteTargetError = exports.InvalidMarketParameterError = exports.InvalidEcrecoverSignatureVError = exports.ChainIdMismatchError = void 0;
4
4
  var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
5
5
  Object.defineProperty(exports, "ChainIdMismatchError", { enumerable: true, get: function () { return midnight_sdk_1.ChainIdMismatchError; } });
6
6
  Object.defineProperty(exports, "InvalidEcrecoverSignatureVError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidEcrecoverSignatureVError; } });
@@ -12,6 +12,10 @@ Object.defineProperty(exports, "InvalidOfferParameterError", { enumerable: true,
12
12
  Object.defineProperty(exports, "InvalidPositionAccrualStateError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualStateError; } });
13
13
  Object.defineProperty(exports, "InvalidPositionAccrualTimestampError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionAccrualTimestampError; } });
14
14
  Object.defineProperty(exports, "InvalidPositionLossFactorError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidPositionLossFactorError; } });
15
+ Object.defineProperty(exports, "InvalidRateRatifierV1RateError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidRateRatifierV1RateError; } });
16
+ Object.defineProperty(exports, "InvalidRateRatifierV1TickError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidRateRatifierV1TickError; } });
17
+ Object.defineProperty(exports, "InvalidRateRatifierV1TimeError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidRateRatifierV1TimeError; } });
18
+ Object.defineProperty(exports, "InvalidRatifierV1AddressError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidRatifierV1AddressError; } });
15
19
  Object.defineProperty(exports, "InvalidTickSpacingError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTickSpacingError; } });
16
20
  Object.defineProperty(exports, "InvalidTreeError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTreeError; } });
17
21
  Object.defineProperty(exports, "InvalidTreeHeightError", { enumerable: true, get: function () { return midnight_sdk_1.InvalidTreeHeightError; } });
@@ -20,6 +24,8 @@ Object.defineProperty(exports, "MidnightApiError", { enumerable: true, get: func
20
24
  Object.defineProperty(exports, "MidnightMempoolValidationError", { enumerable: true, get: function () { return midnight_sdk_1.MidnightMempoolValidationError; } });
21
25
  Object.defineProperty(exports, "PayloadDecodeError", { enumerable: true, get: function () { return midnight_sdk_1.PayloadDecodeError; } });
22
26
  Object.defineProperty(exports, "PriceGreaterThanOneError", { enumerable: true, get: function () { return midnight_sdk_1.PriceGreaterThanOneError; } });
27
+ Object.defineProperty(exports, "RateRatifierV1BoundOverflowError", { enumerable: true, get: function () { return midnight_sdk_1.RateRatifierV1BoundOverflowError; } });
28
+ Object.defineProperty(exports, "RatifierV1TakerNotAllowedError", { enumerable: true, get: function () { return midnight_sdk_1.RatifierV1TakerNotAllowedError; } });
23
29
  Object.defineProperty(exports, "SettlementFeeExceedsPriceError", { enumerable: true, get: function () { return midnight_sdk_1.SettlementFeeExceedsPriceError; } });
24
30
  Object.defineProperty(exports, "TickOutOfRangeError", { enumerable: true, get: function () { return midnight_sdk_1.TickOutOfRangeError; } });
25
31
  Object.defineProperty(exports, "UnknownCollateralIndexError", { enumerable: true, get: function () { return midnight_sdk_1.UnknownCollateralIndexError; } });
@@ -1 +1 @@
1
- export type { BuildFixedRateOfferChainParams, DecodedEcrecoverRatifierData, DecodedSetterRatifierData, DeploylessFetchParameters, EcrecoverRatificationTypedData, EcrecoverRatifierDataDigestParams, EcrecoverRatifierDataParams, EcrecoverRatifierDataVerificationParams, EcrecoverRatifierRatifyParams, EcrecoverRatifierRootDigestParams, EcrecoverRatifierTypedDataParams, EcrecoverSignatureInput, FixedRateOfferChainLeg, GetRatifierInfoParams, MidnightCallParameters, MidnightFetchParams, RatifierInfo, SetterRatifierDataParams, SetterRatifierDataVerificationParams, VerifiedEcrecoverRatifierData, } from "@morpho-org/midnight-sdk";
1
+ export type { BuildFixedRateOfferChainParams, DecodedEcrecoverRatifierData, DecodedPriceRatifierV1Data, DecodedRateRatifierV1Data, DecodedSetterRatifierData, DeploylessFetchParameters, EcrecoverRatificationTypedData, EcrecoverRatifierDataDigestParams, EcrecoverRatifierDataParams, EcrecoverRatifierDataRequest, EcrecoverRatifierDataVerificationParams, EcrecoverRatifierRatifyParams, EcrecoverRatifierRatifyRequest, EcrecoverRatifierRootDigestParams, EcrecoverRatifierSignRequest, EcrecoverRatifierTypedDataParams, EcrecoverRatifierTypedDataRequest, EcrecoverSignatureInput, FixedRateOfferChainLeg, GetRatifierInfoParams, MidnightCallParameters, MidnightFetchParams, PriceRatifierV1Leaf, PriceRatifierV1LeafStruct, PriceRatifierV1TreeDescriptor, PriceRatifierV1TreeInput, RateRatifierV1Leaf, RateRatifierV1LeafStruct, RateRatifierV1TreeDescriptor, RateRatifierV1TreeInput, RatifierInfo, SetterRatifierDataParams, SetterRatifierDataRequest, SetterRatifierDataVerificationParams, SetterRatifierRatifyRequest, VerifiedEcrecoverRatifierData, } from "@morpho-org/midnight-sdk";
@@ -1 +1,11 @@
1
- export { EcrecoverRatifierUtils, eip712Digest, GroupUtils, MarketUtils, OfferChainUtils, OfferUtils, Payload, PositionUtils, RatifierUtils, SetterRatifierUtils, TakeAmountsLib, TickLib, TreeUtils, } from "@morpho-org/midnight-sdk";
1
+ export { EcrecoverRatifier,
2
+ /** @deprecated Use EcrecoverRatifier with a tagged tree. */
3
+ EcrecoverRatifierUtils, eip712Digest, GroupUtils, MarketUtils, OfferChainUtils, OfferUtils, Payload, PositionUtils, PriceRatifierV1,
4
+ /** @deprecated Use PriceRatifierV1. */
5
+ PriceRatifierV1Utils, RateRatifierV1,
6
+ /** @deprecated Use RateRatifierV1. */
7
+ RateRatifierV1Utils, Ratifier,
8
+ /** @deprecated Use Ratifier. */
9
+ RatifierUtils, SetterRatifier,
10
+ /** @deprecated Use SetterRatifier with a tagged tree. */
11
+ SetterRatifierUtils, TakeAmountsLib, TickLib, TreeUtils, } from "@morpho-org/midnight-sdk";
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TreeUtils = exports.TickLib = exports.TakeAmountsLib = exports.SetterRatifierUtils = exports.RatifierUtils = exports.PositionUtils = exports.Payload = exports.OfferUtils = exports.OfferChainUtils = exports.MarketUtils = exports.GroupUtils = exports.eip712Digest = exports.EcrecoverRatifierUtils = void 0;
3
+ exports.TreeUtils = exports.TickLib = exports.TakeAmountsLib = exports.SetterRatifierUtils = exports.SetterRatifier = exports.RatifierUtils = exports.Ratifier = exports.RateRatifierV1Utils = exports.RateRatifierV1 = exports.PriceRatifierV1Utils = exports.PriceRatifierV1 = exports.PositionUtils = exports.Payload = exports.OfferUtils = exports.OfferChainUtils = exports.MarketUtils = exports.GroupUtils = exports.eip712Digest = exports.EcrecoverRatifierUtils = exports.EcrecoverRatifier = void 0;
4
4
  var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
5
+ Object.defineProperty(exports, "EcrecoverRatifier", { enumerable: true, get: function () { return midnight_sdk_1.EcrecoverRatifier; } });
6
+ /** @deprecated Use EcrecoverRatifier with a tagged tree. */
5
7
  Object.defineProperty(exports, "EcrecoverRatifierUtils", { enumerable: true, get: function () { return midnight_sdk_1.EcrecoverRatifierUtils; } });
6
8
  Object.defineProperty(exports, "eip712Digest", { enumerable: true, get: function () { return midnight_sdk_1.eip712Digest; } });
7
9
  Object.defineProperty(exports, "GroupUtils", { enumerable: true, get: function () { return midnight_sdk_1.GroupUtils; } });
@@ -10,7 +12,17 @@ Object.defineProperty(exports, "OfferChainUtils", { enumerable: true, get: funct
10
12
  Object.defineProperty(exports, "OfferUtils", { enumerable: true, get: function () { return midnight_sdk_1.OfferUtils; } });
11
13
  Object.defineProperty(exports, "Payload", { enumerable: true, get: function () { return midnight_sdk_1.Payload; } });
12
14
  Object.defineProperty(exports, "PositionUtils", { enumerable: true, get: function () { return midnight_sdk_1.PositionUtils; } });
15
+ Object.defineProperty(exports, "PriceRatifierV1", { enumerable: true, get: function () { return midnight_sdk_1.PriceRatifierV1; } });
16
+ /** @deprecated Use PriceRatifierV1. */
17
+ Object.defineProperty(exports, "PriceRatifierV1Utils", { enumerable: true, get: function () { return midnight_sdk_1.PriceRatifierV1Utils; } });
18
+ Object.defineProperty(exports, "RateRatifierV1", { enumerable: true, get: function () { return midnight_sdk_1.RateRatifierV1; } });
19
+ /** @deprecated Use RateRatifierV1. */
20
+ Object.defineProperty(exports, "RateRatifierV1Utils", { enumerable: true, get: function () { return midnight_sdk_1.RateRatifierV1Utils; } });
21
+ Object.defineProperty(exports, "Ratifier", { enumerable: true, get: function () { return midnight_sdk_1.Ratifier; } });
22
+ /** @deprecated Use Ratifier. */
13
23
  Object.defineProperty(exports, "RatifierUtils", { enumerable: true, get: function () { return midnight_sdk_1.RatifierUtils; } });
24
+ Object.defineProperty(exports, "SetterRatifier", { enumerable: true, get: function () { return midnight_sdk_1.SetterRatifier; } });
25
+ /** @deprecated Use SetterRatifier with a tagged tree. */
14
26
  Object.defineProperty(exports, "SetterRatifierUtils", { enumerable: true, get: function () { return midnight_sdk_1.SetterRatifierUtils; } });
15
27
  Object.defineProperty(exports, "TakeAmountsLib", { enumerable: true, get: function () { return midnight_sdk_1.TakeAmountsLib; } });
16
28
  Object.defineProperty(exports, "TickLib", { enumerable: true, get: function () { return midnight_sdk_1.TickLib; } });