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