@morpho-org/morpho-sdk 10.4.0 → 10.5.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 (193) hide show
  1. package/lib/cjs/actions/blue/common.js +12 -3
  2. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +16 -11
  3. package/lib/cjs/actions/midnight/takeBorrow.js +14 -8
  4. package/lib/cjs/actions/midnight/takeLend.js +15 -9
  5. package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +19 -13
  6. package/lib/cjs/actions/midnight/takeWithdraw.js +14 -8
  7. package/lib/cjs/constants.d.ts +1 -1
  8. package/lib/cjs/constants.js +3 -2
  9. package/lib/cjs/entities/midnight/midnight.d.ts +106 -103
  10. package/lib/cjs/entities/midnight/midnight.js +120 -101
  11. package/lib/cjs/entities/vaultV1/vaultV1.js +0 -1
  12. package/lib/cjs/entities/vaultV2/vaultV2.js +0 -1
  13. package/lib/cjs/helpers/constant.d.ts +7 -0
  14. package/lib/cjs/helpers/constant.js +8 -1
  15. package/lib/cjs/helpers/index.d.ts +1 -1
  16. package/lib/cjs/helpers/index.js +2 -1
  17. package/lib/cjs/helpers/validate.d.ts +25 -1
  18. package/lib/cjs/helpers/validate.js +25 -1
  19. package/lib/cjs/transactionPlan/assemble.d.ts +24 -0
  20. package/lib/cjs/transactionPlan/assemble.js +25 -0
  21. package/lib/cjs/transactionPlan/blue/borrow.js +14 -64
  22. package/lib/cjs/transactionPlan/blue/refinance.js +9 -11
  23. package/lib/cjs/transactionPlan/blue/repay.js +10 -24
  24. package/lib/cjs/transactionPlan/blue/repayWithdrawCollateral.js +49 -45
  25. package/lib/cjs/transactionPlan/blue/stored.d.ts +26 -0
  26. package/lib/cjs/transactionPlan/blue/stored.js +87 -0
  27. package/lib/cjs/transactionPlan/blue/supply.js +7 -22
  28. package/lib/cjs/transactionPlan/blue/supplyCollateral.d.ts +1 -1
  29. package/lib/cjs/transactionPlan/blue/supplyCollateral.js +10 -15
  30. package/lib/cjs/transactionPlan/blue/supplyCollateralBorrow.js +14 -64
  31. package/lib/cjs/transactionPlan/blue/withdraw.d.ts +2 -3
  32. package/lib/cjs/transactionPlan/blue/withdraw.js +67 -79
  33. package/lib/cjs/transactionPlan/blue/withdrawCollateral.d.ts +2 -3
  34. package/lib/cjs/transactionPlan/blue/withdrawCollateral.js +31 -30
  35. package/lib/cjs/transactionPlan/deposit.js +4 -7
  36. package/lib/cjs/transactionPlan/intent.d.ts +1 -1
  37. package/lib/cjs/transactionPlan/midnight/makeBorrow.d.ts +1 -1
  38. package/lib/cjs/transactionPlan/midnight/makeBorrow.js +1 -1
  39. package/lib/cjs/transactionPlan/midnight/makeLend.d.ts +1 -1
  40. package/lib/cjs/transactionPlan/midnight/makeLend.js +1 -1
  41. package/lib/cjs/transactionPlan/midnight/makeRepay.d.ts +1 -1
  42. package/lib/cjs/transactionPlan/midnight/makeRepay.js +1 -1
  43. package/lib/cjs/transactionPlan/midnight/repayWithdrawCollateral.d.ts +1 -1
  44. package/lib/cjs/transactionPlan/midnight/repayWithdrawCollateral.js +1 -1
  45. package/lib/cjs/transactionPlan/midnight/supplyBlueMakeLend.d.ts +1 -1
  46. package/lib/cjs/transactionPlan/midnight/supplyBlueMakeLend.js +1 -1
  47. package/lib/cjs/transactionPlan/midnight/supplyCollateral.d.ts +1 -1
  48. package/lib/cjs/transactionPlan/midnight/supplyCollateral.js +1 -1
  49. package/lib/cjs/transactionPlan/midnight/supplyCollateralBatch.d.ts +1 -1
  50. package/lib/cjs/transactionPlan/midnight/supplyCollateralBatch.js +1 -1
  51. package/lib/cjs/transactionPlan/midnight/supplyCollateralMakeBorrow.d.ts +1 -1
  52. package/lib/cjs/transactionPlan/midnight/supplyCollateralMakeBorrow.js +1 -1
  53. package/lib/cjs/transactionPlan/midnight/supplyCollateralWithNative.d.ts +1 -1
  54. package/lib/cjs/transactionPlan/midnight/supplyCollateralWithNative.js +1 -1
  55. package/lib/cjs/transactionPlan/midnight/takeBorrow.d.ts +6 -2
  56. package/lib/cjs/transactionPlan/midnight/takeBorrow.js +10 -4
  57. package/lib/cjs/transactionPlan/midnight/takeRepayWithdrawCollateral.d.ts +1 -1
  58. package/lib/cjs/transactionPlan/midnight/takeRepayWithdrawCollateral.js +1 -1
  59. package/lib/cjs/transactionPlan/midnight/takeWithdraw.d.ts +1 -1
  60. package/lib/cjs/transactionPlan/midnight/takeWithdraw.js +1 -1
  61. package/lib/cjs/transactionPlan/permit.d.ts +15 -2
  62. package/lib/cjs/transactionPlan/permit.js +26 -68
  63. package/lib/cjs/transactionPlan/plan.d.ts +51 -1
  64. package/lib/cjs/transactionPlan/plan.js +56 -13
  65. package/lib/cjs/transactionPlan/redeem.js +4 -7
  66. package/lib/cjs/transactionPlan/types.d.ts +4 -3
  67. package/lib/cjs/transactionPlan/vaultBinding.d.ts +29 -0
  68. package/lib/cjs/transactionPlan/vaultBinding.js +69 -0
  69. package/lib/cjs/transactionPlan/vaultRequirements.d.ts +20 -0
  70. package/lib/cjs/transactionPlan/vaultRequirements.js +37 -0
  71. package/lib/cjs/transactionPlan/vaultv1/deposit.d.ts +1 -1
  72. package/lib/cjs/transactionPlan/vaultv1/deposit.js +2 -13
  73. package/lib/cjs/transactionPlan/vaultv1/inKindRedeem.d.ts +2 -2
  74. package/lib/cjs/transactionPlan/vaultv1/inKindRedeem.js +10 -41
  75. package/lib/cjs/transactionPlan/vaultv1/migrateToV2.d.ts +1 -1
  76. package/lib/cjs/transactionPlan/vaultv1/migrateToV2.js +6 -18
  77. package/lib/cjs/transactionPlan/vaultv1/redeem.js +1 -12
  78. package/lib/cjs/transactionPlan/vaultv1/withdraw.d.ts +1 -1
  79. package/lib/cjs/transactionPlan/vaultv1/withdraw.js +2 -13
  80. package/lib/cjs/transactionPlan/vaultv2/deposit.d.ts +1 -1
  81. package/lib/cjs/transactionPlan/vaultv2/deposit.js +2 -13
  82. package/lib/cjs/transactionPlan/vaultv2/forceRedeem.d.ts +1 -1
  83. package/lib/cjs/transactionPlan/vaultv2/forceRedeem.js +4 -7
  84. package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.d.ts +2 -2
  85. package/lib/cjs/transactionPlan/vaultv2/forceWithdraw.js +12 -42
  86. package/lib/cjs/transactionPlan/vaultv2/inKindRedeem.d.ts +2 -2
  87. package/lib/cjs/transactionPlan/vaultv2/inKindRedeem.js +10 -41
  88. package/lib/cjs/transactionPlan/vaultv2/redeem.d.ts +1 -1
  89. package/lib/cjs/transactionPlan/vaultv2/redeem.js +2 -13
  90. package/lib/cjs/transactionPlan/vaultv2/withdraw.d.ts +1 -1
  91. package/lib/cjs/transactionPlan/vaultv2/withdraw.js +2 -13
  92. package/lib/cjs/transactionPlan/withdraw.js +4 -7
  93. package/lib/cjs/types/error.d.ts +27 -1
  94. package/lib/cjs/types/error.js +32 -3
  95. package/lib/cjs/version.d.ts +1 -1
  96. package/lib/cjs/version.js +1 -1
  97. package/lib/esm/actions/blue/common.js +13 -4
  98. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +16 -11
  99. package/lib/esm/actions/midnight/takeBorrow.js +14 -8
  100. package/lib/esm/actions/midnight/takeLend.js +15 -9
  101. package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +19 -13
  102. package/lib/esm/actions/midnight/takeWithdraw.js +14 -8
  103. package/lib/esm/constants.d.ts +1 -1
  104. package/lib/esm/constants.js +1 -1
  105. package/lib/esm/entities/midnight/midnight.d.ts +106 -103
  106. package/lib/esm/entities/midnight/midnight.js +120 -101
  107. package/lib/esm/entities/vaultV1/vaultV1.js +0 -1
  108. package/lib/esm/entities/vaultV2/vaultV2.js +0 -1
  109. package/lib/esm/helpers/constant.d.ts +7 -0
  110. package/lib/esm/helpers/constant.js +7 -0
  111. package/lib/esm/helpers/index.d.ts +1 -1
  112. package/lib/esm/helpers/index.js +1 -1
  113. package/lib/esm/helpers/validate.d.ts +25 -1
  114. package/lib/esm/helpers/validate.js +25 -2
  115. package/lib/esm/transactionPlan/assemble.d.ts +24 -0
  116. package/lib/esm/transactionPlan/assemble.js +21 -0
  117. package/lib/esm/transactionPlan/blue/borrow.js +15 -65
  118. package/lib/esm/transactionPlan/blue/refinance.js +10 -12
  119. package/lib/esm/transactionPlan/blue/repay.js +11 -25
  120. package/lib/esm/transactionPlan/blue/repayWithdrawCollateral.js +50 -46
  121. package/lib/esm/transactionPlan/blue/stored.d.ts +26 -0
  122. package/lib/esm/transactionPlan/blue/stored.js +80 -0
  123. package/lib/esm/transactionPlan/blue/supply.js +7 -22
  124. package/lib/esm/transactionPlan/blue/supplyCollateral.d.ts +1 -1
  125. package/lib/esm/transactionPlan/blue/supplyCollateral.js +10 -15
  126. package/lib/esm/transactionPlan/blue/supplyCollateralBorrow.js +15 -65
  127. package/lib/esm/transactionPlan/blue/withdraw.d.ts +2 -3
  128. package/lib/esm/transactionPlan/blue/withdraw.js +70 -82
  129. package/lib/esm/transactionPlan/blue/withdrawCollateral.d.ts +2 -3
  130. package/lib/esm/transactionPlan/blue/withdrawCollateral.js +32 -31
  131. package/lib/esm/transactionPlan/deposit.js +5 -8
  132. package/lib/esm/transactionPlan/intent.d.ts +1 -1
  133. package/lib/esm/transactionPlan/midnight/makeBorrow.d.ts +1 -1
  134. package/lib/esm/transactionPlan/midnight/makeBorrow.js +1 -1
  135. package/lib/esm/transactionPlan/midnight/makeLend.d.ts +1 -1
  136. package/lib/esm/transactionPlan/midnight/makeLend.js +1 -1
  137. package/lib/esm/transactionPlan/midnight/makeRepay.d.ts +1 -1
  138. package/lib/esm/transactionPlan/midnight/makeRepay.js +1 -1
  139. package/lib/esm/transactionPlan/midnight/repayWithdrawCollateral.d.ts +1 -1
  140. package/lib/esm/transactionPlan/midnight/repayWithdrawCollateral.js +1 -1
  141. package/lib/esm/transactionPlan/midnight/supplyBlueMakeLend.d.ts +1 -1
  142. package/lib/esm/transactionPlan/midnight/supplyBlueMakeLend.js +1 -1
  143. package/lib/esm/transactionPlan/midnight/supplyCollateral.d.ts +1 -1
  144. package/lib/esm/transactionPlan/midnight/supplyCollateral.js +1 -1
  145. package/lib/esm/transactionPlan/midnight/supplyCollateralBatch.d.ts +1 -1
  146. package/lib/esm/transactionPlan/midnight/supplyCollateralBatch.js +1 -1
  147. package/lib/esm/transactionPlan/midnight/supplyCollateralMakeBorrow.d.ts +1 -1
  148. package/lib/esm/transactionPlan/midnight/supplyCollateralMakeBorrow.js +1 -1
  149. package/lib/esm/transactionPlan/midnight/supplyCollateralWithNative.d.ts +1 -1
  150. package/lib/esm/transactionPlan/midnight/supplyCollateralWithNative.js +1 -1
  151. package/lib/esm/transactionPlan/midnight/takeBorrow.d.ts +6 -2
  152. package/lib/esm/transactionPlan/midnight/takeBorrow.js +11 -5
  153. package/lib/esm/transactionPlan/midnight/takeRepayWithdrawCollateral.d.ts +1 -1
  154. package/lib/esm/transactionPlan/midnight/takeRepayWithdrawCollateral.js +1 -1
  155. package/lib/esm/transactionPlan/midnight/takeWithdraw.d.ts +1 -1
  156. package/lib/esm/transactionPlan/midnight/takeWithdraw.js +1 -1
  157. package/lib/esm/transactionPlan/permit.d.ts +15 -2
  158. package/lib/esm/transactionPlan/permit.js +25 -68
  159. package/lib/esm/transactionPlan/plan.d.ts +51 -1
  160. package/lib/esm/transactionPlan/plan.js +55 -13
  161. package/lib/esm/transactionPlan/redeem.js +5 -8
  162. package/lib/esm/transactionPlan/types.d.ts +4 -3
  163. package/lib/esm/transactionPlan/vaultBinding.d.ts +29 -0
  164. package/lib/esm/transactionPlan/vaultBinding.js +65 -0
  165. package/lib/esm/transactionPlan/vaultRequirements.d.ts +20 -0
  166. package/lib/esm/transactionPlan/vaultRequirements.js +34 -0
  167. package/lib/esm/transactionPlan/vaultv1/deposit.d.ts +1 -1
  168. package/lib/esm/transactionPlan/vaultv1/deposit.js +3 -14
  169. package/lib/esm/transactionPlan/vaultv1/inKindRedeem.d.ts +2 -2
  170. package/lib/esm/transactionPlan/vaultv1/inKindRedeem.js +12 -43
  171. package/lib/esm/transactionPlan/vaultv1/migrateToV2.d.ts +1 -1
  172. package/lib/esm/transactionPlan/vaultv1/migrateToV2.js +9 -21
  173. package/lib/esm/transactionPlan/vaultv1/redeem.js +2 -13
  174. package/lib/esm/transactionPlan/vaultv1/withdraw.d.ts +1 -1
  175. package/lib/esm/transactionPlan/vaultv1/withdraw.js +3 -14
  176. package/lib/esm/transactionPlan/vaultv2/deposit.d.ts +1 -1
  177. package/lib/esm/transactionPlan/vaultv2/deposit.js +3 -14
  178. package/lib/esm/transactionPlan/vaultv2/forceRedeem.d.ts +1 -1
  179. package/lib/esm/transactionPlan/vaultv2/forceRedeem.js +5 -8
  180. package/lib/esm/transactionPlan/vaultv2/forceWithdraw.d.ts +2 -2
  181. package/lib/esm/transactionPlan/vaultv2/forceWithdraw.js +15 -45
  182. package/lib/esm/transactionPlan/vaultv2/inKindRedeem.d.ts +2 -2
  183. package/lib/esm/transactionPlan/vaultv2/inKindRedeem.js +12 -43
  184. package/lib/esm/transactionPlan/vaultv2/redeem.d.ts +1 -1
  185. package/lib/esm/transactionPlan/vaultv2/redeem.js +3 -14
  186. package/lib/esm/transactionPlan/vaultv2/withdraw.d.ts +1 -1
  187. package/lib/esm/transactionPlan/vaultv2/withdraw.js +3 -14
  188. package/lib/esm/transactionPlan/withdraw.js +5 -8
  189. package/lib/esm/types/error.d.ts +27 -1
  190. package/lib/esm/types/error.js +30 -2
  191. package/lib/esm/version.d.ts +1 -1
  192. package/lib/esm/version.js +1 -1
  193. package/package.json +3 -3
