@morpho-org/midnight-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/README.md +252 -0
  2. package/lib/cjs/abis.d.ts +3170 -0
  3. package/lib/cjs/abis.js +4073 -0
  4. package/lib/cjs/api/MidnightApi.d.ts +532 -0
  5. package/lib/cjs/api/MidnightApi.js +713 -0
  6. package/lib/cjs/api/helpers.d.ts +20 -0
  7. package/lib/cjs/api/helpers.js +189 -0
  8. package/lib/cjs/api/index.d.ts +2 -0
  9. package/lib/cjs/api/index.js +21 -0
  10. package/lib/cjs/api/types.d.ts +453 -0
  11. package/lib/cjs/api/types.js +2 -0
  12. package/lib/cjs/constants.d.ts +168 -0
  13. package/lib/cjs/constants.js +187 -0
  14. package/lib/cjs/errors.d.ts +253 -0
  15. package/lib/cjs/errors.js +309 -0
  16. package/lib/cjs/fetch/Market.d.ts +65 -0
  17. package/lib/cjs/fetch/Market.js +117 -0
  18. package/lib/cjs/fetch/Offer.d.ts +74 -0
  19. package/lib/cjs/fetch/Offer.js +119 -0
  20. package/lib/cjs/fetch/Position.d.ts +85 -0
  21. package/lib/cjs/fetch/Position.js +148 -0
  22. package/lib/cjs/fetch/Ratifier.d.ts +38 -0
  23. package/lib/cjs/fetch/Ratifier.js +57 -0
  24. package/lib/cjs/fetch/index.d.ts +5 -0
  25. package/lib/cjs/fetch/index.js +21 -0
  26. package/lib/cjs/fetch/types.d.ts +57 -0
  27. package/lib/cjs/fetch/types.js +2 -0
  28. package/lib/cjs/fetch/utils.d.ts +8 -0
  29. package/lib/cjs/fetch/utils.js +18 -0
  30. package/lib/cjs/index.d.ts +18 -0
  31. package/lib/cjs/index.js +57 -0
  32. package/lib/cjs/market/Market.d.ts +613 -0
  33. package/lib/cjs/market/Market.js +503 -0
  34. package/lib/cjs/market/MarketUtils.d.ts +189 -0
  35. package/lib/cjs/market/MarketUtils.js +303 -0
  36. package/lib/cjs/market/Position.d.ts +424 -0
  37. package/lib/cjs/market/Position.js +425 -0
  38. package/lib/cjs/market/PositionUtils.d.ts +115 -0
  39. package/lib/cjs/market/PositionUtils.js +194 -0
  40. package/lib/cjs/market/index.d.ts +4 -0
  41. package/lib/cjs/market/index.js +20 -0
  42. package/lib/cjs/math/ConsumableUnitsLib.d.ts +57 -0
  43. package/lib/cjs/math/ConsumableUnitsLib.js +77 -0
  44. package/lib/cjs/math/TakeAmountsLib.d.ts +175 -0
  45. package/lib/cjs/math/TakeAmountsLib.js +199 -0
  46. package/lib/cjs/math/TickLib.d.ts +200 -0
  47. package/lib/cjs/math/TickLib.js +272 -0
  48. package/lib/cjs/math/index.d.ts +3 -0
  49. package/lib/cjs/math/index.js +19 -0
  50. package/lib/cjs/offers/Offer.d.ts +534 -0
  51. package/lib/cjs/offers/Offer.js +343 -0
  52. package/lib/cjs/offers/OfferUtils.d.ts +565 -0
  53. package/lib/cjs/offers/OfferUtils.js +659 -0
  54. package/lib/cjs/offers/index.d.ts +2 -0
  55. package/lib/cjs/offers/index.js +18 -0
  56. package/lib/cjs/package.json +1 -0
  57. package/lib/cjs/queries/GetPosition.d.ts +55 -0
  58. package/lib/cjs/queries/GetPosition.js +74 -0
  59. package/lib/cjs/queries/index.d.ts +1 -0
  60. package/lib/cjs/queries/index.js +37 -0
  61. package/lib/cjs/signatures/EcrecoverRatifierUtils.d.ts +733 -0
  62. package/lib/cjs/signatures/EcrecoverRatifierUtils.js +618 -0
  63. package/lib/cjs/signatures/Group.d.ts +178 -0
  64. package/lib/cjs/signatures/Group.js +193 -0
  65. package/lib/cjs/signatures/GroupUtils.d.ts +191 -0
  66. package/lib/cjs/signatures/GroupUtils.js +127 -0
  67. package/lib/cjs/signatures/Payload.d.ts +283 -0
  68. package/lib/cjs/signatures/Payload.js +570 -0
  69. package/lib/cjs/signatures/RatifierUtils.d.ts +109 -0
  70. package/lib/cjs/signatures/RatifierUtils.js +76 -0
  71. package/lib/cjs/signatures/SetterRatifierUtils.d.ts +243 -0
  72. package/lib/cjs/signatures/SetterRatifierUtils.js +217 -0
  73. package/lib/cjs/signatures/Tree.d.ts +241 -0
  74. package/lib/cjs/signatures/Tree.js +263 -0
  75. package/lib/cjs/signatures/TreeUtils.d.ts +573 -0
  76. package/lib/cjs/signatures/TreeUtils.js +461 -0
  77. package/lib/cjs/signatures/index.d.ts +7 -0
  78. package/lib/cjs/signatures/index.js +23 -0
  79. package/lib/esm/abis.d.ts +3170 -0
  80. package/lib/esm/abis.js +4070 -0
  81. package/lib/esm/api/MidnightApi.d.ts +532 -0
  82. package/lib/esm/api/MidnightApi.js +709 -0
  83. package/lib/esm/api/helpers.d.ts +20 -0
  84. package/lib/esm/api/helpers.js +180 -0
  85. package/lib/esm/api/index.d.ts +2 -0
  86. package/lib/esm/api/index.js +2 -0
  87. package/lib/esm/api/types.d.ts +453 -0
  88. package/lib/esm/api/types.js +1 -0
  89. package/lib/esm/constants.d.ts +168 -0
  90. package/lib/esm/constants.js +184 -0
  91. package/lib/esm/errors.d.ts +253 -0
  92. package/lib/esm/errors.js +291 -0
  93. package/lib/esm/fetch/Market.d.ts +65 -0
  94. package/lib/esm/fetch/Market.js +113 -0
  95. package/lib/esm/fetch/Offer.d.ts +74 -0
  96. package/lib/esm/fetch/Offer.js +116 -0
  97. package/lib/esm/fetch/Position.d.ts +85 -0
  98. package/lib/esm/fetch/Position.js +144 -0
  99. package/lib/esm/fetch/Ratifier.d.ts +38 -0
  100. package/lib/esm/fetch/Ratifier.js +54 -0
  101. package/lib/esm/fetch/index.d.ts +5 -0
  102. package/lib/esm/fetch/index.js +5 -0
  103. package/lib/esm/fetch/types.d.ts +57 -0
  104. package/lib/esm/fetch/types.js +1 -0
  105. package/lib/esm/fetch/utils.d.ts +8 -0
  106. package/lib/esm/fetch/utils.js +12 -0
  107. package/lib/esm/index.d.ts +18 -0
  108. package/lib/esm/index.js +18 -0
  109. package/lib/esm/market/Market.d.ts +613 -0
  110. package/lib/esm/market/Market.js +498 -0
  111. package/lib/esm/market/MarketUtils.d.ts +189 -0
  112. package/lib/esm/market/MarketUtils.js +300 -0
  113. package/lib/esm/market/Position.d.ts +424 -0
  114. package/lib/esm/market/Position.js +420 -0
  115. package/lib/esm/market/PositionUtils.d.ts +115 -0
  116. package/lib/esm/market/PositionUtils.js +191 -0
  117. package/lib/esm/market/index.d.ts +4 -0
  118. package/lib/esm/market/index.js +4 -0
  119. package/lib/esm/math/ConsumableUnitsLib.d.ts +57 -0
  120. package/lib/esm/math/ConsumableUnitsLib.js +74 -0
  121. package/lib/esm/math/TakeAmountsLib.d.ts +175 -0
  122. package/lib/esm/math/TakeAmountsLib.js +196 -0
  123. package/lib/esm/math/TickLib.d.ts +200 -0
  124. package/lib/esm/math/TickLib.js +269 -0
  125. package/lib/esm/math/index.d.ts +3 -0
  126. package/lib/esm/math/index.js +3 -0
  127. package/lib/esm/offers/Offer.d.ts +534 -0
  128. package/lib/esm/offers/Offer.js +339 -0
  129. package/lib/esm/offers/OfferUtils.d.ts +565 -0
  130. package/lib/esm/offers/OfferUtils.js +656 -0
  131. package/lib/esm/offers/index.d.ts +2 -0
  132. package/lib/esm/offers/index.js +2 -0
  133. package/lib/esm/package.json +1 -0
  134. package/lib/esm/queries/GetPosition.d.ts +55 -0
  135. package/lib/esm/queries/GetPosition.js +71 -0
  136. package/lib/esm/queries/index.d.ts +1 -0
  137. package/lib/esm/queries/index.js +1 -0
  138. package/lib/esm/signatures/EcrecoverRatifierUtils.d.ts +733 -0
  139. package/lib/esm/signatures/EcrecoverRatifierUtils.js +615 -0
  140. package/lib/esm/signatures/Group.d.ts +178 -0
  141. package/lib/esm/signatures/Group.js +189 -0
  142. package/lib/esm/signatures/GroupUtils.d.ts +191 -0
  143. package/lib/esm/signatures/GroupUtils.js +124 -0
  144. package/lib/esm/signatures/Payload.d.ts +283 -0
  145. package/lib/esm/signatures/Payload.js +564 -0
  146. package/lib/esm/signatures/RatifierUtils.d.ts +109 -0
  147. package/lib/esm/signatures/RatifierUtils.js +73 -0
  148. package/lib/esm/signatures/SetterRatifierUtils.d.ts +243 -0
  149. package/lib/esm/signatures/SetterRatifierUtils.js +214 -0
  150. package/lib/esm/signatures/Tree.d.ts +241 -0
  151. package/lib/esm/signatures/Tree.js +259 -0
  152. package/lib/esm/signatures/TreeUtils.d.ts +573 -0
  153. package/lib/esm/signatures/TreeUtils.js +458 -0
  154. package/lib/esm/signatures/index.d.ts +7 -0
  155. package/lib/esm/signatures/index.js +7 -0
  156. package/package.json +69 -0
  157. package/src/index.ts +19 -0
