@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.browser.d.ts
CHANGED
|
@@ -11,15 +11,17 @@ declare namespace BookResponse_d_exports {
|
|
|
11
11
|
export { BookLevelResponse, from$15 as from };
|
|
12
12
|
}
|
|
13
13
|
type BookLevelResponse = {
|
|
14
|
+
tick: number;
|
|
14
15
|
price: string;
|
|
15
16
|
assets: string;
|
|
16
17
|
count: number;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
type Input$1 = {
|
|
20
|
+
tick: number;
|
|
20
21
|
assets: bigint;
|
|
21
22
|
count: number;
|
|
22
|
-
}
|
|
23
|
+
};
|
|
24
|
+
declare function from$15(level: Input$1): BookLevelResponse;
|
|
23
25
|
//#endregion
|
|
24
26
|
//#region src/api/Schema/health.d.ts
|
|
25
27
|
declare const CollectorHealth: z.ZodObject<{
|
|
@@ -29,9 +31,9 @@ declare const CollectorHealth: z.ZodObject<{
|
|
|
29
31
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
30
32
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
31
33
|
status: z.ZodEnum<{
|
|
32
|
-
unknown: "unknown";
|
|
33
34
|
live: "live";
|
|
34
35
|
lagging: "lagging";
|
|
36
|
+
unknown: "unknown";
|
|
35
37
|
}>;
|
|
36
38
|
initialized: z.ZodBoolean;
|
|
37
39
|
}, z.core.$strip>;
|
|
@@ -42,9 +44,9 @@ declare const CollectorsHealthResponse: z.ZodArray<z.ZodObject<{
|
|
|
42
44
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
43
45
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
44
46
|
status: z.ZodEnum<{
|
|
45
|
-
unknown: "unknown";
|
|
46
47
|
live: "live";
|
|
47
48
|
lagging: "lagging";
|
|
49
|
+
unknown: "unknown";
|
|
48
50
|
}>;
|
|
49
51
|
initialized: z.ZodBoolean;
|
|
50
52
|
}, z.core.$strip>>;
|
|
@@ -575,7 +577,7 @@ declare const MorphoV2: readonly [{
|
|
|
575
577
|
readonly stateMutability: "nonpayable";
|
|
576
578
|
readonly inputs: readonly [{
|
|
577
579
|
readonly type: "address";
|
|
578
|
-
readonly name: "
|
|
580
|
+
readonly name: "feeRecipient";
|
|
579
581
|
}];
|
|
580
582
|
readonly outputs: readonly [];
|
|
581
583
|
}, {
|
|
@@ -655,6 +657,15 @@ declare const MorphoV2: readonly [{
|
|
|
655
657
|
}, {
|
|
656
658
|
readonly type: "address";
|
|
657
659
|
readonly name: "taker";
|
|
660
|
+
}, {
|
|
661
|
+
readonly type: "address";
|
|
662
|
+
readonly name: "takerCallback";
|
|
663
|
+
}, {
|
|
664
|
+
readonly type: "bytes";
|
|
665
|
+
readonly name: "takerCallbackData";
|
|
666
|
+
}, {
|
|
667
|
+
readonly type: "address";
|
|
668
|
+
readonly name: "receiverIfTakerIsSeller";
|
|
658
669
|
}, {
|
|
659
670
|
readonly type: "tuple";
|
|
660
671
|
readonly components: readonly [{
|
|
@@ -716,6 +727,9 @@ declare const MorphoV2: readonly [{
|
|
|
716
727
|
}, {
|
|
717
728
|
readonly type: "bytes";
|
|
718
729
|
readonly name: "callbackData";
|
|
730
|
+
}, {
|
|
731
|
+
readonly type: "address";
|
|
732
|
+
readonly name: "receiverIfMakerIsSeller";
|
|
719
733
|
}];
|
|
720
734
|
readonly name: "offer";
|
|
721
735
|
}, {
|
|
@@ -737,12 +751,6 @@ declare const MorphoV2: readonly [{
|
|
|
737
751
|
}, {
|
|
738
752
|
readonly type: "bytes32[]";
|
|
739
753
|
readonly name: "proof";
|
|
740
|
-
}, {
|
|
741
|
-
readonly type: "address";
|
|
742
|
-
readonly name: "takerCallback";
|
|
743
|
-
}, {
|
|
744
|
-
readonly type: "bytes";
|
|
745
|
-
readonly name: "takerCallbackData";
|
|
746
754
|
}];
|
|
747
755
|
readonly outputs: readonly [{
|
|
748
756
|
readonly type: "uint256";
|
|
@@ -864,6 +872,9 @@ declare const MorphoV2: readonly [{
|
|
|
864
872
|
}, {
|
|
865
873
|
readonly type: "address";
|
|
866
874
|
readonly name: "onBehalf";
|
|
875
|
+
}, {
|
|
876
|
+
readonly type: "address";
|
|
877
|
+
readonly name: "receiver";
|
|
867
878
|
}];
|
|
868
879
|
readonly outputs: readonly [{
|
|
869
880
|
readonly type: "uint256";
|
|
@@ -906,6 +917,9 @@ declare const MorphoV2: readonly [{
|
|
|
906
917
|
}, {
|
|
907
918
|
readonly type: "address";
|
|
908
919
|
readonly name: "onBehalf";
|
|
920
|
+
}, {
|
|
921
|
+
readonly type: "address";
|
|
922
|
+
readonly name: "receiver";
|
|
909
923
|
}];
|
|
910
924
|
readonly outputs: readonly [];
|
|
911
925
|
}, {
|
|
@@ -1093,7 +1107,7 @@ declare const MorphoV2: readonly [{
|
|
|
1093
1107
|
readonly type: "event";
|
|
1094
1108
|
readonly inputs: readonly [{
|
|
1095
1109
|
readonly type: "address";
|
|
1096
|
-
readonly name: "
|
|
1110
|
+
readonly name: "feeRecipient";
|
|
1097
1111
|
readonly indexed: true;
|
|
1098
1112
|
}];
|
|
1099
1113
|
}, {
|
|
@@ -1168,6 +1182,9 @@ declare const MorphoV2: readonly [{
|
|
|
1168
1182
|
}, {
|
|
1169
1183
|
readonly type: "bool";
|
|
1170
1184
|
readonly name: "sellerIsBorrower";
|
|
1185
|
+
}, {
|
|
1186
|
+
readonly type: "address";
|
|
1187
|
+
readonly name: "sellerReceiver";
|
|
1171
1188
|
}, {
|
|
1172
1189
|
readonly type: "bytes32";
|
|
1173
1190
|
readonly name: "group";
|
|
@@ -1181,7 +1198,6 @@ declare const MorphoV2: readonly [{
|
|
|
1181
1198
|
readonly inputs: readonly [{
|
|
1182
1199
|
readonly type: "address";
|
|
1183
1200
|
readonly name: "caller";
|
|
1184
|
-
readonly indexed: true;
|
|
1185
1201
|
}, {
|
|
1186
1202
|
readonly type: "bytes32";
|
|
1187
1203
|
readonly name: "id";
|
|
@@ -1196,6 +1212,10 @@ declare const MorphoV2: readonly [{
|
|
|
1196
1212
|
readonly type: "address";
|
|
1197
1213
|
readonly name: "onBehalf";
|
|
1198
1214
|
readonly indexed: true;
|
|
1215
|
+
}, {
|
|
1216
|
+
readonly type: "address";
|
|
1217
|
+
readonly name: "receiver";
|
|
1218
|
+
readonly indexed: true;
|
|
1199
1219
|
}];
|
|
1200
1220
|
}, {
|
|
1201
1221
|
readonly name: "WithdrawCollateral";
|
|
@@ -1218,6 +1238,9 @@ declare const MorphoV2: readonly [{
|
|
|
1218
1238
|
readonly type: "address";
|
|
1219
1239
|
readonly name: "onBehalf";
|
|
1220
1240
|
readonly indexed: true;
|
|
1241
|
+
}, {
|
|
1242
|
+
readonly type: "address";
|
|
1243
|
+
readonly name: "receiver";
|
|
1221
1244
|
}];
|
|
1222
1245
|
}];
|
|
1223
1246
|
type MorphoV2 = typeof MorphoV2;
|
|
@@ -1937,8 +1960,8 @@ type Offer = {
|
|
|
1937
1960
|
/** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
|
|
1938
1961
|
readonly assets: bigint; /** The max debt units to trade. Mutually exclusive with assets and obligationShares. */
|
|
1939
1962
|
readonly obligationUnits: bigint; /** The max lending shares to trade. Mutually exclusive with assets and obligationUnits. */
|
|
1940
|
-
readonly obligationShares: bigint; /** The
|
|
1941
|
-
readonly
|
|
1963
|
+
readonly obligationShares: bigint; /** The offer tick. */
|
|
1964
|
+
readonly tick: number; /** The date at which all interests will be paid. */
|
|
1942
1965
|
readonly maturity: Maturity; /** The date at which the offer will expire. */
|
|
1943
1966
|
readonly expiry: number; /** The date at which the offer will start. */
|
|
1944
1967
|
readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
|
|
@@ -1951,7 +1974,8 @@ type Offer = {
|
|
|
1951
1974
|
readonly callback: {
|
|
1952
1975
|
readonly address: Address;
|
|
1953
1976
|
readonly data: Hex;
|
|
1954
|
-
};
|
|
1977
|
+
}; /** Receiver of loan token proceeds when maker is seller on `take()`. */
|
|
1978
|
+
readonly receiverIfMakerIsSeller: Address;
|
|
1955
1979
|
};
|
|
1956
1980
|
declare enum Status {
|
|
1957
1981
|
VALID = "VALID",
|
|
@@ -1966,7 +1990,7 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1966
1990
|
assets: z$1.ZodBigInt;
|
|
1967
1991
|
obligationUnits: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1968
1992
|
obligationShares: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBigInt>>;
|
|
1969
|
-
|
|
1993
|
+
tick: z$1.ZodCoercedNumber<unknown>;
|
|
1970
1994
|
maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
|
|
1971
1995
|
expiry: z$1.ZodNumber;
|
|
1972
1996
|
start: z$1.ZodNumber;
|
|
@@ -1984,6 +2008,7 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1984
2008
|
address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1985
2009
|
data: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1986
2010
|
}, z$1.core.$strip>;
|
|
2011
|
+
receiverIfMakerIsSeller: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1987
2012
|
}, z$1.core.$strip>;
|
|
1988
2013
|
/**
|
|
1989
2014
|
* Input type for creating offers. Accepts flexible group types that will be coerced to Hex.
|
|
@@ -1996,12 +2021,13 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1996
2021
|
*
|
|
1997
2022
|
* All values validated to be non-negative and within bytes32 range.
|
|
1998
2023
|
*/
|
|
1999
|
-
type OfferInput = Compute<Omit<Offer, "chainId" | "group" | "session" | "obligationUnits" | "obligationShares"> & {
|
|
2024
|
+
type OfferInput = Compute<Omit<Offer, "chainId" | "group" | "session" | "obligationUnits" | "obligationShares" | "receiverIfMakerIsSeller"> & {
|
|
2000
2025
|
chainId: number;
|
|
2001
2026
|
group: Hex | bigint | number | string; /** Optional: defaults to zero bytes32. */
|
|
2002
2027
|
session?: Hex | bigint | number | string; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationShares. */
|
|
2003
2028
|
obligationUnits?: bigint; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationUnits. */
|
|
2004
|
-
obligationShares?: bigint;
|
|
2029
|
+
obligationShares?: bigint; /** Optional: defaults to maker for backward compatibility. */
|
|
2030
|
+
receiverIfMakerIsSeller?: Address;
|
|
2005
2031
|
}>;
|
|
2006
2032
|
/**
|
|
2007
2033
|
* Creates an offer from a plain object.
|
|
@@ -2019,9 +2045,9 @@ declare namespace from$10 {
|
|
|
2019
2045
|
* @param input - The offer to create.
|
|
2020
2046
|
* @returns The created offer.
|
|
2021
2047
|
*/
|
|
2022
|
-
declare function fromSnakeCase$1(input: Snake<Omit<Offer, "
|
|
2023
|
-
|
|
2024
|
-
|
|
2048
|
+
declare function fromSnakeCase$1(input: Snake<Omit<Offer, "session" | "receiverIfMakerIsSeller"> & {
|
|
2049
|
+
session?: Hex;
|
|
2050
|
+
receiverIfMakerIsSeller?: Address;
|
|
2025
2051
|
}>): Offer;
|
|
2026
2052
|
/**
|
|
2027
2053
|
* Converts an offer to a snake case object.
|
|
@@ -2041,7 +2067,7 @@ declare const serialize: (offer: Offer) => {
|
|
|
2041
2067
|
assets: string;
|
|
2042
2068
|
obligationUnits: string;
|
|
2043
2069
|
obligationShares: string;
|
|
2044
|
-
|
|
2070
|
+
tick: number;
|
|
2045
2071
|
maturity: number;
|
|
2046
2072
|
expiry: number;
|
|
2047
2073
|
start: number;
|
|
@@ -2059,6 +2085,7 @@ declare const serialize: (offer: Offer) => {
|
|
|
2059
2085
|
address: `0x${string}`;
|
|
2060
2086
|
data: `0x${string}`;
|
|
2061
2087
|
};
|
|
2088
|
+
receiverIfMakerIsSeller: `0x${string}`;
|
|
2062
2089
|
hash: `0x${string}`;
|
|
2063
2090
|
};
|
|
2064
2091
|
type RandomConfig = {
|
|
@@ -2076,11 +2103,12 @@ type RandomConfig = {
|
|
|
2076
2103
|
expiry?: number;
|
|
2077
2104
|
group?: Hex | bigint | number | string;
|
|
2078
2105
|
session?: Hex | bigint | number | string;
|
|
2079
|
-
|
|
2106
|
+
tick?: number;
|
|
2080
2107
|
callback?: {
|
|
2081
2108
|
address: Address;
|
|
2082
2109
|
data: Hex;
|
|
2083
2110
|
};
|
|
2111
|
+
receiverIfMakerIsSeller?: Address;
|
|
2084
2112
|
collaterals?: readonly Collateral[];
|
|
2085
2113
|
};
|
|
2086
2114
|
/**
|
|
@@ -2125,7 +2153,7 @@ declare const types: {
|
|
|
2125
2153
|
readonly name: "obligationShares";
|
|
2126
2154
|
readonly type: "uint256";
|
|
2127
2155
|
}, {
|
|
2128
|
-
readonly name: "
|
|
2156
|
+
readonly name: "tick";
|
|
2129
2157
|
readonly type: "uint256";
|
|
2130
2158
|
}, {
|
|
2131
2159
|
readonly name: "maturity";
|
|
@@ -2151,6 +2179,9 @@ declare const types: {
|
|
|
2151
2179
|
}, {
|
|
2152
2180
|
readonly name: "callback";
|
|
2153
2181
|
readonly type: "Callback";
|
|
2182
|
+
}, {
|
|
2183
|
+
readonly name: "receiverIfMakerIsSeller";
|
|
2184
|
+
readonly type: "address";
|
|
2154
2185
|
}];
|
|
2155
2186
|
readonly Collateral: readonly [{
|
|
2156
2187
|
readonly name: "asset";
|
|
@@ -2249,6 +2280,11 @@ declare const takeEvent: {
|
|
|
2249
2280
|
readonly type: "bool";
|
|
2250
2281
|
readonly indexed: false;
|
|
2251
2282
|
readonly internalType: "bool";
|
|
2283
|
+
}, {
|
|
2284
|
+
readonly name: "sellerReceiver";
|
|
2285
|
+
readonly type: "address";
|
|
2286
|
+
readonly indexed: false;
|
|
2287
|
+
readonly internalType: "address";
|
|
2252
2288
|
}, {
|
|
2253
2289
|
readonly name: "group";
|
|
2254
2290
|
readonly type: "bytes32";
|
|
@@ -2452,26 +2488,26 @@ declare namespace from$8 {
|
|
|
2452
2488
|
type ReturnType = Position;
|
|
2453
2489
|
}
|
|
2454
2490
|
declare namespace Quote_d_exports {
|
|
2455
|
-
export { InvalidQuoteError, Quote,
|
|
2491
|
+
export { InvalidQuoteError, Quote, QuoteInput, Side, from$7 as from, fromSnakeCase, random };
|
|
2456
2492
|
}
|
|
2457
|
-
type
|
|
2493
|
+
type Side = {
|
|
2494
|
+
/** The best side tick, or null when no active quote exists. */tick: number | null; /** The side price for the obligation. (18 decimals). */
|
|
2495
|
+
price: bigint;
|
|
2496
|
+
};
|
|
2497
|
+
type QuoteInput = {
|
|
2458
2498
|
/** The obligation id. */obligationId: Hex;
|
|
2459
2499
|
ask: {
|
|
2460
|
-
/** The ask
|
|
2500
|
+
/** The best ask tick, or null when there is no active ask quote. */tick: number | null;
|
|
2461
2501
|
};
|
|
2462
2502
|
bid: {
|
|
2463
|
-
/** The bid
|
|
2503
|
+
/** The best bid tick, or null when there is no active bid quote. */tick: number | null;
|
|
2464
2504
|
};
|
|
2465
2505
|
};
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
ask:
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
bid: z$1.ZodObject<{
|
|
2472
|
-
price: z$1.ZodBigInt;
|
|
2473
|
-
}, z$1.core.$strip>;
|
|
2474
|
-
}, z$1.core.$strip>;
|
|
2506
|
+
type Quote = {
|
|
2507
|
+
/** The obligation id. */obligationId: Hex;
|
|
2508
|
+
ask: Side;
|
|
2509
|
+
bid: Side;
|
|
2510
|
+
};
|
|
2475
2511
|
/**
|
|
2476
2512
|
* Creates a quote for a given obligation.
|
|
2477
2513
|
* @constructor
|
|
@@ -2481,12 +2517,12 @@ declare const QuoteSchema: z$1.ZodObject<{
|
|
|
2481
2517
|
*
|
|
2482
2518
|
* @example
|
|
2483
2519
|
* ```ts
|
|
2484
|
-
* const quote = Quote.from({ obligationId: "0x123", ask: {
|
|
2520
|
+
* const quote = Quote.from({ obligationId: "0x123", ask: { tick: 500 }, bid: { tick: 510 } });
|
|
2485
2521
|
* ```
|
|
2486
2522
|
*/
|
|
2487
2523
|
declare function from$7(parameters: from$7.Parameters): from$7.ReturnType;
|
|
2488
2524
|
declare namespace from$7 {
|
|
2489
|
-
type Parameters =
|
|
2525
|
+
type Parameters = QuoteInput;
|
|
2490
2526
|
type ReturnType = Quote;
|
|
2491
2527
|
type ErrorType = InvalidQuoteError;
|
|
2492
2528
|
}
|
|
@@ -2498,7 +2534,7 @@ declare namespace from$7 {
|
|
|
2498
2534
|
*/
|
|
2499
2535
|
declare function fromSnakeCase(snake: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
2500
2536
|
declare namespace fromSnakeCase {
|
|
2501
|
-
type Parameters = Snake<
|
|
2537
|
+
type Parameters = Snake<QuoteInput>;
|
|
2502
2538
|
type ReturnType = Quote;
|
|
2503
2539
|
type ErrorType = from$7.ErrorType;
|
|
2504
2540
|
}
|
|
@@ -2521,6 +2557,41 @@ declare class InvalidQuoteError extends BaseError<z$1.ZodError | Error> {
|
|
|
2521
2557
|
readonly name = "Quote.InvalidQuoteError";
|
|
2522
2558
|
constructor(error: z$1.ZodError | Error);
|
|
2523
2559
|
}
|
|
2560
|
+
declare namespace Tick_d_exports {
|
|
2561
|
+
export { InvalidPriceError, InvalidTickError, MAX_PRICE, TICK_RANGE, priceToTick, tickToPrice };
|
|
2562
|
+
}
|
|
2563
|
+
/** Tick domain supported by Morpho V2. */
|
|
2564
|
+
declare const TICK_RANGE = 990;
|
|
2565
|
+
/** Max allowed price (1e18 in wad). */
|
|
2566
|
+
declare const MAX_PRICE: bigint;
|
|
2567
|
+
/**
|
|
2568
|
+
* Converts a tick to a wad price using the same approximation and rounding as TickLib.
|
|
2569
|
+
* @param tick - Tick value in the inclusive range [0, 990].
|
|
2570
|
+
* @returns The price in wad units.
|
|
2571
|
+
* @throws {@link InvalidTickError} If tick is not an integer in range [0, 990].
|
|
2572
|
+
*/
|
|
2573
|
+
declare function tickToPrice(tick: number): bigint;
|
|
2574
|
+
declare namespace tickToPrice {
|
|
2575
|
+
type ErrorType = InvalidTickError;
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* Returns the lowest tick with a higher-or-equal price.
|
|
2579
|
+
* @param price - Price in wad units.
|
|
2580
|
+
* @returns The first tick whose {@link tickToPrice} is greater than or equal to `price`.
|
|
2581
|
+
* @throws {@link InvalidPriceError} If price is outside [0, 1e18].
|
|
2582
|
+
*/
|
|
2583
|
+
declare function priceToTick(price: bigint): number;
|
|
2584
|
+
declare namespace priceToTick {
|
|
2585
|
+
type ErrorType = InvalidPriceError;
|
|
2586
|
+
}
|
|
2587
|
+
declare class InvalidTickError extends BaseError {
|
|
2588
|
+
readonly name = "Tick.InvalidTickError";
|
|
2589
|
+
constructor(tick: number);
|
|
2590
|
+
}
|
|
2591
|
+
declare class InvalidPriceError extends BaseError {
|
|
2592
|
+
readonly name = "Tick.InvalidPriceError";
|
|
2593
|
+
constructor(price: bigint);
|
|
2594
|
+
}
|
|
2524
2595
|
declare namespace TradingFee_d_exports {
|
|
2525
2596
|
export { BREAKPOINTS, Fees, InvalidFeeError, InvalidFeesLengthError, TradingFee, WAD, activate, compute, deactivate, from$6 as from, getFees, isActivated };
|
|
2526
2597
|
}
|
|
@@ -2837,13 +2908,13 @@ interface paths {
|
|
|
2837
2908
|
};
|
|
2838
2909
|
/**
|
|
2839
2910
|
* Get aggregated book
|
|
2840
|
-
* @description Returns aggregated book data for a given obligation and side. Offers are grouped by
|
|
2911
|
+
* @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).
|
|
2841
2912
|
*/
|
|
2842
2913
|
get: {
|
|
2843
2914
|
parameters: {
|
|
2844
2915
|
query?: {
|
|
2845
2916
|
/**
|
|
2846
|
-
* @description Maximum number of
|
|
2917
|
+
* @description Maximum number of tick levels to return.
|
|
2847
2918
|
* @example 10
|
|
2848
2919
|
*/
|
|
2849
2920
|
limit?: number;
|
|
@@ -2959,7 +3030,7 @@ interface paths {
|
|
|
2959
3030
|
};
|
|
2960
3031
|
/**
|
|
2961
3032
|
* Get config rules
|
|
2962
|
-
* @description Returns configured rules (maturities, loan tokens, oracles) for supported chains.
|
|
3033
|
+
* @description Returns configured rules (maturities, loan tokens, collateral tokens, oracles) for supported chains.
|
|
2963
3034
|
*/
|
|
2964
3035
|
get: {
|
|
2965
3036
|
parameters: {
|
|
@@ -2971,7 +3042,7 @@ interface paths {
|
|
|
2971
3042
|
chains?: number[];
|
|
2972
3043
|
/**
|
|
2973
3044
|
* @description Filter by rule types (comma-separated).
|
|
2974
|
-
* @example maturity,loan_token,oracle
|
|
3045
|
+
* @example maturity,loan_token,collateral_token,oracle
|
|
2975
3046
|
*/
|
|
2976
3047
|
types?: string[];
|
|
2977
3048
|
/**
|
|
@@ -3090,11 +3161,16 @@ interface paths {
|
|
|
3090
3161
|
};
|
|
3091
3162
|
/**
|
|
3092
3163
|
* List all obligations
|
|
3093
|
-
* @description Returns a list of obligations with their current best ask and bid.
|
|
3164
|
+
* @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.
|
|
3094
3165
|
*/
|
|
3095
3166
|
get: {
|
|
3096
3167
|
parameters: {
|
|
3097
3168
|
query?: {
|
|
3169
|
+
/**
|
|
3170
|
+
* @description Sort order as comma-separated fields (`id`, `ask`, `bid`, `maturity`). Prefix with `-` for descending order. Max 3 fields.
|
|
3171
|
+
* @example -ask,bid,maturity
|
|
3172
|
+
*/
|
|
3173
|
+
sort?: string;
|
|
3098
3174
|
/**
|
|
3099
3175
|
* @description Filter by exact maturity timestamps (comma-separated, unix seconds).
|
|
3100
3176
|
* @example 1761922800,1764524800
|
|
@@ -3121,8 +3197,8 @@ interface paths {
|
|
|
3121
3197
|
*/
|
|
3122
3198
|
limit?: number;
|
|
3123
3199
|
/**
|
|
3124
|
-
* @description
|
|
3125
|
-
* @example
|
|
3200
|
+
* @description Pagination cursor in base64url-encoded format.
|
|
3201
|
+
* @example eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAiLCJhc2siOiIwIiwiYmlkIjoiMCIsIm1hdHVyaXR5IjoxNzYxOTIyODAwfQ
|
|
3126
3202
|
*/
|
|
3127
3203
|
cursor?: string;
|
|
3128
3204
|
};
|
|
@@ -3351,7 +3427,7 @@ interface paths {
|
|
|
3351
3427
|
};
|
|
3352
3428
|
/**
|
|
3353
3429
|
* Get user positions
|
|
3354
|
-
* @description Returns positions for a user with reserved balance.
|
|
3430
|
+
* @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.
|
|
3355
3431
|
*/
|
|
3356
3432
|
get: {
|
|
3357
3433
|
parameters: {
|
|
@@ -3460,14 +3536,19 @@ interface components {
|
|
|
3460
3536
|
schemas: {
|
|
3461
3537
|
BookListResponse: {
|
|
3462
3538
|
meta: components["schemas"]["Meta"]; /** @example eyJvZmZzZXQiOjEwMH0 */
|
|
3463
|
-
cursor: string | null; /** @description Aggregated book levels grouped by
|
|
3539
|
+
cursor: string | null; /** @description Aggregated book levels grouped by offer tick. */
|
|
3464
3540
|
data: components["schemas"]["BookLevelResponse"][];
|
|
3465
3541
|
};
|
|
3466
3542
|
Meta: {
|
|
3467
3543
|
/** @example 2024-01-01T12:00:00.000Z */timestamp: string;
|
|
3468
3544
|
};
|
|
3469
3545
|
BookLevelResponse: {
|
|
3470
|
-
/** @example
|
|
3546
|
+
/** @example 495 */tick: number;
|
|
3547
|
+
/**
|
|
3548
|
+
* @description Price derived from tick, scaled by 1e18.
|
|
3549
|
+
* @example 500000000000000000
|
|
3550
|
+
*/
|
|
3551
|
+
price: string; /** @example 369216000000000000000000 */
|
|
3471
3552
|
assets: string; /** @example 5 */
|
|
3472
3553
|
count: number;
|
|
3473
3554
|
};
|
|
@@ -3544,6 +3625,11 @@ interface components {
|
|
|
3544
3625
|
* "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
3545
3626
|
* },
|
|
3546
3627
|
* {
|
|
3628
|
+
* "type": "collateral_token",
|
|
3629
|
+
* "chain_id": 1,
|
|
3630
|
+
* "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
3631
|
+
* },
|
|
3632
|
+
* {
|
|
3547
3633
|
* "type": "oracle",
|
|
3548
3634
|
* "chain_id": 1,
|
|
3549
3635
|
* "address": "0xDddd770BADd886dF3864029e4B377B5F6a2B6b83"
|
|
@@ -3593,11 +3679,12 @@ interface components {
|
|
|
3593
3679
|
* "obligation_shares": "0",
|
|
3594
3680
|
* "start": 1761922790,
|
|
3595
3681
|
* "expiry": 1761922799,
|
|
3596
|
-
* "
|
|
3682
|
+
* "tick": 495,
|
|
3597
3683
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
3598
3684
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3599
3685
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
3600
|
-
* "callback_data": "0x"
|
|
3686
|
+
* "callback_data": "0x",
|
|
3687
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
3601
3688
|
* },
|
|
3602
3689
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
3603
3690
|
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc",
|
|
@@ -3637,11 +3724,12 @@ interface components {
|
|
|
3637
3724
|
* "obligation_shares": "0",
|
|
3638
3725
|
* "start": 1761922790,
|
|
3639
3726
|
* "expiry": 1761922799,
|
|
3640
|
-
* "
|
|
3727
|
+
* "tick": 495,
|
|
3641
3728
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
3642
3729
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3643
3730
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
3644
|
-
* "callback_data": "0x"
|
|
3731
|
+
* "callback_data": "0x",
|
|
3732
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
3645
3733
|
* }
|
|
3646
3734
|
*/
|
|
3647
3735
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
@@ -3682,12 +3770,13 @@ interface components {
|
|
|
3682
3770
|
obligation_units: string; /** @example 0 */
|
|
3683
3771
|
obligation_shares: string; /** @example 1761922790 */
|
|
3684
3772
|
start: number; /** @example 1761922799 */
|
|
3685
|
-
expiry: number; /** @example
|
|
3686
|
-
|
|
3773
|
+
expiry: number; /** @example 495 */
|
|
3774
|
+
tick: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
3687
3775
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
3688
3776
|
session: string; /** @example 0x0000000000000000000000000000000000000000 */
|
|
3689
3777
|
callback: string; /** @example 0x */
|
|
3690
|
-
callback_data: string;
|
|
3778
|
+
callback_data: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3779
|
+
receiver_if_maker_is_seller: string;
|
|
3691
3780
|
};
|
|
3692
3781
|
ObligationOfferResponse: {
|
|
3693
3782
|
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */loan_token: string;
|
|
@@ -3709,7 +3798,7 @@ interface components {
|
|
|
3709
3798
|
oracle: string;
|
|
3710
3799
|
};
|
|
3711
3800
|
ObligationListResponse: {
|
|
3712
|
-
meta: components["schemas"]["Meta"]; /** @example
|
|
3801
|
+
meta: components["schemas"]["Meta"]; /** @example eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAiLCJhc2siOiIwIiwiYmlkIjoiMCIsIm1hdHVyaXR5IjoxNzYxOTIyODAwfQ */
|
|
3713
3802
|
cursor: string | null; /** @description List of obligations with takable offers. */
|
|
3714
3803
|
data: components["schemas"]["ObligationResponse"][];
|
|
3715
3804
|
};
|
|
@@ -3723,10 +3812,20 @@ interface components {
|
|
|
3723
3812
|
bid: components["schemas"]["BidResponse"];
|
|
3724
3813
|
};
|
|
3725
3814
|
AskResponse: {
|
|
3726
|
-
/**
|
|
3815
|
+
/**
|
|
3816
|
+
* @description Best ask tick. Null when there is no active ask quote.
|
|
3817
|
+
* @example 500
|
|
3818
|
+
*/
|
|
3819
|
+
tick: number | null; /** @example 1000000000000000000 */
|
|
3820
|
+
price: string;
|
|
3727
3821
|
};
|
|
3728
3822
|
BidResponse: {
|
|
3729
|
-
/**
|
|
3823
|
+
/**
|
|
3824
|
+
* @description Best bid tick. Null when there is no active bid quote.
|
|
3825
|
+
* @example 500
|
|
3826
|
+
*/
|
|
3827
|
+
tick: number | null; /** @example 1000000000000000000 */
|
|
3828
|
+
price: string;
|
|
3730
3829
|
};
|
|
3731
3830
|
ObligationSingleSuccessResponse: {
|
|
3732
3831
|
meta: components["schemas"]["Meta"]; /** @example null */
|
|
@@ -3832,6 +3931,7 @@ interface components {
|
|
|
3832
3931
|
* "chain_id": 1,
|
|
3833
3932
|
* "contract": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
|
|
3834
3933
|
* "user": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
|
|
3934
|
+
* "obligation_id": "0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
|
|
3835
3935
|
* "reserved": "200000000000000000000",
|
|
3836
3936
|
* "block_number": 21345678
|
|
3837
3937
|
* }
|
|
@@ -3842,7 +3942,12 @@ interface components {
|
|
|
3842
3942
|
PositionListItemResponse: {
|
|
3843
3943
|
/** @example 1 */chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
3844
3944
|
contract: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3845
|
-
user: string;
|
|
3945
|
+
user: string;
|
|
3946
|
+
/**
|
|
3947
|
+
* @description Obligation id this reserved amount belongs to, or null if no lots exist.
|
|
3948
|
+
* @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67
|
|
3949
|
+
*/
|
|
3950
|
+
obligation_id: string | null; /** @example 200000000000000000000 */
|
|
3846
3951
|
reserved: string; /** @example 21345678 */
|
|
3847
3952
|
block_number: number;
|
|
3848
3953
|
};
|
|
@@ -3853,8 +3958,8 @@ interface components {
|
|
|
3853
3958
|
/** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
|
|
3854
3959
|
assets: string; /** @example 0 */
|
|
3855
3960
|
obligation_units?: string; /** @example 0 */
|
|
3856
|
-
obligation_shares?: string; /** @example
|
|
3857
|
-
|
|
3961
|
+
obligation_shares?: string; /** @example 495 */
|
|
3962
|
+
tick: number; /** @example 1761922799 */
|
|
3858
3963
|
maturity: number; /** @example 1761922799 */
|
|
3859
3964
|
expiry: number; /** @example 1761922790 */
|
|
3860
3965
|
start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
@@ -3879,7 +3984,8 @@ interface components {
|
|
|
3879
3984
|
* "data": "0x"
|
|
3880
3985
|
* }
|
|
3881
3986
|
*/
|
|
3882
|
-
callback: components["schemas"]["ValidateCallbackRequest"];
|
|
3987
|
+
callback: components["schemas"]["ValidateCallbackRequest"]; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3988
|
+
receiver_if_maker_is_seller: string;
|
|
3883
3989
|
};
|
|
3884
3990
|
ValidateCollateralRequest: {
|
|
3885
3991
|
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */asset: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
@@ -3922,6 +4028,7 @@ type ObligationResponse = paths["/v1/obligations"]["get"]["responses"]["200"]["c
|
|
|
3922
4028
|
* Creates an `ObligationResponse` from a `Obligation`.
|
|
3923
4029
|
* @constructor
|
|
3924
4030
|
* @param obligation - {@link Obligation}
|
|
4031
|
+
* @param quote - {@link Quote}
|
|
3925
4032
|
* @returns The created `ObligationResponse`. {@link ObligationResponse}
|
|
3926
4033
|
*/
|
|
3927
4034
|
declare function from$3(obligation: Obligation, quote: Quote): ObligationResponse;
|
|
@@ -3935,7 +4042,7 @@ type Input = Readonly<{
|
|
|
3935
4042
|
assets: bigint;
|
|
3936
4043
|
obligationUnits: bigint;
|
|
3937
4044
|
obligationShares: bigint;
|
|
3938
|
-
|
|
4045
|
+
tick: number;
|
|
3939
4046
|
maturity: number;
|
|
3940
4047
|
expiry: number;
|
|
3941
4048
|
start: number;
|
|
@@ -3953,6 +4060,7 @@ type Input = Readonly<{
|
|
|
3953
4060
|
address: Address;
|
|
3954
4061
|
data: Hex;
|
|
3955
4062
|
};
|
|
4063
|
+
receiverIfMakerIsSeller: Address;
|
|
3956
4064
|
root?: Hex | undefined;
|
|
3957
4065
|
proof?: Hex[] | undefined;
|
|
3958
4066
|
signature?: Hex | undefined;
|
|
@@ -4011,7 +4119,8 @@ declare namespace getByUser {
|
|
|
4011
4119
|
chainId: Id;
|
|
4012
4120
|
contract: Address;
|
|
4013
4121
|
user: Address;
|
|
4014
|
-
blockNumber: number; /** The
|
|
4122
|
+
blockNumber: number; /** The obligation this reserved amount belongs to, or null if no lots exist */
|
|
4123
|
+
obligationId: string | null; /** The amount reserved by active offers: max(lot.upper) - offset - consumed */
|
|
4015
4124
|
reserved: bigint;
|
|
4016
4125
|
};
|
|
4017
4126
|
type ReturnType = {
|
|
@@ -4026,6 +4135,7 @@ type PositionResponse = {
|
|
|
4026
4135
|
chain_id: Id;
|
|
4027
4136
|
contract: Address;
|
|
4028
4137
|
user: Address;
|
|
4138
|
+
obligation_id: string | null;
|
|
4029
4139
|
reserved: string;
|
|
4030
4140
|
block_number: number;
|
|
4031
4141
|
};
|
|
@@ -4075,6 +4185,7 @@ declare const schemas: {
|
|
|
4075
4185
|
maturity: "maturity";
|
|
4076
4186
|
callback: "callback";
|
|
4077
4187
|
loan_token: "loan_token";
|
|
4188
|
+
collateral_token: "collateral_token";
|
|
4078
4189
|
oracle: "oracle";
|
|
4079
4190
|
}>>>>;
|
|
4080
4191
|
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>>>>>;
|
|
@@ -4107,6 +4218,7 @@ declare const schemas: {
|
|
|
4107
4218
|
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>>>>>;
|
|
4108
4219
|
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>>>>>;
|
|
4109
4220
|
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>>>>>;
|
|
4221
|
+
sort: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodString>>>;
|
|
4110
4222
|
limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodPipe<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>, z$1.ZodNumber>>>;
|
|
4111
4223
|
}, z$1.core.$strip>;
|
|
4112
4224
|
readonly get_obligation: z$1.ZodObject<{
|
|
@@ -4223,13 +4335,16 @@ declare namespace getOffers {
|
|
|
4223
4335
|
}
|
|
4224
4336
|
declare function getObligations(apiClient: Client<paths>, parameters?: getObligations.Parameters): Promise<getObligations.ReturnType>;
|
|
4225
4337
|
declare namespace getObligations {
|
|
4338
|
+
type SortField = "id" | "ask" | "bid" | "maturity";
|
|
4339
|
+
type SortEntry = SortField | `-${SortField}`;
|
|
4226
4340
|
type Parameters = {
|
|
4227
|
-
/** Pagination cursor
|
|
4341
|
+
/** Pagination cursor in base64url-encoded format. */cursor?: string; /** Maximum number of obligations to return. @default 20 */
|
|
4228
4342
|
limit?: number; /** Filter by chain IDs (comma-separated). */
|
|
4229
4343
|
chainIds?: number[]; /** Filter by loan token addresses (comma-separated). */
|
|
4230
4344
|
loanTokens?: Address[]; /** Filter by collateral tokens (comma-separated, matches any collateral). */
|
|
4231
4345
|
collateralTokens?: Address[]; /** Filter by exact maturity timestamps (comma-separated, unix seconds). */
|
|
4232
|
-
maturities?: number[];
|
|
4346
|
+
maturities?: number[]; /** Sort order entries in priority order. Prefix with '-' for descending. Max 3 fields. */
|
|
4347
|
+
sort?: SortEntry[];
|
|
4233
4348
|
};
|
|
4234
4349
|
type ReturnType = {
|
|
4235
4350
|
obligations: Compute<{
|
|
@@ -4348,6 +4463,10 @@ type ConfigRule = {
|
|
|
4348
4463
|
type: "loan_token";
|
|
4349
4464
|
chain_id: Id;
|
|
4350
4465
|
address: Address;
|
|
4466
|
+
} | {
|
|
4467
|
+
type: "collateral_token";
|
|
4468
|
+
chain_id: Id;
|
|
4469
|
+
address: Address;
|
|
4351
4470
|
} | {
|
|
4352
4471
|
type: "oracle";
|
|
4353
4472
|
chain_id: Id;
|
|
@@ -4435,9 +4554,9 @@ type GatekeeperParameters = {
|
|
|
4435
4554
|
declare function create(parameters: GatekeeperParameters): Gatekeeper;
|
|
4436
4555
|
//#endregion
|
|
4437
4556
|
//#region src/gatekeeper/morphoRules.d.ts
|
|
4438
|
-
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, "
|
|
4557
|
+
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">)[];
|
|
4439
4558
|
declare namespace Rules_d_exports {
|
|
4440
|
-
export { ValidityParameters, amountMutualExclusivity, callback, chains, maturity, oracle, sameMaker,
|
|
4559
|
+
export { ValidityParameters, amountMutualExclusivity, callback, chains, collateralToken, loanToken, maturity, oracle, sameMaker, validity };
|
|
4441
4560
|
}
|
|
4442
4561
|
type ValidityParameters = {
|
|
4443
4562
|
client: PublicClient<Transport, Chain$1>;
|
|
@@ -4466,15 +4585,25 @@ declare const callback: ({
|
|
|
4466
4585
|
allowedAddresses: Address[];
|
|
4467
4586
|
}) => Rule<Offer, "callback">;
|
|
4468
4587
|
/**
|
|
4469
|
-
* A validation rule that checks if the offer's
|
|
4470
|
-
* @param assetsByChainId - Allowed
|
|
4588
|
+
* A validation rule that checks if the offer's loan token is allowed for its chain.
|
|
4589
|
+
* @param assetsByChainId - Allowed loan tokens indexed by chain id.
|
|
4471
4590
|
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
4472
4591
|
*/
|
|
4473
|
-
declare const
|
|
4592
|
+
declare const loanToken: ({
|
|
4474
4593
|
assetsByChainId
|
|
4475
4594
|
}: {
|
|
4476
4595
|
assetsByChainId: Partial<Record<Id, Address[]>>;
|
|
4477
|
-
}) => Rule<Offer, "
|
|
4596
|
+
}) => Rule<Offer, "loan_token">;
|
|
4597
|
+
/**
|
|
4598
|
+
* A validation rule that checks if the offer's collateral tokens are allowed for its chain.
|
|
4599
|
+
* @param collateralAssetsByChainId - Allowed collateral tokens indexed by chain id.
|
|
4600
|
+
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
4601
|
+
*/
|
|
4602
|
+
declare const collateralToken: ({
|
|
4603
|
+
collateralAssetsByChainId
|
|
4604
|
+
}: {
|
|
4605
|
+
collateralAssetsByChainId: Partial<Record<Id, Address[]>>;
|
|
4606
|
+
}) => Rule<Offer, "collateral_token">;
|
|
4478
4607
|
/**
|
|
4479
4608
|
* A validation rule that checks if the offer's oracle addresses are allowed for its chain.
|
|
4480
4609
|
* @param oraclesByChainId - Allowed oracles indexed by chain id.
|
|
@@ -4689,5 +4818,5 @@ declare namespace index_d_exports$2 {
|
|
|
4689
4818
|
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 };
|
|
4690
4819
|
}
|
|
4691
4820
|
//#endregion
|
|
4692
|
-
export { index_d_exports as Abi, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainRegistry_d_exports as ChainRegistry, Collateral_d_exports as Collateral, Compute, ConfigRule, ConfigRulesPayload, ERC4626_d_exports as ERC4626, ErrorPayload, Errors_d_exports as Errors, Format_d_exports as Format, Gatekeeper_d_exports as Gatekeeper, Client_d_exports as GatekeeperClient, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Maturity_d_exports as Maturity, MempoolClient_d_exports as Mempool, Obligation_d_exports as Obligation, Offer_d_exports as Offer, Oracle_d_exports as Oracle, Position_d_exports as Position, Quote_d_exports as Quote, index_d_exports$1 as RouterApi, Client_d_exports$1 as RouterClient, Rules_d_exports as Rules, SuccessPayload, time_d_exports as Time, TradingFee_d_exports as TradingFee, Transfer_d_exports as Transfer, Tree_d_exports as Tree, index_d_exports$2 as Utils, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules };
|
|
4821
|
+
export { index_d_exports as Abi, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainRegistry_d_exports as ChainRegistry, Collateral_d_exports as Collateral, Compute, ConfigRule, ConfigRulesPayload, ERC4626_d_exports as ERC4626, ErrorPayload, Errors_d_exports as Errors, Format_d_exports as Format, Gatekeeper_d_exports as Gatekeeper, Client_d_exports as GatekeeperClient, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Maturity_d_exports as Maturity, MempoolClient_d_exports as Mempool, Obligation_d_exports as Obligation, Offer_d_exports as Offer, Oracle_d_exports as Oracle, Position_d_exports as Position, Quote_d_exports as Quote, index_d_exports$1 as RouterApi, Client_d_exports$1 as RouterClient, Rules_d_exports as Rules, SuccessPayload, Tick_d_exports as Tick, time_d_exports as Time, TradingFee_d_exports as TradingFee, Transfer_d_exports as Transfer, Tree_d_exports as Tree, index_d_exports$2 as Utils, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules };
|
|
4693
4822
|
//# sourceMappingURL=index.browser.d.ts.map
|