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