@morpho-dev/router 0.1.15 → 0.1.17
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 +623 -371
- package/dist/cli.js.map +1 -1
- package/dist/index.browser.d.cts +160 -79
- package/dist/index.browser.d.ts +160 -79
- package/dist/index.browser.js +353 -214
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +354 -216
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.cts +216 -440
- package/dist/index.node.d.ts +216 -440
- package/dist/index.node.js +5421 -5892
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +5420 -5889
- package/dist/index.node.mjs.map +1 -1
- package/package.json +11 -12
package/dist/index.node.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions
|
|
1
|
+
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions } from 'viem';
|
|
2
2
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
3
3
|
import { PGlite } from '@electric-sql/pglite';
|
|
4
4
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
@@ -6,7 +6,7 @@ import { drizzle as drizzle$1 } from 'drizzle-orm/pglite';
|
|
|
6
6
|
import { Pool } from 'pg';
|
|
7
7
|
import * as z from 'zod';
|
|
8
8
|
import { z as z$1 } from 'zod/v4';
|
|
9
|
-
import * as
|
|
9
|
+
import * as node_modules_zod_openapi_dist_components_CXzxKPFp_js from 'node_modules/zod-openapi/dist/components-CXzxKPFp.js';
|
|
10
10
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
11
11
|
|
|
12
12
|
declare const Oracle: readonly [{
|
|
@@ -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,7 +576,7 @@ 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.
|
|
@@ -610,7 +590,7 @@ declare function toSnakeCase(offer: Offer): Snake<Offer>;
|
|
|
610
590
|
* @warning The generated Offer should not be used for production usage.
|
|
611
591
|
* @returns {Offer} A randomly generated Offer object.
|
|
612
592
|
*/
|
|
613
|
-
declare function random$
|
|
593
|
+
declare function random$2(): Offer;
|
|
614
594
|
/**
|
|
615
595
|
* Creates an EIP-712 domain object.
|
|
616
596
|
* @param chainId - The chain ID.
|
|
@@ -701,8 +681,8 @@ declare function hash(offer: Omit<Offer, "hash">): Hex;
|
|
|
701
681
|
* @returns The obligation id as a 32-byte hex string.
|
|
702
682
|
*/
|
|
703
683
|
declare function obligationId(offer: Offer): Hex;
|
|
704
|
-
declare function encode(offer: Offer): `0x${string}`;
|
|
705
|
-
declare function decode(data: Hex, blockNumber: number | bigint): Offer;
|
|
684
|
+
declare function encode$1(offer: Offer): `0x${string}`;
|
|
685
|
+
declare function decode$1(data: Hex, blockNumber: number | bigint): Offer;
|
|
706
686
|
type OfferConsumed = {
|
|
707
687
|
id: string;
|
|
708
688
|
chainId: bigint;
|
|
@@ -762,9 +742,7 @@ type Offer$1_OfferConsumed = OfferConsumed;
|
|
|
762
742
|
declare const Offer$1_OfferHashSchema: typeof OfferHashSchema;
|
|
763
743
|
declare const Offer$1_OfferSchema: typeof OfferSchema;
|
|
764
744
|
declare const Offer$1_consumedEvent: typeof consumedEvent;
|
|
765
|
-
declare const Offer$1_decode: typeof decode;
|
|
766
745
|
declare const Offer$1_domain: typeof domain;
|
|
767
|
-
declare const Offer$1_encode: typeof encode;
|
|
768
746
|
declare const Offer$1_fromConsumedLog: typeof fromConsumedLog;
|
|
769
747
|
declare const Offer$1_hash: typeof hash;
|
|
770
748
|
declare const Offer$1_obligationId: typeof obligationId;
|
|
@@ -772,7 +750,7 @@ declare const Offer$1_sign: typeof sign;
|
|
|
772
750
|
declare const Offer$1_toSnakeCase: typeof toSnakeCase;
|
|
773
751
|
declare const Offer$1_types: typeof types;
|
|
774
752
|
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,
|
|
753
|
+
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, 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
754
|
}
|
|
777
755
|
|
|
778
756
|
/**
|
|
@@ -952,17 +930,17 @@ declare const ObligationSchema: z.ZodObject<{
|
|
|
952
930
|
* });
|
|
953
931
|
* ```
|
|
954
932
|
*/
|
|
955
|
-
declare function from$
|
|
956
|
-
declare namespace from$
|
|
933
|
+
declare function from$5(parameters: from$5.Parameters): from$5.ReturnType;
|
|
934
|
+
declare namespace from$5 {
|
|
957
935
|
type Parameters = {
|
|
958
936
|
/** The chain id where the liquidity for this obligation is located. */
|
|
959
937
|
chainId: Id;
|
|
960
938
|
/** The token that is being borrowed for this obligation. */
|
|
961
939
|
loanToken: Address;
|
|
962
940
|
/** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
963
|
-
collaterals: from$
|
|
941
|
+
collaterals: from$8.Parameters[] | readonly from$8.Parameters[];
|
|
964
942
|
/** The maturity of the obligation. */
|
|
965
|
-
maturity: from$
|
|
943
|
+
maturity: from$7.Parameters;
|
|
966
944
|
};
|
|
967
945
|
type ReturnType = Obligation;
|
|
968
946
|
type ErrorType = InvalidObligationError;
|
|
@@ -973,8 +951,8 @@ declare namespace from$4 {
|
|
|
973
951
|
* @param input - {@link fromSnakeCase.Parameters}
|
|
974
952
|
* @returns The created obligation. {@link fromSnakeCase.ReturnType}
|
|
975
953
|
*/
|
|
976
|
-
declare function fromSnakeCase(input: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
977
|
-
declare namespace fromSnakeCase {
|
|
954
|
+
declare function fromSnakeCase$1(input: fromSnakeCase$1.Parameters): fromSnakeCase$1.ReturnType;
|
|
955
|
+
declare namespace fromSnakeCase$1 {
|
|
978
956
|
type Parameters = Snake<Obligation>;
|
|
979
957
|
type ReturnType = Obligation;
|
|
980
958
|
type ErrorType = InvalidObligationError;
|
|
@@ -1008,8 +986,8 @@ declare namespace id {
|
|
|
1008
986
|
* const obligation = Obligation.random();
|
|
1009
987
|
* ```
|
|
1010
988
|
*/
|
|
1011
|
-
declare function random(): random.ReturnType;
|
|
1012
|
-
declare namespace random {
|
|
989
|
+
declare function random$1(): random$1.ReturnType;
|
|
990
|
+
declare namespace random$1 {
|
|
1013
991
|
type ReturnType = Obligation;
|
|
1014
992
|
}
|
|
1015
993
|
declare class InvalidObligationError extends BaseError<z.ZodError | Error> {
|
|
@@ -1027,11 +1005,90 @@ type Obligation$1_InvalidObligationError = InvalidObligationError;
|
|
|
1027
1005
|
declare const Obligation$1_InvalidObligationError: typeof InvalidObligationError;
|
|
1028
1006
|
type Obligation$1_Obligation = Obligation;
|
|
1029
1007
|
declare const Obligation$1_ObligationSchema: typeof ObligationSchema;
|
|
1030
|
-
declare const Obligation$1_fromSnakeCase: typeof fromSnakeCase;
|
|
1031
1008
|
declare const Obligation$1_id: typeof id;
|
|
1032
|
-
declare const Obligation$1_random: typeof random;
|
|
1033
1009
|
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$
|
|
1010
|
+
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 };
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
type Quote = {
|
|
1014
|
+
/** The obligation id. */
|
|
1015
|
+
obligationId: Hex;
|
|
1016
|
+
ask: {
|
|
1017
|
+
/** The highest interest rate the seller will accept to pay for the obligation. (18 decimals). */
|
|
1018
|
+
rate: bigint;
|
|
1019
|
+
};
|
|
1020
|
+
bid: {
|
|
1021
|
+
/** The lowest interest rate a buyer is willing to be paid for the obligation. (18 decimals). */
|
|
1022
|
+
rate: bigint;
|
|
1023
|
+
};
|
|
1024
|
+
};
|
|
1025
|
+
declare const QuoteSchema: z.ZodObject<{
|
|
1026
|
+
obligationId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
1027
|
+
ask: z.ZodObject<{
|
|
1028
|
+
rate: z.ZodBigInt;
|
|
1029
|
+
}, z.core.$strip>;
|
|
1030
|
+
bid: z.ZodObject<{
|
|
1031
|
+
rate: z.ZodBigInt;
|
|
1032
|
+
}, z.core.$strip>;
|
|
1033
|
+
}, z.core.$strip>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Creates a quote for a given obligation.
|
|
1036
|
+
* @constructor
|
|
1037
|
+
* @param parameters - {@link from.Parameters}
|
|
1038
|
+
* @returns The created quote. {@link Quote}
|
|
1039
|
+
* @throws If the quote is invalid. {@link InvalidQuoteError}
|
|
1040
|
+
*
|
|
1041
|
+
* @example
|
|
1042
|
+
* ```ts
|
|
1043
|
+
* const quote = Quote.from({ obligationId: "0x123", ask: { assets: 100n, rate: 100n }, bid: { assets: 100n, rate: 100n } });
|
|
1044
|
+
* ```
|
|
1045
|
+
*/
|
|
1046
|
+
declare function from$4(parameters: from$4.Parameters): from$4.ReturnType;
|
|
1047
|
+
declare namespace from$4 {
|
|
1048
|
+
type Parameters = Quote;
|
|
1049
|
+
type ReturnType = Quote;
|
|
1050
|
+
type ErrorType = InvalidQuoteError;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Creates a quote from a snake case object.
|
|
1054
|
+
* @throws If the quote is invalid. {@link InvalidQuoteError}
|
|
1055
|
+
* @param snake - {@link fromSnakeCase.Parameters}
|
|
1056
|
+
* @returns The created quote. {@link fromSnakeCase.ReturnType}
|
|
1057
|
+
*/
|
|
1058
|
+
declare function fromSnakeCase(snake: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
1059
|
+
declare namespace fromSnakeCase {
|
|
1060
|
+
type Parameters = Snake<Quote>;
|
|
1061
|
+
type ReturnType = Quote;
|
|
1062
|
+
type ErrorType = from$4.ErrorType;
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Generates a random quote.
|
|
1066
|
+
* @returns A randomly generated quote. {@link random.ReturnType}
|
|
1067
|
+
*
|
|
1068
|
+
* @example
|
|
1069
|
+
* ```ts
|
|
1070
|
+
* const quote = Quote.random();
|
|
1071
|
+
* ```
|
|
1072
|
+
*/
|
|
1073
|
+
declare function random(): random.ReturnType;
|
|
1074
|
+
declare namespace random {
|
|
1075
|
+
type Parameters = never;
|
|
1076
|
+
type ReturnType = Quote;
|
|
1077
|
+
type ErrorType = from$4.ErrorType;
|
|
1078
|
+
}
|
|
1079
|
+
declare class InvalidQuoteError extends BaseError<z.ZodError | Error> {
|
|
1080
|
+
readonly name = "Quote.InvalidQuoteError";
|
|
1081
|
+
constructor(error: z.ZodError | Error);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
type Quote$1_InvalidQuoteError = InvalidQuoteError;
|
|
1085
|
+
declare const Quote$1_InvalidQuoteError: typeof InvalidQuoteError;
|
|
1086
|
+
type Quote$1_Quote = Quote;
|
|
1087
|
+
declare const Quote$1_QuoteSchema: typeof QuoteSchema;
|
|
1088
|
+
declare const Quote$1_fromSnakeCase: typeof fromSnakeCase;
|
|
1089
|
+
declare const Quote$1_random: typeof random;
|
|
1090
|
+
declare namespace Quote$1 {
|
|
1091
|
+
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
1092
|
}
|
|
1036
1093
|
|
|
1037
1094
|
type Indexer = {
|
|
@@ -1055,7 +1112,7 @@ type PGLiteDB = ReturnType<typeof drizzle$1> & {
|
|
|
1055
1112
|
pool: PGlite;
|
|
1056
1113
|
};
|
|
1057
1114
|
type PG = PgDB | PGLiteDB;
|
|
1058
|
-
declare function connect$
|
|
1115
|
+
declare function connect$1(parameters: {
|
|
1059
1116
|
type: "pg";
|
|
1060
1117
|
endpoint: string;
|
|
1061
1118
|
} | {
|
|
@@ -1070,7 +1127,7 @@ type PG$1_PgDB = PgDB;
|
|
|
1070
1127
|
declare const PG$1_applyMigrations: typeof applyMigrations;
|
|
1071
1128
|
declare const PG$1_clean: typeof clean;
|
|
1072
1129
|
declare namespace PG$1 {
|
|
1073
|
-
export { type PG$1_PG as PG, type PG$1_PGLiteDB as PGLiteDB, type PG$1_PgDB as PgDB, PG$1_applyMigrations as applyMigrations, PG$1_clean as clean, connect$
|
|
1130
|
+
export { type PG$1_PG as PG, type PG$1_PGLiteDB as PGLiteDB, type PG$1_PgDB as PgDB, PG$1_applyMigrations as applyMigrations, PG$1_clean as clean, connect$1 as connect };
|
|
1074
1131
|
}
|
|
1075
1132
|
|
|
1076
1133
|
type ChainStore = {
|
|
@@ -1238,6 +1295,10 @@ type OfferStore = {
|
|
|
1238
1295
|
obligations: Obligation[];
|
|
1239
1296
|
nextCursor: string | null;
|
|
1240
1297
|
}>;
|
|
1298
|
+
/** Get quotes for given obligations. */
|
|
1299
|
+
getQuotes: (parameters: {
|
|
1300
|
+
obligationIds: Hex[];
|
|
1301
|
+
}) => Promise<Quote[]>;
|
|
1241
1302
|
};
|
|
1242
1303
|
type GetOffersFilters = {
|
|
1243
1304
|
creators?: string[];
|
|
@@ -1321,7 +1382,7 @@ type Services = {
|
|
|
1321
1382
|
buyVaultV1CallbackLiquidityCollector: Collector<"buy_vault_v1_callback_liquidity">;
|
|
1322
1383
|
sellERC20CallbackLiquidityCollector: Collector<"sell_erc20_callback_liquidity">;
|
|
1323
1384
|
DB: PG;
|
|
1324
|
-
routerApi: RouterApi;
|
|
1385
|
+
routerApi: RouterApi$1;
|
|
1325
1386
|
};
|
|
1326
1387
|
declare function from$3(config: ServicesConfig): Services;
|
|
1327
1388
|
type Stores = ReturnType<typeof createStores>;
|
|
@@ -1624,32 +1685,32 @@ declare namespace Validation {
|
|
|
1624
1685
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
1625
1686
|
}
|
|
1626
1687
|
|
|
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$
|
|
1688
|
+
type index$3_Batch<T, RuleName extends string, Ctx = void> = Batch<T, RuleName, Ctx>;
|
|
1689
|
+
type index$3_Builder<chain extends Chain = Chain> = Builder<chain>;
|
|
1690
|
+
type index$3_CollectFn<chain extends Chain, collector extends Name> = CollectFn<chain, collector>;
|
|
1691
|
+
type index$3_CollectParameters<chain extends Chain, collector extends Name> = CollectParameters<chain, collector>;
|
|
1692
|
+
type index$3_Collector<name extends Name = Name, chain extends Chain = Chain> = Collector<name, chain>;
|
|
1693
|
+
type index$3_Issue<T, RuleName extends string = string> = Issue<T, RuleName>;
|
|
1694
|
+
type index$3_MorphoContext = MorphoContext;
|
|
1695
|
+
type index$3_Name = Name;
|
|
1696
|
+
type index$3_Result<T, RuleName extends string = string> = Result<T, RuleName>;
|
|
1697
|
+
type index$3_Rule<T, Name extends string = string, Ctx = void> = Rule<T, Name, Ctx>;
|
|
1698
|
+
type index$3_RuleNames<Rules extends readonly {
|
|
1638
1699
|
name: string;
|
|
1639
1700
|
}[]> = 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$
|
|
1701
|
+
type index$3_Single<T, RuleName extends string, Ctx = void> = Single<T, RuleName, Ctx>;
|
|
1702
|
+
declare const index$3_createBuilder: typeof createBuilder;
|
|
1703
|
+
declare const index$3_fetchBalancesAndAllowances: typeof fetchBalancesAndAllowances;
|
|
1704
|
+
declare const index$3_fetchCollateralAndDebt: typeof fetchCollateralAndDebt;
|
|
1705
|
+
declare const index$3_fetchOraclePrices: typeof fetchOraclePrices;
|
|
1706
|
+
declare const index$3_fetchUserVaultMarketLiquidity: typeof fetchUserVaultMarketLiquidity;
|
|
1707
|
+
declare const index$3_morpho: typeof morpho;
|
|
1708
|
+
declare const index$3_names: typeof names;
|
|
1709
|
+
declare const index$3_run: typeof run;
|
|
1710
|
+
declare const index$3_single: typeof single;
|
|
1711
|
+
declare const index$3_start: typeof start;
|
|
1712
|
+
declare namespace index$3 {
|
|
1713
|
+
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
1714
|
}
|
|
1654
1715
|
|
|
1655
1716
|
type CollectorHealthStatus = "live" | "lagging" | "unknown";
|
|
@@ -1696,12 +1757,15 @@ type RouterApiConfig = {
|
|
|
1696
1757
|
store: OfferStore;
|
|
1697
1758
|
healthService: HealthService;
|
|
1698
1759
|
};
|
|
1699
|
-
type RouterApi = {
|
|
1760
|
+
type RouterApi$1 = {
|
|
1700
1761
|
serve: (parameters: {
|
|
1701
1762
|
port: number;
|
|
1702
1763
|
}) => void;
|
|
1703
1764
|
};
|
|
1704
|
-
declare function create(config: RouterApiConfig): RouterApi;
|
|
1765
|
+
declare function create(config: RouterApiConfig): RouterApi$1;
|
|
1766
|
+
|
|
1767
|
+
declare function getSwaggerJson(): unknown;
|
|
1768
|
+
declare function getDocsHtml(): string;
|
|
1705
1769
|
|
|
1706
1770
|
declare const LogLevelValues: readonly ["trace", "debug", "info", "warn", "error", "fatal", "silent"];
|
|
1707
1771
|
type LogLevel = (typeof LogLevelValues)[number];
|
|
@@ -1797,7 +1861,7 @@ declare function getHealthCollectors(healthService: HealthService): Promise<{
|
|
|
1797
1861
|
});
|
|
1798
1862
|
}>;
|
|
1799
1863
|
|
|
1800
|
-
declare function getObligations
|
|
1864
|
+
declare function getObligations(queryParameters: object, store: OfferStore): Promise<{
|
|
1801
1865
|
statusCode: STATUS_CODE;
|
|
1802
1866
|
body: {
|
|
1803
1867
|
status: "success" | "error";
|
|
@@ -1816,7 +1880,7 @@ declare function getObligations$1(queryParameters: object, store: OfferStore): P
|
|
|
1816
1880
|
});
|
|
1817
1881
|
}>;
|
|
1818
1882
|
|
|
1819
|
-
declare function getOffers
|
|
1883
|
+
declare function getOffers(queryParameters: object, store: OfferStore): Promise<{
|
|
1820
1884
|
statusCode: STATUS_CODE;
|
|
1821
1885
|
body: {
|
|
1822
1886
|
status: "success" | "error";
|
|
@@ -1835,11 +1899,15 @@ declare function getOffers$1(queryParameters: object, store: OfferStore): Promis
|
|
|
1835
1899
|
});
|
|
1836
1900
|
}>;
|
|
1837
1901
|
|
|
1838
|
-
declare const index$
|
|
1839
|
-
declare const index$
|
|
1840
|
-
declare const index$
|
|
1841
|
-
declare
|
|
1842
|
-
|
|
1902
|
+
declare const index$2_getDocsHtml: typeof getDocsHtml;
|
|
1903
|
+
declare const index$2_getHealth: typeof getHealth;
|
|
1904
|
+
declare const index$2_getHealthChains: typeof getHealthChains;
|
|
1905
|
+
declare const index$2_getHealthCollectors: typeof getHealthCollectors;
|
|
1906
|
+
declare const index$2_getObligations: typeof getObligations;
|
|
1907
|
+
declare const index$2_getOffers: typeof getOffers;
|
|
1908
|
+
declare const index$2_getSwaggerJson: typeof getSwaggerJson;
|
|
1909
|
+
declare namespace index$2 {
|
|
1910
|
+
export { index$2_getDocsHtml as getDocsHtml, index$2_getHealth as getHealth, index$2_getHealthChains as getHealthChains, index$2_getHealthCollectors as getHealthCollectors, index$2_getObligations as getObligations, index$2_getOffers as getOffers, index$2_getSwaggerJson as getSwaggerJson };
|
|
1843
1911
|
}
|
|
1844
1912
|
|
|
1845
1913
|
declare const CollectorHealth: z$1.ZodObject<{
|
|
@@ -1859,28 +1927,24 @@ declare const ChainHealth: z$1.ZodObject<{
|
|
|
1859
1927
|
block_number: z$1.ZodNumber;
|
|
1860
1928
|
updated_at: z$1.ZodString;
|
|
1861
1929
|
}, 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>;
|
|
1930
|
+
declare const CollectorsHealthResponse: z$1.ZodArray<z$1.ZodObject<{
|
|
1931
|
+
name: z$1.ZodString;
|
|
1932
|
+
chain_id: z$1.ZodNumber;
|
|
1933
|
+
block_number: z$1.ZodNullable<z$1.ZodNumber>;
|
|
1934
|
+
updated_at: z$1.ZodNullable<z$1.ZodString>;
|
|
1935
|
+
lag: z$1.ZodNullable<z$1.ZodNumber>;
|
|
1936
|
+
status: z$1.ZodEnum<{
|
|
1937
|
+
unknown: "unknown";
|
|
1938
|
+
live: "live";
|
|
1939
|
+
lagging: "lagging";
|
|
1940
|
+
}>;
|
|
1941
|
+
}, z$1.core.$strip>>;
|
|
1876
1942
|
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>;
|
|
1943
|
+
declare const ChainsHealthResponse: z$1.ZodArray<z$1.ZodObject<{
|
|
1944
|
+
chain_id: z$1.ZodNumber;
|
|
1945
|
+
block_number: z$1.ZodNumber;
|
|
1946
|
+
updated_at: z$1.ZodString;
|
|
1947
|
+
}, z$1.core.$strip>>;
|
|
1884
1948
|
type ChainsHealthResponse = z$1.infer<typeof ChainsHealthResponse>;
|
|
1885
1949
|
declare const RouterStatusResponse: z$1.ZodObject<{
|
|
1886
1950
|
status: z$1.ZodEnum<{
|
|
@@ -1893,14 +1957,17 @@ type RouterStatusResponse = z$1.infer<typeof RouterStatusResponse>;
|
|
|
1893
1957
|
type ObligationResponse = Snake<Compute<{
|
|
1894
1958
|
/** The obligation id. */
|
|
1895
1959
|
id: Hex;
|
|
1896
|
-
} & Obligation
|
|
1960
|
+
} & Obligation & {
|
|
1961
|
+
ask: Quote["ask"];
|
|
1962
|
+
bid: Quote["bid"];
|
|
1963
|
+
}>>;
|
|
1897
1964
|
/**
|
|
1898
1965
|
* Creates an `ObligationResponse` from a `Obligation`.
|
|
1899
1966
|
* @constructor
|
|
1900
1967
|
* @param obligation - {@link Obligation}
|
|
1901
1968
|
* @returns The created `ObligationResponse`. {@link ObligationResponse}
|
|
1902
1969
|
*/
|
|
1903
|
-
declare function from$2(obligation: Obligation): ObligationResponse;
|
|
1970
|
+
declare function from$2(obligation: Obligation, quote: Quote): ObligationResponse;
|
|
1904
1971
|
|
|
1905
1972
|
type ObligationResponse$1_ObligationResponse = ObligationResponse;
|
|
1906
1973
|
declare namespace ObligationResponse$1 {
|
|
@@ -1921,7 +1988,7 @@ declare namespace OfferResponse$1 {
|
|
|
1921
1988
|
export { type OfferResponse$1_OfferResponse as OfferResponse, from$1 as from };
|
|
1922
1989
|
}
|
|
1923
1990
|
|
|
1924
|
-
declare const OpenApi:
|
|
1991
|
+
declare const OpenApi: node_modules_zod_openapi_dist_components_CXzxKPFp_js.OpenAPIObject;
|
|
1925
1992
|
|
|
1926
1993
|
declare const schemas: {
|
|
1927
1994
|
readonly get_offers: z.ZodObject<{
|
|
@@ -1942,331 +2009,18 @@ type Action = keyof typeof schemas;
|
|
|
1942
2009
|
declare function parse<A extends Action>(action: A, query: unknown): z.infer<(typeof schemas)[A]>;
|
|
1943
2010
|
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
2011
|
|
|
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 };
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
type RouterClientConfig = {
|
|
1961
|
-
/** The URL of the router. */
|
|
1962
|
-
readonly url: URL;
|
|
1963
|
-
/** The default headers to use for each request. */
|
|
1964
|
-
readonly headers: Headers;
|
|
1965
|
-
};
|
|
1966
|
-
type Client$1 = Compute<RouterClientConfig & {
|
|
1967
|
-
/**
|
|
1968
|
-
* Get offers from the router.
|
|
1969
|
-
* @param parameters - {@link getOffers.Parameters}
|
|
1970
|
-
* @returns The offers with pagination cursor. {@link getOffers.ReturnType}
|
|
1971
|
-
*
|
|
1972
|
-
* @example
|
|
1973
|
-
* ```ts
|
|
1974
|
-
* const router = RouterClient.connect({ url: "https://router.morpho.dev" });
|
|
1975
|
-
* const { offers, cursor } = await router.getOffers({ side: "buy", obligationId: "0xa1c...d2f" });
|
|
1976
|
-
* console.log(offers);
|
|
1977
|
-
* ```
|
|
1978
|
-
*/
|
|
1979
|
-
getOffers: (parameters: getOffers.Parameters) => Promise<getOffers.ReturnType>;
|
|
1980
|
-
/**
|
|
1981
|
-
* Get obligations from the router.
|
|
1982
|
-
* @param parameters - {@link getObligations.Parameters}
|
|
1983
|
-
* @returns The obligations with pagination cursor. {@link getObligations.ReturnType}
|
|
1984
|
-
*
|
|
1985
|
-
* @example
|
|
1986
|
-
* ```ts
|
|
1987
|
-
* const router = RouterClient.connect({ url: "https://router.morpho.dev" });
|
|
1988
|
-
* const { obligations, cursor } = await router.getObligations();
|
|
1989
|
-
* console.log(obligations);
|
|
1990
|
-
* ```
|
|
1991
|
-
*/
|
|
1992
|
-
getObligations: (parameters?: getObligations.Parameters) => Promise<getObligations.ReturnType>;
|
|
1993
|
-
}>;
|
|
1994
|
-
type ConnectOptions = {
|
|
1995
|
-
/** The URL of the router to interact with.
|
|
1996
|
-
* @default "https://router.morpho.dev"
|
|
1997
|
-
*/
|
|
1998
|
-
url?: string;
|
|
1999
|
-
/** The API key to use for the router API. */
|
|
2000
|
-
apiKey?: string;
|
|
2001
|
-
/** The default headers to use for each request. */
|
|
2002
|
-
headers?: Headers;
|
|
2003
|
-
};
|
|
2004
|
-
/**
|
|
2005
|
-
* Creates an instance of a router client.
|
|
2006
|
-
* @constructor
|
|
2007
|
-
* @param options - {@link ConnectOptions}
|
|
2008
|
-
* @returns A Router Client. {@link Client}
|
|
2009
|
-
*
|
|
2010
|
-
* @example
|
|
2011
|
-
* ```typescript
|
|
2012
|
-
* const router = RouterClient.connect({ url: "https://router.morpho.dev" });
|
|
2013
|
-
* ```
|
|
2014
|
-
*/
|
|
2015
|
-
declare function connect$1(options?: ConnectOptions): connect$1.ReturnType;
|
|
2016
|
-
declare namespace connect$1 {
|
|
2017
|
-
type ReturnType = Client$1;
|
|
2018
|
-
type ErrorType = InvalidUrlError;
|
|
2019
|
-
}
|
|
2020
|
-
declare function getOffers(config: RouterClientConfig, parameters: getOffers.Parameters): Promise<getOffers.ReturnType>;
|
|
2021
|
-
declare namespace getOffers {
|
|
2022
|
-
type Parameters = {
|
|
2023
|
-
/** The desired side of the match: 'buy' if you want to buy, 'sell' if you want to sell */
|
|
2024
|
-
side: "buy" | "sell";
|
|
2025
|
-
/** The offers obligation id */
|
|
2026
|
-
obligationId: Hex;
|
|
2027
|
-
/** Pagination cursor in base64url-encoded format */
|
|
2028
|
-
cursor?: string;
|
|
2029
|
-
/** Maximum number of offers to return. @default 20 */
|
|
2030
|
-
limit?: number;
|
|
2031
|
-
};
|
|
2032
|
-
type ReturnType = {
|
|
2033
|
-
offers: Offer[];
|
|
2034
|
-
/** The pagination cursor. */
|
|
2035
|
-
cursor: string | null;
|
|
2036
|
-
};
|
|
2037
|
-
type ErrorType = GetApiErrorType;
|
|
2038
|
-
}
|
|
2039
|
-
declare function getObligations(config: RouterClientConfig, parameters?: getObligations.Parameters): Promise<getObligations.ReturnType>;
|
|
2040
|
-
declare namespace getObligations {
|
|
2041
|
-
type Parameters = {
|
|
2042
|
-
/** Pagination cursor is a 32-byte hex string. */
|
|
2043
|
-
cursor?: Hex;
|
|
2044
|
-
/** Maximum number of obligations to return. @default 20 */
|
|
2045
|
-
limit?: number;
|
|
2046
|
-
};
|
|
2047
|
-
type ReturnType = {
|
|
2048
|
-
obligations: Obligation[];
|
|
2049
|
-
/** The pagination cursor. */
|
|
2050
|
-
cursor: string | null;
|
|
2051
|
-
};
|
|
2052
|
-
type ErrorType = GetApiErrorType;
|
|
2053
|
-
}
|
|
2054
|
-
type GetApiErrorType = HttpGetApiFailedError | HttpUnauthorizedError | HttpForbiddenError | HttpRateLimitError;
|
|
2055
|
-
declare class InvalidUrlError extends BaseError {
|
|
2056
|
-
name: string;
|
|
2057
|
-
constructor(url: string);
|
|
2058
|
-
}
|
|
2059
|
-
declare class HttpUnauthorizedError extends BaseError {
|
|
2060
|
-
name: string;
|
|
2061
|
-
constructor();
|
|
2062
|
-
}
|
|
2063
|
-
declare class HttpForbiddenError extends BaseError {
|
|
2064
|
-
name: string;
|
|
2065
|
-
constructor();
|
|
2066
|
-
}
|
|
2067
|
-
declare class HttpRateLimitError extends BaseError {
|
|
2068
|
-
name: string;
|
|
2069
|
-
constructor();
|
|
2070
|
-
}
|
|
2071
|
-
declare class HttpGetApiFailedError extends BaseError {
|
|
2072
|
-
name: string;
|
|
2073
|
-
constructor(message: string, { details }?: {
|
|
2074
|
-
details?: string;
|
|
2075
|
-
});
|
|
2076
|
-
}
|
|
2077
|
-
|
|
2078
|
-
type Client$2_ConnectOptions = ConnectOptions;
|
|
2079
|
-
type Client$2_HttpForbiddenError = HttpForbiddenError;
|
|
2080
|
-
declare const Client$2_HttpForbiddenError: typeof HttpForbiddenError;
|
|
2081
|
-
type Client$2_HttpGetApiFailedError = HttpGetApiFailedError;
|
|
2082
|
-
declare const Client$2_HttpGetApiFailedError: typeof HttpGetApiFailedError;
|
|
2083
|
-
type Client$2_HttpRateLimitError = HttpRateLimitError;
|
|
2084
|
-
declare const Client$2_HttpRateLimitError: typeof HttpRateLimitError;
|
|
2085
|
-
type Client$2_HttpUnauthorizedError = HttpUnauthorizedError;
|
|
2086
|
-
declare const Client$2_HttpUnauthorizedError: typeof HttpUnauthorizedError;
|
|
2087
|
-
type Client$2_InvalidUrlError = InvalidUrlError;
|
|
2088
|
-
declare const Client$2_InvalidUrlError: typeof InvalidUrlError;
|
|
2089
|
-
declare const Client$2_getObligations: typeof getObligations;
|
|
2090
|
-
declare const Client$2_getOffers: typeof getOffers;
|
|
2091
|
-
declare namespace Client$2 {
|
|
2092
|
-
export { type Client$1 as Client, type Client$2_ConnectOptions as ConnectOptions, Client$2_HttpForbiddenError as HttpForbiddenError, Client$2_HttpGetApiFailedError as HttpGetApiFailedError, Client$2_HttpRateLimitError as HttpRateLimitError, Client$2_HttpUnauthorizedError as HttpUnauthorizedError, Client$2_InvalidUrlError as InvalidUrlError, connect$1 as connect, Client$2_getObligations as getObligations, Client$2_getOffers as getOffers };
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
declare const users: Account[];
|
|
2096
|
-
declare const assetList: readonly ["USDC", "DAI"];
|
|
2097
|
-
declare const mockAddress: (asset: (typeof assetList)[number]) => `0x${string}`;
|
|
2098
|
-
declare const mockOracleAddress: `0x${string}`;
|
|
2099
|
-
declare const mockMorphoAddress: `0x${string}`;
|
|
2100
|
-
declare const mockFactoryAddress: `0x${string}`;
|
|
2101
|
-
declare const encodeConsumedEvent: (parameters: {
|
|
2102
|
-
user: Address;
|
|
2103
|
-
nonce: bigint;
|
|
2104
|
-
amount: bigint;
|
|
2105
|
-
}) => `0x${string}`;
|
|
2106
|
-
declare const assetMethods: readonly ["balanceOf", "allowance"];
|
|
2107
|
-
declare const oracleMethods: readonly ["price"];
|
|
2108
|
-
declare const morphoMethods: readonly ["debtOf", "collateralOf", "market", "position"];
|
|
2109
|
-
declare const vaultMethods: readonly ["asset", "balanceOf", "totalSupply", "totalAssets", "withdrawQueue"];
|
|
2110
|
-
declare const factoryMethods: readonly ["isMetaMorpho", "morpho"];
|
|
2111
|
-
type AssetMethod = (typeof assetMethods)[number];
|
|
2112
|
-
type OracleMethod = (typeof oracleMethods)[number];
|
|
2113
|
-
type MorphoMethod = (typeof morphoMethods)[number];
|
|
2114
|
-
type VaultMethod = (typeof vaultMethods)[number];
|
|
2115
|
-
type FactoryMethod = (typeof factoryMethods)[number];
|
|
2116
|
-
type MethodParameters = {
|
|
2117
|
-
balanceOf: {
|
|
2118
|
-
address: Address;
|
|
2119
|
-
value: bigint;
|
|
2120
|
-
};
|
|
2121
|
-
allowance: {
|
|
2122
|
-
owner: Address;
|
|
2123
|
-
spender: Address;
|
|
2124
|
-
value: bigint;
|
|
2125
|
-
};
|
|
2126
|
-
};
|
|
2127
|
-
type OracleMethodParameters = {
|
|
2128
|
-
price: {
|
|
2129
|
-
value: bigint;
|
|
2130
|
-
};
|
|
2131
|
-
};
|
|
2132
|
-
type MorphoMethodParameters = {
|
|
2133
|
-
debtOf: {
|
|
2134
|
-
user: Address;
|
|
2135
|
-
obligationId: Hex;
|
|
2136
|
-
value: bigint;
|
|
2137
|
-
};
|
|
2138
|
-
collateralOf: {
|
|
2139
|
-
user: Address;
|
|
2140
|
-
obligationId: Hex;
|
|
2141
|
-
collateralAsset: Address;
|
|
2142
|
-
value: bigint;
|
|
2143
|
-
};
|
|
2144
|
-
market: {
|
|
2145
|
-
marketId: Hex;
|
|
2146
|
-
totalSupplyAssets: bigint;
|
|
2147
|
-
totalSupplyShares: bigint;
|
|
2148
|
-
totalBorrowAssets: bigint;
|
|
2149
|
-
totalBorrowShares: bigint;
|
|
2150
|
-
lastUpdate: bigint;
|
|
2151
|
-
fee: bigint;
|
|
2152
|
-
};
|
|
2153
|
-
position: {
|
|
2154
|
-
marketId: Hex;
|
|
2155
|
-
user: Address;
|
|
2156
|
-
supplyShares: bigint;
|
|
2157
|
-
borrowShares: bigint;
|
|
2158
|
-
collateral: bigint;
|
|
2159
|
-
};
|
|
2160
|
-
};
|
|
2161
|
-
type VaultMethodParameters = {
|
|
2162
|
-
asset: {
|
|
2163
|
-
value: Address;
|
|
2164
|
-
};
|
|
2165
|
-
balanceOf: {
|
|
2166
|
-
user: Address;
|
|
2167
|
-
value: bigint;
|
|
2168
|
-
};
|
|
2169
|
-
totalSupply: {
|
|
2170
|
-
value: bigint;
|
|
2171
|
-
};
|
|
2172
|
-
totalAssets: {
|
|
2173
|
-
value: bigint;
|
|
2174
|
-
};
|
|
2175
|
-
withdrawQueue: {
|
|
2176
|
-
value: Hex[];
|
|
2177
|
-
};
|
|
2178
|
-
};
|
|
2179
|
-
type FactoryMethodParameters = {
|
|
2180
|
-
isMetaMorpho: {
|
|
2181
|
-
vault: Address;
|
|
2182
|
-
value: boolean;
|
|
2183
|
-
};
|
|
2184
|
-
morpho: {
|
|
2185
|
-
value: Address;
|
|
2186
|
-
};
|
|
2187
|
-
};
|
|
2188
|
-
type MockedAsset = {
|
|
2189
|
-
address: Address;
|
|
2190
|
-
set: (slot: Hex | AssetMethod, parameters: Hex | bigint | MethodParameters[AssetMethod]) => Promise<void>;
|
|
2191
|
-
};
|
|
2192
|
-
type MockedOracle = {
|
|
2193
|
-
address: Address;
|
|
2194
|
-
set: (method: OracleMethod, parameters: OracleMethodParameters[OracleMethod]) => Promise<void>;
|
|
2195
|
-
};
|
|
2196
|
-
type MockedMorpho = {
|
|
2197
|
-
address: Address;
|
|
2198
|
-
set: (method: MorphoMethod, parameters: MorphoMethodParameters[MorphoMethod]) => Promise<void>;
|
|
2199
|
-
};
|
|
2200
|
-
type MockedVault = {
|
|
2201
|
-
address: Address;
|
|
2202
|
-
set: (method: VaultMethod, parameters: VaultMethodParameters[VaultMethod]) => Promise<void>;
|
|
2203
|
-
};
|
|
2204
|
-
type MockedFactory = {
|
|
2205
|
-
address: Address;
|
|
2206
|
-
set: (method: FactoryMethod, parameters: FactoryMethodParameters[FactoryMethod]) => Promise<void>;
|
|
2207
|
-
};
|
|
2208
|
-
type Mocked = {
|
|
2209
|
-
name: string;
|
|
2210
|
-
client: WalletClient;
|
|
2211
|
-
mempoolAddress: Address;
|
|
2212
|
-
termsAddress: Address;
|
|
2213
|
-
mine: () => Promise<void>;
|
|
2214
|
-
reset: () => Promise<void>;
|
|
2215
|
-
deployVault: () => Promise<MockedVault>;
|
|
2216
|
-
oracle: MockedOracle;
|
|
2217
|
-
morpho: MockedMorpho;
|
|
2218
|
-
factory: MockedFactory;
|
|
2219
|
-
} & Record<(typeof assetList)[number], MockedAsset>;
|
|
2220
|
-
declare function mock(name: string): Promise<Mocked>;
|
|
2221
|
-
/**
|
|
2222
|
-
* Start a local anvil chain.
|
|
2223
|
-
* @example
|
|
2224
|
-
* ```ts
|
|
2225
|
-
* import { EVM } from "@morpho-dev/router";
|
|
2226
|
-
* EVM.serve(); // local chain rpc url running on http://localhost:8545
|
|
2227
|
-
* ```
|
|
2228
|
-
*/
|
|
2229
|
-
declare function serve(parameters: {
|
|
2230
|
-
port: number;
|
|
2231
|
-
forkUrl: string;
|
|
2232
|
-
blockNumber?: number;
|
|
2233
|
-
}): Promise<{
|
|
2234
|
-
rpcUrl: `http://localhost:${number}`;
|
|
2235
|
-
stop: () => boolean;
|
|
2236
|
-
}>;
|
|
2237
|
-
|
|
2238
|
-
type EVM_AssetMethod = AssetMethod;
|
|
2239
|
-
type EVM_FactoryMethod = FactoryMethod;
|
|
2240
|
-
type EVM_FactoryMethodParameters = FactoryMethodParameters;
|
|
2241
|
-
type EVM_MethodParameters = MethodParameters;
|
|
2242
|
-
type EVM_Mocked = Mocked;
|
|
2243
|
-
type EVM_MockedAsset = MockedAsset;
|
|
2244
|
-
type EVM_MockedFactory = MockedFactory;
|
|
2245
|
-
type EVM_MockedMorpho = MockedMorpho;
|
|
2246
|
-
type EVM_MockedOracle = MockedOracle;
|
|
2247
|
-
type EVM_MockedVault = MockedVault;
|
|
2248
|
-
type EVM_MorphoMethod = MorphoMethod;
|
|
2249
|
-
type EVM_MorphoMethodParameters = MorphoMethodParameters;
|
|
2250
|
-
type EVM_OracleMethod = OracleMethod;
|
|
2251
|
-
type EVM_OracleMethodParameters = OracleMethodParameters;
|
|
2252
|
-
type EVM_VaultMethod = VaultMethod;
|
|
2253
|
-
type EVM_VaultMethodParameters = VaultMethodParameters;
|
|
2254
|
-
declare const EVM_assetList: typeof assetList;
|
|
2255
|
-
declare const EVM_assetMethods: typeof assetMethods;
|
|
2256
|
-
declare const EVM_encodeConsumedEvent: typeof encodeConsumedEvent;
|
|
2257
|
-
declare const EVM_factoryMethods: typeof factoryMethods;
|
|
2258
|
-
declare const EVM_mock: typeof mock;
|
|
2259
|
-
declare const EVM_mockAddress: typeof mockAddress;
|
|
2260
|
-
declare const EVM_mockFactoryAddress: typeof mockFactoryAddress;
|
|
2261
|
-
declare const EVM_mockMorphoAddress: typeof mockMorphoAddress;
|
|
2262
|
-
declare const EVM_mockOracleAddress: typeof mockOracleAddress;
|
|
2263
|
-
declare const EVM_morphoMethods: typeof morphoMethods;
|
|
2264
|
-
declare const EVM_oracleMethods: typeof oracleMethods;
|
|
2265
|
-
declare const EVM_serve: typeof serve;
|
|
2266
|
-
declare const EVM_users: typeof users;
|
|
2267
|
-
declare const EVM_vaultMethods: typeof vaultMethods;
|
|
2268
|
-
declare namespace EVM {
|
|
2269
|
-
export { type EVM_AssetMethod as AssetMethod, type EVM_FactoryMethod as FactoryMethod, type EVM_FactoryMethodParameters as FactoryMethodParameters, type EVM_MethodParameters as MethodParameters, type EVM_Mocked as Mocked, type EVM_MockedAsset as MockedAsset, type EVM_MockedFactory as MockedFactory, type EVM_MockedMorpho as MockedMorpho, type EVM_MockedOracle as MockedOracle, type EVM_MockedVault as MockedVault, type EVM_MorphoMethod as MorphoMethod, type EVM_MorphoMethodParameters as MorphoMethodParameters, type EVM_OracleMethod as OracleMethod, type EVM_OracleMethodParameters as OracleMethodParameters, type EVM_VaultMethod as VaultMethod, type EVM_VaultMethodParameters as VaultMethodParameters, EVM_assetList as assetList, EVM_assetMethods as assetMethods, EVM_encodeConsumedEvent as encodeConsumedEvent, EVM_factoryMethods as factoryMethods, EVM_mock as mock, EVM_mockAddress as mockAddress, EVM_mockFactoryAddress as mockFactoryAddress, EVM_mockMorphoAddress as mockMorphoAddress, EVM_mockOracleAddress as mockOracleAddress, EVM_morphoMethods as morphoMethods, EVM_oracleMethods as oracleMethods, EVM_serve as serve, EVM_users as users, EVM_vaultMethods as vaultMethods };
|
|
2012
|
+
declare const RouterApi_ChainHealth: typeof ChainHealth;
|
|
2013
|
+
type RouterApi_ChainsHealthResponse = ChainsHealthResponse;
|
|
2014
|
+
declare const RouterApi_CollectorHealth: typeof CollectorHealth;
|
|
2015
|
+
type RouterApi_CollectorsHealthResponse = CollectorsHealthResponse;
|
|
2016
|
+
declare const RouterApi_OpenApi: typeof OpenApi;
|
|
2017
|
+
type RouterApi_RouterApiConfig = RouterApiConfig;
|
|
2018
|
+
type RouterApi_RouterStatusResponse = RouterStatusResponse;
|
|
2019
|
+
declare const RouterApi_create: typeof create;
|
|
2020
|
+
declare const RouterApi_parse: typeof parse;
|
|
2021
|
+
declare const RouterApi_safeParse: typeof safeParse;
|
|
2022
|
+
declare namespace RouterApi {
|
|
2023
|
+
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 };
|
|
2270
2024
|
}
|
|
2271
2025
|
|
|
2272
2026
|
type MempoolEVMClientConfig = {
|
|
@@ -3449,6 +3203,28 @@ declare namespace schema {
|
|
|
3449
3203
|
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 };
|
|
3450
3204
|
}
|
|
3451
3205
|
|
|
3206
|
+
type Cursor = {
|
|
3207
|
+
sort: "rate" | "maturity" | "expiry" | "amount";
|
|
3208
|
+
dir: "asc" | "desc";
|
|
3209
|
+
rate?: string;
|
|
3210
|
+
maturity?: number;
|
|
3211
|
+
expiry?: number;
|
|
3212
|
+
assets?: string;
|
|
3213
|
+
hash: string;
|
|
3214
|
+
page?: number;
|
|
3215
|
+
};
|
|
3216
|
+
declare function validate(cursor: unknown): cursor is Cursor;
|
|
3217
|
+
declare function encode(c: Cursor): string;
|
|
3218
|
+
declare function decode(token?: string): Cursor | null;
|
|
3219
|
+
|
|
3220
|
+
type Cursor$1_Cursor = Cursor;
|
|
3221
|
+
declare const Cursor$1_decode: typeof decode;
|
|
3222
|
+
declare const Cursor$1_encode: typeof encode;
|
|
3223
|
+
declare const Cursor$1_validate: typeof validate;
|
|
3224
|
+
declare namespace Cursor$1 {
|
|
3225
|
+
export { type Cursor$1_Cursor as Cursor, Cursor$1_decode as decode, Cursor$1_encode as encode, Cursor$1_validate as validate };
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3452
3228
|
declare function max$1(a: bigint, b: bigint): bigint;
|
|
3453
3229
|
declare function min(a: bigint, b: bigint): bigint;
|
|
3454
3230
|
|
|
@@ -3531,7 +3307,7 @@ declare const index_poll: typeof poll;
|
|
|
3531
3307
|
declare const index_retry: typeof retry;
|
|
3532
3308
|
declare const index_wait: typeof wait;
|
|
3533
3309
|
declare namespace index {
|
|
3534
|
-
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$
|
|
3310
|
+
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 };
|
|
3535
3311
|
}
|
|
3536
3312
|
|
|
3537
|
-
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, ChainHealth, ChainStore$1 as ChainStore, ChainsHealthResponse, Collateral$1 as Collateral, index$
|
|
3313
|
+
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, RouterIndexer, RouterStatusResponse, Services$1 as Services, time as Time, index as Utils, Validation, ValidationRule, parse, safeParse };
|