@morpho-dev/router 0.7.2 → 0.9.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 +834 -334
- package/dist/drizzle/migrations/0000_setup_single_migration_folder.sql +64 -64
- package/dist/drizzle/migrations/0001_add-trigger-for-consumed-events.sql +5 -5
- package/dist/drizzle/migrations/0002_insert-status-code.sql +1 -1
- package/dist/drizzle/migrations/0003_update-triggers-for-consumed-events.sql +1 -1
- package/dist/drizzle/migrations/0004_drop-status-offers-foreign-key-constraint.sql +1 -1
- package/dist/drizzle/migrations/0005_add-index-to-boost-group-query-and-offer-hash.sql +1 -1
- package/dist/drizzle/migrations/0006_add-callbacks-and-positions-relations.sql +11 -11
- package/dist/drizzle/migrations/0008_validation.sql +10 -10
- package/dist/drizzle/migrations/0009_add-transfers-table.sql +4 -4
- package/dist/drizzle/migrations/0010_add-price.sql +1 -1
- package/dist/drizzle/migrations/0011_nullable-callback-amount.sql +1 -1
- package/dist/drizzle/migrations/0012_add-position-asset.sql +1 -1
- package/dist/drizzle/migrations/0013_remove-depecrated-domains.sql +13 -13
- package/dist/drizzle/migrations/0014_rename-offers-v2-into-offers.sql +19 -19
- package/dist/drizzle/migrations/0015_add-lots-table.sql +3 -3
- package/dist/drizzle/migrations/0016_merkle-metadata.sql +7 -7
- package/dist/drizzle/migrations/0017_dusty_the_hunter.sql +1 -1
- package/dist/drizzle/migrations/0018_add_chain_collector_constraints.sql +3 -3
- package/dist/drizzle/migrations/0019_add-obligation-units-shares.sql +2 -2
- package/dist/drizzle/migrations/0020_add-session.sql +1 -1
- package/dist/drizzle/migrations/0021_drop_chain_collector_epoch_indexes.sql +2 -2
- package/dist/drizzle/migrations/0021_migrate-rate-to-price.sql +6 -6
- package/dist/drizzle/migrations/0022_consolidate-price.sql +5 -5
- package/dist/drizzle/migrations/0023_remove-block-number-for-collaterals.sql +1 -1
- package/dist/drizzle/migrations/0024_add-obligation-id-to-lots.sql +8 -0
- package/dist/drizzle/migrations/0025_rename-price-to-tick.sql +202 -0
- package/dist/drizzle/migrations/0026_add-receiver-if-maker-is-seller.sql +1 -0
- package/dist/drizzle/migrations/meta/0000_snapshot.json +48 -48
- package/dist/drizzle/migrations/meta/0001_snapshot.json +48 -48
- package/dist/drizzle/migrations/meta/0002_snapshot.json +48 -48
- package/dist/drizzle/migrations/meta/0003_snapshot.json +48 -48
- package/dist/drizzle/migrations/meta/0004_snapshot.json +47 -47
- package/dist/drizzle/migrations/meta/0005_snapshot.json +47 -47
- package/dist/drizzle/migrations/meta/0006_snapshot.json +61 -61
- package/dist/drizzle/migrations/meta/0008_snapshot.json +62 -62
- package/dist/drizzle/migrations/meta/0009_snapshot.json +66 -66
- package/dist/drizzle/migrations/meta/0010_snapshot.json +66 -66
- package/dist/drizzle/migrations/meta/0013_snapshot.json +48 -48
- package/dist/drizzle/migrations/meta/0014_snapshot.json +48 -48
- package/dist/drizzle/migrations/meta/0015_snapshot.json +52 -52
- package/dist/drizzle/migrations/meta/0016_snapshot.json +61 -61
- package/dist/drizzle/migrations/meta/0017_snapshot.json +61 -61
- package/dist/drizzle/migrations/meta/0018_snapshot.json +62 -62
- package/dist/drizzle/migrations/meta/0019_snapshot.json +62 -62
- package/dist/drizzle/migrations/meta/0023_snapshot.json +62 -62
- package/dist/drizzle/migrations/meta/0024_snapshot.json +1448 -0
- package/dist/drizzle/migrations/meta/0025_snapshot.json +1448 -0
- package/dist/drizzle/migrations/meta/0026_snapshot.json +1454 -0
- package/dist/drizzle/migrations/meta/_journal.json +21 -0
- package/dist/evm/bytecode/morpho.txt +1 -1
- package/dist/index.browser.d.mts +206 -77
- package/dist/index.browser.d.mts.map +1 -1
- package/dist/index.browser.d.ts +206 -77
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +445 -197
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +440 -198
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +347 -119
- package/dist/index.node.d.mts.map +1 -1
- package/dist/index.node.d.ts +347 -119
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +865 -312
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +861 -314
- package/dist/index.node.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.node.d.mts
CHANGED
|
@@ -509,7 +509,7 @@ declare const MorphoV2: readonly [{
|
|
|
509
509
|
readonly stateMutability: "nonpayable";
|
|
510
510
|
readonly inputs: readonly [{
|
|
511
511
|
readonly type: "address";
|
|
512
|
-
readonly name: "
|
|
512
|
+
readonly name: "feeRecipient";
|
|
513
513
|
}];
|
|
514
514
|
readonly outputs: readonly [];
|
|
515
515
|
}, {
|
|
@@ -589,6 +589,15 @@ declare const MorphoV2: readonly [{
|
|
|
589
589
|
}, {
|
|
590
590
|
readonly type: "address";
|
|
591
591
|
readonly name: "taker";
|
|
592
|
+
}, {
|
|
593
|
+
readonly type: "address";
|
|
594
|
+
readonly name: "takerCallback";
|
|
595
|
+
}, {
|
|
596
|
+
readonly type: "bytes";
|
|
597
|
+
readonly name: "takerCallbackData";
|
|
598
|
+
}, {
|
|
599
|
+
readonly type: "address";
|
|
600
|
+
readonly name: "receiverIfTakerIsSeller";
|
|
592
601
|
}, {
|
|
593
602
|
readonly type: "tuple";
|
|
594
603
|
readonly components: readonly [{
|
|
@@ -650,6 +659,9 @@ declare const MorphoV2: readonly [{
|
|
|
650
659
|
}, {
|
|
651
660
|
readonly type: "bytes";
|
|
652
661
|
readonly name: "callbackData";
|
|
662
|
+
}, {
|
|
663
|
+
readonly type: "address";
|
|
664
|
+
readonly name: "receiverIfMakerIsSeller";
|
|
653
665
|
}];
|
|
654
666
|
readonly name: "offer";
|
|
655
667
|
}, {
|
|
@@ -671,12 +683,6 @@ declare const MorphoV2: readonly [{
|
|
|
671
683
|
}, {
|
|
672
684
|
readonly type: "bytes32[]";
|
|
673
685
|
readonly name: "proof";
|
|
674
|
-
}, {
|
|
675
|
-
readonly type: "address";
|
|
676
|
-
readonly name: "takerCallback";
|
|
677
|
-
}, {
|
|
678
|
-
readonly type: "bytes";
|
|
679
|
-
readonly name: "takerCallbackData";
|
|
680
686
|
}];
|
|
681
687
|
readonly outputs: readonly [{
|
|
682
688
|
readonly type: "uint256";
|
|
@@ -798,6 +804,9 @@ declare const MorphoV2: readonly [{
|
|
|
798
804
|
}, {
|
|
799
805
|
readonly type: "address";
|
|
800
806
|
readonly name: "onBehalf";
|
|
807
|
+
}, {
|
|
808
|
+
readonly type: "address";
|
|
809
|
+
readonly name: "receiver";
|
|
801
810
|
}];
|
|
802
811
|
readonly outputs: readonly [{
|
|
803
812
|
readonly type: "uint256";
|
|
@@ -840,6 +849,9 @@ declare const MorphoV2: readonly [{
|
|
|
840
849
|
}, {
|
|
841
850
|
readonly type: "address";
|
|
842
851
|
readonly name: "onBehalf";
|
|
852
|
+
}, {
|
|
853
|
+
readonly type: "address";
|
|
854
|
+
readonly name: "receiver";
|
|
843
855
|
}];
|
|
844
856
|
readonly outputs: readonly [];
|
|
845
857
|
}, {
|
|
@@ -1027,7 +1039,7 @@ declare const MorphoV2: readonly [{
|
|
|
1027
1039
|
readonly type: "event";
|
|
1028
1040
|
readonly inputs: readonly [{
|
|
1029
1041
|
readonly type: "address";
|
|
1030
|
-
readonly name: "
|
|
1042
|
+
readonly name: "feeRecipient";
|
|
1031
1043
|
readonly indexed: true;
|
|
1032
1044
|
}];
|
|
1033
1045
|
}, {
|
|
@@ -1102,6 +1114,9 @@ declare const MorphoV2: readonly [{
|
|
|
1102
1114
|
}, {
|
|
1103
1115
|
readonly type: "bool";
|
|
1104
1116
|
readonly name: "sellerIsBorrower";
|
|
1117
|
+
}, {
|
|
1118
|
+
readonly type: "address";
|
|
1119
|
+
readonly name: "sellerReceiver";
|
|
1105
1120
|
}, {
|
|
1106
1121
|
readonly type: "bytes32";
|
|
1107
1122
|
readonly name: "group";
|
|
@@ -1115,7 +1130,6 @@ declare const MorphoV2: readonly [{
|
|
|
1115
1130
|
readonly inputs: readonly [{
|
|
1116
1131
|
readonly type: "address";
|
|
1117
1132
|
readonly name: "caller";
|
|
1118
|
-
readonly indexed: true;
|
|
1119
1133
|
}, {
|
|
1120
1134
|
readonly type: "bytes32";
|
|
1121
1135
|
readonly name: "id";
|
|
@@ -1130,6 +1144,10 @@ declare const MorphoV2: readonly [{
|
|
|
1130
1144
|
readonly type: "address";
|
|
1131
1145
|
readonly name: "onBehalf";
|
|
1132
1146
|
readonly indexed: true;
|
|
1147
|
+
}, {
|
|
1148
|
+
readonly type: "address";
|
|
1149
|
+
readonly name: "receiver";
|
|
1150
|
+
readonly indexed: true;
|
|
1133
1151
|
}];
|
|
1134
1152
|
}, {
|
|
1135
1153
|
readonly name: "WithdrawCollateral";
|
|
@@ -1152,6 +1170,9 @@ declare const MorphoV2: readonly [{
|
|
|
1152
1170
|
readonly type: "address";
|
|
1153
1171
|
readonly name: "onBehalf";
|
|
1154
1172
|
readonly indexed: true;
|
|
1173
|
+
}, {
|
|
1174
|
+
readonly type: "address";
|
|
1175
|
+
readonly name: "receiver";
|
|
1155
1176
|
}];
|
|
1156
1177
|
}];
|
|
1157
1178
|
type MorphoV2 = typeof MorphoV2;
|
|
@@ -1871,8 +1892,8 @@ type Offer = {
|
|
|
1871
1892
|
/** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
|
|
1872
1893
|
readonly assets: bigint; /** The max debt units to trade. Mutually exclusive with assets and obligationShares. */
|
|
1873
1894
|
readonly obligationUnits: bigint; /** The max lending shares to trade. Mutually exclusive with assets and obligationUnits. */
|
|
1874
|
-
readonly obligationShares: bigint; /** The
|
|
1875
|
-
readonly
|
|
1895
|
+
readonly obligationShares: bigint; /** The offer tick. */
|
|
1896
|
+
readonly tick: number; /** The date at which all interests will be paid. */
|
|
1876
1897
|
readonly maturity: Maturity; /** The date at which the offer will expire. */
|
|
1877
1898
|
readonly expiry: number; /** The date at which the offer will start. */
|
|
1878
1899
|
readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
|
|
@@ -1885,7 +1906,8 @@ type Offer = {
|
|
|
1885
1906
|
readonly callback: {
|
|
1886
1907
|
readonly address: Address;
|
|
1887
1908
|
readonly data: Hex;
|
|
1888
|
-
};
|
|
1909
|
+
}; /** Receiver of loan token proceeds when maker is seller on `take()`. */
|
|
1910
|
+
readonly receiverIfMakerIsSeller: Address;
|
|
1889
1911
|
};
|
|
1890
1912
|
declare enum Status {
|
|
1891
1913
|
VALID = "VALID",
|
|
@@ -1900,7 +1922,7 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1900
1922
|
assets: z$1.ZodBigInt;
|
|
1901
1923
|
obligationUnits: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1902
1924
|
obligationShares: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1903
|
-
|
|
1925
|
+
tick: z$1.ZodCoercedNumber<unknown>;
|
|
1904
1926
|
maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
|
|
1905
1927
|
expiry: z$1.ZodNumber;
|
|
1906
1928
|
start: z$1.ZodNumber;
|
|
@@ -1918,6 +1940,7 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1918
1940
|
address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1919
1941
|
data: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1920
1942
|
}, z$1.core.$strip>;
|
|
1943
|
+
receiverIfMakerIsSeller: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1921
1944
|
}, z$1.core.$strip>;
|
|
1922
1945
|
/**
|
|
1923
1946
|
* Input type for creating offers. Accepts flexible group types that will be coerced to Hex.
|
|
@@ -1930,12 +1953,13 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1930
1953
|
*
|
|
1931
1954
|
* All values validated to be non-negative and within bytes32 range.
|
|
1932
1955
|
*/
|
|
1933
|
-
type OfferInput = Compute<Omit<Offer, "chainId" | "group" | "session" | "obligationUnits" | "obligationShares"> & {
|
|
1956
|
+
type OfferInput = Compute<Omit<Offer, "chainId" | "group" | "session" | "obligationUnits" | "obligationShares" | "receiverIfMakerIsSeller"> & {
|
|
1934
1957
|
chainId: number;
|
|
1935
1958
|
group: Hex | bigint | number | string; /** Optional: defaults to zero bytes32. */
|
|
1936
1959
|
session?: Hex | bigint | number | string; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationShares. */
|
|
1937
1960
|
obligationUnits?: bigint; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationUnits. */
|
|
1938
|
-
obligationShares?: bigint;
|
|
1961
|
+
obligationShares?: bigint; /** Optional: defaults to maker for backward compatibility. */
|
|
1962
|
+
receiverIfMakerIsSeller?: Address;
|
|
1939
1963
|
}>;
|
|
1940
1964
|
/**
|
|
1941
1965
|
* Creates an offer from a plain object.
|
|
@@ -1953,9 +1977,9 @@ declare namespace from$13 {
|
|
|
1953
1977
|
* @param input - The offer to create.
|
|
1954
1978
|
* @returns The created offer.
|
|
1955
1979
|
*/
|
|
1956
|
-
declare function fromSnakeCase$1(input: Snake<Omit<Offer, "
|
|
1957
|
-
|
|
1958
|
-
|
|
1980
|
+
declare function fromSnakeCase$1(input: Snake<Omit<Offer, "session" | "receiverIfMakerIsSeller"> & {
|
|
1981
|
+
session?: Hex;
|
|
1982
|
+
receiverIfMakerIsSeller?: Address;
|
|
1959
1983
|
}>): Offer;
|
|
1960
1984
|
/**
|
|
1961
1985
|
* Converts an offer to a snake case object.
|
|
@@ -1975,7 +1999,7 @@ declare const serialize: (offer: Offer) => {
|
|
|
1975
1999
|
assets: string;
|
|
1976
2000
|
obligationUnits: string;
|
|
1977
2001
|
obligationShares: string;
|
|
1978
|
-
|
|
2002
|
+
tick: number;
|
|
1979
2003
|
maturity: number;
|
|
1980
2004
|
expiry: number;
|
|
1981
2005
|
start: number;
|
|
@@ -1993,6 +2017,7 @@ declare const serialize: (offer: Offer) => {
|
|
|
1993
2017
|
address: `0x${string}`;
|
|
1994
2018
|
data: `0x${string}`;
|
|
1995
2019
|
};
|
|
2020
|
+
receiverIfMakerIsSeller: `0x${string}`;
|
|
1996
2021
|
hash: `0x${string}`;
|
|
1997
2022
|
};
|
|
1998
2023
|
type RandomConfig = {
|
|
@@ -2010,11 +2035,12 @@ type RandomConfig = {
|
|
|
2010
2035
|
expiry?: number;
|
|
2011
2036
|
group?: Hex | bigint | number | string;
|
|
2012
2037
|
session?: Hex | bigint | number | string;
|
|
2013
|
-
|
|
2038
|
+
tick?: number;
|
|
2014
2039
|
callback?: {
|
|
2015
2040
|
address: Address;
|
|
2016
2041
|
data: Hex;
|
|
2017
2042
|
};
|
|
2043
|
+
receiverIfMakerIsSeller?: Address;
|
|
2018
2044
|
collaterals?: readonly Collateral[];
|
|
2019
2045
|
};
|
|
2020
2046
|
/**
|
|
@@ -2059,7 +2085,7 @@ declare const types: {
|
|
|
2059
2085
|
readonly name: "obligationShares";
|
|
2060
2086
|
readonly type: "uint256";
|
|
2061
2087
|
}, {
|
|
2062
|
-
readonly name: "
|
|
2088
|
+
readonly name: "tick";
|
|
2063
2089
|
readonly type: "uint256";
|
|
2064
2090
|
}, {
|
|
2065
2091
|
readonly name: "maturity";
|
|
@@ -2085,6 +2111,9 @@ declare const types: {
|
|
|
2085
2111
|
}, {
|
|
2086
2112
|
readonly name: "callback";
|
|
2087
2113
|
readonly type: "Callback";
|
|
2114
|
+
}, {
|
|
2115
|
+
readonly name: "receiverIfMakerIsSeller";
|
|
2116
|
+
readonly type: "address";
|
|
2088
2117
|
}];
|
|
2089
2118
|
readonly Collateral: readonly [{
|
|
2090
2119
|
readonly name: "asset";
|
|
@@ -2183,6 +2212,11 @@ declare const takeEvent: {
|
|
|
2183
2212
|
readonly type: "bool";
|
|
2184
2213
|
readonly indexed: false;
|
|
2185
2214
|
readonly internalType: "bool";
|
|
2215
|
+
}, {
|
|
2216
|
+
readonly name: "sellerReceiver";
|
|
2217
|
+
readonly type: "address";
|
|
2218
|
+
readonly indexed: false;
|
|
2219
|
+
readonly internalType: "address";
|
|
2186
2220
|
}, {
|
|
2187
2221
|
readonly name: "group";
|
|
2188
2222
|
readonly type: "bytes32";
|
|
@@ -2386,26 +2420,26 @@ declare namespace from$11 {
|
|
|
2386
2420
|
type ReturnType = Position;
|
|
2387
2421
|
}
|
|
2388
2422
|
declare namespace Quote_d_exports {
|
|
2389
|
-
export { InvalidQuoteError, Quote,
|
|
2423
|
+
export { InvalidQuoteError, Quote, QuoteInput, Side, from$10 as from, fromSnakeCase, random };
|
|
2390
2424
|
}
|
|
2391
|
-
type
|
|
2425
|
+
type Side = {
|
|
2426
|
+
/** The best side tick, or null when no active quote exists. */tick: number | null; /** The side price for the obligation. (18 decimals). */
|
|
2427
|
+
price: bigint;
|
|
2428
|
+
};
|
|
2429
|
+
type QuoteInput = {
|
|
2392
2430
|
/** The obligation id. */obligationId: Hex;
|
|
2393
2431
|
ask: {
|
|
2394
|
-
/** The ask
|
|
2432
|
+
/** The best ask tick, or null when there is no active ask quote. */tick: number | null;
|
|
2395
2433
|
};
|
|
2396
2434
|
bid: {
|
|
2397
|
-
/** The bid
|
|
2435
|
+
/** The best bid tick, or null when there is no active bid quote. */tick: number | null;
|
|
2398
2436
|
};
|
|
2399
2437
|
};
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
ask:
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
bid: z$1.ZodObject<{
|
|
2406
|
-
price: z$1.ZodBigInt;
|
|
2407
|
-
}, z$1.core.$strip>;
|
|
2408
|
-
}, z$1.core.$strip>;
|
|
2438
|
+
type Quote = {
|
|
2439
|
+
/** The obligation id. */obligationId: Hex;
|
|
2440
|
+
ask: Side;
|
|
2441
|
+
bid: Side;
|
|
2442
|
+
};
|
|
2409
2443
|
/**
|
|
2410
2444
|
* Creates a quote for a given obligation.
|
|
2411
2445
|
* @constructor
|
|
@@ -2415,12 +2449,12 @@ declare const QuoteSchema: z$1.ZodObject<{
|
|
|
2415
2449
|
*
|
|
2416
2450
|
* @example
|
|
2417
2451
|
* ```ts
|
|
2418
|
-
* const quote = Quote.from({ obligationId: "0x123", ask: {
|
|
2452
|
+
* const quote = Quote.from({ obligationId: "0x123", ask: { tick: 500 }, bid: { tick: 510 } });
|
|
2419
2453
|
* ```
|
|
2420
2454
|
*/
|
|
2421
2455
|
declare function from$10(parameters: from$10.Parameters): from$10.ReturnType;
|
|
2422
2456
|
declare namespace from$10 {
|
|
2423
|
-
type Parameters =
|
|
2457
|
+
type Parameters = QuoteInput;
|
|
2424
2458
|
type ReturnType = Quote;
|
|
2425
2459
|
type ErrorType = InvalidQuoteError;
|
|
2426
2460
|
}
|
|
@@ -2432,7 +2466,7 @@ declare namespace from$10 {
|
|
|
2432
2466
|
*/
|
|
2433
2467
|
declare function fromSnakeCase(snake: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
2434
2468
|
declare namespace fromSnakeCase {
|
|
2435
|
-
type Parameters = Snake<
|
|
2469
|
+
type Parameters = Snake<QuoteInput>;
|
|
2436
2470
|
type ReturnType = Quote;
|
|
2437
2471
|
type ErrorType = from$10.ErrorType;
|
|
2438
2472
|
}
|
|
@@ -2455,6 +2489,41 @@ declare class InvalidQuoteError extends BaseError<z$1.ZodError | Error> {
|
|
|
2455
2489
|
readonly name = "Quote.InvalidQuoteError";
|
|
2456
2490
|
constructor(error: z$1.ZodError | Error);
|
|
2457
2491
|
}
|
|
2492
|
+
declare namespace Tick_d_exports {
|
|
2493
|
+
export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, priceToTick, tickToPrice };
|
|
2494
|
+
}
|
|
2495
|
+
/** Tick domain supported by Morpho V2. */
|
|
2496
|
+
declare const TICK_RANGE = 990;
|
|
2497
|
+
/** Max allowed price (1e18 in wad). */
|
|
2498
|
+
declare const MAX_PRICE: bigint;
|
|
2499
|
+
/**
|
|
2500
|
+
* Converts a tick to a wad price using the same approximation and rounding as TickLib.
|
|
2501
|
+
* @param tick - Tick value in the inclusive range [0, 990].
|
|
2502
|
+
* @returns The price in wad units.
|
|
2503
|
+
* @throws {@link InvalidTickError} If tick is not an integer in range [0, 990].
|
|
2504
|
+
*/
|
|
2505
|
+
declare function tickToPrice(tick: number): bigint;
|
|
2506
|
+
declare namespace tickToPrice {
|
|
2507
|
+
type ErrorType = InvalidTickError;
|
|
2508
|
+
}
|
|
2509
|
+
/**
|
|
2510
|
+
* Returns the lowest tick with a higher-or-equal price.
|
|
2511
|
+
* @param price - Price in wad units.
|
|
2512
|
+
* @returns The first tick whose {@link tickToPrice} is greater than or equal to `price`.
|
|
2513
|
+
* @throws {@link InvalidPriceError} If price is outside [0, 1e18].
|
|
2514
|
+
*/
|
|
2515
|
+
declare function priceToTick(price: bigint): number;
|
|
2516
|
+
declare namespace priceToTick {
|
|
2517
|
+
type ErrorType = InvalidPriceError;
|
|
2518
|
+
}
|
|
2519
|
+
declare class InvalidTickError extends BaseError {
|
|
2520
|
+
readonly name = "Tick.InvalidTickError";
|
|
2521
|
+
constructor(tick: number);
|
|
2522
|
+
}
|
|
2523
|
+
declare class InvalidPriceError extends BaseError {
|
|
2524
|
+
readonly name = "Tick.InvalidPriceError";
|
|
2525
|
+
constructor(price: bigint);
|
|
2526
|
+
}
|
|
2458
2527
|
declare namespace TradingFee_d_exports {
|
|
2459
2528
|
export { BREAKPOINTS, Fees, InvalidFeeError, InvalidFeesLengthError, TradingFee, WAD, activate, compute, deactivate, from$9 as from, getFees, isActivated };
|
|
2460
2529
|
}
|
|
@@ -2868,7 +2937,7 @@ type Row = {
|
|
|
2868
2937
|
assets: bigint;
|
|
2869
2938
|
obligationUnits: bigint;
|
|
2870
2939
|
obligationShares: bigint;
|
|
2871
|
-
|
|
2940
|
+
tick: number;
|
|
2872
2941
|
maturity: Maturity;
|
|
2873
2942
|
expiry: number;
|
|
2874
2943
|
start: number;
|
|
@@ -2882,6 +2951,7 @@ type Row = {
|
|
|
2882
2951
|
address: Address;
|
|
2883
2952
|
data: Hex;
|
|
2884
2953
|
};
|
|
2954
|
+
receiverIfMakerIsSeller: Address;
|
|
2885
2955
|
consumed: bigint;
|
|
2886
2956
|
available: bigint;
|
|
2887
2957
|
takeable: bigint;
|
|
@@ -2901,18 +2971,6 @@ type OffersDomain = {
|
|
|
2901
2971
|
get: (parameters?: GetOffersParams) => Promise<{
|
|
2902
2972
|
rows: Row[];
|
|
2903
2973
|
nextCursor: string | null;
|
|
2904
|
-
}>; /** Get obligations */
|
|
2905
|
-
getObligations: (parameters?: {
|
|
2906
|
-
ids?: Hex[];
|
|
2907
|
-
chainId?: Id[];
|
|
2908
|
-
loanToken?: Address[];
|
|
2909
|
-
collateralToken?: Address[];
|
|
2910
|
-
maturity?: number[];
|
|
2911
|
-
cursor?: string;
|
|
2912
|
-
limit?: number;
|
|
2913
|
-
}) => Promise<{
|
|
2914
|
-
obligations: Obligation[];
|
|
2915
|
-
nextCursor: string | null;
|
|
2916
2974
|
}>; /** Get quotes for given obligations. */
|
|
2917
2975
|
getQuotes: (parameters: {
|
|
2918
2976
|
obligationIds: Hex[];
|
|
@@ -2939,8 +2997,8 @@ declare namespace get$4 {
|
|
|
2939
2997
|
limit?: number;
|
|
2940
2998
|
};
|
|
2941
2999
|
type Level = {
|
|
2942
|
-
/** The
|
|
2943
|
-
assets: bigint; /** Number of offers at this
|
|
3000
|
+
/** The offer tick for this level */tick: number; /** Sum of takeable amounts at this tick */
|
|
3001
|
+
assets: bigint; /** Number of offers at this tick */
|
|
2944
3002
|
count: number;
|
|
2945
3003
|
};
|
|
2946
3004
|
type ReturnType = {
|
|
@@ -3029,6 +3087,7 @@ type Lot = {
|
|
|
3029
3087
|
user: Address;
|
|
3030
3088
|
contract: Address;
|
|
3031
3089
|
group: string;
|
|
3090
|
+
obligationId: string;
|
|
3032
3091
|
lower: bigint;
|
|
3033
3092
|
upper: bigint;
|
|
3034
3093
|
};
|
|
@@ -3051,6 +3110,7 @@ declare namespace create$5 {
|
|
|
3051
3110
|
positionContract: Address;
|
|
3052
3111
|
positionUser: Address;
|
|
3053
3112
|
group: string;
|
|
3113
|
+
obligationId: string;
|
|
3054
3114
|
size: bigint;
|
|
3055
3115
|
};
|
|
3056
3116
|
type Parameters = OfferLotInfo[];
|
|
@@ -3062,6 +3122,7 @@ declare namespace get$3 {
|
|
|
3062
3122
|
user?: Address;
|
|
3063
3123
|
contract?: Address;
|
|
3064
3124
|
group?: string;
|
|
3125
|
+
obligationId?: string;
|
|
3065
3126
|
};
|
|
3066
3127
|
type ReturnType = Lot[];
|
|
3067
3128
|
}
|
|
@@ -3074,6 +3135,14 @@ type ObligationsDomain = {
|
|
|
3074
3135
|
* @param obligations - Obligations to insert. {@link Obligation.Obligation}
|
|
3075
3136
|
*/
|
|
3076
3137
|
create: (obligations: Obligation[]) => Promise<void>;
|
|
3138
|
+
/**
|
|
3139
|
+
* Get active obligations with optional chain filters.
|
|
3140
|
+
* @param parameters - Optional chain filters.
|
|
3141
|
+
* @returns Matching obligations.
|
|
3142
|
+
*/
|
|
3143
|
+
get: (parameters?: {
|
|
3144
|
+
chainId?: Id[];
|
|
3145
|
+
}) => Promise<Obligation[]>;
|
|
3077
3146
|
};
|
|
3078
3147
|
//#endregion
|
|
3079
3148
|
//#region src/database/domains/Offsets.d.ts
|
|
@@ -3082,6 +3151,7 @@ type Offset = {
|
|
|
3082
3151
|
user: Address;
|
|
3083
3152
|
contract: Address;
|
|
3084
3153
|
group: string;
|
|
3154
|
+
obligationId: string;
|
|
3085
3155
|
value: bigint;
|
|
3086
3156
|
};
|
|
3087
3157
|
type OffsetsDomain = {
|
|
@@ -3096,6 +3166,7 @@ declare namespace get$2 {
|
|
|
3096
3166
|
user?: Address;
|
|
3097
3167
|
contract?: Address;
|
|
3098
3168
|
group?: string;
|
|
3169
|
+
obligationId?: string;
|
|
3099
3170
|
};
|
|
3100
3171
|
type ReturnType = Offset[];
|
|
3101
3172
|
}
|
|
@@ -3174,7 +3245,8 @@ declare namespace getByUser {
|
|
|
3174
3245
|
chainId: Id;
|
|
3175
3246
|
contract: Address;
|
|
3176
3247
|
user: Address;
|
|
3177
|
-
blockNumber: number; /** The
|
|
3248
|
+
blockNumber: number; /** The obligation this reserved amount belongs to, or null if no lots exist */
|
|
3249
|
+
obligationId: string | null; /** The amount reserved by active offers: max(lot.upper) - offset - consumed */
|
|
3178
3250
|
reserved: bigint;
|
|
3179
3251
|
};
|
|
3180
3252
|
type ReturnType = {
|
|
@@ -3262,8 +3334,36 @@ type ValidationsDomain = {
|
|
|
3262
3334
|
*/
|
|
3263
3335
|
upsert: (validations: Validation[]) => Promise<void>;
|
|
3264
3336
|
};
|
|
3337
|
+
//#endregion
|
|
3338
|
+
//#region src/database/readers/ObligationsListing.d.ts
|
|
3339
|
+
type ListObligationsParameters = {
|
|
3340
|
+
ids?: Hex[];
|
|
3341
|
+
chainId?: Id[];
|
|
3342
|
+
loanToken?: Address[];
|
|
3343
|
+
collateralToken?: Address[];
|
|
3344
|
+
maturity?: number[];
|
|
3345
|
+
sort?: string[];
|
|
3346
|
+
cursor?: string;
|
|
3347
|
+
limit?: number;
|
|
3348
|
+
};
|
|
3349
|
+
type ListedObligation = {
|
|
3350
|
+
obligation: Obligation;
|
|
3351
|
+
quote: Quote;
|
|
3352
|
+
};
|
|
3353
|
+
type ListObligationsResult = {
|
|
3354
|
+
obligations: ListedObligation[];
|
|
3355
|
+
nextCursor: string | null;
|
|
3356
|
+
};
|
|
3357
|
+
type ObligationsListingReader = {
|
|
3358
|
+
/**
|
|
3359
|
+
* Lists obligations with SQL keyset pagination and opaque cursor handling.
|
|
3360
|
+
* @param parameters - Optional filters, sorting, and pagination cursor.
|
|
3361
|
+
* @returns Listed obligations with associated quotes and a next cursor.
|
|
3362
|
+
*/
|
|
3363
|
+
list: (parameters?: ListObligationsParameters) => Promise<ListObligationsResult>;
|
|
3364
|
+
};
|
|
3265
3365
|
declare namespace Database_d_exports {
|
|
3266
|
-
export { Core, Database, Driver, WithDomains, connect$2 as connect };
|
|
3366
|
+
export { Core, Database, Driver, WithDomains, connect$2 as connect, getSchemaNamesForMigration };
|
|
3267
3367
|
}
|
|
3268
3368
|
type Driver = ReturnType<typeof drizzle> | ReturnType<typeof drizzle$1>;
|
|
3269
3369
|
type Domains = {
|
|
@@ -3282,7 +3382,13 @@ type Domains = {
|
|
|
3282
3382
|
positions: PositionsDomain;
|
|
3283
3383
|
transfers: TransfersDomain;
|
|
3284
3384
|
};
|
|
3285
|
-
type
|
|
3385
|
+
type Readers = {
|
|
3386
|
+
obligations: ObligationsListingReader;
|
|
3387
|
+
};
|
|
3388
|
+
type DatabaseFacade = Domains & {
|
|
3389
|
+
readers: Readers;
|
|
3390
|
+
};
|
|
3391
|
+
type WithDomains<D extends Driver> = D & DatabaseFacade;
|
|
3286
3392
|
type Core = Omit<WithDomains<Driver>, "transaction"> & {
|
|
3287
3393
|
transaction<T>(fn: (tx: WithDomains<Driver>) => Promise<T>): Promise<T>;
|
|
3288
3394
|
};
|
|
@@ -3299,6 +3405,12 @@ type Database = Core & {
|
|
|
3299
3405
|
* @returns The database client {@link connect.ReturnType}
|
|
3300
3406
|
*/
|
|
3301
3407
|
declare function connect$2(chainRegistry: ChainRegistry, connectionString?: string): Database;
|
|
3408
|
+
/**
|
|
3409
|
+
* Build the list of router schemas that should exist before running migrations.
|
|
3410
|
+
* @param version - Current schema version (e.g. `router_v1.8`).
|
|
3411
|
+
* @returns Ordered schema names from `router_v1.7` to current, or just current if parsing fails.
|
|
3412
|
+
*/
|
|
3413
|
+
declare function getSchemaNamesForMigration(version: string): string[];
|
|
3302
3414
|
declare namespace Gate_d_exports {
|
|
3303
3415
|
export { Batch, Issue, Result, Rule, RuleNames, Single, batch$1 as batch, run, single };
|
|
3304
3416
|
}
|
|
@@ -3383,6 +3495,10 @@ type ConfigRule = {
|
|
|
3383
3495
|
type: "loan_token";
|
|
3384
3496
|
chain_id: Id;
|
|
3385
3497
|
address: Address;
|
|
3498
|
+
} | {
|
|
3499
|
+
type: "collateral_token";
|
|
3500
|
+
chain_id: Id;
|
|
3501
|
+
address: Address;
|
|
3386
3502
|
} | {
|
|
3387
3503
|
type: "oracle";
|
|
3388
3504
|
chain_id: Id;
|
|
@@ -3555,15 +3671,17 @@ declare namespace BookResponse_d_exports {
|
|
|
3555
3671
|
export { BookLevelResponse, from$4 as from };
|
|
3556
3672
|
}
|
|
3557
3673
|
type BookLevelResponse = {
|
|
3674
|
+
tick: number;
|
|
3558
3675
|
price: string;
|
|
3559
3676
|
assets: string;
|
|
3560
3677
|
count: number;
|
|
3561
3678
|
};
|
|
3562
|
-
|
|
3563
|
-
|
|
3679
|
+
type Input$1 = {
|
|
3680
|
+
tick: number;
|
|
3564
3681
|
assets: bigint;
|
|
3565
3682
|
count: number;
|
|
3566
|
-
}
|
|
3683
|
+
};
|
|
3684
|
+
declare function from$4(level: Input$1): BookLevelResponse;
|
|
3567
3685
|
//#endregion
|
|
3568
3686
|
//#region src/api/Schema/health.d.ts
|
|
3569
3687
|
declare const CollectorHealth: z.ZodObject<{
|
|
@@ -3637,13 +3755,13 @@ interface paths {
|
|
|
3637
3755
|
};
|
|
3638
3756
|
/**
|
|
3639
3757
|
* Get aggregated book
|
|
3640
|
-
* @description Returns aggregated book data for a given obligation and side. Offers are grouped by
|
|
3758
|
+
* @description Returns aggregated book data for a given obligation and side. Offers are grouped by tick with summed takeable amounts, and each level includes the corresponding wad-scaled price. Book levels are sorted by tick (ascending for sell side, descending for buy side).
|
|
3641
3759
|
*/
|
|
3642
3760
|
get: {
|
|
3643
3761
|
parameters: {
|
|
3644
3762
|
query?: {
|
|
3645
3763
|
/**
|
|
3646
|
-
* @description Maximum number of
|
|
3764
|
+
* @description Maximum number of tick levels to return.
|
|
3647
3765
|
* @example 10
|
|
3648
3766
|
*/
|
|
3649
3767
|
limit?: number;
|
|
@@ -3759,7 +3877,7 @@ interface paths {
|
|
|
3759
3877
|
};
|
|
3760
3878
|
/**
|
|
3761
3879
|
* Get config rules
|
|
3762
|
-
* @description Returns configured rules (maturities, loan tokens, oracles) for supported chains.
|
|
3880
|
+
* @description Returns configured rules (maturities, loan tokens, collateral tokens, oracles) for supported chains.
|
|
3763
3881
|
*/
|
|
3764
3882
|
get: {
|
|
3765
3883
|
parameters: {
|
|
@@ -3771,7 +3889,7 @@ interface paths {
|
|
|
3771
3889
|
chains?: number[];
|
|
3772
3890
|
/**
|
|
3773
3891
|
* @description Filter by rule types (comma-separated).
|
|
3774
|
-
* @example maturity,loan_token,oracle
|
|
3892
|
+
* @example maturity,loan_token,collateral_token,oracle
|
|
3775
3893
|
*/
|
|
3776
3894
|
types?: string[];
|
|
3777
3895
|
/**
|
|
@@ -3890,11 +4008,16 @@ interface paths {
|
|
|
3890
4008
|
};
|
|
3891
4009
|
/**
|
|
3892
4010
|
* List all obligations
|
|
3893
|
-
* @description Returns a list of obligations with their current best ask and bid.
|
|
4011
|
+
* @description Returns a list of obligations with their current best ask and bid. Sorting is customizable with the sort parameter and defaults to id ascending.
|
|
3894
4012
|
*/
|
|
3895
4013
|
get: {
|
|
3896
4014
|
parameters: {
|
|
3897
4015
|
query?: {
|
|
4016
|
+
/**
|
|
4017
|
+
* @description Sort order as comma-separated fields (`id`, `ask`, `bid`, `maturity`). Prefix with `-` for descending order. Max 3 fields.
|
|
4018
|
+
* @example -ask,bid,maturity
|
|
4019
|
+
*/
|
|
4020
|
+
sort?: string;
|
|
3898
4021
|
/**
|
|
3899
4022
|
* @description Filter by exact maturity timestamps (comma-separated, unix seconds).
|
|
3900
4023
|
* @example 1761922800,1764524800
|
|
@@ -3921,8 +4044,8 @@ interface paths {
|
|
|
3921
4044
|
*/
|
|
3922
4045
|
limit?: number;
|
|
3923
4046
|
/**
|
|
3924
|
-
* @description
|
|
3925
|
-
* @example
|
|
4047
|
+
* @description Pagination cursor in base64url-encoded format.
|
|
4048
|
+
* @example eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAiLCJhc2siOiIwIiwiYmlkIjoiMCIsIm1hdHVyaXR5IjoxNzYxOTIyODAwfQ
|
|
3926
4049
|
*/
|
|
3927
4050
|
cursor?: string;
|
|
3928
4051
|
};
|
|
@@ -4151,7 +4274,7 @@ interface paths {
|
|
|
4151
4274
|
};
|
|
4152
4275
|
/**
|
|
4153
4276
|
* Get user positions
|
|
4154
|
-
* @description Returns positions for a user with reserved balance.
|
|
4277
|
+
* @description Returns positions for a user with reserved balance per obligation. Each (position, obligation) pair is returned as a separate row. Positions with no lots return a single row with obligation_id = null and reserved = 0.
|
|
4155
4278
|
*/
|
|
4156
4279
|
get: {
|
|
4157
4280
|
parameters: {
|
|
@@ -4260,14 +4383,19 @@ interface components {
|
|
|
4260
4383
|
schemas: {
|
|
4261
4384
|
BookListResponse: {
|
|
4262
4385
|
meta: components["schemas"]["Meta"]; /** @example eyJvZmZzZXQiOjEwMH0 */
|
|
4263
|
-
cursor: string | null; /** @description Aggregated book levels grouped by
|
|
4386
|
+
cursor: string | null; /** @description Aggregated book levels grouped by offer tick. */
|
|
4264
4387
|
data: components["schemas"]["BookLevelResponse"][];
|
|
4265
4388
|
};
|
|
4266
4389
|
Meta: {
|
|
4267
4390
|
/** @example 2024-01-01T12:00:00.000Z */timestamp: string;
|
|
4268
4391
|
};
|
|
4269
4392
|
BookLevelResponse: {
|
|
4270
|
-
/** @example
|
|
4393
|
+
/** @example 495 */tick: number;
|
|
4394
|
+
/**
|
|
4395
|
+
* @description Price derived from tick, scaled by 1e18.
|
|
4396
|
+
* @example 500000000000000000
|
|
4397
|
+
*/
|
|
4398
|
+
price: string; /** @example 369216000000000000000000 */
|
|
4271
4399
|
assets: string; /** @example 5 */
|
|
4272
4400
|
count: number;
|
|
4273
4401
|
};
|
|
@@ -4344,6 +4472,11 @@ interface components {
|
|
|
4344
4472
|
* "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
4345
4473
|
* },
|
|
4346
4474
|
* {
|
|
4475
|
+
* "type": "collateral_token",
|
|
4476
|
+
* "chain_id": 1,
|
|
4477
|
+
* "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
4478
|
+
* },
|
|
4479
|
+
* {
|
|
4347
4480
|
* "type": "oracle",
|
|
4348
4481
|
* "chain_id": 1,
|
|
4349
4482
|
* "address": "0xDddd770BADd886dF3864029e4B377B5F6a2B6b83"
|
|
@@ -4393,11 +4526,12 @@ interface components {
|
|
|
4393
4526
|
* "obligation_shares": "0",
|
|
4394
4527
|
* "start": 1761922790,
|
|
4395
4528
|
* "expiry": 1761922799,
|
|
4396
|
-
* "
|
|
4529
|
+
* "tick": 495,
|
|
4397
4530
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
4398
4531
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
4399
4532
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
4400
|
-
* "callback_data": "0x"
|
|
4533
|
+
* "callback_data": "0x",
|
|
4534
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4401
4535
|
* },
|
|
4402
4536
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
4403
4537
|
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc",
|
|
@@ -4437,11 +4571,12 @@ interface components {
|
|
|
4437
4571
|
* "obligation_shares": "0",
|
|
4438
4572
|
* "start": 1761922790,
|
|
4439
4573
|
* "expiry": 1761922799,
|
|
4440
|
-
* "
|
|
4574
|
+
* "tick": 495,
|
|
4441
4575
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
4442
4576
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
4443
4577
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
4444
|
-
* "callback_data": "0x"
|
|
4578
|
+
* "callback_data": "0x",
|
|
4579
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4445
4580
|
* }
|
|
4446
4581
|
*/
|
|
4447
4582
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
@@ -4482,12 +4617,13 @@ interface components {
|
|
|
4482
4617
|
obligation_units: string; /** @example 0 */
|
|
4483
4618
|
obligation_shares: string; /** @example 1761922790 */
|
|
4484
4619
|
start: number; /** @example 1761922799 */
|
|
4485
|
-
expiry: number; /** @example
|
|
4486
|
-
|
|
4620
|
+
expiry: number; /** @example 495 */
|
|
4621
|
+
tick: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
4487
4622
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
4488
4623
|
session: string; /** @example 0x0000000000000000000000000000000000000000 */
|
|
4489
4624
|
callback: string; /** @example 0x */
|
|
4490
|
-
callback_data: string;
|
|
4625
|
+
callback_data: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4626
|
+
receiver_if_maker_is_seller: string;
|
|
4491
4627
|
};
|
|
4492
4628
|
ObligationOfferResponse: {
|
|
4493
4629
|
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */loan_token: string;
|
|
@@ -4509,7 +4645,7 @@ interface components {
|
|
|
4509
4645
|
oracle: string;
|
|
4510
4646
|
};
|
|
4511
4647
|
ObligationListResponse: {
|
|
4512
|
-
meta: components["schemas"]["Meta"]; /** @example
|
|
4648
|
+
meta: components["schemas"]["Meta"]; /** @example eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAiLCJhc2siOiIwIiwiYmlkIjoiMCIsIm1hdHVyaXR5IjoxNzYxOTIyODAwfQ */
|
|
4513
4649
|
cursor: string | null; /** @description List of obligations with takable offers. */
|
|
4514
4650
|
data: components["schemas"]["ObligationResponse"][];
|
|
4515
4651
|
};
|
|
@@ -4523,10 +4659,20 @@ interface components {
|
|
|
4523
4659
|
bid: components["schemas"]["BidResponse"];
|
|
4524
4660
|
};
|
|
4525
4661
|
AskResponse: {
|
|
4526
|
-
/**
|
|
4662
|
+
/**
|
|
4663
|
+
* @description Best ask tick. Null when there is no active ask quote.
|
|
4664
|
+
* @example 500
|
|
4665
|
+
*/
|
|
4666
|
+
tick: number | null; /** @example 1000000000000000000 */
|
|
4667
|
+
price: string;
|
|
4527
4668
|
};
|
|
4528
4669
|
BidResponse: {
|
|
4529
|
-
/**
|
|
4670
|
+
/**
|
|
4671
|
+
* @description Best bid tick. Null when there is no active bid quote.
|
|
4672
|
+
* @example 500
|
|
4673
|
+
*/
|
|
4674
|
+
tick: number | null; /** @example 1000000000000000000 */
|
|
4675
|
+
price: string;
|
|
4530
4676
|
};
|
|
4531
4677
|
ObligationSingleSuccessResponse: {
|
|
4532
4678
|
meta: components["schemas"]["Meta"]; /** @example null */
|
|
@@ -4632,6 +4778,7 @@ interface components {
|
|
|
4632
4778
|
* "chain_id": 1,
|
|
4633
4779
|
* "contract": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
|
|
4634
4780
|
* "user": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
4781
|
+
* "obligation_id": "0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
|
|
4635
4782
|
* "reserved": "200000000000000000000",
|
|
4636
4783
|
* "block_number": 21345678
|
|
4637
4784
|
* }
|
|
@@ -4642,7 +4789,12 @@ interface components {
|
|
|
4642
4789
|
PositionListItemResponse: {
|
|
4643
4790
|
/** @example 1 */chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
4644
4791
|
contract: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4645
|
-
user: string;
|
|
4792
|
+
user: string;
|
|
4793
|
+
/**
|
|
4794
|
+
* @description Obligation id this reserved amount belongs to, or null if no lots exist.
|
|
4795
|
+
* @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67
|
|
4796
|
+
*/
|
|
4797
|
+
obligation_id: string | null; /** @example 200000000000000000000 */
|
|
4646
4798
|
reserved: string; /** @example 21345678 */
|
|
4647
4799
|
block_number: number;
|
|
4648
4800
|
};
|
|
@@ -4653,8 +4805,8 @@ interface components {
|
|
|
4653
4805
|
/** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
|
|
4654
4806
|
assets: string; /** @example 0 */
|
|
4655
4807
|
obligation_units?: string; /** @example 0 */
|
|
4656
|
-
obligation_shares?: string; /** @example
|
|
4657
|
-
|
|
4808
|
+
obligation_shares?: string; /** @example 495 */
|
|
4809
|
+
tick: number; /** @example 1761922799 */
|
|
4658
4810
|
maturity: number; /** @example 1761922799 */
|
|
4659
4811
|
expiry: number; /** @example 1761922790 */
|
|
4660
4812
|
start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
@@ -4679,7 +4831,8 @@ interface components {
|
|
|
4679
4831
|
* "data": "0x"
|
|
4680
4832
|
* }
|
|
4681
4833
|
*/
|
|
4682
|
-
callback: components["schemas"]["ValidateCallbackRequest"];
|
|
4834
|
+
callback: components["schemas"]["ValidateCallbackRequest"]; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4835
|
+
receiver_if_maker_is_seller: string;
|
|
4683
4836
|
};
|
|
4684
4837
|
ValidateCollateralRequest: {
|
|
4685
4838
|
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */asset: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
@@ -4722,6 +4875,7 @@ type ObligationResponse = paths["/v1/obligations"]["get"]["responses"]["200"]["c
|
|
|
4722
4875
|
* Creates an `ObligationResponse` from a `Obligation`.
|
|
4723
4876
|
* @constructor
|
|
4724
4877
|
* @param obligation - {@link Obligation}
|
|
4878
|
+
* @param quote - {@link Quote}
|
|
4725
4879
|
* @returns The created `ObligationResponse`. {@link ObligationResponse}
|
|
4726
4880
|
*/
|
|
4727
4881
|
declare function from$3(obligation: Obligation, quote: Quote): ObligationResponse;
|
|
@@ -4735,7 +4889,7 @@ type Input = Readonly<{
|
|
|
4735
4889
|
assets: bigint;
|
|
4736
4890
|
obligationUnits: bigint;
|
|
4737
4891
|
obligationShares: bigint;
|
|
4738
|
-
|
|
4892
|
+
tick: number;
|
|
4739
4893
|
maturity: number;
|
|
4740
4894
|
expiry: number;
|
|
4741
4895
|
start: number;
|
|
@@ -4753,6 +4907,7 @@ type Input = Readonly<{
|
|
|
4753
4907
|
address: Address;
|
|
4754
4908
|
data: Hex;
|
|
4755
4909
|
};
|
|
4910
|
+
receiverIfMakerIsSeller: Address;
|
|
4756
4911
|
root?: Hex | undefined;
|
|
4757
4912
|
proof?: Hex[] | undefined;
|
|
4758
4913
|
signature?: Hex | undefined;
|
|
@@ -4804,6 +4959,7 @@ type PositionResponse = {
|
|
|
4804
4959
|
chain_id: Id;
|
|
4805
4960
|
contract: Address;
|
|
4806
4961
|
user: Address;
|
|
4962
|
+
obligation_id: string | null;
|
|
4807
4963
|
reserved: string;
|
|
4808
4964
|
block_number: number;
|
|
4809
4965
|
};
|
|
@@ -4854,6 +5010,7 @@ declare const schemas: {
|
|
|
4854
5010
|
maturity: "maturity";
|
|
4855
5011
|
callback: "callback";
|
|
4856
5012
|
loan_token: "loan_token";
|
|
5013
|
+
collateral_token: "collateral_token";
|
|
4857
5014
|
}>>>>;
|
|
4858
5015
|
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>>>>>;
|
|
4859
5016
|
}, z$1.core.$strip>;
|
|
@@ -4885,6 +5042,7 @@ declare const schemas: {
|
|
|
4885
5042
|
loan_tokens: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>>>>;
|
|
4886
5043
|
collateral_tokens: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>>>>;
|
|
4887
5044
|
maturities: 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>>>>>;
|
|
5045
|
+
sort: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodString>>>;
|
|
4888
5046
|
limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodPipe<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>, z$1.ZodNumber>>>;
|
|
4889
5047
|
}, z$1.core.$strip>;
|
|
4890
5048
|
readonly get_obligation: z$1.ZodObject<{
|
|
@@ -5155,13 +5313,16 @@ declare namespace getOffers {
|
|
|
5155
5313
|
}
|
|
5156
5314
|
declare function getObligations(apiClient: Client$1<paths>, parameters?: getObligations.Parameters): Promise<getObligations.ReturnType>;
|
|
5157
5315
|
declare namespace getObligations {
|
|
5316
|
+
type SortField = "id" | "ask" | "bid" | "maturity";
|
|
5317
|
+
type SortEntry = SortField | `-${SortField}`;
|
|
5158
5318
|
type Parameters = {
|
|
5159
|
-
/** Pagination cursor
|
|
5319
|
+
/** Pagination cursor in base64url-encoded format. */cursor?: string; /** Maximum number of obligations to return. @default 20 */
|
|
5160
5320
|
limit?: number; /** Filter by chain IDs (comma-separated). */
|
|
5161
5321
|
chainIds?: number[]; /** Filter by loan token addresses (comma-separated). */
|
|
5162
5322
|
loanTokens?: Address[]; /** Filter by collateral tokens (comma-separated, matches any collateral). */
|
|
5163
5323
|
collateralTokens?: Address[]; /** Filter by exact maturity timestamps (comma-separated, unix seconds). */
|
|
5164
|
-
maturities?: number[];
|
|
5324
|
+
maturities?: number[]; /** Sort order entries in priority order. Prefix with '-' for descending. Max 3 fields. */
|
|
5325
|
+
sort?: SortEntry[];
|
|
5165
5326
|
};
|
|
5166
5327
|
type ReturnType = {
|
|
5167
5328
|
obligations: Compute<{
|
|
@@ -5198,7 +5359,7 @@ declare class HttpGetApiFailedError extends BaseError {
|
|
|
5198
5359
|
}
|
|
5199
5360
|
//#endregion
|
|
5200
5361
|
//#region src/database/drizzle/VERSION.d.ts
|
|
5201
|
-
declare const VERSION: "router_v1.
|
|
5362
|
+
declare const VERSION: "router_v1.8";
|
|
5202
5363
|
//#endregion
|
|
5203
5364
|
//#region src/database/drizzle/schema.d.ts
|
|
5204
5365
|
declare enum EnumTableName {
|
|
@@ -5221,12 +5382,12 @@ declare enum EnumTableName {
|
|
|
5221
5382
|
MERKLE_PATHS = "merkle_paths"
|
|
5222
5383
|
}
|
|
5223
5384
|
declare const TABLE_NAMES: readonly EnumTableName[];
|
|
5224
|
-
declare const VERSIONED_TABLE_NAMES: ("\"router_v1.
|
|
5385
|
+
declare const VERSIONED_TABLE_NAMES: ("\"router_v1.8\".\"obligations\"" | "\"router_v1.8\".\"groups\"" | "\"router_v1.8\".\"consumed_events\"" | "\"router_v1.8\".\"obligation_collaterals_v2\"" | "\"router_v1.8\".\"oracles\"" | "\"router_v1.8\".\"offers\"" | "\"router_v1.8\".\"offers_callbacks\"" | "\"router_v1.8\".\"callbacks\"" | "\"router_v1.8\".\"positions\"" | "\"router_v1.8\".\"transfers\"" | "\"router_v1.8\".\"validations\"" | "\"router_v1.8\".\"collectors\"" | "\"router_v1.8\".\"chains\"" | "\"router_v1.8\".\"lots\"" | "\"router_v1.8\".\"offsets\"" | "\"router_v1.8\".\"trees\"" | "\"router_v1.8\".\"merkle_paths\"")[];
|
|
5225
5386
|
type TableName = (typeof TABLE_NAMES)[number];
|
|
5226
5387
|
type VersionedTableName = `"${typeof VERSION}"."${TableName}"`;
|
|
5227
5388
|
declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5228
5389
|
name: EnumTableName.OBLIGATIONS;
|
|
5229
|
-
schema: "router_v1.
|
|
5390
|
+
schema: "router_v1.8";
|
|
5230
5391
|
columns: {
|
|
5231
5392
|
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
5232
5393
|
name: "obligation_id";
|
|
@@ -5307,7 +5468,7 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5307
5468
|
}>;
|
|
5308
5469
|
declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5309
5470
|
name: EnumTableName.GROUPS;
|
|
5310
|
-
schema: "router_v1.
|
|
5471
|
+
schema: "router_v1.8";
|
|
5311
5472
|
columns: {
|
|
5312
5473
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
5313
5474
|
name: "chain_id";
|
|
@@ -5422,7 +5583,7 @@ declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5422
5583
|
}>;
|
|
5423
5584
|
declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5424
5585
|
name: EnumTableName.CONSUMED_EVENTS;
|
|
5425
|
-
schema: "router_v1.
|
|
5586
|
+
schema: "router_v1.8";
|
|
5426
5587
|
columns: {
|
|
5427
5588
|
eventId: drizzle_orm_pg_core0.PgColumn<{
|
|
5428
5589
|
name: "event_id";
|
|
@@ -5556,7 +5717,7 @@ declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5556
5717
|
}>;
|
|
5557
5718
|
declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5558
5719
|
name: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
5559
|
-
schema: "router_v1.
|
|
5720
|
+
schema: "router_v1.8";
|
|
5560
5721
|
columns: {
|
|
5561
5722
|
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
5562
5723
|
name: "obligation_id";
|
|
@@ -5673,7 +5834,7 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5673
5834
|
}>;
|
|
5674
5835
|
declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5675
5836
|
name: EnumTableName.ORACLES;
|
|
5676
|
-
schema: "router_v1.
|
|
5837
|
+
schema: "router_v1.8";
|
|
5677
5838
|
columns: {
|
|
5678
5839
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
5679
5840
|
name: "chain_id";
|
|
@@ -5769,7 +5930,7 @@ declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5769
5930
|
}>;
|
|
5770
5931
|
declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5771
5932
|
name: EnumTableName.OFFERS;
|
|
5772
|
-
schema: "router_v1.
|
|
5933
|
+
schema: "router_v1.8";
|
|
5773
5934
|
columns: {
|
|
5774
5935
|
hash: drizzle_orm_pg_core0.PgColumn<{
|
|
5775
5936
|
name: "hash";
|
|
@@ -5860,13 +6021,13 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5860
6021
|
identity: undefined;
|
|
5861
6022
|
generated: undefined;
|
|
5862
6023
|
}, {}, {}>;
|
|
5863
|
-
|
|
5864
|
-
name: "
|
|
6024
|
+
tick: drizzle_orm_pg_core0.PgColumn<{
|
|
6025
|
+
name: "tick";
|
|
5865
6026
|
tableName: EnumTableName.OFFERS;
|
|
5866
|
-
dataType: "
|
|
5867
|
-
columnType: "
|
|
5868
|
-
data:
|
|
5869
|
-
driverParam: string;
|
|
6027
|
+
dataType: "number";
|
|
6028
|
+
columnType: "PgInteger";
|
|
6029
|
+
data: number;
|
|
6030
|
+
driverParam: string | number;
|
|
5870
6031
|
notNull: true;
|
|
5871
6032
|
hasDefault: false;
|
|
5872
6033
|
isPrimaryKey: false;
|
|
@@ -6057,6 +6218,25 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6057
6218
|
identity: undefined;
|
|
6058
6219
|
generated: undefined;
|
|
6059
6220
|
}, {}, {}>;
|
|
6221
|
+
receiverIfMakerIsSeller: drizzle_orm_pg_core0.PgColumn<{
|
|
6222
|
+
name: "receiver_if_maker_is_seller";
|
|
6223
|
+
tableName: EnumTableName.OFFERS;
|
|
6224
|
+
dataType: "string";
|
|
6225
|
+
columnType: "PgVarchar";
|
|
6226
|
+
data: string;
|
|
6227
|
+
driverParam: string;
|
|
6228
|
+
notNull: false;
|
|
6229
|
+
hasDefault: false;
|
|
6230
|
+
isPrimaryKey: false;
|
|
6231
|
+
isAutoincrement: false;
|
|
6232
|
+
hasRuntimeDefault: false;
|
|
6233
|
+
enumValues: [string, ...string[]];
|
|
6234
|
+
baseColumn: never;
|
|
6235
|
+
identity: undefined;
|
|
6236
|
+
generated: undefined;
|
|
6237
|
+
}, {}, {
|
|
6238
|
+
length: 42;
|
|
6239
|
+
}>;
|
|
6060
6240
|
blockNumber: drizzle_orm_pg_core0.PgColumn<{
|
|
6061
6241
|
name: "block_number";
|
|
6062
6242
|
tableName: EnumTableName.OFFERS;
|
|
@@ -6096,7 +6276,7 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6096
6276
|
}>;
|
|
6097
6277
|
declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6098
6278
|
name: EnumTableName.OFFERS_CALLBACKS;
|
|
6099
|
-
schema: "router_v1.
|
|
6279
|
+
schema: "router_v1.8";
|
|
6100
6280
|
columns: {
|
|
6101
6281
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
6102
6282
|
name: "offer_hash";
|
|
@@ -6141,7 +6321,7 @@ declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6141
6321
|
}>;
|
|
6142
6322
|
declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6143
6323
|
name: EnumTableName.CALLBACKS;
|
|
6144
|
-
schema: "router_v1.
|
|
6324
|
+
schema: "router_v1.8";
|
|
6145
6325
|
columns: {
|
|
6146
6326
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
6147
6327
|
name: "id";
|
|
@@ -6241,7 +6421,7 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6241
6421
|
}>;
|
|
6242
6422
|
declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6243
6423
|
name: EnumTableName.LOTS;
|
|
6244
|
-
schema: "router_v1.
|
|
6424
|
+
schema: "router_v1.8";
|
|
6245
6425
|
columns: {
|
|
6246
6426
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6247
6427
|
name: "chain_id";
|
|
@@ -6319,6 +6499,25 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6319
6499
|
}, {}, {
|
|
6320
6500
|
length: 66;
|
|
6321
6501
|
}>;
|
|
6502
|
+
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
6503
|
+
name: "obligation_id";
|
|
6504
|
+
tableName: EnumTableName.LOTS;
|
|
6505
|
+
dataType: "string";
|
|
6506
|
+
columnType: "PgVarchar";
|
|
6507
|
+
data: string;
|
|
6508
|
+
driverParam: string;
|
|
6509
|
+
notNull: true;
|
|
6510
|
+
hasDefault: false;
|
|
6511
|
+
isPrimaryKey: false;
|
|
6512
|
+
isAutoincrement: false;
|
|
6513
|
+
hasRuntimeDefault: false;
|
|
6514
|
+
enumValues: [string, ...string[]];
|
|
6515
|
+
baseColumn: never;
|
|
6516
|
+
identity: undefined;
|
|
6517
|
+
generated: undefined;
|
|
6518
|
+
}, {}, {
|
|
6519
|
+
length: 66;
|
|
6520
|
+
}>;
|
|
6322
6521
|
lower: drizzle_orm_pg_core0.PgColumn<{
|
|
6323
6522
|
name: "lower";
|
|
6324
6523
|
tableName: EnumTableName.LOTS;
|
|
@@ -6358,7 +6557,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6358
6557
|
}>;
|
|
6359
6558
|
declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6360
6559
|
name: EnumTableName.OFFSETS;
|
|
6361
|
-
schema: "router_v1.
|
|
6560
|
+
schema: "router_v1.8";
|
|
6362
6561
|
columns: {
|
|
6363
6562
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6364
6563
|
name: "chain_id";
|
|
@@ -6436,6 +6635,25 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6436
6635
|
}, {}, {
|
|
6437
6636
|
length: 66;
|
|
6438
6637
|
}>;
|
|
6638
|
+
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
6639
|
+
name: "obligation_id";
|
|
6640
|
+
tableName: EnumTableName.OFFSETS;
|
|
6641
|
+
dataType: "string";
|
|
6642
|
+
columnType: "PgVarchar";
|
|
6643
|
+
data: string;
|
|
6644
|
+
driverParam: string;
|
|
6645
|
+
notNull: true;
|
|
6646
|
+
hasDefault: false;
|
|
6647
|
+
isPrimaryKey: false;
|
|
6648
|
+
isAutoincrement: false;
|
|
6649
|
+
hasRuntimeDefault: false;
|
|
6650
|
+
enumValues: [string, ...string[]];
|
|
6651
|
+
baseColumn: never;
|
|
6652
|
+
identity: undefined;
|
|
6653
|
+
generated: undefined;
|
|
6654
|
+
}, {}, {
|
|
6655
|
+
length: 66;
|
|
6656
|
+
}>;
|
|
6439
6657
|
value: drizzle_orm_pg_core0.PgColumn<{
|
|
6440
6658
|
name: "value";
|
|
6441
6659
|
tableName: EnumTableName.OFFSETS;
|
|
@@ -6459,7 +6677,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6459
6677
|
declare const PositionTypes: drizzle_orm_pg_core0.PgEnum<[Type, ...Type[]]>;
|
|
6460
6678
|
declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6461
6679
|
name: "position_types";
|
|
6462
|
-
schema: "router_v1.
|
|
6680
|
+
schema: "router_v1.8";
|
|
6463
6681
|
columns: {
|
|
6464
6682
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
6465
6683
|
name: "id";
|
|
@@ -6500,7 +6718,7 @@ declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6500
6718
|
}>;
|
|
6501
6719
|
declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6502
6720
|
name: EnumTableName.POSITIONS;
|
|
6503
|
-
schema: "router_v1.
|
|
6721
|
+
schema: "router_v1.8";
|
|
6504
6722
|
columns: {
|
|
6505
6723
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6506
6724
|
name: "chain_id";
|
|
@@ -6651,7 +6869,7 @@ declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6651
6869
|
}>;
|
|
6652
6870
|
declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6653
6871
|
name: EnumTableName.TRANSFERS;
|
|
6654
|
-
schema: "router_v1.
|
|
6872
|
+
schema: "router_v1.8";
|
|
6655
6873
|
columns: {
|
|
6656
6874
|
eventId: drizzle_orm_pg_core0.PgColumn<{
|
|
6657
6875
|
name: "event_id";
|
|
@@ -6805,7 +7023,7 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6805
7023
|
declare const StatusCode: drizzle_orm_pg_core0.PgEnum<[Status, ...Status[]]>;
|
|
6806
7024
|
declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6807
7025
|
name: "status";
|
|
6808
|
-
schema: "router_v1.
|
|
7026
|
+
schema: "router_v1.8";
|
|
6809
7027
|
columns: {
|
|
6810
7028
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
6811
7029
|
name: "id";
|
|
@@ -6846,7 +7064,7 @@ declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6846
7064
|
}>;
|
|
6847
7065
|
declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6848
7066
|
name: "validations";
|
|
6849
|
-
schema: "router_v1.
|
|
7067
|
+
schema: "router_v1.8";
|
|
6850
7068
|
columns: {
|
|
6851
7069
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
6852
7070
|
name: "offer_hash";
|
|
@@ -6906,7 +7124,7 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6906
7124
|
}>;
|
|
6907
7125
|
declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6908
7126
|
name: EnumTableName.COLLECTORS;
|
|
6909
|
-
schema: "router_v1.
|
|
7127
|
+
schema: "router_v1.8";
|
|
6910
7128
|
columns: {
|
|
6911
7129
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6912
7130
|
name: "chain_id";
|
|
@@ -7002,7 +7220,7 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7002
7220
|
}>;
|
|
7003
7221
|
declare const chains$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7004
7222
|
name: EnumTableName.CHAINS;
|
|
7005
|
-
schema: "router_v1.
|
|
7223
|
+
schema: "router_v1.8";
|
|
7006
7224
|
columns: {
|
|
7007
7225
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
7008
7226
|
name: "chain_id";
|
|
@@ -7079,7 +7297,7 @@ declare const chains$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7079
7297
|
}>;
|
|
7080
7298
|
declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7081
7299
|
name: EnumTableName.TREES;
|
|
7082
|
-
schema: "router_v1.
|
|
7300
|
+
schema: "router_v1.8";
|
|
7083
7301
|
columns: {
|
|
7084
7302
|
root: drizzle_orm_pg_core0.PgColumn<{
|
|
7085
7303
|
name: "root";
|
|
@@ -7141,7 +7359,7 @@ declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7141
7359
|
}>;
|
|
7142
7360
|
declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7143
7361
|
name: EnumTableName.MERKLE_PATHS;
|
|
7144
|
-
schema: "router_v1.
|
|
7362
|
+
schema: "router_v1.8";
|
|
7145
7363
|
columns: {
|
|
7146
7364
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
7147
7365
|
name: "offer_hash";
|
|
@@ -7223,9 +7441,9 @@ declare namespace index_d_exports$2 {
|
|
|
7223
7441
|
}
|
|
7224
7442
|
//#endregion
|
|
7225
7443
|
//#region src/gatekeeper/morphoRules.d.ts
|
|
7226
|
-
declare const morphoRules: (chains: Chain$1[]) => (Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity"> | Rule<Offer, "chain_ids"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "
|
|
7444
|
+
declare const morphoRules: (chains: Chain$1[]) => (Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity"> | Rule<Offer, "chain_ids"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "loan_token"> | Rule<Offer, "collateral_token"> | Rule<Offer, "oracle">)[];
|
|
7227
7445
|
declare namespace Rules_d_exports {
|
|
7228
|
-
export { ValidityParameters, amountMutualExclusivity, callback, chains, maturity, oracle, sameMaker,
|
|
7446
|
+
export { ValidityParameters, amountMutualExclusivity, callback, chains, collateralToken, loanToken, maturity, oracle, sameMaker, validity };
|
|
7229
7447
|
}
|
|
7230
7448
|
type ValidityParameters = {
|
|
7231
7449
|
client: PublicClient<Transport, Chain$1>;
|
|
@@ -7254,15 +7472,25 @@ declare const callback: ({
|
|
|
7254
7472
|
allowedAddresses: Address[];
|
|
7255
7473
|
}) => Rule<Offer, "callback">;
|
|
7256
7474
|
/**
|
|
7257
|
-
* A validation rule that checks if the offer's
|
|
7258
|
-
* @param assetsByChainId - Allowed
|
|
7475
|
+
* A validation rule that checks if the offer's loan token is allowed for its chain.
|
|
7476
|
+
* @param assetsByChainId - Allowed loan tokens indexed by chain id.
|
|
7259
7477
|
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
7260
7478
|
*/
|
|
7261
|
-
declare const
|
|
7479
|
+
declare const loanToken: ({
|
|
7262
7480
|
assetsByChainId
|
|
7263
7481
|
}: {
|
|
7264
7482
|
assetsByChainId: Partial<Record<Id, Address[]>>;
|
|
7265
|
-
}) => Rule<Offer, "
|
|
7483
|
+
}) => Rule<Offer, "loan_token">;
|
|
7484
|
+
/**
|
|
7485
|
+
* A validation rule that checks if the offer's collateral tokens are allowed for its chain.
|
|
7486
|
+
* @param collateralAssetsByChainId - Allowed collateral tokens indexed by chain id.
|
|
7487
|
+
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
7488
|
+
*/
|
|
7489
|
+
declare const collateralToken: ({
|
|
7490
|
+
collateralAssetsByChainId
|
|
7491
|
+
}: {
|
|
7492
|
+
collateralAssetsByChainId: Partial<Record<Id, Address[]>>;
|
|
7493
|
+
}) => Rule<Offer, "collateral_token">;
|
|
7266
7494
|
/**
|
|
7267
7495
|
* A validation rule that checks if the offer's oracle addresses are allowed for its chain.
|
|
7268
7496
|
* @param oraclesByChainId - Allowed oracles indexed by chain id.
|
|
@@ -7519,5 +7747,5 @@ declare namespace index_d_exports$3 {
|
|
|
7519
7747
|
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 };
|
|
7520
7748
|
}
|
|
7521
7749
|
//#endregion
|
|
7522
|
-
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, 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, 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 };
|
|
7750
|
+
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, 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 };
|
|
7523
7751
|
//# sourceMappingURL=index.node.d.mts.map
|