@morpho-dev/router 0.0.18 → 0.0.20
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/index.browser.d.cts +19 -19
- package/dist/index.browser.d.ts +19 -19
- package/dist/index.browser.js +186 -114
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +187 -115
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.cts +31 -31
- package/dist/index.node.d.ts +31 -31
- package/dist/index.node.js +186 -114
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +188 -116
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.node.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _morpho_dev_mempool from '@morpho-dev/mempool';
|
|
2
|
-
import { Compute, Offer, Errors, Format } from '@morpho-dev/mempool';
|
|
2
|
+
import { Compute, Offer, Errors, Format, Maturity, LLTV } from '@morpho-dev/mempool';
|
|
3
3
|
export * from '@morpho-dev/mempool';
|
|
4
4
|
import * as viem from 'viem';
|
|
5
5
|
import { Address, Hex, Account, PublicClient } from 'viem';
|
|
@@ -54,19 +54,19 @@ declare const schemas: {
|
|
|
54
54
|
max_amount: z.ZodOptional<z.ZodBigInt>;
|
|
55
55
|
min_rate: z.ZodOptional<z.ZodBigInt>;
|
|
56
56
|
max_rate: z.ZodOptional<z.ZodBigInt>;
|
|
57
|
-
min_maturity: z.
|
|
58
|
-
max_maturity: z.
|
|
59
|
-
min_expiry: z.
|
|
60
|
-
max_expiry: z.
|
|
57
|
+
min_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
58
|
+
max_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
59
|
+
min_expiry: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
60
|
+
max_expiry: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
61
61
|
collateral_assets: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
|
|
62
62
|
collateral_oracles: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
|
|
63
63
|
collateral_tuple: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
64
64
|
asset: string;
|
|
65
65
|
oracle: string | undefined;
|
|
66
|
-
lltv:
|
|
66
|
+
lltv: (bigint & _morpho_dev_mempool.Brand<"LLTV">) | undefined;
|
|
67
67
|
}[], string>>>;
|
|
68
|
-
min_lltv: z.ZodOptional<z.ZodPipe<z.
|
|
69
|
-
max_lltv: z.ZodOptional<z.ZodPipe<z.
|
|
68
|
+
min_lltv: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<bigint & _morpho_dev_mempool.Brand<"LLTV">, number>>>;
|
|
69
|
+
max_lltv: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<bigint & _morpho_dev_mempool.Brand<"LLTV">, number>>>;
|
|
70
70
|
sort_by: z.ZodOptional<z.ZodEnum<{
|
|
71
71
|
rate: "rate";
|
|
72
72
|
maturity: "maturity";
|
|
@@ -90,11 +90,11 @@ declare const schemas: {
|
|
|
90
90
|
collaterals: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
91
91
|
asset: string;
|
|
92
92
|
oracle: string;
|
|
93
|
-
lltv: bigint
|
|
93
|
+
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
94
94
|
}[], string>>>;
|
|
95
|
-
maturity: z.
|
|
96
|
-
min_maturity: z.
|
|
97
|
-
max_maturity: z.
|
|
95
|
+
maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
96
|
+
min_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
97
|
+
max_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
98
98
|
loan_token: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
99
99
|
creator: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
100
100
|
status: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<("valid" | "callback_not_supported" | "callback_error" | "unverified")[], string>>>;
|
|
@@ -104,7 +104,7 @@ declare const schemas: {
|
|
|
104
104
|
};
|
|
105
105
|
type Action = keyof typeof schemas;
|
|
106
106
|
declare function parse<A extends Action>(action: A, query: unknown): z.infer<(typeof schemas)[A]>;
|
|
107
|
-
declare function safeParse<A extends Action>(action: A, query: unknown): z.ZodSafeParseResult<z.infer<(typeof schemas)[A]>>;
|
|
107
|
+
declare function safeParse<A extends Action>(action: A, query: unknown, error?: z.core.$ZodErrorMap<z.core.$ZodIssue>): z.ZodSafeParseResult<z.infer<(typeof schemas)[A]>>;
|
|
108
108
|
|
|
109
109
|
declare const OfferStatusValues: readonly ["valid", "callback_not_supported", "callback_error", "unverified"];
|
|
110
110
|
type OfferStatus = (typeof OfferStatusValues)[number];
|
|
@@ -250,9 +250,9 @@ type GetParameters = {
|
|
|
250
250
|
/** Maximum rate per asset (in wei) */
|
|
251
251
|
maxRate?: bigint;
|
|
252
252
|
/** Minimum maturity timestamp (Unix timestamp in seconds) */
|
|
253
|
-
minMaturity?:
|
|
253
|
+
minMaturity?: Maturity.Maturity;
|
|
254
254
|
/** Maximum maturity timestamp (Unix timestamp in seconds) */
|
|
255
|
-
maxMaturity?:
|
|
255
|
+
maxMaturity?: Maturity.Maturity;
|
|
256
256
|
/** Minimum expiry timestamp (Unix timestamp in seconds) */
|
|
257
257
|
minExpiry?: number;
|
|
258
258
|
/** Maximum expiry timestamp (Unix timestamp in seconds) */
|
|
@@ -265,12 +265,12 @@ type GetParameters = {
|
|
|
265
265
|
collateralTuple?: Array<{
|
|
266
266
|
asset: string;
|
|
267
267
|
oracle?: string;
|
|
268
|
-
lltv?:
|
|
268
|
+
lltv?: LLTV.LLTV;
|
|
269
269
|
}>;
|
|
270
270
|
/** Minimum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
271
|
-
minLltv?:
|
|
271
|
+
minLltv?: LLTV.LLTV;
|
|
272
272
|
/** Maximum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
273
|
-
maxLltv?:
|
|
273
|
+
maxLltv?: LLTV.LLTV;
|
|
274
274
|
/** Field to sort results by */
|
|
275
275
|
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
276
276
|
/** Sort direction: asc (ascending) or desc (descending, default) */
|
|
@@ -291,14 +291,14 @@ type MatchParameters = {
|
|
|
291
291
|
collaterals?: Array<{
|
|
292
292
|
asset: string;
|
|
293
293
|
oracle: string;
|
|
294
|
-
lltv:
|
|
294
|
+
lltv: LLTV.LLTV;
|
|
295
295
|
}>;
|
|
296
296
|
/** Exact maturity timestamp (Unix timestamp in seconds) */
|
|
297
|
-
maturity?:
|
|
297
|
+
maturity?: Maturity.Maturity;
|
|
298
298
|
/** Minimum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
299
|
-
minMaturity?:
|
|
299
|
+
minMaturity?: Maturity.Maturity;
|
|
300
300
|
/** Maximum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
301
|
-
maxMaturity?:
|
|
301
|
+
maxMaturity?: Maturity.Maturity;
|
|
302
302
|
/** The loan asset address to match against */
|
|
303
303
|
loanToken?: string;
|
|
304
304
|
/** Filter by a specific offer creator address */
|
|
@@ -431,8 +431,8 @@ type GetOffersFilters = {
|
|
|
431
431
|
maxAmount?: bigint;
|
|
432
432
|
minRate?: bigint;
|
|
433
433
|
maxRate?: bigint;
|
|
434
|
-
minMaturity?:
|
|
435
|
-
maxMaturity?:
|
|
434
|
+
minMaturity?: Maturity.Maturity;
|
|
435
|
+
maxMaturity?: Maturity.Maturity;
|
|
436
436
|
minExpiry?: number;
|
|
437
437
|
maxExpiry?: number;
|
|
438
438
|
collateralAssets?: string[];
|
|
@@ -440,10 +440,10 @@ type GetOffersFilters = {
|
|
|
440
440
|
collateralTuple?: Array<{
|
|
441
441
|
asset: string;
|
|
442
442
|
oracle?: string;
|
|
443
|
-
lltv?:
|
|
443
|
+
lltv?: LLTV.LLTV;
|
|
444
444
|
}>;
|
|
445
|
-
minLltv?:
|
|
446
|
-
maxLltv?:
|
|
445
|
+
minLltv?: LLTV.LLTV;
|
|
446
|
+
maxLltv?: LLTV.LLTV;
|
|
447
447
|
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
448
448
|
sortOrder?: "asc" | "desc";
|
|
449
449
|
cursor?: string;
|
|
@@ -456,11 +456,11 @@ type FindMatchingOffersParams = {
|
|
|
456
456
|
collaterals?: Array<{
|
|
457
457
|
asset: string;
|
|
458
458
|
oracle: string;
|
|
459
|
-
lltv:
|
|
459
|
+
lltv: LLTV.LLTV;
|
|
460
460
|
}>;
|
|
461
|
-
maturity?:
|
|
462
|
-
minMaturity?:
|
|
463
|
-
maxMaturity?:
|
|
461
|
+
maturity?: Maturity.Maturity;
|
|
462
|
+
minMaturity?: Maturity.Maturity;
|
|
463
|
+
maxMaturity?: Maturity.Maturity;
|
|
464
464
|
loanToken?: string;
|
|
465
465
|
creator?: string;
|
|
466
466
|
/** Filter by offer status; if omitted defaults to ["valid"] */
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _morpho_dev_mempool from '@morpho-dev/mempool';
|
|
2
|
-
import { Compute, Offer, Errors, Format } from '@morpho-dev/mempool';
|
|
2
|
+
import { Compute, Offer, Errors, Format, Maturity, LLTV } from '@morpho-dev/mempool';
|
|
3
3
|
export * from '@morpho-dev/mempool';
|
|
4
4
|
import * as viem from 'viem';
|
|
5
5
|
import { Address, Hex, Account, PublicClient } from 'viem';
|
|
@@ -54,19 +54,19 @@ declare const schemas: {
|
|
|
54
54
|
max_amount: z.ZodOptional<z.ZodBigInt>;
|
|
55
55
|
min_rate: z.ZodOptional<z.ZodBigInt>;
|
|
56
56
|
max_rate: z.ZodOptional<z.ZodBigInt>;
|
|
57
|
-
min_maturity: z.
|
|
58
|
-
max_maturity: z.
|
|
59
|
-
min_expiry: z.
|
|
60
|
-
max_expiry: z.
|
|
57
|
+
min_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
58
|
+
max_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
59
|
+
min_expiry: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
60
|
+
max_expiry: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
61
61
|
collateral_assets: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
|
|
62
62
|
collateral_oracles: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
|
|
63
63
|
collateral_tuple: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
64
64
|
asset: string;
|
|
65
65
|
oracle: string | undefined;
|
|
66
|
-
lltv:
|
|
66
|
+
lltv: (bigint & _morpho_dev_mempool.Brand<"LLTV">) | undefined;
|
|
67
67
|
}[], string>>>;
|
|
68
|
-
min_lltv: z.ZodOptional<z.ZodPipe<z.
|
|
69
|
-
max_lltv: z.ZodOptional<z.ZodPipe<z.
|
|
68
|
+
min_lltv: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<bigint & _morpho_dev_mempool.Brand<"LLTV">, number>>>;
|
|
69
|
+
max_lltv: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<bigint & _morpho_dev_mempool.Brand<"LLTV">, number>>>;
|
|
70
70
|
sort_by: z.ZodOptional<z.ZodEnum<{
|
|
71
71
|
rate: "rate";
|
|
72
72
|
maturity: "maturity";
|
|
@@ -90,11 +90,11 @@ declare const schemas: {
|
|
|
90
90
|
collaterals: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
91
91
|
asset: string;
|
|
92
92
|
oracle: string;
|
|
93
|
-
lltv: bigint
|
|
93
|
+
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
94
94
|
}[], string>>>;
|
|
95
|
-
maturity: z.
|
|
96
|
-
min_maturity: z.
|
|
97
|
-
max_maturity: z.
|
|
95
|
+
maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
96
|
+
min_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
97
|
+
max_maturity: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number & _morpho_dev_mempool.Brand<"Maturity">, number>>>;
|
|
98
98
|
loan_token: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
99
99
|
creator: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
100
100
|
status: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<("valid" | "callback_not_supported" | "callback_error" | "unverified")[], string>>>;
|
|
@@ -104,7 +104,7 @@ declare const schemas: {
|
|
|
104
104
|
};
|
|
105
105
|
type Action = keyof typeof schemas;
|
|
106
106
|
declare function parse<A extends Action>(action: A, query: unknown): z.infer<(typeof schemas)[A]>;
|
|
107
|
-
declare function safeParse<A extends Action>(action: A, query: unknown): z.ZodSafeParseResult<z.infer<(typeof schemas)[A]>>;
|
|
107
|
+
declare function safeParse<A extends Action>(action: A, query: unknown, error?: z.core.$ZodErrorMap<z.core.$ZodIssue>): z.ZodSafeParseResult<z.infer<(typeof schemas)[A]>>;
|
|
108
108
|
|
|
109
109
|
declare const OfferStatusValues: readonly ["valid", "callback_not_supported", "callback_error", "unverified"];
|
|
110
110
|
type OfferStatus = (typeof OfferStatusValues)[number];
|
|
@@ -250,9 +250,9 @@ type GetParameters = {
|
|
|
250
250
|
/** Maximum rate per asset (in wei) */
|
|
251
251
|
maxRate?: bigint;
|
|
252
252
|
/** Minimum maturity timestamp (Unix timestamp in seconds) */
|
|
253
|
-
minMaturity?:
|
|
253
|
+
minMaturity?: Maturity.Maturity;
|
|
254
254
|
/** Maximum maturity timestamp (Unix timestamp in seconds) */
|
|
255
|
-
maxMaturity?:
|
|
255
|
+
maxMaturity?: Maturity.Maturity;
|
|
256
256
|
/** Minimum expiry timestamp (Unix timestamp in seconds) */
|
|
257
257
|
minExpiry?: number;
|
|
258
258
|
/** Maximum expiry timestamp (Unix timestamp in seconds) */
|
|
@@ -265,12 +265,12 @@ type GetParameters = {
|
|
|
265
265
|
collateralTuple?: Array<{
|
|
266
266
|
asset: string;
|
|
267
267
|
oracle?: string;
|
|
268
|
-
lltv?:
|
|
268
|
+
lltv?: LLTV.LLTV;
|
|
269
269
|
}>;
|
|
270
270
|
/** Minimum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
271
|
-
minLltv?:
|
|
271
|
+
minLltv?: LLTV.LLTV;
|
|
272
272
|
/** Maximum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
273
|
-
maxLltv?:
|
|
273
|
+
maxLltv?: LLTV.LLTV;
|
|
274
274
|
/** Field to sort results by */
|
|
275
275
|
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
276
276
|
/** Sort direction: asc (ascending) or desc (descending, default) */
|
|
@@ -291,14 +291,14 @@ type MatchParameters = {
|
|
|
291
291
|
collaterals?: Array<{
|
|
292
292
|
asset: string;
|
|
293
293
|
oracle: string;
|
|
294
|
-
lltv:
|
|
294
|
+
lltv: LLTV.LLTV;
|
|
295
295
|
}>;
|
|
296
296
|
/** Exact maturity timestamp (Unix timestamp in seconds) */
|
|
297
|
-
maturity?:
|
|
297
|
+
maturity?: Maturity.Maturity;
|
|
298
298
|
/** Minimum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
299
|
-
minMaturity?:
|
|
299
|
+
minMaturity?: Maturity.Maturity;
|
|
300
300
|
/** Maximum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
301
|
-
maxMaturity?:
|
|
301
|
+
maxMaturity?: Maturity.Maturity;
|
|
302
302
|
/** The loan asset address to match against */
|
|
303
303
|
loanToken?: string;
|
|
304
304
|
/** Filter by a specific offer creator address */
|
|
@@ -431,8 +431,8 @@ type GetOffersFilters = {
|
|
|
431
431
|
maxAmount?: bigint;
|
|
432
432
|
minRate?: bigint;
|
|
433
433
|
maxRate?: bigint;
|
|
434
|
-
minMaturity?:
|
|
435
|
-
maxMaturity?:
|
|
434
|
+
minMaturity?: Maturity.Maturity;
|
|
435
|
+
maxMaturity?: Maturity.Maturity;
|
|
436
436
|
minExpiry?: number;
|
|
437
437
|
maxExpiry?: number;
|
|
438
438
|
collateralAssets?: string[];
|
|
@@ -440,10 +440,10 @@ type GetOffersFilters = {
|
|
|
440
440
|
collateralTuple?: Array<{
|
|
441
441
|
asset: string;
|
|
442
442
|
oracle?: string;
|
|
443
|
-
lltv?:
|
|
443
|
+
lltv?: LLTV.LLTV;
|
|
444
444
|
}>;
|
|
445
|
-
minLltv?:
|
|
446
|
-
maxLltv?:
|
|
445
|
+
minLltv?: LLTV.LLTV;
|
|
446
|
+
maxLltv?: LLTV.LLTV;
|
|
447
447
|
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
448
448
|
sortOrder?: "asc" | "desc";
|
|
449
449
|
cursor?: string;
|
|
@@ -456,11 +456,11 @@ type FindMatchingOffersParams = {
|
|
|
456
456
|
collaterals?: Array<{
|
|
457
457
|
asset: string;
|
|
458
458
|
oracle: string;
|
|
459
|
-
lltv:
|
|
459
|
+
lltv: LLTV.LLTV;
|
|
460
460
|
}>;
|
|
461
|
-
maturity?:
|
|
462
|
-
minMaturity?:
|
|
463
|
-
maxMaturity?:
|
|
461
|
+
maturity?: Maturity.Maturity;
|
|
462
|
+
minMaturity?: Maturity.Maturity;
|
|
463
|
+
maxMaturity?: Maturity.Maturity;
|
|
464
464
|
loanToken?: string;
|
|
465
465
|
creator?: string;
|
|
466
466
|
/** Filter by offer status; if omitted defaults to ["valid"] */
|