@morpho-dev/router 0.10.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.
Files changed (60) hide show
  1. package/README.md +20 -5
  2. package/dist/cli.js +14944 -8994
  3. package/dist/drizzle/migrations/0031_sell-takeable-reindex.sql +254 -0
  4. package/dist/drizzle/migrations/0032_callback-type.sql +3 -0
  5. package/dist/drizzle/migrations/0033_obligation-id-bytes20.sql +255 -0
  6. package/dist/drizzle/migrations/0034_chain-checkpoints.sql +1 -0
  7. package/dist/drizzle/migrations/0035_chain-tip-hash-cas.sql +1 -0
  8. package/dist/drizzle/migrations/0036_pending-links.sql +22 -0
  9. package/dist/drizzle/migrations/0037_chain-finalized-anchor.sql +2 -0
  10. package/dist/drizzle/migrations/0038_add-obligation-rcf-threshold.sql +2 -0
  11. package/dist/drizzle/migrations/0039_add-offers-composite-indexes.sql +2 -0
  12. package/dist/drizzle/migrations/0040_drop-redundant-offers-indexes.sql +2 -0
  13. package/dist/drizzle/migrations/0041_add-group-winner-expression-index.sql +10 -0
  14. package/dist/drizzle/migrations/0042_contract-sync-v1.14.sql +284 -0
  15. package/dist/drizzle/migrations/0043_add-obligation-side-tick-index.sql +1 -0
  16. package/dist/drizzle/migrations/0044_index-audit-cleanup.sql +27 -0
  17. package/dist/drizzle/migrations/0045_add-lots-offsets-availability-indexes.sql +5 -0
  18. package/dist/drizzle/migrations/0046_add-offers-active-tick-index.sql +1 -0
  19. package/dist/drizzle/migrations/0047_add-offers-book-winners-index.sql +1 -0
  20. package/dist/drizzle/migrations/0048_covering-indexes-for-winners-queries.sql +34 -0
  21. package/dist/drizzle/migrations/0049_contract-sync-v1.15.sql +305 -0
  22. package/dist/drizzle/migrations/meta/0031_snapshot.json +1652 -0
  23. package/dist/drizzle/migrations/meta/0033_snapshot.json +1658 -0
  24. package/dist/drizzle/migrations/meta/0036_snapshot.json +1864 -0
  25. package/dist/drizzle/migrations/meta/0037_snapshot.json +1876 -0
  26. package/dist/drizzle/migrations/meta/0038_snapshot.json +1882 -0
  27. package/dist/drizzle/migrations/meta/0039_snapshot.json +1960 -0
  28. package/dist/drizzle/migrations/meta/0040_snapshot.json +1912 -0
  29. package/dist/drizzle/migrations/meta/0041_snapshot.json +1912 -0
  30. package/dist/drizzle/migrations/meta/0042_snapshot.json +1882 -0
  31. package/dist/drizzle/migrations/meta/0043_snapshot.json +1909 -0
  32. package/dist/drizzle/migrations/meta/0044_snapshot.json +1853 -0
  33. package/dist/drizzle/migrations/meta/0045_snapshot.json +1921 -0
  34. package/dist/drizzle/migrations/meta/0046_snapshot.json +1966 -0
  35. package/dist/drizzle/migrations/meta/0047_snapshot.json +2005 -0
  36. package/dist/drizzle/migrations/meta/0048_snapshot.json +2035 -0
  37. package/dist/drizzle/migrations/meta/0049_snapshot.json +2035 -0
  38. package/dist/drizzle/migrations/meta/_journal.json +133 -0
  39. package/dist/evm/bytecode/morpho.txt +1 -1
  40. package/dist/index.browser.d.mts +784 -282
  41. package/dist/index.browser.d.mts.map +1 -1
  42. package/dist/index.browser.mjs +1516 -675
  43. package/dist/index.browser.mjs.map +1 -1
  44. package/dist/index.node.d.mts +1676 -602
  45. package/dist/index.node.d.mts.map +1 -1
  46. package/dist/index.node.mjs +10121 -5251
  47. package/dist/index.node.mjs.map +1 -1
  48. package/dist/register-otel-hook.js +7 -0
  49. package/dist/server-D4xxddev.js +9573 -0
  50. package/dist/server.js +9617 -0
  51. package/docs/integrator.md +14 -24
  52. package/package.json +36 -29
  53. package/dist/index.browser.d.ts +0 -5007
  54. package/dist/index.browser.d.ts.map +0 -1
  55. package/dist/index.browser.js +0 -5825
  56. package/dist/index.browser.js.map +0 -1
  57. package/dist/index.node.d.ts +0 -8263
  58. package/dist/index.node.d.ts.map +0 -1
  59. package/dist/index.node.js +0 -12566
  60. package/dist/index.node.js.map +0 -1
@@ -1,8 +1,9 @@
1
1
  import { AbiEvent, Account, Address, ChainContract, ChainFormatters, Client, GetLogsReturnType, Hex, MulticallParameters, PublicClient, Transport, WalletClient } from "viem";
2
2
  import { Chain } from "viem/chains";
3
3
  import * as z$1 from "zod";
4
- import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
4
+ import { SimpleMerkleTree } from "@openzeppelin/merkle-tree";
5
5
  import * as drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
6
+ import { Hono } from "hono";
6
7
  import { z } from "zod/v4";
7
8
  import "reflect-metadata";
8
9
  import { OpenAPIDocument } from "openapi-metadata";