@@ -0,0 +1,4073 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setterRatifierAbi = exports.ecrecoverRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = void 0;
4
+ /**
5
+ * Pinned ABI JSON for the core Midnight contract.
6
+ *
7
+ * Source: `morpho-org/midnight` commit `615fcfa12f725df3a16d65b2c2209272eff5bc10`,
8
+ * `src/interfaces/IMidnight.sol`, Forge artifact `out/src/interfaces/IMidnight.sol/IMidnight.json`.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { midnightAbi } from "@morpho-org/midnight-sdk";
13
+ *
14
+ * console.log(midnightAbi.length);
15
+ * ```
16
+ */
17
+ exports.midnightAbi = [
18
+ {
19
+ inputs: [],
20
+ name: "AlreadyConsumed",
21
+ type: "error",
22
+ },
23
+ {
24
+ inputs: [],
25
+ name: "BuyerGatedFromIncreasingCredit",
26
+ type: "error",
27
+ },
28
+ {
29
+ inputs: [],
30
+ name: "CannotIncreaseDebtPostMaturity",
31
+ type: "error",
32
+ },
33
+ {
34
+ inputs: [],
35
+ name: "CollateralParamsNotSorted",
36
+ type: "error",
37
+ },
38
+ {
39
+ inputs: [],
40
+ name: "ConsumedAssets",
41
+ type: "error",
42
+ },
43
+ {
44
+ inputs: [],
45
+ name: "ConsumedUnits",
46
+ type: "error",
47
+ },
48
+ {
49
+ inputs: [],
50
+ name: "ContinuousFeeAboveMax",
51
+ type: "error",
52
+ },
53
+ {
54
+ inputs: [],
55
+ name: "ContinuousFeeAboveOfferCap",
56
+ type: "error",
57
+ },
58
+ {
59
+ inputs: [],
60
+ name: "FeeNotMultipleOfFeeCbp",
61
+ type: "error",
62
+ },
63
+ {
64
+ inputs: [],
65
+ name: "InconsistentInput",
66
+ type: "error",
67
+ },
68
+ {
69
+ inputs: [],
70
+ name: "InvalidFeeIndex",
71
+ type: "error",
72
+ },
73
+ {
74
+ inputs: [],
75
+ name: "InvalidLltv",
76
+ type: "error",
77
+ },
78
+ {
79
+ inputs: [],
80
+ name: "InvalidMaxLif",
81
+ type: "error",
82
+ },
83
+ {
84
+ inputs: [],
85
+ name: "InvalidOfferCaps",
86
+ type: "error",
87
+ },
88
+ {
89
+ inputs: [],
90
+ name: "InvalidTickSpacing",
91
+ type: "error",
92
+ },
93
+ {
94
+ inputs: [],
95
+ name: "LiquidatorGatedFromLiquidating",
96
+ type: "error",
97
+ },
98
+ {
99
+ inputs: [],
100
+ name: "LltvNotAllowed",
101
+ type: "error",
102
+ },
103
+ {
104
+ inputs: [],
105
+ name: "MakerCreditOrDebtIncreased",
106
+ type: "error",
107
+ },
108
+ {
109
+ inputs: [],
110
+ name: "MarketLossFactorMaxedOut",
111
+ type: "error",
112
+ },
113
+ {
114
+ inputs: [],
115
+ name: "MarketNotCreated",
116
+ type: "error",
117
+ },
118
+ {
119
+ inputs: [],
120
+ name: "MaturityTooFar",
121
+ type: "error",
122
+ },
123
+ {
124
+ inputs: [],
125
+ name: "NoCollateralParams",
126
+ type: "error",
127
+ },
128
+ {
129
+ inputs: [],
130
+ name: "NotBorrower",
131
+ type: "error",
132
+ },
133
+ {
134
+ inputs: [],
135
+ name: "NotLiquidatable",
136
+ type: "error",
137
+ },
138
+ {
139
+ inputs: [],
140
+ name: "OfferExpired",
141
+ type: "error",
142
+ },
143
+ {
144
+ inputs: [],
145
+ name: "OfferNotStarted",
146
+ type: "error",
147
+ },
148
+ {
149
+ inputs: [],
150
+ name: "OnlyFeeClaimer",
151
+ type: "error",
152
+ },
153
+ {
154
+ inputs: [],
155
+ name: "OnlyFeeSetter",
156
+ type: "error",
157
+ },
158
+ {
159
+ inputs: [],
160
+ name: "OnlyRoleSetter",
161
+ type: "error",
162
+ },
163
+ {
164
+ inputs: [],
165
+ name: "OnlyTickSpacingSetter",
166
+ type: "error",
167
+ },
168
+ {
169
+ inputs: [],
170
+ name: "RatifierFailed",
171
+ type: "error",
172
+ },
173
+ {
174
+ inputs: [],
175
+ name: "RatifierUnauthorized",
176
+ type: "error",
177
+ },
178
+ {
179
+ inputs: [],
180
+ name: "RecoveryCloseFactorConditionsViolated",
181
+ type: "error",
182
+ },
183
+ {
184
+ inputs: [],
185
+ name: "SelfTake",
186
+ type: "error",
187
+ },
188
+ {
189
+ inputs: [],
190
+ name: "SellerGatedFromIncreasingDebt",
191
+ type: "error",
192
+ },
193
+ {
194
+ inputs: [],
195
+ name: "SellerIsLiquidatable",
196
+ type: "error",
197
+ },
198
+ {
199
+ inputs: [],
200
+ name: "SettlementFeeAboveMax",
201
+ type: "error",
202
+ },
203
+ {
204
+ inputs: [],
205
+ name: "TakerUnauthorized",
206
+ type: "error",
207
+ },
208
+ {
209
+ inputs: [],
210
+ name: "TickNotAccessible",
211
+ type: "error",
212
+ },
213
+ {
214
+ inputs: [],
215
+ name: "TooManyActivatedCollaterals",
216
+ type: "error",
217
+ },
218
+ {
219
+ inputs: [],
220
+ name: "TooManyCollateralParams",
221
+ type: "error",
222
+ },
223
+ {
224
+ inputs: [],
225
+ name: "Unauthorized",
226
+ type: "error",
227
+ },
228
+ {
229
+ inputs: [],
230
+ name: "UnhealthyBorrower",
231
+ type: "error",
232
+ },
233
+ {
234
+ inputs: [],
235
+ name: "UnusedReceiverMustBeZero",
236
+ type: "error",
237
+ },
238
+ {
239
+ inputs: [],
240
+ name: "WrongBuyCallbackReturnValue",
241
+ type: "error",
242
+ },
243
+ {
244
+ inputs: [],
245
+ name: "WrongFlashLoanCallbackReturnValue",
246
+ type: "error",
247
+ },
248
+ {
249
+ inputs: [],
250
+ name: "WrongLiquidateCallbackReturnValue",
251
+ type: "error",
252
+ },
253
+ {
254
+ inputs: [],
255
+ name: "WrongRepayCallbackReturnValue",
256
+ type: "error",
257
+ },
258
+ {
259
+ inputs: [],
260
+ name: "WrongSellCallbackReturnValue",
261
+ type: "error",
262
+ },
263
+ {
264
+ inputs: [],
265
+ name: "INITIAL_CHAIN_ID",
266
+ outputs: [
267
+ {
268
+ internalType: "uint256",
269
+ name: "",
270
+ type: "uint256",
271
+ },
272
+ ],
273
+ stateMutability: "view",
274
+ type: "function",
275
+ },
276
+ {
277
+ inputs: [
278
+ {
279
+ internalType: "uint256",
280
+ name: "lltv",
281
+ type: "uint256",
282
+ },
283
+ ],
284
+ name: "addLltv",
285
+ outputs: [],
286
+ stateMutability: "nonpayable",
287
+ type: "function",
288
+ },
289
+ {
290
+ inputs: [
291
+ {
292
+ internalType: "uint256",
293
+ name: "lltv",
294
+ type: "uint256",
295
+ },
296
+ ],
297
+ name: "isLltvAllowed",
298
+ outputs: [
299
+ {
300
+ internalType: "bool",
301
+ name: "",
302
+ type: "bool",
303
+ },
304
+ ],
305
+ stateMutability: "view",
306
+ type: "function",
307
+ },
308
+ {
309
+ inputs: [
310
+ {
311
+ components: [
312
+ {
313
+ internalType: "address",
314
+ name: "loanToken",
315
+ type: "address",
316
+ },
317
+ {
318
+ components: [
319
+ {
320
+ internalType: "address",
321
+ name: "token",
322
+ type: "address",
323
+ },
324
+ {
325
+ internalType: "uint256",
326
+ name: "lltv",
327
+ type: "uint256",
328
+ },
329
+ {
330
+ internalType: "uint256",
331
+ name: "maxLif",
332
+ type: "uint256",
333
+ },
334
+ {
335
+ internalType: "address",
336
+ name: "oracle",
337
+ type: "address",
338
+ },
339
+ ],
340
+ internalType: "struct CollateralParams[]",
341
+ name: "collateralParams",
342
+ type: "tuple[]",
343
+ },
344
+ {
345
+ internalType: "uint256",
346
+ name: "maturity",
347
+ type: "uint256",
348
+ },
349
+ {
350
+ internalType: "uint256",
351
+ name: "rcfThreshold",
352
+ type: "uint256",
353
+ },
354
+ {
355
+ internalType: "address",
356
+ name: "enterGate",
357
+ type: "address",
358
+ },
359
+ {
360
+ internalType: "address",
361
+ name: "liquidatorGate",
362
+ type: "address",
363
+ },
364
+ ],
365
+ internalType: "struct Market",
366
+ name: "market",
367
+ type: "tuple",
368
+ },
369
+ {
370
+ internalType: "uint256",
371
+ name: "amount",
372
+ type: "uint256",
373
+ },
374
+ {
375
+ internalType: "address",
376
+ name: "receiver",
377
+ type: "address",
378
+ },
379
+ ],
380
+ name: "claimContinuousFee",
381
+ outputs: [],
382
+ stateMutability: "nonpayable",
383
+ type: "function",
384
+ },
385
+ {
386
+ inputs: [
387
+ {
388
+ internalType: "address",
389
+ name: "token",
390
+ type: "address",
391
+ },
392
+ {
393
+ internalType: "uint256",
394
+ name: "amount",
395
+ type: "uint256",
396
+ },
397
+ {
398
+ internalType: "address",
399
+ name: "receiver",
400
+ type: "address",
401
+ },
402
+ ],
403
+ name: "claimSettlementFee",
404
+ outputs: [],
405
+ stateMutability: "nonpayable",
406
+ type: "function",
407
+ },
408
+ {
409
+ inputs: [
410
+ {
411
+ internalType: "address",
412
+ name: "token",
413
+ type: "address",
414
+ },
415
+ ],
416
+ name: "claimableSettlementFee",
417
+ outputs: [
418
+ {
419
+ internalType: "uint256",
420
+ name: "",
421
+ type: "uint256",
422
+ },
423
+ ],
424
+ stateMutability: "view",
425
+ type: "function",
426
+ },
427
+ {
428
+ inputs: [
429
+ {
430
+ internalType: "bytes32",
431
+ name: "id",
432
+ type: "bytes32",
433
+ },
434
+ {
435
+ internalType: "address",
436
+ name: "user",
437
+ type: "address",
438
+ },
439
+ {
440
+ internalType: "uint256",
441
+ name: "index",
442
+ type: "uint256",
443
+ },
444
+ ],
445
+ name: "collateral",
446
+ outputs: [
447
+ {
448
+ internalType: "uint128",
449
+ name: "",
450
+ type: "uint128",
451
+ },
452
+ ],
453
+ stateMutability: "view",
454
+ type: "function",
455
+ },
456
+ {
457
+ inputs: [
458
+ {
459
+ internalType: "bytes32",
460
+ name: "id",
461
+ type: "bytes32",
462
+ },
463
+ {
464
+ internalType: "address",
465
+ name: "user",
466
+ type: "address",
467
+ },
468
+ ],
469
+ name: "collateralBitmap",
470
+ outputs: [
471
+ {
472
+ internalType: "uint128",
473
+ name: "",
474
+ type: "uint128",
475
+ },
476
+ ],
477
+ stateMutability: "view",
478
+ type: "function",
479
+ },
480
+ {
481
+ inputs: [
482
+ {
483
+ internalType: "address",
484
+ name: "user",
485
+ type: "address",
486
+ },
487
+ {
488
+ internalType: "bytes32",
489
+ name: "group",
490
+ type: "bytes32",
491
+ },
492
+ ],
493
+ name: "consumed",
494
+ outputs: [
495
+ {
496
+ internalType: "uint256",
497
+ name: "",
498
+ type: "uint256",
499
+ },
500
+ ],
501
+ stateMutability: "view",
502
+ type: "function",
503
+ },
504
+ {
505
+ inputs: [
506
+ {
507
+ internalType: "bytes32",
508
+ name: "id",
509
+ type: "bytes32",
510
+ },
511
+ ],
512
+ name: "continuousFee",
513
+ outputs: [
514
+ {
515
+ internalType: "uint32",
516
+ name: "",
517
+ type: "uint32",
518
+ },
519
+ ],
520
+ stateMutability: "view",
521
+ type: "function",
522
+ },
523
+ {
524
+ inputs: [
525
+ {
526
+ internalType: "bytes32",
527
+ name: "id",
528
+ type: "bytes32",
529
+ },
530
+ ],
531
+ name: "continuousFeeCredit",
532
+ outputs: [
533
+ {
534
+ internalType: "uint128",
535
+ name: "",
536
+ type: "uint128",
537
+ },
538
+ ],
539
+ stateMutability: "view",
540
+ type: "function",
541
+ },
542
+ {
543
+ inputs: [
544
+ {
545
+ internalType: "bytes32",
546
+ name: "id",
547
+ type: "bytes32",
548
+ },
549
+ {
550
+ internalType: "address",
551
+ name: "user",
552
+ type: "address",
553
+ },
554
+ ],
555
+ name: "credit",
556
+ outputs: [
557
+ {
558
+ internalType: "uint128",
559
+ name: "",
560
+ type: "uint128",
561
+ },
562
+ ],
563
+ stateMutability: "view",
564
+ type: "function",
565
+ },
566
+ {
567
+ inputs: [
568
+ {
569
+ internalType: "bytes32",
570
+ name: "id",
571
+ type: "bytes32",
572
+ },
573
+ {
574
+ internalType: "address",
575
+ name: "user",
576
+ type: "address",
577
+ },
578
+ ],
579
+ name: "debt",
580
+ outputs: [
581
+ {
582
+ internalType: "uint128",
583
+ name: "",
584
+ type: "uint128",
585
+ },
586
+ ],
587
+ stateMutability: "view",
588
+ type: "function",
589
+ },
590
+ {
591
+ inputs: [
592
+ {
593
+ internalType: "address",
594
+ name: "loanToken",
595
+ type: "address",
596
+ },
597
+ ],
598
+ name: "defaultContinuousFee",
599
+ outputs: [
600
+ {
601
+ internalType: "uint32",
602
+ name: "",
603
+ type: "uint32",
604
+ },
605
+ ],
606
+ stateMutability: "view",
607
+ type: "function",
608
+ },
609
+ {
610
+ inputs: [
611
+ {
612
+ internalType: "address",
613
+ name: "loanToken",
614
+ type: "address",
615
+ },
616
+ {
617
+ internalType: "uint256",
618
+ name: "index",
619
+ type: "uint256",
620
+ },
621
+ ],
622
+ name: "defaultSettlementFeeCbp",
623
+ outputs: [
624
+ {
625
+ internalType: "uint16",
626
+ name: "",
627
+ type: "uint16",
628
+ },
629
+ ],
630
+ stateMutability: "view",
631
+ type: "function",
632
+ },
633
+ {
634
+ inputs: [],
635
+ name: "feeClaimer",
636
+ outputs: [
637
+ {
638
+ internalType: "address",
639
+ name: "",
640
+ type: "address",
641
+ },
642
+ ],
643
+ stateMutability: "view",
644
+ type: "function",
645
+ },
646
+ {
647
+ inputs: [],
648
+ name: "feeSetter",
649
+ outputs: [
650
+ {
651
+ internalType: "address",
652
+ name: "",
653
+ type: "address",
654
+ },
655
+ ],
656
+ stateMutability: "view",
657
+ type: "function",
658
+ },
659
+ {
660
+ inputs: [
661
+ {
662
+ internalType: "address[]",
663
+ name: "tokens",
664
+ type: "address[]",
665
+ },
666
+ {
667
+ internalType: "uint256[]",
668
+ name: "assets",
669
+ type: "uint256[]",
670
+ },
671
+ {
672
+ internalType: "address",
673
+ name: "callback",
674
+ type: "address",
675
+ },
676
+ {
677
+ internalType: "bytes",
678
+ name: "data",
679
+ type: "bytes",
680
+ },
681
+ ],
682
+ name: "flashLoan",
683
+ outputs: [],
684
+ stateMutability: "nonpayable",
685
+ type: "function",
686
+ },
687
+ {
688
+ inputs: [
689
+ {
690
+ internalType: "address",
691
+ name: "authorizer",
692
+ type: "address",
693
+ },
694
+ {
695
+ internalType: "address",
696
+ name: "authorized",
697
+ type: "address",
698
+ },
699
+ ],
700
+ name: "isAuthorized",
701
+ outputs: [
702
+ {
703
+ internalType: "bool",
704
+ name: "",
705
+ type: "bool",
706
+ },
707
+ ],
708
+ stateMutability: "view",
709
+ type: "function",
710
+ },
711
+ {
712
+ inputs: [
713
+ {
714
+ components: [
715
+ {
716
+ internalType: "address",
717
+ name: "loanToken",
718
+ type: "address",
719
+ },
720
+ {
721
+ components: [
722
+ {
723
+ internalType: "address",
724
+ name: "token",
725
+ type: "address",
726
+ },
727
+ {
728
+ internalType: "uint256",
729
+ name: "lltv",
730
+ type: "uint256",
731
+ },
732
+ {
733
+ internalType: "uint256",
734
+ name: "maxLif",
735
+ type: "uint256",
736
+ },
737
+ {
738
+ internalType: "address",
739
+ name: "oracle",
740
+ type: "address",
741
+ },
742
+ ],
743
+ internalType: "struct CollateralParams[]",
744
+ name: "collateralParams",
745
+ type: "tuple[]",
746
+ },
747
+ {
748
+ internalType: "uint256",
749
+ name: "maturity",
750
+ type: "uint256",
751
+ },
752
+ {
753
+ internalType: "uint256",
754
+ name: "rcfThreshold",
755
+ type: "uint256",
756
+ },
757
+ {
758
+ internalType: "address",
759
+ name: "enterGate",
760
+ type: "address",
761
+ },
762
+ {
763
+ internalType: "address",
764
+ name: "liquidatorGate",
765
+ type: "address",
766
+ },
767
+ ],
768
+ internalType: "struct Market",
769
+ name: "market",
770
+ type: "tuple",
771
+ },
772
+ {
773
+ internalType: "bytes32",
774
+ name: "id",
775
+ type: "bytes32",
776
+ },
777
+ {
778
+ internalType: "address",
779
+ name: "borrower",
780
+ type: "address",
781
+ },
782
+ ],
783
+ name: "isHealthy",
784
+ outputs: [
785
+ {
786
+ internalType: "bool",
787
+ name: "",
788
+ type: "bool",
789
+ },
790
+ ],
791
+ stateMutability: "view",
792
+ type: "function",
793
+ },
794
+ {
795
+ inputs: [
796
+ {
797
+ internalType: "bytes32",
798
+ name: "id",
799
+ type: "bytes32",
800
+ },
801
+ {
802
+ internalType: "address",
803
+ name: "user",
804
+ type: "address",
805
+ },
806
+ ],
807
+ name: "lastAccrual",
808
+ outputs: [
809
+ {
810
+ internalType: "uint128",
811
+ name: "",
812
+ type: "uint128",
813
+ },
814
+ ],
815
+ stateMutability: "view",
816
+ type: "function",
817
+ },
818
+ {
819
+ inputs: [
820
+ {
821
+ internalType: "bytes32",
822
+ name: "id",
823
+ type: "bytes32",
824
+ },
825
+ {
826
+ internalType: "address",
827
+ name: "user",
828
+ type: "address",
829
+ },
830
+ ],
831
+ name: "lastLossFactor",
832
+ outputs: [
833
+ {
834
+ internalType: "uint128",
835
+ name: "",
836
+ type: "uint128",
837
+ },
838
+ ],
839
+ stateMutability: "view",
840
+ type: "function",
841
+ },
842
+ {
843
+ inputs: [
844
+ {
845
+ components: [
846
+ {
847
+ internalType: "address",
848
+ name: "loanToken",
849
+ type: "address",
850
+ },
851
+ {
852
+ components: [
853
+ {
854
+ internalType: "address",
855
+ name: "token",
856
+ type: "address",
857
+ },
858
+ {
859
+ internalType: "uint256",
860
+ name: "lltv",
861
+ type: "uint256",
862
+ },
863
+ {
864
+ internalType: "uint256",
865
+ name: "maxLif",
866
+ type: "uint256",
867
+ },
868
+ {
869
+ internalType: "address",
870
+ name: "oracle",
871
+ type: "address",
872
+ },
873
+ ],
874
+ internalType: "struct CollateralParams[]",
875
+ name: "collateralParams",
876
+ type: "tuple[]",
877
+ },
878
+ {
879
+ internalType: "uint256",
880
+ name: "maturity",
881
+ type: "uint256",
882
+ },
883
+ {
884
+ internalType: "uint256",
885
+ name: "rcfThreshold",
886
+ type: "uint256",
887
+ },
888
+ {
889
+ internalType: "address",
890
+ name: "enterGate",
891
+ type: "address",
892
+ },
893
+ {
894
+ internalType: "address",
895
+ name: "liquidatorGate",
896
+ type: "address",
897
+ },
898
+ ],
899
+ internalType: "struct Market",
900
+ name: "market",
901
+ type: "tuple",
902
+ },
903
+ {
904
+ internalType: "uint256",
905
+ name: "collateralIndex",
906
+ type: "uint256",
907
+ },
908
+ {
909
+ internalType: "uint256",
910
+ name: "seizedAssets",
911
+ type: "uint256",
912
+ },
913
+ {
914
+ internalType: "uint256",
915
+ name: "repaidUnits",
916
+ type: "uint256",
917
+ },
918
+ {
919
+ internalType: "address",
920
+ name: "borrower",
921
+ type: "address",
922
+ },
923
+ {
924
+ internalType: "bool",
925
+ name: "postMaturityMode",
926
+ type: "bool",
927
+ },
928
+ {
929
+ internalType: "address",
930
+ name: "receiver",
931
+ type: "address",
932
+ },
933
+ {
934
+ internalType: "address",
935
+ name: "callback",
936
+ type: "address",
937
+ },
938
+ {
939
+ internalType: "bytes",
940
+ name: "data",
941
+ type: "bytes",
942
+ },
943
+ ],
944
+ name: "liquidate",
945
+ outputs: [
946
+ {
947
+ internalType: "uint256",
948
+ name: "outputSeizedAssets",
949
+ type: "uint256",
950
+ },
951
+ {
952
+ internalType: "uint256",
953
+ name: "outputRepaidUnits",
954
+ type: "uint256",
955
+ },
956
+ ],
957
+ stateMutability: "nonpayable",
958
+ type: "function",
959
+ },
960
+ {
961
+ inputs: [
962
+ {
963
+ internalType: "bytes32",
964
+ name: "id",
965
+ type: "bytes32",
966
+ },
967
+ {
968
+ internalType: "address",
969
+ name: "user",
970
+ type: "address",
971
+ },
972
+ ],
973
+ name: "liquidationLocked",
974
+ outputs: [
975
+ {
976
+ internalType: "bool",
977
+ name: "",
978
+ type: "bool",
979
+ },
980
+ ],
981
+ stateMutability: "view",
982
+ type: "function",
983
+ },
984
+ {
985
+ inputs: [
986
+ {
987
+ internalType: "bytes32",
988
+ name: "id",
989
+ type: "bytes32",
990
+ },
991
+ ],
992
+ name: "lossFactor",
993
+ outputs: [
994
+ {
995
+ internalType: "uint128",
996
+ name: "",
997
+ type: "uint128",
998
+ },
999
+ ],
1000
+ stateMutability: "view",
1001
+ type: "function",
1002
+ },
1003
+ {
1004
+ inputs: [
1005
+ {
1006
+ internalType: "bytes32",
1007
+ name: "id",
1008
+ type: "bytes32",
1009
+ },
1010
+ ],
1011
+ name: "marketState",
1012
+ outputs: [
1013
+ {
1014
+ internalType: "uint128",
1015
+ name: "totalUnits",
1016
+ type: "uint128",
1017
+ },
1018
+ {
1019
+ internalType: "uint128",
1020
+ name: "lossFactor",
1021
+ type: "uint128",
1022
+ },
1023
+ {
1024
+ internalType: "uint128",
1025
+ name: "withdrawable",
1026
+ type: "uint128",
1027
+ },
1028
+ {
1029
+ internalType: "uint128",
1030
+ name: "continuousFeeCredit",
1031
+ type: "uint128",
1032
+ },
1033
+ {
1034
+ internalType: "uint16",
1035
+ name: "settlementFeeCbp0",
1036
+ type: "uint16",
1037
+ },
1038
+ {
1039
+ internalType: "uint16",
1040
+ name: "settlementFeeCbp1",
1041
+ type: "uint16",
1042
+ },
1043
+ {
1044
+ internalType: "uint16",
1045
+ name: "settlementFeeCbp2",
1046
+ type: "uint16",
1047
+ },
1048
+ {
1049
+ internalType: "uint16",
1050
+ name: "settlementFeeCbp3",
1051
+ type: "uint16",
1052
+ },
1053
+ {
1054
+ internalType: "uint16",
1055
+ name: "settlementFeeCbp4",
1056
+ type: "uint16",
1057
+ },
1058
+ {
1059
+ internalType: "uint16",
1060
+ name: "settlementFeeCbp5",
1061
+ type: "uint16",
1062
+ },
1063
+ {
1064
+ internalType: "uint16",
1065
+ name: "settlementFeeCbp6",
1066
+ type: "uint16",
1067
+ },
1068
+ {
1069
+ internalType: "uint32",
1070
+ name: "continuousFee",
1071
+ type: "uint32",
1072
+ },
1073
+ {
1074
+ internalType: "uint8",
1075
+ name: "tickSpacing",
1076
+ type: "uint8",
1077
+ },
1078
+ ],
1079
+ stateMutability: "view",
1080
+ type: "function",
1081
+ },
1082
+ {
1083
+ inputs: [
1084
+ {
1085
+ internalType: "bytes[]",
1086
+ name: "calls",
1087
+ type: "bytes[]",
1088
+ },
1089
+ ],
1090
+ name: "multicall",
1091
+ outputs: [],
1092
+ stateMutability: "nonpayable",
1093
+ type: "function",
1094
+ },
1095
+ {
1096
+ inputs: [
1097
+ {
1098
+ internalType: "bytes32",
1099
+ name: "id",
1100
+ type: "bytes32",
1101
+ },
1102
+ {
1103
+ internalType: "address",
1104
+ name: "user",
1105
+ type: "address",
1106
+ },
1107
+ ],
1108
+ name: "pendingFee",
1109
+ outputs: [
1110
+ {
1111
+ internalType: "uint128",
1112
+ name: "",
1113
+ type: "uint128",
1114
+ },
1115
+ ],
1116
+ stateMutability: "view",
1117
+ type: "function",
1118
+ },
1119
+ {
1120
+ inputs: [
1121
+ {
1122
+ internalType: "bytes32",
1123
+ name: "id",
1124
+ type: "bytes32",
1125
+ },
1126
+ {
1127
+ internalType: "address",
1128
+ name: "user",
1129
+ type: "address",
1130
+ },
1131
+ ],
1132
+ name: "position",
1133
+ outputs: [
1134
+ {
1135
+ internalType: "uint128",
1136
+ name: "credit",
1137
+ type: "uint128",
1138
+ },
1139
+ {
1140
+ internalType: "uint128",
1141
+ name: "pendingFee",
1142
+ type: "uint128",
1143
+ },
1144
+ {
1145
+ internalType: "uint128",
1146
+ name: "lastLossFactor",
1147
+ type: "uint128",
1148
+ },
1149
+ {
1150
+ internalType: "uint128",
1151
+ name: "lastAccrual",
1152
+ type: "uint128",
1153
+ },
1154
+ {
1155
+ internalType: "uint128",
1156
+ name: "debt",
1157
+ type: "uint128",
1158
+ },
1159
+ {
1160
+ internalType: "uint128",
1161
+ name: "collateralBitmap",
1162
+ type: "uint128",
1163
+ },
1164
+ ],
1165
+ stateMutability: "view",
1166
+ type: "function",
1167
+ },
1168
+ {
1169
+ inputs: [
1170
+ {
1171
+ components: [
1172
+ {
1173
+ internalType: "address",
1174
+ name: "loanToken",
1175
+ type: "address",
1176
+ },
1177
+ {
1178
+ components: [
1179
+ {
1180
+ internalType: "address",
1181
+ name: "token",
1182
+ type: "address",
1183
+ },
1184
+ {
1185
+ internalType: "uint256",
1186
+ name: "lltv",
1187
+ type: "uint256",
1188
+ },
1189
+ {
1190
+ internalType: "uint256",
1191
+ name: "maxLif",
1192
+ type: "uint256",
1193
+ },
1194
+ {
1195
+ internalType: "address",
1196
+ name: "oracle",
1197
+ type: "address",
1198
+ },
1199
+ ],
1200
+ internalType: "struct CollateralParams[]",
1201
+ name: "collateralParams",
1202
+ type: "tuple[]",
1203
+ },
1204
+ {
1205
+ internalType: "uint256",
1206
+ name: "maturity",
1207
+ type: "uint256",
1208
+ },
1209
+ {
1210
+ internalType: "uint256",
1211
+ name: "rcfThreshold",
1212
+ type: "uint256",
1213
+ },
1214
+ {
1215
+ internalType: "address",
1216
+ name: "enterGate",
1217
+ type: "address",
1218
+ },
1219
+ {
1220
+ internalType: "address",
1221
+ name: "liquidatorGate",
1222
+ type: "address",
1223
+ },
1224
+ ],
1225
+ internalType: "struct Market",
1226
+ name: "market",
1227
+ type: "tuple",
1228
+ },
1229
+ {
1230
+ internalType: "uint256",
1231
+ name: "units",
1232
+ type: "uint256",
1233
+ },
1234
+ {
1235
+ internalType: "address",
1236
+ name: "onBehalf",
1237
+ type: "address",
1238
+ },
1239
+ {
1240
+ internalType: "address",
1241
+ name: "callback",
1242
+ type: "address",
1243
+ },
1244
+ {
1245
+ internalType: "bytes",
1246
+ name: "data",
1247
+ type: "bytes",
1248
+ },
1249
+ ],
1250
+ name: "repay",
1251
+ outputs: [],
1252
+ stateMutability: "nonpayable",
1253
+ type: "function",
1254
+ },
1255
+ {
1256
+ inputs: [],
1257
+ name: "roleSetter",
1258
+ outputs: [
1259
+ {
1260
+ internalType: "address",
1261
+ name: "",
1262
+ type: "address",
1263
+ },
1264
+ ],
1265
+ stateMutability: "view",
1266
+ type: "function",
1267
+ },
1268
+ {
1269
+ inputs: [
1270
+ {
1271
+ internalType: "bytes32",
1272
+ name: "group",
1273
+ type: "bytes32",
1274
+ },
1275
+ {
1276
+ internalType: "uint256",
1277
+ name: "amount",
1278
+ type: "uint256",
1279
+ },
1280
+ {
1281
+ internalType: "address",
1282
+ name: "onBehalf",
1283
+ type: "address",
1284
+ },
1285
+ ],
1286
+ name: "setConsumed",
1287
+ outputs: [],
1288
+ stateMutability: "nonpayable",
1289
+ type: "function",
1290
+ },
1291
+ {
1292
+ inputs: [
1293
+ {
1294
+ internalType: "address",
1295
+ name: "loanToken",
1296
+ type: "address",
1297
+ },
1298
+ {
1299
+ internalType: "uint256",
1300
+ name: "newContinuousFee",
1301
+ type: "uint256",
1302
+ },
1303
+ ],
1304
+ name: "setDefaultContinuousFee",
1305
+ outputs: [],
1306
+ stateMutability: "nonpayable",
1307
+ type: "function",
1308
+ },
1309
+ {
1310
+ inputs: [
1311
+ {
1312
+ internalType: "address",
1313
+ name: "loanToken",
1314
+ type: "address",
1315
+ },
1316
+ {
1317
+ internalType: "uint256",
1318
+ name: "index",
1319
+ type: "uint256",
1320
+ },
1321
+ {
1322
+ internalType: "uint256",
1323
+ name: "newSettlementFee",
1324
+ type: "uint256",
1325
+ },
1326
+ ],
1327
+ name: "setDefaultSettlementFee",
1328
+ outputs: [],
1329
+ stateMutability: "nonpayable",
1330
+ type: "function",
1331
+ },
1332
+ {
1333
+ inputs: [
1334
+ {
1335
+ internalType: "address",
1336
+ name: "newFeeClaimer",
1337
+ type: "address",
1338
+ },
1339
+ ],
1340
+ name: "setFeeClaimer",
1341
+ outputs: [],
1342
+ stateMutability: "nonpayable",
1343
+ type: "function",
1344
+ },
1345
+ {
1346
+ inputs: [
1347
+ {
1348
+ internalType: "address",
1349
+ name: "newFeeSetter",
1350
+ type: "address",
1351
+ },
1352
+ ],
1353
+ name: "setFeeSetter",
1354
+ outputs: [],
1355
+ stateMutability: "nonpayable",
1356
+ type: "function",
1357
+ },
1358
+ {
1359
+ inputs: [
1360
+ {
1361
+ internalType: "address",
1362
+ name: "authorized",
1363
+ type: "address",
1364
+ },
1365
+ {
1366
+ internalType: "bool",
1367
+ name: "newIsAuthorized",
1368
+ type: "bool",
1369
+ },
1370
+ {
1371
+ internalType: "address",
1372
+ name: "onBehalf",
1373
+ type: "address",
1374
+ },
1375
+ ],
1376
+ name: "setIsAuthorized",
1377
+ outputs: [],
1378
+ stateMutability: "nonpayable",
1379
+ type: "function",
1380
+ },
1381
+ {
1382
+ inputs: [
1383
+ {
1384
+ internalType: "bytes32",
1385
+ name: "id",
1386
+ type: "bytes32",
1387
+ },
1388
+ {
1389
+ internalType: "uint256",
1390
+ name: "newContinuousFee",
1391
+ type: "uint256",
1392
+ },
1393
+ ],
1394
+ name: "setMarketContinuousFee",
1395
+ outputs: [],
1396
+ stateMutability: "nonpayable",
1397
+ type: "function",
1398
+ },
1399
+ {
1400
+ inputs: [
1401
+ {
1402
+ internalType: "bytes32",
1403
+ name: "id",
1404
+ type: "bytes32",
1405
+ },
1406
+ {
1407
+ internalType: "uint256",
1408
+ name: "index",
1409
+ type: "uint256",
1410
+ },
1411
+ {
1412
+ internalType: "uint256",
1413
+ name: "newSettlementFee",
1414
+ type: "uint256",
1415
+ },
1416
+ ],
1417
+ name: "setMarketSettlementFee",
1418
+ outputs: [],
1419
+ stateMutability: "nonpayable",
1420
+ type: "function",
1421
+ },
1422
+ {
1423
+ inputs: [
1424
+ {
1425
+ internalType: "bytes32",
1426
+ name: "id",
1427
+ type: "bytes32",
1428
+ },
1429
+ {
1430
+ internalType: "uint256",
1431
+ name: "newTickSpacing",
1432
+ type: "uint256",
1433
+ },
1434
+ ],
1435
+ name: "setMarketTickSpacing",
1436
+ outputs: [],
1437
+ stateMutability: "nonpayable",
1438
+ type: "function",
1439
+ },
1440
+ {
1441
+ inputs: [
1442
+ {
1443
+ internalType: "address",
1444
+ name: "newRoleSetter",
1445
+ type: "address",
1446
+ },
1447
+ ],
1448
+ name: "setRoleSetter",
1449
+ outputs: [],
1450
+ stateMutability: "nonpayable",
1451
+ type: "function",
1452
+ },
1453
+ {
1454
+ inputs: [
1455
+ {
1456
+ internalType: "address",
1457
+ name: "newTickSpacingSetter",
1458
+ type: "address",
1459
+ },
1460
+ ],
1461
+ name: "setTickSpacingSetter",
1462
+ outputs: [],
1463
+ stateMutability: "nonpayable",
1464
+ type: "function",
1465
+ },
1466
+ {
1467
+ inputs: [
1468
+ {
1469
+ internalType: "bytes32",
1470
+ name: "id",
1471
+ type: "bytes32",
1472
+ },
1473
+ {
1474
+ internalType: "uint256",
1475
+ name: "timeToMaturity",
1476
+ type: "uint256",
1477
+ },
1478
+ ],
1479
+ name: "settlementFee",
1480
+ outputs: [
1481
+ {
1482
+ internalType: "uint256",
1483
+ name: "",
1484
+ type: "uint256",
1485
+ },
1486
+ ],
1487
+ stateMutability: "view",
1488
+ type: "function",
1489
+ },
1490
+ {
1491
+ inputs: [
1492
+ {
1493
+ internalType: "bytes32",
1494
+ name: "id",
1495
+ type: "bytes32",
1496
+ },
1497
+ ],
1498
+ name: "settlementFeeCbps",
1499
+ outputs: [
1500
+ {
1501
+ internalType: "uint16[7]",
1502
+ name: "",
1503
+ type: "uint16[7]",
1504
+ },
1505
+ ],
1506
+ stateMutability: "view",
1507
+ type: "function",
1508
+ },
1509
+ {
1510
+ inputs: [
1511
+ {
1512
+ components: [
1513
+ {
1514
+ internalType: "address",
1515
+ name: "loanToken",
1516
+ type: "address",
1517
+ },
1518
+ {
1519
+ components: [
1520
+ {
1521
+ internalType: "address",
1522
+ name: "token",
1523
+ type: "address",
1524
+ },
1525
+ {
1526
+ internalType: "uint256",
1527
+ name: "lltv",
1528
+ type: "uint256",
1529
+ },
1530
+ {
1531
+ internalType: "uint256",
1532
+ name: "maxLif",
1533
+ type: "uint256",
1534
+ },
1535
+ {
1536
+ internalType: "address",
1537
+ name: "oracle",
1538
+ type: "address",
1539
+ },
1540
+ ],
1541
+ internalType: "struct CollateralParams[]",
1542
+ name: "collateralParams",
1543
+ type: "tuple[]",
1544
+ },
1545
+ {
1546
+ internalType: "uint256",
1547
+ name: "maturity",
1548
+ type: "uint256",
1549
+ },
1550
+ {
1551
+ internalType: "uint256",
1552
+ name: "rcfThreshold",
1553
+ type: "uint256",
1554
+ },
1555
+ {
1556
+ internalType: "address",
1557
+ name: "enterGate",
1558
+ type: "address",
1559
+ },
1560
+ {
1561
+ internalType: "address",
1562
+ name: "liquidatorGate",
1563
+ type: "address",
1564
+ },
1565
+ ],
1566
+ internalType: "struct Market",
1567
+ name: "market",
1568
+ type: "tuple",
1569
+ },
1570
+ {
1571
+ internalType: "uint256",
1572
+ name: "collateralIndex",
1573
+ type: "uint256",
1574
+ },
1575
+ {
1576
+ internalType: "uint256",
1577
+ name: "assets",
1578
+ type: "uint256",
1579
+ },
1580
+ {
1581
+ internalType: "address",
1582
+ name: "onBehalf",
1583
+ type: "address",
1584
+ },
1585
+ ],
1586
+ name: "supplyCollateral",
1587
+ outputs: [],
1588
+ stateMutability: "nonpayable",
1589
+ type: "function",
1590
+ },
1591
+ {
1592
+ inputs: [
1593
+ {
1594
+ components: [
1595
+ {
1596
+ components: [
1597
+ {
1598
+ internalType: "address",
1599
+ name: "loanToken",
1600
+ type: "address",
1601
+ },
1602
+ {
1603
+ components: [
1604
+ {
1605
+ internalType: "address",
1606
+ name: "token",
1607
+ type: "address",
1608
+ },
1609
+ {
1610
+ internalType: "uint256",
1611
+ name: "lltv",
1612
+ type: "uint256",
1613
+ },
1614
+ {
1615
+ internalType: "uint256",
1616
+ name: "maxLif",
1617
+ type: "uint256",
1618
+ },
1619
+ {
1620
+ internalType: "address",
1621
+ name: "oracle",
1622
+ type: "address",
1623
+ },
1624
+ ],
1625
+ internalType: "struct CollateralParams[]",
1626
+ name: "collateralParams",
1627
+ type: "tuple[]",
1628
+ },
1629
+ {
1630
+ internalType: "uint256",
1631
+ name: "maturity",
1632
+ type: "uint256",
1633
+ },
1634
+ {
1635
+ internalType: "uint256",
1636
+ name: "rcfThreshold",
1637
+ type: "uint256",
1638
+ },
1639
+ {
1640
+ internalType: "address",
1641
+ name: "enterGate",
1642
+ type: "address",
1643
+ },
1644
+ {
1645
+ internalType: "address",
1646
+ name: "liquidatorGate",
1647
+ type: "address",
1648
+ },
1649
+ ],
1650
+ internalType: "struct Market",
1651
+ name: "market",
1652
+ type: "tuple",
1653
+ },
1654
+ {
1655
+ internalType: "bool",
1656
+ name: "buy",
1657
+ type: "bool",
1658
+ },
1659
+ {
1660
+ internalType: "address",
1661
+ name: "maker",
1662
+ type: "address",
1663
+ },
1664
+ {
1665
+ internalType: "uint256",
1666
+ name: "start",
1667
+ type: "uint256",
1668
+ },
1669
+ {
1670
+ internalType: "uint256",
1671
+ name: "expiry",
1672
+ type: "uint256",
1673
+ },
1674
+ {
1675
+ internalType: "uint256",
1676
+ name: "tick",
1677
+ type: "uint256",
1678
+ },
1679
+ {
1680
+ internalType: "bytes32",
1681
+ name: "group",
1682
+ type: "bytes32",
1683
+ },
1684
+ {
1685
+ internalType: "address",
1686
+ name: "callback",
1687
+ type: "address",
1688
+ },
1689
+ {
1690
+ internalType: "bytes",
1691
+ name: "callbackData",
1692
+ type: "bytes",
1693
+ },
1694
+ {
1695
+ internalType: "address",
1696
+ name: "receiverIfMakerIsSeller",
1697
+ type: "address",
1698
+ },
1699
+ {
1700
+ internalType: "address",
1701
+ name: "ratifier",
1702
+ type: "address",
1703
+ },
1704
+ {
1705
+ internalType: "bool",
1706
+ name: "reduceOnly",
1707
+ type: "bool",
1708
+ },
1709
+ {
1710
+ internalType: "uint256",
1711
+ name: "maxUnits",
1712
+ type: "uint256",
1713
+ },
1714
+ {
1715
+ internalType: "uint256",
1716
+ name: "maxAssets",
1717
+ type: "uint256",
1718
+ },
1719
+ {
1720
+ internalType: "uint256",
1721
+ name: "continuousFeeCap",
1722
+ type: "uint256",
1723
+ },
1724
+ ],
1725
+ internalType: "struct Offer",
1726
+ name: "offer",
1727
+ type: "tuple",
1728
+ },
1729
+ {
1730
+ internalType: "bytes",
1731
+ name: "ratifierData",
1732
+ type: "bytes",
1733
+ },
1734
+ {
1735
+ internalType: "uint256",
1736
+ name: "units",
1737
+ type: "uint256",
1738
+ },
1739
+ {
1740
+ internalType: "address",
1741
+ name: "taker",
1742
+ type: "address",
1743
+ },
1744
+ {
1745
+ internalType: "address",
1746
+ name: "receiverIfTakerIsSeller",
1747
+ type: "address",
1748
+ },
1749
+ {
1750
+ internalType: "address",
1751
+ name: "takerCallback",
1752
+ type: "address",
1753
+ },
1754
+ {
1755
+ internalType: "bytes",
1756
+ name: "takerCallbackData",
1757
+ type: "bytes",
1758
+ },
1759
+ ],
1760
+ name: "take",
1761
+ outputs: [
1762
+ {
1763
+ internalType: "uint256",
1764
+ name: "buyerAssets",
1765
+ type: "uint256",
1766
+ },
1767
+ {
1768
+ internalType: "uint256",
1769
+ name: "sellerAssets",
1770
+ type: "uint256",
1771
+ },
1772
+ ],
1773
+ stateMutability: "nonpayable",
1774
+ type: "function",
1775
+ },
1776
+ {
1777
+ inputs: [
1778
+ {
1779
+ internalType: "bytes32",
1780
+ name: "id",
1781
+ type: "bytes32",
1782
+ },
1783
+ ],
1784
+ name: "tickSpacing",
1785
+ outputs: [
1786
+ {
1787
+ internalType: "uint8",
1788
+ name: "",
1789
+ type: "uint8",
1790
+ },
1791
+ ],
1792
+ stateMutability: "view",
1793
+ type: "function",
1794
+ },
1795
+ {
1796
+ inputs: [],
1797
+ name: "tickSpacingSetter",
1798
+ outputs: [
1799
+ {
1800
+ internalType: "address",
1801
+ name: "",
1802
+ type: "address",
1803
+ },
1804
+ ],
1805
+ stateMutability: "view",
1806
+ type: "function",
1807
+ },
1808
+ {
1809
+ inputs: [
1810
+ {
1811
+ components: [
1812
+ {
1813
+ internalType: "address",
1814
+ name: "loanToken",
1815
+ type: "address",
1816
+ },
1817
+ {
1818
+ components: [
1819
+ {
1820
+ internalType: "address",
1821
+ name: "token",
1822
+ type: "address",
1823
+ },
1824
+ {
1825
+ internalType: "uint256",
1826
+ name: "lltv",
1827
+ type: "uint256",
1828
+ },
1829
+ {
1830
+ internalType: "uint256",
1831
+ name: "maxLif",
1832
+ type: "uint256",
1833
+ },
1834
+ {
1835
+ internalType: "address",
1836
+ name: "oracle",
1837
+ type: "address",
1838
+ },
1839
+ ],
1840
+ internalType: "struct CollateralParams[]",
1841
+ name: "collateralParams",
1842
+ type: "tuple[]",
1843
+ },
1844
+ {
1845
+ internalType: "uint256",
1846
+ name: "maturity",
1847
+ type: "uint256",
1848
+ },
1849
+ {
1850
+ internalType: "uint256",
1851
+ name: "rcfThreshold",
1852
+ type: "uint256",
1853
+ },
1854
+ {
1855
+ internalType: "address",
1856
+ name: "enterGate",
1857
+ type: "address",
1858
+ },
1859
+ {
1860
+ internalType: "address",
1861
+ name: "liquidatorGate",
1862
+ type: "address",
1863
+ },
1864
+ ],
1865
+ internalType: "struct Market",
1866
+ name: "market",
1867
+ type: "tuple",
1868
+ },
1869
+ ],
1870
+ name: "toId",
1871
+ outputs: [
1872
+ {
1873
+ internalType: "bytes32",
1874
+ name: "",
1875
+ type: "bytes32",
1876
+ },
1877
+ ],
1878
+ stateMutability: "view",
1879
+ type: "function",
1880
+ },
1881
+ {
1882
+ inputs: [
1883
+ {
1884
+ internalType: "bytes32",
1885
+ name: "id",
1886
+ type: "bytes32",
1887
+ },
1888
+ ],
1889
+ name: "toMarket",
1890
+ outputs: [
1891
+ {
1892
+ components: [
1893
+ {
1894
+ internalType: "address",
1895
+ name: "loanToken",
1896
+ type: "address",
1897
+ },
1898
+ {
1899
+ components: [
1900
+ {
1901
+ internalType: "address",
1902
+ name: "token",
1903
+ type: "address",
1904
+ },
1905
+ {
1906
+ internalType: "uint256",
1907
+ name: "lltv",
1908
+ type: "uint256",
1909
+ },
1910
+ {
1911
+ internalType: "uint256",
1912
+ name: "maxLif",
1913
+ type: "uint256",
1914
+ },
1915
+ {
1916
+ internalType: "address",
1917
+ name: "oracle",
1918
+ type: "address",
1919
+ },
1920
+ ],
1921
+ internalType: "struct CollateralParams[]",
1922
+ name: "collateralParams",
1923
+ type: "tuple[]",
1924
+ },
1925
+ {
1926
+ internalType: "uint256",
1927
+ name: "maturity",
1928
+ type: "uint256",
1929
+ },
1930
+ {
1931
+ internalType: "uint256",
1932
+ name: "rcfThreshold",
1933
+ type: "uint256",
1934
+ },
1935
+ {
1936
+ internalType: "address",
1937
+ name: "enterGate",
1938
+ type: "address",
1939
+ },
1940
+ {
1941
+ internalType: "address",
1942
+ name: "liquidatorGate",
1943
+ type: "address",
1944
+ },
1945
+ ],
1946
+ internalType: "struct Market",
1947
+ name: "",
1948
+ type: "tuple",
1949
+ },
1950
+ ],
1951
+ stateMutability: "view",
1952
+ type: "function",
1953
+ },
1954
+ {
1955
+ inputs: [
1956
+ {
1957
+ internalType: "bytes32",
1958
+ name: "id",
1959
+ type: "bytes32",
1960
+ },
1961
+ ],
1962
+ name: "totalUnits",
1963
+ outputs: [
1964
+ {
1965
+ internalType: "uint128",
1966
+ name: "",
1967
+ type: "uint128",
1968
+ },
1969
+ ],
1970
+ stateMutability: "view",
1971
+ type: "function",
1972
+ },
1973
+ {
1974
+ inputs: [
1975
+ {
1976
+ components: [
1977
+ {
1978
+ internalType: "address",
1979
+ name: "loanToken",
1980
+ type: "address",
1981
+ },
1982
+ {
1983
+ components: [
1984
+ {
1985
+ internalType: "address",
1986
+ name: "token",
1987
+ type: "address",
1988
+ },
1989
+ {
1990
+ internalType: "uint256",
1991
+ name: "lltv",
1992
+ type: "uint256",
1993
+ },
1994
+ {
1995
+ internalType: "uint256",
1996
+ name: "maxLif",
1997
+ type: "uint256",
1998
+ },
1999
+ {
2000
+ internalType: "address",
2001
+ name: "oracle",
2002
+ type: "address",
2003
+ },
2004
+ ],
2005
+ internalType: "struct CollateralParams[]",
2006
+ name: "collateralParams",
2007
+ type: "tuple[]",
2008
+ },
2009
+ {
2010
+ internalType: "uint256",
2011
+ name: "maturity",
2012
+ type: "uint256",
2013
+ },
2014
+ {
2015
+ internalType: "uint256",
2016
+ name: "rcfThreshold",
2017
+ type: "uint256",
2018
+ },
2019
+ {
2020
+ internalType: "address",
2021
+ name: "enterGate",
2022
+ type: "address",
2023
+ },
2024
+ {
2025
+ internalType: "address",
2026
+ name: "liquidatorGate",
2027
+ type: "address",
2028
+ },
2029
+ ],
2030
+ internalType: "struct Market",
2031
+ name: "market",
2032
+ type: "tuple",
2033
+ },
2034
+ ],
2035
+ name: "touchMarket",
2036
+ outputs: [
2037
+ {
2038
+ internalType: "bytes32",
2039
+ name: "",
2040
+ type: "bytes32",
2041
+ },
2042
+ ],
2043
+ stateMutability: "nonpayable",
2044
+ type: "function",
2045
+ },
2046
+ {
2047
+ inputs: [
2048
+ {
2049
+ components: [
2050
+ {
2051
+ internalType: "address",
2052
+ name: "loanToken",
2053
+ type: "address",
2054
+ },
2055
+ {
2056
+ components: [
2057
+ {
2058
+ internalType: "address",
2059
+ name: "token",
2060
+ type: "address",
2061
+ },
2062
+ {
2063
+ internalType: "uint256",
2064
+ name: "lltv",
2065
+ type: "uint256",
2066
+ },
2067
+ {
2068
+ internalType: "uint256",
2069
+ name: "maxLif",
2070
+ type: "uint256",
2071
+ },
2072
+ {
2073
+ internalType: "address",
2074
+ name: "oracle",
2075
+ type: "address",
2076
+ },
2077
+ ],
2078
+ internalType: "struct CollateralParams[]",
2079
+ name: "collateralParams",
2080
+ type: "tuple[]",
2081
+ },
2082
+ {
2083
+ internalType: "uint256",
2084
+ name: "maturity",
2085
+ type: "uint256",
2086
+ },
2087
+ {
2088
+ internalType: "uint256",
2089
+ name: "rcfThreshold",
2090
+ type: "uint256",
2091
+ },
2092
+ {
2093
+ internalType: "address",
2094
+ name: "enterGate",
2095
+ type: "address",
2096
+ },
2097
+ {
2098
+ internalType: "address",
2099
+ name: "liquidatorGate",
2100
+ type: "address",
2101
+ },
2102
+ ],
2103
+ internalType: "struct Market",
2104
+ name: "market",
2105
+ type: "tuple",
2106
+ },
2107
+ {
2108
+ internalType: "address",
2109
+ name: "user",
2110
+ type: "address",
2111
+ },
2112
+ ],
2113
+ name: "updatePosition",
2114
+ outputs: [
2115
+ {
2116
+ internalType: "uint128",
2117
+ name: "newCredit",
2118
+ type: "uint128",
2119
+ },
2120
+ {
2121
+ internalType: "uint128",
2122
+ name: "newPendingFee",
2123
+ type: "uint128",
2124
+ },
2125
+ {
2126
+ internalType: "uint128",
2127
+ name: "accruedFee",
2128
+ type: "uint128",
2129
+ },
2130
+ ],
2131
+ stateMutability: "nonpayable",
2132
+ type: "function",
2133
+ },
2134
+ {
2135
+ inputs: [
2136
+ {
2137
+ components: [
2138
+ {
2139
+ internalType: "address",
2140
+ name: "loanToken",
2141
+ type: "address",
2142
+ },
2143
+ {
2144
+ components: [
2145
+ {
2146
+ internalType: "address",
2147
+ name: "token",
2148
+ type: "address",
2149
+ },
2150
+ {
2151
+ internalType: "uint256",
2152
+ name: "lltv",
2153
+ type: "uint256",
2154
+ },
2155
+ {
2156
+ internalType: "uint256",
2157
+ name: "maxLif",
2158
+ type: "uint256",
2159
+ },
2160
+ {
2161
+ internalType: "address",
2162
+ name: "oracle",
2163
+ type: "address",
2164
+ },
2165
+ ],
2166
+ internalType: "struct CollateralParams[]",
2167
+ name: "collateralParams",
2168
+ type: "tuple[]",
2169
+ },
2170
+ {
2171
+ internalType: "uint256",
2172
+ name: "maturity",
2173
+ type: "uint256",
2174
+ },
2175
+ {
2176
+ internalType: "uint256",
2177
+ name: "rcfThreshold",
2178
+ type: "uint256",
2179
+ },
2180
+ {
2181
+ internalType: "address",
2182
+ name: "enterGate",
2183
+ type: "address",
2184
+ },
2185
+ {
2186
+ internalType: "address",
2187
+ name: "liquidatorGate",
2188
+ type: "address",
2189
+ },
2190
+ ],
2191
+ internalType: "struct Market",
2192
+ name: "market",
2193
+ type: "tuple",
2194
+ },
2195
+ {
2196
+ internalType: "bytes32",
2197
+ name: "id",
2198
+ type: "bytes32",
2199
+ },
2200
+ {
2201
+ internalType: "address",
2202
+ name: "user",
2203
+ type: "address",
2204
+ },
2205
+ ],
2206
+ name: "updatePositionView",
2207
+ outputs: [
2208
+ {
2209
+ internalType: "uint128",
2210
+ name: "newCredit",
2211
+ type: "uint128",
2212
+ },
2213
+ {
2214
+ internalType: "uint128",
2215
+ name: "newPendingFee",
2216
+ type: "uint128",
2217
+ },
2218
+ {
2219
+ internalType: "uint128",
2220
+ name: "accruedFee",
2221
+ type: "uint128",
2222
+ },
2223
+ ],
2224
+ stateMutability: "view",
2225
+ type: "function",
2226
+ },
2227
+ {
2228
+ inputs: [
2229
+ {
2230
+ components: [
2231
+ {
2232
+ internalType: "address",
2233
+ name: "loanToken",
2234
+ type: "address",
2235
+ },
2236
+ {
2237
+ components: [
2238
+ {
2239
+ internalType: "address",
2240
+ name: "token",
2241
+ type: "address",
2242
+ },
2243
+ {
2244
+ internalType: "uint256",
2245
+ name: "lltv",
2246
+ type: "uint256",
2247
+ },
2248
+ {
2249
+ internalType: "uint256",
2250
+ name: "maxLif",
2251
+ type: "uint256",
2252
+ },
2253
+ {
2254
+ internalType: "address",
2255
+ name: "oracle",
2256
+ type: "address",
2257
+ },
2258
+ ],
2259
+ internalType: "struct CollateralParams[]",
2260
+ name: "collateralParams",
2261
+ type: "tuple[]",
2262
+ },
2263
+ {
2264
+ internalType: "uint256",
2265
+ name: "maturity",
2266
+ type: "uint256",
2267
+ },
2268
+ {
2269
+ internalType: "uint256",
2270
+ name: "rcfThreshold",
2271
+ type: "uint256",
2272
+ },
2273
+ {
2274
+ internalType: "address",
2275
+ name: "enterGate",
2276
+ type: "address",
2277
+ },
2278
+ {
2279
+ internalType: "address",
2280
+ name: "liquidatorGate",
2281
+ type: "address",
2282
+ },
2283
+ ],
2284
+ internalType: "struct Market",
2285
+ name: "market",
2286
+ type: "tuple",
2287
+ },
2288
+ {
2289
+ internalType: "uint256",
2290
+ name: "units",
2291
+ type: "uint256",
2292
+ },
2293
+ {
2294
+ internalType: "address",
2295
+ name: "onBehalf",
2296
+ type: "address",
2297
+ },
2298
+ {
2299
+ internalType: "address",
2300
+ name: "receiver",
2301
+ type: "address",
2302
+ },
2303
+ ],
2304
+ name: "withdraw",
2305
+ outputs: [],
2306
+ stateMutability: "nonpayable",
2307
+ type: "function",
2308
+ },
2309
+ {
2310
+ inputs: [
2311
+ {
2312
+ components: [
2313
+ {
2314
+ internalType: "address",
2315
+ name: "loanToken",
2316
+ type: "address",
2317
+ },
2318
+ {
2319
+ components: [
2320
+ {
2321
+ internalType: "address",
2322
+ name: "token",
2323
+ type: "address",
2324
+ },
2325
+ {
2326
+ internalType: "uint256",
2327
+ name: "lltv",
2328
+ type: "uint256",
2329
+ },
2330
+ {
2331
+ internalType: "uint256",
2332
+ name: "maxLif",
2333
+ type: "uint256",
2334
+ },
2335
+ {
2336
+ internalType: "address",
2337
+ name: "oracle",
2338
+ type: "address",
2339
+ },
2340
+ ],
2341
+ internalType: "struct CollateralParams[]",
2342
+ name: "collateralParams",
2343
+ type: "tuple[]",
2344
+ },
2345
+ {
2346
+ internalType: "uint256",
2347
+ name: "maturity",
2348
+ type: "uint256",
2349
+ },
2350
+ {
2351
+ internalType: "uint256",
2352
+ name: "rcfThreshold",
2353
+ type: "uint256",
2354
+ },
2355
+ {
2356
+ internalType: "address",
2357
+ name: "enterGate",
2358
+ type: "address",
2359
+ },
2360
+ {
2361
+ internalType: "address",
2362
+ name: "liquidatorGate",
2363
+ type: "address",
2364
+ },
2365
+ ],
2366
+ internalType: "struct Market",
2367
+ name: "market",
2368
+ type: "tuple",
2369
+ },
2370
+ {
2371
+ internalType: "uint256",
2372
+ name: "collateralIndex",
2373
+ type: "uint256",
2374
+ },
2375
+ {
2376
+ internalType: "uint256",
2377
+ name: "assets",
2378
+ type: "uint256",
2379
+ },
2380
+ {
2381
+ internalType: "address",
2382
+ name: "onBehalf",
2383
+ type: "address",
2384
+ },
2385
+ {
2386
+ internalType: "address",
2387
+ name: "receiver",
2388
+ type: "address",
2389
+ },
2390
+ ],
2391
+ name: "withdrawCollateral",
2392
+ outputs: [],
2393
+ stateMutability: "nonpayable",
2394
+ type: "function",
2395
+ },
2396
+ {
2397
+ inputs: [
2398
+ {
2399
+ internalType: "bytes32",
2400
+ name: "id",
2401
+ type: "bytes32",
2402
+ },
2403
+ ],
2404
+ name: "withdrawable",
2405
+ outputs: [
2406
+ {
2407
+ internalType: "uint128",
2408
+ name: "",
2409
+ type: "uint128",
2410
+ },
2411
+ ],
2412
+ stateMutability: "view",
2413
+ type: "function",
2414
+ },
2415
+ ];
2416
+ /**
2417
+ * Pinned ABI JSON for the MidnightBundles.
2418
+ *
2419
+ * Source: `morpho-org/midnight` commit `615fcfa12f725df3a16d65b2c2209272eff5bc10`,
2420
+ * `src/periphery/interfaces/IMidnightBundles.sol`, Forge artifact `out/src/periphery/interfaces/IMidnightBundles.sol/IMidnightBundles.json`.
2421
+ *
2422
+ * @example
2423
+ * ```ts
2424
+ * import { midnightBundlesAbi } from "@morpho-org/midnight-sdk";
2425
+ *
2426
+ * console.log(midnightBundlesAbi.length);
2427
+ * ```
2428
+ */
2429
+ exports.midnightBundlesAbi = [
2430
+ {
2431
+ inputs: [],
2432
+ name: "ApproveReturnedFalse",
2433
+ type: "error",
2434
+ },
2435
+ {
2436
+ inputs: [],
2437
+ name: "InconsistentMarket",
2438
+ type: "error",
2439
+ },
2440
+ {
2441
+ inputs: [],
2442
+ name: "InconsistentSide",
2443
+ type: "error",
2444
+ },
2445
+ {
2446
+ inputs: [],
2447
+ name: "OutOfOffers",
2448
+ type: "error",
2449
+ },
2450
+ {
2451
+ inputs: [],
2452
+ name: "PctExceeded",
2453
+ type: "error",
2454
+ },
2455
+ {
2456
+ inputs: [],
2457
+ name: "SellerAssetsTooLow",
2458
+ type: "error",
2459
+ },
2460
+ {
2461
+ inputs: [],
2462
+ name: "Unauthorized",
2463
+ type: "error",
2464
+ },
2465
+ {
2466
+ inputs: [],
2467
+ name: "UnitsTooHigh",
2468
+ type: "error",
2469
+ },
2470
+ {
2471
+ inputs: [],
2472
+ name: "UnitsTooLow",
2473
+ type: "error",
2474
+ },
2475
+ {
2476
+ inputs: [],
2477
+ name: "MIDNIGHT",
2478
+ outputs: [
2479
+ {
2480
+ internalType: "address",
2481
+ name: "",
2482
+ type: "address",
2483
+ },
2484
+ ],
2485
+ stateMutability: "view",
2486
+ type: "function",
2487
+ },
2488
+ {
2489
+ inputs: [],
2490
+ name: "PERMIT2",
2491
+ outputs: [
2492
+ {
2493
+ internalType: "address",
2494
+ name: "",
2495
+ type: "address",
2496
+ },
2497
+ ],
2498
+ stateMutability: "view",
2499
+ type: "function",
2500
+ },
2501
+ {
2502
+ inputs: [
2503
+ {
2504
+ internalType: "uint256",
2505
+ name: "targetBuyerAssets",
2506
+ type: "uint256",
2507
+ },
2508
+ {
2509
+ internalType: "uint256",
2510
+ name: "minUnits",
2511
+ type: "uint256",
2512
+ },
2513
+ {
2514
+ internalType: "address",
2515
+ name: "taker",
2516
+ type: "address",
2517
+ },
2518
+ {
2519
+ components: [
2520
+ {
2521
+ internalType: "enum PermitKind",
2522
+ name: "kind",
2523
+ type: "uint8",
2524
+ },
2525
+ {
2526
+ internalType: "bytes",
2527
+ name: "data",
2528
+ type: "bytes",
2529
+ },
2530
+ ],
2531
+ internalType: "struct TokenPermit",
2532
+ name: "loanTokenPermit",
2533
+ type: "tuple",
2534
+ },
2535
+ {
2536
+ components: [
2537
+ {
2538
+ components: [
2539
+ {
2540
+ components: [
2541
+ {
2542
+ internalType: "address",
2543
+ name: "loanToken",
2544
+ type: "address",
2545
+ },
2546
+ {
2547
+ components: [
2548
+ {
2549
+ internalType: "address",
2550
+ name: "token",
2551
+ type: "address",
2552
+ },
2553
+ {
2554
+ internalType: "uint256",
2555
+ name: "lltv",
2556
+ type: "uint256",
2557
+ },
2558
+ {
2559
+ internalType: "uint256",
2560
+ name: "maxLif",
2561
+ type: "uint256",
2562
+ },
2563
+ {
2564
+ internalType: "address",
2565
+ name: "oracle",
2566
+ type: "address",
2567
+ },
2568
+ ],
2569
+ internalType: "struct CollateralParams[]",
2570
+ name: "collateralParams",
2571
+ type: "tuple[]",
2572
+ },
2573
+ {
2574
+ internalType: "uint256",
2575
+ name: "maturity",
2576
+ type: "uint256",
2577
+ },
2578
+ {
2579
+ internalType: "uint256",
2580
+ name: "rcfThreshold",
2581
+ type: "uint256",
2582
+ },
2583
+ {
2584
+ internalType: "address",
2585
+ name: "enterGate",
2586
+ type: "address",
2587
+ },
2588
+ {
2589
+ internalType: "address",
2590
+ name: "liquidatorGate",
2591
+ type: "address",
2592
+ },
2593
+ ],
2594
+ internalType: "struct Market",
2595
+ name: "market",
2596
+ type: "tuple",
2597
+ },
2598
+ {
2599
+ internalType: "bool",
2600
+ name: "buy",
2601
+ type: "bool",
2602
+ },
2603
+ {
2604
+ internalType: "address",
2605
+ name: "maker",
2606
+ type: "address",
2607
+ },
2608
+ {
2609
+ internalType: "uint256",
2610
+ name: "start",
2611
+ type: "uint256",
2612
+ },
2613
+ {
2614
+ internalType: "uint256",
2615
+ name: "expiry",
2616
+ type: "uint256",
2617
+ },
2618
+ {
2619
+ internalType: "uint256",
2620
+ name: "tick",
2621
+ type: "uint256",
2622
+ },
2623
+ {
2624
+ internalType: "bytes32",
2625
+ name: "group",
2626
+ type: "bytes32",
2627
+ },
2628
+ {
2629
+ internalType: "address",
2630
+ name: "callback",
2631
+ type: "address",
2632
+ },
2633
+ {
2634
+ internalType: "bytes",
2635
+ name: "callbackData",
2636
+ type: "bytes",
2637
+ },
2638
+ {
2639
+ internalType: "address",
2640
+ name: "receiverIfMakerIsSeller",
2641
+ type: "address",
2642
+ },
2643
+ {
2644
+ internalType: "address",
2645
+ name: "ratifier",
2646
+ type: "address",
2647
+ },
2648
+ {
2649
+ internalType: "bool",
2650
+ name: "reduceOnly",
2651
+ type: "bool",
2652
+ },
2653
+ {
2654
+ internalType: "uint256",
2655
+ name: "maxUnits",
2656
+ type: "uint256",
2657
+ },
2658
+ {
2659
+ internalType: "uint256",
2660
+ name: "maxAssets",
2661
+ type: "uint256",
2662
+ },
2663
+ {
2664
+ internalType: "uint256",
2665
+ name: "continuousFeeCap",
2666
+ type: "uint256",
2667
+ },
2668
+ ],
2669
+ internalType: "struct Offer",
2670
+ name: "offer",
2671
+ type: "tuple",
2672
+ },
2673
+ {
2674
+ internalType: "bytes",
2675
+ name: "ratifierData",
2676
+ type: "bytes",
2677
+ },
2678
+ {
2679
+ internalType: "uint256",
2680
+ name: "units",
2681
+ type: "uint256",
2682
+ },
2683
+ ],
2684
+ internalType: "struct Take[]",
2685
+ name: "takes",
2686
+ type: "tuple[]",
2687
+ },
2688
+ {
2689
+ components: [
2690
+ {
2691
+ internalType: "uint256",
2692
+ name: "collateralIndex",
2693
+ type: "uint256",
2694
+ },
2695
+ {
2696
+ internalType: "uint256",
2697
+ name: "assets",
2698
+ type: "uint256",
2699
+ },
2700
+ ],
2701
+ internalType: "struct CollateralWithdrawal[]",
2702
+ name: "collateralWithdrawals",
2703
+ type: "tuple[]",
2704
+ },
2705
+ {
2706
+ internalType: "address",
2707
+ name: "collateralReceiver",
2708
+ type: "address",
2709
+ },
2710
+ {
2711
+ internalType: "uint256",
2712
+ name: "referralFeePct",
2713
+ type: "uint256",
2714
+ },
2715
+ {
2716
+ internalType: "address",
2717
+ name: "referralFeeRecipient",
2718
+ type: "address",
2719
+ },
2720
+ ],
2721
+ name: "buyWithAssetsTargetAndWithdrawCollateral",
2722
+ outputs: [],
2723
+ stateMutability: "nonpayable",
2724
+ type: "function",
2725
+ },
2726
+ {
2727
+ inputs: [
2728
+ {
2729
+ internalType: "uint256",
2730
+ name: "targetUnits",
2731
+ type: "uint256",
2732
+ },
2733
+ {
2734
+ internalType: "uint256",
2735
+ name: "maxBuyerAssets",
2736
+ type: "uint256",
2737
+ },
2738
+ {
2739
+ internalType: "address",
2740
+ name: "taker",
2741
+ type: "address",
2742
+ },
2743
+ {
2744
+ components: [
2745
+ {
2746
+ internalType: "enum PermitKind",
2747
+ name: "kind",
2748
+ type: "uint8",
2749
+ },
2750
+ {
2751
+ internalType: "bytes",
2752
+ name: "data",
2753
+ type: "bytes",
2754
+ },
2755
+ ],
2756
+ internalType: "struct TokenPermit",
2757
+ name: "loanTokenPermit",
2758
+ type: "tuple",
2759
+ },
2760
+ {
2761
+ components: [
2762
+ {
2763
+ components: [
2764
+ {
2765
+ components: [
2766
+ {
2767
+ internalType: "address",
2768
+ name: "loanToken",
2769
+ type: "address",
2770
+ },
2771
+ {
2772
+ components: [
2773
+ {
2774
+ internalType: "address",
2775
+ name: "token",
2776
+ type: "address",
2777
+ },
2778
+ {
2779
+ internalType: "uint256",
2780
+ name: "lltv",
2781
+ type: "uint256",
2782
+ },
2783
+ {
2784
+ internalType: "uint256",
2785
+ name: "maxLif",
2786
+ type: "uint256",
2787
+ },
2788
+ {
2789
+ internalType: "address",
2790
+ name: "oracle",
2791
+ type: "address",
2792
+ },
2793
+ ],
2794
+ internalType: "struct CollateralParams[]",
2795
+ name: "collateralParams",
2796
+ type: "tuple[]",
2797
+ },
2798
+ {
2799
+ internalType: "uint256",
2800
+ name: "maturity",
2801
+ type: "uint256",
2802
+ },
2803
+ {
2804
+ internalType: "uint256",
2805
+ name: "rcfThreshold",
2806
+ type: "uint256",
2807
+ },
2808
+ {
2809
+ internalType: "address",
2810
+ name: "enterGate",
2811
+ type: "address",
2812
+ },
2813
+ {
2814
+ internalType: "address",
2815
+ name: "liquidatorGate",
2816
+ type: "address",
2817
+ },
2818
+ ],
2819
+ internalType: "struct Market",
2820
+ name: "market",
2821
+ type: "tuple",
2822
+ },
2823
+ {
2824
+ internalType: "bool",
2825
+ name: "buy",
2826
+ type: "bool",
2827
+ },
2828
+ {
2829
+ internalType: "address",
2830
+ name: "maker",
2831
+ type: "address",
2832
+ },
2833
+ {
2834
+ internalType: "uint256",
2835
+ name: "start",
2836
+ type: "uint256",
2837
+ },
2838
+ {
2839
+ internalType: "uint256",
2840
+ name: "expiry",
2841
+ type: "uint256",
2842
+ },
2843
+ {
2844
+ internalType: "uint256",
2845
+ name: "tick",
2846
+ type: "uint256",
2847
+ },
2848
+ {
2849
+ internalType: "bytes32",
2850
+ name: "group",
2851
+ type: "bytes32",
2852
+ },
2853
+ {
2854
+ internalType: "address",
2855
+ name: "callback",
2856
+ type: "address",
2857
+ },
2858
+ {
2859
+ internalType: "bytes",
2860
+ name: "callbackData",
2861
+ type: "bytes",
2862
+ },
2863
+ {
2864
+ internalType: "address",
2865
+ name: "receiverIfMakerIsSeller",
2866
+ type: "address",
2867
+ },
2868
+ {
2869
+ internalType: "address",
2870
+ name: "ratifier",
2871
+ type: "address",
2872
+ },
2873
+ {
2874
+ internalType: "bool",
2875
+ name: "reduceOnly",
2876
+ type: "bool",
2877
+ },
2878
+ {
2879
+ internalType: "uint256",
2880
+ name: "maxUnits",
2881
+ type: "uint256",
2882
+ },
2883
+ {
2884
+ internalType: "uint256",
2885
+ name: "maxAssets",
2886
+ type: "uint256",
2887
+ },
2888
+ {
2889
+ internalType: "uint256",
2890
+ name: "continuousFeeCap",
2891
+ type: "uint256",
2892
+ },
2893
+ ],
2894
+ internalType: "struct Offer",
2895
+ name: "offer",
2896
+ type: "tuple",
2897
+ },
2898
+ {
2899
+ internalType: "bytes",
2900
+ name: "ratifierData",
2901
+ type: "bytes",
2902
+ },
2903
+ {
2904
+ internalType: "uint256",
2905
+ name: "units",
2906
+ type: "uint256",
2907
+ },
2908
+ ],
2909
+ internalType: "struct Take[]",
2910
+ name: "takes",
2911
+ type: "tuple[]",
2912
+ },
2913
+ {
2914
+ components: [
2915
+ {
2916
+ internalType: "uint256",
2917
+ name: "collateralIndex",
2918
+ type: "uint256",
2919
+ },
2920
+ {
2921
+ internalType: "uint256",
2922
+ name: "assets",
2923
+ type: "uint256",
2924
+ },
2925
+ ],
2926
+ internalType: "struct CollateralWithdrawal[]",
2927
+ name: "collateralWithdrawals",
2928
+ type: "tuple[]",
2929
+ },
2930
+ {
2931
+ internalType: "address",
2932
+ name: "collateralReceiver",
2933
+ type: "address",
2934
+ },
2935
+ {
2936
+ internalType: "uint256",
2937
+ name: "referralFeePct",
2938
+ type: "uint256",
2939
+ },
2940
+ {
2941
+ internalType: "address",
2942
+ name: "referralFeeRecipient",
2943
+ type: "address",
2944
+ },
2945
+ ],
2946
+ name: "buyWithUnitsTargetAndWithdrawCollateral",
2947
+ outputs: [],
2948
+ stateMutability: "nonpayable",
2949
+ type: "function",
2950
+ },
2951
+ {
2952
+ inputs: [
2953
+ {
2954
+ components: [
2955
+ {
2956
+ internalType: "address",
2957
+ name: "loanToken",
2958
+ type: "address",
2959
+ },
2960
+ {
2961
+ components: [
2962
+ {
2963
+ internalType: "address",
2964
+ name: "token",
2965
+ type: "address",
2966
+ },
2967
+ {
2968
+ internalType: "uint256",
2969
+ name: "lltv",
2970
+ type: "uint256",
2971
+ },
2972
+ {
2973
+ internalType: "uint256",
2974
+ name: "maxLif",
2975
+ type: "uint256",
2976
+ },
2977
+ {
2978
+ internalType: "address",
2979
+ name: "oracle",
2980
+ type: "address",
2981
+ },
2982
+ ],
2983
+ internalType: "struct CollateralParams[]",
2984
+ name: "collateralParams",
2985
+ type: "tuple[]",
2986
+ },
2987
+ {
2988
+ internalType: "uint256",
2989
+ name: "maturity",
2990
+ type: "uint256",
2991
+ },
2992
+ {
2993
+ internalType: "uint256",
2994
+ name: "rcfThreshold",
2995
+ type: "uint256",
2996
+ },
2997
+ {
2998
+ internalType: "address",
2999
+ name: "enterGate",
3000
+ type: "address",
3001
+ },
3002
+ {
3003
+ internalType: "address",
3004
+ name: "liquidatorGate",
3005
+ type: "address",
3006
+ },
3007
+ ],
3008
+ internalType: "struct Market",
3009
+ name: "market",
3010
+ type: "tuple",
3011
+ },
3012
+ {
3013
+ internalType: "uint256",
3014
+ name: "assets",
3015
+ type: "uint256",
3016
+ },
3017
+ {
3018
+ internalType: "address",
3019
+ name: "onBehalf",
3020
+ type: "address",
3021
+ },
3022
+ {
3023
+ components: [
3024
+ {
3025
+ internalType: "enum PermitKind",
3026
+ name: "kind",
3027
+ type: "uint8",
3028
+ },
3029
+ {
3030
+ internalType: "bytes",
3031
+ name: "data",
3032
+ type: "bytes",
3033
+ },
3034
+ ],
3035
+ internalType: "struct TokenPermit",
3036
+ name: "loanTokenPermit",
3037
+ type: "tuple",
3038
+ },
3039
+ {
3040
+ components: [
3041
+ {
3042
+ internalType: "uint256",
3043
+ name: "collateralIndex",
3044
+ type: "uint256",
3045
+ },
3046
+ {
3047
+ internalType: "uint256",
3048
+ name: "assets",
3049
+ type: "uint256",
3050
+ },
3051
+ ],
3052
+ internalType: "struct CollateralWithdrawal[]",
3053
+ name: "collateralWithdrawals",
3054
+ type: "tuple[]",
3055
+ },
3056
+ {
3057
+ internalType: "address",
3058
+ name: "collateralReceiver",
3059
+ type: "address",
3060
+ },
3061
+ {
3062
+ internalType: "uint256",
3063
+ name: "referralFeePct",
3064
+ type: "uint256",
3065
+ },
3066
+ {
3067
+ internalType: "address",
3068
+ name: "referralFeeRecipient",
3069
+ type: "address",
3070
+ },
3071
+ ],
3072
+ name: "repayAndWithdrawCollateral",
3073
+ outputs: [],
3074
+ stateMutability: "nonpayable",
3075
+ type: "function",
3076
+ },
3077
+ {
3078
+ inputs: [
3079
+ {
3080
+ internalType: "uint256",
3081
+ name: "targetSellerAssets",
3082
+ type: "uint256",
3083
+ },
3084
+ {
3085
+ internalType: "uint256",
3086
+ name: "maxUnits",
3087
+ type: "uint256",
3088
+ },
3089
+ {
3090
+ internalType: "address",
3091
+ name: "taker",
3092
+ type: "address",
3093
+ },
3094
+ {
3095
+ internalType: "address",
3096
+ name: "receiverIfTakerIsSeller",
3097
+ type: "address",
3098
+ },
3099
+ {
3100
+ components: [
3101
+ {
3102
+ internalType: "uint256",
3103
+ name: "collateralIndex",
3104
+ type: "uint256",
3105
+ },
3106
+ {
3107
+ internalType: "uint256",
3108
+ name: "assets",
3109
+ type: "uint256",
3110
+ },
3111
+ {
3112
+ components: [
3113
+ {
3114
+ internalType: "enum PermitKind",
3115
+ name: "kind",
3116
+ type: "uint8",
3117
+ },
3118
+ {
3119
+ internalType: "bytes",
3120
+ name: "data",
3121
+ type: "bytes",
3122
+ },
3123
+ ],
3124
+ internalType: "struct TokenPermit",
3125
+ name: "permit",
3126
+ type: "tuple",
3127
+ },
3128
+ ],
3129
+ internalType: "struct CollateralSupply[]",
3130
+ name: "collateralSupplies",
3131
+ type: "tuple[]",
3132
+ },
3133
+ {
3134
+ components: [
3135
+ {
3136
+ components: [
3137
+ {
3138
+ components: [
3139
+ {
3140
+ internalType: "address",
3141
+ name: "loanToken",
3142
+ type: "address",
3143
+ },
3144
+ {
3145
+ components: [
3146
+ {
3147
+ internalType: "address",
3148
+ name: "token",
3149
+ type: "address",
3150
+ },
3151
+ {
3152
+ internalType: "uint256",
3153
+ name: "lltv",
3154
+ type: "uint256",
3155
+ },
3156
+ {
3157
+ internalType: "uint256",
3158
+ name: "maxLif",
3159
+ type: "uint256",
3160
+ },
3161
+ {
3162
+ internalType: "address",
3163
+ name: "oracle",
3164
+ type: "address",
3165
+ },
3166
+ ],
3167
+ internalType: "struct CollateralParams[]",
3168
+ name: "collateralParams",
3169
+ type: "tuple[]",
3170
+ },
3171
+ {
3172
+ internalType: "uint256",
3173
+ name: "maturity",
3174
+ type: "uint256",
3175
+ },
3176
+ {
3177
+ internalType: "uint256",
3178
+ name: "rcfThreshold",
3179
+ type: "uint256",
3180
+ },
3181
+ {
3182
+ internalType: "address",
3183
+ name: "enterGate",
3184
+ type: "address",
3185
+ },
3186
+ {
3187
+ internalType: "address",
3188
+ name: "liquidatorGate",
3189
+ type: "address",
3190
+ },
3191
+ ],
3192
+ internalType: "struct Market",
3193
+ name: "market",
3194
+ type: "tuple",
3195
+ },
3196
+ {
3197
+ internalType: "bool",
3198
+ name: "buy",
3199
+ type: "bool",
3200
+ },
3201
+ {
3202
+ internalType: "address",
3203
+ name: "maker",
3204
+ type: "address",
3205
+ },
3206
+ {
3207
+ internalType: "uint256",
3208
+ name: "start",
3209
+ type: "uint256",
3210
+ },
3211
+ {
3212
+ internalType: "uint256",
3213
+ name: "expiry",
3214
+ type: "uint256",
3215
+ },
3216
+ {
3217
+ internalType: "uint256",
3218
+ name: "tick",
3219
+ type: "uint256",
3220
+ },
3221
+ {
3222
+ internalType: "bytes32",
3223
+ name: "group",
3224
+ type: "bytes32",
3225
+ },
3226
+ {
3227
+ internalType: "address",
3228
+ name: "callback",
3229
+ type: "address",
3230
+ },
3231
+ {
3232
+ internalType: "bytes",
3233
+ name: "callbackData",
3234
+ type: "bytes",
3235
+ },
3236
+ {
3237
+ internalType: "address",
3238
+ name: "receiverIfMakerIsSeller",
3239
+ type: "address",
3240
+ },
3241
+ {
3242
+ internalType: "address",
3243
+ name: "ratifier",
3244
+ type: "address",
3245
+ },
3246
+ {
3247
+ internalType: "bool",
3248
+ name: "reduceOnly",
3249
+ type: "bool",
3250
+ },
3251
+ {
3252
+ internalType: "uint256",
3253
+ name: "maxUnits",
3254
+ type: "uint256",
3255
+ },
3256
+ {
3257
+ internalType: "uint256",
3258
+ name: "maxAssets",
3259
+ type: "uint256",
3260
+ },
3261
+ {
3262
+ internalType: "uint256",
3263
+ name: "continuousFeeCap",
3264
+ type: "uint256",
3265
+ },
3266
+ ],
3267
+ internalType: "struct Offer",
3268
+ name: "offer",
3269
+ type: "tuple",
3270
+ },
3271
+ {
3272
+ internalType: "bytes",
3273
+ name: "ratifierData",
3274
+ type: "bytes",
3275
+ },
3276
+ {
3277
+ internalType: "uint256",
3278
+ name: "units",
3279
+ type: "uint256",
3280
+ },
3281
+ ],
3282
+ internalType: "struct Take[]",
3283
+ name: "takes",
3284
+ type: "tuple[]",
3285
+ },
3286
+ {
3287
+ internalType: "uint256",
3288
+ name: "referralFeePct",
3289
+ type: "uint256",
3290
+ },
3291
+ {
3292
+ internalType: "address",
3293
+ name: "referralFeeRecipient",
3294
+ type: "address",
3295
+ },
3296
+ ],
3297
+ name: "supplyCollateralAndSellWithAssetsTarget",
3298
+ outputs: [],
3299
+ stateMutability: "nonpayable",
3300
+ type: "function",
3301
+ },
3302
+ {
3303
+ inputs: [
3304
+ {
3305
+ internalType: "uint256",
3306
+ name: "targetUnits",
3307
+ type: "uint256",
3308
+ },
3309
+ {
3310
+ internalType: "uint256",
3311
+ name: "minSellerAssets",
3312
+ type: "uint256",
3313
+ },
3314
+ {
3315
+ internalType: "address",
3316
+ name: "taker",
3317
+ type: "address",
3318
+ },
3319
+ {
3320
+ internalType: "address",
3321
+ name: "receiverIfTakerIsSeller",
3322
+ type: "address",
3323
+ },
3324
+ {
3325
+ components: [
3326
+ {
3327
+ internalType: "uint256",
3328
+ name: "collateralIndex",
3329
+ type: "uint256",
3330
+ },
3331
+ {
3332
+ internalType: "uint256",
3333
+ name: "assets",
3334
+ type: "uint256",
3335
+ },
3336
+ {
3337
+ components: [
3338
+ {
3339
+ internalType: "enum PermitKind",
3340
+ name: "kind",
3341
+ type: "uint8",
3342
+ },
3343
+ {
3344
+ internalType: "bytes",
3345
+ name: "data",
3346
+ type: "bytes",
3347
+ },
3348
+ ],
3349
+ internalType: "struct TokenPermit",
3350
+ name: "permit",
3351
+ type: "tuple",
3352
+ },
3353
+ ],
3354
+ internalType: "struct CollateralSupply[]",
3355
+ name: "collateralSupplies",
3356
+ type: "tuple[]",
3357
+ },
3358
+ {
3359
+ components: [
3360
+ {
3361
+ components: [
3362
+ {
3363
+ components: [
3364
+ {
3365
+ internalType: "address",
3366
+ name: "loanToken",
3367
+ type: "address",
3368
+ },
3369
+ {
3370
+ components: [
3371
+ {
3372
+ internalType: "address",
3373
+ name: "token",
3374
+ type: "address",
3375
+ },
3376
+ {
3377
+ internalType: "uint256",
3378
+ name: "lltv",
3379
+ type: "uint256",
3380
+ },
3381
+ {
3382
+ internalType: "uint256",
3383
+ name: "maxLif",
3384
+ type: "uint256",
3385
+ },
3386
+ {
3387
+ internalType: "address",
3388
+ name: "oracle",
3389
+ type: "address",
3390
+ },
3391
+ ],
3392
+ internalType: "struct CollateralParams[]",
3393
+ name: "collateralParams",
3394
+ type: "tuple[]",
3395
+ },
3396
+ {
3397
+ internalType: "uint256",
3398
+ name: "maturity",
3399
+ type: "uint256",
3400
+ },
3401
+ {
3402
+ internalType: "uint256",
3403
+ name: "rcfThreshold",
3404
+ type: "uint256",
3405
+ },
3406
+ {
3407
+ internalType: "address",
3408
+ name: "enterGate",
3409
+ type: "address",
3410
+ },
3411
+ {
3412
+ internalType: "address",
3413
+ name: "liquidatorGate",
3414
+ type: "address",
3415
+ },
3416
+ ],
3417
+ internalType: "struct Market",
3418
+ name: "market",
3419
+ type: "tuple",
3420
+ },
3421
+ {
3422
+ internalType: "bool",
3423
+ name: "buy",
3424
+ type: "bool",
3425
+ },
3426
+ {
3427
+ internalType: "address",
3428
+ name: "maker",
3429
+ type: "address",
3430
+ },
3431
+ {
3432
+ internalType: "uint256",
3433
+ name: "start",
3434
+ type: "uint256",
3435
+ },
3436
+ {
3437
+ internalType: "uint256",
3438
+ name: "expiry",
3439
+ type: "uint256",
3440
+ },
3441
+ {
3442
+ internalType: "uint256",
3443
+ name: "tick",
3444
+ type: "uint256",
3445
+ },
3446
+ {
3447
+ internalType: "bytes32",
3448
+ name: "group",
3449
+ type: "bytes32",
3450
+ },
3451
+ {
3452
+ internalType: "address",
3453
+ name: "callback",
3454
+ type: "address",
3455
+ },
3456
+ {
3457
+ internalType: "bytes",
3458
+ name: "callbackData",
3459
+ type: "bytes",
3460
+ },
3461
+ {
3462
+ internalType: "address",
3463
+ name: "receiverIfMakerIsSeller",
3464
+ type: "address",
3465
+ },
3466
+ {
3467
+ internalType: "address",
3468
+ name: "ratifier",
3469
+ type: "address",
3470
+ },
3471
+ {
3472
+ internalType: "bool",
3473
+ name: "reduceOnly",
3474
+ type: "bool",
3475
+ },
3476
+ {
3477
+ internalType: "uint256",
3478
+ name: "maxUnits",
3479
+ type: "uint256",
3480
+ },
3481
+ {
3482
+ internalType: "uint256",
3483
+ name: "maxAssets",
3484
+ type: "uint256",
3485
+ },
3486
+ {
3487
+ internalType: "uint256",
3488
+ name: "continuousFeeCap",
3489
+ type: "uint256",
3490
+ },
3491
+ ],
3492
+ internalType: "struct Offer",
3493
+ name: "offer",
3494
+ type: "tuple",
3495
+ },
3496
+ {
3497
+ internalType: "bytes",
3498
+ name: "ratifierData",
3499
+ type: "bytes",
3500
+ },
3501
+ {
3502
+ internalType: "uint256",
3503
+ name: "units",
3504
+ type: "uint256",
3505
+ },
3506
+ ],
3507
+ internalType: "struct Take[]",
3508
+ name: "takes",
3509
+ type: "tuple[]",
3510
+ },
3511
+ {
3512
+ internalType: "uint256",
3513
+ name: "referralFeePct",
3514
+ type: "uint256",
3515
+ },
3516
+ {
3517
+ internalType: "address",
3518
+ name: "referralFeeRecipient",
3519
+ type: "address",
3520
+ },
3521
+ ],
3522
+ name: "supplyCollateralAndSellWithUnitsTarget",
3523
+ outputs: [],
3524
+ stateMutability: "nonpayable",
3525
+ type: "function",
3526
+ },
3527
+ ];
3528
+ /**
3529
+ * Pinned ABI JSON for the EcrecoverRatifier.
3530
+ *
3531
+ * Source: `morpho-org/midnight` commit `615fcfa12f725df3a16d65b2c2209272eff5bc10`,
3532
+ * `src/ratifiers/interfaces/IEcrecoverRatifier.sol`, Forge artifact `out/src/ratifiers/interfaces/IEcrecoverRatifier.sol/IEcrecoverRatifier.json`.
3533
+ *
3534
+ * @example
3535
+ * ```ts
3536
+ * import { ecrecoverRatifierAbi } from "@morpho-org/midnight-sdk";
3537
+ *
3538
+ * console.log(ecrecoverRatifierAbi.length);
3539
+ * ```
3540
+ */
3541
+ exports.ecrecoverRatifierAbi = [
3542
+ {
3543
+ inputs: [],
3544
+ name: "InvalidProof",
3545
+ type: "error",
3546
+ },
3547
+ {
3548
+ inputs: [],
3549
+ name: "InvalidSignature",
3550
+ type: "error",
3551
+ },
3552
+ {
3553
+ inputs: [],
3554
+ name: "RootCanceled",
3555
+ type: "error",
3556
+ },
3557
+ {
3558
+ inputs: [],
3559
+ name: "Unauthorized",
3560
+ type: "error",
3561
+ },
3562
+ {
3563
+ anonymous: false,
3564
+ inputs: [
3565
+ {
3566
+ indexed: true,
3567
+ internalType: "address",
3568
+ name: "caller",
3569
+ type: "address",
3570
+ },
3571
+ {
3572
+ indexed: true,
3573
+ internalType: "address",
3574
+ name: "maker",
3575
+ type: "address",
3576
+ },
3577
+ {
3578
+ indexed: true,
3579
+ internalType: "bytes32",
3580
+ name: "root",
3581
+ type: "bytes32",
3582
+ },
3583
+ ],
3584
+ name: "CancelRoot",
3585
+ type: "event",
3586
+ },
3587
+ {
3588
+ inputs: [],
3589
+ name: "MIDNIGHT",
3590
+ outputs: [
3591
+ {
3592
+ internalType: "address",
3593
+ name: "",
3594
+ type: "address",
3595
+ },
3596
+ ],
3597
+ stateMutability: "view",
3598
+ type: "function",
3599
+ },
3600
+ {
3601
+ inputs: [
3602
+ {
3603
+ internalType: "address",
3604
+ name: "maker",
3605
+ type: "address",
3606
+ },
3607
+ {
3608
+ internalType: "bytes32",
3609
+ name: "root",
3610
+ type: "bytes32",
3611
+ },
3612
+ ],
3613
+ name: "cancelRoot",
3614
+ outputs: [],
3615
+ stateMutability: "nonpayable",
3616
+ type: "function",
3617
+ },
3618
+ {
3619
+ inputs: [
3620
+ {
3621
+ components: [
3622
+ {
3623
+ components: [
3624
+ {
3625
+ internalType: "address",
3626
+ name: "loanToken",
3627
+ type: "address",
3628
+ },
3629
+ {
3630
+ components: [
3631
+ {
3632
+ internalType: "address",
3633
+ name: "token",
3634
+ type: "address",
3635
+ },
3636
+ {
3637
+ internalType: "uint256",
3638
+ name: "lltv",
3639
+ type: "uint256",
3640
+ },
3641
+ {
3642
+ internalType: "uint256",
3643
+ name: "maxLif",
3644
+ type: "uint256",
3645
+ },
3646
+ {
3647
+ internalType: "address",
3648
+ name: "oracle",
3649
+ type: "address",
3650
+ },
3651
+ ],
3652
+ internalType: "struct CollateralParams[]",
3653
+ name: "collateralParams",
3654
+ type: "tuple[]",
3655
+ },
3656
+ {
3657
+ internalType: "uint256",
3658
+ name: "maturity",
3659
+ type: "uint256",
3660
+ },
3661
+ {
3662
+ internalType: "uint256",
3663
+ name: "rcfThreshold",
3664
+ type: "uint256",
3665
+ },
3666
+ {
3667
+ internalType: "address",
3668
+ name: "enterGate",
3669
+ type: "address",
3670
+ },
3671
+ {
3672
+ internalType: "address",
3673
+ name: "liquidatorGate",
3674
+ type: "address",
3675
+ },
3676
+ ],
3677
+ internalType: "struct Market",
3678
+ name: "market",
3679
+ type: "tuple",
3680
+ },
3681
+ {
3682
+ internalType: "bool",
3683
+ name: "buy",
3684
+ type: "bool",
3685
+ },
3686
+ {
3687
+ internalType: "address",
3688
+ name: "maker",
3689
+ type: "address",
3690
+ },
3691
+ {
3692
+ internalType: "uint256",
3693
+ name: "start",
3694
+ type: "uint256",
3695
+ },
3696
+ {
3697
+ internalType: "uint256",
3698
+ name: "expiry",
3699
+ type: "uint256",
3700
+ },
3701
+ {
3702
+ internalType: "uint256",
3703
+ name: "tick",
3704
+ type: "uint256",
3705
+ },
3706
+ {
3707
+ internalType: "bytes32",
3708
+ name: "group",
3709
+ type: "bytes32",
3710
+ },
3711
+ {
3712
+ internalType: "address",
3713
+ name: "callback",
3714
+ type: "address",
3715
+ },
3716
+ {
3717
+ internalType: "bytes",
3718
+ name: "callbackData",
3719
+ type: "bytes",
3720
+ },
3721
+ {
3722
+ internalType: "address",
3723
+ name: "receiverIfMakerIsSeller",
3724
+ type: "address",
3725
+ },
3726
+ {
3727
+ internalType: "address",
3728
+ name: "ratifier",
3729
+ type: "address",
3730
+ },
3731
+ {
3732
+ internalType: "bool",
3733
+ name: "reduceOnly",
3734
+ type: "bool",
3735
+ },
3736
+ {
3737
+ internalType: "uint256",
3738
+ name: "maxUnits",
3739
+ type: "uint256",
3740
+ },
3741
+ {
3742
+ internalType: "uint256",
3743
+ name: "maxAssets",
3744
+ type: "uint256",
3745
+ },
3746
+ {
3747
+ internalType: "uint256",
3748
+ name: "continuousFeeCap",
3749
+ type: "uint256",
3750
+ },
3751
+ ],
3752
+ internalType: "struct Offer",
3753
+ name: "offer",
3754
+ type: "tuple",
3755
+ },
3756
+ {
3757
+ internalType: "bytes",
3758
+ name: "ratifierData",
3759
+ type: "bytes",
3760
+ },
3761
+ ],
3762
+ name: "isRatified",
3763
+ outputs: [
3764
+ {
3765
+ internalType: "bytes32",
3766
+ name: "",
3767
+ type: "bytes32",
3768
+ },
3769
+ ],
3770
+ stateMutability: "view",
3771
+ type: "function",
3772
+ },
3773
+ {
3774
+ inputs: [
3775
+ {
3776
+ internalType: "address",
3777
+ name: "maker",
3778
+ type: "address",
3779
+ },
3780
+ {
3781
+ internalType: "bytes32",
3782
+ name: "root",
3783
+ type: "bytes32",
3784
+ },
3785
+ ],
3786
+ name: "isRootCanceled",
3787
+ outputs: [
3788
+ {
3789
+ internalType: "bool",
3790
+ name: "",
3791
+ type: "bool",
3792
+ },
3793
+ ],
3794
+ stateMutability: "view",
3795
+ type: "function",
3796
+ },
3797
+ ];
3798
+ /**
3799
+ * Pinned ABI JSON for the SetterRatifier.
3800
+ *
3801
+ * Source: `morpho-org/midnight` commit `615fcfa12f725df3a16d65b2c2209272eff5bc10`,
3802
+ * `src/ratifiers/interfaces/ISetterRatifier.sol`, Forge artifact `out/src/ratifiers/interfaces/ISetterRatifier.sol/ISetterRatifier.json`.
3803
+ *
3804
+ * @example
3805
+ * ```ts
3806
+ * import { setterRatifierAbi } from "@morpho-org/midnight-sdk";
3807
+ *
3808
+ * console.log(setterRatifierAbi.length);
3809
+ * ```
3810
+ */
3811
+ exports.setterRatifierAbi = [
3812
+ {
3813
+ inputs: [],
3814
+ name: "InvalidProof",
3815
+ type: "error",
3816
+ },
3817
+ {
3818
+ inputs: [],
3819
+ name: "NotRatified",
3820
+ type: "error",
3821
+ },
3822
+ {
3823
+ inputs: [],
3824
+ name: "Unauthorized",
3825
+ type: "error",
3826
+ },
3827
+ {
3828
+ anonymous: false,
3829
+ inputs: [
3830
+ {
3831
+ indexed: true,
3832
+ internalType: "address",
3833
+ name: "caller",
3834
+ type: "address",
3835
+ },
3836
+ {
3837
+ indexed: true,
3838
+ internalType: "address",
3839
+ name: "maker",
3840
+ type: "address",
3841
+ },
3842
+ {
3843
+ indexed: true,
3844
+ internalType: "bytes32",
3845
+ name: "root",
3846
+ type: "bytes32",
3847
+ },
3848
+ {
3849
+ indexed: false,
3850
+ internalType: "bool",
3851
+ name: "newIsRootRatified",
3852
+ type: "bool",
3853
+ },
3854
+ ],
3855
+ name: "SetIsRootRatified",
3856
+ type: "event",
3857
+ },
3858
+ {
3859
+ inputs: [],
3860
+ name: "MIDNIGHT",
3861
+ outputs: [
3862
+ {
3863
+ internalType: "address",
3864
+ name: "",
3865
+ type: "address",
3866
+ },
3867
+ ],
3868
+ stateMutability: "view",
3869
+ type: "function",
3870
+ },
3871
+ {
3872
+ inputs: [
3873
+ {
3874
+ components: [
3875
+ {
3876
+ components: [
3877
+ {
3878
+ internalType: "address",
3879
+ name: "loanToken",
3880
+ type: "address",
3881
+ },
3882
+ {
3883
+ components: [
3884
+ {
3885
+ internalType: "address",
3886
+ name: "token",
3887
+ type: "address",
3888
+ },
3889
+ {
3890
+ internalType: "uint256",
3891
+ name: "lltv",
3892
+ type: "uint256",
3893
+ },
3894
+ {
3895
+ internalType: "uint256",
3896
+ name: "maxLif",
3897
+ type: "uint256",
3898
+ },
3899
+ {
3900
+ internalType: "address",
3901
+ name: "oracle",
3902
+ type: "address",
3903
+ },
3904
+ ],
3905
+ internalType: "struct CollateralParams[]",
3906
+ name: "collateralParams",
3907
+ type: "tuple[]",
3908
+ },
3909
+ {
3910
+ internalType: "uint256",
3911
+ name: "maturity",
3912
+ type: "uint256",
3913
+ },
3914
+ {
3915
+ internalType: "uint256",
3916
+ name: "rcfThreshold",
3917
+ type: "uint256",
3918
+ },
3919
+ {
3920
+ internalType: "address",
3921
+ name: "enterGate",
3922
+ type: "address",
3923
+ },
3924
+ {
3925
+ internalType: "address",
3926
+ name: "liquidatorGate",
3927
+ type: "address",
3928
+ },
3929
+ ],
3930
+ internalType: "struct Market",
3931
+ name: "market",
3932
+ type: "tuple",
3933
+ },
3934
+ {
3935
+ internalType: "bool",
3936
+ name: "buy",
3937
+ type: "bool",
3938
+ },
3939
+ {
3940
+ internalType: "address",
3941
+ name: "maker",
3942
+ type: "address",
3943
+ },
3944
+ {
3945
+ internalType: "uint256",
3946
+ name: "start",
3947
+ type: "uint256",
3948
+ },
3949
+ {
3950
+ internalType: "uint256",
3951
+ name: "expiry",
3952
+ type: "uint256",
3953
+ },
3954
+ {
3955
+ internalType: "uint256",
3956
+ name: "tick",
3957
+ type: "uint256",
3958
+ },
3959
+ {
3960
+ internalType: "bytes32",
3961
+ name: "group",
3962
+ type: "bytes32",
3963
+ },
3964
+ {
3965
+ internalType: "address",
3966
+ name: "callback",
3967
+ type: "address",
3968
+ },
3969
+ {
3970
+ internalType: "bytes",
3971
+ name: "callbackData",
3972
+ type: "bytes",
3973
+ },
3974
+ {
3975
+ internalType: "address",
3976
+ name: "receiverIfMakerIsSeller",
3977
+ type: "address",
3978
+ },
3979
+ {
3980
+ internalType: "address",
3981
+ name: "ratifier",
3982
+ type: "address",
3983
+ },
3984
+ {
3985
+ internalType: "bool",
3986
+ name: "reduceOnly",
3987
+ type: "bool",
3988
+ },
3989
+ {
3990
+ internalType: "uint256",
3991
+ name: "maxUnits",
3992
+ type: "uint256",
3993
+ },
3994
+ {
3995
+ internalType: "uint256",
3996
+ name: "maxAssets",
3997
+ type: "uint256",
3998
+ },
3999
+ {
4000
+ internalType: "uint256",
4001
+ name: "continuousFeeCap",
4002
+ type: "uint256",
4003
+ },
4004
+ ],
4005
+ internalType: "struct Offer",
4006
+ name: "offer",
4007
+ type: "tuple",
4008
+ },
4009
+ {
4010
+ internalType: "bytes",
4011
+ name: "ratifierData",
4012
+ type: "bytes",
4013
+ },
4014
+ ],
4015
+ name: "isRatified",
4016
+ outputs: [
4017
+ {
4018
+ internalType: "bytes32",
4019
+ name: "",
4020
+ type: "bytes32",
4021
+ },
4022
+ ],
4023
+ stateMutability: "view",
4024
+ type: "function",
4025
+ },
4026
+ {
4027
+ inputs: [
4028
+ {
4029
+ internalType: "address",
4030
+ name: "maker",
4031
+ type: "address",
4032
+ },
4033
+ {
4034
+ internalType: "bytes32",
4035
+ name: "root",
4036
+ type: "bytes32",
4037
+ },
4038
+ ],
4039
+ name: "isRootRatified",
4040
+ outputs: [
4041
+ {
4042
+ internalType: "bool",
4043
+ name: "",
4044
+ type: "bool",
4045
+ },
4046
+ ],
4047
+ stateMutability: "view",
4048
+ type: "function",
4049
+ },
4050
+ {
4051
+ inputs: [
4052
+ {
4053
+ internalType: "address",
4054
+ name: "maker",
4055
+ type: "address",
4056
+ },
4057
+ {
4058
+ internalType: "bytes32",
4059
+ name: "root",
4060
+ type: "bytes32",
4061
+ },
4062
+ {
4063
+ internalType: "bool",
4064
+ name: "newIsRootRatified",
4065
+ type: "bool",
4066
+ },
4067
+ ],
4068
+ name: "setIsRootRatified",
4069
+ outputs: [],
4070
+ stateMutability: "nonpayable",
4071
+ type: "function",
4072
+ },
4073
+ ];