@morpho-dev/router 0.1.16 → 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 -369
- package/dist/cli.js.map +1 -1
- package/dist/index.browser.d.cts +158 -77
- package/dist/index.browser.d.ts +158 -77
- 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 +213 -260
- package/dist/index.node.d.ts +213 -260
- package/dist/index.node.js +5410 -5293
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +5410 -5293
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.browser.d.ts
CHANGED
|
@@ -21,28 +21,24 @@ declare const ChainHealth: z$1.ZodObject<{
|
|
|
21
21
|
block_number: z$1.ZodNumber;
|
|
22
22
|
updated_at: z$1.ZodString;
|
|
23
23
|
}, z$1.core.$strip>;
|
|
24
|
-
declare const CollectorsHealthResponse: z$1.ZodObject<{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, z$1.core.$strip>>;
|
|
37
|
-
}, z$1.core.$strip>;
|
|
24
|
+
declare const CollectorsHealthResponse: z$1.ZodArray<z$1.ZodObject<{
|
|
25
|
+
name: z$1.ZodString;
|
|
26
|
+
chain_id: z$1.ZodNumber;
|
|
27
|
+
block_number: z$1.ZodNullable<z$1.ZodNumber>;
|
|
28
|
+
updated_at: z$1.ZodNullable<z$1.ZodString>;
|
|
29
|
+
lag: z$1.ZodNullable<z$1.ZodNumber>;
|
|
30
|
+
status: z$1.ZodEnum<{
|
|
31
|
+
live: "live";
|
|
32
|
+
lagging: "lagging";
|
|
33
|
+
unknown: "unknown";
|
|
34
|
+
}>;
|
|
35
|
+
}, z$1.core.$strip>>;
|
|
38
36
|
type CollectorsHealthResponse = z$1.infer<typeof CollectorsHealthResponse>;
|
|
39
|
-
declare const ChainsHealthResponse: z$1.ZodObject<{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, z$1.core.$strip>>;
|
|
45
|
-
}, z$1.core.$strip>;
|
|
37
|
+
declare const ChainsHealthResponse: z$1.ZodArray<z$1.ZodObject<{
|
|
38
|
+
chain_id: z$1.ZodNumber;
|
|
39
|
+
block_number: z$1.ZodNumber;
|
|
40
|
+
updated_at: z$1.ZodString;
|
|
41
|
+
}, z$1.core.$strip>>;
|
|
46
42
|
type ChainsHealthResponse = z$1.infer<typeof ChainsHealthResponse>;
|
|
47
43
|
declare const RouterStatusResponse: z$1.ZodObject<{
|
|
48
44
|
status: z$1.ZodEnum<{
|
|
@@ -396,8 +392,8 @@ type Options = (typeof Options)[number];
|
|
|
396
392
|
* @param lltv - The LLTV option or the scaled LLTV.
|
|
397
393
|
* @returns The LLTV.
|
|
398
394
|
*/
|
|
399
|
-
declare function from$
|
|
400
|
-
declare namespace from$
|
|
395
|
+
declare function from$8(lltv: Options | bigint): LLTV;
|
|
396
|
+
declare namespace from$8 {
|
|
401
397
|
type ErrorType = InvalidOptionError$1 | InvalidLLTVError;
|
|
402
398
|
}
|
|
403
399
|
declare class InvalidOptionError$1 extends BaseError {
|
|
@@ -416,7 +412,7 @@ type LLTV$1_LLTV = LLTV;
|
|
|
416
412
|
declare const LLTV$1_LLTVSchema: typeof LLTVSchema;
|
|
417
413
|
type LLTV$1_Options = Options;
|
|
418
414
|
declare namespace LLTV$1 {
|
|
419
|
-
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$
|
|
415
|
+
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$8 as from };
|
|
420
416
|
}
|
|
421
417
|
|
|
422
418
|
type Collateral = {
|
|
@@ -437,8 +433,8 @@ declare const CollateralsSchema: z.ZodArray<z.ZodObject<{
|
|
|
437
433
|
oracle: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
438
434
|
lltv: z.ZodPipe<z.ZodBigInt, z.ZodTransform<LLTV, bigint>>;
|
|
439
435
|
}, z.core.$strip>>;
|
|
440
|
-
declare const from$
|
|
441
|
-
declare namespace from$
|
|
436
|
+
declare const from$7: (parameters: from$7.Parameters) => from$7.ReturnType;
|
|
437
|
+
declare namespace from$7 {
|
|
442
438
|
type Parameters = {
|
|
443
439
|
asset: Address;
|
|
444
440
|
lltv: Options | bigint;
|
|
@@ -451,27 +447,7 @@ type Collateral$1_Collateral = Collateral;
|
|
|
451
447
|
declare const Collateral$1_CollateralSchema: typeof CollateralSchema;
|
|
452
448
|
declare const Collateral$1_CollateralsSchema: typeof CollateralsSchema;
|
|
453
449
|
declare namespace Collateral$1 {
|
|
454
|
-
export { type Collateral$1_Collateral as Collateral, Collateral$1_CollateralSchema as CollateralSchema, Collateral$1_CollateralsSchema as CollateralsSchema, from$
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
type Cursor = {
|
|
458
|
-
sort: "rate" | "maturity" | "expiry" | "amount";
|
|
459
|
-
dir: "asc" | "desc";
|
|
460
|
-
rate?: string;
|
|
461
|
-
maturity?: number;
|
|
462
|
-
expiry?: number;
|
|
463
|
-
assets?: string;
|
|
464
|
-
hash: string;
|
|
465
|
-
page?: number;
|
|
466
|
-
};
|
|
467
|
-
declare function validate(cursor: unknown): cursor is Cursor;
|
|
468
|
-
declare function encode$1(c: Cursor): string;
|
|
469
|
-
declare function decode$1(token?: string): Cursor | null;
|
|
470
|
-
|
|
471
|
-
type Cursor$1_Cursor = Cursor;
|
|
472
|
-
declare const Cursor$1_validate: typeof validate;
|
|
473
|
-
declare namespace Cursor$1 {
|
|
474
|
-
export { type Cursor$1_Cursor as Cursor, decode$1 as decode, encode$1 as encode, Cursor$1_validate as validate };
|
|
450
|
+
export { type Collateral$1_Collateral as Collateral, Collateral$1_CollateralSchema as CollateralSchema, Collateral$1_CollateralsSchema as CollateralsSchema, from$7 as from };
|
|
475
451
|
}
|
|
476
452
|
|
|
477
453
|
/** The snake case representation of a type with bigint values stringified. */
|
|
@@ -500,11 +476,11 @@ declare function toSnakeCase$1<T>(obj: T): Snake<T>;
|
|
|
500
476
|
* Converts checksummed ethereum addresses to lowercase if used as values.
|
|
501
477
|
* @warning Does not unstringify bigint values.
|
|
502
478
|
*/
|
|
503
|
-
declare function fromSnakeCase$
|
|
479
|
+
declare function fromSnakeCase$3<T>(obj: Snake<T>): T;
|
|
504
480
|
|
|
505
481
|
type Format_Snake<T> = Snake<T>;
|
|
506
482
|
declare namespace Format {
|
|
507
|
-
export { type Format_Snake as Snake, fromSnakeCase$
|
|
483
|
+
export { type Format_Snake as Snake, fromSnakeCase$3 as fromSnakeCase, toSnakeCase$1 as toSnakeCase };
|
|
508
484
|
}
|
|
509
485
|
|
|
510
486
|
/**
|
|
@@ -527,8 +503,8 @@ type MaturityOptions = keyof typeof MaturityOptions;
|
|
|
527
503
|
* @throws {InvalidDateError} If the maturity is in seconds but not a valid date.
|
|
528
504
|
* @throws {InvalidOptionError} If the maturity is not a valid option.
|
|
529
505
|
*/
|
|
530
|
-
declare function from$
|
|
531
|
-
declare namespace from$
|
|
506
|
+
declare function from$6(ts: from$6.Parameters): Maturity;
|
|
507
|
+
declare namespace from$6 {
|
|
532
508
|
type Parameters = number | MaturityOptions;
|
|
533
509
|
type ErrorType = InvalidFormatError | InvalidDateError | InvalidOptionError;
|
|
534
510
|
}
|
|
@@ -555,7 +531,7 @@ type Maturity$1_Maturity = Maturity;
|
|
|
555
531
|
type Maturity$1_MaturityOptions = MaturityOptions;
|
|
556
532
|
declare const Maturity$1_MaturitySchema: typeof MaturitySchema;
|
|
557
533
|
declare namespace Maturity$1 {
|
|
558
|
-
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$
|
|
534
|
+
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$6 as from };
|
|
559
535
|
}
|
|
560
536
|
|
|
561
537
|
type Offer = {
|
|
@@ -630,8 +606,8 @@ declare const OfferSchema: (parameters?: {
|
|
|
630
606
|
* @param input - The offer to create.
|
|
631
607
|
* @returns The created offer with its hash.
|
|
632
608
|
*/
|
|
633
|
-
declare function from$
|
|
634
|
-
declare namespace from$
|
|
609
|
+
declare function from$5(input: Omit<Offer, "hash">): Offer;
|
|
610
|
+
declare namespace from$5 {
|
|
635
611
|
type ErrorType = InvalidOfferError;
|
|
636
612
|
}
|
|
637
613
|
/**
|
|
@@ -640,7 +616,7 @@ declare namespace from$4 {
|
|
|
640
616
|
* @param input - The offer to create.
|
|
641
617
|
* @returns The created offer with its hash.
|
|
642
618
|
*/
|
|
643
|
-
declare function fromSnakeCase$
|
|
619
|
+
declare function fromSnakeCase$2(input: Snake<Omit<Offer, "hash">>): Offer;
|
|
644
620
|
/**
|
|
645
621
|
* Converts an offer to a snake case object.
|
|
646
622
|
* @param offer - The offer to convert.
|
|
@@ -654,7 +630,7 @@ declare function toSnakeCase(offer: Offer): Snake<Offer>;
|
|
|
654
630
|
* @warning The generated Offer should not be used for production usage.
|
|
655
631
|
* @returns {Offer} A randomly generated Offer object.
|
|
656
632
|
*/
|
|
657
|
-
declare function random$
|
|
633
|
+
declare function random$2(): Offer;
|
|
658
634
|
/**
|
|
659
635
|
* Creates an EIP-712 domain object.
|
|
660
636
|
* @param chainId - The chain ID.
|
|
@@ -745,8 +721,8 @@ declare function hash(offer: Omit<Offer, "hash">): Hex;
|
|
|
745
721
|
* @returns The obligation id as a 32-byte hex string.
|
|
746
722
|
*/
|
|
747
723
|
declare function obligationId(offer: Offer): Hex;
|
|
748
|
-
declare function encode(offer: Offer): `0x${string}`;
|
|
749
|
-
declare function decode(data: Hex, blockNumber: number | bigint): Offer;
|
|
724
|
+
declare function encode$1(offer: Offer): `0x${string}`;
|
|
725
|
+
declare function decode$1(data: Hex, blockNumber: number | bigint): Offer;
|
|
750
726
|
type OfferConsumed = {
|
|
751
727
|
id: string;
|
|
752
728
|
chainId: bigint;
|
|
@@ -806,9 +782,7 @@ type Offer$1_OfferConsumed = OfferConsumed;
|
|
|
806
782
|
declare const Offer$1_OfferHashSchema: typeof OfferHashSchema;
|
|
807
783
|
declare const Offer$1_OfferSchema: typeof OfferSchema;
|
|
808
784
|
declare const Offer$1_consumedEvent: typeof consumedEvent;
|
|
809
|
-
declare const Offer$1_decode: typeof decode;
|
|
810
785
|
declare const Offer$1_domain: typeof domain;
|
|
811
|
-
declare const Offer$1_encode: typeof encode;
|
|
812
786
|
declare const Offer$1_fromConsumedLog: typeof fromConsumedLog;
|
|
813
787
|
declare const Offer$1_hash: typeof hash;
|
|
814
788
|
declare const Offer$1_obligationId: typeof obligationId;
|
|
@@ -816,7 +790,7 @@ declare const Offer$1_sign: typeof sign;
|
|
|
816
790
|
declare const Offer$1_toSnakeCase: typeof toSnakeCase;
|
|
817
791
|
declare const Offer$1_types: typeof types;
|
|
818
792
|
declare namespace Offer$1 {
|
|
819
|
-
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,
|
|
793
|
+
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$5 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 };
|
|
820
794
|
}
|
|
821
795
|
|
|
822
796
|
/**
|
|
@@ -996,17 +970,17 @@ declare const ObligationSchema: z.ZodObject<{
|
|
|
996
970
|
* });
|
|
997
971
|
* ```
|
|
998
972
|
*/
|
|
999
|
-
declare function from$
|
|
1000
|
-
declare namespace from$
|
|
973
|
+
declare function from$4(parameters: from$4.Parameters): from$4.ReturnType;
|
|
974
|
+
declare namespace from$4 {
|
|
1001
975
|
type Parameters = {
|
|
1002
976
|
/** The chain id where the liquidity for this obligation is located. */
|
|
1003
977
|
chainId: Id;
|
|
1004
978
|
/** The token that is being borrowed for this obligation. */
|
|
1005
979
|
loanToken: Address;
|
|
1006
980
|
/** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
1007
|
-
collaterals: from$
|
|
981
|
+
collaterals: from$7.Parameters[] | readonly from$7.Parameters[];
|
|
1008
982
|
/** The maturity of the obligation. */
|
|
1009
|
-
maturity: from$
|
|
983
|
+
maturity: from$6.Parameters;
|
|
1010
984
|
};
|
|
1011
985
|
type ReturnType = Obligation;
|
|
1012
986
|
type ErrorType = InvalidObligationError;
|
|
@@ -1017,8 +991,8 @@ declare namespace from$3 {
|
|
|
1017
991
|
* @param input - {@link fromSnakeCase.Parameters}
|
|
1018
992
|
* @returns The created obligation. {@link fromSnakeCase.ReturnType}
|
|
1019
993
|
*/
|
|
1020
|
-
declare function fromSnakeCase(input: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
1021
|
-
declare namespace fromSnakeCase {
|
|
994
|
+
declare function fromSnakeCase$1(input: fromSnakeCase$1.Parameters): fromSnakeCase$1.ReturnType;
|
|
995
|
+
declare namespace fromSnakeCase$1 {
|
|
1022
996
|
type Parameters = Snake<Obligation>;
|
|
1023
997
|
type ReturnType = Obligation;
|
|
1024
998
|
type ErrorType = InvalidObligationError;
|
|
@@ -1052,8 +1026,8 @@ declare namespace id {
|
|
|
1052
1026
|
* const obligation = Obligation.random();
|
|
1053
1027
|
* ```
|
|
1054
1028
|
*/
|
|
1055
|
-
declare function random(): random.ReturnType;
|
|
1056
|
-
declare namespace random {
|
|
1029
|
+
declare function random$1(): random$1.ReturnType;
|
|
1030
|
+
declare namespace random$1 {
|
|
1057
1031
|
type ReturnType = Obligation;
|
|
1058
1032
|
}
|
|
1059
1033
|
declare class InvalidObligationError extends BaseError<z.ZodError | Error> {
|
|
@@ -1071,24 +1045,106 @@ type Obligation$1_InvalidObligationError = InvalidObligationError;
|
|
|
1071
1045
|
declare const Obligation$1_InvalidObligationError: typeof InvalidObligationError;
|
|
1072
1046
|
type Obligation$1_Obligation = Obligation;
|
|
1073
1047
|
declare const Obligation$1_ObligationSchema: typeof ObligationSchema;
|
|
1074
|
-
declare const Obligation$1_fromSnakeCase: typeof fromSnakeCase;
|
|
1075
1048
|
declare const Obligation$1_id: typeof id;
|
|
1076
|
-
declare const Obligation$1_random: typeof random;
|
|
1077
1049
|
declare namespace Obligation$1 {
|
|
1078
|
-
export { Obligation$1_CollateralsAreNotSortedError as CollateralsAreNotSortedError, Obligation$1_InvalidObligationError as InvalidObligationError, type Obligation$1_Obligation as Obligation, Obligation$1_ObligationSchema as ObligationSchema, from$
|
|
1050
|
+
export { Obligation$1_CollateralsAreNotSortedError as CollateralsAreNotSortedError, Obligation$1_InvalidObligationError as InvalidObligationError, type Obligation$1_Obligation as Obligation, Obligation$1_ObligationSchema as ObligationSchema, from$4 as from, fromSnakeCase$1 as fromSnakeCase, Obligation$1_id as id, random$1 as random };
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
type Quote = {
|
|
1054
|
+
/** The obligation id. */
|
|
1055
|
+
obligationId: Hex;
|
|
1056
|
+
ask: {
|
|
1057
|
+
/** The highest interest rate the seller will accept to pay for the obligation. (18 decimals). */
|
|
1058
|
+
rate: bigint;
|
|
1059
|
+
};
|
|
1060
|
+
bid: {
|
|
1061
|
+
/** The lowest interest rate a buyer is willing to be paid for the obligation. (18 decimals). */
|
|
1062
|
+
rate: bigint;
|
|
1063
|
+
};
|
|
1064
|
+
};
|
|
1065
|
+
declare const QuoteSchema: z.ZodObject<{
|
|
1066
|
+
obligationId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
1067
|
+
ask: z.ZodObject<{
|
|
1068
|
+
rate: z.ZodBigInt;
|
|
1069
|
+
}, z.core.$strip>;
|
|
1070
|
+
bid: z.ZodObject<{
|
|
1071
|
+
rate: z.ZodBigInt;
|
|
1072
|
+
}, z.core.$strip>;
|
|
1073
|
+
}, z.core.$strip>;
|
|
1074
|
+
/**
|
|
1075
|
+
* Creates a quote for a given obligation.
|
|
1076
|
+
* @constructor
|
|
1077
|
+
* @param parameters - {@link from.Parameters}
|
|
1078
|
+
* @returns The created quote. {@link Quote}
|
|
1079
|
+
* @throws If the quote is invalid. {@link InvalidQuoteError}
|
|
1080
|
+
*
|
|
1081
|
+
* @example
|
|
1082
|
+
* ```ts
|
|
1083
|
+
* const quote = Quote.from({ obligationId: "0x123", ask: { assets: 100n, rate: 100n }, bid: { assets: 100n, rate: 100n } });
|
|
1084
|
+
* ```
|
|
1085
|
+
*/
|
|
1086
|
+
declare function from$3(parameters: from$3.Parameters): from$3.ReturnType;
|
|
1087
|
+
declare namespace from$3 {
|
|
1088
|
+
type Parameters = Quote;
|
|
1089
|
+
type ReturnType = Quote;
|
|
1090
|
+
type ErrorType = InvalidQuoteError;
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Creates a quote from a snake case object.
|
|
1094
|
+
* @throws If the quote is invalid. {@link InvalidQuoteError}
|
|
1095
|
+
* @param snake - {@link fromSnakeCase.Parameters}
|
|
1096
|
+
* @returns The created quote. {@link fromSnakeCase.ReturnType}
|
|
1097
|
+
*/
|
|
1098
|
+
declare function fromSnakeCase(snake: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
1099
|
+
declare namespace fromSnakeCase {
|
|
1100
|
+
type Parameters = Snake<Quote>;
|
|
1101
|
+
type ReturnType = Quote;
|
|
1102
|
+
type ErrorType = from$3.ErrorType;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Generates a random quote.
|
|
1106
|
+
* @returns A randomly generated quote. {@link random.ReturnType}
|
|
1107
|
+
*
|
|
1108
|
+
* @example
|
|
1109
|
+
* ```ts
|
|
1110
|
+
* const quote = Quote.random();
|
|
1111
|
+
* ```
|
|
1112
|
+
*/
|
|
1113
|
+
declare function random(): random.ReturnType;
|
|
1114
|
+
declare namespace random {
|
|
1115
|
+
type Parameters = never;
|
|
1116
|
+
type ReturnType = Quote;
|
|
1117
|
+
type ErrorType = from$3.ErrorType;
|
|
1118
|
+
}
|
|
1119
|
+
declare class InvalidQuoteError extends BaseError<z.ZodError | Error> {
|
|
1120
|
+
readonly name = "Quote.InvalidQuoteError";
|
|
1121
|
+
constructor(error: z.ZodError | Error);
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
type Quote$1_InvalidQuoteError = InvalidQuoteError;
|
|
1125
|
+
declare const Quote$1_InvalidQuoteError: typeof InvalidQuoteError;
|
|
1126
|
+
type Quote$1_Quote = Quote;
|
|
1127
|
+
declare const Quote$1_QuoteSchema: typeof QuoteSchema;
|
|
1128
|
+
declare const Quote$1_fromSnakeCase: typeof fromSnakeCase;
|
|
1129
|
+
declare const Quote$1_random: typeof random;
|
|
1130
|
+
declare namespace Quote$1 {
|
|
1131
|
+
export { Quote$1_InvalidQuoteError as InvalidQuoteError, type Quote$1_Quote as Quote, Quote$1_QuoteSchema as QuoteSchema, from$3 as from, Quote$1_fromSnakeCase as fromSnakeCase, Quote$1_random as random };
|
|
1079
1132
|
}
|
|
1080
1133
|
|
|
1081
1134
|
type ObligationResponse = Snake<Compute<{
|
|
1082
1135
|
/** The obligation id. */
|
|
1083
1136
|
id: Hex;
|
|
1084
|
-
} & Obligation
|
|
1137
|
+
} & Obligation & {
|
|
1138
|
+
ask: Quote["ask"];
|
|
1139
|
+
bid: Quote["bid"];
|
|
1140
|
+
}>>;
|
|
1085
1141
|
/**
|
|
1086
1142
|
* Creates an `ObligationResponse` from a `Obligation`.
|
|
1087
1143
|
* @constructor
|
|
1088
1144
|
* @param obligation - {@link Obligation}
|
|
1089
1145
|
* @returns The created `ObligationResponse`. {@link ObligationResponse}
|
|
1090
1146
|
*/
|
|
1091
|
-
declare function from$2(obligation: Obligation): ObligationResponse;
|
|
1147
|
+
declare function from$2(obligation: Obligation, quote: Quote): ObligationResponse;
|
|
1092
1148
|
|
|
1093
1149
|
type ObligationResponse$1_ObligationResponse = ObligationResponse;
|
|
1094
1150
|
declare namespace ObligationResponse$1 {
|
|
@@ -1230,7 +1286,10 @@ declare namespace getObligations {
|
|
|
1230
1286
|
limit?: number;
|
|
1231
1287
|
};
|
|
1232
1288
|
type ReturnType = {
|
|
1233
|
-
obligations:
|
|
1289
|
+
obligations: Compute<{
|
|
1290
|
+
/** The obligation id. Uses {@link Obligation.id} to calculate the id.*/
|
|
1291
|
+
id: () => Hex;
|
|
1292
|
+
} & Obligation & Omit<Quote, "obligationId">>[];
|
|
1234
1293
|
/** The pagination cursor. */
|
|
1235
1294
|
cursor: string | null;
|
|
1236
1295
|
};
|
|
@@ -1484,6 +1543,28 @@ declare namespace MempoolClient {
|
|
|
1484
1543
|
export { type MempoolClient_AddParameters as AddParameters, type MempoolClient_Client as Client, type MempoolClient_GetParameters as GetParameters, type MempoolClient_WatchParameters as WatchParameters, MempoolClient_connect as connect };
|
|
1485
1544
|
}
|
|
1486
1545
|
|
|
1546
|
+
type Cursor = {
|
|
1547
|
+
sort: "rate" | "maturity" | "expiry" | "amount";
|
|
1548
|
+
dir: "asc" | "desc";
|
|
1549
|
+
rate?: string;
|
|
1550
|
+
maturity?: number;
|
|
1551
|
+
expiry?: number;
|
|
1552
|
+
assets?: string;
|
|
1553
|
+
hash: string;
|
|
1554
|
+
page?: number;
|
|
1555
|
+
};
|
|
1556
|
+
declare function validate(cursor: unknown): cursor is Cursor;
|
|
1557
|
+
declare function encode(c: Cursor): string;
|
|
1558
|
+
declare function decode(token?: string): Cursor | null;
|
|
1559
|
+
|
|
1560
|
+
type Cursor$1_Cursor = Cursor;
|
|
1561
|
+
declare const Cursor$1_decode: typeof decode;
|
|
1562
|
+
declare const Cursor$1_encode: typeof encode;
|
|
1563
|
+
declare const Cursor$1_validate: typeof validate;
|
|
1564
|
+
declare namespace Cursor$1 {
|
|
1565
|
+
export { type Cursor$1_Cursor as Cursor, Cursor$1_decode as decode, Cursor$1_encode as encode, Cursor$1_validate as validate };
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1487
1568
|
declare function max$1(a: bigint, b: bigint): bigint;
|
|
1488
1569
|
declare function min(a: bigint, b: bigint): bigint;
|
|
1489
1570
|
|
|
@@ -1566,7 +1647,7 @@ declare const index_poll: typeof poll;
|
|
|
1566
1647
|
declare const index_retry: typeof retry;
|
|
1567
1648
|
declare const index_wait: typeof wait;
|
|
1568
1649
|
declare namespace index {
|
|
1569
|
-
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$
|
|
1650
|
+
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 };
|
|
1570
1651
|
}
|
|
1571
1652
|
|
|
1572
|
-
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, Collateral$1 as Collateral, type Compute, Cursor$1 as Cursor, Errors, Format, LLTV$1 as LLTV, Liquidity, Maturity$1 as Maturity, MempoolClient as Mempool, Obligation$1 as Obligation, Offer$1 as Offer, index$1 as RouterApi, Client$2 as RouterClient, time as Time, index as Utils, Validation, ValidationRule };
|
|
1653
|
+
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, Collateral$1 as Collateral, type Compute, Cursor$1 as Cursor, Errors, Format, LLTV$1 as LLTV, Liquidity, Maturity$1 as Maturity, MempoolClient as Mempool, Obligation$1 as Obligation, Offer$1 as Offer, Quote$1 as Quote, index$1 as RouterApi, Client$2 as RouterClient, time as Time, index as Utils, Validation, ValidationRule };
|