@morpho-dev/router 0.11.0 → 0.12.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.
- package/README.md +20 -5
- package/dist/cli.js +11700 -6794
- package/dist/drizzle/migrations/0034_chain-checkpoints.sql +1 -0
- package/dist/drizzle/migrations/0035_chain-tip-hash-cas.sql +1 -0
- package/dist/drizzle/migrations/0036_pending-links.sql +22 -0
- package/dist/drizzle/migrations/0037_chain-finalized-anchor.sql +2 -0
- package/dist/drizzle/migrations/0038_add-obligation-rcf-threshold.sql +2 -0
- package/dist/drizzle/migrations/0039_add-offers-composite-indexes.sql +2 -0
- package/dist/drizzle/migrations/0040_drop-redundant-offers-indexes.sql +2 -0
- package/dist/drizzle/migrations/0041_add-group-winner-expression-index.sql +10 -0
- package/dist/drizzle/migrations/0042_contract-sync-v1.14.sql +284 -0
- package/dist/drizzle/migrations/0043_add-obligation-side-tick-index.sql +1 -0
- package/dist/drizzle/migrations/0044_index-audit-cleanup.sql +27 -0
- package/dist/drizzle/migrations/0045_add-lots-offsets-availability-indexes.sql +5 -0
- package/dist/drizzle/migrations/0046_add-offers-active-tick-index.sql +1 -0
- package/dist/drizzle/migrations/0047_add-offers-book-winners-index.sql +1 -0
- package/dist/drizzle/migrations/0048_covering-indexes-for-winners-queries.sql +34 -0
- package/dist/drizzle/migrations/0049_contract-sync-v1.15.sql +305 -0
- package/dist/drizzle/migrations/meta/0036_snapshot.json +1864 -0
- package/dist/drizzle/migrations/meta/0037_snapshot.json +1876 -0
- package/dist/drizzle/migrations/meta/0038_snapshot.json +1882 -0
- package/dist/drizzle/migrations/meta/0039_snapshot.json +1960 -0
- package/dist/drizzle/migrations/meta/0040_snapshot.json +1912 -0
- package/dist/drizzle/migrations/meta/0041_snapshot.json +1912 -0
- package/dist/drizzle/migrations/meta/0042_snapshot.json +1882 -0
- package/dist/drizzle/migrations/meta/0043_snapshot.json +1909 -0
- package/dist/drizzle/migrations/meta/0044_snapshot.json +1853 -0
- package/dist/drizzle/migrations/meta/0045_snapshot.json +1921 -0
- package/dist/drizzle/migrations/meta/0046_snapshot.json +1966 -0
- package/dist/drizzle/migrations/meta/0047_snapshot.json +2005 -0
- package/dist/drizzle/migrations/meta/0048_snapshot.json +2035 -0
- package/dist/drizzle/migrations/meta/0049_snapshot.json +2035 -0
- package/dist/drizzle/migrations/meta/_journal.json +112 -0
- package/dist/evm/bytecode/morpho.txt +1 -1
- package/dist/index.browser.d.mts +587 -271
- package/dist/index.browser.d.mts.map +1 -1
- package/dist/index.browser.mjs +656 -419
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +1454 -583
- package/dist/index.node.d.mts.map +1 -1
- package/dist/index.node.mjs +9064 -5228
- package/dist/index.node.mjs.map +1 -1
- package/dist/server-D4xxddev.js +9573 -0
- package/dist/server.js +9617 -0
- package/docs/integrator.md +14 -24
- package/package.json +7 -4
package/dist/index.browser.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import * as z$1 from "zod";
|
|
|
5
5
|
import { Client } from "openapi-fetch";
|
|
6
6
|
import { AbiEvent, Address, ChainContract, ChainFormatters, GetLogsReturnType, Hex, MulticallParameters, PublicClient, Transport, WalletClient } from "viem";
|
|
7
7
|
import { Chain } from "viem/chains";
|
|
8
|
-
import {
|
|
8
|
+
import { SimpleMerkleTree } from "@openzeppelin/merkle-tree";
|
|
9
9
|
import "@electric-sql/pglite";
|
|
10
10
|
import "drizzle-orm/node-postgres";
|
|
11
11
|
import "drizzle-orm/pglite";
|
|
@@ -18,12 +18,12 @@ declare namespace BookResponse_d_exports {
|
|
|
18
18
|
type BookLevelResponse = {
|
|
19
19
|
tick: number;
|
|
20
20
|
price: string;
|
|
21
|
-
|
|
21
|
+
obligation_units: string;
|
|
22
22
|
count: number;
|
|
23
23
|
};
|
|
24
24
|
type Input$1 = {
|
|
25
25
|
tick: number;
|
|
26
|
-
|
|
26
|
+
obligationUnits: bigint;
|
|
27
27
|
count: number;
|
|
28
28
|
};
|
|
29
29
|
declare function from$15(level: Input$1): BookLevelResponse;
|
|
@@ -36,9 +36,9 @@ declare const CollectorHealth: z.ZodObject<{
|
|
|
36
36
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
37
37
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
38
38
|
status: z.ZodEnum<{
|
|
39
|
-
unknown: "unknown";
|
|
40
39
|
live: "live";
|
|
41
40
|
lagging: "lagging";
|
|
41
|
+
unknown: "unknown";
|
|
42
42
|
}>;
|
|
43
43
|
initialized: z.ZodBoolean;
|
|
44
44
|
}, z.core.$strip>;
|
|
@@ -49,9 +49,9 @@ declare const CollectorsHealthResponse: z.ZodArray<z.ZodObject<{
|
|
|
49
49
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
50
50
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
51
51
|
status: z.ZodEnum<{
|
|
52
|
-
unknown: "unknown";
|
|
53
52
|
live: "live";
|
|
54
53
|
lagging: "lagging";
|
|
54
|
+
unknown: "unknown";
|
|
55
55
|
}>;
|
|
56
56
|
initialized: z.ZodBoolean;
|
|
57
57
|
}, z.core.$strip>>;
|
|
@@ -229,34 +229,36 @@ declare const MorphoV2: readonly [{
|
|
|
229
229
|
readonly stateMutability: "nonpayable";
|
|
230
230
|
readonly inputs: readonly [];
|
|
231
231
|
}, {
|
|
232
|
-
readonly name: "
|
|
232
|
+
readonly name: "activatedCollaterals";
|
|
233
233
|
readonly type: "function";
|
|
234
234
|
readonly stateMutability: "view";
|
|
235
235
|
readonly inputs: readonly [{
|
|
236
|
-
readonly type: "
|
|
236
|
+
readonly type: "bytes32";
|
|
237
237
|
readonly name: "id";
|
|
238
238
|
}, {
|
|
239
239
|
readonly type: "address";
|
|
240
240
|
readonly name: "user";
|
|
241
|
-
}, {
|
|
242
|
-
readonly type: "uint256";
|
|
243
|
-
readonly name: "collateralIndex";
|
|
244
241
|
}];
|
|
245
242
|
readonly outputs: readonly [{
|
|
246
243
|
readonly type: "uint128";
|
|
247
244
|
}];
|
|
248
245
|
}, {
|
|
249
|
-
readonly name: "
|
|
246
|
+
readonly name: "collateralOf";
|
|
250
247
|
readonly type: "function";
|
|
251
|
-
readonly stateMutability: "
|
|
248
|
+
readonly stateMutability: "view";
|
|
252
249
|
readonly inputs: readonly [{
|
|
253
250
|
readonly type: "bytes32";
|
|
254
|
-
readonly name: "
|
|
251
|
+
readonly name: "id";
|
|
252
|
+
}, {
|
|
253
|
+
readonly type: "address";
|
|
254
|
+
readonly name: "user";
|
|
255
255
|
}, {
|
|
256
256
|
readonly type: "uint256";
|
|
257
|
-
readonly name: "
|
|
257
|
+
readonly name: "index";
|
|
258
|
+
}];
|
|
259
|
+
readonly outputs: readonly [{
|
|
260
|
+
readonly type: "uint128";
|
|
258
261
|
}];
|
|
259
|
-
readonly outputs: readonly [];
|
|
260
262
|
}, {
|
|
261
263
|
readonly name: "consumed";
|
|
262
264
|
readonly type: "function";
|
|
@@ -271,12 +273,40 @@ declare const MorphoV2: readonly [{
|
|
|
271
273
|
readonly outputs: readonly [{
|
|
272
274
|
readonly type: "uint256";
|
|
273
275
|
}];
|
|
276
|
+
}, {
|
|
277
|
+
readonly name: "creditAfterSlashing";
|
|
278
|
+
readonly type: "function";
|
|
279
|
+
readonly stateMutability: "view";
|
|
280
|
+
readonly inputs: readonly [{
|
|
281
|
+
readonly type: "bytes32";
|
|
282
|
+
readonly name: "id";
|
|
283
|
+
}, {
|
|
284
|
+
readonly type: "address";
|
|
285
|
+
readonly name: "user";
|
|
286
|
+
}];
|
|
287
|
+
readonly outputs: readonly [{
|
|
288
|
+
readonly type: "uint256";
|
|
289
|
+
}];
|
|
290
|
+
}, {
|
|
291
|
+
readonly name: "creditOf";
|
|
292
|
+
readonly type: "function";
|
|
293
|
+
readonly stateMutability: "view";
|
|
294
|
+
readonly inputs: readonly [{
|
|
295
|
+
readonly type: "bytes32";
|
|
296
|
+
readonly name: "id";
|
|
297
|
+
}, {
|
|
298
|
+
readonly type: "address";
|
|
299
|
+
readonly name: "user";
|
|
300
|
+
}];
|
|
301
|
+
readonly outputs: readonly [{
|
|
302
|
+
readonly type: "uint256";
|
|
303
|
+
}];
|
|
274
304
|
}, {
|
|
275
305
|
readonly name: "debtOf";
|
|
276
306
|
readonly type: "function";
|
|
277
307
|
readonly stateMutability: "view";
|
|
278
308
|
readonly inputs: readonly [{
|
|
279
|
-
readonly type: "
|
|
309
|
+
readonly type: "bytes32";
|
|
280
310
|
readonly name: "id";
|
|
281
311
|
}, {
|
|
282
312
|
readonly type: "address";
|
|
@@ -294,7 +324,6 @@ declare const MorphoV2: readonly [{
|
|
|
294
324
|
readonly name: "loanToken";
|
|
295
325
|
}, {
|
|
296
326
|
readonly type: "uint256";
|
|
297
|
-
readonly name: "index";
|
|
298
327
|
}];
|
|
299
328
|
readonly outputs: readonly [{
|
|
300
329
|
readonly type: "uint16";
|
|
@@ -312,11 +341,11 @@ declare const MorphoV2: readonly [{
|
|
|
312
341
|
readonly type: "function";
|
|
313
342
|
readonly stateMutability: "view";
|
|
314
343
|
readonly inputs: readonly [{
|
|
315
|
-
readonly type: "
|
|
344
|
+
readonly type: "bytes32";
|
|
316
345
|
readonly name: "id";
|
|
317
346
|
}];
|
|
318
347
|
readonly outputs: readonly [{
|
|
319
|
-
readonly type: "uint16[
|
|
348
|
+
readonly type: "uint16[7]";
|
|
320
349
|
}];
|
|
321
350
|
}, {
|
|
322
351
|
readonly name: "flashLoan";
|
|
@@ -336,6 +365,20 @@ declare const MorphoV2: readonly [{
|
|
|
336
365
|
readonly name: "data";
|
|
337
366
|
}];
|
|
338
367
|
readonly outputs: readonly [];
|
|
368
|
+
}, {
|
|
369
|
+
readonly name: "isAuthorized";
|
|
370
|
+
readonly type: "function";
|
|
371
|
+
readonly stateMutability: "view";
|
|
372
|
+
readonly inputs: readonly [{
|
|
373
|
+
readonly type: "address";
|
|
374
|
+
readonly name: "authorizer";
|
|
375
|
+
}, {
|
|
376
|
+
readonly type: "address";
|
|
377
|
+
readonly name: "authorized";
|
|
378
|
+
}];
|
|
379
|
+
readonly outputs: readonly [{
|
|
380
|
+
readonly type: "bool";
|
|
381
|
+
}];
|
|
339
382
|
}, {
|
|
340
383
|
readonly name: "isHealthy";
|
|
341
384
|
readonly type: "function";
|
|
@@ -353,6 +396,9 @@ declare const MorphoV2: readonly [{
|
|
|
353
396
|
}, {
|
|
354
397
|
readonly type: "uint256";
|
|
355
398
|
readonly name: "lltv";
|
|
399
|
+
}, {
|
|
400
|
+
readonly type: "uint256";
|
|
401
|
+
readonly name: "maxLif";
|
|
356
402
|
}, {
|
|
357
403
|
readonly type: "address";
|
|
358
404
|
readonly name: "oracle";
|
|
@@ -363,11 +409,11 @@ declare const MorphoV2: readonly [{
|
|
|
363
409
|
readonly name: "maturity";
|
|
364
410
|
}, {
|
|
365
411
|
readonly type: "uint256";
|
|
366
|
-
readonly name: "
|
|
412
|
+
readonly name: "rcfThreshold";
|
|
367
413
|
}];
|
|
368
414
|
readonly name: "obligation";
|
|
369
415
|
}, {
|
|
370
|
-
readonly type: "
|
|
416
|
+
readonly type: "bytes32";
|
|
371
417
|
readonly name: "id";
|
|
372
418
|
}, {
|
|
373
419
|
readonly type: "address";
|
|
@@ -393,6 +439,9 @@ declare const MorphoV2: readonly [{
|
|
|
393
439
|
}, {
|
|
394
440
|
readonly type: "uint256";
|
|
395
441
|
readonly name: "lltv";
|
|
442
|
+
}, {
|
|
443
|
+
readonly type: "uint256";
|
|
444
|
+
readonly name: "maxLif";
|
|
396
445
|
}, {
|
|
397
446
|
readonly type: "address";
|
|
398
447
|
readonly name: "oracle";
|
|
@@ -403,7 +452,7 @@ declare const MorphoV2: readonly [{
|
|
|
403
452
|
readonly name: "maturity";
|
|
404
453
|
}, {
|
|
405
454
|
readonly type: "uint256";
|
|
406
|
-
readonly name: "
|
|
455
|
+
readonly name: "rcfThreshold";
|
|
407
456
|
}];
|
|
408
457
|
readonly name: "obligation";
|
|
409
458
|
}, {
|
|
@@ -427,6 +476,64 @@ declare const MorphoV2: readonly [{
|
|
|
427
476
|
}, {
|
|
428
477
|
readonly type: "uint256";
|
|
429
478
|
}];
|
|
479
|
+
}, {
|
|
480
|
+
readonly name: "maxCollateralPerUser";
|
|
481
|
+
readonly type: "function";
|
|
482
|
+
readonly stateMutability: "view";
|
|
483
|
+
readonly inputs: readonly [{
|
|
484
|
+
readonly type: "address";
|
|
485
|
+
readonly name: "collateralToken";
|
|
486
|
+
}];
|
|
487
|
+
readonly outputs: readonly [{
|
|
488
|
+
readonly type: "uint256";
|
|
489
|
+
}];
|
|
490
|
+
}, {
|
|
491
|
+
readonly name: "maxLif";
|
|
492
|
+
readonly type: "function";
|
|
493
|
+
readonly stateMutability: "pure";
|
|
494
|
+
readonly inputs: readonly [{
|
|
495
|
+
readonly type: "uint256";
|
|
496
|
+
readonly name: "lltv";
|
|
497
|
+
}, {
|
|
498
|
+
readonly type: "uint256";
|
|
499
|
+
readonly name: "cursor";
|
|
500
|
+
}];
|
|
501
|
+
readonly outputs: readonly [{
|
|
502
|
+
readonly type: "uint256";
|
|
503
|
+
}];
|
|
504
|
+
}, {
|
|
505
|
+
readonly name: "maxTakeableAssets";
|
|
506
|
+
readonly type: "function";
|
|
507
|
+
readonly stateMutability: "view";
|
|
508
|
+
readonly inputs: readonly [{
|
|
509
|
+
readonly type: "address";
|
|
510
|
+
readonly name: "loanToken";
|
|
511
|
+
}];
|
|
512
|
+
readonly outputs: readonly [{
|
|
513
|
+
readonly type: "uint256";
|
|
514
|
+
}];
|
|
515
|
+
}, {
|
|
516
|
+
readonly name: "maxTotalUnits";
|
|
517
|
+
readonly type: "function";
|
|
518
|
+
readonly stateMutability: "view";
|
|
519
|
+
readonly inputs: readonly [{
|
|
520
|
+
readonly type: "address";
|
|
521
|
+
readonly name: "loanToken";
|
|
522
|
+
}];
|
|
523
|
+
readonly outputs: readonly [{
|
|
524
|
+
readonly type: "uint128";
|
|
525
|
+
}];
|
|
526
|
+
}, {
|
|
527
|
+
readonly name: "maxTradingFee";
|
|
528
|
+
readonly type: "function";
|
|
529
|
+
readonly stateMutability: "pure";
|
|
530
|
+
readonly inputs: readonly [{
|
|
531
|
+
readonly type: "uint256";
|
|
532
|
+
readonly name: "index";
|
|
533
|
+
}];
|
|
534
|
+
readonly outputs: readonly [{
|
|
535
|
+
readonly type: "uint256";
|
|
536
|
+
}];
|
|
430
537
|
}, {
|
|
431
538
|
readonly name: "multicall";
|
|
432
539
|
readonly type: "function";
|
|
@@ -441,7 +548,7 @@ declare const MorphoV2: readonly [{
|
|
|
441
548
|
readonly type: "function";
|
|
442
549
|
readonly stateMutability: "view";
|
|
443
550
|
readonly inputs: readonly [{
|
|
444
|
-
readonly type: "
|
|
551
|
+
readonly type: "bytes32";
|
|
445
552
|
readonly name: "id";
|
|
446
553
|
}];
|
|
447
554
|
readonly outputs: readonly [{
|
|
@@ -452,24 +559,21 @@ declare const MorphoV2: readonly [{
|
|
|
452
559
|
readonly type: "function";
|
|
453
560
|
readonly stateMutability: "view";
|
|
454
561
|
readonly inputs: readonly [{
|
|
455
|
-
readonly type: "
|
|
562
|
+
readonly type: "bytes32";
|
|
456
563
|
readonly name: "id";
|
|
457
564
|
}];
|
|
458
565
|
readonly outputs: readonly [{
|
|
459
566
|
readonly type: "uint128";
|
|
460
567
|
readonly name: "totalUnits";
|
|
461
|
-
}, {
|
|
462
|
-
readonly type: "uint128";
|
|
463
|
-
readonly name: "totalShares";
|
|
464
568
|
}, {
|
|
465
569
|
readonly type: "uint256";
|
|
466
570
|
readonly name: "withdrawable";
|
|
571
|
+
}, {
|
|
572
|
+
readonly type: "uint128";
|
|
573
|
+
readonly name: "lossIndex";
|
|
467
574
|
}, {
|
|
468
575
|
readonly type: "bool";
|
|
469
576
|
readonly name: "created";
|
|
470
|
-
}, {
|
|
471
|
-
readonly type: "uint16[6]";
|
|
472
|
-
readonly name: "fees";
|
|
473
577
|
}];
|
|
474
578
|
}, {
|
|
475
579
|
readonly name: "owner";
|
|
@@ -496,6 +600,9 @@ declare const MorphoV2: readonly [{
|
|
|
496
600
|
}, {
|
|
497
601
|
readonly type: "uint256";
|
|
498
602
|
readonly name: "lltv";
|
|
603
|
+
}, {
|
|
604
|
+
readonly type: "uint256";
|
|
605
|
+
readonly name: "maxLif";
|
|
499
606
|
}, {
|
|
500
607
|
readonly type: "address";
|
|
501
608
|
readonly name: "oracle";
|
|
@@ -506,7 +613,7 @@ declare const MorphoV2: readonly [{
|
|
|
506
613
|
readonly name: "maturity";
|
|
507
614
|
}, {
|
|
508
615
|
readonly type: "uint256";
|
|
509
|
-
readonly name: "
|
|
616
|
+
readonly name: "rcfThreshold";
|
|
510
617
|
}];
|
|
511
618
|
readonly name: "obligation";
|
|
512
619
|
}, {
|
|
@@ -528,6 +635,21 @@ declare const MorphoV2: readonly [{
|
|
|
528
635
|
readonly outputs: readonly [{
|
|
529
636
|
readonly type: "bytes32";
|
|
530
637
|
}];
|
|
638
|
+
}, {
|
|
639
|
+
readonly name: "setConsumed";
|
|
640
|
+
readonly type: "function";
|
|
641
|
+
readonly stateMutability: "nonpayable";
|
|
642
|
+
readonly inputs: readonly [{
|
|
643
|
+
readonly type: "bytes32";
|
|
644
|
+
readonly name: "group";
|
|
645
|
+
}, {
|
|
646
|
+
readonly type: "uint256";
|
|
647
|
+
readonly name: "amount";
|
|
648
|
+
}, {
|
|
649
|
+
readonly type: "address";
|
|
650
|
+
readonly name: "onBehalf";
|
|
651
|
+
}];
|
|
652
|
+
readonly outputs: readonly [];
|
|
531
653
|
}, {
|
|
532
654
|
readonly name: "setDefaultTradingFee";
|
|
533
655
|
readonly type: "function";
|
|
@@ -552,12 +674,63 @@ declare const MorphoV2: readonly [{
|
|
|
552
674
|
readonly name: "newFeeSetter";
|
|
553
675
|
}];
|
|
554
676
|
readonly outputs: readonly [];
|
|
677
|
+
}, {
|
|
678
|
+
readonly name: "setIsAuthorized";
|
|
679
|
+
readonly type: "function";
|
|
680
|
+
readonly stateMutability: "nonpayable";
|
|
681
|
+
readonly inputs: readonly [{
|
|
682
|
+
readonly type: "address";
|
|
683
|
+
readonly name: "onBehalf";
|
|
684
|
+
}, {
|
|
685
|
+
readonly type: "address";
|
|
686
|
+
readonly name: "authorized";
|
|
687
|
+
}, {
|
|
688
|
+
readonly type: "bool";
|
|
689
|
+
readonly name: "newIsAuthorized";
|
|
690
|
+
}];
|
|
691
|
+
readonly outputs: readonly [];
|
|
692
|
+
}, {
|
|
693
|
+
readonly name: "setMaxCollateralPerUser";
|
|
694
|
+
readonly type: "function";
|
|
695
|
+
readonly stateMutability: "nonpayable";
|
|
696
|
+
readonly inputs: readonly [{
|
|
697
|
+
readonly type: "address";
|
|
698
|
+
readonly name: "collateralToken";
|
|
699
|
+
}, {
|
|
700
|
+
readonly type: "uint256";
|
|
701
|
+
readonly name: "newMaxCollateralPerUser";
|
|
702
|
+
}];
|
|
703
|
+
readonly outputs: readonly [];
|
|
704
|
+
}, {
|
|
705
|
+
readonly name: "setMaxTakeableAssets";
|
|
706
|
+
readonly type: "function";
|
|
707
|
+
readonly stateMutability: "nonpayable";
|
|
708
|
+
readonly inputs: readonly [{
|
|
709
|
+
readonly type: "address";
|
|
710
|
+
readonly name: "loanToken";
|
|
711
|
+
}, {
|
|
712
|
+
readonly type: "uint256";
|
|
713
|
+
readonly name: "newMaxTakeableAssets";
|
|
714
|
+
}];
|
|
715
|
+
readonly outputs: readonly [];
|
|
716
|
+
}, {
|
|
717
|
+
readonly name: "setMaxTotalUnits";
|
|
718
|
+
readonly type: "function";
|
|
719
|
+
readonly stateMutability: "nonpayable";
|
|
720
|
+
readonly inputs: readonly [{
|
|
721
|
+
readonly type: "address";
|
|
722
|
+
readonly name: "loanToken";
|
|
723
|
+
}, {
|
|
724
|
+
readonly type: "uint128";
|
|
725
|
+
readonly name: "newMaxTotalUnits";
|
|
726
|
+
}];
|
|
727
|
+
readonly outputs: readonly [];
|
|
555
728
|
}, {
|
|
556
729
|
readonly name: "setObligationTradingFee";
|
|
557
730
|
readonly type: "function";
|
|
558
731
|
readonly stateMutability: "nonpayable";
|
|
559
732
|
readonly inputs: readonly [{
|
|
560
|
-
readonly type: "
|
|
733
|
+
readonly type: "bytes32";
|
|
561
734
|
readonly name: "id";
|
|
562
735
|
}, {
|
|
563
736
|
readonly type: "uint256";
|
|
@@ -586,24 +759,25 @@ declare const MorphoV2: readonly [{
|
|
|
586
759
|
}];
|
|
587
760
|
readonly outputs: readonly [];
|
|
588
761
|
}, {
|
|
589
|
-
readonly name: "
|
|
762
|
+
readonly name: "shuffleSession";
|
|
590
763
|
readonly type: "function";
|
|
591
|
-
readonly stateMutability: "
|
|
764
|
+
readonly stateMutability: "nonpayable";
|
|
592
765
|
readonly inputs: readonly [{
|
|
593
|
-
readonly type: "bytes20";
|
|
594
|
-
readonly name: "id";
|
|
595
|
-
}, {
|
|
596
766
|
readonly type: "address";
|
|
597
|
-
readonly name: "
|
|
598
|
-
}];
|
|
599
|
-
readonly outputs: readonly [{
|
|
600
|
-
readonly type: "uint256";
|
|
767
|
+
readonly name: "onBehalf";
|
|
601
768
|
}];
|
|
769
|
+
readonly outputs: readonly [];
|
|
602
770
|
}, {
|
|
603
|
-
readonly name: "
|
|
771
|
+
readonly name: "slash";
|
|
604
772
|
readonly type: "function";
|
|
605
773
|
readonly stateMutability: "nonpayable";
|
|
606
|
-
readonly inputs: readonly [
|
|
774
|
+
readonly inputs: readonly [{
|
|
775
|
+
readonly type: "bytes32";
|
|
776
|
+
readonly name: "id";
|
|
777
|
+
}, {
|
|
778
|
+
readonly type: "address";
|
|
779
|
+
readonly name: "user";
|
|
780
|
+
}];
|
|
607
781
|
readonly outputs: readonly [];
|
|
608
782
|
}, {
|
|
609
783
|
readonly name: "supplyCollateral";
|
|
@@ -622,6 +796,9 @@ declare const MorphoV2: readonly [{
|
|
|
622
796
|
}, {
|
|
623
797
|
readonly type: "uint256";
|
|
624
798
|
readonly name: "lltv";
|
|
799
|
+
}, {
|
|
800
|
+
readonly type: "uint256";
|
|
801
|
+
readonly name: "maxLif";
|
|
625
802
|
}, {
|
|
626
803
|
readonly type: "address";
|
|
627
804
|
readonly name: "oracle";
|
|
@@ -632,7 +809,7 @@ declare const MorphoV2: readonly [{
|
|
|
632
809
|
readonly name: "maturity";
|
|
633
810
|
}, {
|
|
634
811
|
readonly type: "uint256";
|
|
635
|
-
readonly name: "
|
|
812
|
+
readonly name: "rcfThreshold";
|
|
636
813
|
}];
|
|
637
814
|
readonly name: "obligation";
|
|
638
815
|
}, {
|
|
@@ -651,17 +828,8 @@ declare const MorphoV2: readonly [{
|
|
|
651
828
|
readonly type: "function";
|
|
652
829
|
readonly stateMutability: "nonpayable";
|
|
653
830
|
readonly inputs: readonly [{
|
|
654
|
-
readonly type: "uint256";
|
|
655
|
-
readonly name: "buyerAssets";
|
|
656
|
-
}, {
|
|
657
|
-
readonly type: "uint256";
|
|
658
|
-
readonly name: "sellerAssets";
|
|
659
|
-
}, {
|
|
660
831
|
readonly type: "uint256";
|
|
661
832
|
readonly name: "obligationUnits";
|
|
662
|
-
}, {
|
|
663
|
-
readonly type: "uint256";
|
|
664
|
-
readonly name: "obligationShares";
|
|
665
833
|
}, {
|
|
666
834
|
readonly type: "address";
|
|
667
835
|
readonly name: "taker";
|
|
@@ -689,6 +857,9 @@ declare const MorphoV2: readonly [{
|
|
|
689
857
|
}, {
|
|
690
858
|
readonly type: "uint256";
|
|
691
859
|
readonly name: "lltv";
|
|
860
|
+
}, {
|
|
861
|
+
readonly type: "uint256";
|
|
862
|
+
readonly name: "maxLif";
|
|
692
863
|
}, {
|
|
693
864
|
readonly type: "address";
|
|
694
865
|
readonly name: "oracle";
|
|
@@ -699,7 +870,7 @@ declare const MorphoV2: readonly [{
|
|
|
699
870
|
readonly name: "maturity";
|
|
700
871
|
}, {
|
|
701
872
|
readonly type: "uint256";
|
|
702
|
-
readonly name: "
|
|
873
|
+
readonly name: "rcfThreshold";
|
|
703
874
|
}];
|
|
704
875
|
readonly name: "obligation";
|
|
705
876
|
}, {
|
|
@@ -708,15 +879,9 @@ declare const MorphoV2: readonly [{
|
|
|
708
879
|
}, {
|
|
709
880
|
readonly type: "address";
|
|
710
881
|
readonly name: "maker";
|
|
711
|
-
}, {
|
|
712
|
-
readonly type: "uint256";
|
|
713
|
-
readonly name: "assets";
|
|
714
882
|
}, {
|
|
715
883
|
readonly type: "uint256";
|
|
716
884
|
readonly name: "obligationUnits";
|
|
717
|
-
}, {
|
|
718
|
-
readonly type: "uint256";
|
|
719
|
-
readonly name: "obligationShares";
|
|
720
885
|
}, {
|
|
721
886
|
readonly type: "uint256";
|
|
722
887
|
readonly name: "start";
|
|
@@ -741,6 +906,9 @@ declare const MorphoV2: readonly [{
|
|
|
741
906
|
}, {
|
|
742
907
|
readonly type: "address";
|
|
743
908
|
readonly name: "receiverIfMakerIsSeller";
|
|
909
|
+
}, {
|
|
910
|
+
readonly type: "bool";
|
|
911
|
+
readonly name: "exitOnly";
|
|
744
912
|
}];
|
|
745
913
|
readonly name: "offer";
|
|
746
914
|
}, {
|
|
@@ -769,8 +937,6 @@ declare const MorphoV2: readonly [{
|
|
|
769
937
|
readonly type: "uint256";
|
|
770
938
|
}, {
|
|
771
939
|
readonly type: "uint256";
|
|
772
|
-
}, {
|
|
773
|
-
readonly type: "uint256";
|
|
774
940
|
}];
|
|
775
941
|
}, {
|
|
776
942
|
readonly name: "toId";
|
|
@@ -789,6 +955,9 @@ declare const MorphoV2: readonly [{
|
|
|
789
955
|
}, {
|
|
790
956
|
readonly type: "uint256";
|
|
791
957
|
readonly name: "lltv";
|
|
958
|
+
}, {
|
|
959
|
+
readonly type: "uint256";
|
|
960
|
+
readonly name: "maxLif";
|
|
792
961
|
}, {
|
|
793
962
|
readonly type: "address";
|
|
794
963
|
readonly name: "oracle";
|
|
@@ -799,19 +968,19 @@ declare const MorphoV2: readonly [{
|
|
|
799
968
|
readonly name: "maturity";
|
|
800
969
|
}, {
|
|
801
970
|
readonly type: "uint256";
|
|
802
|
-
readonly name: "
|
|
971
|
+
readonly name: "rcfThreshold";
|
|
803
972
|
}];
|
|
804
973
|
readonly name: "obligation";
|
|
805
974
|
}];
|
|
806
975
|
readonly outputs: readonly [{
|
|
807
|
-
readonly type: "
|
|
976
|
+
readonly type: "bytes32";
|
|
808
977
|
}];
|
|
809
978
|
}, {
|
|
810
979
|
readonly name: "toObligation";
|
|
811
980
|
readonly type: "function";
|
|
812
981
|
readonly stateMutability: "view";
|
|
813
982
|
readonly inputs: readonly [{
|
|
814
|
-
readonly type: "
|
|
983
|
+
readonly type: "bytes32";
|
|
815
984
|
readonly name: "id";
|
|
816
985
|
}];
|
|
817
986
|
readonly outputs: readonly [{
|
|
@@ -827,6 +996,9 @@ declare const MorphoV2: readonly [{
|
|
|
827
996
|
}, {
|
|
828
997
|
readonly type: "uint256";
|
|
829
998
|
readonly name: "lltv";
|
|
999
|
+
}, {
|
|
1000
|
+
readonly type: "uint256";
|
|
1001
|
+
readonly name: "maxLif";
|
|
830
1002
|
}, {
|
|
831
1003
|
readonly type: "address";
|
|
832
1004
|
readonly name: "oracle";
|
|
@@ -837,26 +1009,15 @@ declare const MorphoV2: readonly [{
|
|
|
837
1009
|
readonly name: "maturity";
|
|
838
1010
|
}, {
|
|
839
1011
|
readonly type: "uint256";
|
|
840
|
-
readonly name: "
|
|
1012
|
+
readonly name: "rcfThreshold";
|
|
841
1013
|
}];
|
|
842
1014
|
}];
|
|
843
|
-
}, {
|
|
844
|
-
readonly name: "totalShares";
|
|
845
|
-
readonly type: "function";
|
|
846
|
-
readonly stateMutability: "view";
|
|
847
|
-
readonly inputs: readonly [{
|
|
848
|
-
readonly type: "bytes20";
|
|
849
|
-
readonly name: "id";
|
|
850
|
-
}];
|
|
851
|
-
readonly outputs: readonly [{
|
|
852
|
-
readonly type: "uint256";
|
|
853
|
-
}];
|
|
854
1015
|
}, {
|
|
855
1016
|
readonly name: "totalUnits";
|
|
856
1017
|
readonly type: "function";
|
|
857
1018
|
readonly stateMutability: "view";
|
|
858
1019
|
readonly inputs: readonly [{
|
|
859
|
-
readonly type: "
|
|
1020
|
+
readonly type: "bytes32";
|
|
860
1021
|
readonly name: "id";
|
|
861
1022
|
}];
|
|
862
1023
|
readonly outputs: readonly [{
|
|
@@ -879,6 +1040,9 @@ declare const MorphoV2: readonly [{
|
|
|
879
1040
|
}, {
|
|
880
1041
|
readonly type: "uint256";
|
|
881
1042
|
readonly name: "lltv";
|
|
1043
|
+
}, {
|
|
1044
|
+
readonly type: "uint256";
|
|
1045
|
+
readonly name: "maxLif";
|
|
882
1046
|
}, {
|
|
883
1047
|
readonly type: "address";
|
|
884
1048
|
readonly name: "oracle";
|
|
@@ -889,19 +1053,19 @@ declare const MorphoV2: readonly [{
|
|
|
889
1053
|
readonly name: "maturity";
|
|
890
1054
|
}, {
|
|
891
1055
|
readonly type: "uint256";
|
|
892
|
-
readonly name: "
|
|
1056
|
+
readonly name: "rcfThreshold";
|
|
893
1057
|
}];
|
|
894
1058
|
readonly name: "obligation";
|
|
895
1059
|
}];
|
|
896
1060
|
readonly outputs: readonly [{
|
|
897
|
-
readonly type: "
|
|
1061
|
+
readonly type: "bytes32";
|
|
898
1062
|
}];
|
|
899
1063
|
}, {
|
|
900
1064
|
readonly name: "tradingFee";
|
|
901
1065
|
readonly type: "function";
|
|
902
1066
|
readonly stateMutability: "view";
|
|
903
1067
|
readonly inputs: readonly [{
|
|
904
|
-
readonly type: "
|
|
1068
|
+
readonly type: "bytes32";
|
|
905
1069
|
readonly name: "id";
|
|
906
1070
|
}, {
|
|
907
1071
|
readonly type: "uint256";
|
|
@@ -918,6 +1082,20 @@ declare const MorphoV2: readonly [{
|
|
|
918
1082
|
readonly outputs: readonly [{
|
|
919
1083
|
readonly type: "address";
|
|
920
1084
|
}];
|
|
1085
|
+
}, {
|
|
1086
|
+
readonly name: "userLossIndex";
|
|
1087
|
+
readonly type: "function";
|
|
1088
|
+
readonly stateMutability: "view";
|
|
1089
|
+
readonly inputs: readonly [{
|
|
1090
|
+
readonly type: "bytes32";
|
|
1091
|
+
readonly name: "id";
|
|
1092
|
+
}, {
|
|
1093
|
+
readonly type: "address";
|
|
1094
|
+
readonly name: "user";
|
|
1095
|
+
}];
|
|
1096
|
+
readonly outputs: readonly [{
|
|
1097
|
+
readonly type: "uint128";
|
|
1098
|
+
}];
|
|
921
1099
|
}, {
|
|
922
1100
|
readonly name: "withdraw";
|
|
923
1101
|
readonly type: "function";
|
|
@@ -935,6 +1113,9 @@ declare const MorphoV2: readonly [{
|
|
|
935
1113
|
}, {
|
|
936
1114
|
readonly type: "uint256";
|
|
937
1115
|
readonly name: "lltv";
|
|
1116
|
+
}, {
|
|
1117
|
+
readonly type: "uint256";
|
|
1118
|
+
readonly name: "maxLif";
|
|
938
1119
|
}, {
|
|
939
1120
|
readonly type: "address";
|
|
940
1121
|
readonly name: "oracle";
|
|
@@ -945,15 +1126,12 @@ declare const MorphoV2: readonly [{
|
|
|
945
1126
|
readonly name: "maturity";
|
|
946
1127
|
}, {
|
|
947
1128
|
readonly type: "uint256";
|
|
948
|
-
readonly name: "
|
|
1129
|
+
readonly name: "rcfThreshold";
|
|
949
1130
|
}];
|
|
950
1131
|
readonly name: "obligation";
|
|
951
1132
|
}, {
|
|
952
1133
|
readonly type: "uint256";
|
|
953
1134
|
readonly name: "obligationUnits";
|
|
954
|
-
}, {
|
|
955
|
-
readonly type: "uint256";
|
|
956
|
-
readonly name: "shares";
|
|
957
1135
|
}, {
|
|
958
1136
|
readonly type: "address";
|
|
959
1137
|
readonly name: "onBehalf";
|
|
@@ -961,11 +1139,7 @@ declare const MorphoV2: readonly [{
|
|
|
961
1139
|
readonly type: "address";
|
|
962
1140
|
readonly name: "receiver";
|
|
963
1141
|
}];
|
|
964
|
-
readonly outputs: readonly [
|
|
965
|
-
readonly type: "uint256";
|
|
966
|
-
}, {
|
|
967
|
-
readonly type: "uint256";
|
|
968
|
-
}];
|
|
1142
|
+
readonly outputs: readonly [];
|
|
969
1143
|
}, {
|
|
970
1144
|
readonly name: "withdrawCollateral";
|
|
971
1145
|
readonly type: "function";
|
|
@@ -983,6 +1157,9 @@ declare const MorphoV2: readonly [{
|
|
|
983
1157
|
}, {
|
|
984
1158
|
readonly type: "uint256";
|
|
985
1159
|
readonly name: "lltv";
|
|
1160
|
+
}, {
|
|
1161
|
+
readonly type: "uint256";
|
|
1162
|
+
readonly name: "maxLif";
|
|
986
1163
|
}, {
|
|
987
1164
|
readonly type: "address";
|
|
988
1165
|
readonly name: "oracle";
|
|
@@ -993,7 +1170,7 @@ declare const MorphoV2: readonly [{
|
|
|
993
1170
|
readonly name: "maturity";
|
|
994
1171
|
}, {
|
|
995
1172
|
readonly type: "uint256";
|
|
996
|
-
readonly name: "
|
|
1173
|
+
readonly name: "rcfThreshold";
|
|
997
1174
|
}];
|
|
998
1175
|
readonly name: "obligation";
|
|
999
1176
|
}, {
|
|
@@ -1015,7 +1192,7 @@ declare const MorphoV2: readonly [{
|
|
|
1015
1192
|
readonly type: "function";
|
|
1016
1193
|
readonly stateMutability: "view";
|
|
1017
1194
|
readonly inputs: readonly [{
|
|
1018
|
-
readonly type: "
|
|
1195
|
+
readonly type: "bytes32";
|
|
1019
1196
|
readonly name: "id";
|
|
1020
1197
|
}];
|
|
1021
1198
|
readonly outputs: readonly [{
|
|
@@ -1029,21 +1206,6 @@ declare const MorphoV2: readonly [{
|
|
|
1029
1206
|
readonly name: "owner";
|
|
1030
1207
|
readonly indexed: true;
|
|
1031
1208
|
}];
|
|
1032
|
-
}, {
|
|
1033
|
-
readonly name: "Consume";
|
|
1034
|
-
readonly type: "event";
|
|
1035
|
-
readonly inputs: readonly [{
|
|
1036
|
-
readonly type: "address";
|
|
1037
|
-
readonly name: "user";
|
|
1038
|
-
readonly indexed: true;
|
|
1039
|
-
}, {
|
|
1040
|
-
readonly type: "bytes32";
|
|
1041
|
-
readonly name: "group";
|
|
1042
|
-
readonly indexed: true;
|
|
1043
|
-
}, {
|
|
1044
|
-
readonly type: "uint256";
|
|
1045
|
-
readonly name: "amount";
|
|
1046
|
-
}];
|
|
1047
1209
|
}, {
|
|
1048
1210
|
readonly name: "FlashLoan";
|
|
1049
1211
|
readonly type: "event";
|
|
@@ -1067,7 +1229,7 @@ declare const MorphoV2: readonly [{
|
|
|
1067
1229
|
readonly name: "caller";
|
|
1068
1230
|
readonly indexed: true;
|
|
1069
1231
|
}, {
|
|
1070
|
-
readonly type: "
|
|
1232
|
+
readonly type: "bytes32";
|
|
1071
1233
|
readonly name: "id_";
|
|
1072
1234
|
readonly indexed: true;
|
|
1073
1235
|
}, {
|
|
@@ -1086,12 +1248,15 @@ declare const MorphoV2: readonly [{
|
|
|
1086
1248
|
}, {
|
|
1087
1249
|
readonly type: "uint256";
|
|
1088
1250
|
readonly name: "badDebt";
|
|
1251
|
+
}, {
|
|
1252
|
+
readonly type: "uint256";
|
|
1253
|
+
readonly name: "latestLossIndex";
|
|
1089
1254
|
}];
|
|
1090
1255
|
}, {
|
|
1091
1256
|
readonly name: "ObligationCreated";
|
|
1092
1257
|
readonly type: "event";
|
|
1093
1258
|
readonly inputs: readonly [{
|
|
1094
|
-
readonly type: "
|
|
1259
|
+
readonly type: "bytes32";
|
|
1095
1260
|
readonly name: "id_";
|
|
1096
1261
|
readonly indexed: true;
|
|
1097
1262
|
}, {
|
|
@@ -1107,6 +1272,9 @@ declare const MorphoV2: readonly [{
|
|
|
1107
1272
|
}, {
|
|
1108
1273
|
readonly type: "uint256";
|
|
1109
1274
|
readonly name: "lltv";
|
|
1275
|
+
}, {
|
|
1276
|
+
readonly type: "uint256";
|
|
1277
|
+
readonly name: "maxLif";
|
|
1110
1278
|
}, {
|
|
1111
1279
|
readonly type: "address";
|
|
1112
1280
|
readonly name: "oracle";
|
|
@@ -1117,7 +1285,7 @@ declare const MorphoV2: readonly [{
|
|
|
1117
1285
|
readonly name: "maturity";
|
|
1118
1286
|
}, {
|
|
1119
1287
|
readonly type: "uint256";
|
|
1120
|
-
readonly name: "
|
|
1288
|
+
readonly name: "rcfThreshold";
|
|
1121
1289
|
}];
|
|
1122
1290
|
readonly name: "obligation";
|
|
1123
1291
|
}];
|
|
@@ -1129,7 +1297,7 @@ declare const MorphoV2: readonly [{
|
|
|
1129
1297
|
readonly name: "caller";
|
|
1130
1298
|
readonly indexed: true;
|
|
1131
1299
|
}, {
|
|
1132
|
-
readonly type: "
|
|
1300
|
+
readonly type: "bytes32";
|
|
1133
1301
|
readonly name: "id_";
|
|
1134
1302
|
readonly indexed: true;
|
|
1135
1303
|
}, {
|
|
@@ -1140,6 +1308,25 @@ declare const MorphoV2: readonly [{
|
|
|
1140
1308
|
readonly name: "onBehalf";
|
|
1141
1309
|
readonly indexed: true;
|
|
1142
1310
|
}];
|
|
1311
|
+
}, {
|
|
1312
|
+
readonly name: "SetConsumed";
|
|
1313
|
+
readonly type: "event";
|
|
1314
|
+
readonly inputs: readonly [{
|
|
1315
|
+
readonly type: "address";
|
|
1316
|
+
readonly name: "caller";
|
|
1317
|
+
readonly indexed: true;
|
|
1318
|
+
}, {
|
|
1319
|
+
readonly type: "address";
|
|
1320
|
+
readonly name: "onBehalf";
|
|
1321
|
+
readonly indexed: true;
|
|
1322
|
+
}, {
|
|
1323
|
+
readonly type: "bytes32";
|
|
1324
|
+
readonly name: "group";
|
|
1325
|
+
readonly indexed: true;
|
|
1326
|
+
}, {
|
|
1327
|
+
readonly type: "uint256";
|
|
1328
|
+
readonly name: "amount";
|
|
1329
|
+
}];
|
|
1143
1330
|
}, {
|
|
1144
1331
|
readonly name: "SetDefaultTradingFee";
|
|
1145
1332
|
readonly type: "event";
|
|
@@ -1163,11 +1350,63 @@ declare const MorphoV2: readonly [{
|
|
|
1163
1350
|
readonly name: "feeSetter";
|
|
1164
1351
|
readonly indexed: true;
|
|
1165
1352
|
}];
|
|
1353
|
+
}, {
|
|
1354
|
+
readonly name: "SetIsAuthorized";
|
|
1355
|
+
readonly type: "event";
|
|
1356
|
+
readonly inputs: readonly [{
|
|
1357
|
+
readonly type: "address";
|
|
1358
|
+
readonly name: "caller";
|
|
1359
|
+
readonly indexed: true;
|
|
1360
|
+
}, {
|
|
1361
|
+
readonly type: "address";
|
|
1362
|
+
readonly name: "onBehalf";
|
|
1363
|
+
readonly indexed: true;
|
|
1364
|
+
}, {
|
|
1365
|
+
readonly type: "address";
|
|
1366
|
+
readonly name: "authorized";
|
|
1367
|
+
readonly indexed: true;
|
|
1368
|
+
}, {
|
|
1369
|
+
readonly type: "bool";
|
|
1370
|
+
readonly name: "newIsAuthorized";
|
|
1371
|
+
}];
|
|
1372
|
+
}, {
|
|
1373
|
+
readonly name: "SetMaxCollateralPerUser";
|
|
1374
|
+
readonly type: "event";
|
|
1375
|
+
readonly inputs: readonly [{
|
|
1376
|
+
readonly type: "address";
|
|
1377
|
+
readonly name: "collateralToken";
|
|
1378
|
+
readonly indexed: true;
|
|
1379
|
+
}, {
|
|
1380
|
+
readonly type: "uint256";
|
|
1381
|
+
readonly name: "maxCollateralPerUser";
|
|
1382
|
+
}];
|
|
1383
|
+
}, {
|
|
1384
|
+
readonly name: "SetMaxTakeableAssets";
|
|
1385
|
+
readonly type: "event";
|
|
1386
|
+
readonly inputs: readonly [{
|
|
1387
|
+
readonly type: "address";
|
|
1388
|
+
readonly name: "loanToken";
|
|
1389
|
+
readonly indexed: true;
|
|
1390
|
+
}, {
|
|
1391
|
+
readonly type: "uint256";
|
|
1392
|
+
readonly name: "maxTakeableAssets";
|
|
1393
|
+
}];
|
|
1394
|
+
}, {
|
|
1395
|
+
readonly name: "SetMaxTotalUnits";
|
|
1396
|
+
readonly type: "event";
|
|
1397
|
+
readonly inputs: readonly [{
|
|
1398
|
+
readonly type: "address";
|
|
1399
|
+
readonly name: "loanToken";
|
|
1400
|
+
readonly indexed: true;
|
|
1401
|
+
}, {
|
|
1402
|
+
readonly type: "uint128";
|
|
1403
|
+
readonly name: "maxTotalUnits";
|
|
1404
|
+
}];
|
|
1166
1405
|
}, {
|
|
1167
1406
|
readonly name: "SetObligationTradingFee";
|
|
1168
1407
|
readonly type: "event";
|
|
1169
1408
|
readonly inputs: readonly [{
|
|
1170
|
-
readonly type: "
|
|
1409
|
+
readonly type: "bytes32";
|
|
1171
1410
|
readonly name: "id_";
|
|
1172
1411
|
readonly indexed: true;
|
|
1173
1412
|
}, {
|
|
@@ -1199,12 +1438,37 @@ declare const MorphoV2: readonly [{
|
|
|
1199
1438
|
readonly type: "event";
|
|
1200
1439
|
readonly inputs: readonly [{
|
|
1201
1440
|
readonly type: "address";
|
|
1202
|
-
readonly name: "
|
|
1441
|
+
readonly name: "caller";
|
|
1442
|
+
readonly indexed: true;
|
|
1443
|
+
}, {
|
|
1444
|
+
readonly type: "address";
|
|
1445
|
+
readonly name: "onBehalf";
|
|
1203
1446
|
readonly indexed: true;
|
|
1204
1447
|
}, {
|
|
1205
1448
|
readonly type: "bytes32";
|
|
1206
1449
|
readonly name: "session";
|
|
1207
1450
|
}];
|
|
1451
|
+
}, {
|
|
1452
|
+
readonly name: "Slash";
|
|
1453
|
+
readonly type: "event";
|
|
1454
|
+
readonly inputs: readonly [{
|
|
1455
|
+
readonly type: "address";
|
|
1456
|
+
readonly name: "caller";
|
|
1457
|
+
}, {
|
|
1458
|
+
readonly type: "bytes32";
|
|
1459
|
+
readonly name: "id_";
|
|
1460
|
+
readonly indexed: true;
|
|
1461
|
+
}, {
|
|
1462
|
+
readonly type: "address";
|
|
1463
|
+
readonly name: "user";
|
|
1464
|
+
readonly indexed: true;
|
|
1465
|
+
}, {
|
|
1466
|
+
readonly type: "uint256";
|
|
1467
|
+
readonly name: "credit";
|
|
1468
|
+
}, {
|
|
1469
|
+
readonly type: "uint256";
|
|
1470
|
+
readonly name: "latestLossIndex";
|
|
1471
|
+
}];
|
|
1208
1472
|
}, {
|
|
1209
1473
|
readonly name: "SupplyCollateral";
|
|
1210
1474
|
readonly type: "event";
|
|
@@ -1212,7 +1476,7 @@ declare const MorphoV2: readonly [{
|
|
|
1212
1476
|
readonly type: "address";
|
|
1213
1477
|
readonly name: "caller";
|
|
1214
1478
|
}, {
|
|
1215
|
-
readonly type: "
|
|
1479
|
+
readonly type: "bytes32";
|
|
1216
1480
|
readonly name: "id_";
|
|
1217
1481
|
readonly indexed: true;
|
|
1218
1482
|
}, {
|
|
@@ -1234,7 +1498,7 @@ declare const MorphoV2: readonly [{
|
|
|
1234
1498
|
readonly type: "address";
|
|
1235
1499
|
readonly name: "caller";
|
|
1236
1500
|
}, {
|
|
1237
|
-
readonly type: "
|
|
1501
|
+
readonly type: "bytes32";
|
|
1238
1502
|
readonly name: "id_";
|
|
1239
1503
|
readonly indexed: true;
|
|
1240
1504
|
}, {
|
|
@@ -1257,15 +1521,6 @@ declare const MorphoV2: readonly [{
|
|
|
1257
1521
|
}, {
|
|
1258
1522
|
readonly type: "uint256";
|
|
1259
1523
|
readonly name: "obligationUnits";
|
|
1260
|
-
}, {
|
|
1261
|
-
readonly type: "uint256";
|
|
1262
|
-
readonly name: "obligationShares";
|
|
1263
|
-
}, {
|
|
1264
|
-
readonly type: "bool";
|
|
1265
|
-
readonly name: "buyerIsLender";
|
|
1266
|
-
}, {
|
|
1267
|
-
readonly type: "bool";
|
|
1268
|
-
readonly name: "sellerIsBorrower";
|
|
1269
1524
|
}, {
|
|
1270
1525
|
readonly type: "address";
|
|
1271
1526
|
readonly name: "sellerReceiver";
|
|
@@ -1275,6 +1530,9 @@ declare const MorphoV2: readonly [{
|
|
|
1275
1530
|
}, {
|
|
1276
1531
|
readonly type: "uint256";
|
|
1277
1532
|
readonly name: "consumed";
|
|
1533
|
+
}, {
|
|
1534
|
+
readonly type: "uint256";
|
|
1535
|
+
readonly name: "totalUnits";
|
|
1278
1536
|
}];
|
|
1279
1537
|
}, {
|
|
1280
1538
|
readonly name: "Withdraw";
|
|
@@ -1283,15 +1541,12 @@ declare const MorphoV2: readonly [{
|
|
|
1283
1541
|
readonly type: "address";
|
|
1284
1542
|
readonly name: "caller";
|
|
1285
1543
|
}, {
|
|
1286
|
-
readonly type: "
|
|
1544
|
+
readonly type: "bytes32";
|
|
1287
1545
|
readonly name: "id_";
|
|
1288
1546
|
readonly indexed: true;
|
|
1289
1547
|
}, {
|
|
1290
1548
|
readonly type: "uint256";
|
|
1291
1549
|
readonly name: "obligationUnits";
|
|
1292
|
-
}, {
|
|
1293
|
-
readonly type: "uint256";
|
|
1294
|
-
readonly name: "shares";
|
|
1295
1550
|
}, {
|
|
1296
1551
|
readonly type: "address";
|
|
1297
1552
|
readonly name: "onBehalf";
|
|
@@ -1308,7 +1563,7 @@ declare const MorphoV2: readonly [{
|
|
|
1308
1563
|
readonly type: "address";
|
|
1309
1564
|
readonly name: "caller";
|
|
1310
1565
|
}, {
|
|
1311
|
-
readonly type: "
|
|
1566
|
+
readonly type: "bytes32";
|
|
1312
1567
|
readonly name: "id_";
|
|
1313
1568
|
readonly indexed: true;
|
|
1314
1569
|
}, {
|
|
@@ -1630,7 +1885,8 @@ declare namespace Collateral_d_exports {
|
|
|
1630
1885
|
}
|
|
1631
1886
|
type Collateral = {
|
|
1632
1887
|
/** Asset being used as collateral. */asset: Address; /** Liquidation Loan-to-Value of the collateral. */
|
|
1633
|
-
lltv: LLTV; /**
|
|
1888
|
+
lltv: LLTV; /** Maximum Liquidation Incentive Factor for this collateral. */
|
|
1889
|
+
maxLif: bigint; /** Oracle contract used to price the collateral. */
|
|
1634
1890
|
oracle: Address;
|
|
1635
1891
|
};
|
|
1636
1892
|
declare const abi$1: readonly [{
|
|
@@ -1639,6 +1895,9 @@ declare const abi$1: readonly [{
|
|
|
1639
1895
|
}, {
|
|
1640
1896
|
readonly type: "uint256";
|
|
1641
1897
|
readonly name: "lltv";
|
|
1898
|
+
}, {
|
|
1899
|
+
readonly type: "uint256";
|
|
1900
|
+
readonly name: "maxLif";
|
|
1642
1901
|
}, {
|
|
1643
1902
|
readonly type: "address";
|
|
1644
1903
|
readonly name: "oracle";
|
|
@@ -1647,17 +1906,20 @@ declare const CollateralSchema: z$1.ZodObject<{
|
|
|
1647
1906
|
asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1648
1907
|
oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1649
1908
|
lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
1909
|
+
maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1650
1910
|
}, z$1.core.$strip>;
|
|
1651
1911
|
declare const CollateralsSchema: z$1.ZodArray<z$1.ZodObject<{
|
|
1652
1912
|
asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1653
1913
|
oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1654
1914
|
lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
1915
|
+
maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1655
1916
|
}, z$1.core.$strip>>;
|
|
1656
1917
|
declare const from$13: (parameters: from$13.Parameters) => from$13.ReturnType;
|
|
1657
1918
|
declare namespace from$13 {
|
|
1658
1919
|
type Parameters = {
|
|
1659
1920
|
asset: Address;
|
|
1660
1921
|
lltv: Options | bigint;
|
|
1922
|
+
maxLif?: bigint;
|
|
1661
1923
|
oracle: Address;
|
|
1662
1924
|
};
|
|
1663
1925
|
type ReturnType = Collateral;
|
|
@@ -1837,8 +2099,8 @@ declare namespace Obligation_d_exports {
|
|
|
1837
2099
|
type Obligation$1 = {
|
|
1838
2100
|
/** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
|
|
1839
2101
|
collaterals: Collateral[]; /** The maturity of the obligation. */
|
|
1840
|
-
maturity: Maturity; /**
|
|
1841
|
-
|
|
2102
|
+
maturity: Maturity; /** Recovery-close-factor threshold in obligation units. */
|
|
2103
|
+
rcfThreshold: bigint;
|
|
1842
2104
|
};
|
|
1843
2105
|
declare const ObligationSchema: z$1.ZodObject<{
|
|
1844
2106
|
loanToken: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
@@ -1846,9 +2108,10 @@ declare const ObligationSchema: z$1.ZodObject<{
|
|
|
1846
2108
|
asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1847
2109
|
oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1848
2110
|
lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
2111
|
+
maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1849
2112
|
}, z$1.core.$strip>>;
|
|
1850
2113
|
maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
|
|
1851
|
-
|
|
2114
|
+
rcfThreshold: z$1.ZodBigInt;
|
|
1852
2115
|
}, z$1.core.$strip>;
|
|
1853
2116
|
declare const abi: readonly [{
|
|
1854
2117
|
readonly type: "address";
|
|
@@ -1862,6 +2125,9 @@ declare const abi: readonly [{
|
|
|
1862
2125
|
}, {
|
|
1863
2126
|
readonly type: "uint256";
|
|
1864
2127
|
readonly name: "lltv";
|
|
2128
|
+
}, {
|
|
2129
|
+
readonly type: "uint256";
|
|
2130
|
+
readonly name: "maxLif";
|
|
1865
2131
|
}, {
|
|
1866
2132
|
readonly type: "address";
|
|
1867
2133
|
readonly name: "oracle";
|
|
@@ -1871,7 +2137,7 @@ declare const abi: readonly [{
|
|
|
1871
2137
|
readonly name: "maturity";
|
|
1872
2138
|
}, {
|
|
1873
2139
|
readonly type: "uint256";
|
|
1874
|
-
readonly name: "
|
|
2140
|
+
readonly name: "rcfThreshold";
|
|
1875
2141
|
}];
|
|
1876
2142
|
declare const tupleAbi: readonly [{
|
|
1877
2143
|
readonly type: "tuple";
|
|
@@ -1887,6 +2153,9 @@ declare const tupleAbi: readonly [{
|
|
|
1887
2153
|
}, {
|
|
1888
2154
|
readonly type: "uint256";
|
|
1889
2155
|
readonly name: "lltv";
|
|
2156
|
+
}, {
|
|
2157
|
+
readonly type: "uint256";
|
|
2158
|
+
readonly name: "maxLif";
|
|
1890
2159
|
}, {
|
|
1891
2160
|
readonly type: "address";
|
|
1892
2161
|
readonly name: "oracle";
|
|
@@ -1896,7 +2165,7 @@ declare const tupleAbi: readonly [{
|
|
|
1896
2165
|
readonly name: "maturity";
|
|
1897
2166
|
}, {
|
|
1898
2167
|
readonly type: "uint256";
|
|
1899
|
-
readonly name: "
|
|
2168
|
+
readonly name: "rcfThreshold";
|
|
1900
2169
|
}];
|
|
1901
2170
|
}];
|
|
1902
2171
|
/**
|
|
@@ -1918,6 +2187,7 @@ declare const tupleAbi: readonly [{
|
|
|
1918
2187
|
* }),
|
|
1919
2188
|
* ],
|
|
1920
2189
|
* maturity: Maturity.from("end_of_next_quarter"),
|
|
2190
|
+
* rcfThreshold: 0n,
|
|
1921
2191
|
* });
|
|
1922
2192
|
* ```
|
|
1923
2193
|
*/
|
|
@@ -1926,8 +2196,8 @@ declare namespace from$11 {
|
|
|
1926
2196
|
type Parameters = {
|
|
1927
2197
|
/** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
1928
2198
|
collaterals: from$13.Parameters[] | readonly from$13.Parameters[]; /** The maturity of the obligation. */
|
|
1929
|
-
maturity: from$12.Parameters; /**
|
|
1930
|
-
|
|
2199
|
+
maturity: from$12.Parameters; /** Recovery-close-factor threshold in obligation units. */
|
|
2200
|
+
rcfThreshold: bigint;
|
|
1931
2201
|
};
|
|
1932
2202
|
type ReturnType = Obligation$1;
|
|
1933
2203
|
type ErrorType = InvalidObligationError;
|
|
@@ -1940,17 +2210,14 @@ declare namespace from$11 {
|
|
|
1940
2210
|
*/
|
|
1941
2211
|
declare function fromSnakeCase$2(input: fromSnakeCase$2.Parameters): fromSnakeCase$2.ReturnType;
|
|
1942
2212
|
declare namespace fromSnakeCase$2 {
|
|
1943
|
-
type SnakeCaseParameters =
|
|
1944
|
-
minCollatValue?: bigint;
|
|
1945
|
-
};
|
|
2213
|
+
type SnakeCaseParameters = Obligation$1;
|
|
1946
2214
|
type Parameters = Snake<SnakeCaseParameters>;
|
|
1947
2215
|
type ReturnType = Obligation$1;
|
|
1948
2216
|
type ErrorType = InvalidObligationError;
|
|
1949
2217
|
}
|
|
1950
2218
|
/**
|
|
1951
2219
|
* Calculates a canonical key for an obligation payload.
|
|
1952
|
-
* The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity,
|
|
1953
|
-
* If omitted, `minCollatValue` defaults to `0`.
|
|
2220
|
+
* The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity, rcfThreshold)).
|
|
1954
2221
|
* @throws If the collaterals are not sorted alphabetically by address. {@link CollateralsAreNotSortedError}
|
|
1955
2222
|
* @param parameters - {@link key.Parameters}
|
|
1956
2223
|
* @returns The obligation key as a 32-byte hex string. {@link key.ReturnType}
|
|
@@ -1969,10 +2236,11 @@ declare namespace key$1 {
|
|
|
1969
2236
|
collaterals: {
|
|
1970
2237
|
asset: Address;
|
|
1971
2238
|
lltv: bigint;
|
|
2239
|
+
maxLif?: bigint;
|
|
1972
2240
|
oracle: Address;
|
|
1973
2241
|
}[];
|
|
1974
2242
|
maturity: number;
|
|
1975
|
-
|
|
2243
|
+
rcfThreshold: bigint;
|
|
1976
2244
|
};
|
|
1977
2245
|
type ReturnType = Hex;
|
|
1978
2246
|
type ErrorType = CollateralsAreNotSortedError;
|
|
@@ -1999,7 +2267,6 @@ declare namespace random$2 {
|
|
|
1999
2267
|
*/
|
|
2000
2268
|
declare function fromOffer$1(offer: Offer): fromOffer$1.ReturnType;
|
|
2001
2269
|
declare namespace fromOffer$1 {
|
|
2002
|
-
type Parameters = Offer;
|
|
2003
2270
|
type ReturnType = Obligation$1;
|
|
2004
2271
|
}
|
|
2005
2272
|
declare class InvalidObligationError extends BaseError<z$1.ZodError | Error> {
|
|
@@ -2033,11 +2300,10 @@ declare namespace creationCode {
|
|
|
2033
2300
|
}
|
|
2034
2301
|
/**
|
|
2035
2302
|
* Computes the same id as `IdLib.toId` in Solidity using the CREATE2 preimage:
|
|
2036
|
-
* `keccak256(0xff ++ morphoV2 ++ chainId ++ keccak256(creationCode))
|
|
2037
|
-
* then truncates to the lower 20 bytes.
|
|
2303
|
+
* `keccak256(0xff ++ morphoV2 ++ chainId ++ keccak256(creationCode))`.
|
|
2038
2304
|
*
|
|
2039
2305
|
* @param parameters - {@link toId.Parameters}
|
|
2040
|
-
* @returns The obligation id. {@link toId.ReturnType}
|
|
2306
|
+
* @returns The 32-byte obligation id. {@link toId.ReturnType}
|
|
2041
2307
|
*/
|
|
2042
2308
|
declare function toId(parameters: toId.Parameters): toId.ReturnType;
|
|
2043
2309
|
declare namespace toId {
|
|
@@ -2141,15 +2407,14 @@ declare function generateMarketLiquidityPoolId(parameters: {
|
|
|
2141
2407
|
marketId: string;
|
|
2142
2408
|
}): string;
|
|
2143
2409
|
declare namespace Offer_d_exports {
|
|
2144
|
-
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, encode$1 as encode, from$10 as from, fromSnakeCase$1 as fromSnakeCase, hash, liquidateEvent,
|
|
2410
|
+
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, encode$1 as encode, from$10 as from, fromSnakeCase$1 as fromSnakeCase, hash, liquidateEvent, random$1 as random, repayEvent, serialize, supplyCollateralEvent, takeEvent, toSnakeCase, withdrawCollateralEvent };
|
|
2145
2411
|
}
|
|
2146
2412
|
type Offer = {
|
|
2147
|
-
/** The address that made the offer. */readonly maker: Address; /** The
|
|
2148
|
-
readonly
|
|
2149
|
-
readonly obligationUnits: bigint; /** The max lending shares to trade. Mutually exclusive with assets and obligationUnits. */
|
|
2150
|
-
readonly obligationShares: bigint; /** The offer tick. */
|
|
2413
|
+
/** The address that made the offer. */readonly maker: Address; /** The max debt units to trade. */
|
|
2414
|
+
readonly obligationUnits: bigint; /** The offer tick. */
|
|
2151
2415
|
readonly tick: number; /** The date at which all interests will be paid. */
|
|
2152
|
-
readonly maturity: Maturity; /**
|
|
2416
|
+
readonly maturity: Maturity; /** Recovery-close-factor threshold in obligation units. */
|
|
2417
|
+
readonly rcfThreshold: bigint; /** The date at which the offer will expire. */
|
|
2153
2418
|
readonly expiry: number; /** The date at which the offer will start. */
|
|
2154
2419
|
readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
|
|
2155
2420
|
readonly group: Hex; /** The session. Used for session-based offer management. */
|
|
@@ -2161,7 +2426,8 @@ type Offer = {
|
|
|
2161
2426
|
readonly address: Address;
|
|
2162
2427
|
readonly data: Hex;
|
|
2163
2428
|
}; /** Receiver of loan token proceeds when maker is seller on `take()`. */
|
|
2164
|
-
readonly receiverIfMakerIsSeller: Address;
|
|
2429
|
+
readonly receiverIfMakerIsSeller: Address; /** Whether this offer can only reduce existing positions, not create new ones. */
|
|
2430
|
+
readonly exitOnly: boolean;
|
|
2165
2431
|
};
|
|
2166
2432
|
declare enum Status {
|
|
2167
2433
|
VALID = "VALID",
|
|
@@ -2174,11 +2440,10 @@ type Validation = {
|
|
|
2174
2440
|
};
|
|
2175
2441
|
declare const OfferSchema: () => z$1.ZodObject<{
|
|
2176
2442
|
maker: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
2177
|
-
assets: z$1.ZodBigInt;
|
|
2178
2443
|
obligationUnits: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
2179
|
-
obligationShares: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
2180
2444
|
tick: z$1.ZodCoercedNumber<unknown>;
|
|
2181
2445
|
maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
|
|
2446
|
+
rcfThreshold: z$1.ZodBigInt;
|
|
2182
2447
|
expiry: z$1.ZodNumber;
|
|
2183
2448
|
start: z$1.ZodNumber;
|
|
2184
2449
|
group: z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBigInt]>, z$1.ZodTransform<`0x${string}`, string | number | bigint>>;
|
|
@@ -2189,12 +2454,14 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
2189
2454
|
asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
2190
2455
|
oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
2191
2456
|
lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
2457
|
+
maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
2192
2458
|
}, z$1.core.$strip>>;
|
|
2193
2459
|
callback: z$1.ZodObject<{
|
|
2194
2460
|
address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
2195
2461
|
data: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
2196
2462
|
}, z$1.core.$strip>;
|
|
2197
2463
|
receiverIfMakerIsSeller: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
2464
|
+
exitOnly: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2198
2465
|
}, z$1.core.$strip>;
|
|
2199
2466
|
/**
|
|
2200
2467
|
* Input type for creating offers. Accepts flexible group types that will be coerced to Hex.
|
|
@@ -2207,12 +2474,13 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
2207
2474
|
*
|
|
2208
2475
|
* All values validated to be non-negative and within bytes32 range.
|
|
2209
2476
|
*/
|
|
2210
|
-
type OfferInput = Compute<Omit<Offer, "group" | "session" | "obligationUnits" | "
|
|
2477
|
+
type OfferInput = Compute<Omit<Offer, "group" | "session" | "obligationUnits" | "rcfThreshold" | "receiverIfMakerIsSeller" | "exitOnly"> & {
|
|
2211
2478
|
group: Hex | bigint | number | string; /** Optional: defaults to zero bytes32. */
|
|
2212
|
-
session?: Hex | bigint | number | string; /** Optional: defaults to 0n.
|
|
2213
|
-
obligationUnits?: bigint; /**
|
|
2214
|
-
|
|
2215
|
-
receiverIfMakerIsSeller?: Address;
|
|
2479
|
+
session?: Hex | bigint | number | string; /** Optional: defaults to 0n. */
|
|
2480
|
+
obligationUnits?: bigint; /** Recovery-close-factor threshold in obligation units. */
|
|
2481
|
+
rcfThreshold: bigint; /** Optional: defaults to maker for backward compatibility. */
|
|
2482
|
+
receiverIfMakerIsSeller?: Address; /** Optional: defaults to false. */
|
|
2483
|
+
exitOnly?: boolean;
|
|
2216
2484
|
}>;
|
|
2217
2485
|
/**
|
|
2218
2486
|
* Creates an offer from a plain object.
|
|
@@ -2249,11 +2517,10 @@ declare function toSnakeCase(offer: Offer): Snake<Offer>;
|
|
|
2249
2517
|
*/
|
|
2250
2518
|
declare const serialize: (offer: Offer) => {
|
|
2251
2519
|
maker: `0x${string}`;
|
|
2252
|
-
assets: string;
|
|
2253
2520
|
obligationUnits: string;
|
|
2254
|
-
obligationShares: string;
|
|
2255
2521
|
tick: number;
|
|
2256
2522
|
maturity: number;
|
|
2523
|
+
rcfThreshold: string;
|
|
2257
2524
|
expiry: number;
|
|
2258
2525
|
start: number;
|
|
2259
2526
|
group: `0x${string}`;
|
|
@@ -2264,12 +2531,14 @@ declare const serialize: (offer: Offer) => {
|
|
|
2264
2531
|
asset: `0x${string}`;
|
|
2265
2532
|
oracle: `0x${string}`;
|
|
2266
2533
|
lltv: string;
|
|
2534
|
+
maxLif: string;
|
|
2267
2535
|
}[];
|
|
2268
2536
|
callback: {
|
|
2269
2537
|
address: `0x${string}`;
|
|
2270
2538
|
data: `0x${string}`;
|
|
2271
2539
|
};
|
|
2272
2540
|
receiverIfMakerIsSeller: `0x${string}`;
|
|
2541
|
+
exitOnly: boolean;
|
|
2273
2542
|
hash: `0x${string}`;
|
|
2274
2543
|
};
|
|
2275
2544
|
type RandomConfig = {
|
|
@@ -2277,11 +2546,10 @@ type RandomConfig = {
|
|
|
2277
2546
|
collateralTokens?: Address[];
|
|
2278
2547
|
assetsDecimals?: Record<Address, number>;
|
|
2279
2548
|
buy?: boolean;
|
|
2280
|
-
assets?: bigint;
|
|
2281
2549
|
obligationUnits?: bigint;
|
|
2282
|
-
obligationShares?: bigint;
|
|
2283
2550
|
maker?: Address;
|
|
2284
2551
|
maturity?: Maturity;
|
|
2552
|
+
rcfThreshold?: bigint;
|
|
2285
2553
|
start?: number;
|
|
2286
2554
|
expiry?: number;
|
|
2287
2555
|
group?: Hex | bigint | number | string;
|
|
@@ -2293,6 +2561,7 @@ type RandomConfig = {
|
|
|
2293
2561
|
};
|
|
2294
2562
|
receiverIfMakerIsSeller?: Address;
|
|
2295
2563
|
collaterals?: readonly Collateral[];
|
|
2564
|
+
exitOnly?: boolean;
|
|
2296
2565
|
};
|
|
2297
2566
|
/**
|
|
2298
2567
|
* Generates a random Offer.
|
|
@@ -2309,21 +2578,6 @@ declare function random$1(config?: RandomConfig): Offer;
|
|
|
2309
2578
|
* @returns 32-byte offer hash.
|
|
2310
2579
|
*/
|
|
2311
2580
|
declare function hash(offer: Offer): Hex;
|
|
2312
|
-
/**
|
|
2313
|
-
* Calculates the onchain obligation id for an offer.
|
|
2314
|
-
* The id is computed with {@link Id.toId}.
|
|
2315
|
-
* @param offer - The offer to calculate the obligation id for.
|
|
2316
|
-
* @param parameters - The chain context used by the onchain id function.
|
|
2317
|
-
* @returns The obligation id as a 20-byte hex string.
|
|
2318
|
-
*/
|
|
2319
|
-
declare function obligationId(offer: Offer, parameters: obligationId.Parameters): obligationId.ReturnType;
|
|
2320
|
-
declare namespace obligationId {
|
|
2321
|
-
type Parameters = {
|
|
2322
|
-
chainId: Id;
|
|
2323
|
-
morphoV2: Address;
|
|
2324
|
-
};
|
|
2325
|
-
type ReturnType = Hex;
|
|
2326
|
-
}
|
|
2327
2581
|
declare function encode$1(offer: Offer): `0x${string}`;
|
|
2328
2582
|
declare function decode$1(data: Hex): Offer;
|
|
2329
2583
|
type OfferConsumed = {
|
|
@@ -2347,9 +2601,9 @@ declare const takeEvent: {
|
|
|
2347
2601
|
readonly internalType: "address";
|
|
2348
2602
|
}, {
|
|
2349
2603
|
readonly name: "id_";
|
|
2350
|
-
readonly type: "
|
|
2604
|
+
readonly type: "bytes32";
|
|
2351
2605
|
readonly indexed: true;
|
|
2352
|
-
readonly internalType: "
|
|
2606
|
+
readonly internalType: "bytes32";
|
|
2353
2607
|
}, {
|
|
2354
2608
|
readonly name: "maker";
|
|
2355
2609
|
readonly type: "address";
|
|
@@ -2380,21 +2634,6 @@ declare const takeEvent: {
|
|
|
2380
2634
|
readonly type: "uint256";
|
|
2381
2635
|
readonly indexed: false;
|
|
2382
2636
|
readonly internalType: "uint256";
|
|
2383
|
-
}, {
|
|
2384
|
-
readonly name: "obligationShares";
|
|
2385
|
-
readonly type: "uint256";
|
|
2386
|
-
readonly indexed: false;
|
|
2387
|
-
readonly internalType: "uint256";
|
|
2388
|
-
}, {
|
|
2389
|
-
readonly name: "buyerIsLender";
|
|
2390
|
-
readonly type: "bool";
|
|
2391
|
-
readonly indexed: false;
|
|
2392
|
-
readonly internalType: "bool";
|
|
2393
|
-
}, {
|
|
2394
|
-
readonly name: "sellerIsBorrower";
|
|
2395
|
-
readonly type: "bool";
|
|
2396
|
-
readonly indexed: false;
|
|
2397
|
-
readonly internalType: "bool";
|
|
2398
2637
|
}, {
|
|
2399
2638
|
readonly name: "sellerReceiver";
|
|
2400
2639
|
readonly type: "address";
|
|
@@ -2410,17 +2649,27 @@ declare const takeEvent: {
|
|
|
2410
2649
|
readonly type: "uint256";
|
|
2411
2650
|
readonly indexed: false;
|
|
2412
2651
|
readonly internalType: "uint256";
|
|
2652
|
+
}, {
|
|
2653
|
+
readonly name: "totalUnits";
|
|
2654
|
+
readonly type: "uint256";
|
|
2655
|
+
readonly indexed: false;
|
|
2656
|
+
readonly internalType: "uint256";
|
|
2413
2657
|
}];
|
|
2414
2658
|
readonly anonymous: false;
|
|
2415
2659
|
};
|
|
2416
2660
|
/**
|
|
2417
|
-
* ABI for the
|
|
2661
|
+
* ABI for the SetConsumed event emitted by the Morpho V2 contract.
|
|
2418
2662
|
*/
|
|
2419
2663
|
declare const consumedEvent: {
|
|
2420
2664
|
readonly type: "event";
|
|
2421
|
-
readonly name: "
|
|
2665
|
+
readonly name: "SetConsumed";
|
|
2422
2666
|
readonly inputs: readonly [{
|
|
2423
|
-
readonly name: "
|
|
2667
|
+
readonly name: "caller";
|
|
2668
|
+
readonly type: "address";
|
|
2669
|
+
readonly indexed: true;
|
|
2670
|
+
readonly internalType: "address";
|
|
2671
|
+
}, {
|
|
2672
|
+
readonly name: "onBehalf";
|
|
2424
2673
|
readonly type: "address";
|
|
2425
2674
|
readonly indexed: true;
|
|
2426
2675
|
readonly internalType: "address";
|
|
@@ -2450,9 +2699,9 @@ declare const repayEvent: {
|
|
|
2450
2699
|
readonly internalType: "address";
|
|
2451
2700
|
}, {
|
|
2452
2701
|
readonly name: "id_";
|
|
2453
|
-
readonly type: "
|
|
2702
|
+
readonly type: "bytes32";
|
|
2454
2703
|
readonly indexed: true;
|
|
2455
|
-
readonly internalType: "
|
|
2704
|
+
readonly internalType: "bytes32";
|
|
2456
2705
|
}, {
|
|
2457
2706
|
readonly name: "obligationUnits";
|
|
2458
2707
|
readonly type: "uint256";
|
|
@@ -2479,9 +2728,9 @@ declare const liquidateEvent: {
|
|
|
2479
2728
|
readonly internalType: "address";
|
|
2480
2729
|
}, {
|
|
2481
2730
|
readonly name: "id_";
|
|
2482
|
-
readonly type: "
|
|
2731
|
+
readonly type: "bytes32";
|
|
2483
2732
|
readonly indexed: true;
|
|
2484
|
-
readonly internalType: "
|
|
2733
|
+
readonly internalType: "bytes32";
|
|
2485
2734
|
}, {
|
|
2486
2735
|
readonly name: "collateralIndex";
|
|
2487
2736
|
readonly type: "uint256";
|
|
@@ -2507,6 +2756,11 @@ declare const liquidateEvent: {
|
|
|
2507
2756
|
readonly type: "uint256";
|
|
2508
2757
|
readonly indexed: false;
|
|
2509
2758
|
readonly internalType: "uint256";
|
|
2759
|
+
}, {
|
|
2760
|
+
readonly name: "latestLossIndex";
|
|
2761
|
+
readonly type: "uint256";
|
|
2762
|
+
readonly indexed: false;
|
|
2763
|
+
readonly internalType: "uint256";
|
|
2510
2764
|
}];
|
|
2511
2765
|
readonly anonymous: false;
|
|
2512
2766
|
};
|
|
@@ -2523,9 +2777,9 @@ declare const supplyCollateralEvent: {
|
|
|
2523
2777
|
readonly internalType: "address";
|
|
2524
2778
|
}, {
|
|
2525
2779
|
readonly name: "id_";
|
|
2526
|
-
readonly type: "
|
|
2780
|
+
readonly type: "bytes32";
|
|
2527
2781
|
readonly indexed: true;
|
|
2528
|
-
readonly internalType: "
|
|
2782
|
+
readonly internalType: "bytes32";
|
|
2529
2783
|
}, {
|
|
2530
2784
|
readonly name: "collateral";
|
|
2531
2785
|
readonly type: "address";
|
|
@@ -2557,9 +2811,9 @@ declare const withdrawCollateralEvent: {
|
|
|
2557
2811
|
readonly internalType: "address";
|
|
2558
2812
|
}, {
|
|
2559
2813
|
readonly name: "id_";
|
|
2560
|
-
readonly type: "
|
|
2814
|
+
readonly type: "bytes32";
|
|
2561
2815
|
readonly indexed: true;
|
|
2562
|
-
readonly internalType: "
|
|
2816
|
+
readonly internalType: "bytes32";
|
|
2563
2817
|
}, {
|
|
2564
2818
|
readonly name: "collateral";
|
|
2565
2819
|
readonly type: "address";
|
|
@@ -2831,7 +3085,7 @@ declare class InvalidQuoteError extends BaseError<z$1.ZodError | Error> {
|
|
|
2831
3085
|
constructor(error: z$1.ZodError | Error);
|
|
2832
3086
|
}
|
|
2833
3087
|
declare namespace Tick_d_exports {
|
|
2834
|
-
export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, priceToTick, tickToPrice };
|
|
3088
|
+
export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, assetsToObligationUnits, obligationUnitsToAssets, priceToTick, tickToPrice };
|
|
2835
3089
|
}
|
|
2836
3090
|
/** Tick domain supported by Morpho V2. */
|
|
2837
3091
|
declare const TICK_RANGE = 990;
|
|
@@ -2857,6 +3111,20 @@ declare function priceToTick(price: bigint): number;
|
|
|
2857
3111
|
declare namespace priceToTick {
|
|
2858
3112
|
type ErrorType = InvalidPriceError;
|
|
2859
3113
|
}
|
|
3114
|
+
/**
|
|
3115
|
+
* Converts obligation units to assets using the tick price (mulDivDown).
|
|
3116
|
+
* @param obligationUnits - The obligation units to convert.
|
|
3117
|
+
* @param tick - The offer tick.
|
|
3118
|
+
* @returns The equivalent amount in assets.
|
|
3119
|
+
*/
|
|
3120
|
+
declare function obligationUnitsToAssets(obligationUnits: bigint, tick: number): bigint;
|
|
3121
|
+
/**
|
|
3122
|
+
* Converts assets to obligation units using the tick price (mulDivUp).
|
|
3123
|
+
* @param assets - The asset amount to convert.
|
|
3124
|
+
* @param tick - The offer tick.
|
|
3125
|
+
* @returns The equivalent amount in obligation units.
|
|
3126
|
+
*/
|
|
3127
|
+
declare function assetsToObligationUnits(assets: bigint, tick: number): bigint;
|
|
2860
3128
|
declare class InvalidTickError extends BaseError {
|
|
2861
3129
|
readonly name = "Tick.InvalidTickError";
|
|
2862
3130
|
constructor(tick: number);
|
|
@@ -2870,15 +3138,15 @@ declare namespace TradingFee_d_exports {
|
|
|
2870
3138
|
}
|
|
2871
3139
|
/**
|
|
2872
3140
|
* Time breakpoints in seconds for piecewise linear fee interpolation.
|
|
2873
|
-
* Matches on-chain constants: 0d, 1d, 7d, 30d, 90d, 180d.
|
|
3141
|
+
* Matches on-chain constants: 0d, 1d, 7d, 30d, 90d, 180d, 360d.
|
|
2874
3142
|
*/
|
|
2875
|
-
declare const BREAKPOINTS: readonly [0n, 86400n, 604800n, 2592000n, 7776000n, 15552000n];
|
|
3143
|
+
declare const BREAKPOINTS: readonly [0n, 86400n, 604800n, 2592000n, 7776000n, 15552000n, 31104000n];
|
|
2876
3144
|
/** WAD constant (1e18) for fee scaling. */
|
|
2877
3145
|
declare const WAD: bigint;
|
|
2878
|
-
/** Tuple type for the
|
|
2879
|
-
type Fees = readonly [bigint, bigint, bigint, bigint, bigint, bigint];
|
|
3146
|
+
/** Tuple type for the 7 fee values at each breakpoint. */
|
|
3147
|
+
type Fees = readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint];
|
|
2880
3148
|
/**
|
|
2881
|
-
* TradingFee represents a piecewise linear fee curve with
|
|
3149
|
+
* TradingFee represents a piecewise linear fee curve with 7 breakpoints.
|
|
2882
3150
|
* The internal storage mimics on-chain bitmap behavior but uses a struct for clarity.
|
|
2883
3151
|
*/
|
|
2884
3152
|
type TradingFee = {
|
|
@@ -2886,12 +3154,12 @@ type TradingFee = {
|
|
|
2886
3154
|
readonly _fees: Fees;
|
|
2887
3155
|
} & Brand<"TradingFee">;
|
|
2888
3156
|
/**
|
|
2889
|
-
* Create a TradingFee from an activation flag and
|
|
3157
|
+
* Create a TradingFee from an activation flag and 7 fee values.
|
|
2890
3158
|
* @param activated - Whether the fee is active.
|
|
2891
|
-
* @param fees - Tuple of
|
|
3159
|
+
* @param fees - Tuple of 7 fee values in WAD (one per breakpoint: 0d, 1d, 7d, 30d, 90d, 180d, 360d).
|
|
2892
3160
|
* @returns A new TradingFee instance.
|
|
2893
3161
|
* @throws {@link InvalidFeeError} if any fee exceeds WAD (100%).
|
|
2894
|
-
* @throws {@link InvalidFeesLengthError} if fees array doesn't have exactly
|
|
3162
|
+
* @throws {@link InvalidFeesLengthError} if fees array doesn't have exactly 7 elements.
|
|
2895
3163
|
*/
|
|
2896
3164
|
declare function from$6(activated: boolean, fees: Fees): TradingFee;
|
|
2897
3165
|
declare namespace from$6 {
|
|
@@ -2925,7 +3193,7 @@ declare function deactivate(tradingFee: TradingFee): TradingFee;
|
|
|
2925
3193
|
/**
|
|
2926
3194
|
* Get the fee values at each breakpoint.
|
|
2927
3195
|
* @param tradingFee - The TradingFee instance.
|
|
2928
|
-
* @returns The tuple of
|
|
3196
|
+
* @returns The tuple of 7 fee values.
|
|
2929
3197
|
*/
|
|
2930
3198
|
declare function getFees(tradingFee: TradingFee): Fees;
|
|
2931
3199
|
/** Error thrown when a fee value is invalid (negative or exceeds WAD). */
|
|
@@ -2933,7 +3201,7 @@ declare class InvalidFeeError extends BaseError {
|
|
|
2933
3201
|
readonly name = "TradingFee.InvalidFeeError";
|
|
2934
3202
|
constructor(fee: bigint, index: number);
|
|
2935
3203
|
}
|
|
2936
|
-
/** Error thrown when fees array doesn't have exactly
|
|
3204
|
+
/** Error thrown when fees array doesn't have exactly 7 elements. */
|
|
2937
3205
|
declare class InvalidFeesLengthError extends BaseError {
|
|
2938
3206
|
readonly name = "TradingFee.InvalidFeesLengthError";
|
|
2939
3207
|
constructor(length: number);
|
|
@@ -2980,13 +3248,13 @@ declare namespace from$5 {
|
|
|
2980
3248
|
type ReturnType = Transfer;
|
|
2981
3249
|
}
|
|
2982
3250
|
declare namespace Tree_d_exports {
|
|
2983
|
-
export { DecodeError, EncodeError, NormalizedSignatureDomain, Proof, SignatureDomain, SignatureDomainError, Tree, TreeError, VERSION, decode, encode, encodeUnsigned, from$4 as from, proofs, signatureDomain, signatureTypes };
|
|
3251
|
+
export { DecodeError, EncodeError, MAX_COMPRESSED_OFFERS_BYTES, MAX_DECOMPRESSED_OFFERS_BYTES, MAX_OFFERS_PER_TREE, NormalizedSignatureDomain, Proof, SignatureDomain, SignatureDomainError, Tree, TreeError, VERSION, decode, encode, encodeUnsigned, from$4 as from, proofs, signatureDomain, signatureTypes };
|
|
2984
3252
|
}
|
|
2985
3253
|
/**
|
|
2986
3254
|
* A merkle tree of offers built from offer hashes.
|
|
2987
3255
|
* Constructed via {@link from}. The tree root can be signed for onchain broadcast.
|
|
2988
3256
|
*/
|
|
2989
|
-
type Tree = Compute<
|
|
3257
|
+
type Tree = Compute<SimpleMerkleTree & {
|
|
2990
3258
|
/** The offers in the tree. */offers: Offer[]; /** The root of the tree. */
|
|
2991
3259
|
root: Hex;
|
|
2992
3260
|
}>;
|
|
@@ -2994,7 +3262,10 @@ type Proof = {
|
|
|
2994
3262
|
/** The offer that the proof is for. */offer: Offer; /** The merkle proof path for the offer. */
|
|
2995
3263
|
path: Hex[];
|
|
2996
3264
|
};
|
|
2997
|
-
declare const VERSION =
|
|
3265
|
+
declare const VERSION = 2;
|
|
3266
|
+
declare const MAX_COMPRESSED_OFFERS_BYTES = 1000000;
|
|
3267
|
+
declare const MAX_DECOMPRESSED_OFFERS_BYTES = 4000000;
|
|
3268
|
+
declare const MAX_OFFERS_PER_TREE = 100;
|
|
2998
3269
|
type SignatureDomain = {
|
|
2999
3270
|
/** Chain id used in the EIP-712 domain. */chainId: number | bigint; /** MorphoV2 contract address used as verifying contract. */
|
|
3000
3271
|
verifyingContract: Address;
|
|
@@ -3024,11 +3295,10 @@ declare const signatureTypes: {
|
|
|
3024
3295
|
* Builds a Merkle tree from a list of offers.
|
|
3025
3296
|
*
|
|
3026
3297
|
* Leaves are the offer `hash` values as `bytes32` and are deterministically
|
|
3027
|
-
* ordered
|
|
3028
|
-
* root is stable regardless of the input order.
|
|
3298
|
+
* ordered so that the resulting root is stable regardless of the input order.
|
|
3029
3299
|
*
|
|
3030
3300
|
* @param offers - Offers to include in the tree.
|
|
3031
|
-
* @returns A `
|
|
3301
|
+
* @returns A `SimpleMerkleTree` of offer hashes representing the offers.
|
|
3032
3302
|
* @throws {TreeError} If tree building fails due to offer inconsistencies.
|
|
3033
3303
|
*/
|
|
3034
3304
|
declare const from$4: (offers: Offer[]) => Tree;
|
|
@@ -3036,7 +3306,7 @@ declare const from$4: (offers: Offer[]) => Tree;
|
|
|
3036
3306
|
* Generates merkle proofs for all offers in a tree.
|
|
3037
3307
|
*
|
|
3038
3308
|
* Each proof allows independent verification that an offer is included in the tree
|
|
3039
|
-
* without requiring the full tree.
|
|
3309
|
+
* without requiring the full tree.
|
|
3040
3310
|
*
|
|
3041
3311
|
* @param tree - The {@link Tree} to generate proofs for.
|
|
3042
3312
|
* @returns Array of proofs - {@link Proof}
|
|
@@ -3117,10 +3387,11 @@ declare const encodeUnsigned: (tree: Tree) => Hex;
|
|
|
3117
3387
|
* Returns the tree with separately validated signature and recovered signer address.
|
|
3118
3388
|
*
|
|
3119
3389
|
* Validation order:
|
|
3120
|
-
* 1. Version
|
|
3390
|
+
* 1. Version and static size checks
|
|
3121
3391
|
* 2. Signature verification (fail-fast, before decompression)
|
|
3122
|
-
* 3.
|
|
3123
|
-
* 4.
|
|
3392
|
+
* 3. Streaming decompression with byte cap
|
|
3393
|
+
* 4. JSON array + offer count checks
|
|
3394
|
+
* 5. Root verification (computed from offers vs embedded root)
|
|
3124
3395
|
*
|
|
3125
3396
|
* @example
|
|
3126
3397
|
* ```typescript
|
|
@@ -3826,7 +4097,7 @@ interface components {
|
|
|
3826
4097
|
* @example 500000000000000000
|
|
3827
4098
|
*/
|
|
3828
4099
|
price: string; /** @example 369216000000000000000000 */
|
|
3829
|
-
|
|
4100
|
+
obligation_units: string; /** @example 5 */
|
|
3830
4101
|
count: number;
|
|
3831
4102
|
};
|
|
3832
4103
|
BadRequestResponse: {
|
|
@@ -3944,16 +4215,16 @@ interface components {
|
|
|
3944
4215
|
* {
|
|
3945
4216
|
* "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
|
|
3946
4217
|
* "lltv": "860000000000000000",
|
|
4218
|
+
* "max_lif": "0",
|
|
3947
4219
|
* "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
3948
4220
|
* }
|
|
3949
4221
|
* ],
|
|
3950
|
-
* "maturity": 1761922799
|
|
4222
|
+
* "maturity": 1761922799,
|
|
4223
|
+
* "rcf_threshold": "0"
|
|
3951
4224
|
* },
|
|
3952
4225
|
* "buy": false,
|
|
3953
4226
|
* "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
3954
|
-
* "
|
|
3955
|
-
* "obligation_units": "0",
|
|
3956
|
-
* "obligation_shares": "0",
|
|
4227
|
+
* "obligation_units": "369216000000000000000000",
|
|
3957
4228
|
* "start": 1761922790,
|
|
3958
4229
|
* "expiry": 1761922799,
|
|
3959
4230
|
* "tick": 495,
|
|
@@ -3961,7 +4232,8 @@ interface components {
|
|
|
3961
4232
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3962
4233
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
3963
4234
|
* "callback_data": "0x",
|
|
3964
|
-
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4235
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
4236
|
+
* "exit_only": false
|
|
3965
4237
|
* },
|
|
3966
4238
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
3967
4239
|
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf79",
|
|
@@ -3989,16 +4261,16 @@ interface components {
|
|
|
3989
4261
|
* {
|
|
3990
4262
|
* "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
|
|
3991
4263
|
* "lltv": "860000000000000000",
|
|
4264
|
+
* "max_lif": "0",
|
|
3992
4265
|
* "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
3993
4266
|
* }
|
|
3994
4267
|
* ],
|
|
3995
|
-
* "maturity": 1761922799
|
|
4268
|
+
* "maturity": 1761922799,
|
|
4269
|
+
* "rcf_threshold": "0"
|
|
3996
4270
|
* },
|
|
3997
4271
|
* "buy": false,
|
|
3998
4272
|
* "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
3999
|
-
* "
|
|
4000
|
-
* "obligation_units": "0",
|
|
4001
|
-
* "obligation_shares": "0",
|
|
4273
|
+
* "obligation_units": "369216000000000000000000",
|
|
4002
4274
|
* "start": 1761922790,
|
|
4003
4275
|
* "expiry": 1761922799,
|
|
4004
4276
|
* "tick": 495,
|
|
@@ -4006,7 +4278,8 @@ interface components {
|
|
|
4006
4278
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
4007
4279
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
4008
4280
|
* "callback_data": "0x",
|
|
4009
|
-
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4281
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
4282
|
+
* "exit_only": false
|
|
4010
4283
|
* }
|
|
4011
4284
|
*/
|
|
4012
4285
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
@@ -4034,18 +4307,18 @@ interface components {
|
|
|
4034
4307
|
* {
|
|
4035
4308
|
* "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
|
|
4036
4309
|
* "lltv": "860000000000000000",
|
|
4310
|
+
* "max_lif": "0",
|
|
4037
4311
|
* "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4038
4312
|
* }
|
|
4039
4313
|
* ],
|
|
4040
|
-
* "maturity": 1761922799
|
|
4314
|
+
* "maturity": 1761922799,
|
|
4315
|
+
* "rcf_threshold": "0"
|
|
4041
4316
|
* }
|
|
4042
4317
|
*/
|
|
4043
4318
|
obligation: components["schemas"]["ObligationOfferResponse"]; /** @example false */
|
|
4044
4319
|
buy: boolean; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4045
4320
|
maker: string; /** @example 369216000000000000000000 */
|
|
4046
|
-
|
|
4047
|
-
obligation_units: string; /** @example 0 */
|
|
4048
|
-
obligation_shares: string; /** @example 1761922790 */
|
|
4321
|
+
obligation_units: string; /** @example 1761922790 */
|
|
4049
4322
|
start: number; /** @example 1761922799 */
|
|
4050
4323
|
expiry: number; /** @example 495 */
|
|
4051
4324
|
tick: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
@@ -4053,7 +4326,8 @@ interface components {
|
|
|
4053
4326
|
session: string; /** @example 0x0000000000000000000000000000000000000000 */
|
|
4054
4327
|
callback: string; /** @example 0x */
|
|
4055
4328
|
callback_data: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4056
|
-
receiver_if_maker_is_seller: string;
|
|
4329
|
+
receiver_if_maker_is_seller: string; /** @example false */
|
|
4330
|
+
exit_only: boolean;
|
|
4057
4331
|
};
|
|
4058
4332
|
ObligationOfferResponse: {
|
|
4059
4333
|
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */loan_token: string;
|
|
@@ -4062,16 +4336,19 @@ interface components {
|
|
|
4062
4336
|
* {
|
|
4063
4337
|
* "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
|
|
4064
4338
|
* "lltv": "860000000000000000",
|
|
4339
|
+
* "max_lif": "0",
|
|
4065
4340
|
* "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4066
4341
|
* }
|
|
4067
4342
|
* ]
|
|
4068
4343
|
*/
|
|
4069
4344
|
collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922799 */
|
|
4070
|
-
maturity: number;
|
|
4345
|
+
maturity: number; /** @example 0 */
|
|
4346
|
+
rcf_threshold: string;
|
|
4071
4347
|
};
|
|
4072
4348
|
CollateralResponse: {
|
|
4073
4349
|
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */token: string; /** @example 860000000000000000 */
|
|
4074
|
-
lltv: string; /** @example
|
|
4350
|
+
lltv: string; /** @example 0 */
|
|
4351
|
+
max_lif: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4075
4352
|
oracle: string;
|
|
4076
4353
|
};
|
|
4077
4354
|
ObligationListResponse: {
|
|
@@ -4084,7 +4361,8 @@ interface components {
|
|
|
4084
4361
|
chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
4085
4362
|
loan_token: string;
|
|
4086
4363
|
collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922800 */
|
|
4087
|
-
maturity: number;
|
|
4364
|
+
maturity: number; /** @example 0 */
|
|
4365
|
+
rcf_threshold: string;
|
|
4088
4366
|
ask: components["schemas"]["AskResponse"];
|
|
4089
4367
|
bid: components["schemas"]["BidResponse"];
|
|
4090
4368
|
};
|
|
@@ -4208,7 +4486,7 @@ interface components {
|
|
|
4208
4486
|
* "chain_id": 1,
|
|
4209
4487
|
* "contract": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
|
|
4210
4488
|
* "user": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
4211
|
-
* "obligation_id": "
|
|
4489
|
+
* "obligation_id": "0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
|
|
4212
4490
|
* "reserved": "200000000000000000000",
|
|
4213
4491
|
* "block_number": 21345678
|
|
4214
4492
|
* }
|
|
@@ -4222,7 +4500,7 @@ interface components {
|
|
|
4222
4500
|
user: string;
|
|
4223
4501
|
/**
|
|
4224
4502
|
* @description Obligation id this reserved amount belongs to, or null if no lots exist.
|
|
4225
|
-
* @example
|
|
4503
|
+
* @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67
|
|
4226
4504
|
*/
|
|
4227
4505
|
obligation_id: string | null; /** @example 200000000000000000000 */
|
|
4228
4506
|
reserved: string; /** @example 21345678 */
|
|
@@ -4238,11 +4516,10 @@ interface components {
|
|
|
4238
4516
|
};
|
|
4239
4517
|
ValidateOfferRequest: {
|
|
4240
4518
|
/** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
|
|
4241
|
-
|
|
4242
|
-
obligation_units?: string; /** @example 0 */
|
|
4243
|
-
obligation_shares?: string; /** @example 495 */
|
|
4519
|
+
obligation_units?: string; /** @example 495 */
|
|
4244
4520
|
tick: number; /** @example 1761922799 */
|
|
4245
|
-
maturity: number; /** @example
|
|
4521
|
+
maturity: number; /** @example 0 */
|
|
4522
|
+
rcf_threshold: string; /** @example 1761922799 */
|
|
4246
4523
|
expiry: number; /** @example 1761922790 */
|
|
4247
4524
|
start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
4248
4525
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
@@ -4254,7 +4531,8 @@ interface components {
|
|
|
4254
4531
|
* {
|
|
4255
4532
|
* "asset": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
|
|
4256
4533
|
* "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
4257
|
-
* "lltv": "860000000000000000"
|
|
4534
|
+
* "lltv": "860000000000000000",
|
|
4535
|
+
* "max_lif": "0"
|
|
4258
4536
|
* }
|
|
4259
4537
|
* ]
|
|
4260
4538
|
*/
|
|
@@ -4266,12 +4544,14 @@ interface components {
|
|
|
4266
4544
|
* }
|
|
4267
4545
|
*/
|
|
4268
4546
|
callback: components["schemas"]["ValidateCallbackRequest"]; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4269
|
-
receiver_if_maker_is_seller: string;
|
|
4547
|
+
receiver_if_maker_is_seller: string; /** @example false */
|
|
4548
|
+
exit_only?: boolean;
|
|
4270
4549
|
};
|
|
4271
4550
|
ValidateCollateralRequest: {
|
|
4272
4551
|
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */asset: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4273
4552
|
oracle: string; /** @example 860000000000000000 */
|
|
4274
|
-
lltv: string;
|
|
4553
|
+
lltv: string; /** @example 0 */
|
|
4554
|
+
max_lif: string;
|
|
4275
4555
|
};
|
|
4276
4556
|
ValidateCallbackRequest: {
|
|
4277
4557
|
/** @example 0x0000000000000000000000000000000000000000 */address: string; /** @example 0x */
|
|
@@ -4322,11 +4602,10 @@ type Input = Readonly<{
|
|
|
4322
4602
|
hash: Hex;
|
|
4323
4603
|
obligationId: Hex;
|
|
4324
4604
|
maker: Address;
|
|
4325
|
-
assets: bigint;
|
|
4326
4605
|
obligationUnits: bigint;
|
|
4327
|
-
obligationShares: bigint;
|
|
4328
4606
|
tick: number;
|
|
4329
4607
|
maturity: number;
|
|
4608
|
+
rcfThreshold: bigint;
|
|
4330
4609
|
expiry: number;
|
|
4331
4610
|
start: number;
|
|
4332
4611
|
group: Hex;
|
|
@@ -4337,6 +4616,7 @@ type Input = Readonly<{
|
|
|
4337
4616
|
collaterals: Readonly<{
|
|
4338
4617
|
asset: Address;
|
|
4339
4618
|
lltv: bigint;
|
|
4619
|
+
maxLif: bigint;
|
|
4340
4620
|
oracle: Address;
|
|
4341
4621
|
}[]>;
|
|
4342
4622
|
callback: {
|
|
@@ -4344,6 +4624,7 @@ type Input = Readonly<{
|
|
|
4344
4624
|
data: Hex;
|
|
4345
4625
|
};
|
|
4346
4626
|
receiverIfMakerIsSeller: Address;
|
|
4627
|
+
exitOnly: boolean;
|
|
4347
4628
|
root?: Hex | undefined;
|
|
4348
4629
|
proof?: Hex[] | undefined;
|
|
4349
4630
|
signature?: Hex | undefined;
|
|
@@ -4498,10 +4779,10 @@ declare const schemas: {
|
|
|
4498
4779
|
loan_token: "loan_token";
|
|
4499
4780
|
collateral_token: "collateral_token";
|
|
4500
4781
|
oracle: "oracle";
|
|
4782
|
+
min_duration: "min_duration";
|
|
4783
|
+
max_collaterals: "max_collaterals";
|
|
4501
4784
|
group_consistency: "group_consistency";
|
|
4502
4785
|
group_immutability: "group_immutability";
|
|
4503
|
-
max_collaterals: "max_collaterals";
|
|
4504
|
-
min_duration: "min_duration";
|
|
4505
4786
|
}>>>>;
|
|
4506
4787
|
chains: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>>>>;
|
|
4507
4788
|
}, z$1.core.$strip>;
|
|
@@ -4902,7 +5183,7 @@ declare const morphoRules: (parameters: {
|
|
|
4902
5183
|
};
|
|
4903
5184
|
}) => Rule<Offer, string>[];
|
|
4904
5185
|
declare namespace Rules_d_exports {
|
|
4905
|
-
export {
|
|
5186
|
+
export { amountNonZero, callback, collateralToken, groupConsistency, groupImmutability, loanToken, maturity, maxCollaterals, minDuration, oracle, sameMaker };
|
|
4906
5187
|
}
|
|
4907
5188
|
declare const maturity: ({
|
|
4908
5189
|
maturities
|
|
@@ -4957,11 +5238,6 @@ declare const oracle: ({
|
|
|
4957
5238
|
* This rule is signing-agnostic; signer verification is handled at the collector level.
|
|
4958
5239
|
*/
|
|
4959
5240
|
declare const sameMaker: () => Rule<Offer, "mixed_maker">;
|
|
4960
|
-
/**
|
|
4961
|
-
* A validation rule that ensures mutual exclusivity of offer amount fields.
|
|
4962
|
-
* At most one of (assets, obligationUnits, obligationShares) can be non-zero.
|
|
4963
|
-
* Matches contract requirement: `atMostOneNonZero(offer.assets, offer.obligationUnits, offer.obligationShares)`.
|
|
4964
|
-
*/
|
|
4965
5241
|
/**
|
|
4966
5242
|
* A validation rule that checks if the offer duration (expiry - start) meets a minimum threshold.
|
|
4967
5243
|
* @param minSeconds - Minimum required duration in seconds.
|
|
@@ -4983,10 +5259,16 @@ declare const maxCollaterals: ({
|
|
|
4983
5259
|
}: {
|
|
4984
5260
|
max: number;
|
|
4985
5261
|
}) => Rule<Offer, "max_collaterals">;
|
|
4986
|
-
|
|
5262
|
+
/**
|
|
5263
|
+
* A validation rule that checks if the offer's obligationUnits is non-zero.
|
|
5264
|
+
* The contract requires a positive amount; this rule rejects early.
|
|
5265
|
+
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
5266
|
+
*/
|
|
5267
|
+
declare const amountNonZero: () => Rule<Offer, "amount_non_zero">;
|
|
4987
5268
|
/**
|
|
4988
5269
|
* A batch validation rule that ensures all offers within the same group are consistent.
|
|
4989
|
-
* All offers sharing the same group must have the same loan token,
|
|
5270
|
+
* All offers sharing the same group must have the same loan token, obligationUnits,
|
|
5271
|
+
* and side (buy/sell). The contract tracks consumed per group and requires these to match.
|
|
4990
5272
|
*/
|
|
4991
5273
|
declare const groupConsistency: () => Rule<Offer, "group_consistency">;
|
|
4992
5274
|
/**
|
|
@@ -5130,6 +5412,20 @@ declare function lazy<T>(pollFn: (emit: (value: T) => void, {
|
|
|
5130
5412
|
stop: () => void;
|
|
5131
5413
|
}) => () => boolean): () => AsyncGenerator<Awaited<NonNullable<T>>, void, unknown>;
|
|
5132
5414
|
//#endregion
|
|
5415
|
+
//#region src/utils/mapWithConcurrency.d.ts
|
|
5416
|
+
/**
|
|
5417
|
+
* Map values with a bounded number of concurrent async workers.
|
|
5418
|
+
*
|
|
5419
|
+
* Result ordering always matches the input order.
|
|
5420
|
+
* @param parameters - Input values, concurrency limit, and async mapper.
|
|
5421
|
+
* @returns Mapped results in input order.
|
|
5422
|
+
*/
|
|
5423
|
+
declare function mapWithConcurrency<value, result>(parameters: {
|
|
5424
|
+
values: value[];
|
|
5425
|
+
limit: number;
|
|
5426
|
+
run: (value: value, index: number) => Promise<result>;
|
|
5427
|
+
}): Promise<result[]>;
|
|
5428
|
+
//#endregion
|
|
5133
5429
|
//#region src/utils/poll.d.ts
|
|
5134
5430
|
/**
|
|
5135
5431
|
* Polls a function at a specified interval.
|
|
@@ -5145,8 +5441,19 @@ declare function poll<data>(fn: ({
|
|
|
5145
5441
|
interval: () => Promise<number>;
|
|
5146
5442
|
}): () => boolean;
|
|
5147
5443
|
declare namespace Random_d_exports {
|
|
5148
|
-
export { address, bool, bytes, float, hex, int, seed, withSeed };
|
|
5444
|
+
export { SeededRng, address, bool, bytes, createRng, float, hex, int, seed, withSeed };
|
|
5445
|
+
}
|
|
5446
|
+
/** Isolated RNG instance with convenience methods. */
|
|
5447
|
+
interface SeededRng {
|
|
5448
|
+
float(): number;
|
|
5449
|
+
int(maxExclusive: number, min?: number): number;
|
|
5450
|
+
bool(probability?: number): boolean;
|
|
5149
5451
|
}
|
|
5452
|
+
/**
|
|
5453
|
+
* Creates an isolated seeded RNG instance — safe for concurrent use.
|
|
5454
|
+
* @param seed - Seed string used to derive the initial RNG state.
|
|
5455
|
+
*/
|
|
5456
|
+
declare function createRng(seed: string): SeededRng;
|
|
5150
5457
|
/**
|
|
5151
5458
|
* Runs a function with a deterministic RNG derived from the given seed.
|
|
5152
5459
|
*/
|
|
@@ -5188,10 +5495,19 @@ declare namespace time_d_exports {
|
|
|
5188
5495
|
declare function now(): number;
|
|
5189
5496
|
declare function max$1(): number;
|
|
5190
5497
|
//#endregion
|
|
5498
|
+
//#region src/utils/trim.d.ts
|
|
5499
|
+
/**
|
|
5500
|
+
* Keep the last `keep` entries from an array.
|
|
5501
|
+
* @param array - Source array.
|
|
5502
|
+
* @param keep - Number of entries to keep.
|
|
5503
|
+
* @returns Trimmed copy.
|
|
5504
|
+
*/
|
|
5505
|
+
declare const trimTail: <entry>(array: readonly entry[], keep: number) => entry[];
|
|
5506
|
+
//#endregion
|
|
5191
5507
|
//#region src/utils/wait.d.ts
|
|
5192
5508
|
declare function wait(time: number): Promise<unknown>;
|
|
5193
5509
|
declare namespace index_d_exports$2 {
|
|
5194
|
-
export { BaseError, GlobalErrorType, Group_d_exports as Group, Random_d_exports as Random, ReorgError, Snake, time_d_exports as Time, atMostOneNonZero, batch, batchMulticall, fromSnakeCase$3 as fromSnakeCase, lazy, max$2 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, wait };
|
|
5510
|
+
export { BaseError, GlobalErrorType, Group_d_exports as Group, Random_d_exports as Random, ReorgError, Snake, time_d_exports as Time, atMostOneNonZero, batch, batchMulticall, fromSnakeCase$3 as fromSnakeCase, lazy, mapWithConcurrency, max$2 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, trimTail, wait };
|
|
5195
5511
|
}
|
|
5196
5512
|
//#endregion
|
|
5197
5513
|
export { index_d_exports as Abi, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainRegistry_d_exports as ChainRegistry, Collateral_d_exports as Collateral, Compute, ConfigRule, ConfigRulesPayload, ERC4626_d_exports as ERC4626, ErrorPayload, Errors_d_exports as Errors, Format_d_exports as Format, Gatekeeper_d_exports as Gatekeeper, Client_d_exports as GatekeeperClient, Id_d_exports as Id, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Maturity_d_exports as Maturity, MempoolClient_d_exports as Mempool, Obligation_d_exports as Obligation, Offer_d_exports as Offer, Oracle_d_exports as Oracle, Position_d_exports as Position, Quote_d_exports as Quote, index_d_exports$1 as RouterApi, Client_d_exports$1 as RouterClient, Rules_d_exports as Rules, SuccessPayload, Tick_d_exports as Tick, time_d_exports as Time, TradingFee_d_exports as TradingFee, Transfer_d_exports as Transfer, Tree_d_exports as Tree, index_d_exports$2 as Utils, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules };
|