@morpho-dev/router 0.1.16 → 0.1.18
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/README.md +6 -6
- package/dist/cli.js +970 -565
- package/dist/cli.js.map +1 -1
- package/dist/index.browser.d.cts +182 -79
- package/dist/index.browser.d.ts +182 -79
- package/dist/index.browser.js +443 -235
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +444 -237
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.cts +235 -124
- package/dist/index.node.d.ts +235 -124
- package/dist/index.node.js +2361 -2023
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +2361 -2024
- package/dist/index.node.mjs.map +1 -1
- package/package.json +6 -5
package/dist/index.node.d.cts
CHANGED
|
@@ -352,8 +352,8 @@ type Options = (typeof Options)[number];
|
|
|
352
352
|
* @param lltv - The LLTV option or the scaled LLTV.
|
|
353
353
|
* @returns The LLTV.
|
|
354
354
|
*/
|
|
355
|
-
declare function from$
|
|
356
|
-
declare namespace from$
|
|
355
|
+
declare function from$9(lltv: Options | bigint): LLTV;
|
|
356
|
+
declare namespace from$9 {
|
|
357
357
|
type ErrorType = InvalidOptionError$1 | InvalidLLTVError;
|
|
358
358
|
}
|
|
359
359
|
declare class InvalidOptionError$1 extends BaseError {
|
|
@@ -372,7 +372,7 @@ type LLTV$1_LLTV = LLTV;
|
|
|
372
372
|
declare const LLTV$1_LLTVSchema: typeof LLTVSchema;
|
|
373
373
|
type LLTV$1_Options = Options;
|
|
374
374
|
declare namespace LLTV$1 {
|
|
375
|
-
export { LLTV$1_InvalidLLTVError as InvalidLLTVError, InvalidOptionError$1 as InvalidOptionError, type LLTV$1_LLTV as LLTV, LLTV$1_LLTVSchema as LLTVSchema, type LLTV$1_Options as Options, from$
|
|
375
|
+
export { LLTV$1_InvalidLLTVError as InvalidLLTVError, InvalidOptionError$1 as InvalidOptionError, type LLTV$1_LLTV as LLTV, LLTV$1_LLTVSchema as LLTVSchema, type LLTV$1_Options as Options, from$9 as from };
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
type Collateral = {
|
|
@@ -393,8 +393,8 @@ declare const CollateralsSchema: z.ZodArray<z.ZodObject<{
|
|
|
393
393
|
oracle: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
394
394
|
lltv: z.ZodPipe<z.ZodBigInt, z.ZodTransform<LLTV, bigint>>;
|
|
395
395
|
}, z.core.$strip>>;
|
|
396
|
-
declare const from$
|
|
397
|
-
declare namespace from$
|
|
396
|
+
declare const from$8: (parameters: from$8.Parameters) => from$8.ReturnType;
|
|
397
|
+
declare namespace from$8 {
|
|
398
398
|
type Parameters = {
|
|
399
399
|
asset: Address;
|
|
400
400
|
lltv: Options | bigint;
|
|
@@ -407,27 +407,7 @@ type Collateral$1_Collateral = Collateral;
|
|
|
407
407
|
declare const Collateral$1_CollateralSchema: typeof CollateralSchema;
|
|
408
408
|
declare const Collateral$1_CollateralsSchema: typeof CollateralsSchema;
|
|
409
409
|
declare namespace Collateral$1 {
|
|
410
|
-
export { type Collateral$1_Collateral as Collateral, Collateral$1_CollateralSchema as CollateralSchema, Collateral$1_CollateralsSchema as CollateralsSchema, from$
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
type Cursor = {
|
|
414
|
-
sort: "rate" | "maturity" | "expiry" | "amount";
|
|
415
|
-
dir: "asc" | "desc";
|
|
416
|
-
rate?: string;
|
|
417
|
-
maturity?: number;
|
|
418
|
-
expiry?: number;
|
|
419
|
-
assets?: string;
|
|
420
|
-
hash: string;
|
|
421
|
-
page?: number;
|
|
422
|
-
};
|
|
423
|
-
declare function validate(cursor: unknown): cursor is Cursor;
|
|
424
|
-
declare function encode$1(c: Cursor): string;
|
|
425
|
-
declare function decode$1(token?: string): Cursor | null;
|
|
426
|
-
|
|
427
|
-
type Cursor$1_Cursor = Cursor;
|
|
428
|
-
declare const Cursor$1_validate: typeof validate;
|
|
429
|
-
declare namespace Cursor$1 {
|
|
430
|
-
export { type Cursor$1_Cursor as Cursor, decode$1 as decode, encode$1 as encode, Cursor$1_validate as validate };
|
|
410
|
+
export { type Collateral$1_Collateral as Collateral, Collateral$1_CollateralSchema as CollateralSchema, Collateral$1_CollateralsSchema as CollateralsSchema, from$8 as from };
|
|
431
411
|
}
|
|
432
412
|
|
|
433
413
|
/** The snake case representation of a type with bigint values stringified. */
|
|
@@ -456,11 +436,11 @@ declare function toSnakeCase$1<T>(obj: T): Snake<T>;
|
|
|
456
436
|
* Converts checksummed ethereum addresses to lowercase if used as values.
|
|
457
437
|
* @warning Does not unstringify bigint values.
|
|
458
438
|
*/
|
|
459
|
-
declare function fromSnakeCase$
|
|
439
|
+
declare function fromSnakeCase$3<T>(obj: Snake<T>): T;
|
|
460
440
|
|
|
461
441
|
type Format_Snake<T> = Snake<T>;
|
|
462
442
|
declare namespace Format {
|
|
463
|
-
export { type Format_Snake as Snake, fromSnakeCase$
|
|
443
|
+
export { type Format_Snake as Snake, fromSnakeCase$3 as fromSnakeCase, toSnakeCase$1 as toSnakeCase };
|
|
464
444
|
}
|
|
465
445
|
|
|
466
446
|
/**
|
|
@@ -483,8 +463,8 @@ type MaturityOptions = keyof typeof MaturityOptions;
|
|
|
483
463
|
* @throws {InvalidDateError} If the maturity is in seconds but not a valid date.
|
|
484
464
|
* @throws {InvalidOptionError} If the maturity is not a valid option.
|
|
485
465
|
*/
|
|
486
|
-
declare function from$
|
|
487
|
-
declare namespace from$
|
|
466
|
+
declare function from$7(ts: from$7.Parameters): Maturity;
|
|
467
|
+
declare namespace from$7 {
|
|
488
468
|
type Parameters = number | MaturityOptions;
|
|
489
469
|
type ErrorType = InvalidFormatError | InvalidDateError | InvalidOptionError;
|
|
490
470
|
}
|
|
@@ -511,7 +491,7 @@ type Maturity$1_Maturity = Maturity;
|
|
|
511
491
|
type Maturity$1_MaturityOptions = MaturityOptions;
|
|
512
492
|
declare const Maturity$1_MaturitySchema: typeof MaturitySchema;
|
|
513
493
|
declare namespace Maturity$1 {
|
|
514
|
-
export { Maturity$1_InvalidDateError as InvalidDateError, Maturity$1_InvalidFormatError as InvalidFormatError, Maturity$1_InvalidOptionError as InvalidOptionError, type Maturity$1_Maturity as Maturity, type Maturity$1_MaturityOptions as MaturityOptions, Maturity$1_MaturitySchema as MaturitySchema, from$
|
|
494
|
+
export { Maturity$1_InvalidDateError as InvalidDateError, Maturity$1_InvalidFormatError as InvalidFormatError, Maturity$1_InvalidOptionError as InvalidOptionError, type Maturity$1_Maturity as Maturity, type Maturity$1_MaturityOptions as MaturityOptions, Maturity$1_MaturitySchema as MaturitySchema, from$7 as from };
|
|
515
495
|
}
|
|
516
496
|
|
|
517
497
|
type Offer = {
|
|
@@ -586,8 +566,8 @@ declare const OfferSchema: (parameters?: {
|
|
|
586
566
|
* @param input - The offer to create.
|
|
587
567
|
* @returns The created offer with its hash.
|
|
588
568
|
*/
|
|
589
|
-
declare function from$
|
|
590
|
-
declare namespace from$
|
|
569
|
+
declare function from$6(input: Omit<Offer, "hash">): Offer;
|
|
570
|
+
declare namespace from$6 {
|
|
591
571
|
type ErrorType = InvalidOfferError;
|
|
592
572
|
}
|
|
593
573
|
/**
|
|
@@ -596,21 +576,42 @@ declare namespace from$5 {
|
|
|
596
576
|
* @param input - The offer to create.
|
|
597
577
|
* @returns The created offer with its hash.
|
|
598
578
|
*/
|
|
599
|
-
declare function fromSnakeCase$
|
|
579
|
+
declare function fromSnakeCase$2(input: Snake<Omit<Offer, "hash">>): Offer;
|
|
600
580
|
/**
|
|
601
581
|
* Converts an offer to a snake case object.
|
|
602
582
|
* @param offer - The offer to convert.
|
|
603
583
|
* @returns The converted offer.
|
|
604
584
|
*/
|
|
605
585
|
declare function toSnakeCase(offer: Offer): Snake<Offer>;
|
|
586
|
+
type RandomConfig = {
|
|
587
|
+
chains?: Chain[];
|
|
588
|
+
loanTokens?: Address[];
|
|
589
|
+
collateralTokens?: Address[];
|
|
590
|
+
assetsDecimals?: Record<Address, number>;
|
|
591
|
+
buy?: boolean;
|
|
592
|
+
assets?: bigint;
|
|
593
|
+
consumed?: bigint;
|
|
594
|
+
offering?: Address;
|
|
595
|
+
maturity?: Maturity;
|
|
596
|
+
start?: number;
|
|
597
|
+
expiry?: number;
|
|
598
|
+
nonce?: bigint;
|
|
599
|
+
rate?: bigint;
|
|
600
|
+
callback?: {
|
|
601
|
+
address: Address;
|
|
602
|
+
data: Hex;
|
|
603
|
+
gasLimit: bigint;
|
|
604
|
+
};
|
|
605
|
+
collaterals?: readonly Collateral[];
|
|
606
|
+
signature?: Hex;
|
|
607
|
+
};
|
|
606
608
|
/**
|
|
607
609
|
* Generates a random Offer.
|
|
608
|
-
* The returned Offer contains randomly generated values
|
|
609
|
-
* Some fields use fixed or deterministic values (e.g., chainId, collaterals, callback).
|
|
610
|
+
* The returned Offer contains randomly generated values.
|
|
610
611
|
* @warning The generated Offer should not be used for production usage.
|
|
611
612
|
* @returns {Offer} A randomly generated Offer object.
|
|
612
613
|
*/
|
|
613
|
-
declare function random$
|
|
614
|
+
declare function random$2(config?: RandomConfig): Offer;
|
|
614
615
|
/**
|
|
615
616
|
* Creates an EIP-712 domain object.
|
|
616
617
|
* @param chainId - The chain ID.
|
|
@@ -701,8 +702,8 @@ declare function hash(offer: Omit<Offer, "hash">): Hex;
|
|
|
701
702
|
* @returns The obligation id as a 32-byte hex string.
|
|
702
703
|
*/
|
|
703
704
|
declare function obligationId(offer: Offer): Hex;
|
|
704
|
-
declare function encode(offer: Offer): `0x${string}`;
|
|
705
|
-
declare function decode(data: Hex, blockNumber: number | bigint): Offer;
|
|
705
|
+
declare function encode$1(offer: Offer): `0x${string}`;
|
|
706
|
+
declare function decode$1(data: Hex, blockNumber: number | bigint): Offer;
|
|
706
707
|
type OfferConsumed = {
|
|
707
708
|
id: string;
|
|
708
709
|
chainId: bigint;
|
|
@@ -761,10 +762,9 @@ type Offer$1_Offer = Offer;
|
|
|
761
762
|
type Offer$1_OfferConsumed = OfferConsumed;
|
|
762
763
|
declare const Offer$1_OfferHashSchema: typeof OfferHashSchema;
|
|
763
764
|
declare const Offer$1_OfferSchema: typeof OfferSchema;
|
|
765
|
+
type Offer$1_RandomConfig = RandomConfig;
|
|
764
766
|
declare const Offer$1_consumedEvent: typeof consumedEvent;
|
|
765
|
-
declare const Offer$1_decode: typeof decode;
|
|
766
767
|
declare const Offer$1_domain: typeof domain;
|
|
767
|
-
declare const Offer$1_encode: typeof encode;
|
|
768
768
|
declare const Offer$1_fromConsumedLog: typeof fromConsumedLog;
|
|
769
769
|
declare const Offer$1_hash: typeof hash;
|
|
770
770
|
declare const Offer$1_obligationId: typeof obligationId;
|
|
@@ -772,7 +772,7 @@ declare const Offer$1_sign: typeof sign;
|
|
|
772
772
|
declare const Offer$1_toSnakeCase: typeof toSnakeCase;
|
|
773
773
|
declare const Offer$1_types: typeof types;
|
|
774
774
|
declare namespace Offer$1 {
|
|
775
|
-
export { Offer$1_AccountNotSetError as AccountNotSetError, Offer$1_InvalidOfferError as InvalidOfferError, type Offer$1_Offer as Offer, type Offer$1_OfferConsumed as OfferConsumed, Offer$1_OfferHashSchema as OfferHashSchema, Offer$1_OfferSchema as OfferSchema, Offer$1_consumedEvent as consumedEvent,
|
|
775
|
+
export { Offer$1_AccountNotSetError as AccountNotSetError, Offer$1_InvalidOfferError as InvalidOfferError, type Offer$1_Offer as Offer, type Offer$1_OfferConsumed as OfferConsumed, Offer$1_OfferHashSchema as OfferHashSchema, Offer$1_OfferSchema as OfferSchema, type Offer$1_RandomConfig as RandomConfig, Offer$1_consumedEvent as consumedEvent, decode$1 as decode, Offer$1_domain as domain, encode$1 as encode, from$6 as from, Offer$1_fromConsumedLog as fromConsumedLog, fromSnakeCase$2 as fromSnakeCase, Offer$1_hash as hash, Offer$1_obligationId as obligationId, random$2 as random, Offer$1_sign as sign, Offer$1_toSnakeCase as toSnakeCase, Offer$1_types as types };
|
|
776
776
|
}
|
|
777
777
|
|
|
778
778
|
/**
|
|
@@ -952,17 +952,17 @@ declare const ObligationSchema: z.ZodObject<{
|
|
|
952
952
|
* });
|
|
953
953
|
* ```
|
|
954
954
|
*/
|
|
955
|
-
declare function from$
|
|
956
|
-
declare namespace from$
|
|
955
|
+
declare function from$5(parameters: from$5.Parameters): from$5.ReturnType;
|
|
956
|
+
declare namespace from$5 {
|
|
957
957
|
type Parameters = {
|
|
958
958
|
/** The chain id where the liquidity for this obligation is located. */
|
|
959
959
|
chainId: Id;
|
|
960
960
|
/** The token that is being borrowed for this obligation. */
|
|
961
961
|
loanToken: Address;
|
|
962
962
|
/** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
963
|
-
collaterals: from$
|
|
963
|
+
collaterals: from$8.Parameters[] | readonly from$8.Parameters[];
|
|
964
964
|
/** The maturity of the obligation. */
|
|
965
|
-
maturity: from$
|
|
965
|
+
maturity: from$7.Parameters;
|
|
966
966
|
};
|
|
967
967
|
type ReturnType = Obligation;
|
|
968
968
|
type ErrorType = InvalidObligationError;
|
|
@@ -973,8 +973,8 @@ declare namespace from$4 {
|
|
|
973
973
|
* @param input - {@link fromSnakeCase.Parameters}
|
|
974
974
|
* @returns The created obligation. {@link fromSnakeCase.ReturnType}
|
|
975
975
|
*/
|
|
976
|
-
declare function fromSnakeCase(input: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
977
|
-
declare namespace fromSnakeCase {
|
|
976
|
+
declare function fromSnakeCase$1(input: fromSnakeCase$1.Parameters): fromSnakeCase$1.ReturnType;
|
|
977
|
+
declare namespace fromSnakeCase$1 {
|
|
978
978
|
type Parameters = Snake<Obligation>;
|
|
979
979
|
type ReturnType = Obligation;
|
|
980
980
|
type ErrorType = InvalidObligationError;
|
|
@@ -1008,8 +1008,8 @@ declare namespace id {
|
|
|
1008
1008
|
* const obligation = Obligation.random();
|
|
1009
1009
|
* ```
|
|
1010
1010
|
*/
|
|
1011
|
-
declare function random(): random.ReturnType;
|
|
1012
|
-
declare namespace random {
|
|
1011
|
+
declare function random$1(): random$1.ReturnType;
|
|
1012
|
+
declare namespace random$1 {
|
|
1013
1013
|
type ReturnType = Obligation;
|
|
1014
1014
|
}
|
|
1015
1015
|
declare class InvalidObligationError extends BaseError<z.ZodError | Error> {
|
|
@@ -1027,11 +1027,90 @@ type Obligation$1_InvalidObligationError = InvalidObligationError;
|
|
|
1027
1027
|
declare const Obligation$1_InvalidObligationError: typeof InvalidObligationError;
|
|
1028
1028
|
type Obligation$1_Obligation = Obligation;
|
|
1029
1029
|
declare const Obligation$1_ObligationSchema: typeof ObligationSchema;
|
|
1030
|
-
declare const Obligation$1_fromSnakeCase: typeof fromSnakeCase;
|
|
1031
1030
|
declare const Obligation$1_id: typeof id;
|
|
1032
|
-
declare const Obligation$1_random: typeof random;
|
|
1033
1031
|
declare namespace Obligation$1 {
|
|
1034
|
-
export { Obligation$1_CollateralsAreNotSortedError as CollateralsAreNotSortedError, Obligation$1_InvalidObligationError as InvalidObligationError, type Obligation$1_Obligation as Obligation, Obligation$1_ObligationSchema as ObligationSchema, from$
|
|
1032
|
+
export { Obligation$1_CollateralsAreNotSortedError as CollateralsAreNotSortedError, Obligation$1_InvalidObligationError as InvalidObligationError, type Obligation$1_Obligation as Obligation, Obligation$1_ObligationSchema as ObligationSchema, from$5 as from, fromSnakeCase$1 as fromSnakeCase, Obligation$1_id as id, random$1 as random };
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
type Quote = {
|
|
1036
|
+
/** The obligation id. */
|
|
1037
|
+
obligationId: Hex;
|
|
1038
|
+
ask: {
|
|
1039
|
+
/** The highest interest rate the seller will accept to pay for the obligation. (18 decimals). */
|
|
1040
|
+
rate: bigint;
|
|
1041
|
+
};
|
|
1042
|
+
bid: {
|
|
1043
|
+
/** The lowest interest rate a buyer is willing to be paid for the obligation. (18 decimals). */
|
|
1044
|
+
rate: bigint;
|
|
1045
|
+
};
|
|
1046
|
+
};
|
|
1047
|
+
declare const QuoteSchema: z.ZodObject<{
|
|
1048
|
+
obligationId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
1049
|
+
ask: z.ZodObject<{
|
|
1050
|
+
rate: z.ZodBigInt;
|
|
1051
|
+
}, z.core.$strip>;
|
|
1052
|
+
bid: z.ZodObject<{
|
|
1053
|
+
rate: z.ZodBigInt;
|
|
1054
|
+
}, z.core.$strip>;
|
|
1055
|
+
}, z.core.$strip>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Creates a quote for a given obligation.
|
|
1058
|
+
* @constructor
|
|
1059
|
+
* @param parameters - {@link from.Parameters}
|
|
1060
|
+
* @returns The created quote. {@link Quote}
|
|
1061
|
+
* @throws If the quote is invalid. {@link InvalidQuoteError}
|
|
1062
|
+
*
|
|
1063
|
+
* @example
|
|
1064
|
+
* ```ts
|
|
1065
|
+
* const quote = Quote.from({ obligationId: "0x123", ask: { assets: 100n, rate: 100n }, bid: { assets: 100n, rate: 100n } });
|
|
1066
|
+
* ```
|
|
1067
|
+
*/
|
|
1068
|
+
declare function from$4(parameters: from$4.Parameters): from$4.ReturnType;
|
|
1069
|
+
declare namespace from$4 {
|
|
1070
|
+
type Parameters = Quote;
|
|
1071
|
+
type ReturnType = Quote;
|
|
1072
|
+
type ErrorType = InvalidQuoteError;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Creates a quote from a snake case object.
|
|
1076
|
+
* @throws If the quote is invalid. {@link InvalidQuoteError}
|
|
1077
|
+
* @param snake - {@link fromSnakeCase.Parameters}
|
|
1078
|
+
* @returns The created quote. {@link fromSnakeCase.ReturnType}
|
|
1079
|
+
*/
|
|
1080
|
+
declare function fromSnakeCase(snake: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
1081
|
+
declare namespace fromSnakeCase {
|
|
1082
|
+
type Parameters = Snake<Quote>;
|
|
1083
|
+
type ReturnType = Quote;
|
|
1084
|
+
type ErrorType = from$4.ErrorType;
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Generates a random quote.
|
|
1088
|
+
* @returns A randomly generated quote. {@link random.ReturnType}
|
|
1089
|
+
*
|
|
1090
|
+
* @example
|
|
1091
|
+
* ```ts
|
|
1092
|
+
* const quote = Quote.random();
|
|
1093
|
+
* ```
|
|
1094
|
+
*/
|
|
1095
|
+
declare function random(): random.ReturnType;
|
|
1096
|
+
declare namespace random {
|
|
1097
|
+
type Parameters = never;
|
|
1098
|
+
type ReturnType = Quote;
|
|
1099
|
+
type ErrorType = from$4.ErrorType;
|
|
1100
|
+
}
|
|
1101
|
+
declare class InvalidQuoteError extends BaseError<z.ZodError | Error> {
|
|
1102
|
+
readonly name = "Quote.InvalidQuoteError";
|
|
1103
|
+
constructor(error: z.ZodError | Error);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
type Quote$1_InvalidQuoteError = InvalidQuoteError;
|
|
1107
|
+
declare const Quote$1_InvalidQuoteError: typeof InvalidQuoteError;
|
|
1108
|
+
type Quote$1_Quote = Quote;
|
|
1109
|
+
declare const Quote$1_QuoteSchema: typeof QuoteSchema;
|
|
1110
|
+
declare const Quote$1_fromSnakeCase: typeof fromSnakeCase;
|
|
1111
|
+
declare const Quote$1_random: typeof random;
|
|
1112
|
+
declare namespace Quote$1 {
|
|
1113
|
+
export { Quote$1_InvalidQuoteError as InvalidQuoteError, type Quote$1_Quote as Quote, Quote$1_QuoteSchema as QuoteSchema, from$4 as from, Quote$1_fromSnakeCase as fromSnakeCase, Quote$1_random as random };
|
|
1035
1114
|
}
|
|
1036
1115
|
|
|
1037
1116
|
type Indexer = {
|
|
@@ -1238,6 +1317,10 @@ type OfferStore = {
|
|
|
1238
1317
|
obligations: Obligation[];
|
|
1239
1318
|
nextCursor: string | null;
|
|
1240
1319
|
}>;
|
|
1320
|
+
/** Get quotes for given obligations. */
|
|
1321
|
+
getQuotes: (parameters: {
|
|
1322
|
+
obligationIds: Hex[];
|
|
1323
|
+
}) => Promise<Quote[]>;
|
|
1241
1324
|
};
|
|
1242
1325
|
type GetOffersFilters = {
|
|
1243
1326
|
creators?: string[];
|
|
@@ -1321,7 +1404,7 @@ type Services = {
|
|
|
1321
1404
|
buyVaultV1CallbackLiquidityCollector: Collector<"buy_vault_v1_callback_liquidity">;
|
|
1322
1405
|
sellERC20CallbackLiquidityCollector: Collector<"sell_erc20_callback_liquidity">;
|
|
1323
1406
|
DB: PG;
|
|
1324
|
-
routerApi: RouterApi;
|
|
1407
|
+
routerApi: RouterApi$1;
|
|
1325
1408
|
};
|
|
1326
1409
|
declare function from$3(config: ServicesConfig): Services;
|
|
1327
1410
|
type Stores = ReturnType<typeof createStores>;
|
|
@@ -1624,32 +1707,32 @@ declare namespace Validation {
|
|
|
1624
1707
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
1625
1708
|
}
|
|
1626
1709
|
|
|
1627
|
-
type index$
|
|
1628
|
-
type index$
|
|
1629
|
-
type index$
|
|
1630
|
-
type index$
|
|
1631
|
-
type index$
|
|
1632
|
-
type index$
|
|
1633
|
-
type index$
|
|
1634
|
-
type index$
|
|
1635
|
-
type index$
|
|
1636
|
-
type index$
|
|
1637
|
-
type index$
|
|
1710
|
+
type index$3_Batch<T, RuleName extends string, Ctx = void> = Batch<T, RuleName, Ctx>;
|
|
1711
|
+
type index$3_Builder<chain extends Chain = Chain> = Builder<chain>;
|
|
1712
|
+
type index$3_CollectFn<chain extends Chain, collector extends Name> = CollectFn<chain, collector>;
|
|
1713
|
+
type index$3_CollectParameters<chain extends Chain, collector extends Name> = CollectParameters<chain, collector>;
|
|
1714
|
+
type index$3_Collector<name extends Name = Name, chain extends Chain = Chain> = Collector<name, chain>;
|
|
1715
|
+
type index$3_Issue<T, RuleName extends string = string> = Issue<T, RuleName>;
|
|
1716
|
+
type index$3_MorphoContext = MorphoContext;
|
|
1717
|
+
type index$3_Name = Name;
|
|
1718
|
+
type index$3_Result<T, RuleName extends string = string> = Result<T, RuleName>;
|
|
1719
|
+
type index$3_Rule<T, Name extends string = string, Ctx = void> = Rule<T, Name, Ctx>;
|
|
1720
|
+
type index$3_RuleNames<Rules extends readonly {
|
|
1638
1721
|
name: string;
|
|
1639
1722
|
}[]> = RuleNames<Rules>;
|
|
1640
|
-
type index$
|
|
1641
|
-
declare const index$
|
|
1642
|
-
declare const index$
|
|
1643
|
-
declare const index$
|
|
1644
|
-
declare const index$
|
|
1645
|
-
declare const index$
|
|
1646
|
-
declare const index$
|
|
1647
|
-
declare const index$
|
|
1648
|
-
declare const index$
|
|
1649
|
-
declare const index$
|
|
1650
|
-
declare const index$
|
|
1651
|
-
declare namespace index$
|
|
1652
|
-
export { type index$
|
|
1723
|
+
type index$3_Single<T, RuleName extends string, Ctx = void> = Single<T, RuleName, Ctx>;
|
|
1724
|
+
declare const index$3_createBuilder: typeof createBuilder;
|
|
1725
|
+
declare const index$3_fetchBalancesAndAllowances: typeof fetchBalancesAndAllowances;
|
|
1726
|
+
declare const index$3_fetchCollateralAndDebt: typeof fetchCollateralAndDebt;
|
|
1727
|
+
declare const index$3_fetchOraclePrices: typeof fetchOraclePrices;
|
|
1728
|
+
declare const index$3_fetchUserVaultMarketLiquidity: typeof fetchUserVaultMarketLiquidity;
|
|
1729
|
+
declare const index$3_morpho: typeof morpho;
|
|
1730
|
+
declare const index$3_names: typeof names;
|
|
1731
|
+
declare const index$3_run: typeof run;
|
|
1732
|
+
declare const index$3_single: typeof single;
|
|
1733
|
+
declare const index$3_start: typeof start;
|
|
1734
|
+
declare namespace index$3 {
|
|
1735
|
+
export { type index$3_Batch as Batch, type index$3_Builder as Builder, type index$3_CollectFn as CollectFn, type index$3_CollectParameters as CollectParameters, type index$3_Collector as Collector, type index$3_Issue as Issue, type index$3_MorphoContext as MorphoContext, type index$3_Name as Name, type index$3_Result as Result, type index$3_Rule as Rule, type index$3_RuleNames as RuleNames, type index$3_Single as Single, batch$1 as batch, create$2 as create, index$3_createBuilder as createBuilder, index$3_fetchBalancesAndAllowances as fetchBalancesAndAllowances, index$3_fetchCollateralAndDebt as fetchCollateralAndDebt, index$3_fetchOraclePrices as fetchOraclePrices, index$3_fetchUserVaultMarketLiquidity as fetchUserVaultMarketLiquidity, index$3_morpho as morpho, index$3_names as names, index$3_run as run, index$3_single as single, index$3_start as start };
|
|
1653
1736
|
}
|
|
1654
1737
|
|
|
1655
1738
|
type CollectorHealthStatus = "live" | "lagging" | "unknown";
|
|
@@ -1696,12 +1779,15 @@ type RouterApiConfig = {
|
|
|
1696
1779
|
store: OfferStore;
|
|
1697
1780
|
healthService: HealthService;
|
|
1698
1781
|
};
|
|
1699
|
-
type RouterApi = {
|
|
1782
|
+
type RouterApi$1 = {
|
|
1700
1783
|
serve: (parameters: {
|
|
1701
1784
|
port: number;
|
|
1702
1785
|
}) => void;
|
|
1703
1786
|
};
|
|
1704
|
-
declare function create(config: RouterApiConfig): RouterApi;
|
|
1787
|
+
declare function create(config: RouterApiConfig): RouterApi$1;
|
|
1788
|
+
|
|
1789
|
+
declare function getSwaggerJson(): unknown;
|
|
1790
|
+
declare function getDocsHtml(): string;
|
|
1705
1791
|
|
|
1706
1792
|
declare const LogLevelValues: readonly ["trace", "debug", "info", "warn", "error", "fatal", "silent"];
|
|
1707
1793
|
type LogLevel = (typeof LogLevelValues)[number];
|
|
@@ -1835,11 +1921,13 @@ declare function getOffers$1(queryParameters: object, store: OfferStore): Promis
|
|
|
1835
1921
|
});
|
|
1836
1922
|
}>;
|
|
1837
1923
|
|
|
1838
|
-
declare const index$
|
|
1839
|
-
declare const index$
|
|
1840
|
-
declare const index$
|
|
1841
|
-
declare
|
|
1842
|
-
|
|
1924
|
+
declare const index$2_getDocsHtml: typeof getDocsHtml;
|
|
1925
|
+
declare const index$2_getHealth: typeof getHealth;
|
|
1926
|
+
declare const index$2_getHealthChains: typeof getHealthChains;
|
|
1927
|
+
declare const index$2_getHealthCollectors: typeof getHealthCollectors;
|
|
1928
|
+
declare const index$2_getSwaggerJson: typeof getSwaggerJson;
|
|
1929
|
+
declare namespace index$2 {
|
|
1930
|
+
export { index$2_getDocsHtml as getDocsHtml, index$2_getHealth as getHealth, index$2_getHealthChains as getHealthChains, index$2_getHealthCollectors as getHealthCollectors, getObligations$1 as getObligations, getOffers$1 as getOffers, index$2_getSwaggerJson as getSwaggerJson };
|
|
1843
1931
|
}
|
|
1844
1932
|
|
|
1845
1933
|
declare const CollectorHealth: z$1.ZodObject<{
|
|
@@ -1859,28 +1947,24 @@ declare const ChainHealth: z$1.ZodObject<{
|
|
|
1859
1947
|
block_number: z$1.ZodNumber;
|
|
1860
1948
|
updated_at: z$1.ZodString;
|
|
1861
1949
|
}, z$1.core.$strip>;
|
|
1862
|
-
declare const CollectorsHealthResponse: z$1.ZodObject<{
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
}, z$1.core.$strip>>;
|
|
1875
|
-
}, z$1.core.$strip>;
|
|
1950
|
+
declare const CollectorsHealthResponse: z$1.ZodArray<z$1.ZodObject<{
|
|
1951
|
+
name: z$1.ZodString;
|
|
1952
|
+
chain_id: z$1.ZodNumber;
|
|
1953
|
+
block_number: z$1.ZodNullable<z$1.ZodNumber>;
|
|
1954
|
+
updated_at: z$1.ZodNullable<z$1.ZodString>;
|
|
1955
|
+
lag: z$1.ZodNullable<z$1.ZodNumber>;
|
|
1956
|
+
status: z$1.ZodEnum<{
|
|
1957
|
+
unknown: "unknown";
|
|
1958
|
+
live: "live";
|
|
1959
|
+
lagging: "lagging";
|
|
1960
|
+
}>;
|
|
1961
|
+
}, z$1.core.$strip>>;
|
|
1876
1962
|
type CollectorsHealthResponse = z$1.infer<typeof CollectorsHealthResponse>;
|
|
1877
|
-
declare const ChainsHealthResponse: z$1.ZodObject<{
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
}, z$1.core.$strip>>;
|
|
1883
|
-
}, z$1.core.$strip>;
|
|
1963
|
+
declare const ChainsHealthResponse: z$1.ZodArray<z$1.ZodObject<{
|
|
1964
|
+
chain_id: z$1.ZodNumber;
|
|
1965
|
+
block_number: z$1.ZodNumber;
|
|
1966
|
+
updated_at: z$1.ZodString;
|
|
1967
|
+
}, z$1.core.$strip>>;
|
|
1884
1968
|
type ChainsHealthResponse = z$1.infer<typeof ChainsHealthResponse>;
|
|
1885
1969
|
declare const RouterStatusResponse: z$1.ZodObject<{
|
|
1886
1970
|
status: z$1.ZodEnum<{
|
|
@@ -1893,14 +1977,17 @@ type RouterStatusResponse = z$1.infer<typeof RouterStatusResponse>;
|
|
|
1893
1977
|
type ObligationResponse = Snake<Compute<{
|
|
1894
1978
|
/** The obligation id. */
|
|
1895
1979
|
id: Hex;
|
|
1896
|
-
} & Obligation
|
|
1980
|
+
} & Obligation & {
|
|
1981
|
+
ask: Quote["ask"];
|
|
1982
|
+
bid: Quote["bid"];
|
|
1983
|
+
}>>;
|
|
1897
1984
|
/**
|
|
1898
1985
|
* Creates an `ObligationResponse` from a `Obligation`.
|
|
1899
1986
|
* @constructor
|
|
1900
1987
|
* @param obligation - {@link Obligation}
|
|
1901
1988
|
* @returns The created `ObligationResponse`. {@link ObligationResponse}
|
|
1902
1989
|
*/
|
|
1903
|
-
declare function from$2(obligation: Obligation): ObligationResponse;
|
|
1990
|
+
declare function from$2(obligation: Obligation, quote: Quote): ObligationResponse;
|
|
1904
1991
|
|
|
1905
1992
|
type ObligationResponse$1_ObligationResponse = ObligationResponse;
|
|
1906
1993
|
declare namespace ObligationResponse$1 {
|
|
@@ -1942,19 +2029,18 @@ type Action = keyof typeof schemas;
|
|
|
1942
2029
|
declare function parse<A extends Action>(action: A, query: unknown): z.infer<(typeof schemas)[A]>;
|
|
1943
2030
|
declare function safeParse<A extends Action>(action: A, query: unknown, error?: z.core.$ZodErrorMap<z.core.$ZodIssue>): z.ZodSafeParseResult<z.infer<(typeof schemas)[A]>>;
|
|
1944
2031
|
|
|
1945
|
-
declare const
|
|
1946
|
-
type
|
|
1947
|
-
declare const
|
|
1948
|
-
type
|
|
1949
|
-
declare const
|
|
1950
|
-
type
|
|
1951
|
-
type
|
|
1952
|
-
|
|
1953
|
-
declare const
|
|
1954
|
-
declare const
|
|
1955
|
-
declare
|
|
1956
|
-
|
|
1957
|
-
export { index$2_ChainHealth as ChainHealth, type index$2_ChainsHealthResponse as ChainsHealthResponse, index$2_CollectorHealth as CollectorHealth, type index$2_CollectorsHealthResponse as CollectorsHealthResponse, index$3 as Controllers, ObligationResponse$1 as ObligationResponse, OfferResponse$1 as OfferResponse, index$2_OpenApi as OpenApi, type index$2_RouterApi as RouterApi, type index$2_RouterApiConfig as RouterApiConfig, type index$2_RouterStatusResponse as RouterStatusResponse, index$2_create as create, index$2_parse as parse, index$2_safeParse as safeParse };
|
|
2032
|
+
declare const RouterApi_ChainHealth: typeof ChainHealth;
|
|
2033
|
+
type RouterApi_ChainsHealthResponse = ChainsHealthResponse;
|
|
2034
|
+
declare const RouterApi_CollectorHealth: typeof CollectorHealth;
|
|
2035
|
+
type RouterApi_CollectorsHealthResponse = CollectorsHealthResponse;
|
|
2036
|
+
declare const RouterApi_OpenApi: typeof OpenApi;
|
|
2037
|
+
type RouterApi_RouterApiConfig = RouterApiConfig;
|
|
2038
|
+
type RouterApi_RouterStatusResponse = RouterStatusResponse;
|
|
2039
|
+
declare const RouterApi_create: typeof create;
|
|
2040
|
+
declare const RouterApi_parse: typeof parse;
|
|
2041
|
+
declare const RouterApi_safeParse: typeof safeParse;
|
|
2042
|
+
declare namespace RouterApi {
|
|
2043
|
+
export { RouterApi_ChainHealth as ChainHealth, type RouterApi_ChainsHealthResponse as ChainsHealthResponse, RouterApi_CollectorHealth as CollectorHealth, type RouterApi_CollectorsHealthResponse as CollectorsHealthResponse, index$2 as Controllers, ObligationResponse$1 as ObligationResponse, OfferResponse$1 as OfferResponse, RouterApi_OpenApi as OpenApi, type RouterApi$1 as RouterApi, type RouterApi_RouterApiConfig as RouterApiConfig, type RouterApi_RouterStatusResponse as RouterStatusResponse, RouterApi_create as create, RouterApi_parse as parse, RouterApi_safeParse as safeParse };
|
|
1958
2044
|
}
|
|
1959
2045
|
|
|
1960
2046
|
type RouterClientConfig = {
|
|
@@ -2045,7 +2131,10 @@ declare namespace getObligations {
|
|
|
2045
2131
|
limit?: number;
|
|
2046
2132
|
};
|
|
2047
2133
|
type ReturnType = {
|
|
2048
|
-
obligations:
|
|
2134
|
+
obligations: Compute<{
|
|
2135
|
+
/** The obligation id. Uses {@link Obligation.id} to calculate the id.*/
|
|
2136
|
+
id: () => Hex;
|
|
2137
|
+
} & Obligation & Omit<Quote, "obligationId">>[];
|
|
2049
2138
|
/** The pagination cursor. */
|
|
2050
2139
|
cursor: string | null;
|
|
2051
2140
|
};
|
|
@@ -3272,6 +3361,28 @@ declare namespace schema {
|
|
|
3272
3361
|
export { schema_VERSION as VERSION, schema_chains as chains, schema_collectors as collectors, schema_consumed as consumed, schema_liquidityLinks as liquidityLinks, schema_liquidityPools as liquidityPools, schema_obligationCollaterals as obligationCollaterals, schema_obligations as obligations, schema_offerLiquidityPools as offerLiquidityPools, schema_offers as offers };
|
|
3273
3362
|
}
|
|
3274
3363
|
|
|
3364
|
+
type Cursor = {
|
|
3365
|
+
sort: "rate" | "maturity" | "expiry" | "amount";
|
|
3366
|
+
dir: "asc" | "desc";
|
|
3367
|
+
rate?: string;
|
|
3368
|
+
maturity?: number;
|
|
3369
|
+
expiry?: number;
|
|
3370
|
+
assets?: string;
|
|
3371
|
+
hash: string;
|
|
3372
|
+
page?: number;
|
|
3373
|
+
};
|
|
3374
|
+
declare function validate(cursor: unknown): cursor is Cursor;
|
|
3375
|
+
declare function encode(c: Cursor): string;
|
|
3376
|
+
declare function decode(token?: string): Cursor | null;
|
|
3377
|
+
|
|
3378
|
+
type Cursor$1_Cursor = Cursor;
|
|
3379
|
+
declare const Cursor$1_decode: typeof decode;
|
|
3380
|
+
declare const Cursor$1_encode: typeof encode;
|
|
3381
|
+
declare const Cursor$1_validate: typeof validate;
|
|
3382
|
+
declare namespace Cursor$1 {
|
|
3383
|
+
export { type Cursor$1_Cursor as Cursor, Cursor$1_decode as decode, Cursor$1_encode as encode, Cursor$1_validate as validate };
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3275
3386
|
declare function max$1(a: bigint, b: bigint): bigint;
|
|
3276
3387
|
declare function min(a: bigint, b: bigint): bigint;
|
|
3277
3388
|
|
|
@@ -3354,7 +3465,7 @@ declare const index_poll: typeof poll;
|
|
|
3354
3465
|
declare const index_retry: typeof retry;
|
|
3355
3466
|
declare const index_wait: typeof wait;
|
|
3356
3467
|
declare namespace index {
|
|
3357
|
-
export { index_BaseError as BaseError, type index_GlobalErrorType as GlobalErrorType, type index_Snake as Snake, time as Time, index_batch as batch, index_batchMulticall as batchMulticall, fromSnakeCase$
|
|
3468
|
+
export { index_BaseError as BaseError, type index_GlobalErrorType as GlobalErrorType, type index_Snake as Snake, time as Time, index_batch as batch, index_batchMulticall as batchMulticall, fromSnakeCase$3 as fromSnakeCase, index_lazy as lazy, max$1 as max, index_min as min, index_poll as poll, index_retry as retry, toSnakeCase$1 as toSnakeCase, index_wait as wait };
|
|
3358
3469
|
}
|
|
3359
3470
|
|
|
3360
|
-
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, ChainHealth, ChainStore$1 as ChainStore, ChainsHealthResponse, Collateral$1 as Collateral, index$
|
|
3471
|
+
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, ChainHealth, ChainStore$1 as ChainStore, ChainsHealthResponse, Collateral$1 as Collateral, index$3 as Collector, CollectorHealth, CollectorStore$1 as CollectorStore, CollectorsHealthResponse, type Compute, Cursor$1 as Cursor, Errors, Format, Health, LLTV$1 as LLTV, Liquidity, LiquidityStore$1 as LiquidityStore, Logger$1 as Logger, Maturity$1 as Maturity, index$1 as Mempool, Obligation$1 as Obligation, ObligationResponse$1 as ObligationResponse, Offer$1 as Offer, OfferResponse$1 as OfferResponse, OfferStore$1 as OfferStore, schema as OffersSchema, OpenApi, PG$1 as PG, Quote$1 as Quote, RouterApi, Client$2 as RouterClient, RouterIndexer, RouterStatusResponse, Services$1 as Services, time as Time, index as Utils, Validation, ValidationRule, parse, safeParse };
|