@morpho-org/morpho-sdk 9.8.0 → 10.0.0-next.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 (181) hide show
  1. package/MIGRATION-v9-to-v10.md +114 -0
  2. package/README.md +5 -1
  3. package/lib/cjs/abis.d.ts +1 -1
  4. package/lib/cjs/abis.js +5 -1
  5. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +3 -4
  6. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +1 -1
  7. package/lib/cjs/actions/midnight/cancelAndMake.d.ts +2 -1
  8. package/lib/cjs/actions/midnight/cancelAndMake.js +2 -1
  9. package/lib/cjs/actions/midnight/cancelOffers.d.ts +54 -0
  10. package/lib/cjs/actions/midnight/cancelOffers.js +107 -0
  11. package/lib/cjs/actions/midnight/index.d.ts +1 -0
  12. package/lib/cjs/actions/midnight/index.js +1 -0
  13. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +1 -1
  14. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +1 -1
  15. package/lib/cjs/actions/midnight/takeBorrow.d.ts +1 -1
  16. package/lib/cjs/actions/midnight/takeBorrow.js +1 -1
  17. package/lib/cjs/actions/midnight/takeLend.d.ts +1 -1
  18. package/lib/cjs/actions/midnight/takeLend.js +1 -1
  19. package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -1
  20. package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +1 -1
  21. package/lib/cjs/actions/midnight/takeWithdraw.d.ts +1 -1
  22. package/lib/cjs/actions/midnight/takeWithdraw.js +1 -1
  23. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -4
  24. package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -1
  25. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +4 -6
  26. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +3 -3
  27. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +4 -6
  28. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +3 -3
  29. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -6
  30. package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +3 -2
  31. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +3 -5
  32. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +26 -23
  33. package/lib/cjs/blue/abis.d.ts +1 -1
  34. package/lib/cjs/blue/abis.js +5 -1
  35. package/lib/cjs/blue/entities.d.ts +4 -4
  36. package/lib/cjs/blue/entities.js +3 -1
  37. package/lib/cjs/blue/errors.d.ts +2 -2
  38. package/lib/cjs/blue/errors.js +5 -1
  39. package/lib/cjs/blue/fetch.d.ts +2 -2
  40. package/lib/cjs/blue/fetch.js +3 -1
  41. package/lib/cjs/blue/utils.d.ts +1 -1
  42. package/lib/cjs/blue/utils.js +2 -1
  43. package/lib/cjs/entities/blue/blue.d.ts +34 -28
  44. package/lib/cjs/entities/blue/blue.js +99 -73
  45. package/lib/cjs/entities/index.d.ts +4 -4
  46. package/lib/cjs/entities/index.js +3 -1
  47. package/lib/cjs/entities/midnight/deadline.d.ts +2 -2
  48. package/lib/cjs/entities/midnight/deadline.js +2 -2
  49. package/lib/cjs/entities/midnight/midnight.d.ts +49 -51
  50. package/lib/cjs/entities/midnight/midnight.js +144 -131
  51. package/lib/cjs/entities/midnight/publication.d.ts +2 -0
  52. package/lib/cjs/entities/midnight/publication.js +126 -100
  53. package/lib/cjs/entities/midnight/types.d.ts +4 -4
  54. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +3 -5
  55. package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +17 -17
  56. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +3 -4
  57. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +1 -1
  58. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +12 -12
  59. package/lib/cjs/entities/vaultV1/vaultV1.js +83 -57
  60. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +50 -24
  61. package/lib/cjs/entities/vaultV2/vaultV2.js +166 -90
  62. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +17 -2
  63. package/lib/cjs/entities/vaultV2BlueReallocationData.js +1410 -806
  64. package/lib/cjs/errors.d.ts +4 -4
  65. package/lib/cjs/errors.js +7 -5
  66. package/lib/cjs/fetch.d.ts +2 -2
  67. package/lib/cjs/fetch.js +3 -1
  68. package/lib/cjs/helpers/deadShares.js +55 -34
  69. package/lib/cjs/helpers/metadata.d.ts +14 -2
  70. package/lib/cjs/helpers/metadata.js +39 -4
  71. package/lib/cjs/helpers/previewVaultV2ForceWithdraw.js +34 -22
  72. package/lib/cjs/helpers/previewVaultV2InKindRedeem.js +7 -1
  73. package/lib/cjs/helpers/validate.js +76 -61
  74. package/lib/cjs/helpers/validateMidnightTakeFeasibility.js +154 -103
  75. package/lib/cjs/helpers/vaultV2ForceWithdrawPlan.js +31 -20
  76. package/lib/cjs/midnight/errors.d.ts +2 -1
  77. package/lib/cjs/midnight/errors.js +5 -4
  78. package/lib/cjs/transactionPlan/plan.js +6 -3
  79. package/lib/cjs/transactionPlan/serde.js +7 -7
  80. package/lib/cjs/transactionPlan/vaultv2/deposit.d.ts +6 -4
  81. package/lib/cjs/transactionPlan/vaultv2/deposit.js +5 -3
  82. package/lib/cjs/transactionPlan/vaultv2/withdraw.d.ts +6 -4
  83. package/lib/cjs/transactionPlan/vaultv2/withdraw.js +5 -3
  84. package/lib/cjs/types/action.d.ts +26 -2
  85. package/lib/cjs/types/action.js +1 -1
  86. package/lib/cjs/types/error.js +11 -5
  87. package/lib/cjs/types/metadata.d.ts +12 -2
  88. package/lib/cjs/utils.d.ts +2 -2
  89. package/lib/cjs/utils.js +4 -2
  90. package/lib/cjs/version.d.ts +1 -1
  91. package/lib/cjs/version.js +1 -1
  92. package/lib/esm/abis.d.ts +1 -1
  93. package/lib/esm/abis.js +1 -1
  94. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +3 -4
  95. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +1 -1
  96. package/lib/esm/actions/midnight/cancelAndMake.d.ts +2 -1
  97. package/lib/esm/actions/midnight/cancelAndMake.js +2 -1
  98. package/lib/esm/actions/midnight/cancelOffers.d.ts +54 -0
  99. package/lib/esm/actions/midnight/cancelOffers.js +103 -0
  100. package/lib/esm/actions/midnight/index.d.ts +1 -0
  101. package/lib/esm/actions/midnight/index.js +1 -0
  102. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +1 -1
  103. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +1 -1
  104. package/lib/esm/actions/midnight/takeBorrow.d.ts +1 -1
  105. package/lib/esm/actions/midnight/takeBorrow.js +1 -1
  106. package/lib/esm/actions/midnight/takeLend.d.ts +1 -1
  107. package/lib/esm/actions/midnight/takeLend.js +1 -1
  108. package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -1
  109. package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +1 -1
  110. package/lib/esm/actions/midnight/takeWithdraw.d.ts +1 -1
  111. package/lib/esm/actions/midnight/takeWithdraw.js +1 -1
  112. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +3 -4
  113. package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +1 -1
  114. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +4 -6
  115. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +3 -3
  116. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +4 -6
  117. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +3 -3
  118. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +5 -6
  119. package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +3 -2
  120. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +3 -5
  121. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +26 -23
  122. package/lib/esm/blue/abis.d.ts +1 -1
  123. package/lib/esm/blue/abis.js +1 -1
  124. package/lib/esm/blue/entities.d.ts +4 -4
  125. package/lib/esm/blue/entities.js +2 -2
  126. package/lib/esm/blue/errors.d.ts +2 -2
  127. package/lib/esm/blue/errors.js +2 -2
  128. package/lib/esm/blue/fetch.d.ts +2 -2
  129. package/lib/esm/blue/fetch.js +2 -2
  130. package/lib/esm/blue/utils.d.ts +1 -1
  131. package/lib/esm/blue/utils.js +1 -1
  132. package/lib/esm/entities/blue/blue.d.ts +34 -28
  133. package/lib/esm/entities/blue/blue.js +99 -73
  134. package/lib/esm/entities/index.d.ts +4 -4
  135. package/lib/esm/entities/index.js +2 -2
  136. package/lib/esm/entities/midnight/deadline.d.ts +2 -2
  137. package/lib/esm/entities/midnight/deadline.js +2 -2
  138. package/lib/esm/entities/midnight/midnight.d.ts +49 -51
  139. package/lib/esm/entities/midnight/midnight.js +145 -132
  140. package/lib/esm/entities/midnight/publication.d.ts +2 -0
  141. package/lib/esm/entities/midnight/publication.js +126 -100
  142. package/lib/esm/entities/midnight/types.d.ts +4 -4
  143. package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +3 -5
  144. package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +17 -17
  145. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +3 -4
  146. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +1 -1
  147. package/lib/esm/entities/vaultV1/vaultV1.d.ts +12 -12
  148. package/lib/esm/entities/vaultV1/vaultV1.js +83 -57
  149. package/lib/esm/entities/vaultV2/vaultV2.d.ts +50 -24
  150. package/lib/esm/entities/vaultV2/vaultV2.js +166 -90
  151. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +17 -2
  152. package/lib/esm/entities/vaultV2BlueReallocationData.js +1410 -806
  153. package/lib/esm/errors.d.ts +4 -4
  154. package/lib/esm/errors.js +4 -4
  155. package/lib/esm/fetch.d.ts +2 -2
  156. package/lib/esm/fetch.js +2 -2
  157. package/lib/esm/helpers/deadShares.js +56 -35
  158. package/lib/esm/helpers/metadata.d.ts +14 -2
  159. package/lib/esm/helpers/metadata.js +38 -4
  160. package/lib/esm/helpers/previewVaultV2ForceWithdraw.js +34 -22
  161. package/lib/esm/helpers/previewVaultV2InKindRedeem.js +7 -1
  162. package/lib/esm/helpers/validate.js +76 -61
  163. package/lib/esm/helpers/validateMidnightTakeFeasibility.js +153 -102
  164. package/lib/esm/helpers/vaultV2ForceWithdrawPlan.js +31 -20
  165. package/lib/esm/midnight/errors.d.ts +2 -1
  166. package/lib/esm/midnight/errors.js +2 -1
  167. package/lib/esm/transactionPlan/plan.js +6 -3
  168. package/lib/esm/transactionPlan/serde.js +7 -7
  169. package/lib/esm/transactionPlan/vaultv2/deposit.d.ts +6 -4
  170. package/lib/esm/transactionPlan/vaultv2/deposit.js +5 -3
  171. package/lib/esm/transactionPlan/vaultv2/withdraw.d.ts +6 -4
  172. package/lib/esm/transactionPlan/vaultv2/withdraw.js +5 -3
  173. package/lib/esm/types/action.d.ts +26 -2
  174. package/lib/esm/types/action.js +1 -1
  175. package/lib/esm/types/error.js +11 -5
  176. package/lib/esm/types/metadata.d.ts +12 -2
  177. package/lib/esm/utils.d.ts +2 -2
  178. package/lib/esm/utils.js +2 -2
  179. package/lib/esm/version.d.ts +1 -1
  180. package/lib/esm/version.js +1 -1
  181. package/package.json +8 -7
