@morpho-dev/router 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/chunk-Bo1DHCg-.mjs +18 -0
- package/dist/cli.js +2654 -2335
- package/dist/index.browser.d.mts +456 -482
- package/dist/index.browser.d.mts.map +1 -1
- package/dist/index.browser.d.ts +456 -482
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +623 -304
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +592 -294
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +629 -692
- package/dist/index.node.d.mts.map +1 -1
- package/dist/index.node.d.ts +629 -692
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +919 -583
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +886 -571
- package/dist/index.node.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-jass6xSI.mjs +0 -13
package/dist/index.node.d.mts
CHANGED
|
@@ -273,19 +273,48 @@ declare const Morpho: readonly [{
|
|
|
273
273
|
}];
|
|
274
274
|
readonly stateMutability: "view";
|
|
275
275
|
}];
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/core/types.d.ts
|
|
278
|
+
/** Combines members of an intersection into a readable type. */
|
|
279
|
+
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
280
|
+
declare const BrandTypeId: unique symbol;
|
|
281
|
+
type Brand<in out ID extends string | symbol> = {
|
|
282
|
+
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
283
|
+
};
|
|
276
284
|
declare namespace Callback_d_exports {
|
|
277
|
-
export { BuyVaultV1CallbackData,
|
|
285
|
+
export { BuyERC20Data, BuyVaultV1CallbackData, Callback, CallbackPosition, SellERC20CallbackData, Type$1 as Type, decode$2 as decode, decodeBuyERC20, decodeBuyVaultV1Callback, decodeSellERC20Callback, encode$2 as encode, encodeBuyERC20, encodeBuyVaultV1Callback, encodeSellERC20Callback, isEmptyCallback };
|
|
278
286
|
}
|
|
279
|
-
|
|
287
|
+
/** A position decoded from callback data. */
|
|
288
|
+
type CallbackPosition = {
|
|
289
|
+
/** The ERC20 token contract address. */contract: Address; /** The maximum amount available from this position. */
|
|
290
|
+
amount: bigint;
|
|
291
|
+
};
|
|
292
|
+
type Callback = {
|
|
293
|
+
type: Type$1.BuyWithEmptyCallback;
|
|
294
|
+
} | (({
|
|
295
|
+
/** The address of the callback contract. */address: Address; /** The ABI-encoded callback data. */
|
|
296
|
+
data: Hex;
|
|
297
|
+
} & {
|
|
298
|
+
type: Type$1.BuyERC20; /** The decoded callback inputs. */
|
|
299
|
+
inputs: {
|
|
300
|
+
/** The ERC20 positions available for the callback. */positions: CallbackPosition[];
|
|
301
|
+
};
|
|
302
|
+
}) & Brand<"Callback">);
|
|
303
|
+
declare enum Type$1 {
|
|
280
304
|
BuyWithEmptyCallback = "buy_with_empty_callback",
|
|
305
|
+
BuyERC20 = "buy_erc20",
|
|
281
306
|
BuyVaultV1Callback = "buy_vault_v1_callback",
|
|
282
|
-
SellERC20Callback = "sell_erc20_callback"
|
|
307
|
+
SellERC20Callback = "sell_erc20_callback"
|
|
283
308
|
}
|
|
284
309
|
declare const isEmptyCallback: (offer: Offer) => boolean;
|
|
285
|
-
declare function decode$2(type:
|
|
310
|
+
declare function decode$2(type: Type$1, data: Hex): {
|
|
286
311
|
contract: Address;
|
|
287
312
|
amount: bigint;
|
|
288
313
|
}[];
|
|
314
|
+
type BuyERC20Data = {
|
|
315
|
+
tokens: Address[];
|
|
316
|
+
amounts: bigint[];
|
|
317
|
+
};
|
|
289
318
|
type BuyVaultV1CallbackData = {
|
|
290
319
|
vaults: Address[];
|
|
291
320
|
amounts: bigint[];
|
|
@@ -294,8 +323,28 @@ type SellERC20CallbackData = {
|
|
|
294
323
|
collaterals: Address[];
|
|
295
324
|
amounts: bigint[];
|
|
296
325
|
};
|
|
297
|
-
declare function encode$2(type:
|
|
298
|
-
declare function encode$2(type:
|
|
326
|
+
declare function encode$2(type: Type$1.BuyERC20, data: BuyERC20Data): Hex;
|
|
327
|
+
declare function encode$2(type: Type$1.BuyVaultV1Callback, data: BuyVaultV1CallbackData): Hex;
|
|
328
|
+
declare function encode$2(type: Type$1.SellERC20Callback, data: SellERC20CallbackData): Hex;
|
|
329
|
+
/**
|
|
330
|
+
* Decodes BuyERC20 callback data into positions.
|
|
331
|
+
* @param data - The ABI-encoded callback data containing token addresses and amounts.
|
|
332
|
+
* @returns Array of positions with contract address and amount.
|
|
333
|
+
* @throws If data is empty, malformed, or arrays have mismatched lengths.
|
|
334
|
+
*/
|
|
335
|
+
declare function decodeBuyERC20(data: Hex): Array<{
|
|
336
|
+
contract: Address;
|
|
337
|
+
amount: bigint;
|
|
338
|
+
}>;
|
|
339
|
+
/**
|
|
340
|
+
* Encodes BuyERC20 callback parameters into ABI-encoded data.
|
|
341
|
+
* @param parameters - The tokens and amounts to encode.
|
|
342
|
+
* @returns ABI-encoded hex string.
|
|
343
|
+
*/
|
|
344
|
+
declare function encodeBuyERC20(parameters: {
|
|
345
|
+
tokens: Address[];
|
|
346
|
+
amounts: bigint[];
|
|
347
|
+
}): Hex;
|
|
299
348
|
declare function decodeBuyVaultV1Callback(data: Hex): Array<{
|
|
300
349
|
contract: Address;
|
|
301
350
|
amount: bigint;
|
|
@@ -357,6 +406,7 @@ type Chain$1 = Compute<Omit<Chain<ChainFormatters, {
|
|
|
357
406
|
v1_1: ChainContract;
|
|
358
407
|
};
|
|
359
408
|
};
|
|
409
|
+
callbacks: Callback[];
|
|
360
410
|
}>, "custom"> & {
|
|
361
411
|
id: Id;
|
|
362
412
|
name: Name$1;
|
|
@@ -370,6 +420,7 @@ type Chain$1 = Compute<Omit<Chain<ChainFormatters, {
|
|
|
370
420
|
v1_1: ChainContract;
|
|
371
421
|
};
|
|
372
422
|
};
|
|
423
|
+
callbacks: Callback[];
|
|
373
424
|
};
|
|
374
425
|
}>;
|
|
375
426
|
declare const ChainId: {
|
|
@@ -423,17 +474,14 @@ type ChainRegistry = {
|
|
|
423
474
|
getById: (chainId: Id) => Chain$1 | undefined;
|
|
424
475
|
list: () => Chain$1[];
|
|
425
476
|
};
|
|
477
|
+
/**
|
|
478
|
+
* Creates a chain registry from a list of chains.
|
|
479
|
+
* @param chains - Array of chain objects to register.
|
|
480
|
+
* @returns A registry for looking up chains by ID. {@link ChainRegistry}
|
|
481
|
+
*/
|
|
426
482
|
declare function create$6(chains: Chain$1[]): ChainRegistry;
|
|
427
|
-
//#endregion
|
|
428
|
-
//#region src/core/types.d.ts
|
|
429
|
-
/** Combines members of an intersection into a readable type. */
|
|
430
|
-
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
431
|
-
declare const BrandTypeId: unique symbol;
|
|
432
|
-
type Brand<in out ID extends string | symbol> = {
|
|
433
|
-
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
434
|
-
};
|
|
435
483
|
declare namespace LLTV_d_exports {
|
|
436
|
-
export { InvalidLLTVError, InvalidOptionError$1 as InvalidOptionError, LLTV, LLTVSchema, Options, from$
|
|
484
|
+
export { InvalidLLTVError, InvalidOptionError$1 as InvalidOptionError, LLTV, LLTVSchema, Options, from$17 as from };
|
|
437
485
|
}
|
|
438
486
|
type LLTV = bigint & Brand<"LLTV">;
|
|
439
487
|
declare const Options: readonly [0.385, 0.5, 0.625, 0.77, 0.86, 0.915, 0.945, 0.965, 0.98];
|
|
@@ -443,8 +491,8 @@ type Options = (typeof Options)[number];
|
|
|
443
491
|
* @param lltv - The LLTV option or the scaled LLTV.
|
|
444
492
|
* @returns The LLTV.
|
|
445
493
|
*/
|
|
446
|
-
declare function from$
|
|
447
|
-
declare namespace from$
|
|
494
|
+
declare function from$17(lltv: Options | bigint): LLTV;
|
|
495
|
+
declare namespace from$17 {
|
|
448
496
|
type ErrorType = InvalidOptionError$1 | InvalidLLTVError;
|
|
449
497
|
}
|
|
450
498
|
declare class InvalidOptionError$1 extends BaseError {
|
|
@@ -457,14 +505,11 @@ declare class InvalidLLTVError extends BaseError {
|
|
|
457
505
|
}
|
|
458
506
|
declare const LLTVSchema: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
459
507
|
declare namespace Collateral_d_exports {
|
|
460
|
-
export { Collateral, CollateralSchema, CollateralsSchema, from$
|
|
508
|
+
export { Collateral, CollateralSchema, CollateralsSchema, from$16 as from, random$3 as random };
|
|
461
509
|
}
|
|
462
510
|
type Collateral = {
|
|
463
|
-
/** Asset being used as collateral. */
|
|
464
|
-
|
|
465
|
-
/** Liquidation Loan-to-Value of the collateral. */
|
|
466
|
-
lltv: LLTV;
|
|
467
|
-
/** Oracle contract used to price the collateral. */
|
|
511
|
+
/** Asset being used as collateral. */asset: Address; /** Liquidation Loan-to-Value of the collateral. */
|
|
512
|
+
lltv: LLTV; /** Oracle contract used to price the collateral. */
|
|
468
513
|
oracle: Address;
|
|
469
514
|
};
|
|
470
515
|
declare const CollateralSchema: z$1.ZodObject<{
|
|
@@ -477,8 +522,8 @@ declare const CollateralsSchema: z$1.ZodArray<z$1.ZodObject<{
|
|
|
477
522
|
oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
478
523
|
lltv: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
479
524
|
}, z$1.core.$strip>>;
|
|
480
|
-
declare const from$
|
|
481
|
-
declare namespace from$
|
|
525
|
+
declare const from$16: (parameters: from$16.Parameters) => from$16.ReturnType;
|
|
526
|
+
declare namespace from$16 {
|
|
482
527
|
type Parameters = {
|
|
483
528
|
asset: Address;
|
|
484
529
|
lltv: Options | bigint;
|
|
@@ -516,8 +561,7 @@ declare namespace ERC4626_d_exports {
|
|
|
516
561
|
declare function decimalsOffset(parameters: decimalsOffset.Parameters): number;
|
|
517
562
|
declare namespace decimalsOffset {
|
|
518
563
|
type Parameters = {
|
|
519
|
-
/** The number of decimals of the underlying asset. */
|
|
520
|
-
underlyingDecimals: number;
|
|
564
|
+
/** The number of decimals of the underlying asset. */underlyingDecimals: number;
|
|
521
565
|
};
|
|
522
566
|
type ReturnType = number;
|
|
523
567
|
}
|
|
@@ -536,11 +580,8 @@ declare namespace decimalsOffset {
|
|
|
536
580
|
declare function convertToAssets(parameters: convertToAssets.Parameters): convertToAssets.ReturnType;
|
|
537
581
|
declare namespace convertToAssets {
|
|
538
582
|
type Parameters = {
|
|
539
|
-
/** The amount of shares to convert. */
|
|
540
|
-
|
|
541
|
-
/** Total amount of assets in the vault. */
|
|
542
|
-
totalAssets: bigint;
|
|
543
|
-
/** Total amount of shares in the vault. */
|
|
583
|
+
/** The amount of shares to convert. */shares: bigint; /** Total amount of assets in the vault. */
|
|
584
|
+
totalAssets: bigint; /** Total amount of shares in the vault. */
|
|
544
585
|
totalSupply: bigint;
|
|
545
586
|
/**
|
|
546
587
|
* OpenZeppelin decimals offset used by the ERC4626 implementation.
|
|
@@ -567,11 +608,8 @@ declare namespace convertToAssets {
|
|
|
567
608
|
declare function convertToShares(parameters: convertToShares.Parameters): convertToShares.ReturnType;
|
|
568
609
|
declare namespace convertToShares {
|
|
569
610
|
type Parameters = {
|
|
570
|
-
/** The amount of assets to convert. */
|
|
571
|
-
|
|
572
|
-
/** Total amount of assets in the vault. */
|
|
573
|
-
totalAssets: bigint;
|
|
574
|
-
/** Total amount of shares in the vault. */
|
|
611
|
+
/** The amount of assets to convert. */assets: bigint; /** Total amount of assets in the vault. */
|
|
612
|
+
totalAssets: bigint; /** Total amount of shares in the vault. */
|
|
575
613
|
totalSupply: bigint;
|
|
576
614
|
/**
|
|
577
615
|
* OpenZeppelin decimals offset used by the ERC4626 implementation.
|
|
@@ -707,7 +745,7 @@ declare function generateMarketLiquidityPoolId(parameters: {
|
|
|
707
745
|
marketId: string;
|
|
708
746
|
}): string;
|
|
709
747
|
declare namespace Maturity_d_exports {
|
|
710
|
-
export { InvalidDateError, InvalidFormatError, InvalidOptionError, Maturity, MaturityOptions, MaturitySchema, MaturityType, from$
|
|
748
|
+
export { InvalidDateError, InvalidFormatError, InvalidOptionError, Maturity, MaturityOptions, MaturitySchema, MaturityType, from$15 as from };
|
|
711
749
|
}
|
|
712
750
|
/**
|
|
713
751
|
* Maturity is a number that represents a date in seconds.
|
|
@@ -720,7 +758,7 @@ declare enum MaturityType {
|
|
|
720
758
|
EndOfMonth = "end_of_month",
|
|
721
759
|
EndOfNextMonth = "end_of_next_month",
|
|
722
760
|
EndOfQuarter = "end_of_quarter",
|
|
723
|
-
EndOfNextQuarter = "end_of_next_quarter"
|
|
761
|
+
EndOfNextQuarter = "end_of_next_quarter"
|
|
724
762
|
}
|
|
725
763
|
declare const MaturityOptions: {
|
|
726
764
|
readonly end_of_week: () => Maturity;
|
|
@@ -737,8 +775,8 @@ type MaturityOptions = keyof typeof MaturityOptions;
|
|
|
737
775
|
* @throws {InvalidDateError} If the maturity is in seconds but not a valid date.
|
|
738
776
|
* @throws {InvalidOptionError} If the maturity is not a valid option.
|
|
739
777
|
*/
|
|
740
|
-
declare function from$
|
|
741
|
-
declare namespace from$
|
|
778
|
+
declare function from$15(ts: from$15.Parameters): Maturity;
|
|
779
|
+
declare namespace from$15 {
|
|
742
780
|
type Parameters = number | MaturityOptions;
|
|
743
781
|
type ErrorType = InvalidFormatError | InvalidDateError | InvalidOptionError;
|
|
744
782
|
}
|
|
@@ -782,16 +820,12 @@ declare function toSnakeCase$1<T>(obj: T): Snake<T>;
|
|
|
782
820
|
declare function fromSnakeCase$3<T>(obj: Snake<T>): T;
|
|
783
821
|
declare function stringifyBigint<T>(value: T): StringifiedBigint<T>;
|
|
784
822
|
declare namespace Obligation_d_exports {
|
|
785
|
-
export { CollateralsAreNotSortedError, InvalidObligationError, Obligation, ObligationSchema, from$
|
|
823
|
+
export { CollateralsAreNotSortedError, InvalidObligationError, Obligation, ObligationSchema, from$14 as from, fromSnakeCase$2 as fromSnakeCase, id, random$2 as random };
|
|
786
824
|
}
|
|
787
825
|
type Obligation = {
|
|
788
|
-
/** The chain id where the liquidity for this obligation is located. */
|
|
789
|
-
|
|
790
|
-
/** The
|
|
791
|
-
loanToken: Address;
|
|
792
|
-
/** The exact set of collaterals required to borrow the loan token. */
|
|
793
|
-
collaterals: Collateral[];
|
|
794
|
-
/** The maturity of the obligation. */
|
|
826
|
+
/** The chain id where the liquidity for this obligation is located. */chainId: Id; /** The token that is being borrowed for this obligation. */
|
|
827
|
+
loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
|
|
828
|
+
collaterals: Collateral[]; /** The maturity of the obligation. */
|
|
795
829
|
maturity: Maturity;
|
|
796
830
|
};
|
|
797
831
|
declare const ObligationSchema: z$1.ZodObject<{
|
|
@@ -827,17 +861,13 @@ declare const ObligationSchema: z$1.ZodObject<{
|
|
|
827
861
|
* });
|
|
828
862
|
* ```
|
|
829
863
|
*/
|
|
830
|
-
declare function from$
|
|
831
|
-
declare namespace from$
|
|
864
|
+
declare function from$14(parameters: from$14.Parameters): from$14.ReturnType;
|
|
865
|
+
declare namespace from$14 {
|
|
832
866
|
type Parameters = {
|
|
833
|
-
/** The chain id where the liquidity for this obligation is located. */
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
/** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
838
|
-
collaterals: from$15.Parameters[] | readonly from$15.Parameters[];
|
|
839
|
-
/** The maturity of the obligation. */
|
|
840
|
-
maturity: from$14.Parameters;
|
|
867
|
+
/** The chain id where the liquidity for this obligation is located. */chainId: number; /** The token that is being borrowed for this obligation. */
|
|
868
|
+
loanToken: Address; /** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
869
|
+
collaterals: from$16.Parameters[] | readonly from$16.Parameters[]; /** The maturity of the obligation. */
|
|
870
|
+
maturity: from$15.Parameters;
|
|
841
871
|
};
|
|
842
872
|
type ReturnType = Obligation;
|
|
843
873
|
type ErrorType = InvalidObligationError;
|
|
@@ -907,38 +937,23 @@ declare class CollateralsAreNotSortedError extends BaseError {
|
|
|
907
937
|
constructor();
|
|
908
938
|
}
|
|
909
939
|
declare namespace Offer_d_exports {
|
|
910
|
-
export { AccountNotSetError, InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, domain, encode$1 as encode, from$
|
|
940
|
+
export { AccountNotSetError, InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, domain, encode$1 as encode, from$13 as from, fromSnakeCase$1 as fromSnakeCase, hash, obligationId, random$1 as random, serialize, sign, signatureMsg, toSnakeCase, types };
|
|
911
941
|
}
|
|
912
942
|
type Offer = {
|
|
913
|
-
/** The address that made the offer. */
|
|
914
|
-
readonly
|
|
915
|
-
/** The
|
|
916
|
-
readonly
|
|
917
|
-
|
|
918
|
-
readonly
|
|
919
|
-
|
|
920
|
-
readonly
|
|
921
|
-
/** The
|
|
922
|
-
readonly
|
|
923
|
-
/** The
|
|
924
|
-
readonly
|
|
925
|
-
/** The
|
|
926
|
-
readonly
|
|
927
|
-
/** The date at which the offer will start. */
|
|
928
|
-
readonly start: number;
|
|
929
|
-
/** The group. Used for OCO (One-Cancelled-Other) mechanism. */
|
|
930
|
-
readonly group: Hex;
|
|
931
|
-
/** The session. Used for session-based offer management. */
|
|
932
|
-
readonly session: Hex;
|
|
933
|
-
/** The side of the offer. `true` for buy, `false` for sell. */
|
|
934
|
-
readonly buy: boolean;
|
|
935
|
-
/** The chain id where the liquidity for this offer is located. */
|
|
936
|
-
readonly chainId: Id;
|
|
937
|
-
/** The token that is being borrowed. */
|
|
938
|
-
readonly loanToken: Address;
|
|
939
|
-
/** The exact set of collaterals required to borrow the loan token. */
|
|
940
|
-
readonly collaterals: readonly Collateral[];
|
|
941
|
-
/** The optional callback data to retrieve the maker funds. */
|
|
943
|
+
/** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
|
|
944
|
+
readonly assets: bigint; /** The max debt units to trade. Mutually exclusive with assets and obligationShares. */
|
|
945
|
+
readonly obligationUnits: bigint; /** The max lending shares to trade. Mutually exclusive with assets and obligationUnits. */
|
|
946
|
+
readonly obligationShares: bigint; /** The price (18 decimals). */
|
|
947
|
+
readonly price: bigint; /** The date at which all interests will be paid. */
|
|
948
|
+
readonly maturity: Maturity; /** The date at which the offer will expire. */
|
|
949
|
+
readonly expiry: number; /** The date at which the offer will start. */
|
|
950
|
+
readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
|
|
951
|
+
readonly group: Hex; /** The session. Used for session-based offer management. */
|
|
952
|
+
readonly session: Hex; /** The side of the offer. `true` for buy, `false` for sell. */
|
|
953
|
+
readonly buy: boolean; /** The chain id where the liquidity for this offer is located. */
|
|
954
|
+
readonly chainId: Id; /** The token that is being borrowed. */
|
|
955
|
+
readonly loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
|
|
956
|
+
readonly collaterals: readonly Collateral[]; /** The optional callback data to retrieve the maker funds. */
|
|
942
957
|
readonly callback: {
|
|
943
958
|
readonly address: Address;
|
|
944
959
|
readonly data: Hex;
|
|
@@ -946,7 +961,7 @@ type Offer = {
|
|
|
946
961
|
};
|
|
947
962
|
declare enum Status {
|
|
948
963
|
VALID = "VALID",
|
|
949
|
-
SIMULATION_ERROR = "SIMULATION_ERROR"
|
|
964
|
+
SIMULATION_ERROR = "SIMULATION_ERROR"
|
|
950
965
|
}
|
|
951
966
|
type Validation = {
|
|
952
967
|
offerHash: Hex;
|
|
@@ -989,12 +1004,9 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
989
1004
|
*/
|
|
990
1005
|
type OfferInput = Compute<Omit<Offer, "chainId" | "group" | "session" | "obligationUnits" | "obligationShares"> & {
|
|
991
1006
|
chainId: number;
|
|
992
|
-
group: Hex | bigint | number | string;
|
|
993
|
-
/** Optional: defaults to
|
|
994
|
-
|
|
995
|
-
/** Optional: defaults to 0n. Mutually exclusive with assets and obligationShares. */
|
|
996
|
-
obligationUnits?: bigint;
|
|
997
|
-
/** Optional: defaults to 0n. Mutually exclusive with assets and obligationUnits. */
|
|
1007
|
+
group: Hex | bigint | number | string; /** Optional: defaults to zero bytes32. */
|
|
1008
|
+
session?: Hex | bigint | number | string; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationShares. */
|
|
1009
|
+
obligationUnits?: bigint; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationUnits. */
|
|
998
1010
|
obligationShares?: bigint;
|
|
999
1011
|
}>;
|
|
1000
1012
|
/**
|
|
@@ -1003,8 +1015,8 @@ type OfferInput = Compute<Omit<Offer, "chainId" | "group" | "session" | "obligat
|
|
|
1003
1015
|
* @param input - The offer to create.
|
|
1004
1016
|
* @returns The created offer.
|
|
1005
1017
|
*/
|
|
1006
|
-
declare function from$
|
|
1007
|
-
declare namespace from$
|
|
1018
|
+
declare function from$13(input: OfferInput): Offer;
|
|
1019
|
+
declare namespace from$13 {
|
|
1008
1020
|
type ErrorType = InvalidOfferError;
|
|
1009
1021
|
}
|
|
1010
1022
|
/**
|
|
@@ -1235,19 +1247,15 @@ declare class AccountNotSetError extends BaseError {
|
|
|
1235
1247
|
constructor();
|
|
1236
1248
|
}
|
|
1237
1249
|
declare namespace Oracle_d_exports {
|
|
1238
|
-
export { Conversion, Oracle, from$
|
|
1250
|
+
export { Conversion, Oracle, from$12 as from };
|
|
1239
1251
|
}
|
|
1240
1252
|
/**
|
|
1241
1253
|
* An oracle contract that provides price information for assets.
|
|
1242
1254
|
*/
|
|
1243
1255
|
type Oracle = {
|
|
1244
|
-
/** The chain id where the oracle is deployed. */
|
|
1245
|
-
readonly
|
|
1246
|
-
/** The
|
|
1247
|
-
readonly address: Address;
|
|
1248
|
-
/** The price returned by the oracle (in the oracle's native units), null if no price available. */
|
|
1249
|
-
readonly price: bigint | null;
|
|
1250
|
-
/** The block number at which the price was fetched. */
|
|
1256
|
+
/** The chain id where the oracle is deployed. */readonly chainId: Id; /** The address of the oracle contract. */
|
|
1257
|
+
readonly address: Address; /** The price returned by the oracle (in the oracle's native units), null if no price available. */
|
|
1258
|
+
readonly price: bigint | null; /** The block number at which the price was fetched. */
|
|
1251
1259
|
readonly blockNumber: number;
|
|
1252
1260
|
};
|
|
1253
1261
|
/**
|
|
@@ -1255,8 +1263,8 @@ type Oracle = {
|
|
|
1255
1263
|
* @param data - The data to create the oracle from.
|
|
1256
1264
|
* @returns The created oracle.
|
|
1257
1265
|
*/
|
|
1258
|
-
declare function from$
|
|
1259
|
-
declare namespace from$
|
|
1266
|
+
declare function from$12(data: from$12.Parameters): from$12.ReturnType;
|
|
1267
|
+
declare namespace from$12 {
|
|
1260
1268
|
type Parameters = {
|
|
1261
1269
|
chainId: Id;
|
|
1262
1270
|
address: Address;
|
|
@@ -1297,33 +1305,28 @@ declare namespace Conversion {
|
|
|
1297
1305
|
}): bigint;
|
|
1298
1306
|
}
|
|
1299
1307
|
declare namespace Position_d_exports {
|
|
1300
|
-
export { Position, Type, from$
|
|
1308
|
+
export { Position, Type, from$11 as from };
|
|
1301
1309
|
}
|
|
1302
1310
|
type Position = {
|
|
1303
|
-
/** The chain id. */
|
|
1304
|
-
chainId: Id;
|
|
1311
|
+
/** The chain id. */chainId: Id;
|
|
1305
1312
|
/** The contract address from which the position is called.
|
|
1306
1313
|
* While balances are obviously tracked on ERC20 contracts, we prefer to track which contract is called to know the balance.
|
|
1307
1314
|
* For example, when depositing into a vault, we would specify the vault contract address as the contract not the underlying vault's ERC20 token address.
|
|
1308
1315
|
*/
|
|
1309
|
-
contract: Address;
|
|
1310
|
-
/** The
|
|
1311
|
-
|
|
1312
|
-
/** The type of position. */
|
|
1313
|
-
type: Type;
|
|
1314
|
-
/** The balance of the position. */
|
|
1316
|
+
contract: Address; /** The user address. */
|
|
1317
|
+
user: Address; /** The type of position. */
|
|
1318
|
+
type: Type; /** The balance of the position. */
|
|
1315
1319
|
balance?: bigint;
|
|
1316
1320
|
/** The underlying asset of the position.
|
|
1317
1321
|
* For ERC20 positions, this equals the contract address.
|
|
1318
1322
|
* For vault positions, this is the vault's underlying asset.
|
|
1319
1323
|
*/
|
|
1320
|
-
asset?: Address;
|
|
1321
|
-
/** The block number at which the position was last updated. */
|
|
1324
|
+
asset?: Address; /** The block number at which the position was last updated. */
|
|
1322
1325
|
blockNumber: number;
|
|
1323
1326
|
};
|
|
1324
1327
|
declare enum Type {
|
|
1325
1328
|
ERC20 = "erc20",
|
|
1326
|
-
VAULT_V1 = "vault_v1"
|
|
1329
|
+
VAULT_V1 = "vault_v1"
|
|
1327
1330
|
}
|
|
1328
1331
|
/**
|
|
1329
1332
|
* @constructor
|
|
@@ -1331,8 +1334,8 @@ declare enum Type {
|
|
|
1331
1334
|
* @param parameters - {@link from.Parameters}
|
|
1332
1335
|
* @returns The created Position. {@link from.ReturnType}
|
|
1333
1336
|
*/
|
|
1334
|
-
declare function from$
|
|
1335
|
-
declare namespace from$
|
|
1337
|
+
declare function from$11(parameters: from$11.Parameters): from$11.ReturnType;
|
|
1338
|
+
declare namespace from$11 {
|
|
1336
1339
|
type Parameters = {
|
|
1337
1340
|
chainId: Id;
|
|
1338
1341
|
contract: Address;
|
|
@@ -1345,18 +1348,15 @@ declare namespace from$10 {
|
|
|
1345
1348
|
type ReturnType = Position;
|
|
1346
1349
|
}
|
|
1347
1350
|
declare namespace Quote_d_exports {
|
|
1348
|
-
export { InvalidQuoteError, Quote, QuoteSchema, from$
|
|
1351
|
+
export { InvalidQuoteError, Quote, QuoteSchema, from$10 as from, fromSnakeCase, random };
|
|
1349
1352
|
}
|
|
1350
1353
|
type Quote = {
|
|
1351
|
-
/** The obligation id. */
|
|
1352
|
-
obligationId: Hex;
|
|
1354
|
+
/** The obligation id. */obligationId: Hex;
|
|
1353
1355
|
ask: {
|
|
1354
|
-
/** The ask price for the obligation. (18 decimals). */
|
|
1355
|
-
price: bigint;
|
|
1356
|
+
/** The ask price for the obligation. (18 decimals). */price: bigint;
|
|
1356
1357
|
};
|
|
1357
1358
|
bid: {
|
|
1358
|
-
/** The bid price for the obligation. (18 decimals). */
|
|
1359
|
-
price: bigint;
|
|
1359
|
+
/** The bid price for the obligation. (18 decimals). */price: bigint;
|
|
1360
1360
|
};
|
|
1361
1361
|
};
|
|
1362
1362
|
declare const QuoteSchema: z$1.ZodObject<{
|
|
@@ -1380,8 +1380,8 @@ declare const QuoteSchema: z$1.ZodObject<{
|
|
|
1380
1380
|
* const quote = Quote.from({ obligationId: "0x123", ask: { price: 100n }, bid: { price: 100n } });
|
|
1381
1381
|
* ```
|
|
1382
1382
|
*/
|
|
1383
|
-
declare function from$
|
|
1384
|
-
declare namespace from$
|
|
1383
|
+
declare function from$10(parameters: from$10.Parameters): from$10.ReturnType;
|
|
1384
|
+
declare namespace from$10 {
|
|
1385
1385
|
type Parameters = Quote;
|
|
1386
1386
|
type ReturnType = Quote;
|
|
1387
1387
|
type ErrorType = InvalidQuoteError;
|
|
@@ -1396,7 +1396,7 @@ declare function fromSnakeCase(snake: fromSnakeCase.Parameters): fromSnakeCase.R
|
|
|
1396
1396
|
declare namespace fromSnakeCase {
|
|
1397
1397
|
type Parameters = Snake<Quote>;
|
|
1398
1398
|
type ReturnType = Quote;
|
|
1399
|
-
type ErrorType = from$
|
|
1399
|
+
type ErrorType = from$10.ErrorType;
|
|
1400
1400
|
}
|
|
1401
1401
|
/**
|
|
1402
1402
|
* Generates a random quote.
|
|
@@ -1411,12 +1411,85 @@ declare function random(): random.ReturnType;
|
|
|
1411
1411
|
declare namespace random {
|
|
1412
1412
|
type Parameters = never;
|
|
1413
1413
|
type ReturnType = Quote;
|
|
1414
|
-
type ErrorType = from$
|
|
1414
|
+
type ErrorType = from$10.ErrorType;
|
|
1415
1415
|
}
|
|
1416
1416
|
declare class InvalidQuoteError extends BaseError<z$1.ZodError | Error> {
|
|
1417
1417
|
readonly name = "Quote.InvalidQuoteError";
|
|
1418
1418
|
constructor(error: z$1.ZodError | Error);
|
|
1419
1419
|
}
|
|
1420
|
+
declare namespace TradingFee_d_exports {
|
|
1421
|
+
export { BREAKPOINTS, Fees, InvalidFeeError, InvalidFeesLengthError, TradingFee, WAD, activate, compute, deactivate, from$9 as from, getFees, isActivated };
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* Time breakpoints in seconds for piecewise linear fee interpolation.
|
|
1425
|
+
* Matches on-chain constants: 0d, 1d, 7d, 30d, 90d, 180d.
|
|
1426
|
+
*/
|
|
1427
|
+
declare const BREAKPOINTS: readonly [0n, 86400n, 604800n, 2592000n, 7776000n, 15552000n];
|
|
1428
|
+
/** WAD constant (1e18) for fee scaling. */
|
|
1429
|
+
declare const WAD: bigint;
|
|
1430
|
+
/** Tuple type for the 6 fee values at each breakpoint. */
|
|
1431
|
+
type Fees = readonly [bigint, bigint, bigint, bigint, bigint, bigint];
|
|
1432
|
+
/**
|
|
1433
|
+
* TradingFee represents a piecewise linear fee curve with 6 breakpoints.
|
|
1434
|
+
* The internal storage mimics on-chain bitmap behavior but uses a struct for clarity.
|
|
1435
|
+
*/
|
|
1436
|
+
type TradingFee = {
|
|
1437
|
+
readonly _activated: boolean;
|
|
1438
|
+
readonly _fees: Fees;
|
|
1439
|
+
} & Brand<"TradingFee">;
|
|
1440
|
+
/**
|
|
1441
|
+
* Create a TradingFee from an activation flag and 6 fee values.
|
|
1442
|
+
* @param activated - Whether the fee is active.
|
|
1443
|
+
* @param fees - Tuple of 6 fee values in WAD (one per breakpoint: 0d, 1d, 7d, 30d, 90d, 180d).
|
|
1444
|
+
* @returns A new TradingFee instance.
|
|
1445
|
+
* @throws {@link InvalidFeeError} if any fee exceeds WAD (100%).
|
|
1446
|
+
* @throws {@link InvalidFeesLengthError} if fees array doesn't have exactly 6 elements.
|
|
1447
|
+
*/
|
|
1448
|
+
declare function from$9(activated: boolean, fees: Fees): TradingFee;
|
|
1449
|
+
declare namespace from$9 {
|
|
1450
|
+
type ErrorType = InvalidFeeError | InvalidFeesLengthError;
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Compute the trading fee for a given time to maturity using piecewise linear interpolation.
|
|
1454
|
+
* @param tradingFee - The TradingFee instance.
|
|
1455
|
+
* @param timeToMaturity - Time to maturity in seconds.
|
|
1456
|
+
* @returns The interpolated fee in WAD. Returns 0n if not activated.
|
|
1457
|
+
*/
|
|
1458
|
+
declare function compute(tradingFee: TradingFee, timeToMaturity: number): bigint;
|
|
1459
|
+
/**
|
|
1460
|
+
* Check if the trading fee is activated.
|
|
1461
|
+
* @param tradingFee - The TradingFee instance.
|
|
1462
|
+
* @returns True if activated, false otherwise.
|
|
1463
|
+
*/
|
|
1464
|
+
declare function isActivated(tradingFee: TradingFee): boolean;
|
|
1465
|
+
/**
|
|
1466
|
+
* Create a new TradingFee with activation enabled.
|
|
1467
|
+
* @param tradingFee - The TradingFee instance.
|
|
1468
|
+
* @returns A new TradingFee with activated set to true.
|
|
1469
|
+
*/
|
|
1470
|
+
declare function activate(tradingFee: TradingFee): TradingFee;
|
|
1471
|
+
/**
|
|
1472
|
+
* Create a new TradingFee with activation disabled.
|
|
1473
|
+
* @param tradingFee - The TradingFee instance.
|
|
1474
|
+
* @returns A new TradingFee with activated set to false.
|
|
1475
|
+
*/
|
|
1476
|
+
declare function deactivate(tradingFee: TradingFee): TradingFee;
|
|
1477
|
+
/**
|
|
1478
|
+
* Get the fee values at each breakpoint.
|
|
1479
|
+
* @param tradingFee - The TradingFee instance.
|
|
1480
|
+
* @returns The tuple of 6 fee values.
|
|
1481
|
+
*/
|
|
1482
|
+
declare function getFees(tradingFee: TradingFee): Fees;
|
|
1483
|
+
/** Error thrown when a fee value is invalid (negative or exceeds WAD). */
|
|
1484
|
+
declare class InvalidFeeError extends BaseError {
|
|
1485
|
+
readonly name = "TradingFee.InvalidFeeError";
|
|
1486
|
+
constructor(fee: bigint, index: number);
|
|
1487
|
+
}
|
|
1488
|
+
/** Error thrown when fees array doesn't have exactly 6 elements. */
|
|
1489
|
+
declare class InvalidFeesLengthError extends BaseError {
|
|
1490
|
+
readonly name = "TradingFee.InvalidFeesLengthError";
|
|
1491
|
+
constructor(length: number);
|
|
1492
|
+
}
|
|
1420
1493
|
declare namespace Transfer_d_exports {
|
|
1421
1494
|
export { Transfer, from$8 as from };
|
|
1422
1495
|
}
|
|
@@ -1462,15 +1535,11 @@ declare namespace Tree_d_exports {
|
|
|
1462
1535
|
* Constructed via {@link from}. The tree root can be signed for onchain broadcast.
|
|
1463
1536
|
*/
|
|
1464
1537
|
type Tree = Compute<StandardMerkleTree<[Hex]> & {
|
|
1465
|
-
/** The offers in the tree. */
|
|
1466
|
-
offers: Offer[];
|
|
1467
|
-
/** The root of the tree. */
|
|
1538
|
+
/** The offers in the tree. */offers: Offer[]; /** The root of the tree. */
|
|
1468
1539
|
root: Hex;
|
|
1469
1540
|
}>;
|
|
1470
1541
|
type Proof = {
|
|
1471
|
-
/** The offer that the proof is for. */
|
|
1472
|
-
offer: Offer;
|
|
1473
|
-
/** The merkle proof path for the offer. */
|
|
1542
|
+
/** The offer that the proof is for. */offer: Offer; /** The merkle proof path for the offer. */
|
|
1474
1543
|
path: Hex[];
|
|
1475
1544
|
};
|
|
1476
1545
|
declare const VERSION$1 = 1;
|
|
@@ -1603,15 +1672,10 @@ declare const names: readonly ["offers", "consumed_events", "positions", "prices
|
|
|
1603
1672
|
type Name = (typeof names)[number];
|
|
1604
1673
|
/** A general collector interface. */
|
|
1605
1674
|
type Collector<name extends Name = Name, client extends PublicClient<Transport, Chain$1> = PublicClient<Transport, Chain$1>> = {
|
|
1606
|
-
/** The name of the collector. */
|
|
1607
|
-
readonly
|
|
1608
|
-
/** The
|
|
1609
|
-
readonly
|
|
1610
|
-
/** The public client used to query chain head. */
|
|
1611
|
-
readonly client: client;
|
|
1612
|
-
/** The database connection for collector metadata. */
|
|
1613
|
-
readonly db: Database;
|
|
1614
|
-
/** The normal polling interval (ms) for this collector. */
|
|
1675
|
+
/** The name of the collector. */readonly name: name; /** The chain the collector is running on. */
|
|
1676
|
+
readonly chain: client["chain"]; /** The public client used to query chain head. */
|
|
1677
|
+
readonly client: client; /** The database connection for collector metadata. */
|
|
1678
|
+
readonly db: Database; /** The normal polling interval (ms) for this collector. */
|
|
1615
1679
|
readonly interval: number;
|
|
1616
1680
|
/** Start collecting data from external sources.
|
|
1617
1681
|
* @yields The last block number processed by the collector.
|
|
@@ -1659,31 +1723,23 @@ type HandleReorgParameters = {
|
|
|
1659
1723
|
collectorNames?: Name[];
|
|
1660
1724
|
};
|
|
1661
1725
|
type BlocksDomain = {
|
|
1662
|
-
/** Initialize and return chain + collector state, seeding rows when missing. */
|
|
1663
|
-
init: (parameters: InitParameters) => Promise<{
|
|
1726
|
+
/** Initialize and return chain + collector state, seeding rows when missing. */init: (parameters: InitParameters) => Promise<{
|
|
1664
1727
|
chain: ChainState;
|
|
1665
1728
|
collector: CollectorState;
|
|
1666
|
-
}>;
|
|
1667
|
-
/** Return
|
|
1668
|
-
getChain: (chainId: Id) => Promise<ChainState>;
|
|
1669
|
-
/** Return collector state, failing if it has not been initialized yet. */
|
|
1729
|
+
}>; /** Return chain state, failing if it has not been initialized yet. */
|
|
1730
|
+
getChain: (chainId: Id) => Promise<ChainState>; /** Return collector state, failing if it has not been initialized yet. */
|
|
1670
1731
|
getCollector: (parameters: {
|
|
1671
1732
|
chainId: Id;
|
|
1672
1733
|
collectorName: Name;
|
|
1673
|
-
}) => Promise<CollectorState>;
|
|
1674
|
-
/** Return chain state rows, optionally filtered by chain id. */
|
|
1734
|
+
}) => Promise<CollectorState>; /** Return chain state rows, optionally filtered by chain id. */
|
|
1675
1735
|
getChains: (parameters?: {
|
|
1676
1736
|
chainId?: Id;
|
|
1677
|
-
}) => Promise<ChainSnapshot[]>;
|
|
1678
|
-
/** Return collector state rows, optionally filtered by chain id. */
|
|
1737
|
+
}) => Promise<ChainSnapshot[]>; /** Return collector state rows, optionally filtered by chain id. */
|
|
1679
1738
|
getCollectors: (parameters?: {
|
|
1680
1739
|
chainId?: Id;
|
|
1681
|
-
}) => Promise<CollectorSnapshot[]>;
|
|
1682
|
-
/** Persist
|
|
1683
|
-
|
|
1684
|
-
/** Persist collector block state updates and enforce invariants via storage CAS. */
|
|
1685
|
-
advanceCollector: (parameters: AdvanceCollectorParameters) => Promise<void>;
|
|
1686
|
-
/** Apply a reorg by advancing the chain epoch and fencing collectors. */
|
|
1740
|
+
}) => Promise<CollectorSnapshot[]>; /** Persist chain block state updates. */
|
|
1741
|
+
advanceChain: (parameters: AdvanceChainParameters) => Promise<void>; /** Persist collector block state updates and enforce invariants via storage CAS. */
|
|
1742
|
+
advanceCollector: (parameters: AdvanceCollectorParameters) => Promise<void>; /** Apply a reorg by advancing the chain epoch and fencing collectors. */
|
|
1687
1743
|
handleReorg: (parameters: HandleReorgParameters) => Promise<void>;
|
|
1688
1744
|
};
|
|
1689
1745
|
declare namespace Logger_d_exports {
|
|
@@ -1743,8 +1799,7 @@ type Row = {
|
|
|
1743
1799
|
blockNumber: number;
|
|
1744
1800
|
};
|
|
1745
1801
|
type OffersDomain = {
|
|
1746
|
-
/** Create multiple offers. */
|
|
1747
|
-
create: (batches: CreateBatch[]) => Promise<Hex[]>;
|
|
1802
|
+
/** Create multiple offers. */create: (batches: CreateBatch[]) => Promise<Hex[]>;
|
|
1748
1803
|
/** Delete multiple offers by hashes or block number greater than or equal to the given value on a given chain.
|
|
1749
1804
|
* @returns the number of offers deleted.
|
|
1750
1805
|
*/
|
|
@@ -1753,65 +1808,50 @@ type OffersDomain = {
|
|
|
1753
1808
|
} | {
|
|
1754
1809
|
blockNumberGte: number;
|
|
1755
1810
|
chainId: Id;
|
|
1756
|
-
}) => Promise<number>;
|
|
1757
|
-
/** Get all offers. */
|
|
1811
|
+
}) => Promise<number>; /** Get all offers. */
|
|
1758
1812
|
get: (parameters?: GetOffersParams) => Promise<{
|
|
1759
1813
|
rows: Row[];
|
|
1760
1814
|
nextCursor: string | null;
|
|
1761
|
-
}>;
|
|
1762
|
-
/** Get obligations */
|
|
1815
|
+
}>; /** Get obligations */
|
|
1763
1816
|
getObligations: (parameters?: {
|
|
1764
1817
|
ids?: Hex[];
|
|
1765
|
-
chainId?: Id;
|
|
1766
|
-
loanToken?: Address;
|
|
1767
|
-
collateralToken?: Address;
|
|
1768
|
-
maturity?: number;
|
|
1818
|
+
chainId?: Id[];
|
|
1819
|
+
loanToken?: Address[];
|
|
1820
|
+
collateralToken?: Address[];
|
|
1821
|
+
maturity?: number[];
|
|
1769
1822
|
cursor?: string;
|
|
1770
1823
|
limit?: number;
|
|
1771
1824
|
}) => Promise<{
|
|
1772
1825
|
obligations: Obligation[];
|
|
1773
1826
|
nextCursor: string | null;
|
|
1774
|
-
}>;
|
|
1775
|
-
/** Get quotes for given obligations. */
|
|
1827
|
+
}>; /** Get quotes for given obligations. */
|
|
1776
1828
|
getQuotes: (parameters: {
|
|
1777
1829
|
obligationIds: Hex[];
|
|
1778
1830
|
}) => Promise<Quote[]>;
|
|
1779
1831
|
};
|
|
1780
1832
|
type PaginationParams$1 = {
|
|
1781
|
-
/** Cursor string returned by a previous call, for pagination */
|
|
1782
|
-
cursor?: string;
|
|
1783
|
-
/** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1833
|
+
/** Cursor string returned by a previous call, for pagination */cursor?: string; /** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1784
1834
|
limit?: number;
|
|
1785
1835
|
};
|
|
1786
1836
|
type GetOffersParams = {
|
|
1787
|
-
/** Filter by maker address */
|
|
1788
|
-
maker?: Address;
|
|
1837
|
+
/** Filter by maker address */maker?: Address;
|
|
1789
1838
|
} & PaginationParams$1;
|
|
1790
1839
|
//#endregion
|
|
1791
1840
|
//#region src/database/domains/Book.d.ts
|
|
1792
1841
|
type BookDomain = {
|
|
1793
|
-
/** Get aggregated book levels for a given obligation side. */
|
|
1794
|
-
get: (parameters: get$4.Parameters) => Promise<get$4.ReturnType>;
|
|
1795
|
-
/** Get all offers for a given obligation side with cross-invalidation. */
|
|
1842
|
+
/** Get aggregated book levels for a given obligation side. */get: (parameters: get$4.Parameters) => Promise<get$4.ReturnType>; /** Get all offers for a given obligation side with cross-invalidation. */
|
|
1796
1843
|
getOffers: (parameters: getOffers$2.Parameters) => Promise<getOffers$2.ReturnType>;
|
|
1797
1844
|
};
|
|
1798
1845
|
declare namespace get$4 {
|
|
1799
1846
|
type Parameters = {
|
|
1800
|
-
/** The side of the offer. */
|
|
1801
|
-
|
|
1802
|
-
/**
|
|
1803
|
-
obligationId: Hex;
|
|
1804
|
-
/** Cursor string returned by a previous call, for pagination */
|
|
1805
|
-
cursor?: string;
|
|
1806
|
-
/** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1847
|
+
/** The side of the offer. */side: "buy" | "sell"; /** The obligationId of the offer. */
|
|
1848
|
+
obligationId: Hex; /** Cursor string returned by a previous call, for pagination */
|
|
1849
|
+
cursor?: string; /** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1807
1850
|
limit?: number;
|
|
1808
1851
|
};
|
|
1809
1852
|
type Level = {
|
|
1810
|
-
/** The computed price for this level (interpolated at query time) */
|
|
1811
|
-
|
|
1812
|
-
/** Sum of takeable amounts at this price */
|
|
1813
|
-
assets: bigint;
|
|
1814
|
-
/** Number of offers at this price */
|
|
1853
|
+
/** The computed price for this level (interpolated at query time) */price: bigint; /** Sum of takeable amounts at this price */
|
|
1854
|
+
assets: bigint; /** Number of offers at this price */
|
|
1815
1855
|
count: number;
|
|
1816
1856
|
};
|
|
1817
1857
|
type ReturnType = {
|
|
@@ -1821,13 +1861,9 @@ declare namespace get$4 {
|
|
|
1821
1861
|
}
|
|
1822
1862
|
declare namespace getOffers$2 {
|
|
1823
1863
|
type Parameters = {
|
|
1824
|
-
/** The side of the offer. */
|
|
1825
|
-
|
|
1826
|
-
/**
|
|
1827
|
-
obligationId: Hex;
|
|
1828
|
-
/** Cursor string returned by a previous call, for pagination */
|
|
1829
|
-
cursor?: string;
|
|
1830
|
-
/** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1864
|
+
/** The side of the offer. */side: "buy" | "sell"; /** The obligationId of the offer. */
|
|
1865
|
+
obligationId: Hex; /** Cursor string returned by a previous call, for pagination */
|
|
1866
|
+
cursor?: string; /** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1831
1867
|
limit?: number;
|
|
1832
1868
|
};
|
|
1833
1869
|
type ReturnType = {
|
|
@@ -1846,9 +1882,7 @@ type Event = {
|
|
|
1846
1882
|
blockNumber: number;
|
|
1847
1883
|
};
|
|
1848
1884
|
type ConsumedDomain = {
|
|
1849
|
-
/** Create new consumed events. */
|
|
1850
|
-
create: (parameters: Event[]) => Promise<void>;
|
|
1851
|
-
/** Delete multiple consumed events by chain and block number greater than or equal to the given value. */
|
|
1885
|
+
/** Create new consumed events. */create: (parameters: Event[]) => Promise<void>; /** Delete multiple consumed events by chain and block number greater than or equal to the given value. */
|
|
1852
1886
|
delete: (parameters: {
|
|
1853
1887
|
chainId: Id;
|
|
1854
1888
|
blockNumberGte: number;
|
|
@@ -1942,9 +1976,7 @@ type OraclesDomain = {
|
|
|
1942
1976
|
//#endregion
|
|
1943
1977
|
//#region src/database/domains/Positions.d.ts
|
|
1944
1978
|
type PaginationParams = {
|
|
1945
|
-
/** Cursor string returned by a previous call, for pagination */
|
|
1946
|
-
cursor?: string;
|
|
1947
|
-
/** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1979
|
+
/** Cursor string returned by a previous call, for pagination */cursor?: string; /** Page size; defaults to {@link DEFAULT_LIMIT} */
|
|
1948
1980
|
limit?: number;
|
|
1949
1981
|
};
|
|
1950
1982
|
type PositionsDomain = {
|
|
@@ -1982,11 +2014,8 @@ declare namespace upsert {
|
|
|
1982
2014
|
}
|
|
1983
2015
|
declare namespace get$1 {
|
|
1984
2016
|
type Parameters = PaginationParams & {
|
|
1985
|
-
/** The chain id to get positions for. Default is all chains. */
|
|
1986
|
-
|
|
1987
|
-
/** The type of position to get. Default is all types. */
|
|
1988
|
-
type?: Type;
|
|
1989
|
-
/** If true, only return positions that have a balance. */
|
|
2017
|
+
/** The chain id to get positions for. Default is all chains. */chainId?: Id; /** The type of position to get. Default is all types. */
|
|
2018
|
+
type?: Type; /** If true, only return positions that have a balance. */
|
|
1990
2019
|
filled?: boolean;
|
|
1991
2020
|
};
|
|
1992
2021
|
type ReturnType = {
|
|
@@ -1996,15 +2025,13 @@ declare namespace get$1 {
|
|
|
1996
2025
|
}
|
|
1997
2026
|
declare namespace getByUser {
|
|
1998
2027
|
type Parameters = PaginationParams & {
|
|
1999
|
-
/** The user address to get positions for. */
|
|
2000
|
-
user: Address;
|
|
2028
|
+
/** The user address to get positions for. */user: Address;
|
|
2001
2029
|
};
|
|
2002
2030
|
type PositionWithReserved = {
|
|
2003
2031
|
chainId: Id;
|
|
2004
2032
|
contract: Address;
|
|
2005
2033
|
user: Address;
|
|
2006
|
-
blockNumber: number;
|
|
2007
|
-
/** The amount reserved by active offers: max(lot.upper) - offset - consumed */
|
|
2034
|
+
blockNumber: number; /** The amount reserved by active offers: max(lot.upper) - offset - consumed */
|
|
2008
2035
|
reserved: bigint;
|
|
2009
2036
|
};
|
|
2010
2037
|
type ReturnType = {
|
|
@@ -2014,9 +2041,7 @@ declare namespace getByUser {
|
|
|
2014
2041
|
}
|
|
2015
2042
|
declare namespace setEmptyAfter {
|
|
2016
2043
|
type Parameters = {
|
|
2017
|
-
/** The chain id . */
|
|
2018
|
-
chainId: Id;
|
|
2019
|
-
/** The block number after which all positions should be set to empty. (inclusive) */
|
|
2044
|
+
/** The chain id . */chainId: Id; /** The block number after which all positions should be set to empty. (inclusive) */
|
|
2020
2045
|
blockNumber: number;
|
|
2021
2046
|
};
|
|
2022
2047
|
type ReturnType = number;
|
|
@@ -2135,20 +2160,20 @@ declare namespace Gate_d_exports {
|
|
|
2135
2160
|
/**
|
|
2136
2161
|
* A validation rule.
|
|
2137
2162
|
*/
|
|
2138
|
-
type Rule<T, Name
|
|
2163
|
+
type Rule<T, Name extends string = string> = {
|
|
2139
2164
|
kind: "single";
|
|
2140
|
-
name: Name
|
|
2165
|
+
name: Name;
|
|
2141
2166
|
description: string;
|
|
2142
|
-
run: Single<T, Name
|
|
2167
|
+
run: Single<T, Name>;
|
|
2143
2168
|
} | {
|
|
2144
2169
|
kind: "batch";
|
|
2145
|
-
name: Name
|
|
2170
|
+
name: Name;
|
|
2146
2171
|
description: string;
|
|
2147
|
-
run: Batch<T, Name
|
|
2172
|
+
run: Batch<T, Name>;
|
|
2148
2173
|
};
|
|
2149
|
-
type RuleNames<Rules
|
|
2174
|
+
type RuleNames<Rules extends readonly {
|
|
2150
2175
|
name: string;
|
|
2151
|
-
}[]> = Rules
|
|
2176
|
+
}[]> = Rules[number]["name"];
|
|
2152
2177
|
/**
|
|
2153
2178
|
* A single item validation rule.
|
|
2154
2179
|
* @param item - The item to validate.
|
|
@@ -2168,7 +2193,7 @@ type Batch<T, RuleName extends string> = (items: T[]) => Map<number, Omit<Issue<
|
|
|
2168
2193
|
* @param run - The function that validates the rule.
|
|
2169
2194
|
* @returns The created rule.
|
|
2170
2195
|
*/
|
|
2171
|
-
declare function single<Name
|
|
2196
|
+
declare function single<Name extends string, T>(name: Name, description: string, run: Single<T, Name>): Rule<T, Name>;
|
|
2172
2197
|
/**
|
|
2173
2198
|
* Create a validation rule iterating over a batch of items at a time.
|
|
2174
2199
|
* @param name - The name of the rule.
|
|
@@ -2176,153 +2201,90 @@ declare function single<Name$2 extends string, T>(name: Name$2, description: str
|
|
|
2176
2201
|
* @param run - The function that validates the rule.
|
|
2177
2202
|
* @returns The created rule.
|
|
2178
2203
|
*/
|
|
2179
|
-
declare function batch$1<Name
|
|
2204
|
+
declare function batch$1<Name extends string, T>(name: Name, description: string, run: Batch<T, Name>): Rule<T, Name>;
|
|
2180
2205
|
/**
|
|
2181
2206
|
* A validation issue.
|
|
2182
2207
|
*/
|
|
2183
2208
|
type Issue<T, RuleName extends string = string> = {
|
|
2184
|
-
/** The name of the rule that caused the issue. */
|
|
2185
|
-
|
|
2186
|
-
/** The message of the issue. */
|
|
2187
|
-
message: string;
|
|
2188
|
-
/** The item that was not valid. */
|
|
2209
|
+
/** The name of the rule that caused the issue. */ruleName: RuleName; /** The message of the issue. */
|
|
2210
|
+
message: string; /** The item that was not valid. */
|
|
2189
2211
|
item: T;
|
|
2190
2212
|
};
|
|
2191
2213
|
/**
|
|
2192
2214
|
* The result of a validation.
|
|
2193
2215
|
*/
|
|
2194
2216
|
type Result<T, RuleName extends string = string> = {
|
|
2195
|
-
/** The items that were valid. */
|
|
2196
|
-
valid: T[];
|
|
2197
|
-
/** The reports of the failed validations. */
|
|
2217
|
+
/** The items that were valid. */valid: T[]; /** The reports of the failed validations. */
|
|
2198
2218
|
issues: Issue<T, RuleName>[];
|
|
2199
2219
|
};
|
|
2200
|
-
declare function run<T, Name
|
|
2220
|
+
declare function run<T, Name extends string, Rules extends readonly Rule<T, Name>[]>(parameters: {
|
|
2201
2221
|
items: T[];
|
|
2202
|
-
rules: Rules$1;
|
|
2203
|
-
chunkSize?: number;
|
|
2204
|
-
}): Promise<Result<T, RuleNames<Rules$1>>>;
|
|
2205
|
-
declare namespace Gatekeeper_d_exports {
|
|
2206
|
-
export { Gatekeeper, Rules, create$3 as create };
|
|
2207
|
-
}
|
|
2208
|
-
type Rules = readonly Rule<Offer, string>[];
|
|
2209
|
-
type Gatekeeper = {
|
|
2210
2222
|
rules: Rules;
|
|
2211
|
-
|
|
2223
|
+
chunkSize?: number;
|
|
2224
|
+
}): Promise<Result<T, RuleNames<Rules>>>;
|
|
2225
|
+
//#endregion
|
|
2226
|
+
//#region src/gatekeeper/types.d.ts
|
|
2227
|
+
type RuleInfo = {
|
|
2228
|
+
name: string;
|
|
2229
|
+
description: string;
|
|
2212
2230
|
};
|
|
2213
|
-
type
|
|
2214
|
-
|
|
2231
|
+
type RulesProvider = {
|
|
2232
|
+
getRules: () => Promise<RuleInfo[]>;
|
|
2215
2233
|
};
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
type GateConfig = {
|
|
2221
|
-
callbacks?: CallbackConfig[];
|
|
2222
|
-
maturities?: MaturityType[];
|
|
2234
|
+
type ValidationIssue = {
|
|
2235
|
+
index: number;
|
|
2236
|
+
rule: string;
|
|
2237
|
+
message: string;
|
|
2223
2238
|
};
|
|
2224
|
-
type
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
vaultFactories: Address[];
|
|
2228
|
-
} | {
|
|
2229
|
-
type: CallbackType.SellERC20Callback;
|
|
2230
|
-
addresses: Address[];
|
|
2231
|
-
} | {
|
|
2232
|
-
type: CallbackType.BuyWithEmptyCallback;
|
|
2239
|
+
type ValidateOffersSuccess = {
|
|
2240
|
+
payload: Hex;
|
|
2241
|
+
root: Hex;
|
|
2233
2242
|
};
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
* @returns The matching callback addresses or an empty array if not configured
|
|
2258
|
-
*/
|
|
2259
|
-
declare function getCallbackTypeAddresses(chain: Name$1, type: CallbackType): Address[];
|
|
2260
|
-
/**
|
|
2261
|
-
* Returns the list of allowed non-empty callback addresses for a chain.
|
|
2262
|
-
*
|
|
2263
|
-
* @param chain - Chain name
|
|
2264
|
-
* @returns Array of allowed callback addresses (lowercased). Empty when none configured
|
|
2265
|
-
*/
|
|
2266
|
-
declare const getCallbackAddresses: (chain: Name$1) => Address[];
|
|
2267
|
-
declare const assets: Record<string, Address[]>;
|
|
2268
|
-
declare const configs: Record<Name$1, GateConfig>;
|
|
2269
|
-
//#endregion
|
|
2270
|
-
//#region src/gatekeeper/morphoRules.d.ts
|
|
2271
|
-
declare const morphoRules: (chains: Chain$1[]) => (Rule<Offer, "chain_ids"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "token"> | Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity">)[];
|
|
2272
|
-
declare namespace Rules_d_exports {
|
|
2273
|
-
export { ValidityParameters, amountMutualExclusivity, callback, chains$1 as chains, maturity, sameMaker, token, validity };
|
|
2243
|
+
type ValidateOffersIssues = {
|
|
2244
|
+
issues: ValidationIssue[];
|
|
2245
|
+
};
|
|
2246
|
+
type ValidateOffersData = ValidateOffersSuccess | ValidateOffersIssues;
|
|
2247
|
+
type SuccessPayload<T> = {
|
|
2248
|
+
meta: {
|
|
2249
|
+
timestamp: string;
|
|
2250
|
+
};
|
|
2251
|
+
cursor: string | null;
|
|
2252
|
+
data: T;
|
|
2253
|
+
};
|
|
2254
|
+
type ErrorPayload = {
|
|
2255
|
+
meta: {
|
|
2256
|
+
timestamp: string;
|
|
2257
|
+
};
|
|
2258
|
+
error: {
|
|
2259
|
+
code: string;
|
|
2260
|
+
message: string;
|
|
2261
|
+
details?: unknown;
|
|
2262
|
+
};
|
|
2263
|
+
};
|
|
2264
|
+
declare namespace Client_d_exports {
|
|
2265
|
+
export { ClientConfig, GatekeeperClient, createHttpClient };
|
|
2274
2266
|
}
|
|
2275
|
-
type
|
|
2276
|
-
|
|
2267
|
+
type GatekeeperClient = RulesProvider & {
|
|
2268
|
+
/** Validate offers and return the raw response payload. */validate: (body: unknown) => Promise<{
|
|
2269
|
+
statusCode: number;
|
|
2270
|
+
body: unknown;
|
|
2271
|
+
}>; /** Validate offers and return decision results. */
|
|
2272
|
+
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>; /** Base URL for the gatekeeper service. */
|
|
2273
|
+
baseUrl: string;
|
|
2274
|
+
};
|
|
2275
|
+
type ClientConfig = {
|
|
2276
|
+
baseUrl: string;
|
|
2277
|
+
timeoutMs?: number;
|
|
2278
|
+
fetchFn?: typeof fetch;
|
|
2277
2279
|
};
|
|
2278
2280
|
/**
|
|
2279
|
-
*
|
|
2280
|
-
*
|
|
2281
|
-
* @
|
|
2282
|
-
* @returns Array of validation rules to evaluate against offers
|
|
2283
|
-
*/
|
|
2284
|
-
declare function validity(parameters: ValidityParameters): (Rule<Offer, "expiry"> | Rule<Offer, "sell_erc20_callback_invalid"> | Rule<Offer, "buy_offers_callback_vault_invalid">)[];
|
|
2285
|
-
declare const chains$1: ({
|
|
2286
|
-
chains: chains$1
|
|
2287
|
-
}: {
|
|
2288
|
-
chains: Chain$1[];
|
|
2289
|
-
}) => Rule<Offer, "chain_ids">;
|
|
2290
|
-
declare const maturity: ({
|
|
2291
|
-
maturities
|
|
2292
|
-
}: {
|
|
2293
|
-
maturities: MaturityType[];
|
|
2294
|
-
}) => Rule<Offer, "maturity">;
|
|
2295
|
-
declare const callback: ({
|
|
2296
|
-
callbacks,
|
|
2297
|
-
allowedAddresses
|
|
2298
|
-
}: {
|
|
2299
|
-
callbacks: CallbackType[];
|
|
2300
|
-
allowedAddresses: Address[];
|
|
2301
|
-
}) => Rule<Offer, "callback">;
|
|
2302
|
-
/**
|
|
2303
|
-
* A validation rule that checks if the offer's tokens are allowed for its chain.
|
|
2304
|
-
* @param assetsByChainId - Allowed assets indexed by chain id.
|
|
2305
|
-
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
2306
|
-
*/
|
|
2307
|
-
declare const token: ({
|
|
2308
|
-
assetsByChainId
|
|
2309
|
-
}: {
|
|
2310
|
-
assetsByChainId: Partial<Record<Id, Address[]>>;
|
|
2311
|
-
}) => Rule<Offer, "token">;
|
|
2312
|
-
/**
|
|
2313
|
-
* A batch validation rule that ensures all offers in a tree have the same maker address.
|
|
2314
|
-
* Returns an issue only for the first non-conforming offer.
|
|
2315
|
-
* This rule is signing-agnostic; signer verification is handled at the collector level.
|
|
2281
|
+
* Create an HTTP client for a gatekeeper service.
|
|
2282
|
+
* @param config - Gatekeeper client configuration. {@link ClientConfig}
|
|
2283
|
+
* @returns An HTTP-backed gatekeeper client. {@link GatekeeperClient}
|
|
2316
2284
|
*/
|
|
2317
|
-
declare
|
|
2318
|
-
/**
|
|
2319
|
-
* A validation rule that ensures mutual exclusivity of offer amount fields.
|
|
2320
|
-
* At most one of (assets, obligationUnits, obligationShares) can be non-zero.
|
|
2321
|
-
* Matches contract requirement: `atMostOneNonZero(offer.assets, offer.obligationUnits, offer.obligationShares)`.
|
|
2322
|
-
*/
|
|
2323
|
-
declare const amountMutualExclusivity: () => Rule<Offer, "amount_mutual_exclusivity">;
|
|
2285
|
+
declare function createHttpClient(config: ClientConfig): GatekeeperClient;
|
|
2324
2286
|
declare namespace Indexer_d_exports {
|
|
2325
|
-
export { Indexer, IndexerConfig, create$
|
|
2287
|
+
export { Indexer, IndexerConfig, create$3 as create, from$6 as from };
|
|
2326
2288
|
}
|
|
2327
2289
|
type Indexer = {
|
|
2328
2290
|
start: () => () => void;
|
|
@@ -2332,7 +2294,7 @@ type Indexer = {
|
|
|
2332
2294
|
type IndexerConfig<client extends PublicClient<Transport, Chain$1, Account | undefined>> = {
|
|
2333
2295
|
client: client;
|
|
2334
2296
|
db: Database;
|
|
2335
|
-
gatekeeper:
|
|
2297
|
+
gatekeeper: GatekeeperClient;
|
|
2336
2298
|
interval?: number;
|
|
2337
2299
|
maxBatchSize?: number;
|
|
2338
2300
|
maxBlockNumber?: number;
|
|
@@ -2341,12 +2303,12 @@ type IndexerConfig<client extends PublicClient<Transport, Chain$1, Account | und
|
|
|
2341
2303
|
retryDelayMs?: number;
|
|
2342
2304
|
};
|
|
2343
2305
|
declare function from$6<client extends PublicClient<Transport, Chain$1, Account | undefined>>(config: IndexerConfig<client>): Indexer;
|
|
2344
|
-
declare function create$
|
|
2306
|
+
declare function create$3<client extends PublicClient<Transport, Chain$1, Account | undefined>>(params: {
|
|
2345
2307
|
collectors: Collector[];
|
|
2346
2308
|
client: client;
|
|
2347
2309
|
}): Indexer;
|
|
2348
2310
|
declare namespace Health_d_exports {
|
|
2349
|
-
export { ChainHealth$1 as ChainHealth, CollectorHealth$1 as CollectorHealth, CollectorHealthStatus, HealthService, HealthServiceParameters, MissingCollector, RouterHealth, RouterStatus, create$
|
|
2311
|
+
export { ChainHealth$1 as ChainHealth, CollectorHealth$1 as CollectorHealth, CollectorHealthStatus, HealthService, HealthServiceParameters, MissingCollector, RouterHealth, RouterStatus, create$2 as create };
|
|
2350
2312
|
}
|
|
2351
2313
|
type CollectorHealthStatus = "live" | "lagging" | "unknown";
|
|
2352
2314
|
type RouterStatus = "live" | "syncing";
|
|
@@ -2384,12 +2346,9 @@ type HealthService = {
|
|
|
2384
2346
|
getChains: () => Promise<ChainHealth$1[]>;
|
|
2385
2347
|
};
|
|
2386
2348
|
type HealthServiceParameters = {
|
|
2387
|
-
db: Database;
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
/** Map of chainId to client for fetching remote block numbers. */
|
|
2391
|
-
healthClients?: Map<Id, Client>;
|
|
2392
|
-
/** Chain registry for deriving expected initialization state. */
|
|
2349
|
+
db: Database; /** Maximum number of blocks a collector can lag behind its chain before being considered lagging. */
|
|
2350
|
+
maxAllowedLag?: number; /** Map of chainId to client for fetching remote block numbers. */
|
|
2351
|
+
healthClients?: Map<Id, Client>; /** Chain registry for deriving expected initialization state. */
|
|
2393
2352
|
chainRegistry?: ChainRegistry;
|
|
2394
2353
|
};
|
|
2395
2354
|
type Snapshot = {
|
|
@@ -2403,7 +2362,7 @@ type Snapshot = {
|
|
|
2403
2362
|
/**
|
|
2404
2363
|
* Create a health service that exposes collector and chain block numbers.
|
|
2405
2364
|
*/
|
|
2406
|
-
declare function create$
|
|
2365
|
+
declare function create$2(parameters: HealthServiceParameters): HealthService;
|
|
2407
2366
|
//#endregion
|
|
2408
2367
|
//#region src/api/Api.d.ts
|
|
2409
2368
|
type RouterApi = {
|
|
@@ -2411,18 +2370,18 @@ type RouterApi = {
|
|
|
2411
2370
|
};
|
|
2412
2371
|
type ApiConfig = {
|
|
2413
2372
|
db: Database;
|
|
2414
|
-
gatekeeper:
|
|
2373
|
+
gatekeeper: GatekeeperClient;
|
|
2415
2374
|
port: number;
|
|
2416
2375
|
chainRegistry: ChainRegistry;
|
|
2417
2376
|
};
|
|
2418
2377
|
declare function from$5(config: ApiConfig): RouterApi;
|
|
2419
2378
|
type CreateParameters = {
|
|
2420
2379
|
db: Database;
|
|
2421
|
-
gatekeeper:
|
|
2380
|
+
gatekeeper: GatekeeperClient;
|
|
2422
2381
|
port: number;
|
|
2423
2382
|
chainRegistry: ChainRegistry;
|
|
2424
2383
|
};
|
|
2425
|
-
declare function create(params: CreateParameters): RouterApi;
|
|
2384
|
+
declare function create$1(params: CreateParameters): RouterApi;
|
|
2426
2385
|
declare namespace BookResponse_d_exports {
|
|
2427
2386
|
export { BookLevelResponse, from$4 as from };
|
|
2428
2387
|
}
|
|
@@ -2499,7 +2458,6 @@ type RouterStatusResponse = z.infer<typeof RouterStatusResponse>;
|
|
|
2499
2458
|
* This file was auto-generated by openapi-typescript.
|
|
2500
2459
|
* Do not make direct changes to the file.
|
|
2501
2460
|
*/
|
|
2502
|
-
|
|
2503
2461
|
interface paths {
|
|
2504
2462
|
"/v1/books/{obligationId}/{side}": {
|
|
2505
2463
|
parameters: {
|
|
@@ -2543,16 +2501,14 @@ interface paths {
|
|
|
2543
2501
|
};
|
|
2544
2502
|
requestBody?: never;
|
|
2545
2503
|
responses: {
|
|
2546
|
-
/** @description Success */
|
|
2547
|
-
200: {
|
|
2504
|
+
/** @description Success */200: {
|
|
2548
2505
|
headers: {
|
|
2549
2506
|
[name: string]: unknown;
|
|
2550
2507
|
};
|
|
2551
2508
|
content: {
|
|
2552
2509
|
"application/json": components["schemas"]["BookListResponse"];
|
|
2553
2510
|
};
|
|
2554
|
-
};
|
|
2555
|
-
/** @description Bad Request */
|
|
2511
|
+
}; /** @description Bad Request */
|
|
2556
2512
|
400: {
|
|
2557
2513
|
headers: {
|
|
2558
2514
|
[name: string]: unknown;
|
|
@@ -2580,7 +2536,7 @@ interface paths {
|
|
|
2580
2536
|
};
|
|
2581
2537
|
/**
|
|
2582
2538
|
* Get router configuration
|
|
2583
|
-
* @description Returns chain configurations including contract addresses and supported
|
|
2539
|
+
* @description Returns chain configurations including contract addresses and supported callback types.
|
|
2584
2540
|
*/
|
|
2585
2541
|
get: {
|
|
2586
2542
|
parameters: {
|
|
@@ -2591,8 +2547,7 @@ interface paths {
|
|
|
2591
2547
|
};
|
|
2592
2548
|
requestBody?: never;
|
|
2593
2549
|
responses: {
|
|
2594
|
-
/** @description Success */
|
|
2595
|
-
200: {
|
|
2550
|
+
/** @description Success */200: {
|
|
2596
2551
|
headers: {
|
|
2597
2552
|
[name: string]: unknown;
|
|
2598
2553
|
};
|
|
@@ -2656,16 +2611,14 @@ interface paths {
|
|
|
2656
2611
|
};
|
|
2657
2612
|
requestBody?: never;
|
|
2658
2613
|
responses: {
|
|
2659
|
-
/** @description Success */
|
|
2660
|
-
200: {
|
|
2614
|
+
/** @description Success */200: {
|
|
2661
2615
|
headers: {
|
|
2662
2616
|
[name: string]: unknown;
|
|
2663
2617
|
};
|
|
2664
2618
|
content: {
|
|
2665
2619
|
"application/json": components["schemas"]["OfferListResponse"];
|
|
2666
2620
|
};
|
|
2667
|
-
};
|
|
2668
|
-
/** @description Bad Request */
|
|
2621
|
+
}; /** @description Bad Request */
|
|
2669
2622
|
400: {
|
|
2670
2623
|
headers: {
|
|
2671
2624
|
[name: string]: unknown;
|
|
@@ -2699,25 +2652,25 @@ interface paths {
|
|
|
2699
2652
|
parameters: {
|
|
2700
2653
|
query?: {
|
|
2701
2654
|
/**
|
|
2702
|
-
* @description Filter by exact maturity
|
|
2703
|
-
* @example 1761922800
|
|
2655
|
+
* @description Filter by exact maturity timestamps (comma-separated, unix seconds).
|
|
2656
|
+
* @example 1761922800,1764524800
|
|
2704
2657
|
*/
|
|
2705
|
-
|
|
2658
|
+
maturities?: number[];
|
|
2706
2659
|
/**
|
|
2707
|
-
* @description Filter by collateral
|
|
2708
|
-
* @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751
|
|
2660
|
+
* @description Filter by collateral tokens (comma-separated, matches any collateral).
|
|
2661
|
+
* @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751,0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078
|
|
2709
2662
|
*/
|
|
2710
|
-
|
|
2663
|
+
collateral_tokens?: string[];
|
|
2711
2664
|
/**
|
|
2712
|
-
* @description Filter by loan token
|
|
2713
|
-
* @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078
|
|
2665
|
+
* @description Filter by loan token addresses (comma-separated).
|
|
2666
|
+
* @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078,0x34Cf890dB685FC536E05652FB41f02090c3fb751
|
|
2714
2667
|
*/
|
|
2715
|
-
|
|
2668
|
+
loan_tokens?: string[];
|
|
2716
2669
|
/**
|
|
2717
|
-
* @description Filter by chain
|
|
2718
|
-
* @example 1
|
|
2670
|
+
* @description Filter by chain IDs (comma-separated).
|
|
2671
|
+
* @example 1,8453
|
|
2719
2672
|
*/
|
|
2720
|
-
|
|
2673
|
+
chains?: number[];
|
|
2721
2674
|
/**
|
|
2722
2675
|
* @description Maximum number of obligations to return.
|
|
2723
2676
|
* @example 10
|
|
@@ -2735,16 +2688,14 @@ interface paths {
|
|
|
2735
2688
|
};
|
|
2736
2689
|
requestBody?: never;
|
|
2737
2690
|
responses: {
|
|
2738
|
-
/** @description Success */
|
|
2739
|
-
200: {
|
|
2691
|
+
/** @description Success */200: {
|
|
2740
2692
|
headers: {
|
|
2741
2693
|
[name: string]: unknown;
|
|
2742
2694
|
};
|
|
2743
2695
|
content: {
|
|
2744
2696
|
"application/json": components["schemas"]["ObligationListResponse"];
|
|
2745
2697
|
};
|
|
2746
|
-
};
|
|
2747
|
-
/** @description Bad Request */
|
|
2698
|
+
}; /** @description Bad Request */
|
|
2748
2699
|
400: {
|
|
2749
2700
|
headers: {
|
|
2750
2701
|
[name: string]: unknown;
|
|
@@ -2789,16 +2740,14 @@ interface paths {
|
|
|
2789
2740
|
};
|
|
2790
2741
|
requestBody?: never;
|
|
2791
2742
|
responses: {
|
|
2792
|
-
/** @description Success */
|
|
2793
|
-
200: {
|
|
2743
|
+
/** @description Success */200: {
|
|
2794
2744
|
headers: {
|
|
2795
2745
|
[name: string]: unknown;
|
|
2796
2746
|
};
|
|
2797
2747
|
content: {
|
|
2798
2748
|
"application/json": components["schemas"]["ObligationSingleSuccessResponse"];
|
|
2799
2749
|
};
|
|
2800
|
-
};
|
|
2801
|
-
/** @description Bad Request */
|
|
2750
|
+
}; /** @description Bad Request */
|
|
2802
2751
|
400: {
|
|
2803
2752
|
headers: {
|
|
2804
2753
|
[name: string]: unknown;
|
|
@@ -2843,8 +2792,7 @@ interface paths {
|
|
|
2843
2792
|
};
|
|
2844
2793
|
requestBody?: never;
|
|
2845
2794
|
responses: {
|
|
2846
|
-
/** @description Success */
|
|
2847
|
-
200: {
|
|
2795
|
+
/** @description Success */200: {
|
|
2848
2796
|
headers: {
|
|
2849
2797
|
[name: string]: unknown;
|
|
2850
2798
|
};
|
|
@@ -2888,8 +2836,7 @@ interface paths {
|
|
|
2888
2836
|
};
|
|
2889
2837
|
requestBody?: never;
|
|
2890
2838
|
responses: {
|
|
2891
|
-
/** @description Success */
|
|
2892
|
-
200: {
|
|
2839
|
+
/** @description Success */200: {
|
|
2893
2840
|
headers: {
|
|
2894
2841
|
[name: string]: unknown;
|
|
2895
2842
|
};
|
|
@@ -2933,8 +2880,7 @@ interface paths {
|
|
|
2933
2880
|
};
|
|
2934
2881
|
requestBody?: never;
|
|
2935
2882
|
responses: {
|
|
2936
|
-
/** @description Success */
|
|
2937
|
-
200: {
|
|
2883
|
+
/** @description Success */200: {
|
|
2938
2884
|
headers: {
|
|
2939
2885
|
[name: string]: unknown;
|
|
2940
2886
|
};
|
|
@@ -2989,16 +2935,14 @@ interface paths {
|
|
|
2989
2935
|
};
|
|
2990
2936
|
requestBody?: never;
|
|
2991
2937
|
responses: {
|
|
2992
|
-
/** @description Success */
|
|
2993
|
-
200: {
|
|
2938
|
+
/** @description Success */200: {
|
|
2994
2939
|
headers: {
|
|
2995
2940
|
[name: string]: unknown;
|
|
2996
2941
|
};
|
|
2997
2942
|
content: {
|
|
2998
2943
|
"application/json": components["schemas"]["PositionListResponse"];
|
|
2999
2944
|
};
|
|
3000
|
-
};
|
|
3001
|
-
/** @description Bad Request */
|
|
2945
|
+
}; /** @description Bad Request */
|
|
3002
2946
|
400: {
|
|
3003
2947
|
headers: {
|
|
3004
2948
|
[name: string]: unknown;
|
|
@@ -3052,16 +2996,14 @@ interface paths {
|
|
|
3052
2996
|
};
|
|
3053
2997
|
};
|
|
3054
2998
|
responses: {
|
|
3055
|
-
/** @description Success */
|
|
3056
|
-
200: {
|
|
2999
|
+
/** @description Success */200: {
|
|
3057
3000
|
headers: {
|
|
3058
3001
|
[name: string]: unknown;
|
|
3059
3002
|
};
|
|
3060
3003
|
content: {
|
|
3061
3004
|
"application/json": components["schemas"]["ValidationSuccessResponse"];
|
|
3062
3005
|
};
|
|
3063
|
-
};
|
|
3064
|
-
/** @description Bad Request */
|
|
3006
|
+
}; /** @description Bad Request */
|
|
3065
3007
|
400: {
|
|
3066
3008
|
headers: {
|
|
3067
3009
|
[name: string]: unknown;
|
|
@@ -3082,22 +3024,16 @@ interface paths {
|
|
|
3082
3024
|
interface components {
|
|
3083
3025
|
schemas: {
|
|
3084
3026
|
BookListResponse: {
|
|
3085
|
-
meta: components["schemas"]["Meta"];
|
|
3086
|
-
/** @
|
|
3087
|
-
cursor: string | null;
|
|
3088
|
-
/** @description Aggregated book levels grouped by computed price. */
|
|
3027
|
+
meta: components["schemas"]["Meta"]; /** @example eyJvZmZzZXQiOjEwMH0 */
|
|
3028
|
+
cursor: string | null; /** @description Aggregated book levels grouped by computed price. */
|
|
3089
3029
|
data: components["schemas"]["BookLevelResponse"][];
|
|
3090
3030
|
};
|
|
3091
3031
|
Meta: {
|
|
3092
|
-
/** @example 2024-01-01T12:00:00.000Z */
|
|
3093
|
-
timestamp: string;
|
|
3032
|
+
/** @example 2024-01-01T12:00:00.000Z */timestamp: string;
|
|
3094
3033
|
};
|
|
3095
3034
|
BookLevelResponse: {
|
|
3096
|
-
/** @example 2750000000000000000 */
|
|
3097
|
-
|
|
3098
|
-
/** @example 369216000000000000000000 */
|
|
3099
|
-
assets: string;
|
|
3100
|
-
/** @example 5 */
|
|
3035
|
+
/** @example 2750000000000000000 */price: string; /** @example 369216000000000000000000 */
|
|
3036
|
+
assets: string; /** @example 5 */
|
|
3101
3037
|
count: number;
|
|
3102
3038
|
};
|
|
3103
3039
|
BadRequestResponse: {
|
|
@@ -3109,8 +3045,7 @@ interface components {
|
|
|
3109
3045
|
* @example VALIDATION_ERROR
|
|
3110
3046
|
* @enum {string}
|
|
3111
3047
|
*/
|
|
3112
|
-
code: "VALIDATION_ERROR" | "NOT_FOUND" | "INTERNAL_SERVER_ERROR" | "BAD_REQUEST";
|
|
3113
|
-
/** @example Limit must be greater than 0. */
|
|
3048
|
+
code: "VALIDATION_ERROR" | "NOT_FOUND" | "INTERNAL_SERVER_ERROR" | "BAD_REQUEST"; /** @example Limit must be greater than 0. */
|
|
3114
3049
|
message: string;
|
|
3115
3050
|
/**
|
|
3116
3051
|
* @example [
|
|
@@ -3123,8 +3058,7 @@ interface components {
|
|
|
3123
3058
|
details: Record<string, never>;
|
|
3124
3059
|
};
|
|
3125
3060
|
ConfigSuccessResponse: {
|
|
3126
|
-
meta: components["schemas"]["Meta"];
|
|
3127
|
-
/** @example null */
|
|
3061
|
+
meta: components["schemas"]["Meta"]; /** @example null */
|
|
3128
3062
|
cursor: string | null;
|
|
3129
3063
|
/**
|
|
3130
3064
|
* @description Array of chain configurations for all indexed chains.
|
|
@@ -3134,47 +3068,31 @@ interface components {
|
|
|
3134
3068
|
* "contracts": {
|
|
3135
3069
|
* "mempool": "0xD946246695A9259F3B33a78629026F61B3Ab40aF"
|
|
3136
3070
|
* },
|
|
3137
|
-
* "
|
|
3138
|
-
* "
|
|
3139
|
-
*
|
|
3140
|
-
* }
|
|
3071
|
+
* "callbacks": [
|
|
3072
|
+
* "buy_with_empty_callback"
|
|
3073
|
+
* ]
|
|
3141
3074
|
* }
|
|
3142
3075
|
* ]
|
|
3143
3076
|
*/
|
|
3144
3077
|
data: components["schemas"]["ConfigDataResponse"][];
|
|
3145
3078
|
};
|
|
3146
3079
|
ConfigDataResponse: {
|
|
3147
|
-
/** @example 505050505 */
|
|
3148
|
-
chain_id: number;
|
|
3080
|
+
/** @example 505050505 */chain_id: number;
|
|
3149
3081
|
contracts: components["schemas"]["ConfigContractsResponse"];
|
|
3150
3082
|
/**
|
|
3151
|
-
* @description Supported
|
|
3152
|
-
* @example
|
|
3153
|
-
* "
|
|
3154
|
-
*
|
|
3155
|
-
*
|
|
3083
|
+
* @description Supported callback types for this chain.
|
|
3084
|
+
* @example [
|
|
3085
|
+
* "buy_with_empty_callback"
|
|
3086
|
+
* ]
|
|
3087
|
+
* @enum {string}
|
|
3156
3088
|
*/
|
|
3157
|
-
|
|
3089
|
+
callbacks: "buy_with_empty_callback" | "buy_erc20" | "buy_vault_v1_callback" | "sell_erc20_callback";
|
|
3158
3090
|
};
|
|
3159
3091
|
ConfigContractsResponse: {
|
|
3160
|
-
/** @example 0xD946246695A9259F3B33a78629026F61B3Ab40aF */
|
|
3161
|
-
mempool: string;
|
|
3162
|
-
};
|
|
3163
|
-
MaturitiesResponse: {
|
|
3164
|
-
/**
|
|
3165
|
-
* @description Unix timestamp for end of current month maturity (last Friday 15:00 UTC).
|
|
3166
|
-
* @example 1738335600
|
|
3167
|
-
*/
|
|
3168
|
-
end_of_month: number;
|
|
3169
|
-
/**
|
|
3170
|
-
* @description Unix timestamp for end of next month maturity (last Friday 15:00 UTC).
|
|
3171
|
-
* @example 1740754800
|
|
3172
|
-
*/
|
|
3173
|
-
end_of_next_month: number;
|
|
3092
|
+
/** @example 0xD946246695A9259F3B33a78629026F61B3Ab40aF */mempool: string;
|
|
3174
3093
|
};
|
|
3175
3094
|
OfferListResponse: {
|
|
3176
|
-
meta: components["schemas"]["Meta"];
|
|
3177
|
-
/** @example eyJvZmZzZXQiOjEwMH0 */
|
|
3095
|
+
meta: components["schemas"]["Meta"]; /** @example eyJvZmZzZXQiOjEwMH0 */
|
|
3178
3096
|
cursor: string | null;
|
|
3179
3097
|
/**
|
|
3180
3098
|
* @description Offers matching the provided filters.
|
|
@@ -3250,20 +3168,13 @@ interface components {
|
|
|
3250
3168
|
* "callback_data": "0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000034cf890db685fc536e05652fb41f02090c3fb751000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000108e644e3ab01184155270aa92a00000000000"
|
|
3251
3169
|
* }
|
|
3252
3170
|
*/
|
|
3253
|
-
offer: components["schemas"]["OfferDataResponse"];
|
|
3254
|
-
/** @example
|
|
3255
|
-
|
|
3256
|
-
/** @example
|
|
3257
|
-
|
|
3258
|
-
/** @example
|
|
3259
|
-
|
|
3260
|
-
/** @example 0 */
|
|
3261
|
-
consumed: string;
|
|
3262
|
-
/** @example 369216000000000000000000 */
|
|
3263
|
-
takeable: string;
|
|
3264
|
-
/** @example 2942933377146801 */
|
|
3265
|
-
block_number: number;
|
|
3266
|
-
/** @example 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef */
|
|
3171
|
+
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
3172
|
+
offer_hash: string; /** @example 0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc */
|
|
3173
|
+
obligation_id: string; /** @example 1 */
|
|
3174
|
+
chain_id: number; /** @example 0 */
|
|
3175
|
+
consumed: string; /** @example 369216000000000000000000 */
|
|
3176
|
+
takeable: string; /** @example 2942933377146801 */
|
|
3177
|
+
block_number: number; /** @example 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef */
|
|
3267
3178
|
root: string | null;
|
|
3268
3179
|
/**
|
|
3269
3180
|
* @example [
|
|
@@ -3271,8 +3182,7 @@ interface components {
|
|
|
3271
3182
|
* "0x9876543210fedcba9876543210fedcba9876543210fedcba9876543210fedcba"
|
|
3272
3183
|
* ]
|
|
3273
3184
|
*/
|
|
3274
|
-
proof: string[] | null;
|
|
3275
|
-
/** @example 0x1234567890123456789012345678901234567890123456789012345678901234123456789012345678901234567890123456789012345678901234567890123400 */
|
|
3185
|
+
proof: string[] | null; /** @example 0x1234567890123456789012345678901234567890123456789012345678901234123456789012345678901234567890123456789012345678901234567890123400 */
|
|
3276
3186
|
signature: string | null;
|
|
3277
3187
|
};
|
|
3278
3188
|
OfferDataResponse: {
|
|
@@ -3289,35 +3199,22 @@ interface components {
|
|
|
3289
3199
|
* "maturity": 1761922799
|
|
3290
3200
|
* }
|
|
3291
3201
|
*/
|
|
3292
|
-
obligation: components["schemas"]["ObligationOfferResponse"];
|
|
3293
|
-
/** @example
|
|
3294
|
-
|
|
3295
|
-
/** @example
|
|
3296
|
-
|
|
3297
|
-
/** @example
|
|
3298
|
-
|
|
3299
|
-
/** @example
|
|
3300
|
-
|
|
3301
|
-
/** @example
|
|
3302
|
-
|
|
3303
|
-
/** @example
|
|
3304
|
-
start: number;
|
|
3305
|
-
/** @example 1761922799 */
|
|
3306
|
-
expiry: number;
|
|
3307
|
-
/** @example 2750000000000000000 */
|
|
3308
|
-
price: string;
|
|
3309
|
-
/** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
3310
|
-
group: string;
|
|
3311
|
-
/** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
3312
|
-
session: string;
|
|
3313
|
-
/** @example 0x1111111111111111111111111111111111111111 */
|
|
3314
|
-
callback: string;
|
|
3315
|
-
/** @example 0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000034cf890db685fc536e05652fb41f02090c3fb751000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000108e644e3ab01184155270aa92a00000000000 */
|
|
3202
|
+
obligation: components["schemas"]["ObligationOfferResponse"]; /** @example false */
|
|
3203
|
+
buy: boolean; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3204
|
+
maker: string; /** @example 369216000000000000000000 */
|
|
3205
|
+
assets: string; /** @example 0 */
|
|
3206
|
+
obligation_units: string; /** @example 0 */
|
|
3207
|
+
obligation_shares: string; /** @example 1761922790 */
|
|
3208
|
+
start: number; /** @example 1761922799 */
|
|
3209
|
+
expiry: number; /** @example 2750000000000000000 */
|
|
3210
|
+
price: string; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
3211
|
+
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
3212
|
+
session: string; /** @example 0x1111111111111111111111111111111111111111 */
|
|
3213
|
+
callback: string; /** @example 0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000034cf890db685fc536e05652fb41f02090c3fb751000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000108e644e3ab01184155270aa92a00000000000 */
|
|
3316
3214
|
callback_data: string;
|
|
3317
3215
|
};
|
|
3318
3216
|
ObligationOfferResponse: {
|
|
3319
|
-
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
3320
|
-
loan_token: string;
|
|
3217
|
+
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */loan_token: string;
|
|
3321
3218
|
/**
|
|
3322
3219
|
* @example [
|
|
3323
3220
|
* {
|
|
@@ -3327,51 +3224,37 @@ interface components {
|
|
|
3327
3224
|
* }
|
|
3328
3225
|
* ]
|
|
3329
3226
|
*/
|
|
3330
|
-
collaterals: components["schemas"]["CollateralResponse"][];
|
|
3331
|
-
/** @example 1761922799 */
|
|
3227
|
+
collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922799 */
|
|
3332
3228
|
maturity: number;
|
|
3333
3229
|
};
|
|
3334
3230
|
CollateralResponse: {
|
|
3335
|
-
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */
|
|
3336
|
-
|
|
3337
|
-
/** @example 860000000000000000 */
|
|
3338
|
-
lltv: string;
|
|
3339
|
-
/** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3231
|
+
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */token: string; /** @example 860000000000000000 */
|
|
3232
|
+
lltv: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3340
3233
|
oracle: string;
|
|
3341
3234
|
};
|
|
3342
3235
|
ObligationListResponse: {
|
|
3343
|
-
meta: components["schemas"]["Meta"];
|
|
3344
|
-
/** @
|
|
3345
|
-
cursor: string | null;
|
|
3346
|
-
/** @description List of obligations with takable offers. */
|
|
3236
|
+
meta: components["schemas"]["Meta"]; /** @example 0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc */
|
|
3237
|
+
cursor: string | null; /** @description List of obligations with takable offers. */
|
|
3347
3238
|
data: components["schemas"]["ObligationResponse"][];
|
|
3348
3239
|
};
|
|
3349
3240
|
ObligationResponse: {
|
|
3350
|
-
/** @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67 */
|
|
3351
|
-
|
|
3352
|
-
/** @example 1 */
|
|
3353
|
-
chain_id: number;
|
|
3354
|
-
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
3241
|
+
/** @example 0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67 */id: string; /** @example 1 */
|
|
3242
|
+
chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
3355
3243
|
loan_token: string;
|
|
3356
|
-
collaterals: components["schemas"]["CollateralResponse"][];
|
|
3357
|
-
/** @example 1761922800 */
|
|
3244
|
+
collaterals: components["schemas"]["CollateralResponse"][]; /** @example 1761922800 */
|
|
3358
3245
|
maturity: number;
|
|
3359
3246
|
ask: components["schemas"]["AskResponse"];
|
|
3360
3247
|
bid: components["schemas"]["BidResponse"];
|
|
3361
3248
|
};
|
|
3362
3249
|
AskResponse: {
|
|
3363
|
-
/** @example 1000000000000000000 */
|
|
3364
|
-
price: string;
|
|
3250
|
+
/** @example 1000000000000000000 */price: string;
|
|
3365
3251
|
};
|
|
3366
3252
|
BidResponse: {
|
|
3367
|
-
/** @example 1000000000000000000 */
|
|
3368
|
-
price: string;
|
|
3253
|
+
/** @example 1000000000000000000 */price: string;
|
|
3369
3254
|
};
|
|
3370
3255
|
ObligationSingleSuccessResponse: {
|
|
3371
|
-
meta: components["schemas"]["Meta"];
|
|
3372
|
-
/** @
|
|
3373
|
-
cursor: string | null;
|
|
3374
|
-
/** @description Obligation details. */
|
|
3256
|
+
meta: components["schemas"]["Meta"]; /** @example null */
|
|
3257
|
+
cursor: string | null; /** @description Obligation details. */
|
|
3375
3258
|
data: components["schemas"]["ObligationResponse"];
|
|
3376
3259
|
};
|
|
3377
3260
|
RouterStatusSuccessResponse: {
|
|
@@ -3392,8 +3275,7 @@ interface components {
|
|
|
3392
3275
|
* @example live
|
|
3393
3276
|
* @enum {string}
|
|
3394
3277
|
*/
|
|
3395
|
-
status: "live" | "syncing";
|
|
3396
|
-
/** @example true */
|
|
3278
|
+
status: "live" | "syncing"; /** @example true */
|
|
3397
3279
|
initialized: boolean;
|
|
3398
3280
|
/**
|
|
3399
3281
|
* @description Configured chain ids missing initialization rows.
|
|
@@ -3407,9 +3289,7 @@ interface components {
|
|
|
3407
3289
|
missing_collectors: components["schemas"]["MissingCollectorResponse"][];
|
|
3408
3290
|
};
|
|
3409
3291
|
MissingCollectorResponse: {
|
|
3410
|
-
/** @example 1 */
|
|
3411
|
-
chain_id: number;
|
|
3412
|
-
/** @example offers */
|
|
3292
|
+
/** @example 1 */chain_id: number; /** @example offers */
|
|
3413
3293
|
name: string;
|
|
3414
3294
|
};
|
|
3415
3295
|
CollectorsHealthSuccessResponse: {
|
|
@@ -3431,22 +3311,16 @@ interface components {
|
|
|
3431
3311
|
data: components["schemas"]["CollectorHealthResponse"][];
|
|
3432
3312
|
};
|
|
3433
3313
|
CollectorHealthResponse: {
|
|
3434
|
-
/** @example offers */
|
|
3435
|
-
|
|
3436
|
-
/** @example
|
|
3437
|
-
|
|
3438
|
-
/** @example 21345678 */
|
|
3439
|
-
block_number: number | null;
|
|
3440
|
-
/** @example 2024-01-01T12:00:00.000Z */
|
|
3441
|
-
updated_at: string | null;
|
|
3442
|
-
/** @example 0 */
|
|
3314
|
+
/** @example offers */name: string; /** @example 1 */
|
|
3315
|
+
chain_id: number; /** @example 21345678 */
|
|
3316
|
+
block_number: number | null; /** @example 2024-01-01T12:00:00.000Z */
|
|
3317
|
+
updated_at: string | null; /** @example 0 */
|
|
3443
3318
|
lag: number | null;
|
|
3444
3319
|
/**
|
|
3445
3320
|
* @example live
|
|
3446
3321
|
* @enum {string}
|
|
3447
3322
|
*/
|
|
3448
|
-
status: "live" | "lagging" | "unknown";
|
|
3449
|
-
/** @example true */
|
|
3323
|
+
status: "live" | "lagging" | "unknown"; /** @example true */
|
|
3450
3324
|
initialized: boolean;
|
|
3451
3325
|
};
|
|
3452
3326
|
ChainsHealthSuccessResponse: {
|
|
@@ -3466,20 +3340,14 @@ interface components {
|
|
|
3466
3340
|
data: components["schemas"]["ChainHealthResponse"][];
|
|
3467
3341
|
};
|
|
3468
3342
|
ChainHealthResponse: {
|
|
3469
|
-
/** @example 1 */
|
|
3470
|
-
|
|
3471
|
-
/** @example
|
|
3472
|
-
|
|
3473
|
-
/** @example 21345690 */
|
|
3474
|
-
remote_block_number: number | null;
|
|
3475
|
-
/** @example 2024-01-01T12:00:00.000Z */
|
|
3476
|
-
updated_at: string | null;
|
|
3477
|
-
/** @example true */
|
|
3343
|
+
/** @example 1 */chain_id: number; /** @example 21345678 */
|
|
3344
|
+
local_block_number: number | null; /** @example 21345690 */
|
|
3345
|
+
remote_block_number: number | null; /** @example 2024-01-01T12:00:00.000Z */
|
|
3346
|
+
updated_at: string | null; /** @example true */
|
|
3478
3347
|
initialized: boolean;
|
|
3479
3348
|
};
|
|
3480
3349
|
PositionListResponse: {
|
|
3481
|
-
meta: components["schemas"]["Meta"];
|
|
3482
|
-
/** @example eyJvZmZzZXQiOjEwMH0 */
|
|
3350
|
+
meta: components["schemas"]["Meta"]; /** @example eyJvZmZzZXQiOjEwMH0 */
|
|
3483
3351
|
cursor: string | null;
|
|
3484
3352
|
/**
|
|
3485
3353
|
* @description User positions with reserved balances from active offers.
|
|
@@ -3496,47 +3364,28 @@ interface components {
|
|
|
3496
3364
|
data: components["schemas"]["PositionListItemResponse"][];
|
|
3497
3365
|
};
|
|
3498
3366
|
PositionListItemResponse: {
|
|
3499
|
-
/** @example 1 */
|
|
3500
|
-
|
|
3501
|
-
/** @example
|
|
3502
|
-
|
|
3503
|
-
/** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3504
|
-
user: string;
|
|
3505
|
-
/** @example 200000000000000000000 */
|
|
3506
|
-
reserved: string;
|
|
3507
|
-
/** @example 21345678 */
|
|
3367
|
+
/** @example 1 */chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
3368
|
+
contract: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3369
|
+
user: string; /** @example 200000000000000000000 */
|
|
3370
|
+
reserved: string; /** @example 21345678 */
|
|
3508
3371
|
block_number: number;
|
|
3509
3372
|
};
|
|
3510
3373
|
ValidateOffersRequest: {
|
|
3511
|
-
/** @description Array of offers in snake_case format. Required, non-empty. */
|
|
3512
|
-
offers: components["schemas"]["ValidateOfferRequest"][];
|
|
3374
|
+
/** @description Array of offers in snake_case format. Required, non-empty. */offers: components["schemas"]["ValidateOfferRequest"][];
|
|
3513
3375
|
};
|
|
3514
3376
|
ValidateOfferRequest: {
|
|
3515
|
-
/** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3516
|
-
|
|
3517
|
-
/** @example
|
|
3518
|
-
|
|
3519
|
-
/** @example
|
|
3520
|
-
|
|
3521
|
-
/** @example
|
|
3522
|
-
|
|
3523
|
-
/** @example
|
|
3524
|
-
|
|
3525
|
-
/** @example
|
|
3526
|
-
|
|
3527
|
-
/** @example 1761922799 */
|
|
3528
|
-
expiry: number;
|
|
3529
|
-
/** @example 1761922790 */
|
|
3530
|
-
start: number;
|
|
3531
|
-
/** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
3532
|
-
group: string;
|
|
3533
|
-
/** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
3534
|
-
session: string;
|
|
3535
|
-
/** @example false */
|
|
3536
|
-
buy: boolean;
|
|
3537
|
-
/** @example 1 */
|
|
3538
|
-
chain_id: number;
|
|
3539
|
-
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
3377
|
+
/** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
|
|
3378
|
+
assets: string; /** @example 0 */
|
|
3379
|
+
obligation_units?: string; /** @example 0 */
|
|
3380
|
+
obligation_shares?: string; /** @example 2750000000000000000 */
|
|
3381
|
+
price: string; /** @example 1761922799 */
|
|
3382
|
+
maturity: number; /** @example 1761922799 */
|
|
3383
|
+
expiry: number; /** @example 1761922790 */
|
|
3384
|
+
start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
3385
|
+
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
3386
|
+
session: string; /** @example false */
|
|
3387
|
+
buy: boolean; /** @example 1 */
|
|
3388
|
+
chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
3540
3389
|
loan_token: string;
|
|
3541
3390
|
/**
|
|
3542
3391
|
* @example [
|
|
@@ -3557,24 +3406,17 @@ interface components {
|
|
|
3557
3406
|
callback: components["schemas"]["ValidateCallbackRequest"];
|
|
3558
3407
|
};
|
|
3559
3408
|
ValidateCollateralRequest: {
|
|
3560
|
-
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */
|
|
3561
|
-
|
|
3562
|
-
/** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3563
|
-
oracle: string;
|
|
3564
|
-
/** @example 860000000000000000 */
|
|
3409
|
+
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */asset: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
3410
|
+
oracle: string; /** @example 860000000000000000 */
|
|
3565
3411
|
lltv: string;
|
|
3566
3412
|
};
|
|
3567
3413
|
ValidateCallbackRequest: {
|
|
3568
|
-
/** @example 0x1111111111111111111111111111111111111111 */
|
|
3569
|
-
address: string;
|
|
3570
|
-
/** @example 0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000034cf890db685fc536e05652fb41f02090c3fb751000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000108e644e3ab01184155270aa92a00000000000 */
|
|
3414
|
+
/** @example 0x1111111111111111111111111111111111111111 */address: string; /** @example 0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000034cf890db685fc536e05652fb41f02090c3fb751000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000108e644e3ab01184155270aa92a00000000000 */
|
|
3571
3415
|
data: string;
|
|
3572
3416
|
};
|
|
3573
3417
|
ValidationSuccessResponse: {
|
|
3574
|
-
meta: components["schemas"]["Meta"];
|
|
3575
|
-
/** @
|
|
3576
|
-
cursor: string | null;
|
|
3577
|
-
/** @description Payload and root for client-side signing. */
|
|
3418
|
+
meta: components["schemas"]["Meta"]; /** @example null */
|
|
3419
|
+
cursor: string | null; /** @description Payload and root for client-side signing. */
|
|
3578
3420
|
data: components["schemas"]["ValidationSuccessDataResponse"];
|
|
3579
3421
|
};
|
|
3580
3422
|
ValidationSuccessDataResponse: {
|
|
@@ -3675,10 +3517,6 @@ declare class ObligationsController {
|
|
|
3675
3517
|
declare class UsersController {
|
|
3676
3518
|
getUserPositions(): Promise<void>;
|
|
3677
3519
|
}
|
|
3678
|
-
type RuleInfo = {
|
|
3679
|
-
name: string;
|
|
3680
|
-
description: string;
|
|
3681
|
-
};
|
|
3682
3520
|
type OpenApiOptions = {
|
|
3683
3521
|
rules?: RuleInfo[];
|
|
3684
3522
|
};
|
|
@@ -3707,25 +3545,25 @@ declare const schemas: {
|
|
|
3707
3545
|
strict: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodEnum<{
|
|
3708
3546
|
0: "0";
|
|
3709
3547
|
1: "1";
|
|
3710
|
-
false: "false";
|
|
3711
3548
|
true: "true";
|
|
3712
|
-
|
|
3549
|
+
false: "false";
|
|
3550
|
+
}>, z$1.ZodTransform<boolean, "0" | "1" | "true" | "false">>>;
|
|
3713
3551
|
}, z$1.core.$strip>;
|
|
3714
3552
|
readonly get_health_collectors: z$1.ZodObject<{
|
|
3715
3553
|
strict: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodEnum<{
|
|
3716
3554
|
0: "0";
|
|
3717
3555
|
1: "1";
|
|
3718
|
-
false: "false";
|
|
3719
3556
|
true: "true";
|
|
3720
|
-
|
|
3557
|
+
false: "false";
|
|
3558
|
+
}>, z$1.ZodTransform<boolean, "0" | "1" | "true" | "false">>>;
|
|
3721
3559
|
}, z$1.core.$strip>;
|
|
3722
3560
|
readonly get_health_chains: z$1.ZodObject<{
|
|
3723
3561
|
strict: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodEnum<{
|
|
3724
3562
|
0: "0";
|
|
3725
3563
|
1: "1";
|
|
3726
|
-
false: "false";
|
|
3727
3564
|
true: "true";
|
|
3728
|
-
|
|
3565
|
+
false: "false";
|
|
3566
|
+
}>, z$1.ZodTransform<boolean, "0" | "1" | "true" | "false">>>;
|
|
3729
3567
|
}, z$1.core.$strip>;
|
|
3730
3568
|
readonly get_offers: z$1.ZodObject<{
|
|
3731
3569
|
side: z$1.ZodOptional<z$1.ZodEnum<{
|
|
@@ -3739,10 +3577,10 @@ declare const schemas: {
|
|
|
3739
3577
|
}, z$1.core.$strip>;
|
|
3740
3578
|
readonly get_obligations: z$1.ZodObject<{
|
|
3741
3579
|
cursor: z$1.ZodOptional<z$1.ZodString>;
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3580
|
+
chains: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>>>>;
|
|
3581
|
+
loan_tokens: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>>>>;
|
|
3582
|
+
collateral_tokens: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>>>>;
|
|
3583
|
+
maturities: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>>>>;
|
|
3746
3584
|
limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodPipe<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>, z$1.ZodNumber>>>;
|
|
3747
3585
|
}, z$1.core.$strip>;
|
|
3748
3586
|
readonly get_obligation: z$1.ZodObject<{
|
|
@@ -3777,7 +3615,7 @@ declare enum STATUS_CODE {
|
|
|
3777
3615
|
SUCCESS = 200,
|
|
3778
3616
|
BAD_REQUEST = 400,
|
|
3779
3617
|
NOT_FOUND = 404,
|
|
3780
|
-
INTERNAL_SERVER_ERROR = 500
|
|
3618
|
+
INTERNAL_SERVER_ERROR = 500
|
|
3781
3619
|
}
|
|
3782
3620
|
type Meta = {
|
|
3783
3621
|
timestamp: string;
|
|
@@ -3787,7 +3625,7 @@ type ErrorDetail = {
|
|
|
3787
3625
|
message: string;
|
|
3788
3626
|
details?: unknown;
|
|
3789
3627
|
};
|
|
3790
|
-
type SuccessPayload<T> = Compute<{
|
|
3628
|
+
type SuccessPayload$1<T> = Compute<{
|
|
3791
3629
|
statusCode: STATUS_CODE.SUCCESS;
|
|
3792
3630
|
body: {
|
|
3793
3631
|
cursor: string | null;
|
|
@@ -3795,29 +3633,25 @@ type SuccessPayload<T> = Compute<{
|
|
|
3795
3633
|
meta: Meta;
|
|
3796
3634
|
};
|
|
3797
3635
|
}>;
|
|
3798
|
-
type ErrorPayload<statusCode extends Exclude<STATUS_CODE, STATUS_CODE.SUCCESS> = Exclude<STATUS_CODE, STATUS_CODE.SUCCESS>> = Compute<{
|
|
3636
|
+
type ErrorPayload$1<statusCode extends Exclude<STATUS_CODE, STATUS_CODE.SUCCESS> = Exclude<STATUS_CODE, STATUS_CODE.SUCCESS>> = Compute<{
|
|
3799
3637
|
statusCode: statusCode;
|
|
3800
3638
|
body: {
|
|
3801
3639
|
meta: Meta;
|
|
3802
3640
|
error: ErrorDetail;
|
|
3803
3641
|
};
|
|
3804
3642
|
}>;
|
|
3805
|
-
type Payload<T> = SuccessPayload<T> | ErrorPayload;
|
|
3643
|
+
type Payload<T> = SuccessPayload$1<T> | ErrorPayload$1;
|
|
3806
3644
|
//#endregion
|
|
3807
3645
|
//#region src/api/Controllers/getBook.d.ts
|
|
3808
3646
|
declare function getBook(params: object, db: Database): Promise<Payload<BookLevelResponse[]>>;
|
|
3809
3647
|
//#endregion
|
|
3810
3648
|
//#region src/api/Controllers/getConfig.d.ts
|
|
3811
|
-
type MaturitiesConfig = {
|
|
3812
|
-
end_of_month: number;
|
|
3813
|
-
end_of_next_month: number;
|
|
3814
|
-
};
|
|
3815
3649
|
type ChainConfig = {
|
|
3816
3650
|
chain_id: Id;
|
|
3817
3651
|
contracts: {
|
|
3818
3652
|
mempool: string;
|
|
3819
3653
|
};
|
|
3820
|
-
|
|
3654
|
+
callbacks: string[];
|
|
3821
3655
|
};
|
|
3822
3656
|
/**
|
|
3823
3657
|
* Returns the configuration for all chains the router is indexing.
|
|
@@ -3827,15 +3661,25 @@ type ChainConfig = {
|
|
|
3827
3661
|
declare function getConfig(chainRegistry: ChainRegistry): Promise<Payload<ChainConfig[]>>;
|
|
3828
3662
|
//#endregion
|
|
3829
3663
|
//#region src/api/Controllers/getDocs.d.ts
|
|
3664
|
+
/**
|
|
3665
|
+
* Build the OpenAPI document for the router.
|
|
3666
|
+
* @param parameters - Includes a {@link RulesProvider} to fetch gatekeeper rules.
|
|
3667
|
+
* @returns OpenAPI document. {@link OpenAPIDocument}
|
|
3668
|
+
*/
|
|
3830
3669
|
declare function getSwaggerJson({
|
|
3831
3670
|
gatekeeper
|
|
3832
3671
|
}: {
|
|
3833
|
-
gatekeeper:
|
|
3672
|
+
gatekeeper: RulesProvider;
|
|
3834
3673
|
}): Promise<OpenAPIDocument>;
|
|
3674
|
+
/**
|
|
3675
|
+
* Render the API documentation HTML page.
|
|
3676
|
+
* @param parameters - Includes a {@link RulesProvider} to fetch gatekeeper rules.
|
|
3677
|
+
* @returns HTML page as string.
|
|
3678
|
+
*/
|
|
3835
3679
|
declare function getDocsHtml({
|
|
3836
3680
|
gatekeeper
|
|
3837
3681
|
}: {
|
|
3838
|
-
gatekeeper:
|
|
3682
|
+
gatekeeper: RulesProvider;
|
|
3839
3683
|
}): Promise<string>;
|
|
3840
3684
|
/**
|
|
3841
3685
|
* Renders the integrator documentation as HTML.
|
|
@@ -3865,35 +3709,50 @@ declare function getOffers$1(queryParameters: object, db: Database): Promise<Pay
|
|
|
3865
3709
|
* @returns Paginated list of positions with remaining balances.
|
|
3866
3710
|
*/
|
|
3867
3711
|
declare function getUserPositions(queryParameters: object, db: Database): Promise<Payload<PositionResponse[]>>;
|
|
3712
|
+
declare namespace Gatekeeper_d_exports {
|
|
3713
|
+
export { Gatekeeper, Rules, create };
|
|
3714
|
+
}
|
|
3715
|
+
type Rules = readonly Rule<Offer, string>[];
|
|
3716
|
+
type Gatekeeper = {
|
|
3717
|
+
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>;
|
|
3718
|
+
getRules: () => Promise<RuleInfo[]>;
|
|
3719
|
+
};
|
|
3720
|
+
type GatekeeperParameters = {
|
|
3721
|
+
rules: Rules;
|
|
3722
|
+
};
|
|
3723
|
+
/**
|
|
3724
|
+
* Create a gatekeeper instance with the provided rules.
|
|
3725
|
+
* @param parameters - Gatekeeper parameters. {@link GatekeeperParameters}
|
|
3726
|
+
* @returns Gatekeeper instance. {@link Gatekeeper}
|
|
3727
|
+
*/
|
|
3728
|
+
declare function create(parameters: GatekeeperParameters): Gatekeeper;
|
|
3868
3729
|
//#endregion
|
|
3869
3730
|
//#region src/api/Controllers/validateOffers.d.ts
|
|
3870
|
-
type ValidationIssue = {
|
|
3731
|
+
type ValidationIssue$1 = {
|
|
3871
3732
|
index: number;
|
|
3872
3733
|
rule: string;
|
|
3873
3734
|
message: string;
|
|
3874
3735
|
};
|
|
3875
|
-
type ValidateOffersSuccessPayload = SuccessPayload<{
|
|
3736
|
+
type ValidateOffersSuccessPayload = SuccessPayload$1<{
|
|
3876
3737
|
payload: Hex;
|
|
3877
3738
|
root: Hex;
|
|
3878
3739
|
}>;
|
|
3879
|
-
type ValidateOffersIssuesPayload = SuccessPayload<{
|
|
3880
|
-
issues: ValidationIssue[];
|
|
3740
|
+
type ValidateOffersIssuesPayload = SuccessPayload$1<{
|
|
3741
|
+
issues: ValidationIssue$1[];
|
|
3881
3742
|
}>;
|
|
3882
3743
|
type ValidateOffersResponse = ValidateOffersSuccessPayload | ValidateOffersIssuesPayload;
|
|
3883
|
-
declare function validateOffers(body: object, gatekeeper: Gatekeeper): Promise<ValidateOffersResponse | ErrorPayload>;
|
|
3744
|
+
declare function validateOffers(body: object, gatekeeper: Gatekeeper): Promise<ValidateOffersResponse | ErrorPayload$1>;
|
|
3884
3745
|
declare namespace index_d_exports$4 {
|
|
3885
|
-
export { ChainConfig,
|
|
3746
|
+
export { ChainConfig, ValidationIssue$1 as ValidationIssue, getBook, getConfig, getDocsHtml, getHealth, getHealthChains, getHealthCollectors, getIntegratorDocsHtml, getObligation, getObligations$1 as getObligations, getOffers$1 as getOffers, getSwaggerJson, getUserPositions, validateOffers };
|
|
3886
3747
|
}
|
|
3887
3748
|
declare namespace RouterApi_d_exports {
|
|
3888
|
-
export { ApiConfig, BookResponse_d_exports as BookResponse, BooksController, ChainHealth, ChainsHealthResponse, CollectorHealth, CollectorsHealthResponse, ConfigController, index_d_exports$4 as Controllers, HealthController, ObligationResponse_d_exports as ObligationResponse, ObligationsController, OfferResponse_d_exports as OfferResponse, OffersController, OpenApi, OpenApiOptions, PositionResponse_d_exports as PositionResponse, RouterApi, RouterStatusResponse,
|
|
3749
|
+
export { ApiConfig, BookResponse_d_exports as BookResponse, BooksController, ChainHealth, ChainsHealthResponse, CollectorHealth, CollectorsHealthResponse, ConfigController, index_d_exports$4 as Controllers, HealthController, ObligationResponse_d_exports as ObligationResponse, ObligationsController, OfferResponse_d_exports as OfferResponse, OffersController, OpenApi, OpenApiOptions, PositionResponse_d_exports as PositionResponse, RouterApi, RouterStatusResponse, UsersController, ValidateController, create$1 as create, from$5 as from, parse, safeParse };
|
|
3889
3750
|
}
|
|
3890
|
-
declare namespace Client_d_exports {
|
|
3751
|
+
declare namespace Client_d_exports$1 {
|
|
3891
3752
|
export { Client$3 as Client, ConnectOptions, HttpForbiddenError, HttpGetApiFailedError, HttpRateLimitError, HttpUnauthorizedError, InvalidUrlError, connect$1 as connect, getObligations, getOffers };
|
|
3892
3753
|
}
|
|
3893
3754
|
type RouterClientConfig = {
|
|
3894
|
-
/** The URL of the router. */
|
|
3895
|
-
readonly url: URL;
|
|
3896
|
-
/** The default headers to use for each request. */
|
|
3755
|
+
/** The URL of the router. */readonly url: URL; /** The default headers to use for each request. */
|
|
3897
3756
|
readonly headers: Headers;
|
|
3898
3757
|
};
|
|
3899
3758
|
type Client$3 = Compute<RouterClientConfig & {
|
|
@@ -3930,10 +3789,8 @@ type ConnectOptions = {
|
|
|
3930
3789
|
/** The URL of the router to interact with.
|
|
3931
3790
|
* @default "https://router.morpho.dev"
|
|
3932
3791
|
*/
|
|
3933
|
-
url?: string;
|
|
3934
|
-
/** The
|
|
3935
|
-
apiKey?: string;
|
|
3936
|
-
/** The default headers to use for each request. */
|
|
3792
|
+
url?: string; /** The API key to use for the router API. */
|
|
3793
|
+
apiKey?: string; /** The default headers to use for each request. */
|
|
3937
3794
|
headers?: Headers;
|
|
3938
3795
|
};
|
|
3939
3796
|
/**
|
|
@@ -3956,13 +3813,9 @@ declare namespace connect$1 {
|
|
|
3956
3813
|
declare function getOffers(apiClient: Client$1<paths>, parameters: getOffers.Parameters): Promise<getOffers.ReturnType>;
|
|
3957
3814
|
declare namespace getOffers {
|
|
3958
3815
|
type Parameters = {
|
|
3959
|
-
/** The desired side of the match: 'buy' if you want to buy, 'sell' if you want to sell */
|
|
3960
|
-
|
|
3961
|
-
/**
|
|
3962
|
-
obligationId: Hex;
|
|
3963
|
-
/** Pagination cursor in base64url-encoded format */
|
|
3964
|
-
cursor?: string;
|
|
3965
|
-
/** Maximum number of offers to return. @default 20 */
|
|
3816
|
+
/** The desired side of the match: 'buy' if you want to buy, 'sell' if you want to sell */side: "buy" | "sell"; /** The offers obligation id */
|
|
3817
|
+
obligationId: Hex; /** Pagination cursor in base64url-encoded format */
|
|
3818
|
+
cursor?: string; /** Maximum number of offers to return. @default 20 */
|
|
3966
3819
|
limit?: number;
|
|
3967
3820
|
};
|
|
3968
3821
|
type ReturnType = {
|
|
@@ -3972,14 +3825,10 @@ declare namespace getOffers {
|
|
|
3972
3825
|
consumed: bigint;
|
|
3973
3826
|
takeable: bigint;
|
|
3974
3827
|
} & {
|
|
3975
|
-
/** 32-byte merkle root. */
|
|
3976
|
-
|
|
3977
|
-
/** Sibling hashes for the merkle proof. */
|
|
3978
|
-
proof?: Hex[];
|
|
3979
|
-
/** Offer signature from the Merkle tree. */
|
|
3828
|
+
/** 32-byte merkle root. */root?: Hex; /** Sibling hashes for the merkle proof. */
|
|
3829
|
+
proof?: Hex[]; /** Offer signature from the Merkle tree. */
|
|
3980
3830
|
signature?: Hex;
|
|
3981
|
-
}>[];
|
|
3982
|
-
/** The pagination cursor. */
|
|
3831
|
+
}>[]; /** The pagination cursor. */
|
|
3983
3832
|
cursor: string | null;
|
|
3984
3833
|
};
|
|
3985
3834
|
type ErrorType = GetApiErrorType;
|
|
@@ -3987,25 +3836,17 @@ declare namespace getOffers {
|
|
|
3987
3836
|
declare function getObligations(apiClient: Client$1<paths>, parameters?: getObligations.Parameters): Promise<getObligations.ReturnType>;
|
|
3988
3837
|
declare namespace getObligations {
|
|
3989
3838
|
type Parameters = {
|
|
3990
|
-
/** Pagination cursor is a 32-byte hex string. */
|
|
3991
|
-
|
|
3992
|
-
/**
|
|
3993
|
-
|
|
3994
|
-
/** Filter by
|
|
3995
|
-
|
|
3996
|
-
/** Filter by loan token address. */
|
|
3997
|
-
loanToken?: Address;
|
|
3998
|
-
/** Filter by collateral token (matches any collateral in the obligation). */
|
|
3999
|
-
collateralToken?: Address;
|
|
4000
|
-
/** Filter by exact maturity timestamp (unix seconds). */
|
|
4001
|
-
maturity?: number;
|
|
3839
|
+
/** Pagination cursor is a 32-byte hex string. */cursor?: Hex; /** Maximum number of obligations to return. @default 20 */
|
|
3840
|
+
limit?: number; /** Filter by chain IDs (comma-separated). */
|
|
3841
|
+
chainIds?: number[]; /** Filter by loan token addresses (comma-separated). */
|
|
3842
|
+
loanTokens?: Address[]; /** Filter by collateral tokens (comma-separated, matches any collateral). */
|
|
3843
|
+
collateralTokens?: Address[]; /** Filter by exact maturity timestamps (comma-separated, unix seconds). */
|
|
3844
|
+
maturities?: number[];
|
|
4002
3845
|
};
|
|
4003
3846
|
type ReturnType = {
|
|
4004
3847
|
obligations: Compute<{
|
|
4005
|
-
/** The obligation id. Uses {@link Obligation.id} to calculate the id.*/
|
|
4006
|
-
|
|
4007
|
-
} & Obligation & Omit<Quote, "obligationId">>[];
|
|
4008
|
-
/** The pagination cursor. */
|
|
3848
|
+
/** The obligation id. Uses {@link Obligation.id} to calculate the id.*/id: () => Hex;
|
|
3849
|
+
} & Obligation & Omit<Quote, "obligationId">>[]; /** The pagination cursor. */
|
|
4009
3850
|
cursor: string | null;
|
|
4010
3851
|
};
|
|
4011
3852
|
type ErrorType = GetApiErrorType;
|
|
@@ -4057,7 +3898,7 @@ declare enum EnumTableName {
|
|
|
4057
3898
|
LOTS = "lots",
|
|
4058
3899
|
OFFSETS = "offsets",
|
|
4059
3900
|
TREES = "trees",
|
|
4060
|
-
MERKLE_PATHS = "merkle_paths"
|
|
3901
|
+
MERKLE_PATHS = "merkle_paths"
|
|
4061
3902
|
}
|
|
4062
3903
|
declare const TABLE_NAMES: readonly EnumTableName[];
|
|
4063
3904
|
declare const VERSIONED_TABLE_NAMES: ("\"router_v1.6\".\"obligations\"" | "\"router_v1.6\".\"groups\"" | "\"router_v1.6\".\"consumed_events\"" | "\"router_v1.6\".\"obligation_collaterals_v2\"" | "\"router_v1.6\".\"oracles\"" | "\"router_v1.6\".\"offers\"" | "\"router_v1.6\".\"offers_callbacks\"" | "\"router_v1.6\".\"callbacks\"" | "\"router_v1.6\".\"positions\"" | "\"router_v1.6\".\"transfers\"" | "\"router_v1.6\".\"validations\"" | "\"router_v1.6\".\"collectors\"" | "\"router_v1.6\".\"chains\"" | "\"router_v1.6\".\"lots\"" | "\"router_v1.6\".\"offsets\"" | "\"router_v1.6\".\"trees\"" | "\"router_v1.6\".\"merkle_paths\"")[];
|
|
@@ -5856,7 +5697,7 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5856
5697
|
};
|
|
5857
5698
|
dialect: "pg";
|
|
5858
5699
|
}>;
|
|
5859
|
-
declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5700
|
+
declare const chains$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5860
5701
|
name: EnumTableName.CHAINS;
|
|
5861
5702
|
schema: "router_v1.6";
|
|
5862
5703
|
columns: {
|
|
@@ -6075,8 +5916,115 @@ declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6075
5916
|
dialect: "pg";
|
|
6076
5917
|
}>;
|
|
6077
5918
|
declare namespace index_d_exports$2 {
|
|
6078
|
-
export { PositionTypes, StatusCode, TABLE_NAMES, TableName, VERSION, VERSIONED_TABLE_NAMES, VersionedTableName, callbacks$1 as callbacks, chains, collectors, consumedEvents, groups, lots, merklePaths, obligationCollateralsV2, obligations, offers, offersCallbacks, offsets, oracles, positionTypes, positions, status, transfers, trees, validations };
|
|
5919
|
+
export { PositionTypes, StatusCode, TABLE_NAMES, TableName, VERSION, VERSIONED_TABLE_NAMES, VersionedTableName, callbacks$1 as callbacks, chains$1 as chains, collectors, consumedEvents, groups, lots, merklePaths, obligationCollateralsV2, obligations, offers, offersCallbacks, offsets, oracles, positionTypes, positions, status, transfers, trees, validations };
|
|
6079
5920
|
}
|
|
5921
|
+
declare namespace GateConfig_d_exports {
|
|
5922
|
+
export { CallbackConfig, GateConfig, assets, configs, getCallback, getCallbackAddresses, getCallbackType, getCallbackTypeAddresses };
|
|
5923
|
+
}
|
|
5924
|
+
type GateConfig = {
|
|
5925
|
+
callbacks?: CallbackConfig[];
|
|
5926
|
+
maturities?: MaturityType[];
|
|
5927
|
+
};
|
|
5928
|
+
type CallbackConfig = {
|
|
5929
|
+
type: Type$1.BuyVaultV1Callback;
|
|
5930
|
+
addresses: Address[];
|
|
5931
|
+
vaultFactories: Address[];
|
|
5932
|
+
} | {
|
|
5933
|
+
type: Type$1.SellERC20Callback;
|
|
5934
|
+
addresses: Address[];
|
|
5935
|
+
} | {
|
|
5936
|
+
type: Type$1.BuyWithEmptyCallback;
|
|
5937
|
+
};
|
|
5938
|
+
declare function getCallback(chain: Name$1, type: Type$1.BuyVaultV1Callback): Extract<CallbackConfig, {
|
|
5939
|
+
type: Type$1.BuyVaultV1Callback;
|
|
5940
|
+
}> | undefined;
|
|
5941
|
+
declare function getCallback(chain: Name$1, type: Type$1.SellERC20Callback): Extract<CallbackConfig, {
|
|
5942
|
+
type: Type$1.SellERC20Callback;
|
|
5943
|
+
}> | undefined;
|
|
5944
|
+
declare function getCallback(chain: Name$1, type: Type$1.BuyWithEmptyCallback): Extract<CallbackConfig, {
|
|
5945
|
+
type: Type$1.BuyWithEmptyCallback;
|
|
5946
|
+
}> | undefined;
|
|
5947
|
+
declare function getCallback(chain: Name$1, type: Type$1): CallbackConfig | undefined;
|
|
5948
|
+
/**
|
|
5949
|
+
* Attempts to infer the configured callback type from a callback address on a chain.
|
|
5950
|
+
* Skips the empty callback type as it does not carry addresses.
|
|
5951
|
+
*
|
|
5952
|
+
* @param chain - Chain name for which to infer the callback type
|
|
5953
|
+
* @param address - Callback contract address
|
|
5954
|
+
* @returns The callback type when found, otherwise undefined
|
|
5955
|
+
*/
|
|
5956
|
+
declare function getCallbackType(chain: Name$1, address: Address): Type$1.BuyWithEmptyCallback | Type$1.BuyVaultV1Callback | Type$1.SellERC20Callback | undefined;
|
|
5957
|
+
/**
|
|
5958
|
+
* Returns the callback addresses for a given chain and callback type, if it exists.
|
|
5959
|
+
* @param chain - Chain name for which to read the validation configuration
|
|
5960
|
+
* @param type - Callback type to retrieve
|
|
5961
|
+
* @returns The matching callback addresses or an empty array if not configured
|
|
5962
|
+
*/
|
|
5963
|
+
declare function getCallbackTypeAddresses(chain: Name$1, type: Type$1): Address[];
|
|
5964
|
+
/**
|
|
5965
|
+
* Returns the list of allowed non-empty callback addresses for a chain.
|
|
5966
|
+
*
|
|
5967
|
+
* @param chain - Chain name
|
|
5968
|
+
* @returns Array of allowed callback addresses (lowercased). Empty when none configured
|
|
5969
|
+
*/
|
|
5970
|
+
declare const getCallbackAddresses: (chain: Name$1) => Address[];
|
|
5971
|
+
declare const assets: Record<string, Address[]>;
|
|
5972
|
+
declare const configs: Record<Name$1, GateConfig>;
|
|
5973
|
+
//#endregion
|
|
5974
|
+
//#region src/gatekeeper/morphoRules.d.ts
|
|
5975
|
+
declare const morphoRules: (chains: Chain$1[]) => (Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity"> | Rule<Offer, "chain_ids"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "token">)[];
|
|
5976
|
+
declare namespace Rules_d_exports {
|
|
5977
|
+
export { ValidityParameters, amountMutualExclusivity, callback, chains, maturity, sameMaker, token, validity };
|
|
5978
|
+
}
|
|
5979
|
+
type ValidityParameters = {
|
|
5980
|
+
client: PublicClient<Transport, Chain$1>;
|
|
5981
|
+
};
|
|
5982
|
+
/**
|
|
5983
|
+
* set of rules to validate offers.
|
|
5984
|
+
*
|
|
5985
|
+
* @param parameters - Validity parameters with chain and client
|
|
5986
|
+
* @returns Array of validation rules to evaluate against offers
|
|
5987
|
+
*/
|
|
5988
|
+
declare function validity(parameters: ValidityParameters): (Rule<Offer, "expiry"> | Rule<Offer, "sell_erc20_callback_invalid"> | Rule<Offer, "buy_offers_callback_vault_invalid">)[];
|
|
5989
|
+
declare const chains: ({
|
|
5990
|
+
chains
|
|
5991
|
+
}: {
|
|
5992
|
+
chains: Chain$1[];
|
|
5993
|
+
}) => Rule<Offer, "chain_ids">;
|
|
5994
|
+
declare const maturity: ({
|
|
5995
|
+
maturities
|
|
5996
|
+
}: {
|
|
5997
|
+
maturities: MaturityType[];
|
|
5998
|
+
}) => Rule<Offer, "maturity">;
|
|
5999
|
+
declare const callback: ({
|
|
6000
|
+
callbacks,
|
|
6001
|
+
allowedAddresses
|
|
6002
|
+
}: {
|
|
6003
|
+
callbacks: Type$1[];
|
|
6004
|
+
allowedAddresses: Address[];
|
|
6005
|
+
}) => Rule<Offer, "callback">;
|
|
6006
|
+
/**
|
|
6007
|
+
* A validation rule that checks if the offer's tokens are allowed for its chain.
|
|
6008
|
+
* @param assetsByChainId - Allowed assets indexed by chain id.
|
|
6009
|
+
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
6010
|
+
*/
|
|
6011
|
+
declare const token: ({
|
|
6012
|
+
assetsByChainId
|
|
6013
|
+
}: {
|
|
6014
|
+
assetsByChainId: Partial<Record<Id, Address[]>>;
|
|
6015
|
+
}) => Rule<Offer, "token">;
|
|
6016
|
+
/**
|
|
6017
|
+
* A batch validation rule that ensures all offers in a tree have the same maker address.
|
|
6018
|
+
* Returns an issue only for the first non-conforming offer.
|
|
6019
|
+
* This rule is signing-agnostic; signer verification is handled at the collector level.
|
|
6020
|
+
*/
|
|
6021
|
+
declare const sameMaker: () => Rule<Offer, "mixed_maker">;
|
|
6022
|
+
/**
|
|
6023
|
+
* A validation rule that ensures mutual exclusivity of offer amount fields.
|
|
6024
|
+
* At most one of (assets, obligationUnits, obligationShares) can be non-zero.
|
|
6025
|
+
* Matches contract requirement: `atMostOneNonZero(offer.assets, offer.obligationUnits, offer.obligationShares)`.
|
|
6026
|
+
*/
|
|
6027
|
+
declare const amountMutualExclusivity: () => Rule<Offer, "amount_mutual_exclusivity">;
|
|
6080
6028
|
//#endregion
|
|
6081
6029
|
//#region src/mempool/MempoolEVMClient.d.ts
|
|
6082
6030
|
type MempoolEVMClientConfig = {
|
|
@@ -6087,11 +6035,8 @@ type MempoolEVMClientConfig = {
|
|
|
6087
6035
|
declare function from(parameters: from.Parameters): from.ReturnType;
|
|
6088
6036
|
declare namespace from {
|
|
6089
6037
|
type Parameters = {
|
|
6090
|
-
/** The viem client to use. */
|
|
6091
|
-
|
|
6092
|
-
/** The mempool address. */
|
|
6093
|
-
mempoolAddress: Address;
|
|
6094
|
-
/** The block window to use for the mempool. Defaults to 100. */
|
|
6038
|
+
/** The viem client to use. */client: WalletClient; /** The mempool address. */
|
|
6039
|
+
mempoolAddress: Address; /** The block window to use for the mempool. Defaults to 100. */
|
|
6095
6040
|
blockWindow?: number;
|
|
6096
6041
|
};
|
|
6097
6042
|
type ReturnType = Client$2;
|
|
@@ -6131,18 +6076,12 @@ declare class ChainIdMismatchError extends BaseError {
|
|
|
6131
6076
|
//#region src/mempool/MempoolClient.d.ts
|
|
6132
6077
|
type AddParameters = Compute<Omit<Offer, "createdAt">[]>;
|
|
6133
6078
|
type GetParameters = {
|
|
6134
|
-
/** The block number to get offers from. */
|
|
6135
|
-
|
|
6136
|
-
/** The
|
|
6137
|
-
|
|
6138
|
-
/** The loan asset to get offers from. */
|
|
6139
|
-
loanToken?: string;
|
|
6140
|
-
/** The order to get offers. Defaults to "desc". */
|
|
6141
|
-
order?: "asc" | "desc";
|
|
6142
|
-
/** The options to get offers from. */
|
|
6079
|
+
/** The block number to get offers from. */blockNumberGte?: number; /** The block number to get offers to. */
|
|
6080
|
+
blockNumberLte?: number; /** The loan asset to get offers from. */
|
|
6081
|
+
loanToken?: string; /** The order to get offers. Defaults to "desc". */
|
|
6082
|
+
order?: "asc" | "desc"; /** The options to get offers from. */
|
|
6143
6083
|
options?: {
|
|
6144
|
-
/** The maximum number of offers to return. Defaults to 100. Maximum is 1000. */
|
|
6145
|
-
maxBatchSize?: number;
|
|
6084
|
+
/** The maximum number of offers to return. Defaults to 100. Maximum is 1000. */maxBatchSize?: number;
|
|
6146
6085
|
};
|
|
6147
6086
|
};
|
|
6148
6087
|
/**
|
|
@@ -6153,11 +6092,9 @@ type Client$2 = {
|
|
|
6153
6092
|
* Add an offer to the mempool.
|
|
6154
6093
|
* @returns The created offer with its hash.
|
|
6155
6094
|
*/
|
|
6156
|
-
add: (parameters: AddParameters) => Promise<Hex>;
|
|
6157
|
-
/** Get offers from the mempool. */
|
|
6095
|
+
add: (parameters: AddParameters) => Promise<Hex>; /** Get offers from the mempool. */
|
|
6158
6096
|
get: (parameters?: GetParameters) => AsyncGenerator<{
|
|
6159
|
-
offers: Offer[];
|
|
6160
|
-
/** The block number of the last processed offer. Depends on the `order` parameter, block numbers will ascend or descend. */
|
|
6097
|
+
offers: Offer[]; /** The block number of the last processed offer. Depends on the `order` parameter, block numbers will ascend or descend. */
|
|
6161
6098
|
blockNumber: number;
|
|
6162
6099
|
}>;
|
|
6163
6100
|
/**
|
|
@@ -6316,5 +6253,5 @@ declare namespace index_d_exports$3 {
|
|
|
6316
6253
|
export { BaseError, GlobalErrorType, Group_d_exports as Group, Random_d_exports as Random, ReorgError, Snake, time_d_exports as Time, atMostOneNonZero, batch, batchMulticall, fromSnakeCase$3 as fromSnakeCase, lazy, max$1 as max, min, poll, retry, stringifyBigint, toSnakeCase$1 as toSnakeCase, wait };
|
|
6317
6254
|
}
|
|
6318
6255
|
//#endregion
|
|
6319
|
-
export { index_d_exports as Abi, BookResponse_d_exports as BookResponse, BooksController, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainHealth, ChainRegistry_d_exports as ChainRegistry, ChainsHealthResponse, Collateral_d_exports as Collateral, CollectorHealth, CollectorsHealthResponse, Compute, ConfigController, Database_d_exports as Database, ERC4626_d_exports as ERC4626, Errors_d_exports as Errors, Format_d_exports as Format, GateConfig_d_exports as GateConfig, Gatekeeper_d_exports as Gatekeeper, Health_d_exports as Health, HealthController, Indexer_d_exports as Indexer, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Logger_d_exports as Logger, Maturity_d_exports as Maturity, index_d_exports$1 as Mempool, Obligation_d_exports as Obligation, ObligationResponse_d_exports as ObligationResponse, ObligationsController, Offer_d_exports as Offer, OfferResponse_d_exports as OfferResponse, OffersController, index_d_exports$2 as OffersSchema, OpenApi, OpenApiOptions, Oracle_d_exports as Oracle, Position_d_exports as Position, PositionResponse_d_exports as PositionResponse, Quote_d_exports as Quote, RouterApi_d_exports as RouterApi, Client_d_exports as RouterClient, RouterStatusResponse, RuleInfo, Rules_d_exports as Rules, time_d_exports as Time, Transfer_d_exports as Transfer, Tree_d_exports as Tree, UsersController, index_d_exports$3 as Utils, ValidateController, Gate_d_exports as Validation, morphoRules, parse, safeParse };
|
|
6256
|
+
export { index_d_exports as Abi, BookResponse_d_exports as BookResponse, BooksController, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainHealth, ChainRegistry_d_exports as ChainRegistry, ChainsHealthResponse, Collateral_d_exports as Collateral, CollectorHealth, CollectorsHealthResponse, Compute, ConfigController, Database_d_exports as Database, ERC4626_d_exports as ERC4626, ErrorPayload, Errors_d_exports as Errors, Format_d_exports as Format, GateConfig_d_exports as GateConfig, Gatekeeper_d_exports as Gatekeeper, Client_d_exports as GatekeeperClient, Health_d_exports as Health, HealthController, Indexer_d_exports as Indexer, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Logger_d_exports as Logger, Maturity_d_exports as Maturity, index_d_exports$1 as Mempool, Obligation_d_exports as Obligation, ObligationResponse_d_exports as ObligationResponse, ObligationsController, Offer_d_exports as Offer, OfferResponse_d_exports as OfferResponse, OffersController, index_d_exports$2 as OffersSchema, OpenApi, OpenApiOptions, Oracle_d_exports as Oracle, Position_d_exports as Position, PositionResponse_d_exports as PositionResponse, Quote_d_exports as Quote, RouterApi_d_exports as RouterApi, Client_d_exports$1 as RouterClient, RouterStatusResponse, RuleInfo, Rules_d_exports as Rules, RulesProvider, SuccessPayload, time_d_exports as Time, TradingFee_d_exports as TradingFee, Transfer_d_exports as Transfer, Tree_d_exports as Tree, UsersController, index_d_exports$3 as Utils, ValidateController, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules, parse, safeParse };
|
|
6320
6257
|
//# sourceMappingURL=index.node.d.mts.map
|