@@ -156,7 +157,7 @@ declare const MorphoV2: readonly [{
156
157
  readonly stateMutability: "nonpayable";
157
158
  readonly inputs: readonly [];
158
159
  }, {
159
- readonly name: "collateralOf";
160
+ readonly name: "activatedCollaterals";
160
161
  readonly type: "function";
161
162
  readonly stateMutability: "view";
162
163
  readonly inputs: readonly [{
@@ -165,25 +166,27 @@ declare const MorphoV2: readonly [{
165
166
  }, {
166
167
  readonly type: "address";
167
168
  readonly name: "user";
168
- }, {
169
- readonly type: "address";
170
- readonly name: "collateralToken";
171
169
  }];
172
170
  readonly outputs: readonly [{
173
- readonly type: "uint256";
171
+ readonly type: "uint128";
174
172
  }];
175
173
  }, {
176
- readonly name: "consume";
174
+ readonly name: "collateralOf";
177
175
  readonly type: "function";
178
- readonly stateMutability: "nonpayable";
176
+ readonly stateMutability: "view";
179
177
  readonly inputs: readonly [{
180
178
  readonly type: "bytes32";
181
- readonly name: "group";
179
+ readonly name: "id";
180
+ }, {
181
+ readonly type: "address";
182
+ readonly name: "user";
182
183
  }, {
183
184
  readonly type: "uint256";
184
- readonly name: "amount";
185
+ readonly name: "index";
186
+ }];
187
+ readonly outputs: readonly [{
188
+ readonly type: "uint128";
185
189
  }];
186
- readonly outputs: readonly [];
187
190
  }, {
188
191
  readonly name: "consumed";
189
192
  readonly type: "function";
@@ -198,6 +201,34 @@ declare const MorphoV2: readonly [{
198
201
  readonly outputs: readonly [{
199
202
  readonly type: "uint256";
200
203
  }];
204
+ }, {
205
+ readonly name: "creditAfterSlashing";
206
+ readonly type: "function";
207
+ readonly stateMutability: "view";
208
+ readonly inputs: readonly [{
209
+ readonly type: "bytes32";
210
+ readonly name: "id";
211
+ }, {
212
+ readonly type: "address";
213
+ readonly name: "user";
214
+ }];
215
+ readonly outputs: readonly [{
216
+ readonly type: "uint256";
217
+ }];
218
+ }, {
219
+ readonly name: "creditOf";
220
+ readonly type: "function";
221
+ readonly stateMutability: "view";
222
+ readonly inputs: readonly [{
223
+ readonly type: "bytes32";
224
+ readonly name: "id";
225
+ }, {
226
+ readonly type: "address";
227
+ readonly name: "user";
228
+ }];
229
+ readonly outputs: readonly [{
230
+ readonly type: "uint256";
231
+ }];
201
232
  }, {
202
233
  readonly name: "debtOf";
203
234
  readonly type: "function";
@@ -221,7 +252,6 @@ declare const MorphoV2: readonly [{
221
252
  readonly name: "loanToken";
222
253
  }, {
223
254
  readonly type: "uint256";
224
- readonly name: "index";
225
255
  }];
226
256
  readonly outputs: readonly [{
227
257
  readonly type: "uint16";
@@ -243,7 +273,7 @@ declare const MorphoV2: readonly [{
243
273
  readonly name: "id";
244
274
  }];
245
275
  readonly outputs: readonly [{
246
- readonly type: "uint16[6]";
276
+ readonly type: "uint16[7]";
247
277
  }];
248
278
  }, {
249
279
  readonly name: "flashLoan";
@@ -263,6 +293,20 @@ declare const MorphoV2: readonly [{
263
293
  readonly name: "data";
264
294
  }];
265
295
  readonly outputs: readonly [];
296
+ }, {
297
+ readonly name: "isAuthorized";
298
+ readonly type: "function";
299
+ readonly stateMutability: "view";
300
+ readonly inputs: readonly [{
301
+ readonly type: "address";
302
+ readonly name: "authorizer";
303
+ }, {
304
+ readonly type: "address";
305
+ readonly name: "authorized";
306
+ }];
307
+ readonly outputs: readonly [{
308
+ readonly type: "bool";
309
+ }];
266
310
  }, {
267
311
  readonly name: "isHealthy";
268
312
  readonly type: "function";
@@ -280,6 +324,9 @@ declare const MorphoV2: readonly [{
280
324
  }, {
281
325
  readonly type: "uint256";
282
326
  readonly name: "lltv";
327
+ }, {
328
+ readonly type: "uint256";
329
+ readonly name: "maxLif";
283
330
  }, {
284
331
  readonly type: "address";
285
332
  readonly name: "oracle";
@@ -288,6 +335,9 @@ declare const MorphoV2: readonly [{
288
335
  }, {
289
336
  readonly type: "uint256";
290
337
  readonly name: "maturity";
338
+ }, {
339
+ readonly type: "uint256";
340
+ readonly name: "rcfThreshold";
291
341
  }];
292
342
  readonly name: "obligation";
293
343
  }, {
@@ -317,6 +367,9 @@ declare const MorphoV2: readonly [{
317
367
  }, {
318
368
  readonly type: "uint256";
319
369
  readonly name: "lltv";
370
+ }, {
371
+ readonly type: "uint256";
372
+ readonly name: "maxLif";
320
373
  }, {
321
374
  readonly type: "address";
322
375
  readonly name: "oracle";
@@ -325,21 +378,20 @@ declare const MorphoV2: readonly [{
325
378
  }, {
326
379
  readonly type: "uint256";
327
380
  readonly name: "maturity";
328
- }];
329
- readonly name: "obligation";
330
- }, {
331
- readonly type: "tuple[]";
332
- readonly components: readonly [{
333
- readonly type: "uint256";
334
- readonly name: "collateralIndex";
335
- }, {
336
- readonly type: "uint256";
337
- readonly name: "repaid";
338
381
  }, {
339
382
  readonly type: "uint256";
340
- readonly name: "seized";
383
+ readonly name: "rcfThreshold";
341
384
  }];
342
- readonly name: "seizures";
385
+ readonly name: "obligation";
386
+ }, {
387
+ readonly type: "uint256";
388
+ readonly name: "collateralIndex";
389
+ }, {
390
+ readonly type: "uint256";
391
+ readonly name: "seizedAssets";
392
+ }, {
393
+ readonly type: "uint256";
394
+ readonly name: "repaidUnits";
343
395
  }, {
344
396
  readonly type: "address";
345
397
  readonly name: "borrower";
@@ -348,17 +400,67 @@ declare const MorphoV2: readonly [{
348
400
  readonly name: "data";
349
401
  }];
350
402
  readonly outputs: readonly [{
351
- readonly type: "tuple[]";
352
- readonly components: readonly [{
353
- readonly type: "uint256";
354
- readonly name: "collateralIndex";
355
- }, {
356
- readonly type: "uint256";
357
- readonly name: "repaid";
358
- }, {
359
- readonly type: "uint256";
360
- readonly name: "seized";
361
- }];
403
+ readonly type: "uint256";
404
+ }, {
405
+ readonly type: "uint256";
406
+ }];
407
+ }, {
408
+ readonly name: "maxCollateralPerUser";
409
+ readonly type: "function";
410
+ readonly stateMutability: "view";
411
+ readonly inputs: readonly [{
412
+ readonly type: "address";
413
+ readonly name: "collateralToken";
414
+ }];
415
+ readonly outputs: readonly [{
416
+ readonly type: "uint256";
417
+ }];
418
+ }, {
419
+ readonly name: "maxLif";
420
+ readonly type: "function";
421
+ readonly stateMutability: "pure";
422
+ readonly inputs: readonly [{
423
+ readonly type: "uint256";
424
+ readonly name: "lltv";
425
+ }, {
426
+ readonly type: "uint256";
427
+ readonly name: "cursor";
428
+ }];
429
+ readonly outputs: readonly [{
430
+ readonly type: "uint256";
431
+ }];
432
+ }, {
433
+ readonly name: "maxTakeableAssets";
434
+ readonly type: "function";
435
+ readonly stateMutability: "view";
436
+ readonly inputs: readonly [{
437
+ readonly type: "address";
438
+ readonly name: "loanToken";
439
+ }];
440
+ readonly outputs: readonly [{
441
+ readonly type: "uint256";
442
+ }];
443
+ }, {
444
+ readonly name: "maxTotalUnits";
445
+ readonly type: "function";
446
+ readonly stateMutability: "view";
447
+ readonly inputs: readonly [{
448
+ readonly type: "address";
449
+ readonly name: "loanToken";
450
+ }];
451
+ readonly outputs: readonly [{
452
+ readonly type: "uint128";
453
+ }];
454
+ }, {
455
+ readonly name: "maxTradingFee";
456
+ readonly type: "function";
457
+ readonly stateMutability: "pure";
458
+ readonly inputs: readonly [{
459
+ readonly type: "uint256";
460
+ readonly name: "index";
461
+ }];
462
+ readonly outputs: readonly [{
463
+ readonly type: "uint256";
362
464
  }];
363
465
  }, {
364
466
  readonly name: "multicall";
@@ -391,12 +493,12 @@ declare const MorphoV2: readonly [{
391
493
  readonly outputs: readonly [{
392
494
  readonly type: "uint128";
393
495
  readonly name: "totalUnits";
394
- }, {
395
- readonly type: "uint128";
396
- readonly name: "totalShares";
397
496
  }, {
398
497
  readonly type: "uint256";
399
498
  readonly name: "withdrawable";
499
+ }, {
500
+ readonly type: "uint128";
501
+ readonly name: "lossIndex";
400
502
  }, {
401
503
  readonly type: "bool";
402
504
  readonly name: "created";
@@ -426,6 +528,9 @@ declare const MorphoV2: readonly [{
426
528
  }, {
427
529
  readonly type: "uint256";
428
530
  readonly name: "lltv";
531
+ }, {
532
+ readonly type: "uint256";
533
+ readonly name: "maxLif";
429
534
  }, {
430
535
  readonly type: "address";
431
536
  readonly name: "oracle";
@@ -434,6 +539,9 @@ declare const MorphoV2: readonly [{
434
539
  }, {
435
540
  readonly type: "uint256";
436
541
  readonly name: "maturity";
542
+ }, {
543
+ readonly type: "uint256";
544
+ readonly name: "rcfThreshold";
437
545
  }];
438
546
  readonly name: "obligation";
439
547
  }, {
@@ -455,6 +563,21 @@ declare const MorphoV2: readonly [{
455
563
  readonly outputs: readonly [{
456
564
  readonly type: "bytes32";
457
565
  }];
566
+ }, {
567
+ readonly name: "setConsumed";
568
+ readonly type: "function";
569
+ readonly stateMutability: "nonpayable";
570
+ readonly inputs: readonly [{
571
+ readonly type: "bytes32";
572
+ readonly name: "group";
573
+ }, {
574
+ readonly type: "uint256";
575
+ readonly name: "amount";
576
+ }, {
577
+ readonly type: "address";
578
+ readonly name: "onBehalf";
579
+ }];
580
+ readonly outputs: readonly [];
458
581
  }, {
459
582
  readonly name: "setDefaultTradingFee";
460
583
  readonly type: "function";
@@ -479,6 +602,57 @@ declare const MorphoV2: readonly [{
479
602
  readonly name: "newFeeSetter";
480
603
  }];
481
604
  readonly outputs: readonly [];
605
+ }, {
606
+ readonly name: "setIsAuthorized";
607
+ readonly type: "function";
608
+ readonly stateMutability: "nonpayable";
609
+ readonly inputs: readonly [{
610
+ readonly type: "address";
611
+ readonly name: "onBehalf";
612
+ }, {
613
+ readonly type: "address";
614
+ readonly name: "authorized";
615
+ }, {
616
+ readonly type: "bool";
617
+ readonly name: "newIsAuthorized";
618
+ }];
619
+ readonly outputs: readonly [];
620
+ }, {
621
+ readonly name: "setMaxCollateralPerUser";
622
+ readonly type: "function";
623
+ readonly stateMutability: "nonpayable";
624
+ readonly inputs: readonly [{
625
+ readonly type: "address";
626
+ readonly name: "collateralToken";
627
+ }, {
628
+ readonly type: "uint256";
629
+ readonly name: "newMaxCollateralPerUser";
630
+ }];
631
+ readonly outputs: readonly [];
632
+ }, {
633
+ readonly name: "setMaxTakeableAssets";
634
+ readonly type: "function";
635
+ readonly stateMutability: "nonpayable";
636
+ readonly inputs: readonly [{
637
+ readonly type: "address";
638
+ readonly name: "loanToken";
639
+ }, {
640
+ readonly type: "uint256";
641
+ readonly name: "newMaxTakeableAssets";
642
+ }];
643
+ readonly outputs: readonly [];
644
+ }, {
645
+ readonly name: "setMaxTotalUnits";
646
+ readonly type: "function";
647
+ readonly stateMutability: "nonpayable";
648
+ readonly inputs: readonly [{
649
+ readonly type: "address";
650
+ readonly name: "loanToken";
651
+ }, {
652
+ readonly type: "uint128";
653
+ readonly name: "newMaxTotalUnits";
654
+ }];
655
+ readonly outputs: readonly [];
482
656
  }, {
483
657
  readonly name: "setObligationTradingFee";
484
658
  readonly type: "function";
@@ -513,9 +687,18 @@ declare const MorphoV2: readonly [{
513
687
  }];
514
688
  readonly outputs: readonly [];
515
689
  }, {
516
- readonly name: "sharesOf";
690
+ readonly name: "shuffleSession";
517
691
  readonly type: "function";
518
- readonly stateMutability: "view";
692
+ readonly stateMutability: "nonpayable";
693
+ readonly inputs: readonly [{
694
+ readonly type: "address";
695
+ readonly name: "onBehalf";
696
+ }];
697
+ readonly outputs: readonly [];
698
+ }, {
699
+ readonly name: "slash";
700
+ readonly type: "function";
701
+ readonly stateMutability: "nonpayable";
519
702
  readonly inputs: readonly [{
520
703
  readonly type: "bytes32";
521
704
  readonly name: "id";
@@ -523,14 +706,6 @@ declare const MorphoV2: readonly [{
523
706
  readonly type: "address";
524
707
  readonly name: "user";
525
708
  }];
526
- readonly outputs: readonly [{
527
- readonly type: "uint256";
528
- }];
529
- }, {
530
- readonly name: "shuffleSession";
531
- readonly type: "function";
532
- readonly stateMutability: "nonpayable";
533
- readonly inputs: readonly [];
534
709
  readonly outputs: readonly [];
535
710
  }, {
536
711
  readonly name: "supplyCollateral";
@@ -549,6 +724,9 @@ declare const MorphoV2: readonly [{
549
724
  }, {
550
725
  readonly type: "uint256";
551
726
  readonly name: "lltv";
727
+ }, {
728
+ readonly type: "uint256";
729
+ readonly name: "maxLif";
552
730
  }, {
553
731
  readonly type: "address";
554
732
  readonly name: "oracle";
@@ -557,11 +735,14 @@ declare const MorphoV2: readonly [{
557
735
  }, {
558
736
  readonly type: "uint256";
559
737
  readonly name: "maturity";
738
+ }, {
739
+ readonly type: "uint256";
740
+ readonly name: "rcfThreshold";
560
741
  }];
561
742
  readonly name: "obligation";
562
743
  }, {
563
- readonly type: "address";
564
- readonly name: "collateral";
744
+ readonly type: "uint256";
745
+ readonly name: "collateralIndex";
565
746
  }, {
566
747
  readonly type: "uint256";
567
748
  readonly name: "assets";
@@ -575,17 +756,8 @@ declare const MorphoV2: readonly [{
575
756
  readonly type: "function";
576
757
  readonly stateMutability: "nonpayable";
577
758
  readonly inputs: readonly [{
578
- readonly type: "uint256";
579
- readonly name: "buyerAssets";
580
- }, {
581
- readonly type: "uint256";
582
- readonly name: "sellerAssets";
583
- }, {
584
759
  readonly type: "uint256";
585
760
  readonly name: "obligationUnits";
586
- }, {
587
- readonly type: "uint256";
588
- readonly name: "obligationShares";
589
761
  }, {
590
762
  readonly type: "address";
591
763
  readonly name: "taker";
@@ -613,6 +785,9 @@ declare const MorphoV2: readonly [{
613
785
  }, {
614
786
  readonly type: "uint256";
615
787
  readonly name: "lltv";
788
+ }, {
789
+ readonly type: "uint256";
790
+ readonly name: "maxLif";
616
791
  }, {
617
792
  readonly type: "address";
618
793
  readonly name: "oracle";
@@ -621,6 +796,9 @@ declare const MorphoV2: readonly [{
621
796
  }, {
622
797
  readonly type: "uint256";
623
798
  readonly name: "maturity";
799
+ }, {
800
+ readonly type: "uint256";
801
+ readonly name: "rcfThreshold";
624
802
  }];
625
803
  readonly name: "obligation";
626
804
  }, {
@@ -629,15 +807,9 @@ declare const MorphoV2: readonly [{
629
807
  }, {
630
808
  readonly type: "address";
631
809
  readonly name: "maker";
632
- }, {
633
- readonly type: "uint256";
634
- readonly name: "assets";
635
810
  }, {
636
811
  readonly type: "uint256";
637
812
  readonly name: "obligationUnits";
638
- }, {
639
- readonly type: "uint256";
640
- readonly name: "obligationShares";
641
813
  }, {
642
814
  readonly type: "uint256";
643
815
  readonly name: "start";
@@ -662,6 +834,9 @@ declare const MorphoV2: readonly [{
662
834
  }, {
663
835
  readonly type: "address";
664
836
  readonly name: "receiverIfMakerIsSeller";
837
+ }, {
838
+ readonly type: "bool";
839
+ readonly name: "exitOnly";
665
840
  }];
666
841
  readonly name: "offer";
667
842
  }, {
@@ -690,20 +865,81 @@ declare const MorphoV2: readonly [{
690
865
  readonly type: "uint256";
691
866
  }, {
692
867
  readonly type: "uint256";
693
- }, {
694
- readonly type: "uint256";
695
868
  }];
696
869
  }, {
697
- readonly name: "totalShares";
870
+ readonly name: "toId";
698
871
  readonly type: "function";
699
872
  readonly stateMutability: "view";
700
873
  readonly inputs: readonly [{
701
- readonly type: "bytes32";
702
- readonly name: "id";
703
- }];
704
- readonly outputs: readonly [{
705
- readonly type: "uint256";
706
- }];
874
+ readonly type: "tuple";
875
+ readonly components: readonly [{
876
+ readonly type: "address";
877
+ readonly name: "loanToken";
878
+ }, {
879
+ readonly type: "tuple[]";
880
+ readonly components: readonly [{
881
+ readonly type: "address";
882
+ readonly name: "token";
883
+ }, {
884
+ readonly type: "uint256";
885
+ readonly name: "lltv";
886
+ }, {
887
+ readonly type: "uint256";
888
+ readonly name: "maxLif";
889
+ }, {
890
+ readonly type: "address";
891
+ readonly name: "oracle";
892
+ }];
893
+ readonly name: "collaterals";
894
+ }, {
895
+ readonly type: "uint256";
896
+ readonly name: "maturity";
897
+ }, {
898
+ readonly type: "uint256";
899
+ readonly name: "rcfThreshold";
900
+ }];
901
+ readonly name: "obligation";
902
+ }];
903
+ readonly outputs: readonly [{
904
+ readonly type: "bytes32";
905
+ }];
906
+ }, {
907
+ readonly name: "toObligation";
908
+ readonly type: "function";
909
+ readonly stateMutability: "view";
910
+ readonly inputs: readonly [{
911
+ readonly type: "bytes32";
912
+ readonly name: "id";
913
+ }];
914
+ readonly outputs: readonly [{
915
+ readonly type: "tuple";
916
+ readonly components: readonly [{
917
+ readonly type: "address";
918
+ readonly name: "loanToken";
919
+ }, {
920
+ readonly type: "tuple[]";
921
+ readonly components: readonly [{
922
+ readonly type: "address";
923
+ readonly name: "token";
924
+ }, {
925
+ readonly type: "uint256";
926
+ readonly name: "lltv";
927
+ }, {
928
+ readonly type: "uint256";
929
+ readonly name: "maxLif";
930
+ }, {
931
+ readonly type: "address";
932
+ readonly name: "oracle";
933
+ }];
934
+ readonly name: "collaterals";
935
+ }, {
936
+ readonly type: "uint256";
937
+ readonly name: "maturity";
938
+ }, {
939
+ readonly type: "uint256";
940
+ readonly name: "rcfThreshold";
941
+ }];
942
+ }];
707
943
  }, {
708
944
  readonly name: "totalUnits";
709
945
  readonly type: "function";
@@ -732,6 +968,9 @@ declare const MorphoV2: readonly [{
732
968
  }, {
733
969
  readonly type: "uint256";
734
970
  readonly name: "lltv";
971
+ }, {
972
+ readonly type: "uint256";
973
+ readonly name: "maxLif";
735
974
  }, {
736
975
  readonly type: "address";
737
976
  readonly name: "oracle";
@@ -740,6 +979,9 @@ declare const MorphoV2: readonly [{
740
979
  }, {
741
980
  readonly type: "uint256";
742
981
  readonly name: "maturity";
982
+ }, {
983
+ readonly type: "uint256";
984
+ readonly name: "rcfThreshold";
743
985
  }];
744
986
  readonly name: "obligation";
745
987
  }];
@@ -768,6 +1010,20 @@ declare const MorphoV2: readonly [{
768
1010
  readonly outputs: readonly [{
769
1011
  readonly type: "address";
770
1012
  }];
1013
+ }, {
1014
+ readonly name: "userLossIndex";
1015
+ readonly type: "function";
1016
+ readonly stateMutability: "view";
1017
+ readonly inputs: readonly [{
1018
+ readonly type: "bytes32";
1019
+ readonly name: "id";
1020
+ }, {
1021
+ readonly type: "address";
1022
+ readonly name: "user";
1023
+ }];
1024
+ readonly outputs: readonly [{
1025
+ readonly type: "uint128";
1026
+ }];
771
1027
  }, {
772
1028
  readonly name: "withdraw";
773
1029
  readonly type: "function";
@@ -785,6 +1041,9 @@ declare const MorphoV2: readonly [{
785
1041
  }, {
786
1042
  readonly type: "uint256";
787
1043
  readonly name: "lltv";
1044
+ }, {
1045
+ readonly type: "uint256";
1046
+ readonly name: "maxLif";
788
1047
  }, {
789
1048
  readonly type: "address";
790
1049
  readonly name: "oracle";
@@ -793,14 +1052,14 @@ declare const MorphoV2: readonly [{
793
1052
  }, {
794
1053
  readonly type: "uint256";
795
1054
  readonly name: "maturity";
1055
+ }, {
1056
+ readonly type: "uint256";
1057
+ readonly name: "rcfThreshold";
796
1058
  }];
797
1059
  readonly name: "obligation";
798
1060
  }, {
799
1061
  readonly type: "uint256";
800
1062
  readonly name: "obligationUnits";
801
- }, {
802
- readonly type: "uint256";
803
- readonly name: "shares";
804
1063
  }, {
805
1064
  readonly type: "address";
806
1065
  readonly name: "onBehalf";
@@ -808,11 +1067,7 @@ declare const MorphoV2: readonly [{
808
1067
  readonly type: "address";
809
1068
  readonly name: "receiver";
810
1069
  }];
811
- readonly outputs: readonly [{
812
- readonly type: "uint256";
813
- }, {
814
- readonly type: "uint256";
815
- }];
1070
+ readonly outputs: readonly [];
816
1071
  }, {
817
1072
  readonly name: "withdrawCollateral";
818
1073
  readonly type: "function";
@@ -830,6 +1085,9 @@ declare const MorphoV2: readonly [{
830
1085
  }, {
831
1086
  readonly type: "uint256";
832
1087
  readonly name: "lltv";
1088
+ }, {
1089
+ readonly type: "uint256";
1090
+ readonly name: "maxLif";
833
1091
  }, {
834
1092
  readonly type: "address";
835
1093
  readonly name: "oracle";
@@ -838,11 +1096,14 @@ declare const MorphoV2: readonly [{
838
1096
  }, {
839
1097
  readonly type: "uint256";
840
1098
  readonly name: "maturity";
1099
+ }, {
1100
+ readonly type: "uint256";
1101
+ readonly name: "rcfThreshold";
841
1102
  }];
842
1103
  readonly name: "obligation";
843
1104
  }, {
844
- readonly type: "address";
845
- readonly name: "collateral";
1105
+ readonly type: "uint256";
1106
+ readonly name: "collateralIndex";
846
1107
  }, {
847
1108
  readonly type: "uint256";
848
1109
  readonly name: "assets";
@@ -873,21 +1134,6 @@ declare const MorphoV2: readonly [{
873
1134
  readonly name: "owner";
874
1135
  readonly indexed: true;
875
1136
  }];
876
- }, {
877
- readonly name: "Consume";
878
- readonly type: "event";
879
- readonly inputs: readonly [{
880
- readonly type: "address";
881
- readonly name: "user";
882
- readonly indexed: true;
883
- }, {
884
- readonly type: "bytes32";
885
- readonly name: "group";
886
- readonly indexed: true;
887
- }, {
888
- readonly type: "uint256";
889
- readonly name: "amount";
890
- }];
891
1137
  }, {
892
1138
  readonly name: "FlashLoan";
893
1139
  readonly type: "event";
@@ -912,38 +1158,34 @@ declare const MorphoV2: readonly [{
912
1158
  readonly indexed: true;
913
1159
  }, {
914
1160
  readonly type: "bytes32";
915
- readonly name: "id";
1161
+ readonly name: "id_";
916
1162
  readonly indexed: true;
917
1163
  }, {
918
- readonly type: "tuple[]";
919
- readonly components: readonly [{
920
- readonly type: "uint256";
921
- readonly name: "collateralIndex";
922
- }, {
923
- readonly type: "uint256";
924
- readonly name: "repaid";
925
- }, {
926
- readonly type: "uint256";
927
- readonly name: "seized";
928
- }];
929
- readonly name: "seizures";
1164
+ readonly type: "uint256";
1165
+ readonly name: "collateralIndex";
1166
+ }, {
1167
+ readonly type: "uint256";
1168
+ readonly name: "seizedAssets";
1169
+ }, {
1170
+ readonly type: "uint256";
1171
+ readonly name: "repaidUnits";
930
1172
  }, {
931
1173
  readonly type: "address";
932
1174
  readonly name: "borrower";
933
1175
  readonly indexed: true;
934
1176
  }, {
935
1177
  readonly type: "uint256";
936
- readonly name: "totalRepaid";
1178
+ readonly name: "badDebt";
937
1179
  }, {
938
1180
  readonly type: "uint256";
939
- readonly name: "badDebt";
1181
+ readonly name: "latestLossIndex";
940
1182
  }];
941
1183
  }, {
942
1184
  readonly name: "ObligationCreated";
943
1185
  readonly type: "event";
944
1186
  readonly inputs: readonly [{
945
1187
  readonly type: "bytes32";
946
- readonly name: "id";
1188
+ readonly name: "id_";
947
1189
  readonly indexed: true;
948
1190
  }, {
949
1191
  readonly type: "tuple";
@@ -958,6 +1200,9 @@ declare const MorphoV2: readonly [{
958
1200
  }, {
959
1201
  readonly type: "uint256";
960
1202
  readonly name: "lltv";
1203
+ }, {
1204
+ readonly type: "uint256";
1205
+ readonly name: "maxLif";
961
1206
  }, {
962
1207
  readonly type: "address";
963
1208
  readonly name: "oracle";
@@ -966,6 +1211,9 @@ declare const MorphoV2: readonly [{
966
1211
  }, {
967
1212
  readonly type: "uint256";
968
1213
  readonly name: "maturity";
1214
+ }, {
1215
+ readonly type: "uint256";
1216
+ readonly name: "rcfThreshold";
969
1217
  }];
970
1218
  readonly name: "obligation";
971
1219
  }];
@@ -978,7 +1226,7 @@ declare const MorphoV2: readonly [{
978
1226
  readonly indexed: true;
979
1227
  }, {
980
1228
  readonly type: "bytes32";
981
- readonly name: "id";
1229
+ readonly name: "id_";
982
1230
  readonly indexed: true;
983
1231
  }, {
984
1232
  readonly type: "uint256";
@@ -988,6 +1236,25 @@ declare const MorphoV2: readonly [{
988
1236
  readonly name: "onBehalf";
989
1237
  readonly indexed: true;
990
1238
  }];
1239
+ }, {
1240
+ readonly name: "SetConsumed";
1241
+ readonly type: "event";
1242
+ readonly inputs: readonly [{
1243
+ readonly type: "address";
1244
+ readonly name: "caller";
1245
+ readonly indexed: true;
1246
+ }, {
1247
+ readonly type: "address";
1248
+ readonly name: "onBehalf";
1249
+ readonly indexed: true;
1250
+ }, {
1251
+ readonly type: "bytes32";
1252
+ readonly name: "group";
1253
+ readonly indexed: true;
1254
+ }, {
1255
+ readonly type: "uint256";
1256
+ readonly name: "amount";
1257
+ }];
991
1258
  }, {
992
1259
  readonly name: "SetDefaultTradingFee";
993
1260
  readonly type: "event";
@@ -1011,12 +1278,64 @@ declare const MorphoV2: readonly [{
1011
1278
  readonly name: "feeSetter";
1012
1279
  readonly indexed: true;
1013
1280
  }];
1281
+ }, {
1282
+ readonly name: "SetIsAuthorized";
1283
+ readonly type: "event";
1284
+ readonly inputs: readonly [{
1285
+ readonly type: "address";
1286
+ readonly name: "caller";
1287
+ readonly indexed: true;
1288
+ }, {
1289
+ readonly type: "address";
1290
+ readonly name: "onBehalf";
1291
+ readonly indexed: true;
1292
+ }, {
1293
+ readonly type: "address";
1294
+ readonly name: "authorized";
1295
+ readonly indexed: true;
1296
+ }, {
1297
+ readonly type: "bool";
1298
+ readonly name: "newIsAuthorized";
1299
+ }];
1300
+ }, {
1301
+ readonly name: "SetMaxCollateralPerUser";
1302
+ readonly type: "event";
1303
+ readonly inputs: readonly [{
1304
+ readonly type: "address";
1305
+ readonly name: "collateralToken";
1306
+ readonly indexed: true;
1307
+ }, {
1308
+ readonly type: "uint256";
1309
+ readonly name: "maxCollateralPerUser";
1310
+ }];
1311
+ }, {
1312
+ readonly name: "SetMaxTakeableAssets";
1313
+ readonly type: "event";
1314
+ readonly inputs: readonly [{
1315
+ readonly type: "address";
1316
+ readonly name: "loanToken";
1317
+ readonly indexed: true;
1318
+ }, {
1319
+ readonly type: "uint256";
1320
+ readonly name: "maxTakeableAssets";
1321
+ }];
1322
+ }, {
1323
+ readonly name: "SetMaxTotalUnits";
1324
+ readonly type: "event";
1325
+ readonly inputs: readonly [{
1326
+ readonly type: "address";
1327
+ readonly name: "loanToken";
1328
+ readonly indexed: true;
1329
+ }, {
1330
+ readonly type: "uint128";
1331
+ readonly name: "maxTotalUnits";
1332
+ }];
1014
1333
  }, {
1015
1334
  readonly name: "SetObligationTradingFee";
1016
1335
  readonly type: "event";
1017
1336
  readonly inputs: readonly [{
1018
1337
  readonly type: "bytes32";
1019
- readonly name: "id";
1338
+ readonly name: "id_";
1020
1339
  readonly indexed: true;
1021
1340
  }, {
1022
1341
  readonly type: "uint256";
@@ -1047,12 +1366,37 @@ declare const MorphoV2: readonly [{
1047
1366
  readonly type: "event";
1048
1367
  readonly inputs: readonly [{
1049
1368
  readonly type: "address";
1050
- readonly name: "user";
1369
+ readonly name: "caller";
1370
+ readonly indexed: true;
1371
+ }, {
1372
+ readonly type: "address";
1373
+ readonly name: "onBehalf";
1051
1374
  readonly indexed: true;
1052
1375
  }, {
1053
1376
  readonly type: "bytes32";
1054
1377
  readonly name: "session";
1055
1378
  }];
1379
+ }, {
1380
+ readonly name: "Slash";
1381
+ readonly type: "event";
1382
+ readonly inputs: readonly [{
1383
+ readonly type: "address";
1384
+ readonly name: "caller";
1385
+ }, {
1386
+ readonly type: "bytes32";
1387
+ readonly name: "id_";
1388
+ readonly indexed: true;
1389
+ }, {
1390
+ readonly type: "address";
1391
+ readonly name: "user";
1392
+ readonly indexed: true;
1393
+ }, {
1394
+ readonly type: "uint256";
1395
+ readonly name: "credit";
1396
+ }, {
1397
+ readonly type: "uint256";
1398
+ readonly name: "latestLossIndex";
1399
+ }];
1056
1400
  }, {
1057
1401
  readonly name: "SupplyCollateral";
1058
1402
  readonly type: "event";
@@ -1061,7 +1405,7 @@ declare const MorphoV2: readonly [{
1061
1405
  readonly name: "caller";
1062
1406
  }, {
1063
1407
  readonly type: "bytes32";
1064
- readonly name: "id";
1408
+ readonly name: "id_";
1065
1409
  readonly indexed: true;
1066
1410
  }, {
1067
1411
  readonly type: "address";
@@ -1083,7 +1427,7 @@ declare const MorphoV2: readonly [{
1083
1427
  readonly name: "caller";
1084
1428
  }, {
1085
1429
  readonly type: "bytes32";
1086
- readonly name: "id";
1430
+ readonly name: "id_";
1087
1431
  readonly indexed: true;
1088
1432
  }, {
1089
1433
  readonly type: "address";
@@ -1105,15 +1449,6 @@ declare const MorphoV2: readonly [{
1105
1449
  }, {
1106
1450
  readonly type: "uint256";
1107
1451
  readonly name: "obligationUnits";
1108
- }, {
1109
- readonly type: "uint256";
1110
- readonly name: "obligationShares";
1111
- }, {
1112
- readonly type: "bool";
1113
- readonly name: "buyerIsLender";
1114
- }, {
1115
- readonly type: "bool";
1116
- readonly name: "sellerIsBorrower";
1117
1452
  }, {
1118
1453
  readonly type: "address";
1119
1454
  readonly name: "sellerReceiver";
@@ -1123,6 +1458,9 @@ declare const MorphoV2: readonly [{
1123
1458
  }, {
1124
1459
  readonly type: "uint256";
1125
1460
  readonly name: "consumed";
1461
+ }, {
1462
+ readonly type: "uint256";
1463
+ readonly name: "totalUnits";
1126
1464
  }];
1127
1465
  }, {
1128
1466
  readonly name: "Withdraw";
@@ -1132,14 +1470,11 @@ declare const MorphoV2: readonly [{
1132
1470
  readonly name: "caller";
1133
1471
  }, {
1134
1472
  readonly type: "bytes32";
1135
- readonly name: "id";
1473
+ readonly name: "id_";
1136
1474
  readonly indexed: true;
1137
1475
  }, {
1138
1476
  readonly type: "uint256";
1139
1477
  readonly name: "obligationUnits";
1140
- }, {
1141
- readonly type: "uint256";
1142
- readonly name: "shares";
1143
1478
  }, {
1144
1479
  readonly type: "address";
1145
1480
  readonly name: "onBehalf";
@@ -1157,7 +1492,7 @@ declare const MorphoV2: readonly [{
1157
1492
  readonly name: "caller";
1158
1493
  }, {
1159
1494
  readonly type: "bytes32";
1160
- readonly name: "id";
1495
+ readonly name: "id_";
1161
1496
  readonly indexed: true;
1162
1497
  }, {
1163
1498
  readonly type: "address";
@@ -1301,7 +1636,7 @@ declare const Morpho: readonly [{
1301
1636
  readonly stateMutability: "view";
1302
1637
  }];
1303
1638
  declare namespace Callback_d_exports {
1304
- export { Callback, Type$1 as Type, isEmptyCallback };
1639
+ export { Callback, CallbackType, Type$1 as Type, isEmptyCallback };
1305
1640
  }
1306
1641
  type Callback = {
1307
1642
  type: Type$1.BuyWithEmptyCallback;
@@ -1312,6 +1647,9 @@ declare enum Type$1 {
1312
1647
  BuyWithEmptyCallback = "buy_with_empty_callback",
1313
1648
  SellWithEmptyCallback = "sell_with_empty_callback"
1314
1649
  }
1650
+ declare enum CallbackType {
1651
+ Empty = "empty"
1652
+ }
1315
1653
  declare const isEmptyCallback: (offer: Offer) => boolean;
1316
1654
  declare namespace Errors_d_exports {
1317
1655
  export { BaseError, GlobalErrorType, ReorgError };
@@ -1346,7 +1684,7 @@ declare class ReorgError extends BaseError {
1346
1684
  constructor(blockNumber: number);
1347
1685
  }
1348
1686
  declare namespace Chain_d_exports {
1349
- export { Chain$1 as Chain, ChainId, Id, InvalidBatchSizeError, InvalidBlockRangeError, InvalidBlockWindowError, MissingBlockNumberError, Name$1 as Name, chainIds, chainNames, chains$1 as chains, getChain, getWhitelistedChains, streamLogs };
1687
+ export { Chain$1 as Chain, ChainId, Id, InvalidBatchSizeError, InvalidBlockRangeError, InvalidBlockWindowError, MissingBlockNumberError, Name, UnrecoverableLogsResponseSizeError, chainIds, chainNames, chains$1 as chains, getChain, getWhitelistedChains, streamLogs };
1350
1688
  }
1351
1689
  type Chain$1 = Compute<Omit<Chain<ChainFormatters, {
1352
1690
  morpho: ChainContract;
@@ -1361,7 +1699,7 @@ type Chain$1 = Compute<Omit<Chain<ChainFormatters, {
1361
1699
  callbacks: Callback[];
1362
1700
  }>, "custom"> & {
1363
1701
  id: Id;
1364
- name: Name$1;
1702
+ name: Name;
1365
1703
  custom: {
1366
1704
  morpho: ChainContract;
1367
1705
  morphoBlue: ChainContract;
@@ -1381,13 +1719,13 @@ declare const ChainId: {
1381
1719
  readonly "ETHEREUM-VIRTUAL-TESTNET": 109111114;
1382
1720
  readonly ANVIL: 505050505;
1383
1721
  };
1384
- type Name$1 = Lowercase<keyof typeof ChainId>;
1385
- declare const chainNames: readonly Name$1[];
1386
- type Id = (typeof ChainId)[Uppercase<Name$1>];
1722
+ type Name = Lowercase<keyof typeof ChainId>;
1723
+ declare const chainNames: readonly Name[];
1724
+ type Id = (typeof ChainId)[Uppercase<Name>];
1387
1725
  declare const chainIds: readonly Id[];
1388
1726
  declare function getChain(chainId: Id): Chain$1 | undefined;
1389
1727
  declare const getWhitelistedChains: () => Chain$1[];
1390
- declare const chains$1: Record<Lowercase<Name$1>, Chain$1>;
1728
+ declare const chains$1: Record<Lowercase<Name>, Chain$1>;
1391
1729
  declare function streamLogs<abiEvent extends AbiEvent | undefined = undefined>(parameters: {
1392
1730
  client: PublicClient;
1393
1731
  contractAddress?: Address;
@@ -1405,6 +1743,8 @@ declare function streamLogs<abiEvent extends AbiEvent | undefined = undefined>(p
1405
1743
  }, void, void>;
1406
1744
  declare class InvalidBlockRangeError extends BaseError {
1407
1745
  name: string;
1746
+ readonly fromBlock: bigint;
1747
+ readonly toBlock: bigint;
1408
1748
  constructor(fromBlock: bigint, toBlock: bigint);
1409
1749
  }
1410
1750
  declare class InvalidBlockWindowError extends BaseError {
@@ -1419,6 +1759,10 @@ declare class MissingBlockNumberError extends BaseError {
1419
1759
  name: string;
1420
1760
  constructor();
1421
1761
  }
1762
+ declare class UnrecoverableLogsResponseSizeError extends BaseError<Error> {
1763
+ name: string;
1764
+ constructor(blockNumber: bigint, cause?: unknown);
1765
+ }
1422
1766
  declare namespace ChainRegistry_d_exports {
1423
1767
  export { ChainRegistry, create$8 as create };
1424
1768
  }
@@ -1469,7 +1813,8 @@ declare namespace Collateral_d_exports {
1469
1813
  }
1470
1814
  type Collateral = {
1471
1815
  /** Asset being used as collateral. */asset: Address; /** Liquidation Loan-to-Value of the collateral. */
1472
- lltv: LLTV; /** Oracle contract used to price the collateral. */
1816
+ lltv: LLTV; /** Maximum Liquidation Incentive Factor for this collateral. */
1817
+ maxLif: bigint; /** Oracle contract used to price the collateral. */
1473
1818
  oracle: Address;
1474
1819
  };
1475
1820
  declare const abi$1: readonly [{
@@ -1478,6 +1823,9 @@ declare const abi$1: readonly [{
1478
1823
  }, {
1479
1824
  readonly type: "uint256";
1480
1825
  readonly name: "lltv";
1826
+ }, {
1827
+ readonly type: "uint256";
1828
+ readonly name: "maxLif";
1481
1829
  }, {
1482
1830
  readonly type: "address";
1483
1831
  readonly name: "oracle";
@@ -1486,17 +1834,20 @@ declare const CollateralSchema: z$1.ZodObject<{
1486
1834
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1487
1835
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1488
1836
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
1837
+ maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
1489
1838
  }, z$1.core.$strip>;
1490
1839
  declare const CollateralsSchema: z$1.ZodArray<z$1.ZodObject<{
1491
1840
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1492
1841
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1493
1842
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
1843
+ maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
1494
1844
  }, z$1.core.$strip>>;
1495
1845
  declare const from$16: (parameters: from$16.Parameters) => from$16.ReturnType;
1496
1846
  declare namespace from$16 {
1497
1847
  type Parameters = {
1498
1848
  asset: Address;
1499
1849
  lltv: Options | bigint;
1850
+ maxLif?: bigint;
1500
1851
  oracle: Address;
1501
1852
  };
1502
1853
  type ReturnType = Collateral;
@@ -1676,7 +2027,8 @@ declare namespace Obligation_d_exports {
1676
2027
  type Obligation$1 = {
1677
2028
  /** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
1678
2029
  collaterals: Collateral[]; /** The maturity of the obligation. */
1679
- maturity: Maturity;
2030
+ maturity: Maturity; /** Recovery-close-factor threshold in obligation units. */
2031
+ rcfThreshold: bigint;
1680
2032
  };
1681
2033
  declare const ObligationSchema: z$1.ZodObject<{
1682
2034
  loanToken: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
@@ -1684,8 +2036,10 @@ declare const ObligationSchema: z$1.ZodObject<{
1684
2036
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1685
2037
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1686
2038
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
2039
+ maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
1687
2040
  }, z$1.core.$strip>>;
1688
2041
  maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
2042
+ rcfThreshold: z$1.ZodBigInt;
1689
2043
  }, z$1.core.$strip>;
1690
2044
  declare const abi: readonly [{
1691
2045
  readonly type: "address";
@@ -1699,6 +2053,9 @@ declare const abi: readonly [{
1699
2053
  }, {
1700
2054
  readonly type: "uint256";
1701
2055
  readonly name: "lltv";
2056
+ }, {
2057
+ readonly type: "uint256";
2058
+ readonly name: "maxLif";
1702
2059
  }, {
1703
2060
  readonly type: "address";
1704
2061
  readonly name: "oracle";
@@ -1706,6 +2063,9 @@ declare const abi: readonly [{
1706
2063
  }, {
1707
2064
  readonly type: "uint256";
1708
2065
  readonly name: "maturity";
2066
+ }, {
2067
+ readonly type: "uint256";
2068
+ readonly name: "rcfThreshold";
1709
2069
  }];
1710
2070
  declare const tupleAbi: readonly [{
1711
2071
  readonly type: "tuple";
@@ -1721,6 +2081,9 @@ declare const tupleAbi: readonly [{
1721
2081
  }, {
1722
2082
  readonly type: "uint256";
1723
2083
  readonly name: "lltv";
2084
+ }, {
2085
+ readonly type: "uint256";
2086
+ readonly name: "maxLif";
1724
2087
  }, {
1725
2088
  readonly type: "address";
1726
2089
  readonly name: "oracle";
@@ -1728,6 +2091,9 @@ declare const tupleAbi: readonly [{
1728
2091
  }, {
1729
2092
  readonly type: "uint256";
1730
2093
  readonly name: "maturity";
2094
+ }, {
2095
+ readonly type: "uint256";
2096
+ readonly name: "rcfThreshold";
1731
2097
  }];
1732
2098
  }];
1733
2099
  /**
@@ -1749,6 +2115,7 @@ declare const tupleAbi: readonly [{
1749
2115
  * }),
1750
2116
  * ],
1751
2117
  * maturity: Maturity.from("end_of_next_quarter"),
2118
+ * rcfThreshold: 0n,
1752
2119
  * });
1753
2120
  * ```
1754
2121
  */
@@ -1757,7 +2124,8 @@ declare namespace from$14 {
1757
2124
  type Parameters = {
1758
2125
  /** 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. */
1759
2126
  collaterals: from$16.Parameters[] | readonly from$16.Parameters[]; /** The maturity of the obligation. */
1760
- maturity: from$15.Parameters;
2127
+ maturity: from$15.Parameters; /** Recovery-close-factor threshold in obligation units. */
2128
+ rcfThreshold: bigint;
1761
2129
  };
1762
2130
  type ReturnType = Obligation$1;
1763
2131
  type ErrorType = InvalidObligationError;
@@ -1770,13 +2138,14 @@ declare namespace from$14 {
1770
2138
  */
1771
2139
  declare function fromSnakeCase$2(input: fromSnakeCase$2.Parameters): fromSnakeCase$2.ReturnType;
1772
2140
  declare namespace fromSnakeCase$2 {
1773
- type Parameters = Snake<Obligation$1>;
2141
+ type SnakeCaseParameters = Obligation$1;
2142
+ type Parameters = Snake<SnakeCaseParameters>;
1774
2143
  type ReturnType = Obligation$1;
1775
2144
  type ErrorType = InvalidObligationError;
1776
2145
  }
1777
2146
  /**
1778
2147
  * Calculates a canonical key for an obligation payload.
1779
- * The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity)).
2148
+ * The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity, rcfThreshold)).
1780
2149
  * @throws If the collaterals are not sorted alphabetically by address. {@link CollateralsAreNotSortedError}
1781
2150
  * @param parameters - {@link key.Parameters}
1782
2151
  * @returns The obligation key as a 32-byte hex string. {@link key.ReturnType}
@@ -1795,9 +2164,11 @@ declare namespace key$1 {
1795
2164
  collaterals: {
1796
2165
  asset: Address;
1797
2166
  lltv: bigint;
2167
+ maxLif?: bigint;
1798
2168
  oracle: Address;
1799
2169
  }[];
1800
2170
  maturity: number;
2171
+ rcfThreshold: bigint;
1801
2172
  };
1802
2173
  type ReturnType = Hex;
1803
2174
  type ErrorType = CollateralsAreNotSortedError;
@@ -1824,7 +2195,6 @@ declare namespace random$2 {
1824
2195
  */
1825
2196
  declare function fromOffer$1(offer: Offer): fromOffer$1.ReturnType;
1826
2197
  declare namespace fromOffer$1 {
1827
- type Parameters = Offer;
1828
2198
  type ReturnType = Obligation$1;
1829
2199
  }
1830
2200
  declare class InvalidObligationError extends BaseError<z$1.ZodError | Error> {
@@ -1842,7 +2212,7 @@ type Obligation = Obligation$1;
1842
2212
  /**
1843
2213
  * Builds the same creation code as `IdLib.creationCode` in Solidity.
1844
2214
  *
1845
- * Layout: `prefix (11 bytes) + chainId (32 bytes) + morphoV2 (20 bytes) + abi.encode(obligation)`.
2215
+ * Layout: `prefix (11 bytes) + abi.encode(obligation)`.
1846
2216
  *
1847
2217
  * @param parameters - {@link creationCode.Parameters}
1848
2218
  * @returns The CREATE2 init code bytes. {@link creationCode.ReturnType}
@@ -1857,9 +2227,11 @@ declare namespace creationCode {
1857
2227
  type ReturnType = Hex;
1858
2228
  }
1859
2229
  /**
1860
- * Computes the same id as `IdLib.toId` in Solidity.
2230
+ * Computes the same id as `IdLib.toId` in Solidity using the CREATE2 preimage:
2231
+ * `keccak256(0xff ++ morphoV2 ++ chainId ++ keccak256(creationCode))`.
2232
+ *
1861
2233
  * @param parameters - {@link toId.Parameters}
1862
- * @returns The obligation id. {@link toId.ReturnType}
2234
+ * @returns The 32-byte obligation id. {@link toId.ReturnType}
1863
2235
  */
1864
2236
  declare function toId(parameters: toId.Parameters): toId.ReturnType;
1865
2237
  declare namespace toId {
@@ -1963,15 +2335,14 @@ declare function generateMarketLiquidityPoolId(parameters: {
1963
2335
  marketId: string;
1964
2336
  }): string;
1965
2337
  declare namespace Offer_d_exports {
1966
- export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, encode$1 as encode, from$13 as from, fromSnakeCase$1 as fromSnakeCase, hash, liquidateEvent, obligationId, random$1 as random, repayEvent, serialize, supplyCollateralEvent, takeEvent, toSnakeCase, withdrawCollateralEvent };
2338
+ export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, encode$1 as encode, from$13 as from, fromSnakeCase$1 as fromSnakeCase, hash, liquidateEvent, random$1 as random, repayEvent, serialize, supplyCollateralEvent, takeEvent, toSnakeCase, withdrawCollateralEvent };
1967
2339
  }
1968
2340
  type Offer = {
1969
- /** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
1970
- readonly assets: bigint; /** The max debt units to trade. Mutually exclusive with assets and obligationShares. */
1971
- readonly obligationUnits: bigint; /** The max lending shares to trade. Mutually exclusive with assets and obligationUnits. */
1972
- readonly obligationShares: bigint; /** The offer tick. */
2341
+ /** The address that made the offer. */readonly maker: Address; /** The max debt units to trade. */
2342
+ readonly obligationUnits: bigint; /** The offer tick. */
1973
2343
  readonly tick: number; /** The date at which all interests will be paid. */
1974
- readonly maturity: Maturity; /** The date at which the offer will expire. */
2344
+ readonly maturity: Maturity; /** Recovery-close-factor threshold in obligation units. */
2345
+ readonly rcfThreshold: bigint; /** The date at which the offer will expire. */
1975
2346
  readonly expiry: number; /** The date at which the offer will start. */
1976
2347
  readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
1977
2348
  readonly group: Hex; /** The session. Used for session-based offer management. */
@@ -1983,7 +2354,8 @@ type Offer = {
1983
2354
  readonly address: Address;
1984
2355
  readonly data: Hex;
1985
2356
  }; /** Receiver of loan token proceeds when maker is seller on `take()`. */
1986
- readonly receiverIfMakerIsSeller: Address;
2357
+ readonly receiverIfMakerIsSeller: Address; /** Whether this offer can only reduce existing positions, not create new ones. */
2358
+ readonly exitOnly: boolean;
1987
2359
  };
1988
2360
  declare enum Status {
1989
2361
  VALID = "VALID",
@@ -1996,11 +2368,10 @@ type Validation = {
1996
2368
  };
1997
2369
  declare const OfferSchema: () => z$1.ZodObject<{
1998
2370
  maker: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
1999
- assets: z$1.ZodBigInt;
2000
2371
  obligationUnits: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
2001
- obligationShares: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
2002
2372
  tick: z$1.ZodCoercedNumber<unknown>;
2003
2373
  maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
2374
+ rcfThreshold: z$1.ZodBigInt;
2004
2375
  expiry: z$1.ZodNumber;
2005
2376
  start: z$1.ZodNumber;
2006
2377
  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>>;
@@ -2011,12 +2382,14 @@ declare const OfferSchema: () => z$1.ZodObject<{
2011
2382
  asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2012
2383
  oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2013
2384
  lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
2385
+ maxLif: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
2014
2386
  }, z$1.core.$strip>>;
2015
2387
  callback: z$1.ZodObject<{
2016
2388
  address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2017
2389
  data: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2018
2390
  }, z$1.core.$strip>;
2019
2391
  receiverIfMakerIsSeller: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
2392
+ exitOnly: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
2020
2393
  }, z$1.core.$strip>;
2021
2394
  /**
2022
2395
  * Input type for creating offers. Accepts flexible group types that will be coerced to Hex.
@@ -2029,12 +2402,13 @@ declare const OfferSchema: () => z$1.ZodObject<{
2029
2402
  *
2030
2403
  * All values validated to be non-negative and within bytes32 range.
2031
2404
  */
2032
- type OfferInput = Compute<Omit<Offer, "group" | "session" | "obligationUnits" | "obligationShares" | "receiverIfMakerIsSeller"> & {
2405
+ type OfferInput = Compute<Omit<Offer, "group" | "session" | "obligationUnits" | "rcfThreshold" | "receiverIfMakerIsSeller" | "exitOnly"> & {
2033
2406
  group: Hex | bigint | number | string; /** Optional: defaults to zero bytes32. */
2034
- session?: Hex | bigint | number | string; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationShares. */
2035
- obligationUnits?: bigint; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationUnits. */
2036
- obligationShares?: bigint; /** Optional: defaults to maker for backward compatibility. */
2037
- receiverIfMakerIsSeller?: Address;
2407
+ session?: Hex | bigint | number | string; /** Optional: defaults to 0n. */
2408
+ obligationUnits?: bigint; /** Recovery-close-factor threshold in obligation units. */
2409
+ rcfThreshold: bigint; /** Optional: defaults to maker for backward compatibility. */
2410
+ receiverIfMakerIsSeller?: Address; /** Optional: defaults to false. */
2411
+ exitOnly?: boolean;
2038
2412
  }>;
2039
2413
  /**
2040
2414
  * Creates an offer from a plain object.
@@ -2071,11 +2445,10 @@ declare function toSnakeCase(offer: Offer): Snake<Offer>;
2071
2445
  */
2072
2446
  declare const serialize: (offer: Offer) => {
2073
2447
  maker: `0x${string}`;
2074
- assets: string;
2075
2448
  obligationUnits: string;
2076
- obligationShares: string;
2077
2449
  tick: number;
2078
2450
  maturity: number;
2451
+ rcfThreshold: string;
2079
2452
  expiry: number;
2080
2453
  start: number;
2081
2454
  group: `0x${string}`;
@@ -2086,12 +2459,14 @@ declare const serialize: (offer: Offer) => {
2086
2459
  asset: `0x${string}`;
2087
2460
  oracle: `0x${string}`;
2088
2461
  lltv: string;
2462
+ maxLif: string;
2089
2463
  }[];
2090
2464
  callback: {
2091
2465
  address: `0x${string}`;
2092
2466
  data: `0x${string}`;
2093
2467
  };
2094
2468
  receiverIfMakerIsSeller: `0x${string}`;
2469
+ exitOnly: boolean;
2095
2470
  hash: `0x${string}`;
2096
2471
  };
2097
2472
  type RandomConfig = {
@@ -2099,11 +2474,10 @@ type RandomConfig = {
2099
2474
  collateralTokens?: Address[];
2100
2475
  assetsDecimals?: Record<Address, number>;
2101
2476
  buy?: boolean;
2102
- assets?: bigint;
2103
2477
  obligationUnits?: bigint;
2104
- obligationShares?: bigint;
2105
2478
  maker?: Address;
2106
2479
  maturity?: Maturity;
2480
+ rcfThreshold?: bigint;
2107
2481
  start?: number;
2108
2482
  expiry?: number;
2109
2483
  group?: Hex | bigint | number | string;
@@ -2115,6 +2489,7 @@ type RandomConfig = {
2115
2489
  };
2116
2490
  receiverIfMakerIsSeller?: Address;
2117
2491
  collaterals?: readonly Collateral[];
2492
+ exitOnly?: boolean;
2118
2493
  };
2119
2494
  /**
2120
2495
  * Generates a random Offer.
@@ -2131,21 +2506,6 @@ declare function random$1(config?: RandomConfig): Offer;
2131
2506
  * @returns 32-byte offer hash.
2132
2507
  */
2133
2508
  declare function hash(offer: Offer): Hex;
2134
- /**
2135
- * Calculates the onchain obligation id for an offer.
2136
- * The id is computed with {@link Id.toId}.
2137
- * @param offer - The offer to calculate the obligation id for.
2138
- * @param parameters - The chain context used by the onchain id function.
2139
- * @returns The obligation id as a 32-byte hex string.
2140
- */
2141
- declare function obligationId(offer: Offer, parameters: obligationId.Parameters): obligationId.ReturnType;
2142
- declare namespace obligationId {
2143
- type Parameters = {
2144
- chainId: Id;
2145
- morphoV2: Address;
2146
- };
2147
- type ReturnType = Hex;
2148
- }
2149
2509
  declare function encode$1(offer: Offer): `0x${string}`;
2150
2510
  declare function decode$1(data: Hex): Offer;
2151
2511
  type OfferConsumed = {
@@ -2168,7 +2528,7 @@ declare const takeEvent: {
2168
2528
  readonly indexed: false;
2169
2529
  readonly internalType: "address";
2170
2530
  }, {
2171
- readonly name: "id";
2531
+ readonly name: "id_";
2172
2532
  readonly type: "bytes32";
2173
2533
  readonly indexed: true;
2174
2534
  readonly internalType: "bytes32";
@@ -2202,21 +2562,6 @@ declare const takeEvent: {
2202
2562
  readonly type: "uint256";
2203
2563
  readonly indexed: false;
2204
2564
  readonly internalType: "uint256";
2205
- }, {
2206
- readonly name: "obligationShares";
2207
- readonly type: "uint256";
2208
- readonly indexed: false;
2209
- readonly internalType: "uint256";
2210
- }, {
2211
- readonly name: "buyerIsLender";
2212
- readonly type: "bool";
2213
- readonly indexed: false;
2214
- readonly internalType: "bool";
2215
- }, {
2216
- readonly name: "sellerIsBorrower";
2217
- readonly type: "bool";
2218
- readonly indexed: false;
2219
- readonly internalType: "bool";
2220
2565
  }, {
2221
2566
  readonly name: "sellerReceiver";
2222
2567
  readonly type: "address";
@@ -2232,17 +2577,27 @@ declare const takeEvent: {
2232
2577
  readonly type: "uint256";
2233
2578
  readonly indexed: false;
2234
2579
  readonly internalType: "uint256";
2580
+ }, {
2581
+ readonly name: "totalUnits";
2582
+ readonly type: "uint256";
2583
+ readonly indexed: false;
2584
+ readonly internalType: "uint256";
2235
2585
  }];
2236
2586
  readonly anonymous: false;
2237
2587
  };
2238
2588
  /**
2239
- * ABI for the Consume event emitted by the Obligation contract.
2589
+ * ABI for the SetConsumed event emitted by the Morpho V2 contract.
2240
2590
  */
2241
2591
  declare const consumedEvent: {
2242
2592
  readonly type: "event";
2243
- readonly name: "Consume";
2593
+ readonly name: "SetConsumed";
2244
2594
  readonly inputs: readonly [{
2245
- readonly name: "user";
2595
+ readonly name: "caller";
2596
+ readonly type: "address";
2597
+ readonly indexed: true;
2598
+ readonly internalType: "address";
2599
+ }, {
2600
+ readonly name: "onBehalf";
2246
2601
  readonly type: "address";
2247
2602
  readonly indexed: true;
2248
2603
  readonly internalType: "address";
@@ -2271,7 +2626,7 @@ declare const repayEvent: {
2271
2626
  readonly indexed: true;
2272
2627
  readonly internalType: "address";
2273
2628
  }, {
2274
- readonly name: "id";
2629
+ readonly name: "id_";
2275
2630
  readonly type: "bytes32";
2276
2631
  readonly indexed: true;
2277
2632
  readonly internalType: "bytes32";
@@ -2300,40 +2655,37 @@ declare const liquidateEvent: {
2300
2655
  readonly indexed: true;
2301
2656
  readonly internalType: "address";
2302
2657
  }, {
2303
- readonly name: "id";
2658
+ readonly name: "id_";
2304
2659
  readonly type: "bytes32";
2305
2660
  readonly indexed: true;
2306
2661
  readonly internalType: "bytes32";
2307
2662
  }, {
2308
- readonly name: "seizures";
2309
- readonly type: "tuple[]";
2663
+ readonly name: "collateralIndex";
2664
+ readonly type: "uint256";
2310
2665
  readonly indexed: false;
2311
- readonly internalType: "struct IMorphoV2.Seizure[]";
2312
- readonly components: readonly [{
2313
- readonly name: "collateralIndex";
2314
- readonly type: "uint256";
2315
- readonly internalType: "uint256";
2316
- }, {
2317
- readonly name: "repaid";
2318
- readonly type: "uint256";
2319
- readonly internalType: "uint256";
2320
- }, {
2321
- readonly name: "seized";
2322
- readonly type: "uint256";
2323
- readonly internalType: "uint256";
2324
- }];
2666
+ readonly internalType: "uint256";
2667
+ }, {
2668
+ readonly name: "seizedAssets";
2669
+ readonly type: "uint256";
2670
+ readonly indexed: false;
2671
+ readonly internalType: "uint256";
2672
+ }, {
2673
+ readonly name: "repaidUnits";
2674
+ readonly type: "uint256";
2675
+ readonly indexed: false;
2676
+ readonly internalType: "uint256";
2325
2677
  }, {
2326
2678
  readonly name: "borrower";
2327
2679
  readonly type: "address";
2328
2680
  readonly indexed: true;
2329
2681
  readonly internalType: "address";
2330
2682
  }, {
2331
- readonly name: "totalRepaid";
2683
+ readonly name: "badDebt";
2332
2684
  readonly type: "uint256";
2333
2685
  readonly indexed: false;
2334
2686
  readonly internalType: "uint256";
2335
2687
  }, {
2336
- readonly name: "badDebt";
2688
+ readonly name: "latestLossIndex";
2337
2689
  readonly type: "uint256";
2338
2690
  readonly indexed: false;
2339
2691
  readonly internalType: "uint256";
@@ -2352,7 +2704,7 @@ declare const supplyCollateralEvent: {
2352
2704
  readonly indexed: false;
2353
2705
  readonly internalType: "address";
2354
2706
  }, {
2355
- readonly name: "id";
2707
+ readonly name: "id_";
2356
2708
  readonly type: "bytes32";
2357
2709
  readonly indexed: true;
2358
2710
  readonly internalType: "bytes32";
@@ -2386,7 +2738,7 @@ declare const withdrawCollateralEvent: {
2386
2738
  readonly indexed: false;
2387
2739
  readonly internalType: "address";
2388
2740
  }, {
2389
- readonly name: "id";
2741
+ readonly name: "id_";
2390
2742
  readonly type: "bytes32";
2391
2743
  readonly indexed: true;
2392
2744
  readonly internalType: "bytes32";
@@ -2661,7 +3013,7 @@ declare class InvalidQuoteError extends BaseError<z$1.ZodError | Error> {
2661
3013
  constructor(error: z$1.ZodError | Error);
2662
3014
  }
2663
3015
  declare namespace Tick_d_exports {
2664
- export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, priceToTick, tickToPrice };
3016
+ export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, assetsToObligationUnits, obligationUnitsToAssets, priceToTick, tickToPrice };
2665
3017
  }
2666
3018
  /** Tick domain supported by Morpho V2. */
2667
3019
  declare const TICK_RANGE = 990;
@@ -2687,6 +3039,20 @@ declare function priceToTick(price: bigint): number;
2687
3039
  declare namespace priceToTick {
2688
3040
  type ErrorType = InvalidPriceError;
2689
3041
  }
3042
+ /**
3043
+ * Converts obligation units to assets using the tick price (mulDivDown).
3044
+ * @param obligationUnits - The obligation units to convert.
3045
+ * @param tick - The offer tick.
3046
+ * @returns The equivalent amount in assets.
3047
+ */
3048
+ declare function obligationUnitsToAssets(obligationUnits: bigint, tick: number): bigint;
3049
+ /**
3050
+ * Converts assets to obligation units using the tick price (mulDivUp).
3051
+ * @param assets - The asset amount to convert.
3052
+ * @param tick - The offer tick.
3053
+ * @returns The equivalent amount in obligation units.
3054
+ */
3055
+ declare function assetsToObligationUnits(assets: bigint, tick: number): bigint;
2690
3056
  declare class InvalidTickError extends BaseError {
2691
3057
  readonly name = "Tick.InvalidTickError";
2692
3058
  constructor(tick: number);
@@ -2700,15 +3066,15 @@ declare namespace TradingFee_d_exports {
2700
3066
  }
2701
3067
  /**
2702
3068
  * Time breakpoints in seconds for piecewise linear fee interpolation.
2703
- * Matches on-chain constants: 0d, 1d, 7d, 30d, 90d, 180d.
3069
+ * Matches on-chain constants: 0d, 1d, 7d, 30d, 90d, 180d, 360d.
2704
3070
  */
2705
- declare const BREAKPOINTS: readonly [0n, 86400n, 604800n, 2592000n, 7776000n, 15552000n];
3071
+ declare const BREAKPOINTS: readonly [0n, 86400n, 604800n, 2592000n, 7776000n, 15552000n, 31104000n];
2706
3072
  /** WAD constant (1e18) for fee scaling. */
2707
3073
  declare const WAD: bigint;
2708
- /** Tuple type for the 6 fee values at each breakpoint. */
2709
- type Fees = readonly [bigint, bigint, bigint, bigint, bigint, bigint];
3074
+ /** Tuple type for the 7 fee values at each breakpoint. */
3075
+ type Fees = readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint];
2710
3076
  /**
2711
- * TradingFee represents a piecewise linear fee curve with 6 breakpoints.
3077
+ * TradingFee represents a piecewise linear fee curve with 7 breakpoints.
2712
3078
  * The internal storage mimics on-chain bitmap behavior but uses a struct for clarity.
2713
3079
  */
2714
3080
  type TradingFee = {
@@ -2716,12 +3082,12 @@ type TradingFee = {
2716
3082
  readonly _fees: Fees;
2717
3083
  } & Brand<"TradingFee">;
2718
3084
  /**
2719
- * Create a TradingFee from an activation flag and 6 fee values.
3085
+ * Create a TradingFee from an activation flag and 7 fee values.
2720
3086
  * @param activated - Whether the fee is active.
2721
- * @param fees - Tuple of 6 fee values in WAD (one per breakpoint: 0d, 1d, 7d, 30d, 90d, 180d).
3087
+ * @param fees - Tuple of 7 fee values in WAD (one per breakpoint: 0d, 1d, 7d, 30d, 90d, 180d, 360d).
2722
3088
  * @returns A new TradingFee instance.
2723
3089
  * @throws {@link InvalidFeeError} if any fee exceeds WAD (100%).
2724
- * @throws {@link InvalidFeesLengthError} if fees array doesn't have exactly 6 elements.
3090
+ * @throws {@link InvalidFeesLengthError} if fees array doesn't have exactly 7 elements.
2725
3091
  */
2726
3092
  declare function from$9(activated: boolean, fees: Fees): TradingFee;
2727
3093
  declare namespace from$9 {
@@ -2755,7 +3121,7 @@ declare function deactivate(tradingFee: TradingFee): TradingFee;
2755
3121
  /**
2756
3122
  * Get the fee values at each breakpoint.
2757
3123
  * @param tradingFee - The TradingFee instance.
2758
- * @returns The tuple of 6 fee values.
3124
+ * @returns The tuple of 7 fee values.
2759
3125
  */
2760
3126
  declare function getFees(tradingFee: TradingFee): Fees;
2761
3127
  /** Error thrown when a fee value is invalid (negative or exceeds WAD). */
@@ -2763,7 +3129,7 @@ declare class InvalidFeeError extends BaseError {
2763
3129
  readonly name = "TradingFee.InvalidFeeError";
2764
3130
  constructor(fee: bigint, index: number);
2765
3131
  }
2766
- /** Error thrown when fees array doesn't have exactly 6 elements. */
3132
+ /** Error thrown when fees array doesn't have exactly 7 elements. */
2767
3133
  declare class InvalidFeesLengthError extends BaseError {
2768
3134
  readonly name = "TradingFee.InvalidFeesLengthError";
2769
3135
  constructor(length: number);
@@ -2810,13 +3176,13 @@ declare namespace from$8 {
2810
3176
  type ReturnType = Transfer;
2811
3177
  }
2812
3178
  declare namespace Tree_d_exports {
2813
- export { DecodeError, EncodeError, NormalizedSignatureDomain, Proof, SignatureDomain, SignatureDomainError, Tree, TreeError, VERSION$1 as VERSION, decode, encode, encodeUnsigned, from$7 as from, proofs, signatureDomain, signatureTypes };
3179
+ export { DecodeError, EncodeError, MAX_COMPRESSED_OFFERS_BYTES, MAX_DECOMPRESSED_OFFERS_BYTES, MAX_OFFERS_PER_TREE, NormalizedSignatureDomain, Proof, SignatureDomain, SignatureDomainError, Tree, TreeError, VERSION$1 as VERSION, decode, encode, encodeUnsigned, from$7 as from, proofs, signatureDomain, signatureTypes };
2814
3180
  }
2815
3181
  /**
2816
3182
  * A merkle tree of offers built from offer hashes.
2817
3183
  * Constructed via {@link from}. The tree root can be signed for onchain broadcast.
2818
3184
  */
2819
- type Tree = Compute<StandardMerkleTree<[Hex]> & {
3185
+ type Tree = Compute<SimpleMerkleTree & {
2820
3186
  /** The offers in the tree. */offers: Offer[]; /** The root of the tree. */
2821
3187
  root: Hex;
2822
3188
  }>;
@@ -2824,7 +3190,10 @@ type Proof = {
2824
3190
  /** The offer that the proof is for. */offer: Offer; /** The merkle proof path for the offer. */
2825
3191
  path: Hex[];
2826
3192
  };
2827
- declare const VERSION$1 = 1;
3193
+ declare const VERSION$1 = 2;
3194
+ declare const MAX_COMPRESSED_OFFERS_BYTES = 1000000;
3195
+ declare const MAX_DECOMPRESSED_OFFERS_BYTES = 4000000;
3196
+ declare const MAX_OFFERS_PER_TREE = 100;
2828
3197
  type SignatureDomain = {
2829
3198
  /** Chain id used in the EIP-712 domain. */chainId: number | bigint; /** MorphoV2 contract address used as verifying contract. */
2830
3199
  verifyingContract: Address;
@@ -2854,11 +3223,10 @@ declare const signatureTypes: {
2854
3223
  * Builds a Merkle tree from a list of offers.
2855
3224
  *
2856
3225
  * Leaves are the offer `hash` values as `bytes32` and are deterministically
2857
- * ordered following the StandardMerkleTree leaf ordering so that the resulting
2858
- * root is stable regardless of the input order.
3226
+ * ordered so that the resulting root is stable regardless of the input order.
2859
3227
  *
2860
3228
  * @param offers - Offers to include in the tree.
2861
- * @returns A `StandardMerkleTree` of `bytes32` leaves representing the offers.
3229
+ * @returns A `SimpleMerkleTree` of offer hashes representing the offers.
2862
3230
  * @throws {TreeError} If tree building fails due to offer inconsistencies.
2863
3231
  */
2864
3232
  declare const from$7: (offers: Offer[]) => Tree;
@@ -2866,7 +3234,7 @@ declare const from$7: (offers: Offer[]) => Tree;
2866
3234
  * Generates merkle proofs for all offers in a tree.
2867
3235
  *
2868
3236
  * Each proof allows independent verification that an offer is included in the tree
2869
- * without requiring the full tree. Proofs are ordered by StandardMerkleTree leaf ordering.
3237
+ * without requiring the full tree.
2870
3238
  *
2871
3239
  * @param tree - The {@link Tree} to generate proofs for.
2872
3240
  * @returns Array of proofs - {@link Proof}
@@ -2947,10 +3315,11 @@ declare const encodeUnsigned: (tree: Tree) => Hex;
2947
3315
  * Returns the tree with separately validated signature and recovered signer address.
2948
3316
  *
2949
3317
  * Validation order:
2950
- * 1. Version check
3318
+ * 1. Version and static size checks
2951
3319
  * 2. Signature verification (fail-fast, before decompression)
2952
- * 3. Decompression (only if signature valid)
2953
- * 4. Root verification (computed from offers vs embedded root)
3320
+ * 3. Streaming decompression with byte cap
3321
+ * 4. JSON array + offer count checks
3322
+ * 5. Root verification (computed from offers vs embedded root)
2954
3323
  *
2955
3324
  * @example
2956
3325
  * ```typescript
@@ -3000,30 +3369,28 @@ declare class SignatureDomainError extends BaseError {
3000
3369
  constructor(reason: string);
3001
3370
  }
3002
3371
  //#endregion
3003
- //#region src/indexer/collectors/Collector.d.ts
3004
- declare const names: readonly ["offers", "morpho_v2", "positions", "prices"];
3005
- type Name = (typeof names)[number];
3006
- /** A general collector interface. */
3007
- type Collector<name extends Name = Name, client extends PublicClient<Transport, Chain$1> = PublicClient<Transport, Chain$1>> = {
3008
- /** The name of the collector. */readonly name: name; /** The chain the collector is running on. */
3009
- readonly chain: client["chain"]; /** The public client used to query chain head. */
3010
- readonly client: client; /** The database connection for collector metadata. */
3011
- readonly db: Database; /** The normal polling interval (ms) for this collector. */
3012
- readonly interval: number;
3013
- /** Start collecting data from external sources.
3014
- * @yields The last block number processed by the collector.
3015
- */
3016
- collect: () => AsyncGenerator<number, void, void>;
3017
- };
3372
+ //#region src/indexer/collectors/contracts.d.ts
3373
+ /**
3374
+ * Canonical collector names handled by the indexer runtime.
3375
+ */
3376
+ declare const collectorNames: readonly ["offers", "morpho_v2", "positions", "prices"];
3377
+ /**
3378
+ * Canonical collector name type.
3379
+ */
3380
+ type CollectorName = (typeof collectorNames)[number];
3018
3381
  //#endregion
3019
3382
  //#region src/database/domains/Blocks.d.ts
3020
3383
  type ChainState = {
3021
- chainId: Id;
3022
- blockNumber: number;
3023
- epoch: bigint;
3384
+ /** Chain identifier. */chainId: Id; /** Latest canonical block number persisted for this chain. */
3385
+ blockNumber: number; /** Current chain epoch fencing token. */
3386
+ epoch: bigint; /** Serialized canonical checkpoint ring used by minimal runtime restart hydration. */
3387
+ checkpoints: string; /** Canonical tip hash corresponding to `blockNumber` when available. */
3388
+ tipHash: string | null; /** Latest finalized block number persisted for deep reorg recovery. */
3389
+ finalizedBlockNumber: number | null; /** Finalized block hash corresponding to `finalizedBlockNumber` when available. */
3390
+ finalizedBlockHash: string | null;
3024
3391
  };
3025
3392
  type CollectorState = {
3026
- collectorName: Name;
3393
+ collectorName: CollectorName;
3027
3394
  chainId: Id;
3028
3395
  blockNumber: number;
3029
3396
  epoch: bigint;
@@ -3034,17 +3401,35 @@ type ChainSnapshot = ChainState & {
3034
3401
  type CollectorSnapshot = CollectorState & {
3035
3402
  updatedAt: Date;
3036
3403
  };
3037
- type InitParameters = {
3404
+ type InitChainParameters = {
3038
3405
  chainId: Id;
3039
- collectorName: Name;
3040
3406
  };
3041
- type AdvanceChainParameters = {
3407
+ type InitCollectorParameters = {
3042
3408
  chainId: Id;
3043
- blockNumber: number;
3044
- epoch: bigint;
3409
+ collectorName: CollectorName;
3410
+ };
3411
+ type Init = {
3412
+ (parameters: InitChainParameters): Promise<{
3413
+ chain: ChainState;
3414
+ }>;
3415
+ (parameters: InitCollectorParameters): Promise<{
3416
+ chain: ChainState;
3417
+ collector: CollectorState;
3418
+ }>;
3419
+ };
3420
+ type AdvanceChainParameters = {
3421
+ /** Chain identifier. */chainId: Id; /** Latest canonical block number. */
3422
+ blockNumber: number; /** Current chain epoch fencing token. */
3423
+ epoch: bigint; /** Optional serialized checkpoint ring; defaults to preserving the current value. */
3424
+ checkpoints?: string; /** Optional canonical tip hash; defaults to preserving the current value. */
3425
+ tipHash?: string | null; /** Optional finalized block number; defaults to preserving the current value. */
3426
+ finalizedBlockNumber?: number | null; /** Optional finalized block hash; defaults to preserving the current value. */
3427
+ finalizedBlockHash?: string | null; /** Optional CAS epoch guard for stale-writer rejection. */
3428
+ expectedEpoch?: bigint; /** Optional CAS tip-hash guard for stale-writer rejection. */
3429
+ expectedTipHash?: string | null;
3045
3430
  };
3046
3431
  type AdvanceCollectorParameters = {
3047
- collectorName: Name;
3432
+ collectorName: CollectorName;
3048
3433
  chainId: Id;
3049
3434
  blockNumber: number;
3050
3435
  epoch: bigint;
@@ -3053,17 +3438,14 @@ type HandleReorgParameters = {
3053
3438
  chainId: Id;
3054
3439
  blockNumber: number;
3055
3440
  epoch: bigint;
3056
- collectorNames?: Name[];
3441
+ collectorNames?: CollectorName[];
3057
3442
  };
3058
3443
  type BlocksDomain = {
3059
- /** Initialize and return chain + collector state, seeding rows when missing. */init: (parameters: InitParameters) => Promise<{
3060
- chain: ChainState;
3061
- collector: CollectorState;
3062
- }>; /** Return chain state, failing if it has not been initialized yet. */
3444
+ /** Initialize chain state, and optionally collector state, seeding rows when missing. */init: Init; /** Return chain state, failing if it has not been initialized yet. */
3063
3445
  getChain: (chainId: Id) => Promise<ChainState>; /** Return collector state, failing if it has not been initialized yet. */
3064
3446
  getCollector: (parameters: {
3065
3447
  chainId: Id;
3066
- collectorName: Name;
3448
+ collectorName: CollectorName;
3067
3449
  }) => Promise<CollectorState>; /** Return chain state rows, optionally filtered by chain id. */
3068
3450
  getChains: (parameters?: {
3069
3451
  chainId?: Id;
@@ -3076,7 +3458,7 @@ type BlocksDomain = {
3076
3458
  handleReorg: (parameters: HandleReorgParameters) => Promise<void>;
3077
3459
  };
3078
3460
  declare namespace Logger_d_exports {
3079
- export { LogEntry, LogFn, LogLevel, LogLevelValues, Logger, defaultLogger, getLogger, runWithLogger, silentLogger };
3461
+ export { LogContext, LogEntry, LogFn, LogLevel, LogLevelValues, Logger, defaultLogger, getLogger, isLogFnEnabled, runWithLogContext, runWithLogger, silentLogger };
3080
3462
  }
3081
3463
  declare const LogLevelValues: readonly ["trace", "debug", "info", "warn", "error", "fatal", "silent"];
3082
3464
  type LogLevel = (typeof LogLevelValues)[number];
@@ -3084,6 +3466,7 @@ type LogEntry = Compute<{
3084
3466
  msg: string;
3085
3467
  } & Record<string, unknown>>;
3086
3468
  type LogFn = (entry: LogEntry) => void;
3469
+ type LogContext = Readonly<Record<string, unknown>>;
3087
3470
  type Logger = {
3088
3471
  trace: LogFn;
3089
3472
  debug: LogFn;
@@ -3094,7 +3477,21 @@ type Logger = {
3094
3477
  };
3095
3478
  declare function defaultLogger(minLevel?: LogLevel, pretty?: boolean): Logger;
3096
3479
  declare function silentLogger(): Logger;
3480
+ /**
3481
+ * Check whether a log function is configured to emit entries.
3482
+ * @param logFn - Logger method to inspect.
3483
+ * @returns `true` when the function is enabled.
3484
+ */
3485
+ declare function isLogFnEnabled(logFn: LogFn): boolean;
3097
3486
  declare function runWithLogger<T>(logger: Logger, fn: () => Promise<T>): Promise<T>;
3487
+ /**
3488
+ * Run a function with additional context fields attached to every log entry emitted via {@link getLogger}.
3489
+ * Nested calls merge context (inner keys override outer keys).
3490
+ * @param context - Static fields added to all log entries in this scope.
3491
+ * @param fn - Async function to run with the scoped logging context.
3492
+ * @returns The result of the function.
3493
+ */
3494
+ declare function runWithLogContext<T>(context: LogContext, fn: () => Promise<T>): Promise<T>;
3098
3495
  declare function getLogger(): Logger;
3099
3496
  //#endregion
3100
3497
  //#region src/database/domains/Offers.d.ts
@@ -3110,11 +3507,10 @@ type Row = {
3110
3507
  hash: Hex;
3111
3508
  obligationId: Hex;
3112
3509
  maker: Address;
3113
- assets: bigint;
3114
3510
  obligationUnits: bigint;
3115
- obligationShares: bigint;
3116
3511
  tick: number;
3117
3512
  maturity: Maturity;
3513
+ rcfThreshold: bigint;
3118
3514
  expiry: number;
3119
3515
  start: number;
3120
3516
  group: Hex;
@@ -3128,10 +3524,14 @@ type Row = {
3128
3524
  data: Hex;
3129
3525
  };
3130
3526
  receiverIfMakerIsSeller: Address;
3527
+ exitOnly: boolean;
3131
3528
  consumed: bigint;
3132
3529
  available: bigint;
3133
3530
  takeable: bigint;
3134
3531
  blockNumber: number;
3532
+ root?: Hex;
3533
+ signature?: Hex;
3534
+ proof?: Hex[];
3135
3535
  };
3136
3536
  type OfferReference$1 = {
3137
3537
  hash: Hex;
@@ -3188,7 +3588,7 @@ declare namespace get$5 {
3188
3588
  };
3189
3589
  type Level = {
3190
3590
  /** The offer tick for this level */tick: number; /** Sum of takeable amounts at this tick */
3191
- assets: bigint; /** Number of offers at this tick */
3591
+ obligationUnits: bigint; /** Number of offers at this tick */
3192
3592
  count: number;
3193
3593
  };
3194
3594
  type ReturnType = {
@@ -3214,8 +3614,8 @@ type CallbackInput = {
3214
3614
  chainId: Id;
3215
3615
  contract: Address;
3216
3616
  user: Address;
3217
- amount: bigint;
3218
3617
  positionTypeId: number;
3618
+ type: CallbackType;
3219
3619
  };
3220
3620
  type OfferCallbacks = {
3221
3621
  offerHash: Hex;
@@ -3265,12 +3665,23 @@ type GroupInput = {
3265
3665
  blockNumber: number;
3266
3666
  consumed?: bigint;
3267
3667
  };
3668
+ type GroupKey = {
3669
+ chainId: Id;
3670
+ maker: Address;
3671
+ group: Hex;
3672
+ };
3268
3673
  type GroupsDomain = {
3269
3674
  /**
3270
3675
  * Insert groups (insert-only).
3271
3676
  * @param groups - Groups to insert. {@link GroupInput}
3272
3677
  */
3273
3678
  create: (groups: GroupInput[]) => Promise<void>;
3679
+ /**
3680
+ * Check which groups already exist in the database.
3681
+ * @param groups - Group keys to check. {@link GroupKey}
3682
+ * @returns The subset of input groups that exist in the database.
3683
+ */
3684
+ exists: (groups: GroupKey[]) => Promise<GroupKey[]>;
3274
3685
  };
3275
3686
  //#endregion
3276
3687
  //#region src/database/domains/Lots.d.ts
@@ -3754,6 +4165,22 @@ type ConfigRule = {
3754
4165
  type: "oracle";
3755
4166
  chain_id: Id;
3756
4167
  address: Address;
4168
+ } | {
4169
+ type: "group_consistency";
4170
+ chain_id: Id;
4171
+ description: string;
4172
+ } | {
4173
+ type: "group_immutability";
4174
+ chain_id: Id;
4175
+ description: string;
4176
+ } | {
4177
+ type: "max_collaterals";
4178
+ chain_id: Id;
4179
+ max: number;
4180
+ } | {
4181
+ type: "min_duration";
4182
+ chain_id: Id;
4183
+ min_seconds: number;
3757
4184
  };
3758
4185
  type ValidationIssue = {
3759
4186
  index: number;
@@ -3822,15 +4249,77 @@ type ClientConfig = {
3822
4249
  * @returns An HTTP-backed gatekeeper client. {@link GatekeeperClient}
3823
4250
  */
3824
4251
  declare function createHttpClient(config: ClientConfig): GatekeeperClient;
4252
+ //#endregion
4253
+ //#region src/indexer/engine/operation.d.ts
4254
+ /**
4255
+ * Chain view snapshot returned by the chain sync coroutine.
4256
+ */
4257
+ type ChainView = {
4258
+ /** Current observed head. */head: number; /** Canonical target for collectors this tick. */
4259
+ target: number; /** Canonical epoch after sync/reorg handling. */
4260
+ epoch: number; /** Rewind point when a reorg is detected. */
4261
+ rewindTo?: number;
4262
+ };
4263
+ //#endregion
4264
+ //#region src/indexer/engine/runtime.d.ts
4265
+ /**
4266
+ * Minimal runtime API.
4267
+ *
4268
+ * Role:
4269
+ * - run one deterministic indexing tick end-to-end;
4270
+ * - own chain sync, reorg reconciliation, and collector stepping order;
4271
+ * - centralize retry/backoff and pending-op resume semantics.
4272
+ */
4273
+ type Runtime = {
4274
+ /**
4275
+ * Execute one deterministic runtime tick.
4276
+ * Runs chain sync, applies any reorg rewinds, and advances each collector once.
4277
+ */
4278
+ tick: () => Promise<ChainView>;
4279
+ /**
4280
+ * Return the runtime-recommended wait time before the next tick.
4281
+ *
4282
+ * This captures collector-specific sleep scheduling and is clamped by `heartbeatMs`
4283
+ * when configured.
4284
+ */
4285
+ nextWakeInMs: () => number;
4286
+ };
4287
+ //#endregion
4288
+ //#region src/indexer/Observer.d.ts
4289
+ type CommitEntityOperation = "inserted" | "upserted" | "deleted" | "ignored";
4290
+ type CommitAppliedStat = {
4291
+ collector: string;
4292
+ entity: string;
4293
+ operation: CommitEntityOperation;
4294
+ count: number;
4295
+ };
4296
+ type RuntimeEventObserver$1 = (parameters: {
4297
+ event: string;
4298
+ fields?: Record<string, unknown>;
4299
+ }) => void;
4300
+ type CommitAppliedObserver$1 = (parameters: {
4301
+ collectors: string[];
4302
+ stats: CommitAppliedStat[];
4303
+ committedAtUnixMs: number;
4304
+ }) => void;
4305
+ type ChainObserver = {
4306
+ observeRuntime: (runtime: Runtime) => Runtime;
4307
+ onRuntimeEvent: RuntimeEventObserver$1;
4308
+ onCommitApplied: CommitAppliedObserver$1;
4309
+ };
3825
4310
  declare namespace Indexer_d_exports {
3826
- export { Indexer, IndexerConfig, create$3 as create, from$6 as from };
4311
+ export { CONNECTION_ERROR_ESCALATION_THRESHOLD, CommitAppliedObserver, CreateParameters$1 as CreateParameters, Indexer, IndexerConfig, RuntimeConfig, RuntimeEventObserver, RuntimeObserver, buildRuntime, create$3 as create, from$6 as from };
3827
4312
  }
4313
+ declare const CONNECTION_ERROR_ESCALATION_THRESHOLD = 20;
3828
4314
  type Indexer = {
3829
4315
  start: () => () => void;
3830
4316
  next: () => Promise<void>;
3831
4317
  return: () => Promise<void>;
3832
4318
  };
3833
- type IndexerConfig<client extends PublicClient<Transport, Chain$1, Account | undefined>> = {
4319
+ type RuntimeEventObserver = RuntimeEventObserver$1;
4320
+ type CommitAppliedObserver = CommitAppliedObserver$1;
4321
+ type RuntimeObserver = Pick<ChainObserver, "observeRuntime" | "onRuntimeEvent" | "onCommitApplied">;
4322
+ type RuntimeConfig<client extends PublicClient<Transport, Chain$1, Account | undefined>> = {
3834
4323
  client: client;
3835
4324
  db: Database;
3836
4325
  gatekeeper: GatekeeperClient;
@@ -3839,20 +4328,51 @@ type IndexerConfig<client extends PublicClient<Transport, Chain$1, Account | und
3839
4328
  maxBlockNumber?: number;
3840
4329
  blockWindow?: number;
3841
4330
  retryAttempts?: number;
3842
- retryDelayMs?: number;
4331
+ retryDelayMs?: number; /** Maximum concurrent read/execute operations issued by the runtime. */
4332
+ maxParallelRpc?: number; /** Maximum concurrent runtime commits (chain + collector applies). */
4333
+ maxParallelCommits?: number; /** Adapter pending-resolution budget per commit. */
4334
+ maxPendingResolutionsPerCommit?: number; /** Pending item age threshold (blocks) before ignore eligibility. */
4335
+ pendingIgnoreAfterBlocks?: number; /** Pending item attempt threshold before ignore eligibility. */
4336
+ pendingIgnoreAfterAttempts?: number;
3843
4337
  };
3844
- declare function from$6<client extends PublicClient<Transport, Chain$1, Account | undefined>>(config: IndexerConfig<client>): Indexer;
3845
- declare function create$3<client extends PublicClient<Transport, Chain$1, Account | undefined>>(params: {
3846
- collectors: Collector[];
4338
+ type IndexerConfig<client extends PublicClient<Transport, Chain$1, Account | undefined>> = RuntimeConfig<client> & {
4339
+ /**
4340
+ * Runtime tick burst count per `next()` call.
4341
+ * Defaults to `2` to reduce catch-up latency while preserving backward behavior.
4342
+ */
4343
+ ticksPerNext?: number; /** Optional runtime observer hook for tick and runtime-event monitoring. */
4344
+ observer?: RuntimeObserver;
4345
+ };
4346
+ type CreateParameters$1<client extends PublicClient<Transport, Chain$1, Account | undefined>> = {
3847
4347
  client: client;
3848
- }): Indexer;
4348
+ runtime: Runtime;
4349
+ ticksPerNext?: number;
4350
+ };
4351
+ /**
4352
+ * Build one indexer runtime for a chain configuration.
4353
+ * @param config - Runtime configuration.
4354
+ * @returns Initialized runtime.
4355
+ */
4356
+ declare function buildRuntime<client extends PublicClient<Transport, Chain$1, Account | undefined>>(config: RuntimeConfig<client>): Runtime;
4357
+ /**
4358
+ * Build and start an indexer host for one chain.
4359
+ * @param config - Indexer configuration.
4360
+ * @returns Indexer host.
4361
+ */
4362
+ declare function from$6<client extends PublicClient<Transport, Chain$1, Account | undefined>>(config: IndexerConfig<client>): Indexer;
4363
+ /**
4364
+ * Create an indexer host around a prepared runtime.
4365
+ * @param parameters - Indexer host dependencies.
4366
+ * @returns Indexer host.
4367
+ */
4368
+ declare function create$3<client extends PublicClient<Transport, Chain$1, Account | undefined>>(parameters: CreateParameters$1<client>): Indexer;
3849
4369
  declare namespace Health_d_exports {
3850
4370
  export { ChainHealth$1 as ChainHealth, CollectorHealth$1 as CollectorHealth, CollectorHealthStatus, HealthService, HealthServiceParameters, MissingCollector, RouterHealth, RouterStatus, create$2 as create };
3851
4371
  }
3852
4372
  type CollectorHealthStatus = "live" | "lagging" | "unknown";
3853
4373
  type RouterStatus = "live" | "syncing";
3854
4374
  type CollectorHealth$1 = {
3855
- name: Name;
4375
+ name: CollectorName;
3856
4376
  chainId: Id;
3857
4377
  blockNumber: number | null;
3858
4378
  updatedAt: string | null;
@@ -3870,7 +4390,7 @@ type ChainHealth$1 = {
3870
4390
  };
3871
4391
  type MissingCollector = {
3872
4392
  chainId: Id;
3873
- name: Name;
4393
+ name: CollectorName;
3874
4394
  };
3875
4395
  type RouterHealth = {
3876
4396
  status: RouterStatus;
@@ -3887,7 +4407,8 @@ type HealthService = {
3887
4407
  type HealthServiceParameters = {
3888
4408
  db: Database; /** Maximum number of blocks a collector can lag behind its chain before being considered lagging. */
3889
4409
  maxAllowedLag?: number; /** Map of chainId to client for fetching remote block numbers. */
3890
- healthClients?: Map<Id, Client>; /** Chain registry for deriving expected initialization state. */
4410
+ healthClients?: Map<Id, Client>; /** Timeout guard for each remote head RPC call. */
4411
+ remoteBlockTimeoutMs?: number; /** Chain registry for deriving expected initialization state. */
3891
4412
  chainRegistry?: ChainRegistry;
3892
4413
  };
3893
4414
  type Snapshot = {
@@ -3903,39 +4424,44 @@ type Snapshot = {
3903
4424
  */
3904
4425
  declare function create$2(parameters: HealthServiceParameters): HealthService;
3905
4426
  //#endregion
3906
- //#region src/api/Api.d.ts
3907
- type RouterApi = {
3908
- serve: () => void;
4427
+ //#region src/observability/HttpRequestMetrics.d.ts
4428
+ /**
4429
+ * A completed HTTP request observation.
4430
+ */
4431
+ type Observation = {
4432
+ component: "api" | "gatekeeper";
4433
+ method: string;
4434
+ route: string;
4435
+ statusCode: number;
4436
+ durationMs: number;
3909
4437
  };
3910
- type ApiConfig = {
3911
- db: Database;
3912
- gatekeeper: GatekeeperClient;
3913
- port: number;
3914
- chainRegistry: ChainRegistry;
4438
+ /**
4439
+ * HTTP request metrics collector.
4440
+ */
4441
+ type HttpRequestMetrics = {
4442
+ observe: (observation: Observation) => void;
4443
+ render: () => Promise<string>;
3915
4444
  };
3916
- declare function from$5(config: ApiConfig): RouterApi;
3917
- type CreateParameters = {
3918
- db: Database;
3919
- gatekeeper: GatekeeperClient;
3920
- port: number;
3921
- chainRegistry: ChainRegistry;
4445
+ //#endregion
4446
+ //#region src/observability/SyncMetrics.d.ts
4447
+ type MetricsService = {
4448
+ getPrometheusMetrics: () => Promise<string>;
3922
4449
  };
3923
- declare function create$1(params: CreateParameters): RouterApi;
3924
4450
  declare namespace BookResponse_d_exports {
3925
- export { BookLevelResponse, from$4 as from };
4451
+ export { BookLevelResponse, from$5 as from };
3926
4452
  }
3927
4453
  type BookLevelResponse = {
3928
4454
  tick: number;
3929
4455
  price: string;
3930
- assets: string;
4456
+ obligation_units: string;
3931
4457
  count: number;
3932
4458
  };
3933
4459
  type Input$1 = {
3934
4460
  tick: number;
3935
- assets: bigint;
4461
+ obligationUnits: bigint;
3936
4462
  count: number;
3937
4463
  };
3938
- declare function from$4(level: Input$1): BookLevelResponse;
4464
+ declare function from$5(level: Input$1): BookLevelResponse;
3939
4465
  //#endregion
3940
4466
  //#region src/api/Schema/health.d.ts
3941
4467
  declare const CollectorHealth: z.ZodObject<{
@@ -4650,7 +5176,7 @@ interface components {
4650
5176
  * @example 500000000000000000
4651
5177
  */
4652
5178
  price: string; /** @example 369216000000000000000000 */
4653
- assets: string; /** @example 5 */
5179
+ obligation_units: string; /** @example 5 */
4654
5180
  count: number;
4655
5181
  };
4656
5182
  BadRequestResponse: {
@@ -4768,16 +5294,16 @@ interface components {
4768
5294
  * {
4769
5295
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
4770
5296
  * "lltv": "860000000000000000",
5297
+ * "max_lif": "0",
4771
5298
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
4772
5299
  * }
4773
5300
  * ],
4774
- * "maturity": 1761922799
5301
+ * "maturity": 1761922799,
5302
+ * "rcf_threshold": "0"
4775
5303
  * },
4776
5304
  * "buy": false,
4777
5305
  * "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
4778
- * "assets": "369216000000000000000000",
4779
- * "obligation_units": "0",
4780
- * "obligation_shares": "0",
5306
+ * "obligation_units": "369216000000000000000000",
4781
5307
  * "start": 1761922790,
4782
5308
  * "expiry": 1761922799,
4783
5309
  * "tick": 495,
@@ -4785,10 +5311,11 @@ interface components {
4785
5311
  * "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
4786
5312
  * "callback": "0x0000000000000000000000000000000000000000",
4787
5313
  * "callback_data": "0x",
4788
- * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
5314
+ * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
5315
+ * "exit_only": false
4789
5316
  * },
4790
5317
  * "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
4791
- * "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc",
5318
+ * "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf79",
4792
5319
  * "chain_id": 1,
4793
5320
  * "consumed": "0",
4794
5321
  * "takeable": "369216000000000000000000",
@@ -4813,16 +5340,16 @@ interface components {
4813
5340
  * {
4814
5341
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
4815
5342
  * "lltv": "860000000000000000",
5343
+ * "max_lif": "0",
4816
5344
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
4817
5345
  * }
4818
5346
  * ],
4819
- * "maturity": 1761922799
5347
+ * "maturity": 1761922799,
5348
+ * "rcf_threshold": "0"
4820
5349
  * },
4821
5350
  * "buy": false,
4822
5351
  * "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
4823
- * "assets": "369216000000000000000000",
4824
- * "obligation_units": "0",
4825
- * "obligation_shares": "0",
5352
+ * "obligation_units": "369216000000000000000000",
4826
5353
  * "start": 1761922790,
4827
5354
  * "expiry": 1761922799,
4828
5355
  * "tick": 495,
@@ -4830,11 +5357,12 @@ interface components {
4830
5357
  * "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
4831
5358
  * "callback": "0x0000000000000000000000000000000000000000",
4832
5359
  * "callback_data": "0x",
4833
- * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
5360
+ * "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
5361
+ * "exit_only": false
4834
5362
  * }
4835
5363
  */
4836
5364
  offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
4837
- offer_hash: string; /** @example 0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc */
5365
+ offer_hash: string; /** @example 0x25690ae1aee324a005be565f3bcdd16dbf8daf79 */
4838
5366
  obligation_id: string; /** @example 1 */
4839
5367
  chain_id: number; /** @example 0 */
4840
5368
  consumed: string; /** @example 369216000000000000000000 */
@@ -4858,18 +5386,18 @@ interface components {
4858
5386
  * {
4859
5387
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
4860
5388
  * "lltv": "860000000000000000",
5389
+ * "max_lif": "0",
4861
5390
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
4862
5391
  * }
4863
5392
  * ],
4864
- * "maturity": 1761922799
5393
+ * "maturity": 1761922799,
5394
+ * "rcf_threshold": "0"
4865
5395
  * }
4866
5396
  */
4867
5397
  obligation: components["schemas"]["ObligationOfferResponse"]; /** @example false */
4868
5398
  buy: boolean; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
4869
5399
  maker: string; /** @example 369216000000000000000000 */
4870
- assets: string; /** @example 0 */
4871
- obligation_units: string; /** @example 0 */
4872
- obligation_shares: string; /** @example 1761922790 */
5400
+ obligation_units: string; /** @example 1761922790 */
4873
5401
  start: number; /** @example 1761922799 */
4874
5402
  expiry: number; /** @example 495 */
4875
5403
  tick: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
@@ -4877,7 +5405,8 @@ interface components {
4877
5405
  session: string; /** @example 0x0000000000000000000000000000000000000000 */
4878
5406
  callback: string; /** @example 0x */
4879
5407
  callback_data: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
4880
- receiver_if_maker_is_seller: string;
5408
+ receiver_if_maker_is_seller: string; /** @example false */
5409
+ exit_only: boolean;
4881
5410
  };
4882
5411
  ObligationOfferResponse: {
4883
5412
  /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */loan_token: string;
@@ -4886,16 +5415,19 @@ interface components {
4886
5415
  * {
4887
5416
  * "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
4888
5417
  * "lltv": "860000000000000000",
5418
+ * "max_lif": "0",
4889
5419
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401"
4890
5420
  * }
4891
5421
  * ]
4892
5422
  */
4893
5423
  collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922799 */
4894
- maturity: number;
5424
+ maturity: number; /** @example 0 */
5425
+ rcf_threshold: string;
4895
5426
  };
4896
5427
  CollateralResponse: {
4897
5428
  /** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */token: string; /** @example 860000000000000000 */
4898
- lltv: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
5429
+ lltv: string; /** @example 0 */
5430
+ max_lif: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
4899
5431
  oracle: string;
4900
5432
  };
4901
5433
  ObligationListResponse: {
@@ -4908,7 +5440,8 @@ interface components {
4908
5440
  chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
4909
5441
  loan_token: string;
4910
5442
  collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922800 */
4911
- maturity: number;
5443
+ maturity: number; /** @example 0 */
5444
+ rcf_threshold: string;
4912
5445
  ask: components["schemas"]["AskResponse"];
4913
5446
  bid: components["schemas"]["BidResponse"];
4914
5447
  };
@@ -5062,11 +5595,10 @@ interface components {
5062
5595
  };
5063
5596
  ValidateOfferRequest: {
5064
5597
  /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
5065
- assets: string; /** @example 0 */
5066
- obligation_units?: string; /** @example 0 */
5067
- obligation_shares?: string; /** @example 495 */
5598
+ obligation_units?: string; /** @example 495 */
5068
5599
  tick: number; /** @example 1761922799 */
5069
- maturity: number; /** @example 1761922799 */
5600
+ maturity: number; /** @example 0 */
5601
+ rcf_threshold: string; /** @example 1761922799 */
5070
5602
  expiry: number; /** @example 1761922790 */
5071
5603
  start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
5072
5604
  group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
@@ -5078,7 +5610,8 @@ interface components {
5078
5610
  * {
5079
5611
  * "asset": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
5080
5612
  * "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
5081
- * "lltv": "860000000000000000"
5613
+ * "lltv": "860000000000000000",
5614
+ * "max_lif": "0"
5082
5615
  * }
5083
5616
  * ]
5084
5617
  */
@@ -5090,12 +5623,14 @@ interface components {
5090
5623
  * }
5091
5624
  */
5092
5625
  callback: components["schemas"]["ValidateCallbackRequest"]; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
5093
- receiver_if_maker_is_seller: string;
5626
+ receiver_if_maker_is_seller: string; /** @example false */
5627
+ exit_only?: boolean;
5094
5628
  };
5095
5629
  ValidateCollateralRequest: {
5096
5630
  /** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */asset: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
5097
5631
  oracle: string; /** @example 860000000000000000 */
5098
- lltv: string;
5632
+ lltv: string; /** @example 0 */
5633
+ max_lif: string;
5099
5634
  };
5100
5635
  ValidateCallbackRequest: {
5101
5636
  /** @example 0x0000000000000000000000000000000000000000 */address: string; /** @example 0x */
@@ -5126,7 +5661,7 @@ interface components {
5126
5661
  pathItems: never;
5127
5662
  }
5128
5663
  declare namespace ObligationResponse_d_exports {
5129
- export { ObligationResponse, from$3 as from };
5664
+ export { ObligationResponse, from$4 as from };
5130
5665
  }
5131
5666
  type ObligationResponse = paths["/v1/obligations"]["get"]["responses"]["200"]["content"]["application/json"]["data"][number];
5132
5667
  /**
@@ -5137,20 +5672,19 @@ type ObligationResponse = paths["/v1/obligations"]["get"]["responses"]["200"]["c
5137
5672
  * @param chainId - The chain id used to compute `id`.
5138
5673
  * @returns The created `ObligationResponse`. {@link ObligationResponse}
5139
5674
  */
5140
- declare function from$3(obligation: Obligation$1, quote: Quote, chainId: Id): ObligationResponse;
5675
+ declare function from$4(obligation: Obligation$1, quote: Quote, chainId: Id): ObligationResponse;
5141
5676
  declare namespace OfferResponse_d_exports {
5142
- export { Input, OfferResponse, from$2 as from };
5677
+ export { Input, OfferResponse, from$3 as from };
5143
5678
  }
5144
5679
  type OfferResponse = paths["/v1/offers"]["get"]["responses"]["200"]["content"]["application/json"]["data"][number];
5145
5680
  type Input = Readonly<{
5146
5681
  hash: Hex;
5147
5682
  obligationId: Hex;
5148
5683
  maker: Address;
5149
- assets: bigint;
5150
5684
  obligationUnits: bigint;
5151
- obligationShares: bigint;
5152
5685
  tick: number;
5153
5686
  maturity: number;
5687
+ rcfThreshold: bigint;
5154
5688
  expiry: number;
5155
5689
  start: number;
5156
5690
  group: Hex;
@@ -5161,6 +5695,7 @@ type Input = Readonly<{
5161
5695
  collaterals: Readonly<{
5162
5696
  asset: Address;
5163
5697
  lltv: bigint;
5698
+ maxLif: bigint;
5164
5699
  oracle: Address;
5165
5700
  }[]>;
5166
5701
  callback: {
@@ -5168,6 +5703,7 @@ type Input = Readonly<{
5168
5703
  data: Hex;
5169
5704
  };
5170
5705
  receiverIfMakerIsSeller: Address;
5706
+ exitOnly: boolean;
5171
5707
  root?: Hex | undefined;
5172
5708
  proof?: Hex[] | undefined;
5173
5709
  signature?: Hex | undefined;
@@ -5181,7 +5717,7 @@ type Input = Readonly<{
5181
5717
  * @param input - {@link Input}
5182
5718
  * @returns The created `OfferResponse`. {@link OfferResponse}
5183
5719
  */
5184
- declare function from$2(input: Input): OfferResponse;
5720
+ declare function from$3(input: Input): OfferResponse;
5185
5721
  //#endregion
5186
5722
  //#region src/api/Schema/openapi.d.ts
5187
5723
  declare class BooksController {
@@ -5213,7 +5749,7 @@ declare class UsersController {
5213
5749
  }
5214
5750
  declare const OpenApi: () => Promise<OpenAPIDocument>;
5215
5751
  declare namespace PositionResponse_d_exports {
5216
- export { PositionResponse, PositionWithReserved$1 as PositionWithReserved, from$1 as from };
5752
+ export { PositionResponse, PositionWithReserved$1 as PositionWithReserved, from$2 as from };
5217
5753
  }
5218
5754
  type PositionResponse = {
5219
5755
  chain_id: Id;
@@ -5229,7 +5765,7 @@ type PositionWithReserved$1 = getByUser.PositionWithReserved;
5229
5765
  * @param position - {@link PositionWithReserved}
5230
5766
  * @returns The created `PositionResponse`. {@link PositionResponse}
5231
5767
  */
5232
- declare function from$1(position: PositionWithReserved$1): PositionResponse;
5768
+ declare function from$2(position: PositionWithReserved$1): PositionResponse;
5233
5769
  //#endregion
5234
5770
  //#region src/api/Schema/requests.d.ts
5235
5771
  declare const schemas: {
@@ -5266,11 +5802,15 @@ declare const schemas: {
5266
5802
  cursor: z$1.ZodOptional<z$1.ZodString>;
5267
5803
  limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodPipe<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>, z$1.ZodNumber>>>;
5268
5804
  types: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodEnum<{
5269
- oracle: "oracle";
5805
+ loan_token: "loan_token";
5270
5806
  maturity: "maturity";
5271
5807
  callback: "callback";
5272
- loan_token: "loan_token";
5273
5808
  collateral_token: "collateral_token";
5809
+ oracle: "oracle";
5810
+ min_duration: "min_duration";
5811
+ max_collaterals: "max_collaterals";
5812
+ group_consistency: "group_consistency";
5813
+ group_immutability: "group_immutability";
5274
5814
  }>>>>;
5275
5815
  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>>>>>;
5276
5816
  }, z$1.core.$strip>;
@@ -5412,9 +5952,17 @@ declare function getDocsHtml(): Promise<string>;
5412
5952
  declare function getIntegratorDocsHtml(): Promise<string>;
5413
5953
  //#endregion
5414
5954
  //#region src/api/Controllers/getHealth.d.ts
5415
- declare function getHealth(query: unknown, db: Database, chainRegistry?: ChainRegistry): Promise<Payload<paths["/v1/health"]["get"]["responses"]["200"]["content"]["application/json"]["data"]>>;
5416
- declare function getHealthChains(query: unknown, db: Database, healthClients?: Map<Id, Client>, chainRegistry?: ChainRegistry): Promise<Payload<paths["/v1/health/chains"]["get"]["responses"]["200"]["content"]["application/json"]["data"]>>;
5417
- declare function getHealthCollectors(query: unknown, db: Database, chainRegistry?: ChainRegistry): Promise<Payload<paths["/v1/health/collectors"]["get"]["responses"]["200"]["content"]["application/json"]["data"]>>;
5955
+ declare function getHealth(query: unknown, healthService: HealthService): Promise<Payload<paths["/v1/health"]["get"]["responses"]["200"]["content"]["application/json"]["data"]>>;
5956
+ declare function getHealthChains(query: unknown, healthService: HealthService): Promise<Payload<paths["/v1/health/chains"]["get"]["responses"]["200"]["content"]["application/json"]["data"]>>;
5957
+ declare function getHealthCollectors(query: unknown, healthService: HealthService): Promise<Payload<paths["/v1/health/collectors"]["get"]["responses"]["200"]["content"]["application/json"]["data"]>>;
5958
+ //#endregion
5959
+ //#region src/api/Controllers/getMetrics.d.ts
5960
+ /**
5961
+ * Get router metrics in Prometheus exposition format.
5962
+ * @param metricsService - Metrics service instance. {@link Metrics.MetricsService}
5963
+ * @returns Prometheus exposition payload.
5964
+ */
5965
+ declare function getMetrics(metricsService: MetricsService): Promise<string>;
5418
5966
  //#endregion
5419
5967
  //#region src/api/Controllers/getObligation.d.ts
5420
5968
  declare function getObligation(params: object, db: Database): Promise<Payload<ObligationResponse>>;
@@ -5433,12 +5981,19 @@ type OffersRowsResult = {
5433
5981
  nextCursor: string | null;
5434
5982
  };
5435
5983
  /**
5436
- * Query offers with computed consumed/available/takeable values.
5984
+ * Query offers for a maker with computed consumed/available/takeable values.
5985
+ * Uses the same CTE-based computation as Book.ts via shared OfferFormulas builders.
5437
5986
  * @param db - The database client. {@link Database.Core}
5438
5987
  * @param parameters - {@link GetOffersQueryParams}
5439
5988
  * @returns The offers with pagination cursor.
5440
5989
  */
5441
5990
  declare function getOffersQuery(db: Core, parameters?: GetOffersQueryParams): Promise<OffersRowsResult>;
5991
+ /**
5992
+ * Get offers with optional maker or obligation+side filter.
5993
+ * @param queryParameters - Raw query parameters from the API request.
5994
+ * @param db - The database client. {@link Database.Database}
5995
+ * @returns The offers response payload.
5996
+ */
5442
5997
  declare function getOffers$1(queryParameters: object, db: Database): Promise<Payload<OfferResponse[]>>;
5443
5998
  //#endregion
5444
5999
  //#region src/api/Controllers/getUserPositions.d.ts
@@ -5450,7 +6005,7 @@ declare function getOffers$1(queryParameters: object, db: Database): Promise<Pay
5450
6005
  */
5451
6006
  declare function getUserPositions(queryParameters: object, db: Database): Promise<Payload<PositionResponse[]>>;
5452
6007
  declare namespace Gatekeeper_d_exports {
5453
- export { Gatekeeper, Rules, RulesFactory, create };
6008
+ export { Gatekeeper, Rules, RulesFactory, create$1 as create };
5454
6009
  }
5455
6010
  type Rules = readonly Rule<Offer, string>[];
5456
6011
  type RulesFactory = (chainId: Id) => Rules;
@@ -5468,7 +6023,7 @@ type GatekeeperParameters = {
5468
6023
  * @param parameters - Gatekeeper parameters. {@link GatekeeperParameters}
5469
6024
  * @returns Gatekeeper instance. {@link Gatekeeper}
5470
6025
  */
5471
- declare function create(parameters: GatekeeperParameters): Gatekeeper;
6026
+ declare function create$1(parameters: GatekeeperParameters): Gatekeeper;
5472
6027
  //#endregion
5473
6028
  //#region src/api/Controllers/validateOffers.d.ts
5474
6029
  type ValidationIssue$1 = {
@@ -5486,10 +6041,76 @@ type ValidateOffersIssuesPayload = SuccessPayload$1<{
5486
6041
  type ValidateOffersResponse = ValidateOffersSuccessPayload | ValidateOffersIssuesPayload;
5487
6042
  declare function validateOffers(body: object, gatekeeper: Gatekeeper): Promise<ValidateOffersResponse | ErrorPayload$1>;
5488
6043
  declare namespace index_d_exports$4 {
5489
- export { CONFIG_CONTRACT_NAMES, ConfigContract, ConfigContractName, GetOffersQueryParams, ValidationIssue$1 as ValidationIssue, getBook, getConfigContracts, getConfigRules, getDocsHtml, getHealth, getHealthChains, getHealthCollectors, getIntegratorDocsHtml, getObligation, getObligations$1 as getObligations, getOffers$1 as getOffers, getOffersQuery, getSwaggerJson, getUserPositions, validateOffers };
6044
+ export { CONFIG_CONTRACT_NAMES, ConfigContract, ConfigContractName, GetOffersQueryParams, ValidationIssue$1 as ValidationIssue, getBook, getConfigContracts, getConfigRules, getDocsHtml, getHealth, getHealthChains, getHealthCollectors, getIntegratorDocsHtml, getMetrics, getObligation, getObligations$1 as getObligations, getOffers$1 as getOffers, getOffersQuery, getSwaggerJson, getUserPositions, validateOffers };
5490
6045
  }
6046
+ //#endregion
6047
+ //#region src/api/Api.d.ts
6048
+ type RouterApi = {
6049
+ serve: () => ServerHandle;
6050
+ };
6051
+ type ServerHandle = {
6052
+ close: () => Promise<void>;
6053
+ };
6054
+ type ApiServices = {
6055
+ getOffers: (query: object) => ReturnType<typeof getOffers$1>;
6056
+ getObligations: (query: object) => ReturnType<typeof getObligations$1>;
6057
+ getObligation: (parameters: {
6058
+ obligation_id: string;
6059
+ }) => ReturnType<typeof getObligation>;
6060
+ getBook: (parameters: {
6061
+ obligation_id: string;
6062
+ side: string;
6063
+ cursor?: string;
6064
+ limit?: string;
6065
+ }) => ReturnType<typeof getBook>;
6066
+ validateOffers: GatekeeperClient["validate"];
6067
+ getUserPositions: (parameters: {
6068
+ user_address: string;
6069
+ cursor?: string;
6070
+ limit?: string;
6071
+ }) => ReturnType<typeof getUserPositions>;
6072
+ getHealth: (query: unknown) => ReturnType<typeof getHealth>;
6073
+ getHealthCollectors: (query: unknown) => ReturnType<typeof getHealthCollectors>;
6074
+ getHealthChains: (query: unknown) => ReturnType<typeof getHealthChains>;
6075
+ getMetrics: () => Promise<string>;
6076
+ getConfigContracts: (query: unknown) => ReturnType<typeof getConfigContracts>;
6077
+ getConfigRules: GatekeeperClient["getConfigRules"];
6078
+ observeHttpRequest: (observation: Observation) => void;
6079
+ };
6080
+ type CreateServicesParameters = {
6081
+ db: Database;
6082
+ gatekeeper: GatekeeperClient;
6083
+ chainRegistry: ChainRegistry;
6084
+ healthService: HealthService;
6085
+ metricsService: MetricsService;
6086
+ httpRequestMetrics: HttpRequestMetrics;
6087
+ };
6088
+ type ApiConfig = {
6089
+ services: ApiServices;
6090
+ port: number;
6091
+ };
6092
+ declare function from$1(config: ApiConfig): RouterApi;
6093
+ type CreateParameters = {
6094
+ services: ApiServices;
6095
+ port: number;
6096
+ };
6097
+ declare function create(params: CreateParameters): RouterApi;
6098
+ /**
6099
+ * Build router API endpoint services from infrastructure dependencies.
6100
+ * @param parameters - Router API dependencies.
6101
+ * @returns Endpoint service handlers consumed by {@link createApp}.
6102
+ */
6103
+ declare function createServices(parameters: CreateServicesParameters): ApiServices;
6104
+ /**
6105
+ * Create the router API Hono app with all routes and middleware configured.
6106
+ * @param parameters - API construction parameters.
6107
+ * @returns Configured Hono app instance.
6108
+ */
6109
+ declare function createApp(parameters: {
6110
+ services: ApiServices;
6111
+ }): Hono;
5491
6112
  declare namespace RouterApi_d_exports {
5492
- export { ApiConfig, BookResponse_d_exports as BookResponse, BooksController, ChainHealth, ChainsHealthResponse, CollectorHealth, CollectorsHealthResponse, ConfigContractsController, ConfigRulesController, index_d_exports$4 as Controllers, HealthController, ObligationResponse_d_exports as ObligationResponse, ObligationsController, OfferResponse_d_exports as OfferResponse, OffersController, OpenApi, PositionResponse_d_exports as PositionResponse, RouterApi, RouterStatusResponse, UsersController, ValidateController, create$1 as create, from$5 as from, parse, safeParse };
6113
+ export { ApiConfig, ApiServices, BookResponse_d_exports as BookResponse, BooksController, ChainHealth, ChainsHealthResponse, CollectorHealth, CollectorsHealthResponse, ConfigContractsController, ConfigRulesController, index_d_exports$4 as Controllers, CreateServicesParameters, HealthController, ObligationResponse_d_exports as ObligationResponse, ObligationsController, OfferResponse_d_exports as OfferResponse, OffersController, OpenApi, PositionResponse_d_exports as PositionResponse, RouterApi, RouterStatusResponse, ServerHandle, UsersController, ValidateController, create, createApp, createServices, from$1 as from, parse, safeParse };
5493
6114
  }
5494
6115
  declare namespace Client_d_exports$1 {
5495
6116
  export { Client$3 as Client, ConnectOptions, HttpForbiddenError, HttpGetApiFailedError, HttpRateLimitError, HttpUnauthorizedError, InvalidUrlError, connect$1 as connect, getObligations, getOffers };
@@ -5625,7 +6246,7 @@ declare class HttpGetApiFailedError extends BaseError {
5625
6246
  }
5626
6247
  //#endregion
5627
6248
  //#region src/database/drizzle/VERSION.d.ts
5628
- declare const VERSION: "router_v1.11";
6249
+ declare const VERSION: "router_v1.15";
5629
6250
  //#endregion
5630
6251
  //#region src/database/drizzle/schema.d.ts
5631
6252
  declare enum EnumTableName {
@@ -5643,6 +6264,7 @@ declare enum EnumTableName {
5643
6264
  VALIDATIONS = "validations",
5644
6265
  COLLECTORS = "collectors",
5645
6266
  CHAINS = "chains",
6267
+ PENDING_LINKS = "pending_links",
5646
6268
  LOTS = "lots",
5647
6269
  LOTS_POSITIONS = "lots_positions",
5648
6270
  OFFSETS = "offsets",
@@ -5650,12 +6272,12 @@ declare enum EnumTableName {
5650
6272
  MERKLE_PATHS = "merkle_paths"
5651
6273
  }
5652
6274
  declare const TABLE_NAMES: readonly EnumTableName[];
5653
- declare const VERSIONED_TABLE_NAMES: ("\"router_v1.11\".\"obligations\"" | "\"router_v1.11\".\"obligation_id_keys\"" | "\"router_v1.11\".\"groups\"" | "\"router_v1.11\".\"consumed_events\"" | "\"router_v1.11\".\"obligation_collaterals_v2\"" | "\"router_v1.11\".\"oracles\"" | "\"router_v1.11\".\"offers\"" | "\"router_v1.11\".\"offers_callbacks\"" | "\"router_v1.11\".\"callbacks\"" | "\"router_v1.11\".\"positions\"" | "\"router_v1.11\".\"transfers\"" | "\"router_v1.11\".\"validations\"" | "\"router_v1.11\".\"collectors\"" | "\"router_v1.11\".\"chains\"" | "\"router_v1.11\".\"lots\"" | "\"router_v1.11\".\"lots_positions\"" | "\"router_v1.11\".\"offsets\"" | "\"router_v1.11\".\"trees\"" | "\"router_v1.11\".\"merkle_paths\"")[];
6275
+ declare const VERSIONED_TABLE_NAMES: ("\"router_v1.15\".\"obligations\"" | "\"router_v1.15\".\"obligation_id_keys\"" | "\"router_v1.15\".\"groups\"" | "\"router_v1.15\".\"consumed_events\"" | "\"router_v1.15\".\"obligation_collaterals_v2\"" | "\"router_v1.15\".\"oracles\"" | "\"router_v1.15\".\"offers\"" | "\"router_v1.15\".\"offers_callbacks\"" | "\"router_v1.15\".\"callbacks\"" | "\"router_v1.15\".\"positions\"" | "\"router_v1.15\".\"transfers\"" | "\"router_v1.15\".\"validations\"" | "\"router_v1.15\".\"collectors\"" | "\"router_v1.15\".\"chains\"" | "\"router_v1.15\".\"pending_links\"" | "\"router_v1.15\".\"lots\"" | "\"router_v1.15\".\"lots_positions\"" | "\"router_v1.15\".\"offsets\"" | "\"router_v1.15\".\"trees\"" | "\"router_v1.15\".\"merkle_paths\"")[];
5654
6276
  type TableName = (typeof TABLE_NAMES)[number];
5655
6277
  type VersionedTableName = `"${typeof VERSION}"."${TableName}"`;
5656
6278
  declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
5657
6279
  name: EnumTableName.OBLIGATIONS;
5658
- schema: "router_v1.11";
6280
+ schema: "router_v1.15";
5659
6281
  columns: {
5660
6282
  obligationKey: drizzle_orm_pg_core0.PgColumn<{
5661
6283
  name: "obligation_key";
@@ -5712,12 +6334,29 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
5712
6334
  identity: undefined;
5713
6335
  generated: undefined;
5714
6336
  }, {}, {}>;
6337
+ rcfThreshold: drizzle_orm_pg_core0.PgColumn<{
6338
+ name: "rcf_threshold";
6339
+ tableName: EnumTableName.OBLIGATIONS;
6340
+ dataType: "string";
6341
+ columnType: "PgNumeric";
6342
+ data: string;
6343
+ driverParam: string;
6344
+ notNull: true;
6345
+ hasDefault: false;
6346
+ isPrimaryKey: false;
6347
+ isAutoincrement: false;
6348
+ hasRuntimeDefault: false;
6349
+ enumValues: undefined;
6350
+ baseColumn: never;
6351
+ identity: undefined;
6352
+ generated: undefined;
6353
+ }, {}, {}>;
5715
6354
  };
5716
6355
  dialect: "pg";
5717
6356
  }>;
5718
6357
  declare const obligationIdKeys: drizzle_orm_pg_core0.PgTableWithColumns<{
5719
6358
  name: EnumTableName.OBLIGATION_ID_KEYS;
5720
- schema: "router_v1.11";
6359
+ schema: "router_v1.15";
5721
6360
  columns: {
5722
6361
  obligationId: drizzle_orm_pg_core0.PgColumn<{
5723
6362
  name: "obligation_id";
@@ -5800,7 +6439,7 @@ declare const obligationIdKeys: drizzle_orm_pg_core0.PgTableWithColumns<{
5800
6439
  }>;
5801
6440
  declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
5802
6441
  name: EnumTableName.GROUPS;
5803
- schema: "router_v1.11";
6442
+ schema: "router_v1.15";
5804
6443
  columns: {
5805
6444
  chainId: drizzle_orm_pg_core0.PgColumn<{
5806
6445
  name: "chain_id";
@@ -5915,7 +6554,7 @@ declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
5915
6554
  }>;
5916
6555
  declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
5917
6556
  name: EnumTableName.CONSUMED_EVENTS;
5918
- schema: "router_v1.11";
6557
+ schema: "router_v1.15";
5919
6558
  columns: {
5920
6559
  eventId: drizzle_orm_pg_core0.PgColumn<{
5921
6560
  name: "event_id";
@@ -6049,7 +6688,7 @@ declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
6049
6688
  }>;
6050
6689
  declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
6051
6690
  name: EnumTableName.OBLIGATION_COLLATERALS_V2;
6052
- schema: "router_v1.11";
6691
+ schema: "router_v1.15";
6053
6692
  columns: {
6054
6693
  obligationKey: drizzle_orm_pg_core0.PgColumn<{
6055
6694
  name: "obligation_key";
@@ -6125,6 +6764,23 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
6125
6764
  identity: undefined;
6126
6765
  generated: undefined;
6127
6766
  }, {}, {}>;
6767
+ maxLif: drizzle_orm_pg_core0.PgColumn<{
6768
+ name: "max_lif";
6769
+ tableName: EnumTableName.OBLIGATION_COLLATERALS_V2;
6770
+ dataType: "bigint";
6771
+ columnType: "PgBigInt64";
6772
+ data: bigint;
6773
+ driverParam: string;
6774
+ notNull: true;
6775
+ hasDefault: false;
6776
+ isPrimaryKey: false;
6777
+ isAutoincrement: false;
6778
+ hasRuntimeDefault: false;
6779
+ enumValues: undefined;
6780
+ baseColumn: never;
6781
+ identity: undefined;
6782
+ generated: undefined;
6783
+ }, {}, {}>;
6128
6784
  collateralIndex: drizzle_orm_pg_core0.PgColumn<{
6129
6785
  name: "collateral_index";
6130
6786
  tableName: EnumTableName.OBLIGATION_COLLATERALS_V2;
@@ -6164,7 +6820,7 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
6164
6820
  }>;
6165
6821
  declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
6166
6822
  name: EnumTableName.ORACLES;
6167
- schema: "router_v1.11";
6823
+ schema: "router_v1.15";
6168
6824
  columns: {
6169
6825
  chainId: drizzle_orm_pg_core0.PgColumn<{
6170
6826
  name: "chain_id";
@@ -6260,7 +6916,7 @@ declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
6260
6916
  }>;
6261
6917
  declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
6262
6918
  name: EnumTableName.OFFERS;
6263
- schema: "router_v1.11";
6919
+ schema: "router_v1.15";
6264
6920
  columns: {
6265
6921
  hash: drizzle_orm_pg_core0.PgColumn<{
6266
6922
  name: "hash";
@@ -6300,23 +6956,6 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
6300
6956
  }, {}, {
6301
6957
  length: 66;
6302
6958
  }>;
6303
- assets: drizzle_orm_pg_core0.PgColumn<{
6304
- name: "assets";
6305
- tableName: EnumTableName.OFFERS;
6306
- dataType: "string";
6307
- columnType: "PgNumeric";
6308
- data: string;
6309
- driverParam: string;
6310
- notNull: true;
6311
- hasDefault: false;
6312
- isPrimaryKey: false;
6313
- isAutoincrement: false;
6314
- hasRuntimeDefault: false;
6315
- enumValues: undefined;
6316
- baseColumn: never;
6317
- identity: undefined;
6318
- generated: undefined;
6319
- }, {}, {}>;
6320
6959
  obligationUnits: drizzle_orm_pg_core0.PgColumn<{
6321
6960
  name: "obligation_units";
6322
6961
  tableName: EnumTableName.OFFERS;
@@ -6334,23 +6973,6 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
6334
6973
  identity: undefined;
6335
6974
  generated: undefined;
6336
6975
  }, {}, {}>;
6337
- obligationShares: drizzle_orm_pg_core0.PgColumn<{
6338
- name: "obligation_shares";
6339
- tableName: EnumTableName.OFFERS;
6340
- dataType: "string";
6341
- columnType: "PgNumeric";
6342
- data: string;
6343
- driverParam: string;
6344
- notNull: true;
6345
- hasDefault: true;
6346
- isPrimaryKey: false;
6347
- isAutoincrement: false;
6348
- hasRuntimeDefault: false;
6349
- enumValues: undefined;
6350
- baseColumn: never;
6351
- identity: undefined;
6352
- generated: undefined;
6353
- }, {}, {}>;
6354
6976
  tick: drizzle_orm_pg_core0.PgColumn<{
6355
6977
  name: "tick";
6356
6978
  tableName: EnumTableName.OFFERS;
@@ -6567,15 +7189,15 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
6567
7189
  }, {}, {
6568
7190
  length: 42;
6569
7191
  }>;
6570
- blockNumber: drizzle_orm_pg_core0.PgColumn<{
6571
- name: "block_number";
7192
+ exitOnly: drizzle_orm_pg_core0.PgColumn<{
7193
+ name: "exit_only";
6572
7194
  tableName: EnumTableName.OFFERS;
6573
- dataType: "number";
6574
- columnType: "PgBigInt53";
6575
- data: number;
6576
- driverParam: string | number;
7195
+ dataType: "boolean";
7196
+ columnType: "PgBoolean";
7197
+ data: boolean;
7198
+ driverParam: boolean;
6577
7199
  notNull: true;
6578
- hasDefault: false;
7200
+ hasDefault: true;
6579
7201
  isPrimaryKey: false;
6580
7202
  isAutoincrement: false;
6581
7203
  hasRuntimeDefault: false;
@@ -6584,7 +7206,24 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
6584
7206
  identity: undefined;
6585
7207
  generated: undefined;
6586
7208
  }, {}, {}>;
6587
- updatedAt: drizzle_orm_pg_core0.PgColumn<{
7209
+ blockNumber: drizzle_orm_pg_core0.PgColumn<{
7210
+ name: "block_number";
7211
+ tableName: EnumTableName.OFFERS;
7212
+ dataType: "number";
7213
+ columnType: "PgBigInt53";
7214
+ data: number;
7215
+ driverParam: string | number;
7216
+ notNull: true;
7217
+ hasDefault: false;
7218
+ isPrimaryKey: false;
7219
+ isAutoincrement: false;
7220
+ hasRuntimeDefault: false;
7221
+ enumValues: undefined;
7222
+ baseColumn: never;
7223
+ identity: undefined;
7224
+ generated: undefined;
7225
+ }, {}, {}>;
7226
+ updatedAt: drizzle_orm_pg_core0.PgColumn<{
6588
7227
  name: "updated_at";
6589
7228
  tableName: EnumTableName.OFFERS;
6590
7229
  dataType: "date";
@@ -6606,7 +7245,7 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
6606
7245
  }>;
6607
7246
  declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
6608
7247
  name: EnumTableName.OFFERS_CALLBACKS;
6609
- schema: "router_v1.11";
7248
+ schema: "router_v1.15";
6610
7249
  columns: {
6611
7250
  offerHash: drizzle_orm_pg_core0.PgColumn<{
6612
7251
  name: "offer_hash";
@@ -6668,9 +7307,10 @@ declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
6668
7307
  };
6669
7308
  dialect: "pg";
6670
7309
  }>;
7310
+ declare const CallbackTypes: drizzle_orm_pg_core0.PgEnum<[CallbackType, ...CallbackType[]]>;
6671
7311
  declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
6672
7312
  name: EnumTableName.CALLBACKS;
6673
- schema: "router_v1.11";
7313
+ schema: "router_v1.15";
6674
7314
  columns: {
6675
7315
  id: drizzle_orm_pg_core0.PgColumn<{
6676
7316
  name: "id";
@@ -6727,7 +7367,7 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
6727
7367
  identity: undefined;
6728
7368
  generated: undefined;
6729
7369
  }, {}, {
6730
- length: 42;
7370
+ length: 66;
6731
7371
  }>;
6732
7372
  positionUser: drizzle_orm_pg_core0.PgColumn<{
6733
7373
  name: "position_user";
@@ -6765,19 +7405,19 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
6765
7405
  identity: undefined;
6766
7406
  generated: undefined;
6767
7407
  }, {}, {}>;
6768
- amount: drizzle_orm_pg_core0.PgColumn<{
6769
- name: "amount";
7408
+ type: drizzle_orm_pg_core0.PgColumn<{
7409
+ name: "type";
6770
7410
  tableName: EnumTableName.CALLBACKS;
6771
7411
  dataType: "string";
6772
- columnType: "PgNumeric";
6773
- data: string;
7412
+ columnType: "PgEnumColumn";
7413
+ data: CallbackType;
6774
7414
  driverParam: string;
6775
- notNull: false;
7415
+ notNull: true;
6776
7416
  hasDefault: false;
6777
7417
  isPrimaryKey: false;
6778
7418
  isAutoincrement: false;
6779
7419
  hasRuntimeDefault: false;
6780
- enumValues: undefined;
7420
+ enumValues: [CallbackType, ...CallbackType[]];
6781
7421
  baseColumn: never;
6782
7422
  identity: undefined;
6783
7423
  generated: undefined;
@@ -6787,7 +7427,7 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
6787
7427
  }>;
6788
7428
  declare const lotsPositions: drizzle_orm_pg_core0.PgTableWithColumns<{
6789
7429
  name: EnumTableName.LOTS_POSITIONS;
6790
- schema: "router_v1.11";
7430
+ schema: "router_v1.15";
6791
7431
  columns: {
6792
7432
  chainId: drizzle_orm_pg_core0.PgColumn<{
6793
7433
  name: "chain_id";
@@ -6825,7 +7465,7 @@ declare const lotsPositions: drizzle_orm_pg_core0.PgTableWithColumns<{
6825
7465
  identity: undefined;
6826
7466
  generated: undefined;
6827
7467
  }, {}, {
6828
- length: 42;
7468
+ length: 66;
6829
7469
  }>;
6830
7470
  user: drizzle_orm_pg_core0.PgColumn<{
6831
7471
  name: "user";
@@ -6868,7 +7508,7 @@ declare const lotsPositions: drizzle_orm_pg_core0.PgTableWithColumns<{
6868
7508
  }>;
6869
7509
  declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
6870
7510
  name: EnumTableName.LOTS;
6871
- schema: "router_v1.11";
7511
+ schema: "router_v1.15";
6872
7512
  columns: {
6873
7513
  chainId: drizzle_orm_pg_core0.PgColumn<{
6874
7514
  name: "chain_id";
@@ -6925,7 +7565,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
6925
7565
  identity: undefined;
6926
7566
  generated: undefined;
6927
7567
  }, {}, {
6928
- length: 42;
7568
+ length: 66;
6929
7569
  }>;
6930
7570
  group: drizzle_orm_pg_core0.PgColumn<{
6931
7571
  name: "group";
@@ -7004,7 +7644,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
7004
7644
  }>;
7005
7645
  declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
7006
7646
  name: EnumTableName.OFFSETS;
7007
- schema: "router_v1.11";
7647
+ schema: "router_v1.15";
7008
7648
  columns: {
7009
7649
  chainId: drizzle_orm_pg_core0.PgColumn<{
7010
7650
  name: "chain_id";
@@ -7061,7 +7701,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
7061
7701
  identity: undefined;
7062
7702
  generated: undefined;
7063
7703
  }, {}, {
7064
- length: 42;
7704
+ length: 66;
7065
7705
  }>;
7066
7706
  group: drizzle_orm_pg_core0.PgColumn<{
7067
7707
  name: "group";
@@ -7124,7 +7764,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
7124
7764
  declare const PositionTypes: drizzle_orm_pg_core0.PgEnum<[Type, ...Type[]]>;
7125
7765
  declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
7126
7766
  name: "position_types";
7127
- schema: "router_v1.11";
7767
+ schema: "router_v1.15";
7128
7768
  columns: {
7129
7769
  id: drizzle_orm_pg_core0.PgColumn<{
7130
7770
  name: "id";
@@ -7165,7 +7805,7 @@ declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
7165
7805
  }>;
7166
7806
  declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
7167
7807
  name: EnumTableName.POSITIONS;
7168
- schema: "router_v1.11";
7808
+ schema: "router_v1.15";
7169
7809
  columns: {
7170
7810
  chainId: drizzle_orm_pg_core0.PgColumn<{
7171
7811
  name: "chain_id";
@@ -7316,7 +7956,7 @@ declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
7316
7956
  }>;
7317
7957
  declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
7318
7958
  name: EnumTableName.TRANSFERS;
7319
- schema: "router_v1.11";
7959
+ schema: "router_v1.15";
7320
7960
  columns: {
7321
7961
  eventId: drizzle_orm_pg_core0.PgColumn<{
7322
7962
  name: "event_id";
@@ -7447,16 +8087,438 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
7447
8087
  identity: undefined;
7448
8088
  generated: undefined;
7449
8089
  }, {}, {}>;
7450
- asset: drizzle_orm_pg_core0.PgColumn<{
7451
- name: "asset";
7452
- tableName: EnumTableName.TRANSFERS;
8090
+ asset: drizzle_orm_pg_core0.PgColumn<{
8091
+ name: "asset";
8092
+ tableName: EnumTableName.TRANSFERS;
8093
+ dataType: "string";
8094
+ columnType: "PgVarchar";
8095
+ data: string;
8096
+ driverParam: string;
8097
+ notNull: true;
8098
+ hasDefault: false;
8099
+ isPrimaryKey: false;
8100
+ isAutoincrement: false;
8101
+ hasRuntimeDefault: false;
8102
+ enumValues: [string, ...string[]];
8103
+ baseColumn: never;
8104
+ identity: undefined;
8105
+ generated: undefined;
8106
+ }, {}, {
8107
+ length: 42;
8108
+ }>;
8109
+ blockNumber: drizzle_orm_pg_core0.PgColumn<{
8110
+ name: "block_number";
8111
+ tableName: EnumTableName.TRANSFERS;
8112
+ dataType: "number";
8113
+ columnType: "PgBigInt53";
8114
+ data: number;
8115
+ driverParam: string | number;
8116
+ notNull: true;
8117
+ hasDefault: false;
8118
+ isPrimaryKey: false;
8119
+ isAutoincrement: false;
8120
+ hasRuntimeDefault: false;
8121
+ enumValues: undefined;
8122
+ baseColumn: never;
8123
+ identity: undefined;
8124
+ generated: undefined;
8125
+ }, {}, {}>;
8126
+ createdAt: drizzle_orm_pg_core0.PgColumn<{
8127
+ name: "created_at";
8128
+ tableName: EnumTableName.TRANSFERS;
8129
+ dataType: "date";
8130
+ columnType: "PgTimestamp";
8131
+ data: Date;
8132
+ driverParam: string;
8133
+ notNull: true;
8134
+ hasDefault: true;
8135
+ isPrimaryKey: false;
8136
+ isAutoincrement: false;
8137
+ hasRuntimeDefault: false;
8138
+ enumValues: undefined;
8139
+ baseColumn: never;
8140
+ identity: undefined;
8141
+ generated: undefined;
8142
+ }, {}, {}>;
8143
+ };
8144
+ dialect: "pg";
8145
+ }>;
8146
+ declare const StatusCode: drizzle_orm_pg_core0.PgEnum<[Status, ...Status[]]>;
8147
+ declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
8148
+ name: "status";
8149
+ schema: "router_v1.15";
8150
+ columns: {
8151
+ id: drizzle_orm_pg_core0.PgColumn<{
8152
+ name: "id";
8153
+ tableName: "status";
8154
+ dataType: "number";
8155
+ columnType: "PgSerial";
8156
+ data: number;
8157
+ driverParam: number;
8158
+ notNull: true;
8159
+ hasDefault: true;
8160
+ isPrimaryKey: true;
8161
+ isAutoincrement: false;
8162
+ hasRuntimeDefault: false;
8163
+ enumValues: undefined;
8164
+ baseColumn: never;
8165
+ identity: undefined;
8166
+ generated: undefined;
8167
+ }, {}, {}>;
8168
+ code: drizzle_orm_pg_core0.PgColumn<{
8169
+ name: "code";
8170
+ tableName: "status";
8171
+ dataType: "string";
8172
+ columnType: "PgEnumColumn";
8173
+ data: Status;
8174
+ driverParam: string;
8175
+ notNull: false;
8176
+ hasDefault: false;
8177
+ isPrimaryKey: false;
8178
+ isAutoincrement: false;
8179
+ hasRuntimeDefault: false;
8180
+ enumValues: [Status, ...Status[]];
8181
+ baseColumn: never;
8182
+ identity: undefined;
8183
+ generated: undefined;
8184
+ }, {}, {}>;
8185
+ };
8186
+ dialect: "pg";
8187
+ }>;
8188
+ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
8189
+ name: "validations";
8190
+ schema: "router_v1.15";
8191
+ columns: {
8192
+ offerHash: drizzle_orm_pg_core0.PgColumn<{
8193
+ name: "offer_hash";
8194
+ tableName: "validations";
8195
+ dataType: "string";
8196
+ columnType: "PgVarchar";
8197
+ data: string;
8198
+ driverParam: string;
8199
+ notNull: true;
8200
+ hasDefault: false;
8201
+ isPrimaryKey: false;
8202
+ isAutoincrement: false;
8203
+ hasRuntimeDefault: false;
8204
+ enumValues: [string, ...string[]];
8205
+ baseColumn: never;
8206
+ identity: undefined;
8207
+ generated: undefined;
8208
+ }, {}, {
8209
+ length: 66;
8210
+ }>;
8211
+ obligationId: drizzle_orm_pg_core0.PgColumn<{
8212
+ name: "obligation_id";
8213
+ tableName: "validations";
8214
+ dataType: "string";
8215
+ columnType: "PgVarchar";
8216
+ data: string;
8217
+ driverParam: string;
8218
+ notNull: true;
8219
+ hasDefault: false;
8220
+ isPrimaryKey: false;
8221
+ isAutoincrement: false;
8222
+ hasRuntimeDefault: false;
8223
+ enumValues: [string, ...string[]];
8224
+ baseColumn: never;
8225
+ identity: undefined;
8226
+ generated: undefined;
8227
+ }, {}, {
8228
+ length: 66;
8229
+ }>;
8230
+ statusId: drizzle_orm_pg_core0.PgColumn<{
8231
+ name: "status_id";
8232
+ tableName: "validations";
8233
+ dataType: "number";
8234
+ columnType: "PgInteger";
8235
+ data: number;
8236
+ driverParam: string | number;
8237
+ notNull: true;
8238
+ hasDefault: false;
8239
+ isPrimaryKey: false;
8240
+ isAutoincrement: false;
8241
+ hasRuntimeDefault: false;
8242
+ enumValues: undefined;
8243
+ baseColumn: never;
8244
+ identity: undefined;
8245
+ generated: undefined;
8246
+ }, {}, {}>;
8247
+ updatedAt: drizzle_orm_pg_core0.PgColumn<{
8248
+ name: "updated_at";
8249
+ tableName: "validations";
8250
+ dataType: "date";
8251
+ columnType: "PgTimestamp";
8252
+ data: Date;
8253
+ driverParam: string;
8254
+ notNull: true;
8255
+ hasDefault: true;
8256
+ isPrimaryKey: false;
8257
+ isAutoincrement: false;
8258
+ hasRuntimeDefault: false;
8259
+ enumValues: undefined;
8260
+ baseColumn: never;
8261
+ identity: undefined;
8262
+ generated: undefined;
8263
+ }, {}, {}>;
8264
+ };
8265
+ dialect: "pg";
8266
+ }>;
8267
+ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
8268
+ name: EnumTableName.COLLECTORS;
8269
+ schema: "router_v1.15";
8270
+ columns: {
8271
+ chainId: drizzle_orm_pg_core0.PgColumn<{
8272
+ name: "chain_id";
8273
+ tableName: EnumTableName.COLLECTORS;
8274
+ dataType: "number";
8275
+ columnType: "PgBigInt53";
8276
+ data: Id;
8277
+ driverParam: string | number;
8278
+ notNull: true;
8279
+ hasDefault: false;
8280
+ isPrimaryKey: false;
8281
+ isAutoincrement: false;
8282
+ hasRuntimeDefault: false;
8283
+ enumValues: undefined;
8284
+ baseColumn: never;
8285
+ identity: undefined;
8286
+ generated: undefined;
8287
+ }, {}, {
8288
+ $type: Id;
8289
+ }>;
8290
+ name: drizzle_orm_pg_core0.PgColumn<{
8291
+ name: "name";
8292
+ tableName: EnumTableName.COLLECTORS;
8293
+ dataType: "string";
8294
+ columnType: "PgText";
8295
+ data: "morpho_v2" | "offers" | "positions" | "prices";
8296
+ driverParam: string;
8297
+ notNull: true;
8298
+ hasDefault: false;
8299
+ isPrimaryKey: false;
8300
+ isAutoincrement: false;
8301
+ hasRuntimeDefault: false;
8302
+ enumValues: [string, ...string[]];
8303
+ baseColumn: never;
8304
+ identity: undefined;
8305
+ generated: undefined;
8306
+ }, {}, {
8307
+ $type: "morpho_v2" | "offers" | "positions" | "prices";
8308
+ }>;
8309
+ blockNumber: drizzle_orm_pg_core0.PgColumn<{
8310
+ name: "block_number";
8311
+ tableName: EnumTableName.COLLECTORS;
8312
+ dataType: "number";
8313
+ columnType: "PgBigInt53";
8314
+ data: number;
8315
+ driverParam: string | number;
8316
+ notNull: true;
8317
+ hasDefault: false;
8318
+ isPrimaryKey: false;
8319
+ isAutoincrement: false;
8320
+ hasRuntimeDefault: false;
8321
+ enumValues: undefined;
8322
+ baseColumn: never;
8323
+ identity: undefined;
8324
+ generated: undefined;
8325
+ }, {}, {}>;
8326
+ epoch: drizzle_orm_pg_core0.PgColumn<{
8327
+ name: "epoch";
8328
+ tableName: EnumTableName.COLLECTORS;
8329
+ dataType: "string";
8330
+ columnType: "PgNumeric";
8331
+ data: string;
8332
+ driverParam: string;
8333
+ notNull: true;
8334
+ hasDefault: true;
8335
+ isPrimaryKey: false;
8336
+ isAutoincrement: false;
8337
+ hasRuntimeDefault: false;
8338
+ enumValues: undefined;
8339
+ baseColumn: never;
8340
+ identity: undefined;
8341
+ generated: undefined;
8342
+ }, {}, {}>;
8343
+ updatedAt: drizzle_orm_pg_core0.PgColumn<{
8344
+ name: "updated_at";
8345
+ tableName: EnumTableName.COLLECTORS;
8346
+ dataType: "date";
8347
+ columnType: "PgTimestamp";
8348
+ data: Date;
8349
+ driverParam: string;
8350
+ notNull: true;
8351
+ hasDefault: true;
8352
+ isPrimaryKey: false;
8353
+ isAutoincrement: false;
8354
+ hasRuntimeDefault: false;
8355
+ enumValues: undefined;
8356
+ baseColumn: never;
8357
+ identity: undefined;
8358
+ generated: undefined;
8359
+ }, {}, {}>;
8360
+ };
8361
+ dialect: "pg";
8362
+ }>;
8363
+ declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
8364
+ name: EnumTableName.CHAINS;
8365
+ schema: "router_v1.15";
8366
+ columns: {
8367
+ chainId: drizzle_orm_pg_core0.PgColumn<{
8368
+ name: "chain_id";
8369
+ tableName: EnumTableName.CHAINS;
8370
+ dataType: "number";
8371
+ columnType: "PgBigInt53";
8372
+ data: Id;
8373
+ driverParam: string | number;
8374
+ notNull: true;
8375
+ hasDefault: false;
8376
+ isPrimaryKey: false;
8377
+ isAutoincrement: false;
8378
+ hasRuntimeDefault: false;
8379
+ enumValues: undefined;
8380
+ baseColumn: never;
8381
+ identity: undefined;
8382
+ generated: undefined;
8383
+ }, {}, {
8384
+ $type: Id;
8385
+ }>;
8386
+ blockNumber: drizzle_orm_pg_core0.PgColumn<{
8387
+ name: "block_number";
8388
+ tableName: EnumTableName.CHAINS;
8389
+ dataType: "number";
8390
+ columnType: "PgBigInt53";
8391
+ data: number;
8392
+ driverParam: string | number;
8393
+ notNull: true;
8394
+ hasDefault: false;
8395
+ isPrimaryKey: false;
8396
+ isAutoincrement: false;
8397
+ hasRuntimeDefault: false;
8398
+ enumValues: undefined;
8399
+ baseColumn: never;
8400
+ identity: undefined;
8401
+ generated: undefined;
8402
+ }, {}, {}>;
8403
+ epoch: drizzle_orm_pg_core0.PgColumn<{
8404
+ name: "epoch";
8405
+ tableName: EnumTableName.CHAINS;
8406
+ dataType: "string";
8407
+ columnType: "PgNumeric";
8408
+ data: string;
8409
+ driverParam: string;
8410
+ notNull: true;
8411
+ hasDefault: true;
8412
+ isPrimaryKey: false;
8413
+ isAutoincrement: false;
8414
+ hasRuntimeDefault: false;
8415
+ enumValues: undefined;
8416
+ baseColumn: never;
8417
+ identity: undefined;
8418
+ generated: undefined;
8419
+ }, {}, {}>;
8420
+ checkpoints: drizzle_orm_pg_core0.PgColumn<{
8421
+ name: "checkpoints";
8422
+ tableName: EnumTableName.CHAINS;
8423
+ dataType: "string";
8424
+ columnType: "PgText";
8425
+ data: string;
8426
+ driverParam: string;
8427
+ notNull: true;
8428
+ hasDefault: true;
8429
+ isPrimaryKey: false;
8430
+ isAutoincrement: false;
8431
+ hasRuntimeDefault: false;
8432
+ enumValues: [string, ...string[]];
8433
+ baseColumn: never;
8434
+ identity: undefined;
8435
+ generated: undefined;
8436
+ }, {}, {}>;
8437
+ tipHash: drizzle_orm_pg_core0.PgColumn<{
8438
+ name: "tip_hash";
8439
+ tableName: EnumTableName.CHAINS;
8440
+ dataType: "string";
8441
+ columnType: "PgText";
8442
+ data: string;
8443
+ driverParam: string;
8444
+ notNull: false;
8445
+ hasDefault: false;
8446
+ isPrimaryKey: false;
8447
+ isAutoincrement: false;
8448
+ hasRuntimeDefault: false;
8449
+ enumValues: [string, ...string[]];
8450
+ baseColumn: never;
8451
+ identity: undefined;
8452
+ generated: undefined;
8453
+ }, {}, {}>;
8454
+ finalizedBlockNumber: drizzle_orm_pg_core0.PgColumn<{
8455
+ name: "finalized_block_number";
8456
+ tableName: EnumTableName.CHAINS;
8457
+ dataType: "number";
8458
+ columnType: "PgBigInt53";
8459
+ data: number;
8460
+ driverParam: string | number;
8461
+ notNull: false;
8462
+ hasDefault: false;
8463
+ isPrimaryKey: false;
8464
+ isAutoincrement: false;
8465
+ hasRuntimeDefault: false;
8466
+ enumValues: undefined;
8467
+ baseColumn: never;
8468
+ identity: undefined;
8469
+ generated: undefined;
8470
+ }, {}, {}>;
8471
+ finalizedBlockHash: drizzle_orm_pg_core0.PgColumn<{
8472
+ name: "finalized_block_hash";
8473
+ tableName: EnumTableName.CHAINS;
8474
+ dataType: "string";
8475
+ columnType: "PgText";
8476
+ data: string;
8477
+ driverParam: string;
8478
+ notNull: false;
8479
+ hasDefault: false;
8480
+ isPrimaryKey: false;
8481
+ isAutoincrement: false;
8482
+ hasRuntimeDefault: false;
8483
+ enumValues: [string, ...string[]];
8484
+ baseColumn: never;
8485
+ identity: undefined;
8486
+ generated: undefined;
8487
+ }, {}, {}>;
8488
+ updatedAt: drizzle_orm_pg_core0.PgColumn<{
8489
+ name: "updated_at";
8490
+ tableName: EnumTableName.CHAINS;
8491
+ dataType: "date";
8492
+ columnType: "PgTimestamp";
8493
+ data: Date;
8494
+ driverParam: string;
8495
+ notNull: true;
8496
+ hasDefault: true;
8497
+ isPrimaryKey: false;
8498
+ isAutoincrement: false;
8499
+ hasRuntimeDefault: false;
8500
+ enumValues: undefined;
8501
+ baseColumn: never;
8502
+ identity: undefined;
8503
+ generated: undefined;
8504
+ }, {}, {}>;
8505
+ };
8506
+ dialect: "pg";
8507
+ }>;
8508
+ declare const pendingLinks: drizzle_orm_pg_core0.PgTableWithColumns<{
8509
+ name: EnumTableName.PENDING_LINKS;
8510
+ schema: "router_v1.15";
8511
+ columns: {
8512
+ key: drizzle_orm_pg_core0.PgColumn<{
8513
+ name: "key";
8514
+ tableName: EnumTableName.PENDING_LINKS;
7453
8515
  dataType: "string";
7454
8516
  columnType: "PgVarchar";
7455
8517
  data: string;
7456
8518
  driverParam: string;
7457
8519
  notNull: true;
7458
8520
  hasDefault: false;
7459
- isPrimaryKey: false;
8521
+ isPrimaryKey: true;
7460
8522
  isAutoincrement: false;
7461
8523
  hasRuntimeDefault: false;
7462
8524
  enumValues: [string, ...string[]];
@@ -7464,94 +8526,64 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
7464
8526
  identity: undefined;
7465
8527
  generated: undefined;
7466
8528
  }, {}, {
7467
- length: 42;
8529
+ length: 191;
7468
8530
  }>;
7469
- blockNumber: drizzle_orm_pg_core0.PgColumn<{
7470
- name: "block_number";
7471
- tableName: EnumTableName.TRANSFERS;
7472
- dataType: "number";
7473
- columnType: "PgBigInt53";
7474
- data: number;
7475
- driverParam: string | number;
8531
+ type: drizzle_orm_pg_core0.PgColumn<{
8532
+ name: "type";
8533
+ tableName: EnumTableName.PENDING_LINKS;
8534
+ dataType: "string";
8535
+ columnType: "PgText";
8536
+ data: string;
8537
+ driverParam: string;
7476
8538
  notNull: true;
7477
8539
  hasDefault: false;
7478
8540
  isPrimaryKey: false;
7479
8541
  isAutoincrement: false;
7480
8542
  hasRuntimeDefault: false;
7481
- enumValues: undefined;
8543
+ enumValues: [string, ...string[]];
7482
8544
  baseColumn: never;
7483
8545
  identity: undefined;
7484
8546
  generated: undefined;
7485
8547
  }, {}, {}>;
7486
- createdAt: drizzle_orm_pg_core0.PgColumn<{
7487
- name: "created_at";
7488
- tableName: EnumTableName.TRANSFERS;
7489
- dataType: "date";
7490
- columnType: "PgTimestamp";
7491
- data: Date;
8548
+ status: drizzle_orm_pg_core0.PgColumn<{
8549
+ name: "status";
8550
+ tableName: EnumTableName.PENDING_LINKS;
8551
+ dataType: "string";
8552
+ columnType: "PgText";
8553
+ data: string;
7492
8554
  driverParam: string;
7493
8555
  notNull: true;
7494
- hasDefault: true;
8556
+ hasDefault: false;
7495
8557
  isPrimaryKey: false;
7496
8558
  isAutoincrement: false;
7497
8559
  hasRuntimeDefault: false;
7498
- enumValues: undefined;
8560
+ enumValues: [string, ...string[]];
7499
8561
  baseColumn: never;
7500
8562
  identity: undefined;
7501
8563
  generated: undefined;
7502
8564
  }, {}, {}>;
7503
- };
7504
- dialect: "pg";
7505
- }>;
7506
- declare const StatusCode: drizzle_orm_pg_core0.PgEnum<[Status, ...Status[]]>;
7507
- declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
7508
- name: "status";
7509
- schema: "router_v1.11";
7510
- columns: {
7511
- id: drizzle_orm_pg_core0.PgColumn<{
7512
- name: "id";
7513
- tableName: "status";
8565
+ chainId: drizzle_orm_pg_core0.PgColumn<{
8566
+ name: "chain_id";
8567
+ tableName: EnumTableName.PENDING_LINKS;
7514
8568
  dataType: "number";
7515
- columnType: "PgSerial";
7516
- data: number;
7517
- driverParam: number;
8569
+ columnType: "PgBigInt53";
8570
+ data: Id;
8571
+ driverParam: string | number;
7518
8572
  notNull: true;
7519
- hasDefault: true;
7520
- isPrimaryKey: true;
7521
- isAutoincrement: false;
7522
- hasRuntimeDefault: false;
7523
- enumValues: undefined;
7524
- baseColumn: never;
7525
- identity: undefined;
7526
- generated: undefined;
7527
- }, {}, {}>;
7528
- code: drizzle_orm_pg_core0.PgColumn<{
7529
- name: "code";
7530
- tableName: "status";
7531
- dataType: "string";
7532
- columnType: "PgEnumColumn";
7533
- data: Status;
7534
- driverParam: string;
7535
- notNull: false;
7536
8573
  hasDefault: false;
7537
8574
  isPrimaryKey: false;
7538
8575
  isAutoincrement: false;
7539
8576
  hasRuntimeDefault: false;
7540
- enumValues: [Status, ...Status[]];
8577
+ enumValues: undefined;
7541
8578
  baseColumn: never;
7542
8579
  identity: undefined;
7543
8580
  generated: undefined;
7544
- }, {}, {}>;
7545
- };
7546
- dialect: "pg";
7547
- }>;
7548
- declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
7549
- name: "validations";
7550
- schema: "router_v1.11";
7551
- columns: {
7552
- offerHash: drizzle_orm_pg_core0.PgColumn<{
7553
- name: "offer_hash";
7554
- tableName: "validations";
8581
+ }, {}, {
8582
+ $type: Id;
8583
+ }>;
8584
+ eventId: drizzle_orm_pg_core0.PgColumn<{
8585
+ name: "event_id";
8586
+ tableName: EnumTableName.PENDING_LINKS;
7555
8587
  dataType: "string";
7556
8588
  columnType: "PgVarchar";
7557
8589
  data: string;
@@ -7566,11 +8598,11 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
7566
8598
  identity: undefined;
7567
8599
  generated: undefined;
7568
8600
  }, {}, {
7569
- length: 66;
8601
+ length: 128;
7570
8602
  }>;
7571
8603
  obligationId: drizzle_orm_pg_core0.PgColumn<{
7572
8604
  name: "obligation_id";
7573
- tableName: "validations";
8605
+ tableName: EnumTableName.PENDING_LINKS;
7574
8606
  dataType: "string";
7575
8607
  columnType: "PgVarchar";
7576
8608
  data: string;
@@ -7587,9 +8619,9 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
7587
8619
  }, {}, {
7588
8620
  length: 66;
7589
8621
  }>;
7590
- statusId: drizzle_orm_pg_core0.PgColumn<{
7591
- name: "status_id";
7592
- tableName: "validations";
8622
+ collateralIndex: drizzle_orm_pg_core0.PgColumn<{
8623
+ name: "collateral_index";
8624
+ tableName: EnumTableName.PENDING_LINKS;
7593
8625
  dataType: "number";
7594
8626
  columnType: "PgInteger";
7595
8627
  data: number;
@@ -7604,71 +8636,45 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
7604
8636
  identity: undefined;
7605
8637
  generated: undefined;
7606
8638
  }, {}, {}>;
7607
- updatedAt: drizzle_orm_pg_core0.PgColumn<{
7608
- name: "updated_at";
7609
- tableName: "validations";
7610
- dataType: "date";
7611
- columnType: "PgTimestamp";
7612
- data: Date;
8639
+ user: drizzle_orm_pg_core0.PgColumn<{
8640
+ name: "user";
8641
+ tableName: EnumTableName.PENDING_LINKS;
8642
+ dataType: "string";
8643
+ columnType: "PgVarchar";
8644
+ data: string;
7613
8645
  driverParam: string;
7614
8646
  notNull: true;
7615
- hasDefault: true;
7616
- isPrimaryKey: false;
7617
- isAutoincrement: false;
7618
- hasRuntimeDefault: false;
7619
- enumValues: undefined;
7620
- baseColumn: never;
7621
- identity: undefined;
7622
- generated: undefined;
7623
- }, {}, {}>;
7624
- };
7625
- dialect: "pg";
7626
- }>;
7627
- declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
7628
- name: EnumTableName.COLLECTORS;
7629
- schema: "router_v1.11";
7630
- columns: {
7631
- chainId: drizzle_orm_pg_core0.PgColumn<{
7632
- name: "chain_id";
7633
- tableName: EnumTableName.COLLECTORS;
7634
- dataType: "number";
7635
- columnType: "PgBigInt53";
7636
- data: Id;
7637
- driverParam: string | number;
7638
- notNull: true;
7639
8647
  hasDefault: false;
7640
8648
  isPrimaryKey: false;
7641
8649
  isAutoincrement: false;
7642
8650
  hasRuntimeDefault: false;
7643
- enumValues: undefined;
8651
+ enumValues: [string, ...string[]];
7644
8652
  baseColumn: never;
7645
8653
  identity: undefined;
7646
8654
  generated: undefined;
7647
8655
  }, {}, {
7648
- $type: Id;
8656
+ length: 42;
7649
8657
  }>;
7650
- name: drizzle_orm_pg_core0.PgColumn<{
7651
- name: "name";
7652
- tableName: EnumTableName.COLLECTORS;
8658
+ amount: drizzle_orm_pg_core0.PgColumn<{
8659
+ name: "amount";
8660
+ tableName: EnumTableName.PENDING_LINKS;
7653
8661
  dataType: "string";
7654
- columnType: "PgText";
7655
- data: "morpho_v2" | "offers" | "positions" | "prices";
8662
+ columnType: "PgNumeric";
8663
+ data: string;
7656
8664
  driverParam: string;
7657
8665
  notNull: true;
7658
8666
  hasDefault: false;
7659
8667
  isPrimaryKey: false;
7660
8668
  isAutoincrement: false;
7661
8669
  hasRuntimeDefault: false;
7662
- enumValues: [string, ...string[]];
8670
+ enumValues: undefined;
7663
8671
  baseColumn: never;
7664
8672
  identity: undefined;
7665
8673
  generated: undefined;
7666
- }, {}, {
7667
- $type: "morpho_v2" | "offers" | "positions" | "prices";
7668
- }>;
8674
+ }, {}, {}>;
7669
8675
  blockNumber: drizzle_orm_pg_core0.PgColumn<{
7670
8676
  name: "block_number";
7671
- tableName: EnumTableName.COLLECTORS;
8677
+ tableName: EnumTableName.PENDING_LINKS;
7672
8678
  dataType: "number";
7673
8679
  columnType: "PgBigInt53";
7674
8680
  data: number;
@@ -7683,15 +8689,15 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
7683
8689
  identity: undefined;
7684
8690
  generated: undefined;
7685
8691
  }, {}, {}>;
7686
- epoch: drizzle_orm_pg_core0.PgColumn<{
7687
- name: "epoch";
7688
- tableName: EnumTableName.COLLECTORS;
7689
- dataType: "string";
7690
- columnType: "PgNumeric";
7691
- data: string;
7692
- driverParam: string;
8692
+ firstSeenBlock: drizzle_orm_pg_core0.PgColumn<{
8693
+ name: "first_seen_block";
8694
+ tableName: EnumTableName.PENDING_LINKS;
8695
+ dataType: "number";
8696
+ columnType: "PgBigInt53";
8697
+ data: number;
8698
+ driverParam: string | number;
7693
8699
  notNull: true;
7694
- hasDefault: true;
8700
+ hasDefault: false;
7695
8701
  isPrimaryKey: false;
7696
8702
  isAutoincrement: false;
7697
8703
  hasRuntimeDefault: false;
@@ -7700,15 +8706,15 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
7700
8706
  identity: undefined;
7701
8707
  generated: undefined;
7702
8708
  }, {}, {}>;
7703
- updatedAt: drizzle_orm_pg_core0.PgColumn<{
7704
- name: "updated_at";
7705
- tableName: EnumTableName.COLLECTORS;
7706
- dataType: "date";
7707
- columnType: "PgTimestamp";
7708
- data: Date;
7709
- driverParam: string;
7710
- notNull: true;
7711
- hasDefault: true;
8709
+ lastTriedBlock: drizzle_orm_pg_core0.PgColumn<{
8710
+ name: "last_tried_block";
8711
+ tableName: EnumTableName.PENDING_LINKS;
8712
+ dataType: "number";
8713
+ columnType: "PgBigInt53";
8714
+ data: number;
8715
+ driverParam: string | number;
8716
+ notNull: false;
8717
+ hasDefault: false;
7712
8718
  isPrimaryKey: false;
7713
8719
  isAutoincrement: false;
7714
8720
  hasRuntimeDefault: false;
@@ -7717,22 +8723,15 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
7717
8723
  identity: undefined;
7718
8724
  generated: undefined;
7719
8725
  }, {}, {}>;
7720
- };
7721
- dialect: "pg";
7722
- }>;
7723
- declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
7724
- name: EnumTableName.CHAINS;
7725
- schema: "router_v1.11";
7726
- columns: {
7727
- chainId: drizzle_orm_pg_core0.PgColumn<{
7728
- name: "chain_id";
7729
- tableName: EnumTableName.CHAINS;
8726
+ attempts: drizzle_orm_pg_core0.PgColumn<{
8727
+ name: "attempts";
8728
+ tableName: EnumTableName.PENDING_LINKS;
7730
8729
  dataType: "number";
7731
- columnType: "PgBigInt53";
7732
- data: Id;
8730
+ columnType: "PgInteger";
8731
+ data: number;
7733
8732
  driverParam: string | number;
7734
8733
  notNull: true;
7735
- hasDefault: false;
8734
+ hasDefault: true;
7736
8735
  isPrimaryKey: false;
7737
8736
  isAutoincrement: false;
7738
8737
  hasRuntimeDefault: false;
@@ -7740,35 +8739,33 @@ declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
7740
8739
  baseColumn: never;
7741
8740
  identity: undefined;
7742
8741
  generated: undefined;
7743
- }, {}, {
7744
- $type: Id;
7745
- }>;
7746
- blockNumber: drizzle_orm_pg_core0.PgColumn<{
7747
- name: "block_number";
7748
- tableName: EnumTableName.CHAINS;
7749
- dataType: "number";
7750
- columnType: "PgBigInt53";
7751
- data: number;
7752
- driverParam: string | number;
7753
- notNull: true;
8742
+ }, {}, {}>;
8743
+ ignoredReason: drizzle_orm_pg_core0.PgColumn<{
8744
+ name: "ignored_reason";
8745
+ tableName: EnumTableName.PENDING_LINKS;
8746
+ dataType: "string";
8747
+ columnType: "PgText";
8748
+ data: string;
8749
+ driverParam: string;
8750
+ notNull: false;
7754
8751
  hasDefault: false;
7755
8752
  isPrimaryKey: false;
7756
8753
  isAutoincrement: false;
7757
8754
  hasRuntimeDefault: false;
7758
- enumValues: undefined;
8755
+ enumValues: [string, ...string[]];
7759
8756
  baseColumn: never;
7760
8757
  identity: undefined;
7761
8758
  generated: undefined;
7762
8759
  }, {}, {}>;
7763
- epoch: drizzle_orm_pg_core0.PgColumn<{
7764
- name: "epoch";
7765
- tableName: EnumTableName.CHAINS;
7766
- dataType: "string";
7767
- columnType: "PgNumeric";
7768
- data: string;
8760
+ resolvedAt: drizzle_orm_pg_core0.PgColumn<{
8761
+ name: "resolved_at";
8762
+ tableName: EnumTableName.PENDING_LINKS;
8763
+ dataType: "date";
8764
+ columnType: "PgTimestamp";
8765
+ data: Date;
7769
8766
  driverParam: string;
7770
- notNull: true;
7771
- hasDefault: true;
8767
+ notNull: false;
8768
+ hasDefault: false;
7772
8769
  isPrimaryKey: false;
7773
8770
  isAutoincrement: false;
7774
8771
  hasRuntimeDefault: false;
@@ -7779,7 +8776,7 @@ declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
7779
8776
  }, {}, {}>;
7780
8777
  updatedAt: drizzle_orm_pg_core0.PgColumn<{
7781
8778
  name: "updated_at";
7782
- tableName: EnumTableName.CHAINS;
8779
+ tableName: EnumTableName.PENDING_LINKS;
7783
8780
  dataType: "date";
7784
8781
  columnType: "PgTimestamp";
7785
8782
  data: Date;
@@ -7799,7 +8796,7 @@ declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
7799
8796
  }>;
7800
8797
  declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
7801
8798
  name: EnumTableName.TREES;
7802
- schema: "router_v1.11";
8799
+ schema: "router_v1.15";
7803
8800
  columns: {
7804
8801
  root: drizzle_orm_pg_core0.PgColumn<{
7805
8802
  name: "root";
@@ -7861,7 +8858,7 @@ declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
7861
8858
  }>;
7862
8859
  declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
7863
8860
  name: EnumTableName.MERKLE_PATHS;
7864
- schema: "router_v1.11";
8861
+ schema: "router_v1.15";
7865
8862
  columns: {
7866
8863
  offerHash: drizzle_orm_pg_core0.PgColumn<{
7867
8864
  name: "offer_hash";
@@ -7958,16 +8955,19 @@ declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
7958
8955
  dialect: "pg";
7959
8956
  }>;
7960
8957
  declare namespace index_d_exports$2 {
7961
- export { PositionTypes, StatusCode, TABLE_NAMES, TableName, VERSION, VERSIONED_TABLE_NAMES, VersionedTableName, callbacks$1 as callbacks, chains, collectors, consumedEvents, groups, lots, lotsPositions, merklePaths, obligationCollateralsV2, obligationIdKeys, obligations, offers, offersCallbacks, offsets, oracles, positionTypes, positions, status, transfers, trees, validations };
8958
+ export { CallbackTypes, PositionTypes, StatusCode, TABLE_NAMES, TableName, VERSION, VERSIONED_TABLE_NAMES, VersionedTableName, callbacks$1 as callbacks, chains, collectors, consumedEvents, groups, lots, lotsPositions, merklePaths, obligationCollateralsV2, obligationIdKeys, obligations, offers, offersCallbacks, offsets, oracles, pendingLinks, positionTypes, positions, status, transfers, trees, validations };
7962
8959
  }
7963
8960
  //#endregion
7964
8961
  //#region src/gatekeeper/morphoRules.d.ts
7965
8962
  declare const morphoRules: (parameters: {
7966
8963
  chains: Chain$1[];
7967
8964
  chainId: Id;
7968
- }) => (Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "loan_token"> | Rule<Offer, "collateral_token"> | Rule<Offer, "oracle">)[];
8965
+ db?: {
8966
+ groups: GroupsDomain;
8967
+ };
8968
+ }) => Rule<Offer, string>[];
7969
8969
  declare namespace Rules_d_exports {
7970
- export { amountMutualExclusivity, callback, collateralToken, loanToken, maturity, oracle, sameMaker };
8970
+ export { amountNonZero, callback, collateralToken, groupConsistency, groupImmutability, loanToken, maturity, maxCollaterals, minDuration, oracle, sameMaker };
7971
8971
  }
7972
8972
  declare const maturity: ({
7973
8973
  maturities
@@ -8023,11 +9023,51 @@ declare const oracle: ({
8023
9023
  */
8024
9024
  declare const sameMaker: () => Rule<Offer, "mixed_maker">;
8025
9025
  /**
8026
- * A validation rule that ensures mutual exclusivity of offer amount fields.
8027
- * At most one of (assets, obligationUnits, obligationShares) can be non-zero.
8028
- * Matches contract requirement: `atMostOneNonZero(offer.assets, offer.obligationUnits, offer.obligationShares)`.
9026
+ * A validation rule that checks if the offer duration (expiry - start) meets a minimum threshold.
9027
+ * @param minSeconds - Minimum required duration in seconds.
9028
+ * @returns The issue that was found. If the offer is valid, this will be undefined.
9029
+ */
9030
+ declare const minDuration: ({
9031
+ minSeconds
9032
+ }: {
9033
+ minSeconds: number;
9034
+ }) => Rule<Offer, "min_duration">;
9035
+ /**
9036
+ * A validation rule that checks if an offer exceeds the maximum number of collaterals.
9037
+ * The contract enforces this limit; this rule rejects early to avoid on-chain reverts.
9038
+ * @param max - Maximum allowed collaterals per offer.
9039
+ * @returns The issue that was found. If the offer is valid, this will be undefined.
9040
+ */
9041
+ declare const maxCollaterals: ({
9042
+ max
9043
+ }: {
9044
+ max: number;
9045
+ }) => Rule<Offer, "max_collaterals">;
9046
+ /**
9047
+ * A validation rule that checks if the offer's obligationUnits is non-zero.
9048
+ * The contract requires a positive amount; this rule rejects early.
9049
+ * @returns The issue that was found. If the offer is valid, this will be undefined.
9050
+ */
9051
+ declare const amountNonZero: () => Rule<Offer, "amount_non_zero">;
9052
+ /**
9053
+ * A batch validation rule that ensures all offers within the same group are consistent.
9054
+ * All offers sharing the same group must have the same loan token, obligationUnits,
9055
+ * and side (buy/sell). The contract tracks consumed per group and requires these to match.
8029
9056
  */
8030
- declare const amountMutualExclusivity: () => Rule<Offer, "amount_mutual_exclusivity">;
9057
+ declare const groupConsistency: () => Rule<Offer, "group_consistency">;
9058
+ /**
9059
+ * A batch validation rule that prevents adding offers to groups that already exist in the database.
9060
+ * Groups are immutable after creation — new offers cannot be added to an existing group.
9061
+ */
9062
+ declare const groupImmutability: ({
9063
+ db,
9064
+ chainId
9065
+ }: {
9066
+ db: {
9067
+ groups: GroupsDomain;
9068
+ };
9069
+ chainId: Id;
9070
+ }) => Rule<Offer, "group_immutability">;
8031
9071
  //#endregion
8032
9072
  //#region src/mempool/MempoolEVMClient.d.ts
8033
9073
  type MempoolEVMClientConfig = {
@@ -8127,7 +9167,7 @@ declare namespace index_d_exports$1 {
8127
9167
  }
8128
9168
  //#endregion
8129
9169
  //#region src/utils/BigMath.d.ts
8130
- declare function max$1(a: bigint, b: bigint): bigint;
9170
+ declare function max$2(a: bigint, b: bigint): bigint;
8131
9171
  declare function min(a: bigint, b: bigint): bigint;
8132
9172
  /**
8133
9173
  * Checks if at most one of the given values is non-zero.
@@ -8194,6 +9234,20 @@ declare function lazy<T>(pollFn: (emit: (value: T) => void, {
8194
9234
  stop: () => void;
8195
9235
  }) => () => boolean): () => AsyncGenerator<Awaited<NonNullable<T>>, void, unknown>;
8196
9236
  //#endregion
9237
+ //#region src/utils/mapWithConcurrency.d.ts
9238
+ /**
9239
+ * Map values with a bounded number of concurrent async workers.
9240
+ *
9241
+ * Result ordering always matches the input order.
9242
+ * @param parameters - Input values, concurrency limit, and async mapper.
9243
+ * @returns Mapped results in input order.
9244
+ */
9245
+ declare function mapWithConcurrency<value, result>(parameters: {
9246
+ values: value[];
9247
+ limit: number;
9248
+ run: (value: value, index: number) => Promise<result>;
9249
+ }): Promise<result[]>;
9250
+ //#endregion
8197
9251
  //#region src/utils/poll.d.ts
8198
9252
  /**
8199
9253
  * Polls a function at a specified interval.
@@ -8209,8 +9263,19 @@ declare function poll<data>(fn: ({
8209
9263
  interval: () => Promise<number>;
8210
9264
  }): () => boolean;
8211
9265
  declare namespace Random_d_exports {
8212
- export { address, bool, bytes, float, hex, int, seed, withSeed };
9266
+ export { SeededRng, address, bool, bytes, createRng, float, hex, int, seed, withSeed };
8213
9267
  }
9268
+ /** Isolated RNG instance with convenience methods. */
9269
+ interface SeededRng {
9270
+ float(): number;
9271
+ int(maxExclusive: number, min?: number): number;
9272
+ bool(probability?: number): boolean;
9273
+ }
9274
+ /**
9275
+ * Creates an isolated seeded RNG instance — safe for concurrent use.
9276
+ * @param seed - Seed string used to derive the initial RNG state.
9277
+ */
9278
+ declare function createRng(seed: string): SeededRng;
8214
9279
  /**
8215
9280
  * Runs a function with a deterministic RNG derived from the given seed.
8216
9281
  */
@@ -8247,15 +9312,24 @@ declare function address(): Address;
8247
9312
  //#region src/utils/retry.d.ts
8248
9313
  declare const retry: <T>(fn: () => Promise<T>, attempts?: number, delayMs?: number) => Promise<T>;
8249
9314
  declare namespace time_d_exports {
8250
- export { max, now };
9315
+ export { max$1 as max, now };
8251
9316
  }
8252
9317
  declare function now(): number;
8253
- declare function max(): number;
9318
+ declare function max$1(): number;
9319
+ //#endregion
9320
+ //#region src/utils/trim.d.ts
9321
+ /**
9322
+ * Keep the last `keep` entries from an array.
9323
+ * @param array - Source array.
9324
+ * @param keep - Number of entries to keep.
9325
+ * @returns Trimmed copy.
9326
+ */
9327
+ declare const trimTail: <entry>(array: readonly entry[], keep: number) => entry[];
8254
9328
  //#endregion
8255
9329
  //#region src/utils/wait.d.ts
8256
9330
  declare function wait(time: number): Promise<unknown>;
8257
9331
  declare namespace index_d_exports$3 {
8258
- 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$1 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, wait };
9332
+ 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 };
8259
9333
  }
8260
9334
  //#endregion
8261
9335
  export { index_d_exports as Abi, BookResponse_d_exports as BookResponse, BooksController, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainHealth, ChainRegistry_d_exports as ChainRegistry, ChainsHealthResponse, Collateral_d_exports as Collateral, CollectorHealth, CollectorsHealthResponse, Compute, ConfigContractsController, ConfigRule, ConfigRulesController, ConfigRulesPayload, Database_d_exports as Database, 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, Health_d_exports as Health, HealthController, Id_d_exports as Id, Indexer_d_exports as Indexer, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Logger_d_exports as Logger, Maturity_d_exports as Maturity, index_d_exports$1 as Mempool, Obligation_d_exports as Obligation, ObligationResponse_d_exports as ObligationResponse, ObligationsController, Offer_d_exports as Offer, OfferResponse_d_exports as OfferResponse, OffersController, index_d_exports$2 as OffersSchema, OpenApi, Oracle_d_exports as Oracle, Position_d_exports as Position, PositionResponse_d_exports as PositionResponse, Quote_d_exports as Quote, RouterApi_d_exports as RouterApi, Client_d_exports$1 as RouterClient, RouterStatusResponse, 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, UsersController, index_d_exports$3 as Utils, ValidateController, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules, parse, safeParse };