@@ -60,6 +60,7 @@ export interface MidnightMakerOfferState {
60
60
  * @returns Nothing when every offer can be published.
61
61
  * @throws {MidnightOfferExpiredError} when expiry is not later than `now`.
62
62
  * @throws {MidnightOfferExpiryAfterMaturityError} when expiry exceeds market maturity.
63
+ * @throws {UnknownDataError} when an offer's state or rate entry is missing.
63
64
  * @throws {MidnightOfferGroupConsumedError} when the group's remaining cap is zero.
64
65
  * @throws {MidnightOfferTickSpacingError} when the tick is inaccessible.
65
66
  * @throws {MidnightOfferContinuousFeeCapBelowMarketFeeError} when the market fee exceeds the offer cap.
@@ -98,6 +99,7 @@ export declare function validateMidnightMakerOfferStates(params: {
98
99
  * @throws {ChainIdMismatchError} when the client declares, or its RPC reports via `eth_chainId`,
99
100
  * another chain than `params.chainId`.
100
101
  * @throws {viem.BaseError} when block, contract, or oracle-code reads fail.
102
+ * @throws {UnknownDataError} when required publication state is missing.
101
103
  * @example
102
104
  * ```ts
103
105
  * const { states, now } = await fetchMidnightMakerOfferStates({
@@ -4,6 +4,7 @@ exports.offerMarketParams = void 0;
4
4
  exports.validateMidnightMakerOfferStates = validateMidnightMakerOfferStates;
5
5
  exports.fetchMidnightMakerOfferStates = fetchMidnightMakerOfferStates;
6
6
  exports.validateMidnightMakerOfferCallbacks = validateMidnightMakerOfferCallbacks;
7
+ const blue_sdk_1 = require("@morpho-org/blue-sdk");
7
8
  const midnight_sdk_1 = require("@morpho-org/midnight-sdk");
8
9
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
9
10
  const viem_1 = require("viem");
@@ -12,9 +13,102 @@ const validateClientChainId_js_1 = require("../../actions/requirements/validateC
12
13
  const midnightPublicationError_js_1 = require("../../types/midnightPublicationError.js");
13
14
  // Midnight.sol `touchMarket` rejects markets maturing more than 100 years after creation.
14
15
  const MAX_TIME_TO_MATURITY = 100n * 365n * 86400n;
16
+ function requirePublicationState(value) {
17
+ if (value === undefined)
18
+ throw new blue_sdk_1.UnknownDataError("Missing Midnight publication state.");
19
+ return value;
20
+ }
15
21
  /** @internal */
16
22
  const offerMarketParams = (offer) => "params" in offer.market ? offer.market.params : offer.market;
17
23
  exports.offerMarketParams = offerMarketParams;
24
+ function validateOfferTerms({ offer, state, index, marketId, }) {
25
+ const capacity = BigInt(offer.maxAssets) > 0n
26
+ ? BigInt(offer.maxAssets)
27
+ : BigInt(offer.maxUnits);
28
+ if (state.consumed >= capacity) {
29
+ throw new midnightPublicationError_js_1.MidnightOfferGroupConsumedError({
30
+ index,
31
+ group: offer.group,
32
+ consumed: state.consumed,
33
+ });
34
+ }
35
+ const tickSpacing = state.tickSpacing || Number(midnight_sdk_1.DEFAULT_TICK_SPACING);
36
+ if (BigInt(offer.tick) % BigInt(tickSpacing) !== 0n) {
37
+ throw new midnightPublicationError_js_1.MidnightOfferTickSpacingError({
38
+ index,
39
+ tick: BigInt(offer.tick),
40
+ tickSpacing,
41
+ });
42
+ }
43
+ if (BigInt(offer.continuousFeeCap) < state.continuousFee) {
44
+ throw new midnightPublicationError_js_1.MidnightOfferContinuousFeeCapBelowMarketFeeError({
45
+ index,
46
+ marketId,
47
+ continuousFeeCap: BigInt(offer.continuousFeeCap),
48
+ continuousFee: state.continuousFee,
49
+ });
50
+ }
51
+ if (!offer.buy && BigInt(offer.tick) === 0n) {
52
+ throw new midnightPublicationError_js_1.MidnightOfferZeroPriceSellError({ index });
53
+ }
54
+ }
55
+ function validateOfferRate({ offer, state, index, rate, now, expiry, }) {
56
+ let timestamp = offer.buy ? expiry : morpho_ts_1.MathLib.max(now, BigInt(offer.start));
57
+ if (!offer.buy && rate > 0n) {
58
+ const maxTimeToMaturity = (viem_1.maxUint256 - morpho_ts_1.MathLib.WAD * morpho_ts_1.MathLib.WAD - morpho_ts_1.MathLib.WAD + 1n) / rate;
59
+ const marketMaturity = state.market.params.maturity;
60
+ timestamp = morpho_ts_1.MathLib.max(timestamp, marketMaturity - maxTimeToMaturity);
61
+ if (timestamp > expiry || timestamp > marketMaturity) {
62
+ throw new midnightPublicationError_js_1.MidnightOfferRateBoundUnreachableError({
63
+ index,
64
+ rate,
65
+ tick: BigInt(offer.tick),
66
+ });
67
+ }
68
+ }
69
+ if (!midnight_sdk_1.RateRatifierV1.isPriceAcceptable({
70
+ offer: { ...offer, market: state.market },
71
+ rate,
72
+ timestamp,
73
+ })) {
74
+ throw new midnightPublicationError_js_1.MidnightOfferRateBoundUnreachableError({
75
+ index,
76
+ rate,
77
+ tick: BigInt(offer.tick),
78
+ });
79
+ }
80
+ }
81
+ function validateUncreatedMarket({ state, index, offerMarket, maturity, expiry, now, marketCreationTime, }) {
82
+ const marketCreationTimestamp = marketCreationTime === "now" ? now : expiry;
83
+ const maxMaturity = marketCreationTimestamp + MAX_TIME_TO_MATURITY;
84
+ if (maturity > maxMaturity) {
85
+ throw new midnightPublicationError_js_1.MidnightMarketMaturityTooFarError({
86
+ index,
87
+ maturity,
88
+ maxMaturity,
89
+ });
90
+ }
91
+ for (const [collateralIndex, collateral,] of offerMarket.collateralParams.entries()) {
92
+ if (!state.lltvEnabled[collateralIndex]) {
93
+ throw new midnightPublicationError_js_1.MidnightMarketLltvNotEnabledError({
94
+ index,
95
+ lltv: BigInt(collateral.lltv),
96
+ });
97
+ }
98
+ if (!state.liquidationCursorEnabled[collateralIndex]) {
99
+ throw new midnightPublicationError_js_1.MidnightMarketLiquidationCursorNotEnabledError({
100
+ index,
101
+ liquidationCursor: BigInt(collateral.liquidationCursor),
102
+ });
103
+ }
104
+ if (!state.oracleHasCode[collateralIndex]) {
105
+ throw new midnightPublicationError_js_1.MidnightMarketOracleWithoutCodeError({
106
+ index,
107
+ oracle: collateral.oracle,
108
+ });
109
+ }
110
+ }
111
+ }
18
112
  /**
19
113
  * Rejects the first maker offer that cannot be filled at or after publication.
20
114
  *
@@ -31,6 +125,7 @@ exports.offerMarketParams = offerMarketParams;
31
125
  * @returns Nothing when every offer can be published.
32
126
  * @throws {MidnightOfferExpiredError} when expiry is not later than `now`.
33
127
  * @throws {MidnightOfferExpiryAfterMaturityError} when expiry exceeds market maturity.
128
+ * @throws {UnknownDataError} when an offer's state or rate entry is missing.
34
129
  * @throws {MidnightOfferGroupConsumedError} when the group's remaining cap is zero.
35
130
  * @throws {MidnightOfferTickSpacingError} when the tick is inaccessible.
36
131
  * @throws {MidnightOfferContinuousFeeCapBelowMarketFeeError} when the market fee exceeds the offer cap.
@@ -50,7 +145,7 @@ exports.offerMarketParams = offerMarketParams;
50
145
  function validateMidnightMakerOfferStates(params) {
51
146
  const rateEntries = params.tree.type === "rateV1" ? params.tree.entries : [];
52
147
  params.tree.offers.forEach((offer, index) => {
53
- const state = params.states[index];
148
+ const state = requirePublicationState(params.states[index]);
54
149
  const expiry = BigInt(offer.expiry);
55
150
  const offerMarket = (0, exports.offerMarketParams)(offer);
56
151
  const maturity = BigInt(offerMarket.maturity);
@@ -69,63 +164,12 @@ function validateMidnightMakerOfferStates(params) {
69
164
  maturity,
70
165
  });
71
166
  }
72
- const capacity = BigInt(offer.maxAssets) > 0n
73
- ? BigInt(offer.maxAssets)
74
- : BigInt(offer.maxUnits);
75
- if (state.consumed >= capacity) {
76
- throw new midnightPublicationError_js_1.MidnightOfferGroupConsumedError({
77
- index,
78
- group: offer.group,
79
- consumed: state.consumed,
80
- });
81
- }
82
- const tickSpacing = state.tickSpacing || Number(midnight_sdk_1.DEFAULT_TICK_SPACING);
83
- if (BigInt(offer.tick) % BigInt(tickSpacing) !== 0n) {
84
- throw new midnightPublicationError_js_1.MidnightOfferTickSpacingError({
85
- index,
86
- tick: BigInt(offer.tick),
87
- tickSpacing,
88
- });
89
- }
90
- if (BigInt(offer.continuousFeeCap) < state.continuousFee) {
91
- throw new midnightPublicationError_js_1.MidnightOfferContinuousFeeCapBelowMarketFeeError({
92
- index,
93
- marketId,
94
- continuousFeeCap: BigInt(offer.continuousFeeCap),
95
- continuousFee: state.continuousFee,
96
- });
97
- }
98
- if (!offer.buy && BigInt(offer.tick) === 0n) {
99
- throw new midnightPublicationError_js_1.MidnightOfferZeroPriceSellError({ index });
100
- }
167
+ // Reject inaccessible terms before evaluating rate reachability.
168
+ validateOfferTerms({ offer, state, index, marketId });
101
169
  if (params.tree.type === "rateV1") {
102
- const rate = BigInt(rateEntries[index].rate);
103
- let timestamp = offer.buy
104
- ? expiry
105
- : morpho_ts_1.MathLib.max(params.now, BigInt(offer.start));
106
- if (!offer.buy && rate > 0n) {
107
- const maxTimeToMaturity = (viem_1.maxUint256 - morpho_ts_1.MathLib.WAD * morpho_ts_1.MathLib.WAD - morpho_ts_1.MathLib.WAD + 1n) / rate;
108
- const marketMaturity = state.market.params.maturity;
109
- timestamp = morpho_ts_1.MathLib.max(timestamp, marketMaturity - maxTimeToMaturity);
110
- if (timestamp > expiry || timestamp > marketMaturity) {
111
- throw new midnightPublicationError_js_1.MidnightOfferRateBoundUnreachableError({
112
- index,
113
- rate,
114
- tick: BigInt(offer.tick),
115
- });
116
- }
117
- }
118
- if (!midnight_sdk_1.RateRatifierV1.isPriceAcceptable({
119
- offer: { ...offer, market: state.market },
120
- rate,
121
- timestamp,
122
- })) {
123
- throw new midnightPublicationError_js_1.MidnightOfferRateBoundUnreachableError({
124
- index,
125
- rate,
126
- tick: BigInt(offer.tick),
127
- });
128
- }
170
+ const rate = BigInt(requirePublicationState(rateEntries[index]).rate);
171
+ // Reject rate bounds that cannot become fillable.
172
+ validateOfferRate({ offer, state, index, rate, now: params.now, expiry });
129
173
  }
130
174
  if (offer.reduceOnly && offer.buy && state.debt === 0n) {
131
175
  throw new midnightPublicationError_js_1.MidnightOfferNoDebtError({ index, marketId });
@@ -134,35 +178,16 @@ function validateMidnightMakerOfferStates(params) {
134
178
  throw new midnightPublicationError_js_1.MidnightOfferNoCreditError({ index, marketId });
135
179
  }
136
180
  if (state.tickSpacing === 0) {
137
- const marketCreationTimestamp = params.marketCreationTime === "now" ? params.now : expiry;
138
- const maxMaturity = marketCreationTimestamp + MAX_TIME_TO_MATURITY;
139
- if (maturity > maxMaturity) {
140
- throw new midnightPublicationError_js_1.MidnightMarketMaturityTooFarError({
141
- index,
142
- maturity,
143
- maxMaturity,
144
- });
145
- }
146
- for (const [collateralIndex, collateral,] of offerMarket.collateralParams.entries()) {
147
- if (!state.lltvEnabled[collateralIndex]) {
148
- throw new midnightPublicationError_js_1.MidnightMarketLltvNotEnabledError({
149
- index,
150
- lltv: BigInt(collateral.lltv),
151
- });
152
- }
153
- if (!state.liquidationCursorEnabled[collateralIndex]) {
154
- throw new midnightPublicationError_js_1.MidnightMarketLiquidationCursorNotEnabledError({
155
- index,
156
- liquidationCursor: BigInt(collateral.liquidationCursor),
157
- });
158
- }
159
- if (!state.oracleHasCode[collateralIndex]) {
160
- throw new midnightPublicationError_js_1.MidnightMarketOracleWithoutCodeError({
161
- index,
162
- oracle: collateral.oracle,
163
- });
164
- }
165
- }
181
+ // Reject market parameters that cannot be created.
182
+ validateUncreatedMarket({
183
+ state,
184
+ index,
185
+ offerMarket,
186
+ maturity,
187
+ expiry,
188
+ now: params.now,
189
+ marketCreationTime: params.marketCreationTime,
190
+ });
166
191
  }
167
192
  });
168
193
  }
@@ -182,6 +207,7 @@ function validateMidnightMakerOfferStates(params) {
182
207
  * @throws {ChainIdMismatchError} when the client declares, or its RPC reports via `eth_chainId`,
183
208
  * another chain than `params.chainId`.
184
209
  * @throws {viem.BaseError} when block, contract, or oracle-code reads fail.
210
+ * @throws {UnknownDataError} when required publication state is missing.
185
211
  * @example
186
212
  * ```ts
187
213
  * const { states, now } = await fetchMidnightMakerOfferStates({
@@ -282,12 +308,12 @@ async function fetchMidnightMakerOfferStates(params) {
282
308
  ]);
283
309
  const defaultFeeByLoanToken = new Map(defaultFeeTokens.map((loanToken, index) => [
284
310
  loanToken.toLowerCase(),
285
- defaultFees[index],
311
+ requirePublicationState(defaultFees[index]),
286
312
  ]));
287
313
  const marketById = new Map(markets.map(({ id, market: marketParams }, index) => {
288
- const [totalUnits, lossFactor, withdrawable, continuousFeeCredit, fee0, fee1, fee2, fee3, fee4, fee5, fee6, continuousFee, tickSpacing,] = marketStates[index];
314
+ const [totalUnits, lossFactor, withdrawable, continuousFeeCredit, fee0, fee1, fee2, fee3, fee4, fee5, fee6, continuousFee, tickSpacing,] = requirePublicationState(marketStates[index]);
289
315
  const effectiveContinuousFee = tickSpacing === 0
290
- ? defaultFeeByLoanToken.get(marketParams.loanToken.toLowerCase())
316
+ ? requirePublicationState(defaultFeeByLoanToken.get(marketParams.loanToken.toLowerCase()))
291
317
  : continuousFee;
292
318
  return [
293
319
  id.toLowerCase(),
@@ -305,44 +331,44 @@ async function fetchMidnightMakerOfferStates(params) {
305
331
  }));
306
332
  const consumedByGroup = new Map(groups.map(({ maker, group }, index) => [
307
333
  `${maker.toLowerCase()}:${group.toLowerCase()}`,
308
- consumedValues[index],
334
+ requirePublicationState(consumedValues[index]),
309
335
  ]));
310
336
  const positionByOwner = new Map(owners.map(({ id, maker }, index) => [
311
337
  `${id.toLowerCase()}:${maker.toLowerCase()}`,
312
338
  {
313
- credit: creditValues[index],
314
- debt: debtValues[index],
339
+ credit: requirePublicationState(creditValues[index]),
340
+ debt: requirePublicationState(debtValues[index]),
315
341
  },
316
342
  ]));
317
343
  const collateralStateByKey = new Map(collaterals.map(({ key }, index) => [
318
344
  key,
319
345
  {
320
- lltvEnabled: lltvEnabledByCollateral[index],
321
- liquidationCursorEnabled: liquidationCursorEnabledByCollateral[index],
346
+ lltvEnabled: requirePublicationState(lltvEnabledByCollateral[index]),
347
+ liquidationCursorEnabled: requirePublicationState(liquidationCursorEnabledByCollateral[index]),
322
348
  },
323
349
  ]));
324
350
  const collateralStateByMarket = new Map(markets.map(({ id, market }) => [
325
351
  id.toLowerCase(),
326
- market.collateralParams.map((_, index) => collateralStateByKey.get(`${id.toLowerCase()}:${index}`)),
352
+ market.collateralParams.map((_, index) => requirePublicationState(collateralStateByKey.get(`${id.toLowerCase()}:${index}`))),
327
353
  ]));
328
354
  const codeByOracle = new Map(await Promise.all([...new Set(collaterals.map(({ oracleKey }) => oracleKey))].map(async (oracleKey) => [
329
355
  oracleKey,
330
356
  await (0, actions_1.getCode)(params.client, {
331
- address: collaterals.find(({ oracleKey: key }) => key === oracleKey).collateral.oracle,
357
+ address: requirePublicationState(collaterals.find(({ oracleKey: key }) => key === oracleKey)).collateral.oracle,
332
358
  blockNumber,
333
359
  }),
334
360
  ])));
335
361
  const states = params.tree.offers.map((offer) => {
336
362
  const id = midnight_sdk_1.MarketUtils.toId(offer.market);
337
- const market = marketById.get(id.toLowerCase());
363
+ const market = requirePublicationState(marketById.get(id.toLowerCase()));
338
364
  const groupKey = `${offer.maker.toLowerCase()}:${offer.group.toLowerCase()}`;
339
- const owner = positionByOwner.get(`${id.toLowerCase()}:${offer.maker.toLowerCase()}`);
365
+ const owner = requirePublicationState(positionByOwner.get(`${id.toLowerCase()}:${offer.maker.toLowerCase()}`));
340
366
  const uncreated = market.tickSpacing === 0;
341
367
  const collateralStates = uncreated
342
- ? collateralStateByMarket.get(id.toLowerCase())
368
+ ? requirePublicationState(collateralStateByMarket.get(id.toLowerCase()))
343
369
  : [];
344
370
  return {
345
- consumed: consumedByGroup.get(groupKey),
371
+ consumed: requirePublicationState(consumedByGroup.get(groupKey)),
346
372
  tickSpacing: market.tickSpacing,
347
373
  continuousFee: BigInt(market.continuousFee),
348
374
  credit: owner.credit,
@@ -3,7 +3,7 @@ import type { AccrualPosition, Market, MidnightFetchParams, PriceRatifierV1TreeC
3
3
  import type { Address, Hex } from "viem";
4
4
  import type { MidnightMakeBorrowCollateral } from "../../actions/midnight/cancelAndMake.js";
5
5
  import type { MidnightReferralFeeParams, MidnightTakeableOffer } from "../../actions/midnight/types.js";
6
- import type { ActionOutput, BaseAction, MidnightBuyTarget, MidnightCancelAndMakeAction, MidnightCollateralTransfer, MidnightGroupCancellation, MidnightRepay, MidnightSellTarget } from "../../types/action.js";
6
+ import type { ActionOutput, BaseAction, MidnightBuyTarget, MidnightCancelAndMakeAction, MidnightCollateralTransfer, MidnightGroupCancellation, MidnightRepay, MidnightSellTarget, ReferenceTimestampParams } from "../../types/action.js";
7
7
  /** Optional Midnight API validation controls for make-offer flows. */
8
8
  export type OfferValidationParams = Omit<TreeMempoolValidateParams, "chainId" | "ratification">;
9
9
  /**
@@ -33,7 +33,7 @@ export interface OffersData {
33
33
  readonly payload: Hex;
34
34
  }
35
35
  /** Parameters shared by Midnight maker flows. */
36
- export interface MakeOffersParams {
36
+ export interface MakeOffersParams extends ReferenceTimestampParams {
37
37
  /** Maker expected on every offer. Must send the transaction: V2 acts on `msg.sender`. */
38
38
  readonly accountAddress: Address;
39
39
  readonly offers: MidnightMakerTreeInput;
@@ -146,7 +146,7 @@ export interface MakeOffersOutput extends MidnightActionOutput<MidnightCancelAnd
146
146
  readonly ratifierType: "priceV1" | "rateV1";
147
147
  }
148
148
  /** Parameters shared by Midnight market action flows. */
149
- export interface MarketActionParams {
149
+ export interface MarketActionParams extends ReferenceTimestampParams {
150
150
  readonly accountAddress: Address;
151
151
  readonly marketData: Market;
152
152
  }
@@ -260,7 +260,7 @@ export interface WithdrawCollateralBatchParams extends MarketActionParams, Midni
260
260
  readonly receiver?: Address;
261
261
  }
262
262
  /** Parameters for the Midnight redeem flow. */
263
- export interface RedeemParams {
263
+ export interface RedeemParams extends ReferenceTimestampParams {
264
264
  readonly accountAddress: Address;
265
265
  /** Owner-bound snapshot returned by `getPositionData`; manually constructed ownerless snapshots are rejected. */
266
266
  readonly positionData: AccrualPosition;
@@ -1,7 +1,7 @@
1
1
  import { type Address, type Client } from "viem";
2
- import { type BundlesTokenSignatureRequirement, type ERC20ApprovalAction, type Transaction } from "../../types/index.js";
2
+ import { type BundlesTokenSignatureRequirement, type ERC20ApprovalAction, type ReferenceTimestampParams, type Transaction } from "../../types/index.js";
3
3
  /** Parameters for {@link getBundlesTokenRequirements}. */
4
- export interface GetBundlesTokenRequirementsParams {
4
+ export interface GetBundlesTokenRequirementsParams extends ReferenceTimestampParams {
5
5
  /** ERC-20 token funded by the operation. */
6
6
  readonly token: Address;
7
7
  /** Registered fixed bundles contract that pulls the token. */
@@ -22,8 +22,6 @@ export interface GetBundlesTokenRequirementsParams {
22
22
  readonly useSimplePermit?: boolean;
23
23
  /** @deprecated Ignored. The SDK no longer requests Permit2 funding; use ERC-2612 permits or ERC-20 approvals. */
24
24
  readonly permit2Nonce?: bigint;
25
- /** Timestamp the deadline is validated against; defaults to the current time. */
26
- readonly now?: bigint;
27
25
  }
28
26
  /**
29
27
  * Resolves direct approval or ERC-2612 prerequisites for a registered fixed bundles contract.
@@ -40,7 +38,7 @@ export interface GetBundlesTokenRequirementsParams {
40
38
  * @param params.owner - Account funding the operation.
41
39
  * @param params.chainId - Target chain id; must match the client chain.
42
40
  * @param params.deadline - Final-call and signature deadline.
43
- * @param params.now - Timestamp the deadline is validated against; defaults to the current time.
41
+ * @param params.now - See {@link ReferenceTimestampParams.now}.
44
42
  * @param params.supportSignature - Whether ERC-2612 signatures may be requested.
45
43
  * @param params.supportDeployless - Whether ERC-2612 metadata reads may use deployless calls.
46
44
  * @param params.useSimplePermit - Defaults to true when signatures are supported. Prefer ERC-2612 when `nonces()` succeeds and the token's
@@ -25,7 +25,7 @@ const getErc2612Permit_js_1 = require("./getErc2612Permit.js");
25
25
  * @param params.owner - Account funding the operation.
26
26
  * @param params.chainId - Target chain id; must match the client chain.
27
27
  * @param params.deadline - Final-call and signature deadline.
28
- * @param params.now - Timestamp the deadline is validated against; defaults to the current time.
28
+ * @param params.now - See {@link ReferenceTimestampParams.now}.
29
29
  * @param params.supportSignature - Whether ERC-2612 signatures may be requested.
30
30
  * @param params.supportDeployless - Whether ERC-2612 metadata reads may use deployless calls.
31
31
  * @param params.useSimplePermit - Defaults to true when signatures are supported. Prefer ERC-2612 when `nonces()` succeeds and the token's
@@ -125,22 +125,22 @@ const getBundlesTokenRequirements = async (viemClient, params) => {
125
125
  if (allowance >= params.amount)
126
126
  return [];
127
127
  const { dai } = (0, blue_sdk_1.getChainAddresses)(params.chainId);
128
- if (params.supportSignature) {
129
- const isDai = (0, morpho_ts_1.isDefined)(dai) && (0, viem_1.isAddressEqual)(params.token, dai);
130
- if ((params.useSimplePermit ?? true) && !isDai) {
131
- const permit = await (0, getErc2612Permit_js_1.getErc2612Permit)(viemClient, {
132
- token: params.token,
133
- owner: params.owner,
134
- spender: params.spender,
135
- amount: params.amount,
136
- chainId: params.chainId,
137
- deadline: params.deadline,
138
- now: timestamp,
139
- supportDeployless: params.supportDeployless,
140
- });
141
- if ((0, morpho_ts_1.isDefined)(permit))
142
- return [permit];
143
- }
128
+ const isDai = params.supportSignature &&
129
+ (0, morpho_ts_1.isDefined)(dai) &&
130
+ (0, viem_1.isAddressEqual)(params.token, dai);
131
+ if (params.supportSignature && (params.useSimplePermit ?? true) && !isDai) {
132
+ const permit = await (0, getErc2612Permit_js_1.getErc2612Permit)(viemClient, {
133
+ token: params.token,
134
+ owner: params.owner,
135
+ spender: params.spender,
136
+ amount: params.amount,
137
+ chainId: params.chainId,
138
+ deadline: params.deadline,
139
+ now: timestamp,
140
+ supportDeployless: params.supportDeployless,
141
+ });
142
+ if ((0, morpho_ts_1.isDefined)(permit))
143
+ return [permit];
144
144
  }
145
145
  return (0, index_js_1.resolveBundlesTokenRequirements)({
146
146
  token: params.token,
@@ -1,6 +1,6 @@
1
1
  import type { Token } from "@morpho-org/blue-sdk";
2
2
  import type { Address, Client } from "viem";
3
- import { type ERC20ApprovalAction, type PermitRequirementSignature, type Requirement, type Transaction } from "../../types/index.js";
3
+ import { type ERC20ApprovalAction, type PermitRequirementSignature, type ReferenceTimestampParams, type Requirement, type Transaction } from "../../types/index.js";
4
4
  /**
5
5
  * Resolves the vault-share approval or ERC-2612 requirement for a VaultBundlesV1 exit.
6
6
  *
@@ -11,7 +11,7 @@ import { type ERC20ApprovalAction, type PermitRequirementSignature, type Require
11
11
  *
12
12
  * @param viemClient - Client used to read the current share allowance and permit nonce.
13
13
  * @param params - Vault snapshot, owner, minimum allowance, and deadline values.
14
- * @param params.now - Timestamp the deadline is validated against; defaults to the current time.
14
+ * @param params.now - See {@link ReferenceTimestampParams.now}.
15
15
  * @returns No requirement when the allowance is sufficient, otherwise one approval or permit.
16
16
  * @throws {ChainIdMismatchError} when the client declares, or its RPC reports via `eth_chainId`,
17
17
  * another chain than `params.chainId`.
@@ -26,5 +26,4 @@ export declare const getVaultBundlesSharesRequirements: (viemClient: Client, par
26
26
  readonly requiredShareAllowance: bigint;
27
27
  readonly deadline: bigint;
28
28
  readonly supportSignature: boolean;
29
- readonly now?: bigint;
30
- }) => Promise<readonly (Readonly<Transaction<ERC20ApprovalAction>> | Requirement<PermitRequirementSignature>)[]>;
29
+ } & ReferenceTimestampParams) => Promise<readonly (Readonly<Transaction<ERC20ApprovalAction>> | Requirement<PermitRequirementSignature>)[]>;
@@ -19,7 +19,7 @@ const index_js_3 = require("../../types/index.js");
19
19
  *
20
20
  * @param viemClient - Client used to read the current share allowance and permit nonce.
21
21
  * @param params - Vault snapshot, owner, minimum allowance, and deadline values.
22
- * @param params.now - Timestamp the deadline is validated against; defaults to the current time.
22
+ * @param params.now - See {@link ReferenceTimestampParams.now}.
23
23
  * @returns No requirement when the allowance is sufficient, otherwise one approval or permit.
24
24
  * @throws {ChainIdMismatchError} when the client declares, or its RPC reports via `eth_chainId`,
25
25
  * another chain than `params.chainId`.
@@ -2,7 +2,7 @@ import { type AccrualVault, type AccrualVaultV2, type MarketParams } from "@morp
2
2
  import { fetchAccrualVault } from "@morpho-org/blue-sdk-viem";
3
3
  import { type Address } from "viem";
4
4
  import type { FetchParameters } from "../../types/data.js";
5
- import { type ActionOutput, type ActionRequirement, type BundlesFundingArgs, type BundlesTokenRequirementsOptions, type MorphoClientType, type RequirementSignature, type VaultV1DepositAction, type VaultV1InKindRedeemAction, type VaultV1MigrateToV2Action, type VaultV1MigrateToV2AmountArgs, type VaultV1RedeemAction, type VaultV1WithdrawAction } from "../../types/index.js";
5
+ import { type ActionOutput, type ActionRequirement, type BundlesFundingArgs, type BundlesTokenRequirementsOptions, type MorphoClientType, type ReferenceTimestampParams, type RequirementSignature, type VaultV1DepositAction, type VaultV1InKindRedeemAction, type VaultV1MigrateToV2Action, type VaultV1MigrateToV2AmountArgs, type VaultV1RedeemAction, type VaultV1WithdrawAction } from "../../types/index.js";
6
6
  /** Action surface for Vault V1 reads and writes; writes route through VaultBundlesV1 and VaultExitBundlesV1. */
7
7
  export interface VaultV1Actions {
8
8
  /**
@@ -107,7 +107,7 @@ export interface VaultV1Actions {
107
107
  readonly referralFeePct?: bigint;
108
108
  readonly referralFeeRecipient?: Address;
109
109
  readonly deadline?: bigint;
110
- } & BundlesFundingArgs) => ActionOutput<VaultV1DepositAction, readonly RequirementSignature[], BundlesTokenRequirementsOptions>;
110
+ } & ReferenceTimestampParams & BundlesFundingArgs) => ActionOutput<VaultV1DepositAction, readonly RequirementSignature[], BundlesTokenRequirementsOptions>;
111
111
  /**
112
112
  * Prepares an exact-assets Vault V1 withdrawal through VaultBundlesV1.
113
113
  *
@@ -189,7 +189,7 @@ export interface VaultV1Actions {
189
189
  readonly referralFeePct?: bigint;
190
190
  readonly referralFeeRecipient?: Address;
191
191
  readonly deadline?: bigint;
192
- }) => ActionOutput<VaultV1WithdrawAction, readonly RequirementSignature[], undefined>;
192
+ } & ReferenceTimestampParams) => ActionOutput<VaultV1WithdrawAction, readonly RequirementSignature[], undefined>;
193
193
  /**
194
194
  * Prepares an exact-shares Vault V1 redemption through VaultBundlesV1.
195
195
  *
@@ -270,7 +270,7 @@ export interface VaultV1Actions {
270
270
  readonly referralFeePct?: bigint;
271
271
  readonly referralFeeRecipient?: Address;
272
272
  readonly deadline?: bigint;
273
- }) => ActionOutput<VaultV1RedeemAction, readonly RequirementSignature[], undefined>;
273
+ } & ReferenceTimestampParams) => ActionOutput<VaultV1RedeemAction, readonly RequirementSignature[], undefined>;
274
274
  /**
275
275
  * Prepares an illiquid Vault V1 exit into the vault's Morpho Blue supply positions.
276
276
  *
@@ -355,7 +355,7 @@ export interface VaultV1Actions {
355
355
  readonly vaultData: AccrualVault;
356
356
  readonly userAddress: Address;
357
357
  readonly deadline?: bigint;
358
- }) => ActionOutput<VaultV1InKindRedeemAction, readonly RequirementSignature[], undefined>;
358
+ } & ReferenceTimestampParams) => ActionOutput<VaultV1InKindRedeemAction, readonly RequirementSignature[], undefined>;
359
359
  /**
360
360
  * Prepares a Vault V1-to-Vault V2 migration through VaultBundlesV1.
361
361
  *
@@ -461,7 +461,7 @@ export interface VaultV1Actions {
461
461
  readonly referralFeePct?: bigint;
462
462
  readonly referralFeeRecipient?: Address;
463
463
  readonly deadline?: bigint;
464
- } & VaultV1MigrateToV2AmountArgs) => ActionOutput<VaultV1MigrateToV2Action, readonly RequirementSignature[], undefined>;
464
+ } & ReferenceTimestampParams & VaultV1MigrateToV2AmountArgs) => ActionOutput<VaultV1MigrateToV2Action, readonly RequirementSignature[], undefined>;
465
465
  }
466
466
  /** Binds a viem client to a Vault V1 (MetaMorpho) vault's action builders. */
467
467
  export declare class MorphoVaultV1 implements VaultV1Actions {
@@ -487,7 +487,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
487
487
  readonly referralFeePct?: bigint;
488
488
  readonly referralFeeRecipient?: Address;
489
489
  readonly deadline?: bigint;
490
- } & BundlesFundingArgs): Readonly<{
490
+ } & ReferenceTimestampParams & BundlesFundingArgs): Readonly<{
491
491
  getRequirements: (requirementOptions?: BundlesTokenRequirementsOptions) => Promise<readonly ActionRequirement[]>;
492
492
  buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../index.js").Transaction<VaultV1DepositAction>>;
493
493
  }>;
@@ -499,7 +499,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
499
499
  readonly referralFeePct?: bigint;
500
500
  readonly referralFeeRecipient?: Address;
501
501
  readonly deadline?: bigint;
502
- }): Readonly<{
502
+ } & ReferenceTimestampParams): Readonly<{
503
503
  getRequirements: () => Promise<readonly (Readonly<import("../../index.js").Transaction<import("../../index.js").ERC20ApprovalAction>> | import("../../index.js").Requirement<import("../../index.js").Erc2612RequirementSignature, undefined>)[]>;
504
504
  buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../index.js").Transaction<VaultV1WithdrawAction>>;
505
505
  }>;
@@ -510,18 +510,18 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
510
510
  readonly referralFeePct?: bigint;
511
511
  readonly referralFeeRecipient?: Address;
512
512
  readonly deadline?: bigint;
513
- }): Readonly<{
513
+ } & ReferenceTimestampParams): Readonly<{
514
514
  getRequirements: () => Promise<readonly (Readonly<import("../../index.js").Transaction<import("../../index.js").ERC20ApprovalAction>> | import("../../index.js").Requirement<import("../../index.js").Erc2612RequirementSignature, undefined>)[]>;
515
515
  buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../index.js").Transaction<VaultV1RedeemAction>>;
516
516
  }>;
517
517
  /** {@inheritDoc VaultV1Actions.inKindRedeem} */
518
- inKindRedeem({ amount, marketParamsList, vaultData, userAddress, deadline: deadlineOverride, }: {
518
+ inKindRedeem(params: {
519
519
  readonly amount: bigint;
520
520
  readonly marketParamsList: readonly MarketParams[];
521
521
  readonly vaultData: AccrualVault;
522
522
  readonly userAddress: Address;
523
523
  readonly deadline?: bigint;
524
- }): ActionOutput<VaultV1InKindRedeemAction, readonly RequirementSignature[], undefined>;
524
+ } & ReferenceTimestampParams): ActionOutput<VaultV1InKindRedeemAction, readonly RequirementSignature[], undefined>;
525
525
  /** {@inheritDoc VaultV1Actions.migrateToV2} */
526
526
  migrateToV2(params: {
527
527
  readonly userAddress: Address;
@@ -531,7 +531,7 @@ export declare class MorphoVaultV1 implements VaultV1Actions {
531
531
  readonly referralFeePct?: bigint;
532
532
  readonly referralFeeRecipient?: Address;
533
533
  readonly deadline?: bigint;
534
- } & VaultV1MigrateToV2AmountArgs): Readonly<{
534
+ } & ReferenceTimestampParams & VaultV1MigrateToV2AmountArgs): Readonly<{
535
535
  getRequirements: () => Promise<readonly (Readonly<import("../../index.js").Transaction<import("../../index.js").ERC20ApprovalAction>> | import("../../index.js").Requirement<import("../../index.js").Erc2612RequirementSignature, undefined>)[]>;
536
536
  buildTx: (signatures?: readonly RequirementSignature[]) => Readonly<import("../../index.js").Transaction<VaultV1MigrateToV2Action>>;
537
537
  }>;