@@ -13,9 +13,6 @@ import type { GetOffersDataParams, GetPositionDataParams, MakeLendParams, MakeOf
13
13
  *
14
14
  * @example
15
15
  * ```ts
16
- * import { Time } from "@morpho-org/morpho-ts";
17
- * import { maxUint256 } from "viem";
18
- *
19
16
  * const midnight = client.morpho.midnight(8453);
20
17
  * const marketData = await midnight.getMarketData(marketId);
21
18
  * const output = midnight.takeLend({
@@ -23,7 +20,7 @@ import type { GetOffersDataParams, GetPositionDataParams, MakeLendParams, MakeOf
23
20
  * marketData,
24
21
  * target: { type: "assets", assets: 1_000_000n, minUnits: 900_000n },
25
22
  * takeableOffers: quote.data.takeableOffers,
26
- * maxContinuousFee: maxUint256,
23
+ * maxContinuousFee: BigInt(marketData.continuousFee),
27
24
  * now: (await client.getBlock()).timestamp,
28
25
  * deadline: (await client.getBlock()).timestamp + 600n,
29
26
  * });
@@ -156,22 +153,22 @@ export declare class MorphoMidnight {
156
153
  * On an assets target, sell offers whose tick is out of range or whose buyer price is zero or
157
154
  * above one are dropped from the transaction because one of them would revert the whole bundle.
158
155
  *
159
- * @param params - Lender, market snapshot, buy target, offers, fee cap, deadline, and optional referral fee.
160
- * @param params.accountAddress - Lender; must send the transaction, since V2 acts for `msg.sender`.
161
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
162
- * @param params.target - `{ type: "assets", assets, minUnits }` or `{ type: "units", units, maxBuyerAssets }`.
163
- * @param params.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
156
+ * @param raw - Lender, market snapshot, buy target, offers, fee cap, deadline, and optional referral fee.
157
+ * @param raw.accountAddress - Lender; must send the transaction, since V2 acts for `msg.sender`.
158
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
159
+ * @param raw.target - `{ type: "assets", assets, minUnits }` or `{ type: "units", units, maxBuyerAssets }`.
160
+ * @param raw.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
164
161
  * chain's wNative and transfers it to `msg.sender` before pulling. It may cover part or all of
165
162
  * the maximum wNative amount this call can pull, but not more. Any wrapped native not pulled
166
163
  * stays in the sender's wallet as wNative. The wNative approval to `MidnightBundlesV2` is still
167
164
  * required for the full pulled amount.
168
- * @param params.takeableOffers - Borrow-side offers returned by the Midnight API.
169
- * @param params.maxContinuousFee - Largest market continuous fee accepted, in the unit of the market's
165
+ * @param raw.takeableOffers - Borrow-side offers returned by the Midnight API.
166
+ * @param raw.maxContinuousFee - Largest market continuous fee accepted, in the unit of the market's
170
167
  * onchain `continuousFee` (`Market.continuousFee`): a WAD-scaled per-second rate, so `317097919n`
171
168
  * is about 1% per year. The take reverts if the market fee is higher. Pass `maxUint256` for no cap.
172
- * @param params.deadline - Bundle execution deadline timestamp.
173
- * @param params.referralFeePct - Optional WAD-scaled referral fee paid out of the pulled assets.
174
- * @param params.referralFeeRecipient - Referral fee recipient; required with a positive fee.
169
+ * @param raw.deadline - Bundle execution deadline timestamp.
170
+ * @param raw.referralFeePct - Optional WAD-scaled referral fee paid out of the pulled assets.
171
+ * @param raw.referralFeeRecipient - Referral fee recipient; required with a positive fee.
175
172
  * @returns Lazy loan-token approval and `MidnightBundlesV2` authorization requirements, and a synchronous transaction builder.
176
173
  * @throws {ChainIdMismatchError} when client or market data targets another chain, or from
177
174
  * `getRequirements()` when the RPC reports another chain via `eth_chainId`.
@@ -219,7 +216,7 @@ export declare class MorphoMidnight {
219
216
  * marketData,
220
217
  * target: { type: "assets", assets: 1_000_000n, minUnits: 900_000n },
221
218
  * takeableOffers: quote.data.takeableOffers,
222
- * maxContinuousFee: maxUint256,
219
+ * maxContinuousFee: BigInt(marketData.continuousFee),
223
220
  * now: (await client.getBlock()).timestamp,
224
221
  * deadline: (await client.getBlock()).timestamp + 600n,
225
222
  * });
@@ -236,26 +233,26 @@ export declare class MorphoMidnight {
236
233
  * settlement fee until `deadline` (at or below it on an assets target) are dropped from the transaction because one of them would
237
234
  * revert the whole bundle.
238
235
  *
239
- * @param params - Borrower, market snapshot, sell target, offers, deadline, receiver, and optional referral fee.
240
- * @param params.accountAddress - Borrower; must send the transaction, since V2 acts for `msg.sender`.
241
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
242
- * @param params.positionData - Owner-bound position snapshot returned by `getPositionData`. The
236
+ * @param raw - Borrower, market snapshot, sell target, offers, deadline, receiver, and optional referral fee.
237
+ * @param raw.accountAddress - Borrower; must send the transaction, since V2 acts for `msg.sender`.
238
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
239
+ * @param raw.positionData - Owner-bound position snapshot returned by `getPositionData`. The
243
240
  * `DEFAULT_LLTV_BUFFER` check is only as current as this snapshot and `collateralPrices`: it
244
241
  * does not see transactions mined or prices moved since, so two transactions built from one
245
242
  * snapshot can together end inside the buffer. Midnight still rejects any position above
246
243
  * LLTV onchain. Midnight debt and collateral do not accrue, so the check needs no accrual.
247
- * @param params.collateralPrices - Values from `price()` on each
244
+ * @param raw.collateralPrices - Values from `price()` on each
248
245
  * `marketData.params.collateralParams[i].oracle`, indexed like `positionData.collateral` and
249
246
  * scaled by `ORACLE_PRICE_SCALE`. A price is required for every held or supplied collateral
250
247
  * index, because debt after a borrow is always positive.
251
- * @param params.target - `{ type: "assets", assets, maxUnits }` or `{ type: "units", units, minSellerAssets }`.
252
- * @param params.receiver - Optional loan-asset recipient; defaults to `accountAddress`.
248
+ * @param raw.target - `{ type: "assets", assets, maxUnits }` or `{ type: "units", units, minSellerAssets }`.
249
+ * @param raw.receiver - Optional loan-asset recipient; defaults to `accountAddress`.
253
250
  * Midnight protocol and market token contracts are rejected.
254
- * @param params.takeableOffers - Lend-side offers returned by the Midnight API.
255
- * @param params.deadline - Bounded bundle execution deadline timestamp.
256
- * @param params.referralFeePct - Optional WAD-scaled referral fee taken from the sale
251
+ * @param raw.takeableOffers - Lend-side offers returned by the Midnight API.
252
+ * @param raw.deadline - Bounded bundle execution deadline timestamp.
253
+ * @param raw.referralFeePct - Optional WAD-scaled referral fee taken from the sale
257
254
  * proceeds; on an assets target it is added on top of `target.assets`.
258
- * @param params.referralFeeRecipient - Referral fee recipient; required with a positive fee.
255
+ * @param raw.referralFeeRecipient - Referral fee recipient; required with a positive fee.
259
256
  * @returns Lazy `MidnightBundlesV2` authorization requirement and a synchronous transaction builder.
260
257
  * @throws {ChainIdMismatchError} when client or market data targets another chain, or from
261
258
  * `getRequirements()` when the RPC reports another chain via `eth_chainId`.
@@ -296,6 +293,9 @@ export declare class MorphoMidnight {
296
293
  * withdrawal.
297
294
  * @throws {MidnightTakeTargetUnreachableError} when the live offers cannot hold the target, or
298
295
  * its bounds cannot hold at any fill.
296
+ * @throws {MidnightBorrowTooCloseToMaturityError} when `now` is not past maturity and `deadline` is less
297
+ * than `MIDNIGHT_MIN_BORROW_TIME_TO_MATURITY` (2 hours) before it, even when credit covers the
298
+ * target; use `takeWithdraw` to sell credit only.
299
299
  * @example
300
300
  * ```ts
301
301
  * import { blueOracleAbi } from "@morpho-org/morpho-sdk/abis";
@@ -333,17 +333,17 @@ export declare class MorphoMidnight {
333
333
  * settlement fee until `deadline` (at or below it on an assets target) are dropped from the transaction because one of them would
334
334
  * revert the whole bundle.
335
335
  *
336
- * @param params - Lender, market snapshot, sell target, offers, deadline, receiver, and optional referral fee.
337
- * @param params.accountAddress - Lender; must send the transaction, since V2 acts for `msg.sender`.
338
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
339
- * @param params.target - `{ type: "assets", assets, maxUnits }` or `{ type: "units", units, minSellerAssets }`.
340
- * @param params.receiver - Optional loan-asset recipient; defaults to `accountAddress`.
336
+ * @param raw - Lender, market snapshot, sell target, offers, deadline, receiver, and optional referral fee.
337
+ * @param raw.accountAddress - Lender; must send the transaction, since V2 acts for `msg.sender`.
338
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
339
+ * @param raw.target - `{ type: "assets", assets, maxUnits }` or `{ type: "units", units, minSellerAssets }`.
340
+ * @param raw.receiver - Optional loan-asset recipient; defaults to `accountAddress`.
341
341
  * Midnight protocol and market token contracts are rejected.
342
- * @param params.takeableOffers - Lend-side offers returned by the Midnight API.
343
- * @param params.deadline - Bundle execution deadline timestamp.
344
- * @param params.referralFeePct - Optional WAD-scaled referral fee taken from the sale
342
+ * @param raw.takeableOffers - Lend-side offers returned by the Midnight API.
343
+ * @param raw.deadline - Bundle execution deadline timestamp.
344
+ * @param raw.referralFeePct - Optional WAD-scaled referral fee taken from the sale
345
345
  * proceeds; on an assets target it is added on top of `target.assets`.
346
- * @param params.referralFeeRecipient - Referral fee recipient; required with a positive fee.
346
+ * @param raw.referralFeeRecipient - Referral fee recipient; required with a positive fee.
347
347
  * @returns Lazy `MidnightBundlesV2` authorization requirement and a synchronous transaction builder.
348
348
  * @throws {ChainIdMismatchError} when client or market data targets another chain, or from
349
349
  * `getRequirements()` when the RPC reports another chain via `eth_chainId`.
@@ -402,32 +402,32 @@ export declare class MorphoMidnight {
402
402
  * settlement fee until `deadline` (at or below it on an assets target) are dropped from the transaction because one of them would
403
403
  * revert the whole bundle.
404
404
  *
405
- * @param params - Borrower, market snapshot, collateral supplies, sell target, offers, deadline, receiver, and optional referral fee.
406
- * @param params.accountAddress - Borrower; must send the transaction, since V2 acts for `msg.sender`.
407
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
408
- * @param params.positionData - Owner-bound position snapshot returned by `getPositionData`. The
405
+ * @param raw - Borrower, market snapshot, collateral supplies, sell target, offers, deadline, receiver, and optional referral fee.
406
+ * @param raw.accountAddress - Borrower; must send the transaction, since V2 acts for `msg.sender`.
407
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
408
+ * @param raw.positionData - Owner-bound position snapshot returned by `getPositionData`. The
409
409
  * `DEFAULT_LLTV_BUFFER` check is only as current as this snapshot and `collateralPrices`: it
410
410
  * does not see transactions mined or prices moved since, so two transactions built from one
411
411
  * snapshot can together end inside the buffer. Midnight still rejects any position above
412
412
  * LLTV onchain. Midnight debt and collateral do not accrue, so the check needs no accrual.
413
- * @param params.collateralPrices - Values from `price()` on each
413
+ * @param raw.collateralPrices - Values from `price()` on each
414
414
  * `marketData.params.collateralParams[i].oracle`, indexed like `positionData.collateral` and
415
415
  * scaled by `ORACLE_PRICE_SCALE`. A price is required for every held or supplied collateral
416
416
  * index, because debt after a borrow is always positive.
417
- * @param params.collateralSupplies - Collateral index and assets per supply; must not be empty.
418
- * @param params.target - `{ type: "assets", assets, maxUnits }` or `{ type: "units", units, minSellerAssets }`.
419
- * @param params.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
417
+ * @param raw.collateralSupplies - Collateral index and assets per supply; must not be empty.
418
+ * @param raw.target - `{ type: "assets", assets, maxUnits }` or `{ type: "units", units, minSellerAssets }`.
419
+ * @param raw.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
420
420
  * chain's wNative and transfers it to `msg.sender` before pulling. It may cover part or all of
421
421
  * the maximum wNative amount this call can pull, but not more. Any wrapped native not pulled
422
422
  * stays in the sender's wallet as wNative. The wNative approval to `MidnightBundlesV2` is still
423
423
  * required for the full pulled amount.
424
- * @param params.receiver - Optional loan-asset recipient; defaults to `accountAddress`.
424
+ * @param raw.receiver - Optional loan-asset recipient; defaults to `accountAddress`.
425
425
  * Midnight protocol and market token contracts are rejected.
426
- * @param params.takeableOffers - Lend-side offers returned by the Midnight API.
427
- * @param params.deadline - Bounded bundle execution deadline timestamp.
428
- * @param params.referralFeePct - Optional WAD-scaled referral fee taken from the sale
426
+ * @param raw.takeableOffers - Lend-side offers returned by the Midnight API.
427
+ * @param raw.deadline - Bounded bundle execution deadline timestamp.
428
+ * @param raw.referralFeePct - Optional WAD-scaled referral fee taken from the sale
429
429
  * proceeds; on an assets target it is added on top of `target.assets`.
430
- * @param params.referralFeeRecipient - Referral fee recipient; required with a positive fee.
430
+ * @param raw.referralFeeRecipient - Referral fee recipient; required with a positive fee.
431
431
  * @returns Lazy collateral approvals and `MidnightBundlesV2` authorization requirements, and a synchronous transaction builder.
432
432
  * @throws {ChainIdMismatchError} when client or market data targets another chain, or from
433
433
  * `getRequirements()` when the RPC reports another chain via `eth_chainId`.
@@ -474,6 +474,9 @@ export declare class MorphoMidnight {
474
474
  * withdrawal.
475
475
  * @throws {MidnightTakeTargetUnreachableError} when the live offers cannot hold the target, or
476
476
  * its bounds cannot hold at any fill.
477
+ * @throws {MidnightBorrowTooCloseToMaturityError} when `now` is not past maturity and `deadline` is less
478
+ * than `MIDNIGHT_MIN_BORROW_TIME_TO_MATURITY` (2 hours) before it, even when credit covers the
479
+ * target; use `takeWithdraw` to sell credit only.
477
480
  * @example
478
481
  * ```ts
479
482
  * const output = midnight.supplyCollateralTakeBorrow({
@@ -499,37 +502,37 @@ export declare class MorphoMidnight {
499
502
  * On an assets target, sell offers whose tick is out of range or whose buyer price is zero or
500
503
  * above one are dropped from the transaction because one of them would revert the whole bundle.
501
504
  *
502
- * @param params - Borrower, market snapshot, buy target, offers, repay fallback, withdrawals, fee cap, deadline and optional referral fee.
503
- * @param params.accountAddress - Borrower; must send the transaction, since V2 acts for `msg.sender`.
504
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
505
- * @param params.positionData - Owner-bound position snapshot returned by `getPositionData`. The
505
+ * @param raw - Borrower, market snapshot, buy target, offers, repay fallback, withdrawals, fee cap, deadline and optional referral fee.
506
+ * @param raw.accountAddress - Borrower; must send the transaction, since V2 acts for `msg.sender`.
507
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
508
+ * @param raw.positionData - Owner-bound position snapshot returned by `getPositionData`. The
506
509
  * `DEFAULT_LLTV_BUFFER` check is only as current as this snapshot and `collateralPrices`: it
507
510
  * does not see transactions mined or prices moved since, so two transactions built from one
508
511
  * snapshot can together end inside the buffer. Midnight still rejects any position above
509
512
  * LLTV onchain. Midnight debt and collateral do not accrue, so the check needs no accrual.
510
- * @param params.collateralPrices - Values from `price()` on each
513
+ * @param raw.collateralPrices - Values from `price()` on each
511
514
  * `marketData.params.collateralParams[i].oracle`, indexed like `positionData.collateral` and
512
515
  * scaled by `ORACLE_PRICE_SCALE`. An empty array is safe only when
513
516
  * `collateralWithdrawals` is empty or the conservative post-operation debt is zero: a units
514
517
  * `target` covering `positionData.debt`, or an assets target whose `minUnits` covers it.
515
- * @param params.target - `{ type: "assets", assets, minUnits }` or `{ type: "units", units, maxBuyerAssets }`; `units: maxUint256` targets the sender's whole debt, capped by `maxBuyerAssets` (must be finite; `units: maxUint256` already selects the whole debt).
516
- * @param params.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
518
+ * @param raw.target - `{ type: "assets", assets, minUnits }` or `{ type: "units", units, maxBuyerAssets }`; `units: maxUint256` targets the sender's whole debt, capped by `maxBuyerAssets` (must be finite; `units: maxUint256` already selects the whole debt).
519
+ * @param raw.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
517
520
  * chain's wNative and transfers it to `msg.sender` before pulling. It may cover part or all of
518
521
  * the maximum wNative amount this call can pull, but not more. Any wrapped native not pulled
519
522
  * stays in the sender's wallet as wNative. The wNative approval to `MidnightBundlesV2` is still
520
523
  * required for the full pulled amount.
521
- * @param params.takeableOffers - Borrow-side offers returned by the Midnight API.
522
- * @param params.repayEnabled - Whether the unfilled remainder is repaid directly to Midnight.
523
- * @param params.collateralWithdrawals - Optional collateral withdrawals; `maxUint256` assets withdraws the whole balance.
524
- * @param params.collateralReceiver - Optional collateral recipient; defaults to `accountAddress`,
524
+ * @param raw.takeableOffers - Borrow-side offers returned by the Midnight API.
525
+ * @param raw.repayEnabled - Whether the unfilled remainder is repaid directly to Midnight.
526
+ * @param raw.collateralWithdrawals - Optional collateral withdrawals; `maxUint256` assets withdraws the whole balance.
527
+ * @param raw.collateralReceiver - Optional collateral recipient; defaults to `accountAddress`,
525
528
  * must be non-zero and not a Midnight protocol or market token contract when
526
529
  * `collateralWithdrawals` is non-empty, and is unused otherwise.
527
- * @param params.maxContinuousFee - Largest market continuous fee accepted, in the unit of the market's
530
+ * @param raw.maxContinuousFee - Largest market continuous fee accepted, in the unit of the market's
528
531
  * onchain `continuousFee` (`Market.continuousFee`): a WAD-scaled per-second rate, so `317097919n`
529
532
  * is about 1% per year. The take reverts if the market fee is higher. Pass `maxUint256` for no cap.
530
- * @param params.deadline - Bundle execution deadline timestamp.
531
- * @param params.referralFeePct - Optional WAD-scaled referral fee paid out of the pulled assets.
532
- * @param params.referralFeeRecipient - Referral fee recipient; required with a positive fee.
533
+ * @param raw.deadline - Bundle execution deadline timestamp.
534
+ * @param raw.referralFeePct - Optional WAD-scaled referral fee paid out of the pulled assets.
535
+ * @param raw.referralFeeRecipient - Referral fee recipient; required with a positive fee.
533
536
  * @returns Lazy loan-token approval and `MidnightBundlesV2` authorization requirements, and a synchronous transaction builder.
534
537
  * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
535
538
  * @throws {ChainIdMismatchError} when client or market data targets another chain, or from
@@ -593,7 +596,7 @@ export declare class MorphoMidnight {
593
596
  * takeableOffers: quote.data.takeableOffers,
594
597
  * repayEnabled: true,
595
598
  * collateralWithdrawals: [{ collateralIndex: 0n, assets: maxUint256 }],
596
- * maxContinuousFee: maxUint256,
599
+ * maxContinuousFee: BigInt(marketData.continuousFee),
597
600
  * now: (await client.getBlock()).timestamp,
598
601
  * deadline: (await client.getBlock()).timestamp + 600n,
599
602
  * });
@@ -606,18 +609,18 @@ export declare class MorphoMidnight {
606
609
  * Uses the supplied position snapshot to resolve maxUint256 and check collateral health.
607
610
  * No requirements or RPC reads are needed. The signing account must be accountAddress.
608
611
  *
609
- * @param params - Market, owner-bound position, collateral prices and withdrawal amount.
610
- * @param params.accountAddress - Collateral owner. This account must send the transaction.
611
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
612
- * @param params.positionData - Owner-bound position snapshot returned by getPositionData.
613
- * @param params.collateralPrices - Oracle prices indexed like positionData.collateral and scaled by
612
+ * @param raw - Market, owner-bound position, collateral prices and withdrawal amount.
613
+ * @param raw.accountAddress - Collateral owner. This account must send the transaction.
614
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
615
+ * @param raw.positionData - Owner-bound position snapshot returned by getPositionData.
616
+ * @param raw.collateralPrices - Oracle prices indexed like positionData.collateral and scaled by
614
617
  * ORACLE_PRICE_SCALE; required when the position has debt, otherwise an empty array is safe.
615
- * @param params.collateralIndex - Optional collateral index; defaults to 0n. Indexes follow the
618
+ * @param raw.collateralIndex - Optional collateral index; defaults to 0n. Indexes follow the
616
619
  * market's collateral parameters, which Midnight sorts by token address, not the order they were
617
620
  * listed in when the market was built; check marketData.getCollateralByIndex(index).token.
618
- * @param params.assets - Collateral assets to withdraw. maxUint256 resolves the whole balance of
621
+ * @param raw.assets - Collateral assets to withdraw. maxUint256 resolves the whole balance of
619
622
  * the selected collateral from positionData before building the transaction.
620
- * @param params.receiver - Account receiving the withdrawn collateral; defaults to accountAddress.
623
+ * @param raw.receiver - Account receiving the withdrawn collateral; defaults to accountAddress.
621
624
  * @returns Lazy handles for a direct Midnight withdrawal.
622
625
  * @throws {ChainIdMismatchError} when the client or market targets another chain.
623
626
  * @throws {MidnightCalldataEncodingError} when accountAddress is malformed or an input cannot be ABI-encoded.
@@ -653,15 +656,15 @@ export declare class MorphoMidnight {
653
656
  * Duplicates are rejected, unlike bundle flows which sum them.
654
657
  * No requirements or RPC reads are needed. The signing account must be accountAddress.
655
658
  *
656
- * @param params - Market, owner-bound position, collateral prices and withdrawal amount.
657
- * @param params.accountAddress - Collateral owner. This account must send the transaction.
658
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
659
- * @param params.positionData - Owner-bound position snapshot returned by getPositionData.
660
- * @param params.collateralPrices - Oracle prices indexed like positionData.collateral and scaled by
659
+ * @param raw - Market, owner-bound position, collateral prices and withdrawal amount.
660
+ * @param raw.accountAddress - Collateral owner. This account must send the transaction.
661
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
662
+ * @param raw.positionData - Owner-bound position snapshot returned by getPositionData.
663
+ * @param raw.collateralPrices - Oracle prices indexed like positionData.collateral and scaled by
661
664
  * ORACLE_PRICE_SCALE; required when the position has debt, otherwise an empty array is safe.
662
- * @param params.collateralWithdrawals - Nonempty ordered withdrawals, one per index.
665
+ * @param raw.collateralWithdrawals - Nonempty ordered withdrawals, one per index.
663
666
  * maxUint256 resolves that index's full snapshot balance.
664
- * @param params.receiver - Account receiving the withdrawn collateral; defaults to accountAddress.
667
+ * @param raw.receiver - Account receiving the withdrawn collateral; defaults to accountAddress.
665
668
  * @returns Lazy handles for a direct Midnight withdrawal.
666
669
  * @throws {ChainIdMismatchError} when the client or market targets another chain.
667
670
  * @throws {MidnightCalldataEncodingError} when accountAddress is malformed or an input cannot be ABI-encoded.
@@ -695,18 +698,18 @@ export declare class MorphoMidnight {
695
698
  /**
696
699
  * Prepares a direct collateral supply using a caller-provided market snapshot.
697
700
  *
698
- * @param params.accountAddress - Account receiving the supplied collateral position. It must send
701
+ * @param raw.accountAddress - Account receiving the supplied collateral position. It must send
699
702
  * the transaction: Midnight pulls the collateral from `msg.sender` and only lets the position owner
700
703
  * or its operators supply for it, and the approval requirements are resolved for this account.
701
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
702
- * @param params.collateralAssets - Collateral assets supplied in this transaction.
703
- * @param params.reservedCollateralAssets - Existing collateral reserved by other open maker groups.
704
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
705
+ * @param raw.collateralAssets - Collateral assets supplied in this transaction.
706
+ * @param raw.reservedCollateralAssets - Existing collateral reserved by other open maker groups.
704
707
  * Only raises the approval requirement so those groups keep their allowance; the transaction
705
708
  * transfers only `collateralAssets`.
706
- * @param params.collateralIndex - Optional collateral index; defaults to `0n`. Indexes follow the
709
+ * @param raw.collateralIndex - Optional collateral index; defaults to `0n`. Indexes follow the
707
710
  * market's collateral parameters, which Midnight sorts by token address, not the order they were
708
711
  * listed in when the market was built; check `marketData.getCollateralByIndex(index).token`.
709
- * @param params.now - Optional reference timestamp in seconds; used for metadata only when the
712
+ * @param raw.now - Optional reference timestamp in seconds; used for metadata only when the
710
713
  * client sets `metadata.timestamp: true`.
711
714
  * @returns Lazy token-approval requirements and a synchronous transaction builder.
712
715
  * @throws {NegativeInputError} when the resolved metadata timestamp is negative, or the reserve is negative.
@@ -811,9 +814,9 @@ export declare class MorphoMidnight {
811
814
  * Prepares ordered direct collateral supplies in one Midnight multicall.
812
815
  * Pass one entry per index: duplicates are rejected, unlike bundle flows which sum them.
813
816
  *
814
- * @param params.accountAddress - Sender and collateral beneficiary.
815
- * @param params.marketData - Snapshot of the target market.
816
- * @param params.collateralSupplies - Ordered supplies with optional reserved allowance amounts.
817
+ * @param raw.accountAddress - Sender and collateral beneficiary.
818
+ * @param raw.marketData - Snapshot of the target market.
819
+ * @param raw.collateralSupplies - Ordered supplies with optional reserved allowance amounts.
817
820
  * @returns A lazy approval resolver and synchronous stateless transaction builder.
818
821
  * @throws {ChainIdMismatchError} when the client or market targets another chain.
819
822
  * @throws {MidnightMarketAddressMismatchError} when the deployment differs.
@@ -1313,14 +1316,14 @@ export declare class MorphoMidnight {
1313
1316
  /**
1314
1317
  * Prepares redemption of accrued Midnight credit from a position snapshot.
1315
1318
  *
1316
- * @param params - Position owner, accrued position, optional unit amount, and receiver.
1317
- * @param params.accountAddress - Position owner whose credit is redeemed. It must send the
1319
+ * @param raw - Position owner, accrued position, optional unit amount, and receiver.
1320
+ * @param raw.accountAddress - Position owner whose credit is redeemed. It must send the
1318
1321
  * transaction (or authorize the sender): Midnight reverts `Unauthorized()` otherwise, which
1319
1322
  * `getRequirements()` cannot detect because it does not know the sender.
1320
- * @param params.positionData - Owner-bound position snapshot returned by `getPositionData`.
1321
- * @param params.receiver - Optional credit receiver; defaults to the position owner.
1323
+ * @param raw.positionData - Owner-bound position snapshot returned by `getPositionData`.
1324
+ * @param raw.receiver - Optional credit receiver; defaults to the position owner.
1322
1325
  * Midnight protocol and market token contracts are rejected.
1323
- * @param params.units - Optional credit units to redeem; defaults to the position face value.
1326
+ * @param raw.units - Optional credit units to redeem; defaults to the position face value.
1324
1327
  * Credit is checked after applying the realized losses and continuous fees that Midnight
1325
1328
  * charges before a withdrawal, accrued up to now. Fees keep accruing until maturity, so `units` close to the accrued
1326
1329
  * credit can still revert when the transaction lands later. The default face value does not
@@ -1359,30 +1362,30 @@ export declare class MorphoMidnight {
1359
1362
  /**
1360
1363
  * Prepares a direct `MidnightBundlesV2` repayment, collateral withdrawal, or both, for `accountAddress`.
1361
1364
  *
1362
- * @param params - Account, market snapshot, `repay` mode, collateral withdrawals, optional collateral receiver, and deadline.
1363
- * @param params.accountAddress - Position owner and transaction sender.
1364
- * @param params.marketData - Hydrated market snapshot used for validation and transaction construction.
1365
- * @param params.positionData - Owner-bound position snapshot returned by `getPositionData`. The
1365
+ * @param raw - Account, market snapshot, `repay` mode, collateral withdrawals, optional collateral receiver, and deadline.
1366
+ * @param raw.accountAddress - Position owner and transaction sender.
1367
+ * @param raw.marketData - Hydrated market snapshot used for validation and transaction construction.
1368
+ * @param raw.positionData - Owner-bound position snapshot returned by `getPositionData`. The
1366
1369
  * `DEFAULT_LLTV_BUFFER` check is only as current as this snapshot and `collateralPrices`: it
1367
1370
  * does not see transactions mined or prices moved since, so two transactions built from one
1368
1371
  * snapshot can together end inside the buffer. Midnight still rejects any position above
1369
1372
  * LLTV onchain. Midnight debt and collateral do not accrue, so the check needs no accrual.
1370
- * @param params.collateralPrices - Values from `price()` on each
1373
+ * @param raw.collateralPrices - Values from `price()` on each
1371
1374
  * `marketData.params.collateralParams[i].oracle`, indexed like `positionData.collateral` and
1372
1375
  * scaled by `ORACLE_PRICE_SCALE`. An empty array is safe only when
1373
1376
  * `collateralWithdrawals` is empty or the conservative post-operation debt is zero: a `full`
1374
1377
  * repay, or `repay.assets` covering `positionData.debt`.
1375
- * @param params.repay - `{ type: "assets", assets }` (`0n` to only withdraw) or `{ type: "full", maxBuyerAssets }`; a loan-token approval to `MidnightBundlesV2` is required when the allowance is below the pulled amount (unlimited: `maxUint256`, capped per token by `MAX_TOKEN_APPROVALS`), and any unused part is refunded.
1376
- * @param params.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
1378
+ * @param raw.repay - `{ type: "assets", assets }` (`0n` to only withdraw) or `{ type: "full", maxBuyerAssets }`; a loan-token approval to `MidnightBundlesV2` is required when the allowance is below the pulled amount (unlimited: `maxUint256`, capped per token by `MAX_TOKEN_APPROVALS`), and any unused part is refunded.
1379
+ * @param raw.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
1377
1380
  * chain's wNative and transfers it to `msg.sender` before pulling. It may cover part or all of
1378
1381
  * the maximum wNative amount this call can pull, but not more. Any wrapped native not pulled
1379
1382
  * stays in the sender's wallet as wNative. The wNative approval to `MidnightBundlesV2` is still
1380
1383
  * required for the full pulled amount.
1381
- * @param params.collateralWithdrawals - Optional withdrawals; `assets: maxUint256` withdraws the full balance.
1382
- * @param params.collateralReceiver - Optional collateral recipient; defaults to `accountAddress`,
1384
+ * @param raw.collateralWithdrawals - Optional withdrawals; `assets: maxUint256` withdraws the full balance.
1385
+ * @param raw.collateralReceiver - Optional collateral recipient; defaults to `accountAddress`,
1383
1386
  * must be non-zero and not a Midnight protocol or market token contract when
1384
1387
  * `collateralWithdrawals` is non-empty, and is unused otherwise.
1385
- * @param params.deadline - Bundle execution deadline timestamp. Unlike taker builders,
1388
+ * @param raw.deadline - Bundle execution deadline timestamp. Unlike taker builders,
1386
1389
  * `maxUint256` is accepted because no offers are filled; the pull remains bounded by
1387
1390
  * `repay.assets` or `repay.maxBuyerAssets`.
1388
1391
  * @returns Lazy loan approval/authorization requirements and a synchronous transaction builder.