@morpho-dev/router 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +4698 -3654
- package/dist/drizzle/migrations/0031_sell-takeable-reindex.sql +254 -0
- package/dist/drizzle/migrations/0032_callback-type.sql +3 -0
- package/dist/drizzle/migrations/0033_obligation-id-bytes20.sql +255 -0
- package/dist/drizzle/migrations/meta/0031_snapshot.json +1652 -0
- package/dist/drizzle/migrations/meta/0033_snapshot.json +1658 -0
- package/dist/drizzle/migrations/meta/_journal.json +21 -0
- package/dist/evm/bytecode/morpho.txt +1 -1
- package/dist/index.browser.d.mts +315 -129
- package/dist/index.browser.d.mts.map +1 -1
- package/dist/index.browser.mjs +1005 -401
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +378 -175
- package/dist/index.node.d.mts.map +1 -1
- package/dist/index.node.mjs +2003 -969
- package/dist/index.node.mjs.map +1 -1
- package/dist/register-otel-hook.js +7 -0
- package/package.json +31 -27
- package/dist/index.browser.d.ts +0 -5007
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.browser.js +0 -5825
- package/dist/index.browser.js.map +0 -1
- package/dist/index.node.d.ts +0 -8263
- package/dist/index.node.d.ts.map +0 -1
- package/dist/index.node.js +0 -12566
- package/dist/index.node.js.map +0 -1
package/dist/index.node.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ import { Chain } from "viem/chains";
|
|
|
3
3
|
import * as z$1 from "zod";
|
|
4
4
|
import { StandardMerkleTree } 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";
|
|
@@ -160,17 +161,17 @@ declare const MorphoV2: readonly [{
|
|
|
160
161
|
readonly type: "function";
|
|
161
162
|
readonly stateMutability: "view";
|
|
162
163
|
readonly inputs: readonly [{
|
|
163
|
-
readonly type: "
|
|
164
|
+
readonly type: "bytes20";
|
|
164
165
|
readonly name: "id";
|
|
165
166
|
}, {
|
|
166
167
|
readonly type: "address";
|
|
167
168
|
readonly name: "user";
|
|
168
169
|
}, {
|
|
169
|
-
readonly type: "
|
|
170
|
-
readonly name: "
|
|
170
|
+
readonly type: "uint256";
|
|
171
|
+
readonly name: "collateralIndex";
|
|
171
172
|
}];
|
|
172
173
|
readonly outputs: readonly [{
|
|
173
|
-
readonly type: "
|
|
174
|
+
readonly type: "uint128";
|
|
174
175
|
}];
|
|
175
176
|
}, {
|
|
176
177
|
readonly name: "consume";
|
|
@@ -203,7 +204,7 @@ declare const MorphoV2: readonly [{
|
|
|
203
204
|
readonly type: "function";
|
|
204
205
|
readonly stateMutability: "view";
|
|
205
206
|
readonly inputs: readonly [{
|
|
206
|
-
readonly type: "
|
|
207
|
+
readonly type: "bytes20";
|
|
207
208
|
readonly name: "id";
|
|
208
209
|
}, {
|
|
209
210
|
readonly type: "address";
|
|
@@ -239,7 +240,7 @@ declare const MorphoV2: readonly [{
|
|
|
239
240
|
readonly type: "function";
|
|
240
241
|
readonly stateMutability: "view";
|
|
241
242
|
readonly inputs: readonly [{
|
|
242
|
-
readonly type: "
|
|
243
|
+
readonly type: "bytes20";
|
|
243
244
|
readonly name: "id";
|
|
244
245
|
}];
|
|
245
246
|
readonly outputs: readonly [{
|
|
@@ -288,10 +289,13 @@ declare const MorphoV2: readonly [{
|
|
|
288
289
|
}, {
|
|
289
290
|
readonly type: "uint256";
|
|
290
291
|
readonly name: "maturity";
|
|
292
|
+
}, {
|
|
293
|
+
readonly type: "uint256";
|
|
294
|
+
readonly name: "minCollatValue";
|
|
291
295
|
}];
|
|
292
296
|
readonly name: "obligation";
|
|
293
297
|
}, {
|
|
294
|
-
readonly type: "
|
|
298
|
+
readonly type: "bytes20";
|
|
295
299
|
readonly name: "id";
|
|
296
300
|
}, {
|
|
297
301
|
readonly type: "address";
|
|
@@ -325,21 +329,20 @@ declare const MorphoV2: readonly [{
|
|
|
325
329
|
}, {
|
|
326
330
|
readonly type: "uint256";
|
|
327
331
|
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
332
|
}, {
|
|
339
333
|
readonly type: "uint256";
|
|
340
|
-
readonly name: "
|
|
334
|
+
readonly name: "minCollatValue";
|
|
341
335
|
}];
|
|
342
|
-
readonly name: "
|
|
336
|
+
readonly name: "obligation";
|
|
337
|
+
}, {
|
|
338
|
+
readonly type: "uint256";
|
|
339
|
+
readonly name: "collateralIndex";
|
|
340
|
+
}, {
|
|
341
|
+
readonly type: "uint256";
|
|
342
|
+
readonly name: "seizedAssets";
|
|
343
|
+
}, {
|
|
344
|
+
readonly type: "uint256";
|
|
345
|
+
readonly name: "repaidUnits";
|
|
343
346
|
}, {
|
|
344
347
|
readonly type: "address";
|
|
345
348
|
readonly name: "borrower";
|
|
@@ -348,17 +351,9 @@ declare const MorphoV2: readonly [{
|
|
|
348
351
|
readonly name: "data";
|
|
349
352
|
}];
|
|
350
353
|
readonly outputs: readonly [{
|
|
351
|
-
readonly type: "
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
readonly name: "collateralIndex";
|
|
355
|
-
}, {
|
|
356
|
-
readonly type: "uint256";
|
|
357
|
-
readonly name: "repaid";
|
|
358
|
-
}, {
|
|
359
|
-
readonly type: "uint256";
|
|
360
|
-
readonly name: "seized";
|
|
361
|
-
}];
|
|
354
|
+
readonly type: "uint256";
|
|
355
|
+
}, {
|
|
356
|
+
readonly type: "uint256";
|
|
362
357
|
}];
|
|
363
358
|
}, {
|
|
364
359
|
readonly name: "multicall";
|
|
@@ -374,7 +369,7 @@ declare const MorphoV2: readonly [{
|
|
|
374
369
|
readonly type: "function";
|
|
375
370
|
readonly stateMutability: "view";
|
|
376
371
|
readonly inputs: readonly [{
|
|
377
|
-
readonly type: "
|
|
372
|
+
readonly type: "bytes20";
|
|
378
373
|
readonly name: "id";
|
|
379
374
|
}];
|
|
380
375
|
readonly outputs: readonly [{
|
|
@@ -385,7 +380,7 @@ declare const MorphoV2: readonly [{
|
|
|
385
380
|
readonly type: "function";
|
|
386
381
|
readonly stateMutability: "view";
|
|
387
382
|
readonly inputs: readonly [{
|
|
388
|
-
readonly type: "
|
|
383
|
+
readonly type: "bytes20";
|
|
389
384
|
readonly name: "id";
|
|
390
385
|
}];
|
|
391
386
|
readonly outputs: readonly [{
|
|
@@ -400,6 +395,9 @@ declare const MorphoV2: readonly [{
|
|
|
400
395
|
}, {
|
|
401
396
|
readonly type: "bool";
|
|
402
397
|
readonly name: "created";
|
|
398
|
+
}, {
|
|
399
|
+
readonly type: "uint16[6]";
|
|
400
|
+
readonly name: "fees";
|
|
403
401
|
}];
|
|
404
402
|
}, {
|
|
405
403
|
readonly name: "owner";
|
|
@@ -434,6 +432,9 @@ declare const MorphoV2: readonly [{
|
|
|
434
432
|
}, {
|
|
435
433
|
readonly type: "uint256";
|
|
436
434
|
readonly name: "maturity";
|
|
435
|
+
}, {
|
|
436
|
+
readonly type: "uint256";
|
|
437
|
+
readonly name: "minCollatValue";
|
|
437
438
|
}];
|
|
438
439
|
readonly name: "obligation";
|
|
439
440
|
}, {
|
|
@@ -484,7 +485,7 @@ declare const MorphoV2: readonly [{
|
|
|
484
485
|
readonly type: "function";
|
|
485
486
|
readonly stateMutability: "nonpayable";
|
|
486
487
|
readonly inputs: readonly [{
|
|
487
|
-
readonly type: "
|
|
488
|
+
readonly type: "bytes20";
|
|
488
489
|
readonly name: "id";
|
|
489
490
|
}, {
|
|
490
491
|
readonly type: "uint256";
|
|
@@ -517,7 +518,7 @@ declare const MorphoV2: readonly [{
|
|
|
517
518
|
readonly type: "function";
|
|
518
519
|
readonly stateMutability: "view";
|
|
519
520
|
readonly inputs: readonly [{
|
|
520
|
-
readonly type: "
|
|
521
|
+
readonly type: "bytes20";
|
|
521
522
|
readonly name: "id";
|
|
522
523
|
}, {
|
|
523
524
|
readonly type: "address";
|
|
@@ -557,11 +558,14 @@ declare const MorphoV2: readonly [{
|
|
|
557
558
|
}, {
|
|
558
559
|
readonly type: "uint256";
|
|
559
560
|
readonly name: "maturity";
|
|
561
|
+
}, {
|
|
562
|
+
readonly type: "uint256";
|
|
563
|
+
readonly name: "minCollatValue";
|
|
560
564
|
}];
|
|
561
565
|
readonly name: "obligation";
|
|
562
566
|
}, {
|
|
563
|
-
readonly type: "
|
|
564
|
-
readonly name: "
|
|
567
|
+
readonly type: "uint256";
|
|
568
|
+
readonly name: "collateralIndex";
|
|
565
569
|
}, {
|
|
566
570
|
readonly type: "uint256";
|
|
567
571
|
readonly name: "assets";
|
|
@@ -621,6 +625,9 @@ declare const MorphoV2: readonly [{
|
|
|
621
625
|
}, {
|
|
622
626
|
readonly type: "uint256";
|
|
623
627
|
readonly name: "maturity";
|
|
628
|
+
}, {
|
|
629
|
+
readonly type: "uint256";
|
|
630
|
+
readonly name: "minCollatValue";
|
|
624
631
|
}];
|
|
625
632
|
readonly name: "obligation";
|
|
626
633
|
}, {
|
|
@@ -693,12 +700,80 @@ declare const MorphoV2: readonly [{
|
|
|
693
700
|
}, {
|
|
694
701
|
readonly type: "uint256";
|
|
695
702
|
}];
|
|
703
|
+
}, {
|
|
704
|
+
readonly name: "toId";
|
|
705
|
+
readonly type: "function";
|
|
706
|
+
readonly stateMutability: "view";
|
|
707
|
+
readonly inputs: readonly [{
|
|
708
|
+
readonly type: "tuple";
|
|
709
|
+
readonly components: readonly [{
|
|
710
|
+
readonly type: "address";
|
|
711
|
+
readonly name: "loanToken";
|
|
712
|
+
}, {
|
|
713
|
+
readonly type: "tuple[]";
|
|
714
|
+
readonly components: readonly [{
|
|
715
|
+
readonly type: "address";
|
|
716
|
+
readonly name: "token";
|
|
717
|
+
}, {
|
|
718
|
+
readonly type: "uint256";
|
|
719
|
+
readonly name: "lltv";
|
|
720
|
+
}, {
|
|
721
|
+
readonly type: "address";
|
|
722
|
+
readonly name: "oracle";
|
|
723
|
+
}];
|
|
724
|
+
readonly name: "collaterals";
|
|
725
|
+
}, {
|
|
726
|
+
readonly type: "uint256";
|
|
727
|
+
readonly name: "maturity";
|
|
728
|
+
}, {
|
|
729
|
+
readonly type: "uint256";
|
|
730
|
+
readonly name: "minCollatValue";
|
|
731
|
+
}];
|
|
732
|
+
readonly name: "obligation";
|
|
733
|
+
}];
|
|
734
|
+
readonly outputs: readonly [{
|
|
735
|
+
readonly type: "bytes20";
|
|
736
|
+
}];
|
|
737
|
+
}, {
|
|
738
|
+
readonly name: "toObligation";
|
|
739
|
+
readonly type: "function";
|
|
740
|
+
readonly stateMutability: "view";
|
|
741
|
+
readonly inputs: readonly [{
|
|
742
|
+
readonly type: "bytes20";
|
|
743
|
+
readonly name: "id";
|
|
744
|
+
}];
|
|
745
|
+
readonly outputs: readonly [{
|
|
746
|
+
readonly type: "tuple";
|
|
747
|
+
readonly components: readonly [{
|
|
748
|
+
readonly type: "address";
|
|
749
|
+
readonly name: "loanToken";
|
|
750
|
+
}, {
|
|
751
|
+
readonly type: "tuple[]";
|
|
752
|
+
readonly components: readonly [{
|
|
753
|
+
readonly type: "address";
|
|
754
|
+
readonly name: "token";
|
|
755
|
+
}, {
|
|
756
|
+
readonly type: "uint256";
|
|
757
|
+
readonly name: "lltv";
|
|
758
|
+
}, {
|
|
759
|
+
readonly type: "address";
|
|
760
|
+
readonly name: "oracle";
|
|
761
|
+
}];
|
|
762
|
+
readonly name: "collaterals";
|
|
763
|
+
}, {
|
|
764
|
+
readonly type: "uint256";
|
|
765
|
+
readonly name: "maturity";
|
|
766
|
+
}, {
|
|
767
|
+
readonly type: "uint256";
|
|
768
|
+
readonly name: "minCollatValue";
|
|
769
|
+
}];
|
|
770
|
+
}];
|
|
696
771
|
}, {
|
|
697
772
|
readonly name: "totalShares";
|
|
698
773
|
readonly type: "function";
|
|
699
774
|
readonly stateMutability: "view";
|
|
700
775
|
readonly inputs: readonly [{
|
|
701
|
-
readonly type: "
|
|
776
|
+
readonly type: "bytes20";
|
|
702
777
|
readonly name: "id";
|
|
703
778
|
}];
|
|
704
779
|
readonly outputs: readonly [{
|
|
@@ -709,7 +784,7 @@ declare const MorphoV2: readonly [{
|
|
|
709
784
|
readonly type: "function";
|
|
710
785
|
readonly stateMutability: "view";
|
|
711
786
|
readonly inputs: readonly [{
|
|
712
|
-
readonly type: "
|
|
787
|
+
readonly type: "bytes20";
|
|
713
788
|
readonly name: "id";
|
|
714
789
|
}];
|
|
715
790
|
readonly outputs: readonly [{
|
|
@@ -740,18 +815,21 @@ declare const MorphoV2: readonly [{
|
|
|
740
815
|
}, {
|
|
741
816
|
readonly type: "uint256";
|
|
742
817
|
readonly name: "maturity";
|
|
818
|
+
}, {
|
|
819
|
+
readonly type: "uint256";
|
|
820
|
+
readonly name: "minCollatValue";
|
|
743
821
|
}];
|
|
744
822
|
readonly name: "obligation";
|
|
745
823
|
}];
|
|
746
824
|
readonly outputs: readonly [{
|
|
747
|
-
readonly type: "
|
|
825
|
+
readonly type: "bytes20";
|
|
748
826
|
}];
|
|
749
827
|
}, {
|
|
750
828
|
readonly name: "tradingFee";
|
|
751
829
|
readonly type: "function";
|
|
752
830
|
readonly stateMutability: "view";
|
|
753
831
|
readonly inputs: readonly [{
|
|
754
|
-
readonly type: "
|
|
832
|
+
readonly type: "bytes20";
|
|
755
833
|
readonly name: "id";
|
|
756
834
|
}, {
|
|
757
835
|
readonly type: "uint256";
|
|
@@ -793,6 +871,9 @@ declare const MorphoV2: readonly [{
|
|
|
793
871
|
}, {
|
|
794
872
|
readonly type: "uint256";
|
|
795
873
|
readonly name: "maturity";
|
|
874
|
+
}, {
|
|
875
|
+
readonly type: "uint256";
|
|
876
|
+
readonly name: "minCollatValue";
|
|
796
877
|
}];
|
|
797
878
|
readonly name: "obligation";
|
|
798
879
|
}, {
|
|
@@ -838,11 +919,14 @@ declare const MorphoV2: readonly [{
|
|
|
838
919
|
}, {
|
|
839
920
|
readonly type: "uint256";
|
|
840
921
|
readonly name: "maturity";
|
|
922
|
+
}, {
|
|
923
|
+
readonly type: "uint256";
|
|
924
|
+
readonly name: "minCollatValue";
|
|
841
925
|
}];
|
|
842
926
|
readonly name: "obligation";
|
|
843
927
|
}, {
|
|
844
|
-
readonly type: "
|
|
845
|
-
readonly name: "
|
|
928
|
+
readonly type: "uint256";
|
|
929
|
+
readonly name: "collateralIndex";
|
|
846
930
|
}, {
|
|
847
931
|
readonly type: "uint256";
|
|
848
932
|
readonly name: "assets";
|
|
@@ -859,7 +943,7 @@ declare const MorphoV2: readonly [{
|
|
|
859
943
|
readonly type: "function";
|
|
860
944
|
readonly stateMutability: "view";
|
|
861
945
|
readonly inputs: readonly [{
|
|
862
|
-
readonly type: "
|
|
946
|
+
readonly type: "bytes20";
|
|
863
947
|
readonly name: "id";
|
|
864
948
|
}];
|
|
865
949
|
readonly outputs: readonly [{
|
|
@@ -911,29 +995,22 @@ declare const MorphoV2: readonly [{
|
|
|
911
995
|
readonly name: "caller";
|
|
912
996
|
readonly indexed: true;
|
|
913
997
|
}, {
|
|
914
|
-
readonly type: "
|
|
915
|
-
readonly name: "
|
|
998
|
+
readonly type: "bytes20";
|
|
999
|
+
readonly name: "id_";
|
|
916
1000
|
readonly indexed: true;
|
|
917
1001
|
}, {
|
|
918
|
-
readonly type: "
|
|
919
|
-
readonly
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
readonly type: "uint256";
|
|
927
|
-
readonly name: "seized";
|
|
928
|
-
}];
|
|
929
|
-
readonly name: "seizures";
|
|
1002
|
+
readonly type: "uint256";
|
|
1003
|
+
readonly name: "collateralIndex";
|
|
1004
|
+
}, {
|
|
1005
|
+
readonly type: "uint256";
|
|
1006
|
+
readonly name: "seizedAssets";
|
|
1007
|
+
}, {
|
|
1008
|
+
readonly type: "uint256";
|
|
1009
|
+
readonly name: "repaidUnits";
|
|
930
1010
|
}, {
|
|
931
1011
|
readonly type: "address";
|
|
932
1012
|
readonly name: "borrower";
|
|
933
1013
|
readonly indexed: true;
|
|
934
|
-
}, {
|
|
935
|
-
readonly type: "uint256";
|
|
936
|
-
readonly name: "totalRepaid";
|
|
937
1014
|
}, {
|
|
938
1015
|
readonly type: "uint256";
|
|
939
1016
|
readonly name: "badDebt";
|
|
@@ -942,8 +1019,8 @@ declare const MorphoV2: readonly [{
|
|
|
942
1019
|
readonly name: "ObligationCreated";
|
|
943
1020
|
readonly type: "event";
|
|
944
1021
|
readonly inputs: readonly [{
|
|
945
|
-
readonly type: "
|
|
946
|
-
readonly name: "
|
|
1022
|
+
readonly type: "bytes20";
|
|
1023
|
+
readonly name: "id_";
|
|
947
1024
|
readonly indexed: true;
|
|
948
1025
|
}, {
|
|
949
1026
|
readonly type: "tuple";
|
|
@@ -966,6 +1043,9 @@ declare const MorphoV2: readonly [{
|
|
|
966
1043
|
}, {
|
|
967
1044
|
readonly type: "uint256";
|
|
968
1045
|
readonly name: "maturity";
|
|
1046
|
+
}, {
|
|
1047
|
+
readonly type: "uint256";
|
|
1048
|
+
readonly name: "minCollatValue";
|
|
969
1049
|
}];
|
|
970
1050
|
readonly name: "obligation";
|
|
971
1051
|
}];
|
|
@@ -977,8 +1057,8 @@ declare const MorphoV2: readonly [{
|
|
|
977
1057
|
readonly name: "caller";
|
|
978
1058
|
readonly indexed: true;
|
|
979
1059
|
}, {
|
|
980
|
-
readonly type: "
|
|
981
|
-
readonly name: "
|
|
1060
|
+
readonly type: "bytes20";
|
|
1061
|
+
readonly name: "id_";
|
|
982
1062
|
readonly indexed: true;
|
|
983
1063
|
}, {
|
|
984
1064
|
readonly type: "uint256";
|
|
@@ -1015,8 +1095,8 @@ declare const MorphoV2: readonly [{
|
|
|
1015
1095
|
readonly name: "SetObligationTradingFee";
|
|
1016
1096
|
readonly type: "event";
|
|
1017
1097
|
readonly inputs: readonly [{
|
|
1018
|
-
readonly type: "
|
|
1019
|
-
readonly name: "
|
|
1098
|
+
readonly type: "bytes20";
|
|
1099
|
+
readonly name: "id_";
|
|
1020
1100
|
readonly indexed: true;
|
|
1021
1101
|
}, {
|
|
1022
1102
|
readonly type: "uint256";
|
|
@@ -1060,8 +1140,8 @@ declare const MorphoV2: readonly [{
|
|
|
1060
1140
|
readonly type: "address";
|
|
1061
1141
|
readonly name: "caller";
|
|
1062
1142
|
}, {
|
|
1063
|
-
readonly type: "
|
|
1064
|
-
readonly name: "
|
|
1143
|
+
readonly type: "bytes20";
|
|
1144
|
+
readonly name: "id_";
|
|
1065
1145
|
readonly indexed: true;
|
|
1066
1146
|
}, {
|
|
1067
1147
|
readonly type: "address";
|
|
@@ -1082,8 +1162,8 @@ declare const MorphoV2: readonly [{
|
|
|
1082
1162
|
readonly type: "address";
|
|
1083
1163
|
readonly name: "caller";
|
|
1084
1164
|
}, {
|
|
1085
|
-
readonly type: "
|
|
1086
|
-
readonly name: "
|
|
1165
|
+
readonly type: "bytes20";
|
|
1166
|
+
readonly name: "id_";
|
|
1087
1167
|
readonly indexed: true;
|
|
1088
1168
|
}, {
|
|
1089
1169
|
readonly type: "address";
|
|
@@ -1131,8 +1211,8 @@ declare const MorphoV2: readonly [{
|
|
|
1131
1211
|
readonly type: "address";
|
|
1132
1212
|
readonly name: "caller";
|
|
1133
1213
|
}, {
|
|
1134
|
-
readonly type: "
|
|
1135
|
-
readonly name: "
|
|
1214
|
+
readonly type: "bytes20";
|
|
1215
|
+
readonly name: "id_";
|
|
1136
1216
|
readonly indexed: true;
|
|
1137
1217
|
}, {
|
|
1138
1218
|
readonly type: "uint256";
|
|
@@ -1156,8 +1236,8 @@ declare const MorphoV2: readonly [{
|
|
|
1156
1236
|
readonly type: "address";
|
|
1157
1237
|
readonly name: "caller";
|
|
1158
1238
|
}, {
|
|
1159
|
-
readonly type: "
|
|
1160
|
-
readonly name: "
|
|
1239
|
+
readonly type: "bytes20";
|
|
1240
|
+
readonly name: "id_";
|
|
1161
1241
|
readonly indexed: true;
|
|
1162
1242
|
}, {
|
|
1163
1243
|
readonly type: "address";
|
|
@@ -1301,7 +1381,7 @@ declare const Morpho: readonly [{
|
|
|
1301
1381
|
readonly stateMutability: "view";
|
|
1302
1382
|
}];
|
|
1303
1383
|
declare namespace Callback_d_exports {
|
|
1304
|
-
export { Callback, Type$1 as Type, isEmptyCallback };
|
|
1384
|
+
export { Callback, CallbackType, Type$1 as Type, isEmptyCallback };
|
|
1305
1385
|
}
|
|
1306
1386
|
type Callback = {
|
|
1307
1387
|
type: Type$1.BuyWithEmptyCallback;
|
|
@@ -1312,6 +1392,9 @@ declare enum Type$1 {
|
|
|
1312
1392
|
BuyWithEmptyCallback = "buy_with_empty_callback",
|
|
1313
1393
|
SellWithEmptyCallback = "sell_with_empty_callback"
|
|
1314
1394
|
}
|
|
1395
|
+
declare enum CallbackType {
|
|
1396
|
+
Empty = "empty"
|
|
1397
|
+
}
|
|
1315
1398
|
declare const isEmptyCallback: (offer: Offer) => boolean;
|
|
1316
1399
|
declare namespace Errors_d_exports {
|
|
1317
1400
|
export { BaseError, GlobalErrorType, ReorgError };
|
|
@@ -1346,7 +1429,7 @@ declare class ReorgError extends BaseError {
|
|
|
1346
1429
|
constructor(blockNumber: number);
|
|
1347
1430
|
}
|
|
1348
1431
|
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 };
|
|
1432
|
+
export { Chain$1 as Chain, ChainId, Id, InvalidBatchSizeError, InvalidBlockRangeError, InvalidBlockWindowError, MissingBlockNumberError, Name$1 as Name, UnrecoverableLogsResponseSizeError, chainIds, chainNames, chains$1 as chains, getChain, getWhitelistedChains, streamLogs };
|
|
1350
1433
|
}
|
|
1351
1434
|
type Chain$1 = Compute<Omit<Chain<ChainFormatters, {
|
|
1352
1435
|
morpho: ChainContract;
|
|
@@ -1405,6 +1488,8 @@ declare function streamLogs<abiEvent extends AbiEvent | undefined = undefined>(p
|
|
|
1405
1488
|
}, void, void>;
|
|
1406
1489
|
declare class InvalidBlockRangeError extends BaseError {
|
|
1407
1490
|
name: string;
|
|
1491
|
+
readonly fromBlock: bigint;
|
|
1492
|
+
readonly toBlock: bigint;
|
|
1408
1493
|
constructor(fromBlock: bigint, toBlock: bigint);
|
|
1409
1494
|
}
|
|
1410
1495
|
declare class InvalidBlockWindowError extends BaseError {
|
|
@@ -1419,6 +1504,10 @@ declare class MissingBlockNumberError extends BaseError {
|
|
|
1419
1504
|
name: string;
|
|
1420
1505
|
constructor();
|
|
1421
1506
|
}
|
|
1507
|
+
declare class UnrecoverableLogsResponseSizeError extends BaseError<Error> {
|
|
1508
|
+
name: string;
|
|
1509
|
+
constructor(blockNumber: bigint, cause?: unknown);
|
|
1510
|
+
}
|
|
1422
1511
|
declare namespace ChainRegistry_d_exports {
|
|
1423
1512
|
export { ChainRegistry, create$8 as create };
|
|
1424
1513
|
}
|
|
@@ -1676,7 +1765,8 @@ declare namespace Obligation_d_exports {
|
|
|
1676
1765
|
type Obligation$1 = {
|
|
1677
1766
|
/** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
|
|
1678
1767
|
collaterals: Collateral[]; /** The maturity of the obligation. */
|
|
1679
|
-
maturity: Maturity;
|
|
1768
|
+
maturity: Maturity; /** Minimum collateral value (quoted in loan token) to maintain on collateral updates. */
|
|
1769
|
+
minCollatValue: bigint;
|
|
1680
1770
|
};
|
|
1681
1771
|
declare const ObligationSchema: z$1.ZodObject<{
|
|
1682
1772
|
loanToken: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
@@ -1686,6 +1776,7 @@ declare const ObligationSchema: z$1.ZodObject<{
|
|
|
1686
1776
|
lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
1687
1777
|
}, z$1.core.$strip>>;
|
|
1688
1778
|
maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
|
|
1779
|
+
minCollatValue: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1689
1780
|
}, z$1.core.$strip>;
|
|
1690
1781
|
declare const abi: readonly [{
|
|
1691
1782
|
readonly type: "address";
|
|
@@ -1706,6 +1797,9 @@ declare const abi: readonly [{
|
|
|
1706
1797
|
}, {
|
|
1707
1798
|
readonly type: "uint256";
|
|
1708
1799
|
readonly name: "maturity";
|
|
1800
|
+
}, {
|
|
1801
|
+
readonly type: "uint256";
|
|
1802
|
+
readonly name: "minCollatValue";
|
|
1709
1803
|
}];
|
|
1710
1804
|
declare const tupleAbi: readonly [{
|
|
1711
1805
|
readonly type: "tuple";
|
|
@@ -1728,6 +1822,9 @@ declare const tupleAbi: readonly [{
|
|
|
1728
1822
|
}, {
|
|
1729
1823
|
readonly type: "uint256";
|
|
1730
1824
|
readonly name: "maturity";
|
|
1825
|
+
}, {
|
|
1826
|
+
readonly type: "uint256";
|
|
1827
|
+
readonly name: "minCollatValue";
|
|
1731
1828
|
}];
|
|
1732
1829
|
}];
|
|
1733
1830
|
/**
|
|
@@ -1757,7 +1854,8 @@ declare namespace from$14 {
|
|
|
1757
1854
|
type Parameters = {
|
|
1758
1855
|
/** 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
1856
|
collaterals: from$16.Parameters[] | readonly from$16.Parameters[]; /** The maturity of the obligation. */
|
|
1760
|
-
maturity: from$15.Parameters;
|
|
1857
|
+
maturity: from$15.Parameters; /** Minimum collateral value (quoted in loan token). @default 0 */
|
|
1858
|
+
minCollatValue?: bigint;
|
|
1761
1859
|
};
|
|
1762
1860
|
type ReturnType = Obligation$1;
|
|
1763
1861
|
type ErrorType = InvalidObligationError;
|
|
@@ -1770,13 +1868,17 @@ declare namespace from$14 {
|
|
|
1770
1868
|
*/
|
|
1771
1869
|
declare function fromSnakeCase$2(input: fromSnakeCase$2.Parameters): fromSnakeCase$2.ReturnType;
|
|
1772
1870
|
declare namespace fromSnakeCase$2 {
|
|
1773
|
-
type
|
|
1871
|
+
type SnakeCaseParameters = Omit<Obligation$1, "minCollatValue"> & {
|
|
1872
|
+
minCollatValue?: bigint;
|
|
1873
|
+
};
|
|
1874
|
+
type Parameters = Snake<SnakeCaseParameters>;
|
|
1774
1875
|
type ReturnType = Obligation$1;
|
|
1775
1876
|
type ErrorType = InvalidObligationError;
|
|
1776
1877
|
}
|
|
1777
1878
|
/**
|
|
1778
1879
|
* Calculates a canonical key for an obligation payload.
|
|
1779
|
-
* The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity)).
|
|
1880
|
+
* The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity, minCollatValue)).
|
|
1881
|
+
* If omitted, `minCollatValue` defaults to `0`.
|
|
1780
1882
|
* @throws If the collaterals are not sorted alphabetically by address. {@link CollateralsAreNotSortedError}
|
|
1781
1883
|
* @param parameters - {@link key.Parameters}
|
|
1782
1884
|
* @returns The obligation key as a 32-byte hex string. {@link key.ReturnType}
|
|
@@ -1798,6 +1900,7 @@ declare namespace key$1 {
|
|
|
1798
1900
|
oracle: Address;
|
|
1799
1901
|
}[];
|
|
1800
1902
|
maturity: number;
|
|
1903
|
+
minCollatValue?: bigint;
|
|
1801
1904
|
};
|
|
1802
1905
|
type ReturnType = Hex;
|
|
1803
1906
|
type ErrorType = CollateralsAreNotSortedError;
|
|
@@ -1842,7 +1945,7 @@ type Obligation = Obligation$1;
|
|
|
1842
1945
|
/**
|
|
1843
1946
|
* Builds the same creation code as `IdLib.creationCode` in Solidity.
|
|
1844
1947
|
*
|
|
1845
|
-
* Layout: `prefix (11 bytes) +
|
|
1948
|
+
* Layout: `prefix (11 bytes) + abi.encode(obligation)`.
|
|
1846
1949
|
*
|
|
1847
1950
|
* @param parameters - {@link creationCode.Parameters}
|
|
1848
1951
|
* @returns The CREATE2 init code bytes. {@link creationCode.ReturnType}
|
|
@@ -1857,7 +1960,10 @@ declare namespace creationCode {
|
|
|
1857
1960
|
type ReturnType = Hex;
|
|
1858
1961
|
}
|
|
1859
1962
|
/**
|
|
1860
|
-
* Computes the same id as `IdLib.toId` in Solidity
|
|
1963
|
+
* Computes the same id as `IdLib.toId` in Solidity using the CREATE2 preimage:
|
|
1964
|
+
* `keccak256(0xff ++ morphoV2 ++ chainId ++ keccak256(creationCode))`,
|
|
1965
|
+
* then truncates to the lower 20 bytes.
|
|
1966
|
+
*
|
|
1861
1967
|
* @param parameters - {@link toId.Parameters}
|
|
1862
1968
|
* @returns The obligation id. {@link toId.ReturnType}
|
|
1863
1969
|
*/
|
|
@@ -2136,7 +2242,7 @@ declare function hash(offer: Offer): Hex;
|
|
|
2136
2242
|
* The id is computed with {@link Id.toId}.
|
|
2137
2243
|
* @param offer - The offer to calculate the obligation id for.
|
|
2138
2244
|
* @param parameters - The chain context used by the onchain id function.
|
|
2139
|
-
* @returns The obligation id as a
|
|
2245
|
+
* @returns The obligation id as a 20-byte hex string.
|
|
2140
2246
|
*/
|
|
2141
2247
|
declare function obligationId(offer: Offer, parameters: obligationId.Parameters): obligationId.ReturnType;
|
|
2142
2248
|
declare namespace obligationId {
|
|
@@ -2168,10 +2274,10 @@ declare const takeEvent: {
|
|
|
2168
2274
|
readonly indexed: false;
|
|
2169
2275
|
readonly internalType: "address";
|
|
2170
2276
|
}, {
|
|
2171
|
-
readonly name: "
|
|
2172
|
-
readonly type: "
|
|
2277
|
+
readonly name: "id_";
|
|
2278
|
+
readonly type: "bytes20";
|
|
2173
2279
|
readonly indexed: true;
|
|
2174
|
-
readonly internalType: "
|
|
2280
|
+
readonly internalType: "bytes20";
|
|
2175
2281
|
}, {
|
|
2176
2282
|
readonly name: "maker";
|
|
2177
2283
|
readonly type: "address";
|
|
@@ -2271,10 +2377,10 @@ declare const repayEvent: {
|
|
|
2271
2377
|
readonly indexed: true;
|
|
2272
2378
|
readonly internalType: "address";
|
|
2273
2379
|
}, {
|
|
2274
|
-
readonly name: "
|
|
2275
|
-
readonly type: "
|
|
2380
|
+
readonly name: "id_";
|
|
2381
|
+
readonly type: "bytes20";
|
|
2276
2382
|
readonly indexed: true;
|
|
2277
|
-
readonly internalType: "
|
|
2383
|
+
readonly internalType: "bytes20";
|
|
2278
2384
|
}, {
|
|
2279
2385
|
readonly name: "obligationUnits";
|
|
2280
2386
|
readonly type: "uint256";
|
|
@@ -2300,38 +2406,30 @@ declare const liquidateEvent: {
|
|
|
2300
2406
|
readonly indexed: true;
|
|
2301
2407
|
readonly internalType: "address";
|
|
2302
2408
|
}, {
|
|
2303
|
-
readonly name: "
|
|
2304
|
-
readonly type: "
|
|
2409
|
+
readonly name: "id_";
|
|
2410
|
+
readonly type: "bytes20";
|
|
2305
2411
|
readonly indexed: true;
|
|
2306
|
-
readonly internalType: "
|
|
2412
|
+
readonly internalType: "bytes20";
|
|
2307
2413
|
}, {
|
|
2308
|
-
readonly name: "
|
|
2309
|
-
readonly type: "
|
|
2414
|
+
readonly name: "collateralIndex";
|
|
2415
|
+
readonly type: "uint256";
|
|
2310
2416
|
readonly indexed: false;
|
|
2311
|
-
readonly internalType: "
|
|
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
|
-
}];
|
|
2417
|
+
readonly internalType: "uint256";
|
|
2325
2418
|
}, {
|
|
2326
|
-
readonly name: "
|
|
2327
|
-
readonly type: "
|
|
2328
|
-
readonly indexed:
|
|
2329
|
-
readonly internalType: "
|
|
2419
|
+
readonly name: "seizedAssets";
|
|
2420
|
+
readonly type: "uint256";
|
|
2421
|
+
readonly indexed: false;
|
|
2422
|
+
readonly internalType: "uint256";
|
|
2330
2423
|
}, {
|
|
2331
|
-
readonly name: "
|
|
2424
|
+
readonly name: "repaidUnits";
|
|
2332
2425
|
readonly type: "uint256";
|
|
2333
2426
|
readonly indexed: false;
|
|
2334
2427
|
readonly internalType: "uint256";
|
|
2428
|
+
}, {
|
|
2429
|
+
readonly name: "borrower";
|
|
2430
|
+
readonly type: "address";
|
|
2431
|
+
readonly indexed: true;
|
|
2432
|
+
readonly internalType: "address";
|
|
2335
2433
|
}, {
|
|
2336
2434
|
readonly name: "badDebt";
|
|
2337
2435
|
readonly type: "uint256";
|
|
@@ -2352,10 +2450,10 @@ declare const supplyCollateralEvent: {
|
|
|
2352
2450
|
readonly indexed: false;
|
|
2353
2451
|
readonly internalType: "address";
|
|
2354
2452
|
}, {
|
|
2355
|
-
readonly name: "
|
|
2356
|
-
readonly type: "
|
|
2453
|
+
readonly name: "id_";
|
|
2454
|
+
readonly type: "bytes20";
|
|
2357
2455
|
readonly indexed: true;
|
|
2358
|
-
readonly internalType: "
|
|
2456
|
+
readonly internalType: "bytes20";
|
|
2359
2457
|
}, {
|
|
2360
2458
|
readonly name: "collateral";
|
|
2361
2459
|
readonly type: "address";
|
|
@@ -2386,10 +2484,10 @@ declare const withdrawCollateralEvent: {
|
|
|
2386
2484
|
readonly indexed: false;
|
|
2387
2485
|
readonly internalType: "address";
|
|
2388
2486
|
}, {
|
|
2389
|
-
readonly name: "
|
|
2390
|
-
readonly type: "
|
|
2487
|
+
readonly name: "id_";
|
|
2488
|
+
readonly type: "bytes20";
|
|
2391
2489
|
readonly indexed: true;
|
|
2392
|
-
readonly internalType: "
|
|
2490
|
+
readonly internalType: "bytes20";
|
|
2393
2491
|
}, {
|
|
2394
2492
|
readonly name: "collateral";
|
|
2395
2493
|
readonly type: "address";
|
|
@@ -3076,7 +3174,7 @@ type BlocksDomain = {
|
|
|
3076
3174
|
handleReorg: (parameters: HandleReorgParameters) => Promise<void>;
|
|
3077
3175
|
};
|
|
3078
3176
|
declare namespace Logger_d_exports {
|
|
3079
|
-
export { LogEntry, LogFn, LogLevel, LogLevelValues, Logger, defaultLogger, getLogger, runWithLogger, silentLogger };
|
|
3177
|
+
export { LogContext, LogEntry, LogFn, LogLevel, LogLevelValues, Logger, defaultLogger, getLogger, runWithLogContext, runWithLogger, silentLogger };
|
|
3080
3178
|
}
|
|
3081
3179
|
declare const LogLevelValues: readonly ["trace", "debug", "info", "warn", "error", "fatal", "silent"];
|
|
3082
3180
|
type LogLevel = (typeof LogLevelValues)[number];
|
|
@@ -3084,6 +3182,7 @@ type LogEntry = Compute<{
|
|
|
3084
3182
|
msg: string;
|
|
3085
3183
|
} & Record<string, unknown>>;
|
|
3086
3184
|
type LogFn = (entry: LogEntry) => void;
|
|
3185
|
+
type LogContext = Readonly<Record<string, unknown>>;
|
|
3087
3186
|
type Logger = {
|
|
3088
3187
|
trace: LogFn;
|
|
3089
3188
|
debug: LogFn;
|
|
@@ -3095,6 +3194,14 @@ type Logger = {
|
|
|
3095
3194
|
declare function defaultLogger(minLevel?: LogLevel, pretty?: boolean): Logger;
|
|
3096
3195
|
declare function silentLogger(): Logger;
|
|
3097
3196
|
declare function runWithLogger<T>(logger: Logger, fn: () => Promise<T>): Promise<T>;
|
|
3197
|
+
/**
|
|
3198
|
+
* Run a function with additional context fields attached to every log entry emitted via {@link getLogger}.
|
|
3199
|
+
* Nested calls merge context (inner keys override outer keys).
|
|
3200
|
+
* @param context - Static fields added to all log entries in this scope.
|
|
3201
|
+
* @param fn - Async function to run with the scoped logging context.
|
|
3202
|
+
* @returns The result of the function.
|
|
3203
|
+
*/
|
|
3204
|
+
declare function runWithLogContext<T>(context: LogContext, fn: () => Promise<T>): Promise<T>;
|
|
3098
3205
|
declare function getLogger(): Logger;
|
|
3099
3206
|
//#endregion
|
|
3100
3207
|
//#region src/database/domains/Offers.d.ts
|
|
@@ -3214,8 +3321,8 @@ type CallbackInput = {
|
|
|
3214
3321
|
chainId: Id;
|
|
3215
3322
|
contract: Address;
|
|
3216
3323
|
user: Address;
|
|
3217
|
-
amount: bigint;
|
|
3218
3324
|
positionTypeId: number;
|
|
3325
|
+
type: CallbackType;
|
|
3219
3326
|
};
|
|
3220
3327
|
type OfferCallbacks = {
|
|
3221
3328
|
offerHash: Hex;
|
|
@@ -3265,12 +3372,23 @@ type GroupInput = {
|
|
|
3265
3372
|
blockNumber: number;
|
|
3266
3373
|
consumed?: bigint;
|
|
3267
3374
|
};
|
|
3375
|
+
type GroupKey = {
|
|
3376
|
+
chainId: Id;
|
|
3377
|
+
maker: Address;
|
|
3378
|
+
group: Hex;
|
|
3379
|
+
};
|
|
3268
3380
|
type GroupsDomain = {
|
|
3269
3381
|
/**
|
|
3270
3382
|
* Insert groups (insert-only).
|
|
3271
3383
|
* @param groups - Groups to insert. {@link GroupInput}
|
|
3272
3384
|
*/
|
|
3273
3385
|
create: (groups: GroupInput[]) => Promise<void>;
|
|
3386
|
+
/**
|
|
3387
|
+
* Check which groups already exist in the database.
|
|
3388
|
+
* @param groups - Group keys to check. {@link GroupKey}
|
|
3389
|
+
* @returns The subset of input groups that exist in the database.
|
|
3390
|
+
*/
|
|
3391
|
+
exists: (groups: GroupKey[]) => Promise<GroupKey[]>;
|
|
3274
3392
|
};
|
|
3275
3393
|
//#endregion
|
|
3276
3394
|
//#region src/database/domains/Lots.d.ts
|
|
@@ -3754,6 +3872,22 @@ type ConfigRule = {
|
|
|
3754
3872
|
type: "oracle";
|
|
3755
3873
|
chain_id: Id;
|
|
3756
3874
|
address: Address;
|
|
3875
|
+
} | {
|
|
3876
|
+
type: "group_consistency";
|
|
3877
|
+
chain_id: Id;
|
|
3878
|
+
description: string;
|
|
3879
|
+
} | {
|
|
3880
|
+
type: "group_immutability";
|
|
3881
|
+
chain_id: Id;
|
|
3882
|
+
description: string;
|
|
3883
|
+
} | {
|
|
3884
|
+
type: "max_collaterals";
|
|
3885
|
+
chain_id: Id;
|
|
3886
|
+
max: number;
|
|
3887
|
+
} | {
|
|
3888
|
+
type: "min_duration";
|
|
3889
|
+
chain_id: Id;
|
|
3890
|
+
min_seconds: number;
|
|
3757
3891
|
};
|
|
3758
3892
|
type ValidationIssue = {
|
|
3759
3893
|
index: number;
|
|
@@ -3921,6 +4055,12 @@ type CreateParameters = {
|
|
|
3921
4055
|
chainRegistry: ChainRegistry;
|
|
3922
4056
|
};
|
|
3923
4057
|
declare function create$1(params: CreateParameters): RouterApi;
|
|
4058
|
+
/**
|
|
4059
|
+
* Create the router API Hono app with all routes and middleware configured.
|
|
4060
|
+
* @param parameters - API construction parameters.
|
|
4061
|
+
* @returns Configured Hono app instance.
|
|
4062
|
+
*/
|
|
4063
|
+
declare function createApp(parameters: CreateParameters): Hono;
|
|
3924
4064
|
declare namespace BookResponse_d_exports {
|
|
3925
4065
|
export { BookLevelResponse, from$4 as from };
|
|
3926
4066
|
}
|
|
@@ -4788,7 +4928,7 @@ interface components {
|
|
|
4788
4928
|
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4789
4929
|
* },
|
|
4790
4930
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
4791
|
-
* "obligation_id": "
|
|
4931
|
+
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf79",
|
|
4792
4932
|
* "chain_id": 1,
|
|
4793
4933
|
* "consumed": "0",
|
|
4794
4934
|
* "takeable": "369216000000000000000000",
|
|
@@ -4834,7 +4974,7 @@ interface components {
|
|
|
4834
4974
|
* }
|
|
4835
4975
|
*/
|
|
4836
4976
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
4837
|
-
offer_hash: string; /** @example
|
|
4977
|
+
offer_hash: string; /** @example 0x25690ae1aee324a005be565f3bcdd16dbf8daf79 */
|
|
4838
4978
|
obligation_id: string; /** @example 1 */
|
|
4839
4979
|
chain_id: number; /** @example 0 */
|
|
4840
4980
|
consumed: string; /** @example 369216000000000000000000 */
|
|
@@ -5032,7 +5172,7 @@ interface components {
|
|
|
5032
5172
|
* "chain_id": 1,
|
|
5033
5173
|
* "contract": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
|
|
5034
5174
|
* "user": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
5035
|
-
* "obligation_id": "
|
|
5175
|
+
* "obligation_id": "0x12590ae1aee324a005be565f3bcdd16dbf8daf79",
|
|
5036
5176
|
* "reserved": "200000000000000000000",
|
|
5037
5177
|
* "block_number": 21345678
|
|
5038
5178
|
* }
|
|
@@ -5046,7 +5186,7 @@ interface components {
|
|
|
5046
5186
|
user: string;
|
|
5047
5187
|
/**
|
|
5048
5188
|
* @description Obligation id this reserved amount belongs to, or null if no lots exist.
|
|
5049
|
-
* @example
|
|
5189
|
+
* @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf79
|
|
5050
5190
|
*/
|
|
5051
5191
|
obligation_id: string | null; /** @example 200000000000000000000 */
|
|
5052
5192
|
reserved: string; /** @example 21345678 */
|
|
@@ -5271,6 +5411,10 @@ declare const schemas: {
|
|
|
5271
5411
|
callback: "callback";
|
|
5272
5412
|
loan_token: "loan_token";
|
|
5273
5413
|
collateral_token: "collateral_token";
|
|
5414
|
+
min_duration: "min_duration";
|
|
5415
|
+
max_collaterals: "max_collaterals";
|
|
5416
|
+
group_consistency: "group_consistency";
|
|
5417
|
+
group_immutability: "group_immutability";
|
|
5274
5418
|
}>>>>;
|
|
5275
5419
|
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
5420
|
}, z$1.core.$strip>;
|
|
@@ -5416,6 +5560,15 @@ declare function getHealth(query: unknown, db: Database, chainRegistry?: ChainRe
|
|
|
5416
5560
|
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
5561
|
declare function getHealthCollectors(query: unknown, db: Database, chainRegistry?: ChainRegistry): Promise<Payload<paths["/v1/health/collectors"]["get"]["responses"]["200"]["content"]["application/json"]["data"]>>;
|
|
5418
5562
|
//#endregion
|
|
5563
|
+
//#region src/api/Controllers/getMetrics.d.ts
|
|
5564
|
+
/**
|
|
5565
|
+
* Get router synchronization metrics in Prometheus exposition format.
|
|
5566
|
+
* @param db - Database instance. {@link Database.Database}
|
|
5567
|
+
* @param chainRegistry - Optional chain registry used to scope expected chains.
|
|
5568
|
+
* @returns Prometheus exposition payload.
|
|
5569
|
+
*/
|
|
5570
|
+
declare function getMetrics(db: Database, chainRegistry?: ChainRegistry): Promise<string>;
|
|
5571
|
+
//#endregion
|
|
5419
5572
|
//#region src/api/Controllers/getObligation.d.ts
|
|
5420
5573
|
declare function getObligation(params: object, db: Database): Promise<Payload<ObligationResponse>>;
|
|
5421
5574
|
//#endregion
|
|
@@ -5433,12 +5586,19 @@ type OffersRowsResult = {
|
|
|
5433
5586
|
nextCursor: string | null;
|
|
5434
5587
|
};
|
|
5435
5588
|
/**
|
|
5436
|
-
* Query offers with computed consumed/available/takeable values.
|
|
5589
|
+
* Query offers for a maker with computed consumed/available/takeable values.
|
|
5590
|
+
* Uses the same CTE-based computation as Book.ts via shared OfferFormulas builders.
|
|
5437
5591
|
* @param db - The database client. {@link Database.Core}
|
|
5438
5592
|
* @param parameters - {@link GetOffersQueryParams}
|
|
5439
5593
|
* @returns The offers with pagination cursor.
|
|
5440
5594
|
*/
|
|
5441
5595
|
declare function getOffersQuery(db: Core, parameters?: GetOffersQueryParams): Promise<OffersRowsResult>;
|
|
5596
|
+
/**
|
|
5597
|
+
* Get offers with optional maker or obligation+side filter.
|
|
5598
|
+
* @param queryParameters - Raw query parameters from the API request.
|
|
5599
|
+
* @param db - The database client. {@link Database.Database}
|
|
5600
|
+
* @returns The offers response payload.
|
|
5601
|
+
*/
|
|
5442
5602
|
declare function getOffers$1(queryParameters: object, db: Database): Promise<Payload<OfferResponse[]>>;
|
|
5443
5603
|
//#endregion
|
|
5444
5604
|
//#region src/api/Controllers/getUserPositions.d.ts
|
|
@@ -5486,10 +5646,10 @@ type ValidateOffersIssuesPayload = SuccessPayload$1<{
|
|
|
5486
5646
|
type ValidateOffersResponse = ValidateOffersSuccessPayload | ValidateOffersIssuesPayload;
|
|
5487
5647
|
declare function validateOffers(body: object, gatekeeper: Gatekeeper): Promise<ValidateOffersResponse | ErrorPayload$1>;
|
|
5488
5648
|
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 };
|
|
5649
|
+
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
5650
|
}
|
|
5491
5651
|
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 };
|
|
5652
|
+
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, createApp, from$5 as from, parse, safeParse };
|
|
5493
5653
|
}
|
|
5494
5654
|
declare namespace Client_d_exports$1 {
|
|
5495
5655
|
export { Client$3 as Client, ConnectOptions, HttpForbiddenError, HttpGetApiFailedError, HttpRateLimitError, HttpUnauthorizedError, InvalidUrlError, connect$1 as connect, getObligations, getOffers };
|
|
@@ -5625,7 +5785,7 @@ declare class HttpGetApiFailedError extends BaseError {
|
|
|
5625
5785
|
}
|
|
5626
5786
|
//#endregion
|
|
5627
5787
|
//#region src/database/drizzle/VERSION.d.ts
|
|
5628
|
-
declare const VERSION: "router_v1.
|
|
5788
|
+
declare const VERSION: "router_v1.13";
|
|
5629
5789
|
//#endregion
|
|
5630
5790
|
//#region src/database/drizzle/schema.d.ts
|
|
5631
5791
|
declare enum EnumTableName {
|
|
@@ -5650,12 +5810,12 @@ declare enum EnumTableName {
|
|
|
5650
5810
|
MERKLE_PATHS = "merkle_paths"
|
|
5651
5811
|
}
|
|
5652
5812
|
declare const TABLE_NAMES: readonly EnumTableName[];
|
|
5653
|
-
declare const VERSIONED_TABLE_NAMES: ("\"router_v1.
|
|
5813
|
+
declare const VERSIONED_TABLE_NAMES: ("\"router_v1.13\".\"obligations\"" | "\"router_v1.13\".\"obligation_id_keys\"" | "\"router_v1.13\".\"groups\"" | "\"router_v1.13\".\"consumed_events\"" | "\"router_v1.13\".\"obligation_collaterals_v2\"" | "\"router_v1.13\".\"oracles\"" | "\"router_v1.13\".\"offers\"" | "\"router_v1.13\".\"offers_callbacks\"" | "\"router_v1.13\".\"callbacks\"" | "\"router_v1.13\".\"positions\"" | "\"router_v1.13\".\"transfers\"" | "\"router_v1.13\".\"validations\"" | "\"router_v1.13\".\"collectors\"" | "\"router_v1.13\".\"chains\"" | "\"router_v1.13\".\"lots\"" | "\"router_v1.13\".\"lots_positions\"" | "\"router_v1.13\".\"offsets\"" | "\"router_v1.13\".\"trees\"" | "\"router_v1.13\".\"merkle_paths\"")[];
|
|
5654
5814
|
type TableName = (typeof TABLE_NAMES)[number];
|
|
5655
5815
|
type VersionedTableName = `"${typeof VERSION}"."${TableName}"`;
|
|
5656
5816
|
declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5657
5817
|
name: EnumTableName.OBLIGATIONS;
|
|
5658
|
-
schema: "router_v1.
|
|
5818
|
+
schema: "router_v1.13";
|
|
5659
5819
|
columns: {
|
|
5660
5820
|
obligationKey: drizzle_orm_pg_core0.PgColumn<{
|
|
5661
5821
|
name: "obligation_key";
|
|
@@ -5717,7 +5877,7 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5717
5877
|
}>;
|
|
5718
5878
|
declare const obligationIdKeys: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5719
5879
|
name: EnumTableName.OBLIGATION_ID_KEYS;
|
|
5720
|
-
schema: "router_v1.
|
|
5880
|
+
schema: "router_v1.13";
|
|
5721
5881
|
columns: {
|
|
5722
5882
|
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
5723
5883
|
name: "obligation_id";
|
|
@@ -5736,7 +5896,7 @@ declare const obligationIdKeys: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5736
5896
|
identity: undefined;
|
|
5737
5897
|
generated: undefined;
|
|
5738
5898
|
}, {}, {
|
|
5739
|
-
length:
|
|
5899
|
+
length: 42;
|
|
5740
5900
|
}>;
|
|
5741
5901
|
obligationKey: drizzle_orm_pg_core0.PgColumn<{
|
|
5742
5902
|
name: "obligation_key";
|
|
@@ -5800,7 +5960,7 @@ declare const obligationIdKeys: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5800
5960
|
}>;
|
|
5801
5961
|
declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5802
5962
|
name: EnumTableName.GROUPS;
|
|
5803
|
-
schema: "router_v1.
|
|
5963
|
+
schema: "router_v1.13";
|
|
5804
5964
|
columns: {
|
|
5805
5965
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
5806
5966
|
name: "chain_id";
|
|
@@ -5915,7 +6075,7 @@ declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5915
6075
|
}>;
|
|
5916
6076
|
declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5917
6077
|
name: EnumTableName.CONSUMED_EVENTS;
|
|
5918
|
-
schema: "router_v1.
|
|
6078
|
+
schema: "router_v1.13";
|
|
5919
6079
|
columns: {
|
|
5920
6080
|
eventId: drizzle_orm_pg_core0.PgColumn<{
|
|
5921
6081
|
name: "event_id";
|
|
@@ -6049,7 +6209,7 @@ declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6049
6209
|
}>;
|
|
6050
6210
|
declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6051
6211
|
name: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
6052
|
-
schema: "router_v1.
|
|
6212
|
+
schema: "router_v1.13";
|
|
6053
6213
|
columns: {
|
|
6054
6214
|
obligationKey: drizzle_orm_pg_core0.PgColumn<{
|
|
6055
6215
|
name: "obligation_key";
|
|
@@ -6164,7 +6324,7 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6164
6324
|
}>;
|
|
6165
6325
|
declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6166
6326
|
name: EnumTableName.ORACLES;
|
|
6167
|
-
schema: "router_v1.
|
|
6327
|
+
schema: "router_v1.13";
|
|
6168
6328
|
columns: {
|
|
6169
6329
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6170
6330
|
name: "chain_id";
|
|
@@ -6260,7 +6420,7 @@ declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6260
6420
|
}>;
|
|
6261
6421
|
declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6262
6422
|
name: EnumTableName.OFFERS;
|
|
6263
|
-
schema: "router_v1.
|
|
6423
|
+
schema: "router_v1.13";
|
|
6264
6424
|
columns: {
|
|
6265
6425
|
hash: drizzle_orm_pg_core0.PgColumn<{
|
|
6266
6426
|
name: "hash";
|
|
@@ -6298,7 +6458,7 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6298
6458
|
identity: undefined;
|
|
6299
6459
|
generated: undefined;
|
|
6300
6460
|
}, {}, {
|
|
6301
|
-
length:
|
|
6461
|
+
length: 42;
|
|
6302
6462
|
}>;
|
|
6303
6463
|
assets: drizzle_orm_pg_core0.PgColumn<{
|
|
6304
6464
|
name: "assets";
|
|
@@ -6606,7 +6766,7 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6606
6766
|
}>;
|
|
6607
6767
|
declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6608
6768
|
name: EnumTableName.OFFERS_CALLBACKS;
|
|
6609
|
-
schema: "router_v1.
|
|
6769
|
+
schema: "router_v1.13";
|
|
6610
6770
|
columns: {
|
|
6611
6771
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
6612
6772
|
name: "offer_hash";
|
|
@@ -6644,7 +6804,7 @@ declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6644
6804
|
identity: undefined;
|
|
6645
6805
|
generated: undefined;
|
|
6646
6806
|
}, {}, {
|
|
6647
|
-
length:
|
|
6807
|
+
length: 42;
|
|
6648
6808
|
}>;
|
|
6649
6809
|
callbackId: drizzle_orm_pg_core0.PgColumn<{
|
|
6650
6810
|
name: "callback_id";
|
|
@@ -6668,9 +6828,10 @@ declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6668
6828
|
};
|
|
6669
6829
|
dialect: "pg";
|
|
6670
6830
|
}>;
|
|
6831
|
+
declare const CallbackTypes: drizzle_orm_pg_core0.PgEnum<[CallbackType, ...CallbackType[]]>;
|
|
6671
6832
|
declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6672
6833
|
name: EnumTableName.CALLBACKS;
|
|
6673
|
-
schema: "router_v1.
|
|
6834
|
+
schema: "router_v1.13";
|
|
6674
6835
|
columns: {
|
|
6675
6836
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
6676
6837
|
name: "id";
|
|
@@ -6727,7 +6888,7 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6727
6888
|
identity: undefined;
|
|
6728
6889
|
generated: undefined;
|
|
6729
6890
|
}, {}, {
|
|
6730
|
-
length:
|
|
6891
|
+
length: 66;
|
|
6731
6892
|
}>;
|
|
6732
6893
|
positionUser: drizzle_orm_pg_core0.PgColumn<{
|
|
6733
6894
|
name: "position_user";
|
|
@@ -6765,19 +6926,19 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6765
6926
|
identity: undefined;
|
|
6766
6927
|
generated: undefined;
|
|
6767
6928
|
}, {}, {}>;
|
|
6768
|
-
|
|
6769
|
-
name: "
|
|
6929
|
+
type: drizzle_orm_pg_core0.PgColumn<{
|
|
6930
|
+
name: "type";
|
|
6770
6931
|
tableName: EnumTableName.CALLBACKS;
|
|
6771
6932
|
dataType: "string";
|
|
6772
|
-
columnType: "
|
|
6773
|
-
data:
|
|
6933
|
+
columnType: "PgEnumColumn";
|
|
6934
|
+
data: CallbackType;
|
|
6774
6935
|
driverParam: string;
|
|
6775
|
-
notNull:
|
|
6936
|
+
notNull: true;
|
|
6776
6937
|
hasDefault: false;
|
|
6777
6938
|
isPrimaryKey: false;
|
|
6778
6939
|
isAutoincrement: false;
|
|
6779
6940
|
hasRuntimeDefault: false;
|
|
6780
|
-
enumValues:
|
|
6941
|
+
enumValues: [CallbackType, ...CallbackType[]];
|
|
6781
6942
|
baseColumn: never;
|
|
6782
6943
|
identity: undefined;
|
|
6783
6944
|
generated: undefined;
|
|
@@ -6787,7 +6948,7 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6787
6948
|
}>;
|
|
6788
6949
|
declare const lotsPositions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6789
6950
|
name: EnumTableName.LOTS_POSITIONS;
|
|
6790
|
-
schema: "router_v1.
|
|
6951
|
+
schema: "router_v1.13";
|
|
6791
6952
|
columns: {
|
|
6792
6953
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6793
6954
|
name: "chain_id";
|
|
@@ -6825,7 +6986,7 @@ declare const lotsPositions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6825
6986
|
identity: undefined;
|
|
6826
6987
|
generated: undefined;
|
|
6827
6988
|
}, {}, {
|
|
6828
|
-
length:
|
|
6989
|
+
length: 66;
|
|
6829
6990
|
}>;
|
|
6830
6991
|
user: drizzle_orm_pg_core0.PgColumn<{
|
|
6831
6992
|
name: "user";
|
|
@@ -6868,7 +7029,7 @@ declare const lotsPositions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6868
7029
|
}>;
|
|
6869
7030
|
declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6870
7031
|
name: EnumTableName.LOTS;
|
|
6871
|
-
schema: "router_v1.
|
|
7032
|
+
schema: "router_v1.13";
|
|
6872
7033
|
columns: {
|
|
6873
7034
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6874
7035
|
name: "chain_id";
|
|
@@ -6925,7 +7086,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6925
7086
|
identity: undefined;
|
|
6926
7087
|
generated: undefined;
|
|
6927
7088
|
}, {}, {
|
|
6928
|
-
length:
|
|
7089
|
+
length: 66;
|
|
6929
7090
|
}>;
|
|
6930
7091
|
group: drizzle_orm_pg_core0.PgColumn<{
|
|
6931
7092
|
name: "group";
|
|
@@ -6963,7 +7124,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6963
7124
|
identity: undefined;
|
|
6964
7125
|
generated: undefined;
|
|
6965
7126
|
}, {}, {
|
|
6966
|
-
length:
|
|
7127
|
+
length: 42;
|
|
6967
7128
|
}>;
|
|
6968
7129
|
lower: drizzle_orm_pg_core0.PgColumn<{
|
|
6969
7130
|
name: "lower";
|
|
@@ -7004,7 +7165,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7004
7165
|
}>;
|
|
7005
7166
|
declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7006
7167
|
name: EnumTableName.OFFSETS;
|
|
7007
|
-
schema: "router_v1.
|
|
7168
|
+
schema: "router_v1.13";
|
|
7008
7169
|
columns: {
|
|
7009
7170
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
7010
7171
|
name: "chain_id";
|
|
@@ -7061,7 +7222,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7061
7222
|
identity: undefined;
|
|
7062
7223
|
generated: undefined;
|
|
7063
7224
|
}, {}, {
|
|
7064
|
-
length:
|
|
7225
|
+
length: 66;
|
|
7065
7226
|
}>;
|
|
7066
7227
|
group: drizzle_orm_pg_core0.PgColumn<{
|
|
7067
7228
|
name: "group";
|
|
@@ -7099,7 +7260,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7099
7260
|
identity: undefined;
|
|
7100
7261
|
generated: undefined;
|
|
7101
7262
|
}, {}, {
|
|
7102
|
-
length:
|
|
7263
|
+
length: 42;
|
|
7103
7264
|
}>;
|
|
7104
7265
|
value: drizzle_orm_pg_core0.PgColumn<{
|
|
7105
7266
|
name: "value";
|
|
@@ -7124,7 +7285,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7124
7285
|
declare const PositionTypes: drizzle_orm_pg_core0.PgEnum<[Type, ...Type[]]>;
|
|
7125
7286
|
declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7126
7287
|
name: "position_types";
|
|
7127
|
-
schema: "router_v1.
|
|
7288
|
+
schema: "router_v1.13";
|
|
7128
7289
|
columns: {
|
|
7129
7290
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
7130
7291
|
name: "id";
|
|
@@ -7165,7 +7326,7 @@ declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7165
7326
|
}>;
|
|
7166
7327
|
declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7167
7328
|
name: EnumTableName.POSITIONS;
|
|
7168
|
-
schema: "router_v1.
|
|
7329
|
+
schema: "router_v1.13";
|
|
7169
7330
|
columns: {
|
|
7170
7331
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
7171
7332
|
name: "chain_id";
|
|
@@ -7316,7 +7477,7 @@ declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7316
7477
|
}>;
|
|
7317
7478
|
declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7318
7479
|
name: EnumTableName.TRANSFERS;
|
|
7319
|
-
schema: "router_v1.
|
|
7480
|
+
schema: "router_v1.13";
|
|
7320
7481
|
columns: {
|
|
7321
7482
|
eventId: drizzle_orm_pg_core0.PgColumn<{
|
|
7322
7483
|
name: "event_id";
|
|
@@ -7506,7 +7667,7 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7506
7667
|
declare const StatusCode: drizzle_orm_pg_core0.PgEnum<[Status, ...Status[]]>;
|
|
7507
7668
|
declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7508
7669
|
name: "status";
|
|
7509
|
-
schema: "router_v1.
|
|
7670
|
+
schema: "router_v1.13";
|
|
7510
7671
|
columns: {
|
|
7511
7672
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
7512
7673
|
name: "id";
|
|
@@ -7547,7 +7708,7 @@ declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7547
7708
|
}>;
|
|
7548
7709
|
declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7549
7710
|
name: "validations";
|
|
7550
|
-
schema: "router_v1.
|
|
7711
|
+
schema: "router_v1.13";
|
|
7551
7712
|
columns: {
|
|
7552
7713
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
7553
7714
|
name: "offer_hash";
|
|
@@ -7585,7 +7746,7 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7585
7746
|
identity: undefined;
|
|
7586
7747
|
generated: undefined;
|
|
7587
7748
|
}, {}, {
|
|
7588
|
-
length:
|
|
7749
|
+
length: 42;
|
|
7589
7750
|
}>;
|
|
7590
7751
|
statusId: drizzle_orm_pg_core0.PgColumn<{
|
|
7591
7752
|
name: "status_id";
|
|
@@ -7626,7 +7787,7 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7626
7787
|
}>;
|
|
7627
7788
|
declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7628
7789
|
name: EnumTableName.COLLECTORS;
|
|
7629
|
-
schema: "router_v1.
|
|
7790
|
+
schema: "router_v1.13";
|
|
7630
7791
|
columns: {
|
|
7631
7792
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
7632
7793
|
name: "chain_id";
|
|
@@ -7722,7 +7883,7 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7722
7883
|
}>;
|
|
7723
7884
|
declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7724
7885
|
name: EnumTableName.CHAINS;
|
|
7725
|
-
schema: "router_v1.
|
|
7886
|
+
schema: "router_v1.13";
|
|
7726
7887
|
columns: {
|
|
7727
7888
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
7728
7889
|
name: "chain_id";
|
|
@@ -7799,7 +7960,7 @@ declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7799
7960
|
}>;
|
|
7800
7961
|
declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7801
7962
|
name: EnumTableName.TREES;
|
|
7802
|
-
schema: "router_v1.
|
|
7963
|
+
schema: "router_v1.13";
|
|
7803
7964
|
columns: {
|
|
7804
7965
|
root: drizzle_orm_pg_core0.PgColumn<{
|
|
7805
7966
|
name: "root";
|
|
@@ -7861,7 +8022,7 @@ declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7861
8022
|
}>;
|
|
7862
8023
|
declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7863
8024
|
name: EnumTableName.MERKLE_PATHS;
|
|
7864
|
-
schema: "router_v1.
|
|
8025
|
+
schema: "router_v1.13";
|
|
7865
8026
|
columns: {
|
|
7866
8027
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
7867
8028
|
name: "offer_hash";
|
|
@@ -7899,7 +8060,7 @@ declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7899
8060
|
identity: undefined;
|
|
7900
8061
|
generated: undefined;
|
|
7901
8062
|
}, {}, {
|
|
7902
|
-
length:
|
|
8063
|
+
length: 42;
|
|
7903
8064
|
}>;
|
|
7904
8065
|
treeRoot: drizzle_orm_pg_core0.PgColumn<{
|
|
7905
8066
|
name: "tree_root";
|
|
@@ -7958,16 +8119,19 @@ declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7958
8119
|
dialect: "pg";
|
|
7959
8120
|
}>;
|
|
7960
8121
|
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 };
|
|
8122
|
+
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, positionTypes, positions, status, transfers, trees, validations };
|
|
7962
8123
|
}
|
|
7963
8124
|
//#endregion
|
|
7964
8125
|
//#region src/gatekeeper/morphoRules.d.ts
|
|
7965
8126
|
declare const morphoRules: (parameters: {
|
|
7966
8127
|
chains: Chain$1[];
|
|
7967
8128
|
chainId: Id;
|
|
7968
|
-
|
|
8129
|
+
db?: {
|
|
8130
|
+
groups: GroupsDomain;
|
|
8131
|
+
};
|
|
8132
|
+
}) => Rule<Offer, string>[];
|
|
7969
8133
|
declare namespace Rules_d_exports {
|
|
7970
|
-
export { amountMutualExclusivity, callback, collateralToken, loanToken, maturity, oracle, sameMaker };
|
|
8134
|
+
export { amountMutualExclusivity, callback, collateralToken, groupConsistency, groupImmutability, loanToken, maturity, maxCollaterals, minDuration, oracle, sameMaker };
|
|
7971
8135
|
}
|
|
7972
8136
|
declare const maturity: ({
|
|
7973
8137
|
maturities
|
|
@@ -8027,7 +8191,46 @@ declare const sameMaker: () => Rule<Offer, "mixed_maker">;
|
|
|
8027
8191
|
* At most one of (assets, obligationUnits, obligationShares) can be non-zero.
|
|
8028
8192
|
* Matches contract requirement: `atMostOneNonZero(offer.assets, offer.obligationUnits, offer.obligationShares)`.
|
|
8029
8193
|
*/
|
|
8194
|
+
/**
|
|
8195
|
+
* A validation rule that checks if the offer duration (expiry - start) meets a minimum threshold.
|
|
8196
|
+
* @param minSeconds - Minimum required duration in seconds.
|
|
8197
|
+
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
8198
|
+
*/
|
|
8199
|
+
declare const minDuration: ({
|
|
8200
|
+
minSeconds
|
|
8201
|
+
}: {
|
|
8202
|
+
minSeconds: number;
|
|
8203
|
+
}) => Rule<Offer, "min_duration">;
|
|
8204
|
+
/**
|
|
8205
|
+
* A validation rule that checks if an offer exceeds the maximum number of collaterals.
|
|
8206
|
+
* The contract enforces this limit; this rule rejects early to avoid on-chain reverts.
|
|
8207
|
+
* @param max - Maximum allowed collaterals per offer.
|
|
8208
|
+
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
8209
|
+
*/
|
|
8210
|
+
declare const maxCollaterals: ({
|
|
8211
|
+
max
|
|
8212
|
+
}: {
|
|
8213
|
+
max: number;
|
|
8214
|
+
}) => Rule<Offer, "max_collaterals">;
|
|
8030
8215
|
declare const amountMutualExclusivity: () => Rule<Offer, "amount_mutual_exclusivity">;
|
|
8216
|
+
/**
|
|
8217
|
+
* A batch validation rule that ensures all offers within the same group are consistent.
|
|
8218
|
+
* All offers sharing the same group must have the same loan token, assets amount, and side (buy/sell).
|
|
8219
|
+
*/
|
|
8220
|
+
declare const groupConsistency: () => Rule<Offer, "group_consistency">;
|
|
8221
|
+
/**
|
|
8222
|
+
* A batch validation rule that prevents adding offers to groups that already exist in the database.
|
|
8223
|
+
* Groups are immutable after creation — new offers cannot be added to an existing group.
|
|
8224
|
+
*/
|
|
8225
|
+
declare const groupImmutability: ({
|
|
8226
|
+
db,
|
|
8227
|
+
chainId
|
|
8228
|
+
}: {
|
|
8229
|
+
db: {
|
|
8230
|
+
groups: GroupsDomain;
|
|
8231
|
+
};
|
|
8232
|
+
chainId: Id;
|
|
8233
|
+
}) => Rule<Offer, "group_immutability">;
|
|
8031
8234
|
//#endregion
|
|
8032
8235
|
//#region src/mempool/MempoolEVMClient.d.ts
|
|
8033
8236
|
type MempoolEVMClientConfig = {
|
|
@@ -8127,7 +8330,7 @@ declare namespace index_d_exports$1 {
|
|
|
8127
8330
|
}
|
|
8128
8331
|
//#endregion
|
|
8129
8332
|
//#region src/utils/BigMath.d.ts
|
|
8130
|
-
declare function max$
|
|
8333
|
+
declare function max$2(a: bigint, b: bigint): bigint;
|
|
8131
8334
|
declare function min(a: bigint, b: bigint): bigint;
|
|
8132
8335
|
/**
|
|
8133
8336
|
* Checks if at most one of the given values is non-zero.
|
|
@@ -8247,15 +8450,15 @@ declare function address(): Address;
|
|
|
8247
8450
|
//#region src/utils/retry.d.ts
|
|
8248
8451
|
declare const retry: <T>(fn: () => Promise<T>, attempts?: number, delayMs?: number) => Promise<T>;
|
|
8249
8452
|
declare namespace time_d_exports {
|
|
8250
|
-
export { max, now };
|
|
8453
|
+
export { max$1 as max, now };
|
|
8251
8454
|
}
|
|
8252
8455
|
declare function now(): number;
|
|
8253
|
-
declare function max(): number;
|
|
8456
|
+
declare function max$1(): number;
|
|
8254
8457
|
//#endregion
|
|
8255
8458
|
//#region src/utils/wait.d.ts
|
|
8256
8459
|
declare function wait(time: number): Promise<unknown>;
|
|
8257
8460
|
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$
|
|
8461
|
+
export { BaseError, GlobalErrorType, Group_d_exports as Group, Random_d_exports as Random, ReorgError, Snake, time_d_exports as Time, atMostOneNonZero, batch, batchMulticall, fromSnakeCase$3 as fromSnakeCase, lazy, max$2 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, wait };
|
|
8259
8462
|
}
|
|
8260
8463
|
//#endregion
|
|
8261
8464
|
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 };
|