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