@morpho-dev/router 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2417 -975
- package/dist/drizzle/migrations/0026_add-receiver-if-maker-is-seller.sql +1 -0
- package/dist/drizzle/migrations/0027_debt-to-transfers.sql +239 -0
- package/dist/drizzle/migrations/0028_obligation_id_and_keys.sql +247 -0
- package/dist/drizzle/migrations/0029_collateral-positions.sql +248 -0
- package/dist/drizzle/migrations/0030_remove_chain_id_from_offer.sql +37 -0
- package/dist/drizzle/migrations/meta/0026_snapshot.json +1454 -0
- package/dist/drizzle/migrations/meta/0027_snapshot.json +1581 -0
- package/dist/drizzle/migrations/meta/0028_snapshot.json +1632 -0
- package/dist/drizzle/migrations/meta/0029_snapshot.json +1619 -0
- package/dist/drizzle/migrations/meta/0030_snapshot.json +1652 -0
- package/dist/drizzle/migrations/meta/_journal.json +35 -0
- package/dist/evm/bytecode/morpho.txt +1 -1
- package/dist/index.browser.d.mts +561 -317
- package/dist/index.browser.d.mts.map +1 -1
- package/dist/index.browser.d.ts +557 -313
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +4032 -3816
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +4026 -3816
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +1067 -447
- package/dist/index.node.d.mts.map +1 -1
- package/dist/index.node.d.ts +1067 -447
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +2466 -1195
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +2439 -1174
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.node.d.mts
CHANGED
|
@@ -509,7 +509,7 @@ declare const MorphoV2: readonly [{
|
|
|
509
509
|
readonly stateMutability: "nonpayable";
|
|
510
510
|
readonly inputs: readonly [{
|
|
511
511
|
readonly type: "address";
|
|
512
|
-
readonly name: "
|
|
512
|
+
readonly name: "feeRecipient";
|
|
513
513
|
}];
|
|
514
514
|
readonly outputs: readonly [];
|
|
515
515
|
}, {
|
|
@@ -589,6 +589,15 @@ declare const MorphoV2: readonly [{
|
|
|
589
589
|
}, {
|
|
590
590
|
readonly type: "address";
|
|
591
591
|
readonly name: "taker";
|
|
592
|
+
}, {
|
|
593
|
+
readonly type: "address";
|
|
594
|
+
readonly name: "takerCallback";
|
|
595
|
+
}, {
|
|
596
|
+
readonly type: "bytes";
|
|
597
|
+
readonly name: "takerCallbackData";
|
|
598
|
+
}, {
|
|
599
|
+
readonly type: "address";
|
|
600
|
+
readonly name: "receiverIfTakerIsSeller";
|
|
592
601
|
}, {
|
|
593
602
|
readonly type: "tuple";
|
|
594
603
|
readonly components: readonly [{
|
|
@@ -650,6 +659,9 @@ declare const MorphoV2: readonly [{
|
|
|
650
659
|
}, {
|
|
651
660
|
readonly type: "bytes";
|
|
652
661
|
readonly name: "callbackData";
|
|
662
|
+
}, {
|
|
663
|
+
readonly type: "address";
|
|
664
|
+
readonly name: "receiverIfMakerIsSeller";
|
|
653
665
|
}];
|
|
654
666
|
readonly name: "offer";
|
|
655
667
|
}, {
|
|
@@ -671,12 +683,6 @@ declare const MorphoV2: readonly [{
|
|
|
671
683
|
}, {
|
|
672
684
|
readonly type: "bytes32[]";
|
|
673
685
|
readonly name: "proof";
|
|
674
|
-
}, {
|
|
675
|
-
readonly type: "address";
|
|
676
|
-
readonly name: "takerCallback";
|
|
677
|
-
}, {
|
|
678
|
-
readonly type: "bytes";
|
|
679
|
-
readonly name: "takerCallbackData";
|
|
680
686
|
}];
|
|
681
687
|
readonly outputs: readonly [{
|
|
682
688
|
readonly type: "uint256";
|
|
@@ -798,6 +804,9 @@ declare const MorphoV2: readonly [{
|
|
|
798
804
|
}, {
|
|
799
805
|
readonly type: "address";
|
|
800
806
|
readonly name: "onBehalf";
|
|
807
|
+
}, {
|
|
808
|
+
readonly type: "address";
|
|
809
|
+
readonly name: "receiver";
|
|
801
810
|
}];
|
|
802
811
|
readonly outputs: readonly [{
|
|
803
812
|
readonly type: "uint256";
|
|
@@ -840,6 +849,9 @@ declare const MorphoV2: readonly [{
|
|
|
840
849
|
}, {
|
|
841
850
|
readonly type: "address";
|
|
842
851
|
readonly name: "onBehalf";
|
|
852
|
+
}, {
|
|
853
|
+
readonly type: "address";
|
|
854
|
+
readonly name: "receiver";
|
|
843
855
|
}];
|
|
844
856
|
readonly outputs: readonly [];
|
|
845
857
|
}, {
|
|
@@ -1027,7 +1039,7 @@ declare const MorphoV2: readonly [{
|
|
|
1027
1039
|
readonly type: "event";
|
|
1028
1040
|
readonly inputs: readonly [{
|
|
1029
1041
|
readonly type: "address";
|
|
1030
|
-
readonly name: "
|
|
1042
|
+
readonly name: "feeRecipient";
|
|
1031
1043
|
readonly indexed: true;
|
|
1032
1044
|
}];
|
|
1033
1045
|
}, {
|
|
@@ -1102,6 +1114,9 @@ declare const MorphoV2: readonly [{
|
|
|
1102
1114
|
}, {
|
|
1103
1115
|
readonly type: "bool";
|
|
1104
1116
|
readonly name: "sellerIsBorrower";
|
|
1117
|
+
}, {
|
|
1118
|
+
readonly type: "address";
|
|
1119
|
+
readonly name: "sellerReceiver";
|
|
1105
1120
|
}, {
|
|
1106
1121
|
readonly type: "bytes32";
|
|
1107
1122
|
readonly name: "group";
|
|
@@ -1115,7 +1130,6 @@ declare const MorphoV2: readonly [{
|
|
|
1115
1130
|
readonly inputs: readonly [{
|
|
1116
1131
|
readonly type: "address";
|
|
1117
1132
|
readonly name: "caller";
|
|
1118
|
-
readonly indexed: true;
|
|
1119
1133
|
}, {
|
|
1120
1134
|
readonly type: "bytes32";
|
|
1121
1135
|
readonly name: "id";
|
|
@@ -1130,6 +1144,10 @@ declare const MorphoV2: readonly [{
|
|
|
1130
1144
|
readonly type: "address";
|
|
1131
1145
|
readonly name: "onBehalf";
|
|
1132
1146
|
readonly indexed: true;
|
|
1147
|
+
}, {
|
|
1148
|
+
readonly type: "address";
|
|
1149
|
+
readonly name: "receiver";
|
|
1150
|
+
readonly indexed: true;
|
|
1133
1151
|
}];
|
|
1134
1152
|
}, {
|
|
1135
1153
|
readonly name: "WithdrawCollateral";
|
|
@@ -1152,6 +1170,9 @@ declare const MorphoV2: readonly [{
|
|
|
1152
1170
|
readonly type: "address";
|
|
1153
1171
|
readonly name: "onBehalf";
|
|
1154
1172
|
readonly indexed: true;
|
|
1173
|
+
}, {
|
|
1174
|
+
readonly type: "address";
|
|
1175
|
+
readonly name: "receiver";
|
|
1155
1176
|
}];
|
|
1156
1177
|
}];
|
|
1157
1178
|
type MorphoV2 = typeof MorphoV2;
|
|
@@ -1325,7 +1346,7 @@ declare class ReorgError extends BaseError {
|
|
|
1325
1346
|
constructor(blockNumber: number);
|
|
1326
1347
|
}
|
|
1327
1348
|
declare namespace Chain_d_exports {
|
|
1328
|
-
export { Chain$1 as Chain, ChainId, Id, InvalidBatchSizeError, InvalidBlockRangeError, InvalidBlockWindowError, MissingBlockNumberError, Name$1 as Name, chainIds, chainNames, chains$
|
|
1349
|
+
export { Chain$1 as Chain, ChainId, Id, InvalidBatchSizeError, InvalidBlockRangeError, InvalidBlockWindowError, MissingBlockNumberError, Name$1 as Name, chainIds, chainNames, chains$1 as chains, getChain, getWhitelistedChains, streamLogs };
|
|
1329
1350
|
}
|
|
1330
1351
|
type Chain$1 = Compute<Omit<Chain<ChainFormatters, {
|
|
1331
1352
|
morpho: ChainContract;
|
|
@@ -1366,7 +1387,7 @@ type Id = (typeof ChainId)[Uppercase<Name$1>];
|
|
|
1366
1387
|
declare const chainIds: readonly Id[];
|
|
1367
1388
|
declare function getChain(chainId: Id): Chain$1 | undefined;
|
|
1368
1389
|
declare const getWhitelistedChains: () => Chain$1[];
|
|
1369
|
-
declare const chains$
|
|
1390
|
+
declare const chains$1: Record<Lowercase<Name$1>, Chain$1>;
|
|
1370
1391
|
declare function streamLogs<abiEvent extends AbiEvent | undefined = undefined>(parameters: {
|
|
1371
1392
|
client: PublicClient;
|
|
1372
1393
|
contractAddress?: Address;
|
|
@@ -1399,7 +1420,7 @@ declare class MissingBlockNumberError extends BaseError {
|
|
|
1399
1420
|
constructor();
|
|
1400
1421
|
}
|
|
1401
1422
|
declare namespace ChainRegistry_d_exports {
|
|
1402
|
-
export { ChainRegistry, create$
|
|
1423
|
+
export { ChainRegistry, create$8 as create };
|
|
1403
1424
|
}
|
|
1404
1425
|
type ChainRegistry = {
|
|
1405
1426
|
getById: (chainId: Id) => Chain$1 | undefined;
|
|
@@ -1410,7 +1431,7 @@ type ChainRegistry = {
|
|
|
1410
1431
|
* @param chains - Array of chain objects to register.
|
|
1411
1432
|
* @returns A registry for looking up chains by ID. {@link ChainRegistry}
|
|
1412
1433
|
*/
|
|
1413
|
-
declare function create$
|
|
1434
|
+
declare function create$8(chains: Chain$1[]): ChainRegistry;
|
|
1414
1435
|
//#endregion
|
|
1415
1436
|
//#region src/core/types.d.ts
|
|
1416
1437
|
/** Combines members of an intersection into a readable type. */
|
|
@@ -1444,13 +1465,23 @@ declare class InvalidLLTVError extends BaseError {
|
|
|
1444
1465
|
}
|
|
1445
1466
|
declare const LLTVSchema: z$1.ZodPipe<z$1.ZodBigInt, z$1.ZodTransform<LLTV, bigint>>;
|
|
1446
1467
|
declare namespace Collateral_d_exports {
|
|
1447
|
-
export { Collateral, CollateralSchema, CollateralsSchema, from$16 as from, random$3 as random };
|
|
1468
|
+
export { Collateral, CollateralSchema, CollateralsSchema, abi$1 as abi, from$16 as from, random$3 as random };
|
|
1448
1469
|
}
|
|
1449
1470
|
type Collateral = {
|
|
1450
1471
|
/** Asset being used as collateral. */asset: Address; /** Liquidation Loan-to-Value of the collateral. */
|
|
1451
1472
|
lltv: LLTV; /** Oracle contract used to price the collateral. */
|
|
1452
1473
|
oracle: Address;
|
|
1453
1474
|
};
|
|
1475
|
+
declare const abi$1: readonly [{
|
|
1476
|
+
readonly type: "address";
|
|
1477
|
+
readonly name: "token";
|
|
1478
|
+
}, {
|
|
1479
|
+
readonly type: "uint256";
|
|
1480
|
+
readonly name: "lltv";
|
|
1481
|
+
}, {
|
|
1482
|
+
readonly type: "address";
|
|
1483
|
+
readonly name: "oracle";
|
|
1484
|
+
}];
|
|
1454
1485
|
declare const CollateralSchema: z$1.ZodObject<{
|
|
1455
1486
|
asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1456
1487
|
oracle: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
@@ -1564,102 +1595,33 @@ declare class DenominatorIsZeroError extends BaseError {
|
|
|
1564
1595
|
readonly name = "ERC4626.DenominatorIsZeroError";
|
|
1565
1596
|
constructor();
|
|
1566
1597
|
}
|
|
1567
|
-
declare namespace
|
|
1568
|
-
export {
|
|
1598
|
+
declare namespace Format_d_exports {
|
|
1599
|
+
export { Snake, fromSnakeCase$3 as fromSnakeCase, stringifyBigint, toSnakeCase$1 as toSnakeCase };
|
|
1569
1600
|
}
|
|
1601
|
+
/** The snake case representation of a type with bigint values stringified. */
|
|
1602
|
+
type Snake<T> = DeepMutable<SnakeKeys<StringifiedBigint<T>>>;
|
|
1603
|
+
/** Make arrays/tuples and object props mutable, deeply. */
|
|
1604
|
+
type DeepMutable<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends number | string | boolean | symbol | bigint | null | undefined ? T : T extends readonly [...infer R] ? { -readonly [K in keyof R]: DeepMutable<R[K]> } : T extends ReadonlyArray<infer U> ? Array<DeepMutable<U>> : T extends object ? { -readonly [K in keyof T]: DeepMutable<T[K]> } : T;
|
|
1605
|
+
/** Stringifies bigint values to strings and preserves branded primitives. */
|
|
1606
|
+
type StringifiedBigint<T> = [T] extends [bigint] ? string : [T] extends [`0x${string}`] ? string : T extends number ? T : T extends string ? T : T extends boolean ? T : T extends symbol ? T : T extends null | undefined ? T : T extends readonly (infer U)[] ? readonly StringifiedBigint<U>[] : T extends object ? { [K in keyof T]: StringifiedBigint<T[K]> } : T;
|
|
1607
|
+
/** Key remapping that also preserves branded primitives. */
|
|
1608
|
+
type SnakeKeys<T> = T extends readonly (infer U)[] ? readonly SnakeKeys<U>[] : T extends number | string | boolean | symbol | null | undefined ? T : T extends object ? { [K in keyof T as ToSnakeCase<Extract<K, string>>]: SnakeKeys<T[K]> } : T;
|
|
1609
|
+
type ToSnakeCase<S extends string> = S extends `${infer Head}${infer Tail}` ? Tail extends Uncapitalize<Tail> ? `${Lowercase<Head>}${ToSnakeCase<Tail>}` : `${Lowercase<Head>}_${ToSnakeCase<Uncapitalize<Tail>>}` : S;
|
|
1570
1610
|
/**
|
|
1571
|
-
*
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
amount: bigint;
|
|
1576
|
-
};
|
|
1577
|
-
/**
|
|
1578
|
-
* Represents a hierarchical relationship between two liquidity pools.
|
|
1579
|
-
*/
|
|
1580
|
-
type LiquidityLink = {
|
|
1581
|
-
parentPoolId: string;
|
|
1582
|
-
childPoolId: string;
|
|
1583
|
-
priority: number;
|
|
1584
|
-
};
|
|
1585
|
-
/**
|
|
1586
|
-
* Represents the connection between an offer and its liquidity pools.
|
|
1587
|
-
*/
|
|
1588
|
-
type OfferLiquidityPool = {
|
|
1589
|
-
offerHash: Hex;
|
|
1590
|
-
poolId: string;
|
|
1591
|
-
/**
|
|
1592
|
-
* The available capacity/liquidity from this pool for this offer.
|
|
1593
|
-
* Matches allowance amount from pool below.
|
|
1594
|
-
*/
|
|
1595
|
-
amount: bigint;
|
|
1596
|
-
};
|
|
1597
|
-
/**
|
|
1598
|
-
* Calculate maximum debt capacity from collateral amount.
|
|
1599
|
-
* @param amount - Collateral amount
|
|
1600
|
-
* @param oraclePrice - Oracle price (scaled to 36 decimals)
|
|
1601
|
-
* @param lltv - Loan-to-value ratio (scaled to 18 decimals)
|
|
1602
|
-
* @returns Maximum debt capacity
|
|
1603
|
-
*/
|
|
1604
|
-
declare function calculateMaxDebt(amount: bigint, oraclePrice: bigint, lltv: bigint): bigint;
|
|
1605
|
-
/**
|
|
1606
|
-
* Generate pool ID for balance pools.
|
|
1607
|
-
*/
|
|
1608
|
-
declare function generateBalancePoolId(parameters: {
|
|
1609
|
-
user: Address;
|
|
1610
|
-
chainId: Id;
|
|
1611
|
-
token: Address;
|
|
1612
|
-
}): string;
|
|
1613
|
-
/**
|
|
1614
|
-
* Generate pool ID for allowance pools.
|
|
1615
|
-
*/
|
|
1616
|
-
declare function generateAllowancePoolId(parameters: {
|
|
1617
|
-
user: Address;
|
|
1618
|
-
chainId: Id;
|
|
1619
|
-
token: Address;
|
|
1620
|
-
}): string;
|
|
1621
|
-
/**
|
|
1622
|
-
* Generate pool ID for obligation collateral pools.
|
|
1623
|
-
* Obligation collateral pools represent collateral already deposited in the obligation.
|
|
1624
|
-
* These pools are shared across all offers with the same obligation.
|
|
1625
|
-
*/
|
|
1626
|
-
declare function generateObligationCollateralPoolId(parameters: {
|
|
1627
|
-
user: Address;
|
|
1628
|
-
chainId: Id;
|
|
1629
|
-
obligationId: Hex;
|
|
1630
|
-
token: Address;
|
|
1631
|
-
}): string;
|
|
1632
|
-
/**
|
|
1633
|
-
* Generate pool ID for debt pools.
|
|
1634
|
-
*/
|
|
1635
|
-
declare function generateDebtPoolId(parameters: {
|
|
1636
|
-
user: Address;
|
|
1637
|
-
chainId: Id;
|
|
1638
|
-
obligationId: Hex;
|
|
1639
|
-
}): string;
|
|
1640
|
-
/**
|
|
1641
|
-
* Generate pool ID for user position in a vault.
|
|
1642
|
-
*/
|
|
1643
|
-
declare function generateUserVaultPositionPoolId(parameters: {
|
|
1644
|
-
user: Address;
|
|
1645
|
-
chainId: Id;
|
|
1646
|
-
vault: Address;
|
|
1647
|
-
}): string;
|
|
1648
|
-
/**
|
|
1649
|
-
* Generate pool ID for vault position in a market.
|
|
1611
|
+
* Formats object keys to snake case.
|
|
1612
|
+
* Preserves ethereum addresses as is.
|
|
1613
|
+
* Converts ethereum addresses to checksummed if used as values.
|
|
1614
|
+
* Stringifies bigint values to strings.
|
|
1650
1615
|
*/
|
|
1651
|
-
declare function
|
|
1652
|
-
vault: Address;
|
|
1653
|
-
chainId: Id;
|
|
1654
|
-
marketId: string;
|
|
1655
|
-
}): string;
|
|
1616
|
+
declare function toSnakeCase$1<T>(obj: T): Snake<T>;
|
|
1656
1617
|
/**
|
|
1657
|
-
*
|
|
1618
|
+
* Formats a snake case object to its camel case type.
|
|
1619
|
+
* Preserves ethereum addresses as is.
|
|
1620
|
+
* Converts checksummed ethereum addresses to lowercase if used as values.
|
|
1621
|
+
* @warning Does not unstringify bigint values.
|
|
1658
1622
|
*/
|
|
1659
|
-
declare function
|
|
1660
|
-
|
|
1661
|
-
marketId: string;
|
|
1662
|
-
}): string;
|
|
1623
|
+
declare function fromSnakeCase$3<T>(obj: Snake<T>): T;
|
|
1624
|
+
declare function stringifyBigint<T>(value: T): StringifiedBigint<T>;
|
|
1663
1625
|
declare namespace Maturity_d_exports {
|
|
1664
1626
|
export { InvalidDateError, InvalidFormatError, InvalidOptionError, Maturity, MaturityOptions, MaturitySchema, MaturityType, from$15 as from };
|
|
1665
1627
|
}
|
|
@@ -1708,44 +1670,15 @@ declare class InvalidOptionError extends BaseError {
|
|
|
1708
1670
|
readonly name = "Maturity.InvalidOptionError";
|
|
1709
1671
|
constructor(input: string);
|
|
1710
1672
|
}
|
|
1711
|
-
declare namespace Format_d_exports {
|
|
1712
|
-
export { Snake, fromSnakeCase$3 as fromSnakeCase, stringifyBigint, toSnakeCase$1 as toSnakeCase };
|
|
1713
|
-
}
|
|
1714
|
-
/** The snake case representation of a type with bigint values stringified. */
|
|
1715
|
-
type Snake<T> = DeepMutable<SnakeKeys<StringifiedBigint<T>>>;
|
|
1716
|
-
/** Make arrays/tuples and object props mutable, deeply. */
|
|
1717
|
-
type DeepMutable<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends number | string | boolean | symbol | bigint | null | undefined ? T : T extends readonly [...infer R] ? { -readonly [K in keyof R]: DeepMutable<R[K]> } : T extends ReadonlyArray<infer U> ? Array<DeepMutable<U>> : T extends object ? { -readonly [K in keyof T]: DeepMutable<T[K]> } : T;
|
|
1718
|
-
/** Stringifies bigint values to strings and preserves branded primitives. */
|
|
1719
|
-
type StringifiedBigint<T> = [T] extends [bigint] ? string : [T] extends [`0x${string}`] ? string : T extends number ? T : T extends string ? T : T extends boolean ? T : T extends symbol ? T : T extends null | undefined ? T : T extends readonly (infer U)[] ? readonly StringifiedBigint<U>[] : T extends object ? { [K in keyof T]: StringifiedBigint<T[K]> } : T;
|
|
1720
|
-
/** Key remapping that also preserves branded primitives. */
|
|
1721
|
-
type SnakeKeys<T> = T extends readonly (infer U)[] ? readonly SnakeKeys<U>[] : T extends number | string | boolean | symbol | null | undefined ? T : T extends object ? { [K in keyof T as ToSnakeCase<Extract<K, string>>]: SnakeKeys<T[K]> } : T;
|
|
1722
|
-
type ToSnakeCase<S extends string> = S extends `${infer Head}${infer Tail}` ? Tail extends Uncapitalize<Tail> ? `${Lowercase<Head>}${ToSnakeCase<Tail>}` : `${Lowercase<Head>}_${ToSnakeCase<Uncapitalize<Tail>>}` : S;
|
|
1723
|
-
/**
|
|
1724
|
-
* Formats object keys to snake case.
|
|
1725
|
-
* Preserves ethereum addresses as is.
|
|
1726
|
-
* Converts ethereum addresses to checksummed if used as values.
|
|
1727
|
-
* Stringifies bigint values to strings.
|
|
1728
|
-
*/
|
|
1729
|
-
declare function toSnakeCase$1<T>(obj: T): Snake<T>;
|
|
1730
|
-
/**
|
|
1731
|
-
* Formats a snake case object to its camel case type.
|
|
1732
|
-
* Preserves ethereum addresses as is.
|
|
1733
|
-
* Converts checksummed ethereum addresses to lowercase if used as values.
|
|
1734
|
-
* @warning Does not unstringify bigint values.
|
|
1735
|
-
*/
|
|
1736
|
-
declare function fromSnakeCase$3<T>(obj: Snake<T>): T;
|
|
1737
|
-
declare function stringifyBigint<T>(value: T): StringifiedBigint<T>;
|
|
1738
1673
|
declare namespace Obligation_d_exports {
|
|
1739
|
-
export { CollateralsAreNotSortedError, InvalidObligationError, Obligation, ObligationSchema, from$14 as from, fromOffer$1 as fromOffer, fromSnakeCase$2 as fromSnakeCase,
|
|
1674
|
+
export { CollateralsAreNotSortedError, InvalidObligationError, Obligation$1 as Obligation, ObligationSchema, abi, from$14 as from, fromOffer$1 as fromOffer, fromSnakeCase$2 as fromSnakeCase, key$1 as key, random$2 as random, tupleAbi };
|
|
1740
1675
|
}
|
|
1741
|
-
type Obligation = {
|
|
1742
|
-
/** The
|
|
1743
|
-
loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
|
|
1676
|
+
type Obligation$1 = {
|
|
1677
|
+
/** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
|
|
1744
1678
|
collaterals: Collateral[]; /** The maturity of the obligation. */
|
|
1745
1679
|
maturity: Maturity;
|
|
1746
1680
|
};
|
|
1747
1681
|
declare const ObligationSchema: z$1.ZodObject<{
|
|
1748
|
-
chainId: z$1.ZodNumber;
|
|
1749
1682
|
loanToken: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1750
1683
|
collaterals: z$1.ZodArray<z$1.ZodObject<{
|
|
1751
1684
|
asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
@@ -1754,6 +1687,49 @@ declare const ObligationSchema: z$1.ZodObject<{
|
|
|
1754
1687
|
}, z$1.core.$strip>>;
|
|
1755
1688
|
maturity: z$1.ZodPipe<z$1.ZodNumber, z$1.ZodTransform<Maturity, number>>;
|
|
1756
1689
|
}, z$1.core.$strip>;
|
|
1690
|
+
declare const abi: readonly [{
|
|
1691
|
+
readonly type: "address";
|
|
1692
|
+
readonly name: "loanToken";
|
|
1693
|
+
}, {
|
|
1694
|
+
readonly type: "tuple[]";
|
|
1695
|
+
readonly name: "collaterals";
|
|
1696
|
+
readonly components: readonly [{
|
|
1697
|
+
readonly type: "address";
|
|
1698
|
+
readonly name: "token";
|
|
1699
|
+
}, {
|
|
1700
|
+
readonly type: "uint256";
|
|
1701
|
+
readonly name: "lltv";
|
|
1702
|
+
}, {
|
|
1703
|
+
readonly type: "address";
|
|
1704
|
+
readonly name: "oracle";
|
|
1705
|
+
}];
|
|
1706
|
+
}, {
|
|
1707
|
+
readonly type: "uint256";
|
|
1708
|
+
readonly name: "maturity";
|
|
1709
|
+
}];
|
|
1710
|
+
declare const tupleAbi: readonly [{
|
|
1711
|
+
readonly type: "tuple";
|
|
1712
|
+
readonly components: readonly [{
|
|
1713
|
+
readonly type: "address";
|
|
1714
|
+
readonly name: "loanToken";
|
|
1715
|
+
}, {
|
|
1716
|
+
readonly type: "tuple[]";
|
|
1717
|
+
readonly name: "collaterals";
|
|
1718
|
+
readonly components: readonly [{
|
|
1719
|
+
readonly type: "address";
|
|
1720
|
+
readonly name: "token";
|
|
1721
|
+
}, {
|
|
1722
|
+
readonly type: "uint256";
|
|
1723
|
+
readonly name: "lltv";
|
|
1724
|
+
}, {
|
|
1725
|
+
readonly type: "address";
|
|
1726
|
+
readonly name: "oracle";
|
|
1727
|
+
}];
|
|
1728
|
+
}, {
|
|
1729
|
+
readonly type: "uint256";
|
|
1730
|
+
readonly name: "maturity";
|
|
1731
|
+
}];
|
|
1732
|
+
}];
|
|
1757
1733
|
/**
|
|
1758
1734
|
* Creates an obligation from the given parameters.
|
|
1759
1735
|
* @constructor
|
|
@@ -1764,7 +1740,6 @@ declare const ObligationSchema: z$1.ZodObject<{
|
|
|
1764
1740
|
* @example
|
|
1765
1741
|
* ```ts
|
|
1766
1742
|
* const obligation = Obligation.from({
|
|
1767
|
-
* chainId: 1,
|
|
1768
1743
|
* loanToken: privateKeyToAccount(generatePrivateKey()).address,
|
|
1769
1744
|
* collaterals: [
|
|
1770
1745
|
* Collateral.from({
|
|
@@ -1780,12 +1755,11 @@ declare const ObligationSchema: z$1.ZodObject<{
|
|
|
1780
1755
|
declare function from$14(parameters: from$14.Parameters): from$14.ReturnType;
|
|
1781
1756
|
declare namespace from$14 {
|
|
1782
1757
|
type Parameters = {
|
|
1783
|
-
/** The
|
|
1784
|
-
loanToken: Address; /** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
1758
|
+
/** The token that is being borrowed for this obligation. */loanToken: Address; /** The exact set of collaterals required to borrow the loan token. Must be sorted alphabetically by address. */
|
|
1785
1759
|
collaterals: from$16.Parameters[] | readonly from$16.Parameters[]; /** The maturity of the obligation. */
|
|
1786
1760
|
maturity: from$15.Parameters;
|
|
1787
1761
|
};
|
|
1788
|
-
type ReturnType = Obligation;
|
|
1762
|
+
type ReturnType = Obligation$1;
|
|
1789
1763
|
type ErrorType = InvalidObligationError;
|
|
1790
1764
|
}
|
|
1791
1765
|
/**
|
|
@@ -1796,30 +1770,27 @@ declare namespace from$14 {
|
|
|
1796
1770
|
*/
|
|
1797
1771
|
declare function fromSnakeCase$2(input: fromSnakeCase$2.Parameters): fromSnakeCase$2.ReturnType;
|
|
1798
1772
|
declare namespace fromSnakeCase$2 {
|
|
1799
|
-
type Parameters = Snake<
|
|
1800
|
-
|
|
1801
|
-
}>;
|
|
1802
|
-
type ReturnType = Obligation;
|
|
1773
|
+
type Parameters = Snake<Obligation$1>;
|
|
1774
|
+
type ReturnType = Obligation$1;
|
|
1803
1775
|
type ErrorType = InvalidObligationError;
|
|
1804
1776
|
}
|
|
1805
1777
|
/**
|
|
1806
|
-
* Calculates
|
|
1807
|
-
* The
|
|
1778
|
+
* Calculates a canonical key for an obligation payload.
|
|
1779
|
+
* The key is computed as keccak256(abi.encode(loanToken, collaterals, maturity)).
|
|
1808
1780
|
* @throws If the collaterals are not sorted alphabetically by address. {@link CollateralsAreNotSortedError}
|
|
1809
|
-
* @param parameters - {@link
|
|
1810
|
-
* @returns The obligation
|
|
1781
|
+
* @param parameters - {@link key.Parameters}
|
|
1782
|
+
* @returns The obligation key as a 32-byte hex string. {@link key.ReturnType}
|
|
1811
1783
|
*
|
|
1812
1784
|
* @example
|
|
1813
1785
|
* ```ts
|
|
1814
1786
|
* const obligation = Obligation.random();
|
|
1815
|
-
* const
|
|
1816
|
-
* console.log(
|
|
1787
|
+
* const key = Obligation.key(obligation);
|
|
1788
|
+
* console.log(key); // 0x1234567890123456789012345678901234567890123456789012345678901234
|
|
1817
1789
|
* ```
|
|
1818
1790
|
*/
|
|
1819
|
-
declare function
|
|
1820
|
-
declare namespace
|
|
1791
|
+
declare function key$1(parameters: key$1.Parameters): key$1.ReturnType;
|
|
1792
|
+
declare namespace key$1 {
|
|
1821
1793
|
type Parameters = {
|
|
1822
|
-
chainId: number;
|
|
1823
1794
|
loanToken: Address;
|
|
1824
1795
|
collaterals: {
|
|
1825
1796
|
asset: Address;
|
|
@@ -1842,7 +1813,7 @@ declare namespace id {
|
|
|
1842
1813
|
*/
|
|
1843
1814
|
declare function random$2(): random$2.ReturnType;
|
|
1844
1815
|
declare namespace random$2 {
|
|
1845
|
-
type ReturnType = Obligation;
|
|
1816
|
+
type ReturnType = Obligation$1;
|
|
1846
1817
|
}
|
|
1847
1818
|
/**
|
|
1848
1819
|
* Creates an obligation from an offer.
|
|
@@ -1854,7 +1825,7 @@ declare namespace random$2 {
|
|
|
1854
1825
|
declare function fromOffer$1(offer: Offer): fromOffer$1.ReturnType;
|
|
1855
1826
|
declare namespace fromOffer$1 {
|
|
1856
1827
|
type Parameters = Offer;
|
|
1857
|
-
type ReturnType = Obligation;
|
|
1828
|
+
type ReturnType = Obligation$1;
|
|
1858
1829
|
}
|
|
1859
1830
|
declare class InvalidObligationError extends BaseError<z$1.ZodError | Error> {
|
|
1860
1831
|
readonly name = "Obligation.InvalidObligationError";
|
|
@@ -1864,8 +1835,135 @@ declare class CollateralsAreNotSortedError extends BaseError {
|
|
|
1864
1835
|
readonly name = "Obligation.CollateralsAreNotSortedError";
|
|
1865
1836
|
constructor();
|
|
1866
1837
|
}
|
|
1838
|
+
declare namespace Id_d_exports {
|
|
1839
|
+
export { Obligation, creationCode, toId };
|
|
1840
|
+
}
|
|
1841
|
+
type Obligation = Obligation$1;
|
|
1842
|
+
/**
|
|
1843
|
+
* Builds the same creation code as `IdLib.creationCode` in Solidity.
|
|
1844
|
+
*
|
|
1845
|
+
* Layout: `prefix (11 bytes) + chainId (32 bytes) + morphoV2 (20 bytes) + abi.encode(obligation)`.
|
|
1846
|
+
*
|
|
1847
|
+
* @param parameters - {@link creationCode.Parameters}
|
|
1848
|
+
* @returns The CREATE2 init code bytes. {@link creationCode.ReturnType}
|
|
1849
|
+
*/
|
|
1850
|
+
declare function creationCode(parameters: creationCode.Parameters): creationCode.ReturnType;
|
|
1851
|
+
declare namespace creationCode {
|
|
1852
|
+
type Parameters = {
|
|
1853
|
+
obligation: Obligation;
|
|
1854
|
+
chainId: Id;
|
|
1855
|
+
morphoV2: Address;
|
|
1856
|
+
};
|
|
1857
|
+
type ReturnType = Hex;
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* Computes the same id as `IdLib.toId` in Solidity.
|
|
1861
|
+
* @param parameters - {@link toId.Parameters}
|
|
1862
|
+
* @returns The obligation id. {@link toId.ReturnType}
|
|
1863
|
+
*/
|
|
1864
|
+
declare function toId(parameters: toId.Parameters): toId.ReturnType;
|
|
1865
|
+
declare namespace toId {
|
|
1866
|
+
type Parameters = creationCode.Parameters;
|
|
1867
|
+
type ReturnType = Hex;
|
|
1868
|
+
}
|
|
1869
|
+
declare namespace Liquidity_d_exports {
|
|
1870
|
+
export { LiquidityLink, LiquidityPool, OfferLiquidityPool, calculateMaxDebt, generateAllowancePoolId, generateBalancePoolId, generateDebtPoolId, generateMarketLiquidityPoolId, generateObligationCollateralPoolId, generateUserVaultPositionPoolId, generateVaultPositionPoolId };
|
|
1871
|
+
}
|
|
1872
|
+
/**
|
|
1873
|
+
* Represents a liquidity pool with a unique ID and amount.
|
|
1874
|
+
*/
|
|
1875
|
+
type LiquidityPool = {
|
|
1876
|
+
id: string;
|
|
1877
|
+
amount: bigint;
|
|
1878
|
+
};
|
|
1879
|
+
/**
|
|
1880
|
+
* Represents a hierarchical relationship between two liquidity pools.
|
|
1881
|
+
*/
|
|
1882
|
+
type LiquidityLink = {
|
|
1883
|
+
parentPoolId: string;
|
|
1884
|
+
childPoolId: string;
|
|
1885
|
+
priority: number;
|
|
1886
|
+
};
|
|
1887
|
+
/**
|
|
1888
|
+
* Represents the connection between an offer and its liquidity pools.
|
|
1889
|
+
*/
|
|
1890
|
+
type OfferLiquidityPool = {
|
|
1891
|
+
offerHash: Hex;
|
|
1892
|
+
poolId: string;
|
|
1893
|
+
/**
|
|
1894
|
+
* The available capacity/liquidity from this pool for this offer.
|
|
1895
|
+
* Matches allowance amount from pool below.
|
|
1896
|
+
*/
|
|
1897
|
+
amount: bigint;
|
|
1898
|
+
};
|
|
1899
|
+
/**
|
|
1900
|
+
* Calculate maximum debt capacity from collateral amount.
|
|
1901
|
+
* @param amount - Collateral amount
|
|
1902
|
+
* @param oraclePrice - Oracle price (scaled to 36 decimals)
|
|
1903
|
+
* @param lltv - Loan-to-value ratio (scaled to 18 decimals)
|
|
1904
|
+
* @returns Maximum debt capacity
|
|
1905
|
+
*/
|
|
1906
|
+
declare function calculateMaxDebt(amount: bigint, oraclePrice: bigint, lltv: bigint): bigint;
|
|
1907
|
+
/**
|
|
1908
|
+
* Generate pool ID for balance pools.
|
|
1909
|
+
*/
|
|
1910
|
+
declare function generateBalancePoolId(parameters: {
|
|
1911
|
+
user: Address;
|
|
1912
|
+
chainId: Id;
|
|
1913
|
+
token: Address;
|
|
1914
|
+
}): string;
|
|
1915
|
+
/**
|
|
1916
|
+
* Generate pool ID for allowance pools.
|
|
1917
|
+
*/
|
|
1918
|
+
declare function generateAllowancePoolId(parameters: {
|
|
1919
|
+
user: Address;
|
|
1920
|
+
chainId: Id;
|
|
1921
|
+
token: Address;
|
|
1922
|
+
}): string;
|
|
1923
|
+
/**
|
|
1924
|
+
* Generate pool ID for obligation collateral pools.
|
|
1925
|
+
* Obligation collateral pools represent collateral already deposited in the obligation.
|
|
1926
|
+
* These pools are shared across all offers with the same obligation.
|
|
1927
|
+
*/
|
|
1928
|
+
declare function generateObligationCollateralPoolId(parameters: {
|
|
1929
|
+
user: Address;
|
|
1930
|
+
chainId: Id;
|
|
1931
|
+
obligationId: Hex;
|
|
1932
|
+
token: Address;
|
|
1933
|
+
}): string;
|
|
1934
|
+
/**
|
|
1935
|
+
* Generate pool ID for debt pools.
|
|
1936
|
+
*/
|
|
1937
|
+
declare function generateDebtPoolId(parameters: {
|
|
1938
|
+
user: Address;
|
|
1939
|
+
chainId: Id;
|
|
1940
|
+
obligationId: Hex;
|
|
1941
|
+
}): string;
|
|
1942
|
+
/**
|
|
1943
|
+
* Generate pool ID for user position in a vault.
|
|
1944
|
+
*/
|
|
1945
|
+
declare function generateUserVaultPositionPoolId(parameters: {
|
|
1946
|
+
user: Address;
|
|
1947
|
+
chainId: Id;
|
|
1948
|
+
vault: Address;
|
|
1949
|
+
}): string;
|
|
1950
|
+
/**
|
|
1951
|
+
* Generate pool ID for vault position in a market.
|
|
1952
|
+
*/
|
|
1953
|
+
declare function generateVaultPositionPoolId(parameters: {
|
|
1954
|
+
vault: Address;
|
|
1955
|
+
chainId: Id;
|
|
1956
|
+
marketId: string;
|
|
1957
|
+
}): string;
|
|
1958
|
+
/**
|
|
1959
|
+
* Generate pool ID for market total liquidity.
|
|
1960
|
+
*/
|
|
1961
|
+
declare function generateMarketLiquidityPoolId(parameters: {
|
|
1962
|
+
chainId: Id;
|
|
1963
|
+
marketId: string;
|
|
1964
|
+
}): string;
|
|
1867
1965
|
declare namespace Offer_d_exports {
|
|
1868
|
-
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode,
|
|
1966
|
+
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, encode$1 as encode, from$13 as from, fromSnakeCase$1 as fromSnakeCase, hash, liquidateEvent, obligationId, random$1 as random, repayEvent, serialize, supplyCollateralEvent, takeEvent, toSnakeCase, withdrawCollateralEvent };
|
|
1869
1967
|
}
|
|
1870
1968
|
type Offer = {
|
|
1871
1969
|
/** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
|
|
@@ -1878,14 +1976,14 @@ type Offer = {
|
|
|
1878
1976
|
readonly start: number; /** The group. Used for OCO (One-Cancelled-Other) mechanism. */
|
|
1879
1977
|
readonly group: Hex; /** The session. Used for session-based offer management. */
|
|
1880
1978
|
readonly session: Hex; /** The side of the offer. `true` for buy, `false` for sell. */
|
|
1881
|
-
readonly buy: boolean; /** The
|
|
1882
|
-
readonly chainId: Id; /** The token that is being borrowed. */
|
|
1979
|
+
readonly buy: boolean; /** The token that is being borrowed. */
|
|
1883
1980
|
readonly loanToken: Address; /** The exact set of collaterals required to borrow the loan token. */
|
|
1884
1981
|
readonly collaterals: readonly Collateral[]; /** The optional callback data to retrieve the maker funds. */
|
|
1885
1982
|
readonly callback: {
|
|
1886
1983
|
readonly address: Address;
|
|
1887
1984
|
readonly data: Hex;
|
|
1888
|
-
};
|
|
1985
|
+
}; /** Receiver of loan token proceeds when maker is seller on `take()`. */
|
|
1986
|
+
readonly receiverIfMakerIsSeller: Address;
|
|
1889
1987
|
};
|
|
1890
1988
|
declare enum Status {
|
|
1891
1989
|
VALID = "VALID",
|
|
@@ -1893,6 +1991,7 @@ declare enum Status {
|
|
|
1893
1991
|
}
|
|
1894
1992
|
type Validation = {
|
|
1895
1993
|
offerHash: Hex;
|
|
1994
|
+
obligationId: Hex;
|
|
1896
1995
|
status: Status;
|
|
1897
1996
|
};
|
|
1898
1997
|
declare const OfferSchema: () => z$1.ZodObject<{
|
|
@@ -1907,7 +2006,6 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1907
2006
|
group: z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBigInt]>, z$1.ZodTransform<`0x${string}`, string | number | bigint>>;
|
|
1908
2007
|
session: z$1.ZodPipe<z$1.ZodDefault<z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBigInt]>>>, z$1.ZodTransform<`0x${string}`, string | number | bigint>>;
|
|
1909
2008
|
buy: z$1.ZodBoolean;
|
|
1910
|
-
chainId: z$1.ZodNumber;
|
|
1911
2009
|
loanToken: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1912
2010
|
collaterals: z$1.ZodArray<z$1.ZodObject<{
|
|
1913
2011
|
asset: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
@@ -1918,6 +2016,7 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1918
2016
|
address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1919
2017
|
data: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1920
2018
|
}, z$1.core.$strip>;
|
|
2019
|
+
receiverIfMakerIsSeller: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
1921
2020
|
}, z$1.core.$strip>;
|
|
1922
2021
|
/**
|
|
1923
2022
|
* Input type for creating offers. Accepts flexible group types that will be coerced to Hex.
|
|
@@ -1930,12 +2029,12 @@ declare const OfferSchema: () => z$1.ZodObject<{
|
|
|
1930
2029
|
*
|
|
1931
2030
|
* All values validated to be non-negative and within bytes32 range.
|
|
1932
2031
|
*/
|
|
1933
|
-
type OfferInput = Compute<Omit<Offer, "
|
|
1934
|
-
chainId: number;
|
|
2032
|
+
type OfferInput = Compute<Omit<Offer, "group" | "session" | "obligationUnits" | "obligationShares" | "receiverIfMakerIsSeller"> & {
|
|
1935
2033
|
group: Hex | bigint | number | string; /** Optional: defaults to zero bytes32. */
|
|
1936
2034
|
session?: Hex | bigint | number | string; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationShares. */
|
|
1937
2035
|
obligationUnits?: bigint; /** Optional: defaults to 0n. Mutually exclusive with assets and obligationUnits. */
|
|
1938
|
-
obligationShares?: bigint;
|
|
2036
|
+
obligationShares?: bigint; /** Optional: defaults to maker for backward compatibility. */
|
|
2037
|
+
receiverIfMakerIsSeller?: Address;
|
|
1939
2038
|
}>;
|
|
1940
2039
|
/**
|
|
1941
2040
|
* Creates an offer from a plain object.
|
|
@@ -1953,9 +2052,9 @@ declare namespace from$13 {
|
|
|
1953
2052
|
* @param input - The offer to create.
|
|
1954
2053
|
* @returns The created offer.
|
|
1955
2054
|
*/
|
|
1956
|
-
declare function fromSnakeCase$1(input: Snake<Omit<Offer, "
|
|
1957
|
-
|
|
1958
|
-
|
|
2055
|
+
declare function fromSnakeCase$1(input: Snake<Omit<Offer, "session" | "receiverIfMakerIsSeller"> & {
|
|
2056
|
+
session?: Hex;
|
|
2057
|
+
receiverIfMakerIsSeller?: Address;
|
|
1959
2058
|
}>): Offer;
|
|
1960
2059
|
/**
|
|
1961
2060
|
* Converts an offer to a snake case object.
|
|
@@ -1982,7 +2081,6 @@ declare const serialize: (offer: Offer) => {
|
|
|
1982
2081
|
group: `0x${string}`;
|
|
1983
2082
|
session: `0x${string}`;
|
|
1984
2083
|
buy: boolean;
|
|
1985
|
-
chainId: Id;
|
|
1986
2084
|
loanToken: `0x${string}`;
|
|
1987
2085
|
collaterals: {
|
|
1988
2086
|
asset: `0x${string}`;
|
|
@@ -1993,10 +2091,10 @@ declare const serialize: (offer: Offer) => {
|
|
|
1993
2091
|
address: `0x${string}`;
|
|
1994
2092
|
data: `0x${string}`;
|
|
1995
2093
|
};
|
|
2094
|
+
receiverIfMakerIsSeller: `0x${string}`;
|
|
1996
2095
|
hash: `0x${string}`;
|
|
1997
2096
|
};
|
|
1998
2097
|
type RandomConfig = {
|
|
1999
|
-
chains?: Chain$1[];
|
|
2000
2098
|
loanTokens?: Address[];
|
|
2001
2099
|
collateralTokens?: Address[];
|
|
2002
2100
|
assetsDecimals?: Record<Address, number>;
|
|
@@ -2015,6 +2113,7 @@ type RandomConfig = {
|
|
|
2015
2113
|
address: Address;
|
|
2016
2114
|
data: Hex;
|
|
2017
2115
|
};
|
|
2116
|
+
receiverIfMakerIsSeller?: Address;
|
|
2018
2117
|
collaterals?: readonly Collateral[];
|
|
2019
2118
|
};
|
|
2020
2119
|
/**
|
|
@@ -2025,93 +2124,28 @@ type RandomConfig = {
|
|
|
2025
2124
|
*/
|
|
2026
2125
|
declare function random$1(config?: RandomConfig): Offer;
|
|
2027
2126
|
/**
|
|
2028
|
-
*
|
|
2029
|
-
*
|
|
2030
|
-
*
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
chainId: bigint;
|
|
2034
|
-
verifyingContract: "0x0000000000000000000000000000000000000000";
|
|
2035
|
-
};
|
|
2036
|
-
/**
|
|
2037
|
-
* The EIP-712 types for the offer.
|
|
2038
|
-
* @warning The ordering of the types should NEVER be changed. The offer hash is computed based on the order of the types.
|
|
2039
|
-
* @returns The EIP-712 types.
|
|
2127
|
+
* Computes the canonical chain-agnostic offer hash.
|
|
2128
|
+
* The hash is `keccak256(abi.encode(offer))` using {@link encode}.
|
|
2129
|
+
*
|
|
2130
|
+
* @param offer - Offer payload to hash.
|
|
2131
|
+
* @returns 32-byte offer hash.
|
|
2040
2132
|
*/
|
|
2041
|
-
declare const types: {
|
|
2042
|
-
readonly EIP712Domain: readonly [{
|
|
2043
|
-
readonly name: "chainId";
|
|
2044
|
-
readonly type: "uint256";
|
|
2045
|
-
}, {
|
|
2046
|
-
readonly name: "verifyingContract";
|
|
2047
|
-
readonly type: "address";
|
|
2048
|
-
}];
|
|
2049
|
-
readonly Offer: readonly [{
|
|
2050
|
-
readonly name: "maker";
|
|
2051
|
-
readonly type: "address";
|
|
2052
|
-
}, {
|
|
2053
|
-
readonly name: "assets";
|
|
2054
|
-
readonly type: "uint256";
|
|
2055
|
-
}, {
|
|
2056
|
-
readonly name: "obligationUnits";
|
|
2057
|
-
readonly type: "uint256";
|
|
2058
|
-
}, {
|
|
2059
|
-
readonly name: "obligationShares";
|
|
2060
|
-
readonly type: "uint256";
|
|
2061
|
-
}, {
|
|
2062
|
-
readonly name: "tick";
|
|
2063
|
-
readonly type: "uint256";
|
|
2064
|
-
}, {
|
|
2065
|
-
readonly name: "maturity";
|
|
2066
|
-
readonly type: "uint256";
|
|
2067
|
-
}, {
|
|
2068
|
-
readonly name: "expiry";
|
|
2069
|
-
readonly type: "uint256";
|
|
2070
|
-
}, {
|
|
2071
|
-
readonly name: "group";
|
|
2072
|
-
readonly type: "bytes32";
|
|
2073
|
-
}, {
|
|
2074
|
-
readonly name: "session";
|
|
2075
|
-
readonly type: "bytes32";
|
|
2076
|
-
}, {
|
|
2077
|
-
readonly name: "buy";
|
|
2078
|
-
readonly type: "bool";
|
|
2079
|
-
}, {
|
|
2080
|
-
readonly name: "loanToken";
|
|
2081
|
-
readonly type: "address";
|
|
2082
|
-
}, {
|
|
2083
|
-
readonly name: "collaterals";
|
|
2084
|
-
readonly type: "Collateral[]";
|
|
2085
|
-
}, {
|
|
2086
|
-
readonly name: "callback";
|
|
2087
|
-
readonly type: "Callback";
|
|
2088
|
-
}];
|
|
2089
|
-
readonly Collateral: readonly [{
|
|
2090
|
-
readonly name: "asset";
|
|
2091
|
-
readonly type: "address";
|
|
2092
|
-
}, {
|
|
2093
|
-
readonly name: "oracle";
|
|
2094
|
-
readonly type: "address";
|
|
2095
|
-
}, {
|
|
2096
|
-
readonly name: "lltv";
|
|
2097
|
-
readonly type: "uint256";
|
|
2098
|
-
}];
|
|
2099
|
-
readonly Callback: readonly [{
|
|
2100
|
-
readonly name: "address";
|
|
2101
|
-
readonly type: "address";
|
|
2102
|
-
}, {
|
|
2103
|
-
readonly name: "data";
|
|
2104
|
-
readonly type: "bytes";
|
|
2105
|
-
}];
|
|
2106
|
-
};
|
|
2107
2133
|
declare function hash(offer: Offer): Hex;
|
|
2108
2134
|
/**
|
|
2109
|
-
* Calculates the obligation id for an offer
|
|
2110
|
-
* The id is computed
|
|
2135
|
+
* Calculates the onchain obligation id for an offer.
|
|
2136
|
+
* The id is computed with {@link Id.toId}.
|
|
2111
2137
|
* @param offer - The offer to calculate the obligation id for.
|
|
2138
|
+
* @param parameters - The chain context used by the onchain id function.
|
|
2112
2139
|
* @returns The obligation id as a 32-byte hex string.
|
|
2113
2140
|
*/
|
|
2114
|
-
declare function obligationId(offer: Offer):
|
|
2141
|
+
declare function obligationId(offer: Offer, parameters: obligationId.Parameters): obligationId.ReturnType;
|
|
2142
|
+
declare namespace obligationId {
|
|
2143
|
+
type Parameters = {
|
|
2144
|
+
chainId: Id;
|
|
2145
|
+
morphoV2: Address;
|
|
2146
|
+
};
|
|
2147
|
+
type ReturnType = Hex;
|
|
2148
|
+
}
|
|
2115
2149
|
declare function encode$1(offer: Offer): `0x${string}`;
|
|
2116
2150
|
declare function decode$1(data: Hex): Offer;
|
|
2117
2151
|
type OfferConsumed = {
|
|
@@ -2182,41 +2216,200 @@ declare const takeEvent: {
|
|
|
2182
2216
|
readonly name: "sellerIsBorrower";
|
|
2183
2217
|
readonly type: "bool";
|
|
2184
2218
|
readonly indexed: false;
|
|
2185
|
-
readonly internalType: "bool";
|
|
2219
|
+
readonly internalType: "bool";
|
|
2220
|
+
}, {
|
|
2221
|
+
readonly name: "sellerReceiver";
|
|
2222
|
+
readonly type: "address";
|
|
2223
|
+
readonly indexed: false;
|
|
2224
|
+
readonly internalType: "address";
|
|
2225
|
+
}, {
|
|
2226
|
+
readonly name: "group";
|
|
2227
|
+
readonly type: "bytes32";
|
|
2228
|
+
readonly indexed: false;
|
|
2229
|
+
readonly internalType: "bytes32";
|
|
2230
|
+
}, {
|
|
2231
|
+
readonly name: "consumed";
|
|
2232
|
+
readonly type: "uint256";
|
|
2233
|
+
readonly indexed: false;
|
|
2234
|
+
readonly internalType: "uint256";
|
|
2235
|
+
}];
|
|
2236
|
+
readonly anonymous: false;
|
|
2237
|
+
};
|
|
2238
|
+
/**
|
|
2239
|
+
* ABI for the Consume event emitted by the Obligation contract.
|
|
2240
|
+
*/
|
|
2241
|
+
declare const consumedEvent: {
|
|
2242
|
+
readonly type: "event";
|
|
2243
|
+
readonly name: "Consume";
|
|
2244
|
+
readonly inputs: readonly [{
|
|
2245
|
+
readonly name: "user";
|
|
2246
|
+
readonly type: "address";
|
|
2247
|
+
readonly indexed: true;
|
|
2248
|
+
readonly internalType: "address";
|
|
2249
|
+
}, {
|
|
2250
|
+
readonly name: "group";
|
|
2251
|
+
readonly type: "bytes32";
|
|
2252
|
+
readonly indexed: true;
|
|
2253
|
+
readonly internalType: "bytes32";
|
|
2254
|
+
}, {
|
|
2255
|
+
readonly name: "amount";
|
|
2256
|
+
readonly type: "uint256";
|
|
2257
|
+
readonly indexed: false;
|
|
2258
|
+
readonly internalType: "uint256";
|
|
2259
|
+
}];
|
|
2260
|
+
readonly anonymous: false;
|
|
2261
|
+
};
|
|
2262
|
+
/**
|
|
2263
|
+
* ABI for the Repay event emitted by the MorphoV2 contract.
|
|
2264
|
+
*/
|
|
2265
|
+
declare const repayEvent: {
|
|
2266
|
+
readonly type: "event";
|
|
2267
|
+
readonly name: "Repay";
|
|
2268
|
+
readonly inputs: readonly [{
|
|
2269
|
+
readonly name: "caller";
|
|
2270
|
+
readonly type: "address";
|
|
2271
|
+
readonly indexed: true;
|
|
2272
|
+
readonly internalType: "address";
|
|
2273
|
+
}, {
|
|
2274
|
+
readonly name: "id";
|
|
2275
|
+
readonly type: "bytes32";
|
|
2276
|
+
readonly indexed: true;
|
|
2277
|
+
readonly internalType: "bytes32";
|
|
2278
|
+
}, {
|
|
2279
|
+
readonly name: "obligationUnits";
|
|
2280
|
+
readonly type: "uint256";
|
|
2281
|
+
readonly indexed: false;
|
|
2282
|
+
readonly internalType: "uint256";
|
|
2283
|
+
}, {
|
|
2284
|
+
readonly name: "onBehalf";
|
|
2285
|
+
readonly type: "address";
|
|
2286
|
+
readonly indexed: true;
|
|
2287
|
+
readonly internalType: "address";
|
|
2288
|
+
}];
|
|
2289
|
+
readonly anonymous: false;
|
|
2290
|
+
};
|
|
2291
|
+
/**
|
|
2292
|
+
* ABI for the Liquidate event emitted by the MorphoV2 contract.
|
|
2293
|
+
*/
|
|
2294
|
+
declare const liquidateEvent: {
|
|
2295
|
+
readonly type: "event";
|
|
2296
|
+
readonly name: "Liquidate";
|
|
2297
|
+
readonly inputs: readonly [{
|
|
2298
|
+
readonly name: "caller";
|
|
2299
|
+
readonly type: "address";
|
|
2300
|
+
readonly indexed: true;
|
|
2301
|
+
readonly internalType: "address";
|
|
2302
|
+
}, {
|
|
2303
|
+
readonly name: "id";
|
|
2304
|
+
readonly type: "bytes32";
|
|
2305
|
+
readonly indexed: true;
|
|
2306
|
+
readonly internalType: "bytes32";
|
|
2307
|
+
}, {
|
|
2308
|
+
readonly name: "seizures";
|
|
2309
|
+
readonly type: "tuple[]";
|
|
2310
|
+
readonly indexed: false;
|
|
2311
|
+
readonly internalType: "struct IMorphoV2.Seizure[]";
|
|
2312
|
+
readonly components: readonly [{
|
|
2313
|
+
readonly name: "collateralIndex";
|
|
2314
|
+
readonly type: "uint256";
|
|
2315
|
+
readonly internalType: "uint256";
|
|
2316
|
+
}, {
|
|
2317
|
+
readonly name: "repaid";
|
|
2318
|
+
readonly type: "uint256";
|
|
2319
|
+
readonly internalType: "uint256";
|
|
2320
|
+
}, {
|
|
2321
|
+
readonly name: "seized";
|
|
2322
|
+
readonly type: "uint256";
|
|
2323
|
+
readonly internalType: "uint256";
|
|
2324
|
+
}];
|
|
2325
|
+
}, {
|
|
2326
|
+
readonly name: "borrower";
|
|
2327
|
+
readonly type: "address";
|
|
2328
|
+
readonly indexed: true;
|
|
2329
|
+
readonly internalType: "address";
|
|
2330
|
+
}, {
|
|
2331
|
+
readonly name: "totalRepaid";
|
|
2332
|
+
readonly type: "uint256";
|
|
2333
|
+
readonly indexed: false;
|
|
2334
|
+
readonly internalType: "uint256";
|
|
2335
|
+
}, {
|
|
2336
|
+
readonly name: "badDebt";
|
|
2337
|
+
readonly type: "uint256";
|
|
2338
|
+
readonly indexed: false;
|
|
2339
|
+
readonly internalType: "uint256";
|
|
2340
|
+
}];
|
|
2341
|
+
readonly anonymous: false;
|
|
2342
|
+
};
|
|
2343
|
+
/**
|
|
2344
|
+
* ABI for the SupplyCollateral event emitted by the MorphoV2 contract.
|
|
2345
|
+
*/
|
|
2346
|
+
declare const supplyCollateralEvent: {
|
|
2347
|
+
readonly type: "event";
|
|
2348
|
+
readonly name: "SupplyCollateral";
|
|
2349
|
+
readonly inputs: readonly [{
|
|
2350
|
+
readonly name: "caller";
|
|
2351
|
+
readonly type: "address";
|
|
2352
|
+
readonly indexed: false;
|
|
2353
|
+
readonly internalType: "address";
|
|
2186
2354
|
}, {
|
|
2187
|
-
readonly name: "
|
|
2355
|
+
readonly name: "id";
|
|
2188
2356
|
readonly type: "bytes32";
|
|
2189
|
-
readonly indexed:
|
|
2357
|
+
readonly indexed: true;
|
|
2190
2358
|
readonly internalType: "bytes32";
|
|
2191
2359
|
}, {
|
|
2192
|
-
readonly name: "
|
|
2360
|
+
readonly name: "collateral";
|
|
2361
|
+
readonly type: "address";
|
|
2362
|
+
readonly indexed: true;
|
|
2363
|
+
readonly internalType: "address";
|
|
2364
|
+
}, {
|
|
2365
|
+
readonly name: "assets";
|
|
2193
2366
|
readonly type: "uint256";
|
|
2194
2367
|
readonly indexed: false;
|
|
2195
2368
|
readonly internalType: "uint256";
|
|
2369
|
+
}, {
|
|
2370
|
+
readonly name: "onBehalf";
|
|
2371
|
+
readonly type: "address";
|
|
2372
|
+
readonly indexed: true;
|
|
2373
|
+
readonly internalType: "address";
|
|
2196
2374
|
}];
|
|
2197
2375
|
readonly anonymous: false;
|
|
2198
2376
|
};
|
|
2199
2377
|
/**
|
|
2200
|
-
* ABI for the
|
|
2378
|
+
* ABI for the WithdrawCollateral event emitted by the MorphoV2 contract.
|
|
2201
2379
|
*/
|
|
2202
|
-
declare const
|
|
2380
|
+
declare const withdrawCollateralEvent: {
|
|
2203
2381
|
readonly type: "event";
|
|
2204
|
-
readonly name: "
|
|
2382
|
+
readonly name: "WithdrawCollateral";
|
|
2205
2383
|
readonly inputs: readonly [{
|
|
2206
|
-
readonly name: "
|
|
2384
|
+
readonly name: "caller";
|
|
2207
2385
|
readonly type: "address";
|
|
2208
|
-
readonly indexed:
|
|
2386
|
+
readonly indexed: false;
|
|
2209
2387
|
readonly internalType: "address";
|
|
2210
2388
|
}, {
|
|
2211
|
-
readonly name: "
|
|
2389
|
+
readonly name: "id";
|
|
2212
2390
|
readonly type: "bytes32";
|
|
2213
2391
|
readonly indexed: true;
|
|
2214
2392
|
readonly internalType: "bytes32";
|
|
2215
2393
|
}, {
|
|
2216
|
-
readonly name: "
|
|
2394
|
+
readonly name: "collateral";
|
|
2395
|
+
readonly type: "address";
|
|
2396
|
+
readonly indexed: true;
|
|
2397
|
+
readonly internalType: "address";
|
|
2398
|
+
}, {
|
|
2399
|
+
readonly name: "assets";
|
|
2217
2400
|
readonly type: "uint256";
|
|
2218
2401
|
readonly indexed: false;
|
|
2219
2402
|
readonly internalType: "uint256";
|
|
2403
|
+
}, {
|
|
2404
|
+
readonly name: "onBehalf";
|
|
2405
|
+
readonly type: "address";
|
|
2406
|
+
readonly indexed: true;
|
|
2407
|
+
readonly internalType: "address";
|
|
2408
|
+
}, {
|
|
2409
|
+
readonly name: "receiver";
|
|
2410
|
+
readonly type: "address";
|
|
2411
|
+
readonly indexed: false;
|
|
2412
|
+
readonly internalType: "address";
|
|
2220
2413
|
}];
|
|
2221
2414
|
readonly anonymous: false;
|
|
2222
2415
|
};
|
|
@@ -2289,6 +2482,7 @@ declare namespace fromCollateral {
|
|
|
2289
2482
|
declare function fromOffer(parameters: fromOffer.Parameters): fromOffer.ReturnType;
|
|
2290
2483
|
declare namespace fromOffer {
|
|
2291
2484
|
type Parameters = {
|
|
2485
|
+
chainId: Id;
|
|
2292
2486
|
offer: Offer;
|
|
2293
2487
|
blockNumber: number;
|
|
2294
2488
|
price?: bigint | null;
|
|
@@ -2305,6 +2499,7 @@ declare namespace fromOffer {
|
|
|
2305
2499
|
declare function fromOffers(parameters: fromOffers.Parameters): fromOffers.ReturnType;
|
|
2306
2500
|
declare namespace fromOffers {
|
|
2307
2501
|
type Parameters = {
|
|
2502
|
+
chainId: Id;
|
|
2308
2503
|
offers: Offer[];
|
|
2309
2504
|
blockNumber: number;
|
|
2310
2505
|
price?: bigint | null;
|
|
@@ -2343,7 +2538,7 @@ declare namespace Conversion {
|
|
|
2343
2538
|
}): bigint;
|
|
2344
2539
|
}
|
|
2345
2540
|
declare namespace Position_d_exports {
|
|
2346
|
-
export { Position, Type, from$11 as from };
|
|
2541
|
+
export { Position, Type, from$11 as from, positionTypeId };
|
|
2347
2542
|
}
|
|
2348
2543
|
type Position = {
|
|
2349
2544
|
/** The chain id. */chainId: Id;
|
|
@@ -2358,13 +2553,17 @@ type Position = {
|
|
|
2358
2553
|
/** The underlying asset of the position.
|
|
2359
2554
|
* For ERC20 positions, this equals the contract address.
|
|
2360
2555
|
* For vault positions, this is the vault's underlying asset.
|
|
2556
|
+
* For debt positions, this is the zero address (sentinel).
|
|
2557
|
+
* For collateral positions, this is the collateral token address.
|
|
2361
2558
|
*/
|
|
2362
|
-
asset
|
|
2559
|
+
asset: Address; /** The block number at which the position was last updated. */
|
|
2363
2560
|
blockNumber: number;
|
|
2364
2561
|
};
|
|
2365
2562
|
declare enum Type {
|
|
2366
2563
|
ERC20 = "erc20",
|
|
2367
|
-
VAULT_V1 = "vault_v1"
|
|
2564
|
+
VAULT_V1 = "vault_v1",
|
|
2565
|
+
DEBT_OF = "debtOf",
|
|
2566
|
+
COLLATERAL_OF = "collateralOf"
|
|
2368
2567
|
}
|
|
2369
2568
|
/**
|
|
2370
2569
|
* @constructor
|
|
@@ -2380,32 +2579,38 @@ declare namespace from$11 {
|
|
|
2380
2579
|
user: Address;
|
|
2381
2580
|
type: Type;
|
|
2382
2581
|
balance?: bigint;
|
|
2383
|
-
asset
|
|
2582
|
+
asset: Address;
|
|
2384
2583
|
blockNumber: number;
|
|
2385
2584
|
};
|
|
2386
2585
|
type ReturnType = Position;
|
|
2387
2586
|
}
|
|
2587
|
+
/**
|
|
2588
|
+
* Maps a {@link Type} enum value to its 1-based integer ID used in the database.
|
|
2589
|
+
* @param type - The position type.
|
|
2590
|
+
* @returns The 1-based integer ID.
|
|
2591
|
+
*/
|
|
2592
|
+
declare const positionTypeId: (type: Type) => number;
|
|
2388
2593
|
declare namespace Quote_d_exports {
|
|
2389
|
-
export { InvalidQuoteError, Quote,
|
|
2594
|
+
export { InvalidQuoteError, Quote, QuoteInput, Side, from$10 as from, fromSnakeCase, random };
|
|
2390
2595
|
}
|
|
2391
|
-
type
|
|
2596
|
+
type Side = {
|
|
2597
|
+
/** The best side tick, or null when no active quote exists. */tick: number | null; /** The side price for the obligation. (18 decimals). */
|
|
2598
|
+
price: bigint;
|
|
2599
|
+
};
|
|
2600
|
+
type QuoteInput = {
|
|
2392
2601
|
/** The obligation id. */obligationId: Hex;
|
|
2393
2602
|
ask: {
|
|
2394
|
-
/** The ask
|
|
2603
|
+
/** The best ask tick, or null when there is no active ask quote. */tick: number | null;
|
|
2395
2604
|
};
|
|
2396
2605
|
bid: {
|
|
2397
|
-
/** The bid
|
|
2606
|
+
/** The best bid tick, or null when there is no active bid quote. */tick: number | null;
|
|
2398
2607
|
};
|
|
2399
2608
|
};
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
ask:
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
bid: z$1.ZodObject<{
|
|
2406
|
-
price: z$1.ZodBigInt;
|
|
2407
|
-
}, z$1.core.$strip>;
|
|
2408
|
-
}, z$1.core.$strip>;
|
|
2609
|
+
type Quote = {
|
|
2610
|
+
/** The obligation id. */obligationId: Hex;
|
|
2611
|
+
ask: Side;
|
|
2612
|
+
bid: Side;
|
|
2613
|
+
};
|
|
2409
2614
|
/**
|
|
2410
2615
|
* Creates a quote for a given obligation.
|
|
2411
2616
|
* @constructor
|
|
@@ -2415,12 +2620,12 @@ declare const QuoteSchema: z$1.ZodObject<{
|
|
|
2415
2620
|
*
|
|
2416
2621
|
* @example
|
|
2417
2622
|
* ```ts
|
|
2418
|
-
* const quote = Quote.from({ obligationId: "0x123", ask: {
|
|
2623
|
+
* const quote = Quote.from({ obligationId: "0x123", ask: { tick: 500 }, bid: { tick: 510 } });
|
|
2419
2624
|
* ```
|
|
2420
2625
|
*/
|
|
2421
2626
|
declare function from$10(parameters: from$10.Parameters): from$10.ReturnType;
|
|
2422
2627
|
declare namespace from$10 {
|
|
2423
|
-
type Parameters =
|
|
2628
|
+
type Parameters = QuoteInput;
|
|
2424
2629
|
type ReturnType = Quote;
|
|
2425
2630
|
type ErrorType = InvalidQuoteError;
|
|
2426
2631
|
}
|
|
@@ -2432,7 +2637,7 @@ declare namespace from$10 {
|
|
|
2432
2637
|
*/
|
|
2433
2638
|
declare function fromSnakeCase(snake: fromSnakeCase.Parameters): fromSnakeCase.ReturnType;
|
|
2434
2639
|
declare namespace fromSnakeCase {
|
|
2435
|
-
type Parameters = Snake<
|
|
2640
|
+
type Parameters = Snake<QuoteInput>;
|
|
2436
2641
|
type ReturnType = Quote;
|
|
2437
2642
|
type ErrorType = from$10.ErrorType;
|
|
2438
2643
|
}
|
|
@@ -2573,6 +2778,8 @@ type Transfer = {
|
|
|
2573
2778
|
from: Address;
|
|
2574
2779
|
to: Address;
|
|
2575
2780
|
value: bigint;
|
|
2781
|
+
type: Type; /** The underlying asset of the transfer's position. */
|
|
2782
|
+
asset: Address;
|
|
2576
2783
|
blockNumber: number;
|
|
2577
2784
|
};
|
|
2578
2785
|
/**
|
|
@@ -2596,6 +2803,8 @@ declare namespace from$8 {
|
|
|
2596
2803
|
from: Address;
|
|
2597
2804
|
to: Address;
|
|
2598
2805
|
value: bigint;
|
|
2806
|
+
type: Type;
|
|
2807
|
+
asset: Address;
|
|
2599
2808
|
blockNumber: number;
|
|
2600
2809
|
};
|
|
2601
2810
|
type ReturnType = Transfer;
|
|
@@ -2792,7 +3001,7 @@ declare class SignatureDomainError extends BaseError {
|
|
|
2792
3001
|
}
|
|
2793
3002
|
//#endregion
|
|
2794
3003
|
//#region src/indexer/collectors/Collector.d.ts
|
|
2795
|
-
declare const names: readonly ["offers", "
|
|
3004
|
+
declare const names: readonly ["offers", "morpho_v2", "positions", "prices"];
|
|
2796
3005
|
type Name = (typeof names)[number];
|
|
2797
3006
|
/** A general collector interface. */
|
|
2798
3007
|
type Collector<name extends Name = Name, client extends PublicClient<Transport, Chain$1> = PublicClient<Transport, Chain$1>> = {
|
|
@@ -2891,7 +3100,7 @@ declare function getLogger(): Logger;
|
|
|
2891
3100
|
//#region src/database/domains/Offers.d.ts
|
|
2892
3101
|
type CreateBatch = Readonly<{
|
|
2893
3102
|
blockNumber: number;
|
|
2894
|
-
offers:
|
|
3103
|
+
offers: create$7.OfferInput[];
|
|
2895
3104
|
}>;
|
|
2896
3105
|
/**
|
|
2897
3106
|
* Raw row returned by database queries.
|
|
@@ -2899,6 +3108,7 @@ type CreateBatch = Readonly<{
|
|
|
2899
3108
|
*/
|
|
2900
3109
|
type Row = {
|
|
2901
3110
|
hash: Hex;
|
|
3111
|
+
obligationId: Hex;
|
|
2902
3112
|
maker: Address;
|
|
2903
3113
|
assets: bigint;
|
|
2904
3114
|
obligationUnits: bigint;
|
|
@@ -2917,13 +3127,18 @@ type Row = {
|
|
|
2917
3127
|
address: Address;
|
|
2918
3128
|
data: Hex;
|
|
2919
3129
|
};
|
|
3130
|
+
receiverIfMakerIsSeller: Address;
|
|
2920
3131
|
consumed: bigint;
|
|
2921
3132
|
available: bigint;
|
|
2922
3133
|
takeable: bigint;
|
|
2923
3134
|
blockNumber: number;
|
|
2924
3135
|
};
|
|
3136
|
+
type OfferReference$1 = {
|
|
3137
|
+
hash: Hex;
|
|
3138
|
+
obligationId: Hex;
|
|
3139
|
+
};
|
|
2925
3140
|
type OffersDomain = {
|
|
2926
|
-
/** Insert offers (insert-only). */create: (batches: CreateBatch[]) => Promise<
|
|
3141
|
+
/** Insert offers (insert-only). */create: (batches: CreateBatch[]) => Promise<OfferReference$1[]>;
|
|
2927
3142
|
/** Delete multiple offers by hashes or block number greater than or equal to the given value on a given chain.
|
|
2928
3143
|
* @returns the number of offers deleted.
|
|
2929
3144
|
*/
|
|
@@ -2936,18 +3151,6 @@ type OffersDomain = {
|
|
|
2936
3151
|
get: (parameters?: GetOffersParams) => Promise<{
|
|
2937
3152
|
rows: Row[];
|
|
2938
3153
|
nextCursor: string | null;
|
|
2939
|
-
}>; /** Get obligations */
|
|
2940
|
-
getObligations: (parameters?: {
|
|
2941
|
-
ids?: Hex[];
|
|
2942
|
-
chainId?: Id[];
|
|
2943
|
-
loanToken?: Address[];
|
|
2944
|
-
collateralToken?: Address[];
|
|
2945
|
-
maturity?: number[];
|
|
2946
|
-
cursor?: string;
|
|
2947
|
-
limit?: number;
|
|
2948
|
-
}) => Promise<{
|
|
2949
|
-
obligations: Obligation[];
|
|
2950
|
-
nextCursor: string | null;
|
|
2951
3154
|
}>; /** Get quotes for given obligations. */
|
|
2952
3155
|
getQuotes: (parameters: {
|
|
2953
3156
|
obligationIds: Hex[];
|
|
@@ -2960,13 +3163,23 @@ type PaginationParams$1 = {
|
|
|
2960
3163
|
type GetOffersParams = {
|
|
2961
3164
|
/** Filter by maker address */maker?: Address;
|
|
2962
3165
|
} & PaginationParams$1;
|
|
3166
|
+
declare function create$7(config: {
|
|
3167
|
+
db: Core;
|
|
3168
|
+
}): OffersDomain;
|
|
3169
|
+
declare namespace create$7 {
|
|
3170
|
+
type OfferInput = {
|
|
3171
|
+
offer: Offer;
|
|
3172
|
+
obligationId: Hex;
|
|
3173
|
+
chainId: Id;
|
|
3174
|
+
};
|
|
3175
|
+
}
|
|
2963
3176
|
//#endregion
|
|
2964
3177
|
//#region src/database/domains/Book.d.ts
|
|
2965
3178
|
type BookDomain = {
|
|
2966
|
-
/** Get aggregated book levels for a given obligation side. */get: (parameters: get$
|
|
3179
|
+
/** Get aggregated book levels for a given obligation side. */get: (parameters: get$5.Parameters) => Promise<get$5.ReturnType>; /** Get all offers for a given obligation side with cross-invalidation. */
|
|
2967
3180
|
getOffers: (parameters: getOffers$2.Parameters) => Promise<getOffers$2.ReturnType>;
|
|
2968
3181
|
};
|
|
2969
|
-
declare namespace get$
|
|
3182
|
+
declare namespace get$5 {
|
|
2970
3183
|
type Parameters = {
|
|
2971
3184
|
/** The side of the offer. */side: "buy" | "sell"; /** The obligationId of the offer. */
|
|
2972
3185
|
obligationId: Hex; /** Cursor string returned by a previous call, for pagination */
|
|
@@ -3002,9 +3215,11 @@ type CallbackInput = {
|
|
|
3002
3215
|
contract: Address;
|
|
3003
3216
|
user: Address;
|
|
3004
3217
|
amount: bigint;
|
|
3218
|
+
positionTypeId: number;
|
|
3005
3219
|
};
|
|
3006
3220
|
type OfferCallbacks = {
|
|
3007
3221
|
offerHash: Hex;
|
|
3222
|
+
obligationId: Hex;
|
|
3008
3223
|
callbacks: CallbackInput[];
|
|
3009
3224
|
};
|
|
3010
3225
|
type CallbacksDomain = {
|
|
@@ -3074,18 +3289,20 @@ type LotsDomain = {
|
|
|
3074
3289
|
* Called when offers are created to reserve liquidity on positions.
|
|
3075
3290
|
* For each (position, group), keeps only the biggest offer by assets.
|
|
3076
3291
|
* If lot exists and new offer is bigger, grows the lot and shifts higher lots.
|
|
3292
|
+
* Automatically upserts lots_positions bridge rows before inserting lots.
|
|
3077
3293
|
*/
|
|
3078
|
-
create: (parameters: create$
|
|
3294
|
+
create: (parameters: create$6.Parameters) => Promise<void>;
|
|
3079
3295
|
/**
|
|
3080
3296
|
* Get lots with optional filtering.
|
|
3081
3297
|
*/
|
|
3082
|
-
get: (parameters?: get$
|
|
3298
|
+
get: (parameters?: get$4.Parameters) => Promise<Lot[]>;
|
|
3083
3299
|
};
|
|
3084
|
-
declare namespace create$
|
|
3300
|
+
declare namespace create$6 {
|
|
3085
3301
|
type OfferLotInfo = {
|
|
3086
3302
|
positionChainId: Id;
|
|
3087
3303
|
positionContract: Address;
|
|
3088
3304
|
positionUser: Address;
|
|
3305
|
+
positionTypeId: number;
|
|
3089
3306
|
group: string;
|
|
3090
3307
|
obligationId: string;
|
|
3091
3308
|
size: bigint;
|
|
@@ -3093,7 +3310,7 @@ declare namespace create$5 {
|
|
|
3093
3310
|
type Parameters = OfferLotInfo[];
|
|
3094
3311
|
type ReturnType = undefined;
|
|
3095
3312
|
}
|
|
3096
|
-
declare namespace get$
|
|
3313
|
+
declare namespace get$4 {
|
|
3097
3314
|
type Parameters = {
|
|
3098
3315
|
chainId?: Id;
|
|
3099
3316
|
user?: Address;
|
|
@@ -3103,16 +3320,46 @@ declare namespace get$3 {
|
|
|
3103
3320
|
};
|
|
3104
3321
|
type ReturnType = Lot[];
|
|
3105
3322
|
}
|
|
3106
|
-
declare function create$
|
|
3323
|
+
declare function create$6(db: Core): LotsDomain;
|
|
3107
3324
|
//#endregion
|
|
3108
3325
|
//#region src/database/domains/Obligations.d.ts
|
|
3109
3326
|
type ObligationsDomain = {
|
|
3110
3327
|
/**
|
|
3111
|
-
* Insert obligations (insert-only).
|
|
3112
|
-
* @param obligations - Obligations to insert.
|
|
3328
|
+
* Insert obligations and their onchain obligation id keys (insert-only).
|
|
3329
|
+
* @param obligations - Obligations to insert.
|
|
3330
|
+
*/
|
|
3331
|
+
create: (obligations: create$5.Input[]) => Promise<void>;
|
|
3332
|
+
/**
|
|
3333
|
+
* Get active obligations with optional chain filters.
|
|
3334
|
+
* @param parameters - Optional chain filters.
|
|
3335
|
+
* @returns Matching obligations.
|
|
3113
3336
|
*/
|
|
3114
|
-
|
|
3337
|
+
get: (parameters?: {
|
|
3338
|
+
chainId?: Id[];
|
|
3339
|
+
}) => Promise<get$3.Output[]>;
|
|
3115
3340
|
};
|
|
3341
|
+
/**
|
|
3342
|
+
* Create an obligations domain instance.
|
|
3343
|
+
* @param db - Database core instance.
|
|
3344
|
+
* @returns Obligations domain. {@link ObligationsDomain}
|
|
3345
|
+
*/
|
|
3346
|
+
declare function create$5(db: Core): ObligationsDomain;
|
|
3347
|
+
declare namespace create$5 {
|
|
3348
|
+
type Input = {
|
|
3349
|
+
obligationId: Hex;
|
|
3350
|
+
chainId: Id;
|
|
3351
|
+
morphoV2: Address;
|
|
3352
|
+
obligation: Obligation$1;
|
|
3353
|
+
};
|
|
3354
|
+
}
|
|
3355
|
+
declare namespace get$3 {
|
|
3356
|
+
type Output = {
|
|
3357
|
+
obligationId: Hex;
|
|
3358
|
+
chainId: Id;
|
|
3359
|
+
morphoV2: Address;
|
|
3360
|
+
obligation: Obligation$1;
|
|
3361
|
+
};
|
|
3362
|
+
}
|
|
3116
3363
|
//#endregion
|
|
3117
3364
|
//#region src/database/domains/Offsets.d.ts
|
|
3118
3365
|
type Offset = {
|
|
@@ -3185,7 +3432,7 @@ type PositionsDomain = {
|
|
|
3185
3432
|
*/
|
|
3186
3433
|
getByUser: (parameters: getByUser.Parameters) => Promise<getByUser.ReturnType>;
|
|
3187
3434
|
/**
|
|
3188
|
-
* Set all positions to empty after a given block number (inclusive), deletes all transfers linked to the positions.
|
|
3435
|
+
* Set all positions of a given type to empty after a given block number (inclusive), deletes all transfers linked to the positions.
|
|
3189
3436
|
* @param parameters - {@link setEmptyAfter.Parameters}
|
|
3190
3437
|
* @returns The number of positions set to empty. {@link setEmptyAfter.ReturnType}
|
|
3191
3438
|
*/
|
|
@@ -3208,7 +3455,8 @@ declare namespace get$1 {
|
|
|
3208
3455
|
}
|
|
3209
3456
|
declare namespace getByUser {
|
|
3210
3457
|
type Parameters = PaginationParams & {
|
|
3211
|
-
/** The user address to get positions for. */user: Address;
|
|
3458
|
+
/** The user address to get positions for. */user: Address; /** The type of position to get. Default is all types. */
|
|
3459
|
+
type?: Type;
|
|
3212
3460
|
};
|
|
3213
3461
|
type PositionWithReserved = {
|
|
3214
3462
|
chainId: Id;
|
|
@@ -3225,8 +3473,9 @@ declare namespace getByUser {
|
|
|
3225
3473
|
}
|
|
3226
3474
|
declare namespace setEmptyAfter {
|
|
3227
3475
|
type Parameters = {
|
|
3228
|
-
/** The chain id
|
|
3229
|
-
blockNumber: number;
|
|
3476
|
+
/** The chain id. */chainId: Id; /** The block number after which all positions should be set to empty. (inclusive) */
|
|
3477
|
+
blockNumber: number; /** The position type to target. */
|
|
3478
|
+
type: Type;
|
|
3230
3479
|
};
|
|
3231
3480
|
type ReturnType = number;
|
|
3232
3481
|
}
|
|
@@ -3239,11 +3488,26 @@ type TransfersDomain = {
|
|
|
3239
3488
|
* @returns The number of transfers created. {@link create.ReturnType}
|
|
3240
3489
|
*/
|
|
3241
3490
|
create: (transfers: create$4.Parameters) => Promise<create$4.ReturnType>;
|
|
3491
|
+
/**
|
|
3492
|
+
* Delete transfers by chain, position type, and block number >= given value (for reorg rollback).
|
|
3493
|
+
* Reverses balance deltas on affected positions and cleans up orphan positions.
|
|
3494
|
+
* @param parameters - {@link del.Parameters}
|
|
3495
|
+
* @returns The number of transfers deleted. {@link del.ReturnType}
|
|
3496
|
+
*/
|
|
3497
|
+
delete: (parameters: del.Parameters) => Promise<del.ReturnType>;
|
|
3242
3498
|
};
|
|
3243
3499
|
declare namespace create$4 {
|
|
3244
3500
|
type Parameters = Transfer[];
|
|
3245
3501
|
type ReturnType = number;
|
|
3246
3502
|
}
|
|
3503
|
+
declare namespace del {
|
|
3504
|
+
type Parameters = {
|
|
3505
|
+
chainId: Id;
|
|
3506
|
+
blockNumberGte: number;
|
|
3507
|
+
positionTypeId: number;
|
|
3508
|
+
};
|
|
3509
|
+
type ReturnType = number;
|
|
3510
|
+
}
|
|
3247
3511
|
declare const create$4: (db: Core) => TransfersDomain;
|
|
3248
3512
|
//#endregion
|
|
3249
3513
|
//#region src/database/domains/Trees.d.ts
|
|
@@ -3258,25 +3522,41 @@ type Attestation = {
|
|
|
3258
3522
|
/**
|
|
3259
3523
|
* Input for creating trees with their signatures.
|
|
3260
3524
|
*/
|
|
3261
|
-
type
|
|
3262
|
-
|
|
3525
|
+
type UpsertInput = {
|
|
3526
|
+
root: Hex;
|
|
3263
3527
|
signature: Hex;
|
|
3264
3528
|
};
|
|
3529
|
+
type UpsertPathsInput = {
|
|
3530
|
+
offerHash: Hex;
|
|
3531
|
+
obligationId: Hex;
|
|
3532
|
+
treeRoot: Hex;
|
|
3533
|
+
proof: Hex[];
|
|
3534
|
+
};
|
|
3535
|
+
type OfferReference = {
|
|
3536
|
+
offerHash: Hex;
|
|
3537
|
+
obligationId: Hex;
|
|
3538
|
+
};
|
|
3265
3539
|
type TreesDomain = {
|
|
3266
3540
|
/**
|
|
3267
|
-
* Creates
|
|
3541
|
+
* Creates or updates merkle roots and signatures.
|
|
3542
|
+
*
|
|
3543
|
+
* @param trees - Array of merkle root attestations
|
|
3544
|
+
* @returns Array of tree roots that were upserted
|
|
3545
|
+
*/
|
|
3546
|
+
upsert: (trees: UpsertInput[]) => Promise<Hex[]>;
|
|
3547
|
+
/**
|
|
3548
|
+
* Creates or updates merkle proofs for offers.
|
|
3268
3549
|
*
|
|
3269
|
-
* @param
|
|
3270
|
-
* @returns Array of tree roots that were created/upserted
|
|
3550
|
+
* @param paths - Array of offer proof rows
|
|
3271
3551
|
*/
|
|
3272
|
-
|
|
3552
|
+
upsertPaths: (paths: UpsertPathsInput[]) => Promise<void>;
|
|
3273
3553
|
/**
|
|
3274
3554
|
* Retrieves merkle attestations for execution flow.
|
|
3275
3555
|
*
|
|
3276
|
-
* @param
|
|
3277
|
-
* @returns Map of offer
|
|
3556
|
+
* @param references - Array of offer references to look up
|
|
3557
|
+
* @returns Map of serialized offer key (`offerHash:obligationId`) to attestation
|
|
3278
3558
|
*/
|
|
3279
|
-
getAttestations: (
|
|
3559
|
+
getAttestations: (references: OfferReference[]) => Promise<Map<string, Attestation>>;
|
|
3280
3560
|
};
|
|
3281
3561
|
//#endregion
|
|
3282
3562
|
//#region src/database/domains/Validations.d.ts
|
|
@@ -3303,6 +3583,36 @@ type ValidationsDomain = {
|
|
|
3303
3583
|
*/
|
|
3304
3584
|
upsert: (validations: Validation[]) => Promise<void>;
|
|
3305
3585
|
};
|
|
3586
|
+
//#endregion
|
|
3587
|
+
//#region src/database/readers/ObligationsListing.d.ts
|
|
3588
|
+
type ListObligationsParameters = {
|
|
3589
|
+
ids?: Hex[];
|
|
3590
|
+
chainId?: Id[];
|
|
3591
|
+
loanToken?: Address[];
|
|
3592
|
+
collateralToken?: Address[];
|
|
3593
|
+
maturity?: number[];
|
|
3594
|
+
sort?: string[];
|
|
3595
|
+
cursor?: string;
|
|
3596
|
+
limit?: number;
|
|
3597
|
+
};
|
|
3598
|
+
type ListedObligation = {
|
|
3599
|
+
obligationId: Hex;
|
|
3600
|
+
chainId: Id;
|
|
3601
|
+
obligation: Obligation$1;
|
|
3602
|
+
quote: Quote;
|
|
3603
|
+
};
|
|
3604
|
+
type ListObligationsResult = {
|
|
3605
|
+
obligations: ListedObligation[];
|
|
3606
|
+
nextCursor: string | null;
|
|
3607
|
+
};
|
|
3608
|
+
type ObligationsListingReader = {
|
|
3609
|
+
/**
|
|
3610
|
+
* Lists obligations with SQL keyset pagination and opaque cursor handling.
|
|
3611
|
+
* @param parameters - Optional filters, sorting, and pagination cursor.
|
|
3612
|
+
* @returns Listed obligations with associated quotes and a next cursor.
|
|
3613
|
+
*/
|
|
3614
|
+
list: (parameters?: ListObligationsParameters) => Promise<ListObligationsResult>;
|
|
3615
|
+
};
|
|
3306
3616
|
declare namespace Database_d_exports {
|
|
3307
3617
|
export { Core, Database, Driver, WithDomains, connect$2 as connect, getSchemaNamesForMigration };
|
|
3308
3618
|
}
|
|
@@ -3323,7 +3633,13 @@ type Domains = {
|
|
|
3323
3633
|
positions: PositionsDomain;
|
|
3324
3634
|
transfers: TransfersDomain;
|
|
3325
3635
|
};
|
|
3326
|
-
type
|
|
3636
|
+
type Readers = {
|
|
3637
|
+
obligations: ObligationsListingReader;
|
|
3638
|
+
};
|
|
3639
|
+
type DatabaseFacade = Domains & {
|
|
3640
|
+
readers: Readers;
|
|
3641
|
+
};
|
|
3642
|
+
type WithDomains<D extends Driver> = D & DatabaseFacade;
|
|
3327
3643
|
type Core = Omit<WithDomains<Driver>, "transaction"> & {
|
|
3328
3644
|
transaction<T>(fn: (tx: WithDomains<Driver>) => Promise<T>): Promise<T>;
|
|
3329
3645
|
};
|
|
@@ -3488,7 +3804,10 @@ type GatekeeperClient = {
|
|
|
3488
3804
|
statusCode: number;
|
|
3489
3805
|
body: ConfigRulesPayload;
|
|
3490
3806
|
}>; /** Validate offers and return decision results. */
|
|
3491
|
-
isAllowed: (
|
|
3807
|
+
isAllowed: (parameters: {
|
|
3808
|
+
offers: Offer[];
|
|
3809
|
+
chainId: number;
|
|
3810
|
+
}) => Promise<Result<Offer, string>>; /** Base URL for the gatekeeper service. */
|
|
3492
3811
|
baseUrl: string;
|
|
3493
3812
|
};
|
|
3494
3813
|
type ClientConfig = {
|
|
@@ -3943,11 +4262,16 @@ interface paths {
|
|
|
3943
4262
|
};
|
|
3944
4263
|
/**
|
|
3945
4264
|
* List all obligations
|
|
3946
|
-
* @description Returns a list of obligations with their current best ask and bid.
|
|
4265
|
+
* @description Returns a list of obligations with their current best ask and bid. Sorting is customizable with the sort parameter and defaults to id ascending.
|
|
3947
4266
|
*/
|
|
3948
4267
|
get: {
|
|
3949
4268
|
parameters: {
|
|
3950
4269
|
query?: {
|
|
4270
|
+
/**
|
|
4271
|
+
* @description Sort order as comma-separated fields (`id`, `ask`, `bid`, `maturity`). Prefix with `-` for descending order. Max 3 fields.
|
|
4272
|
+
* @example -ask,bid,maturity
|
|
4273
|
+
*/
|
|
4274
|
+
sort?: string;
|
|
3951
4275
|
/**
|
|
3952
4276
|
* @description Filter by exact maturity timestamps (comma-separated, unix seconds).
|
|
3953
4277
|
* @example 1761922800,1764524800
|
|
@@ -3974,8 +4298,8 @@ interface paths {
|
|
|
3974
4298
|
*/
|
|
3975
4299
|
limit?: number;
|
|
3976
4300
|
/**
|
|
3977
|
-
* @description
|
|
3978
|
-
* @example
|
|
4301
|
+
* @description Pagination cursor in base64url-encoded format.
|
|
4302
|
+
* @example eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAiLCJhc2siOiIwIiwiYmlkIjoiMCIsIm1hdHVyaXR5IjoxNzYxOTIyODAwfQ
|
|
3979
4303
|
*/
|
|
3980
4304
|
cursor?: string;
|
|
3981
4305
|
};
|
|
@@ -4460,7 +4784,8 @@ interface components {
|
|
|
4460
4784
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
4461
4785
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
4462
4786
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
4463
|
-
* "callback_data": "0x"
|
|
4787
|
+
* "callback_data": "0x",
|
|
4788
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4464
4789
|
* },
|
|
4465
4790
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
4466
4791
|
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc",
|
|
@@ -4504,7 +4829,8 @@ interface components {
|
|
|
4504
4829
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
4505
4830
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
4506
4831
|
* "callback": "0x0000000000000000000000000000000000000000",
|
|
4507
|
-
* "callback_data": "0x"
|
|
4832
|
+
* "callback_data": "0x",
|
|
4833
|
+
* "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
|
|
4508
4834
|
* }
|
|
4509
4835
|
*/
|
|
4510
4836
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
@@ -4550,7 +4876,8 @@ interface components {
|
|
|
4550
4876
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
4551
4877
|
session: string; /** @example 0x0000000000000000000000000000000000000000 */
|
|
4552
4878
|
callback: string; /** @example 0x */
|
|
4553
|
-
callback_data: string;
|
|
4879
|
+
callback_data: string; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
4880
|
+
receiver_if_maker_is_seller: string;
|
|
4554
4881
|
};
|
|
4555
4882
|
ObligationOfferResponse: {
|
|
4556
4883
|
/** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */loan_token: string;
|
|
@@ -4572,7 +4899,7 @@ interface components {
|
|
|
4572
4899
|
oracle: string;
|
|
4573
4900
|
};
|
|
4574
4901
|
ObligationListResponse: {
|
|
4575
|
-
meta: components["schemas"]["Meta"]; /** @example
|
|
4902
|
+
meta: components["schemas"]["Meta"]; /** @example eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAiLCJhc2siOiIwIiwiYmlkIjoiMCIsIm1hdHVyaXR5IjoxNzYxOTIyODAwfQ */
|
|
4576
4903
|
cursor: string | null; /** @description List of obligations with takable offers. */
|
|
4577
4904
|
data: components["schemas"]["ObligationResponse"][];
|
|
4578
4905
|
};
|
|
@@ -4586,10 +4913,20 @@ interface components {
|
|
|
4586
4913
|
bid: components["schemas"]["BidResponse"];
|
|
4587
4914
|
};
|
|
4588
4915
|
AskResponse: {
|
|
4589
|
-
/**
|
|
4916
|
+
/**
|
|
4917
|
+
* @description Best ask tick. Null when there is no active ask quote.
|
|
4918
|
+
* @example 500
|
|
4919
|
+
*/
|
|
4920
|
+
tick: number | null; /** @example 1000000000000000000 */
|
|
4921
|
+
price: string;
|
|
4590
4922
|
};
|
|
4591
4923
|
BidResponse: {
|
|
4592
|
-
/**
|
|
4924
|
+
/**
|
|
4925
|
+
* @description Best bid tick. Null when there is no active bid quote.
|
|
4926
|
+
* @example 500
|
|
4927
|
+
*/
|
|
4928
|
+
tick: number | null; /** @example 1000000000000000000 */
|
|
4929
|
+
price: string;
|
|
4593
4930
|
};
|
|
4594
4931
|
ObligationSingleSuccessResponse: {
|
|
4595
4932
|
meta: components["schemas"]["Meta"]; /** @example null */
|
|
@@ -4716,7 +5053,12 @@ interface components {
|
|
|
4716
5053
|
block_number: number;
|
|
4717
5054
|
};
|
|
4718
5055
|
ValidateOffersRequest: {
|
|
4719
|
-
/**
|
|
5056
|
+
/**
|
|
5057
|
+
* @description Chain id used for chain-scoped validation rules.
|
|
5058
|
+
* @example 1
|
|
5059
|
+
*/
|
|
5060
|
+
chain_id: number; /** @description Array of offers in snake_case format. Required, non-empty. */
|
|
5061
|
+
offers: components["schemas"]["ValidateOfferRequest"][];
|
|
4720
5062
|
};
|
|
4721
5063
|
ValidateOfferRequest: {
|
|
4722
5064
|
/** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */maker: string; /** @example 369216000000000000000000 */
|
|
@@ -4729,8 +5071,7 @@ interface components {
|
|
|
4729
5071
|
start: number; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
4730
5072
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
4731
5073
|
session: string; /** @example false */
|
|
4732
|
-
buy: boolean; /** @example
|
|
4733
|
-
chain_id: number; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
5074
|
+
buy: boolean; /** @example 0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078 */
|
|
4734
5075
|
loan_token: string;
|
|
4735
5076
|
/**
|
|
4736
5077
|
* @example [
|
|
@@ -4748,7 +5089,8 @@ interface components {
|
|
|
4748
5089
|
* "data": "0x"
|
|
4749
5090
|
* }
|
|
4750
5091
|
*/
|
|
4751
|
-
callback: components["schemas"]["ValidateCallbackRequest"];
|
|
5092
|
+
callback: components["schemas"]["ValidateCallbackRequest"]; /** @example 0x7b093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
5093
|
+
receiver_if_maker_is_seller: string;
|
|
4752
5094
|
};
|
|
4753
5095
|
ValidateCollateralRequest: {
|
|
4754
5096
|
/** @example 0x34Cf890dB685FC536E05652FB41f02090c3fb751 */asset: string; /** @example 0x45093658BE7f90B63D7c359e8f408e503c2D9401 */
|
|
@@ -4791,15 +5133,18 @@ type ObligationResponse = paths["/v1/obligations"]["get"]["responses"]["200"]["c
|
|
|
4791
5133
|
* Creates an `ObligationResponse` from a `Obligation`.
|
|
4792
5134
|
* @constructor
|
|
4793
5135
|
* @param obligation - {@link Obligation}
|
|
5136
|
+
* @param quote - {@link Quote}
|
|
5137
|
+
* @param chainId - The chain id used to compute `id`.
|
|
4794
5138
|
* @returns The created `ObligationResponse`. {@link ObligationResponse}
|
|
4795
5139
|
*/
|
|
4796
|
-
declare function from$3(obligation: Obligation, quote: Quote): ObligationResponse;
|
|
5140
|
+
declare function from$3(obligation: Obligation$1, quote: Quote, chainId: Id): ObligationResponse;
|
|
4797
5141
|
declare namespace OfferResponse_d_exports {
|
|
4798
5142
|
export { Input, OfferResponse, from$2 as from };
|
|
4799
5143
|
}
|
|
4800
5144
|
type OfferResponse = paths["/v1/offers"]["get"]["responses"]["200"]["content"]["application/json"]["data"][number];
|
|
4801
5145
|
type Input = Readonly<{
|
|
4802
5146
|
hash: Hex;
|
|
5147
|
+
obligationId: Hex;
|
|
4803
5148
|
maker: Address;
|
|
4804
5149
|
assets: bigint;
|
|
4805
5150
|
obligationUnits: bigint;
|
|
@@ -4822,6 +5167,7 @@ type Input = Readonly<{
|
|
|
4822
5167
|
address: Address;
|
|
4823
5168
|
data: Hex;
|
|
4824
5169
|
};
|
|
5170
|
+
receiverIfMakerIsSeller: Address;
|
|
4825
5171
|
root?: Hex | undefined;
|
|
4826
5172
|
proof?: Hex[] | undefined;
|
|
4827
5173
|
signature?: Hex | undefined;
|
|
@@ -4956,6 +5302,7 @@ declare const schemas: {
|
|
|
4956
5302
|
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>>>>>;
|
|
4957
5303
|
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>>>>>;
|
|
4958
5304
|
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>>>>>;
|
|
5305
|
+
sort: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<{} | null | undefined, unknown>, z$1.ZodArray<z$1.ZodString>>>;
|
|
4959
5306
|
limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodPipe<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>, z$1.ZodNumber>>>;
|
|
4960
5307
|
}, z$1.core.$strip>;
|
|
4961
5308
|
readonly get_obligation: z$1.ZodObject<{
|
|
@@ -4971,6 +5318,7 @@ declare const schemas: {
|
|
|
4971
5318
|
limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodPipe<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<number, string>>, z$1.ZodNumber>>>;
|
|
4972
5319
|
}, z$1.core.$strip>;
|
|
4973
5320
|
readonly validate_offers: z$1.ZodObject<{
|
|
5321
|
+
chain_id: z$1.ZodNumber;
|
|
4974
5322
|
offers: z$1.ZodArray<z$1.ZodUnknown>;
|
|
4975
5323
|
}, z$1.core.$strict>;
|
|
4976
5324
|
readonly get_user_positions: z$1.ZodObject<{
|
|
@@ -5102,14 +5450,18 @@ declare function getOffers$1(queryParameters: object, db: Database): Promise<Pay
|
|
|
5102
5450
|
*/
|
|
5103
5451
|
declare function getUserPositions(queryParameters: object, db: Database): Promise<Payload<PositionResponse[]>>;
|
|
5104
5452
|
declare namespace Gatekeeper_d_exports {
|
|
5105
|
-
export { Gatekeeper, Rules, create };
|
|
5453
|
+
export { Gatekeeper, Rules, RulesFactory, create };
|
|
5106
5454
|
}
|
|
5107
5455
|
type Rules = readonly Rule<Offer, string>[];
|
|
5456
|
+
type RulesFactory = (chainId: Id) => Rules;
|
|
5108
5457
|
type Gatekeeper = {
|
|
5109
|
-
isAllowed: (
|
|
5458
|
+
isAllowed: (parameters: {
|
|
5459
|
+
offers: Offer[];
|
|
5460
|
+
chainId: Id;
|
|
5461
|
+
}) => Promise<Result<Offer, string>>;
|
|
5110
5462
|
};
|
|
5111
5463
|
type GatekeeperParameters = {
|
|
5112
|
-
rules:
|
|
5464
|
+
rules: RulesFactory;
|
|
5113
5465
|
};
|
|
5114
5466
|
/**
|
|
5115
5467
|
* Create a gatekeeper instance with the provided rules.
|
|
@@ -5226,18 +5578,22 @@ declare namespace getOffers {
|
|
|
5226
5578
|
}
|
|
5227
5579
|
declare function getObligations(apiClient: Client$1<paths>, parameters?: getObligations.Parameters): Promise<getObligations.ReturnType>;
|
|
5228
5580
|
declare namespace getObligations {
|
|
5581
|
+
type SortField = "id" | "ask" | "bid" | "maturity";
|
|
5582
|
+
type SortEntry = SortField | `-${SortField}`;
|
|
5229
5583
|
type Parameters = {
|
|
5230
|
-
/** Pagination cursor
|
|
5584
|
+
/** Pagination cursor in base64url-encoded format. */cursor?: string; /** Maximum number of obligations to return. @default 20 */
|
|
5231
5585
|
limit?: number; /** Filter by chain IDs (comma-separated). */
|
|
5232
5586
|
chainIds?: number[]; /** Filter by loan token addresses (comma-separated). */
|
|
5233
5587
|
loanTokens?: Address[]; /** Filter by collateral tokens (comma-separated, matches any collateral). */
|
|
5234
5588
|
collateralTokens?: Address[]; /** Filter by exact maturity timestamps (comma-separated, unix seconds). */
|
|
5235
|
-
maturities?: number[];
|
|
5589
|
+
maturities?: number[]; /** Sort order entries in priority order. Prefix with '-' for descending. Max 3 fields. */
|
|
5590
|
+
sort?: SortEntry[];
|
|
5236
5591
|
};
|
|
5237
5592
|
type ReturnType = {
|
|
5238
5593
|
obligations: Compute<{
|
|
5239
|
-
/** The obligation id
|
|
5240
|
-
|
|
5594
|
+
/** The obligation id returned by the API. */id: Hex; /** The chain id used to compute the obligation id. */
|
|
5595
|
+
chainId: Id;
|
|
5596
|
+
} & Obligation$1 & Omit<Quote, "obligationId">>[]; /** The pagination cursor. */
|
|
5241
5597
|
cursor: string | null;
|
|
5242
5598
|
};
|
|
5243
5599
|
type ErrorType = GetApiErrorType;
|
|
@@ -5269,11 +5625,12 @@ declare class HttpGetApiFailedError extends BaseError {
|
|
|
5269
5625
|
}
|
|
5270
5626
|
//#endregion
|
|
5271
5627
|
//#region src/database/drizzle/VERSION.d.ts
|
|
5272
|
-
declare const VERSION: "router_v1.
|
|
5628
|
+
declare const VERSION: "router_v1.11";
|
|
5273
5629
|
//#endregion
|
|
5274
5630
|
//#region src/database/drizzle/schema.d.ts
|
|
5275
5631
|
declare enum EnumTableName {
|
|
5276
5632
|
OBLIGATIONS = "obligations",
|
|
5633
|
+
OBLIGATION_ID_KEYS = "obligation_id_keys",
|
|
5277
5634
|
GROUPS = "groups",
|
|
5278
5635
|
CONSUMED_EVENTS = "consumed_events",
|
|
5279
5636
|
OBLIGATION_COLLATERALS_V2 = "obligation_collaterals_v2",
|
|
@@ -5287,20 +5644,21 @@ declare enum EnumTableName {
|
|
|
5287
5644
|
COLLECTORS = "collectors",
|
|
5288
5645
|
CHAINS = "chains",
|
|
5289
5646
|
LOTS = "lots",
|
|
5647
|
+
LOTS_POSITIONS = "lots_positions",
|
|
5290
5648
|
OFFSETS = "offsets",
|
|
5291
5649
|
TREES = "trees",
|
|
5292
5650
|
MERKLE_PATHS = "merkle_paths"
|
|
5293
5651
|
}
|
|
5294
5652
|
declare const TABLE_NAMES: readonly EnumTableName[];
|
|
5295
|
-
declare const VERSIONED_TABLE_NAMES: ("\"router_v1.
|
|
5653
|
+
declare const VERSIONED_TABLE_NAMES: ("\"router_v1.11\".\"obligations\"" | "\"router_v1.11\".\"obligation_id_keys\"" | "\"router_v1.11\".\"groups\"" | "\"router_v1.11\".\"consumed_events\"" | "\"router_v1.11\".\"obligation_collaterals_v2\"" | "\"router_v1.11\".\"oracles\"" | "\"router_v1.11\".\"offers\"" | "\"router_v1.11\".\"offers_callbacks\"" | "\"router_v1.11\".\"callbacks\"" | "\"router_v1.11\".\"positions\"" | "\"router_v1.11\".\"transfers\"" | "\"router_v1.11\".\"validations\"" | "\"router_v1.11\".\"collectors\"" | "\"router_v1.11\".\"chains\"" | "\"router_v1.11\".\"lots\"" | "\"router_v1.11\".\"lots_positions\"" | "\"router_v1.11\".\"offsets\"" | "\"router_v1.11\".\"trees\"" | "\"router_v1.11\".\"merkle_paths\"")[];
|
|
5296
5654
|
type TableName = (typeof TABLE_NAMES)[number];
|
|
5297
5655
|
type VersionedTableName = `"${typeof VERSION}"."${TableName}"`;
|
|
5298
5656
|
declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5299
5657
|
name: EnumTableName.OBLIGATIONS;
|
|
5300
|
-
schema: "router_v1.
|
|
5658
|
+
schema: "router_v1.11";
|
|
5301
5659
|
columns: {
|
|
5302
|
-
|
|
5303
|
-
name: "
|
|
5660
|
+
obligationKey: drizzle_orm_pg_core0.PgColumn<{
|
|
5661
|
+
name: "obligation_key";
|
|
5304
5662
|
tableName: EnumTableName.OBLIGATIONS;
|
|
5305
5663
|
dataType: "string";
|
|
5306
5664
|
columnType: "PgVarchar";
|
|
@@ -5318,12 +5676,31 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5318
5676
|
}, {}, {
|
|
5319
5677
|
length: 66;
|
|
5320
5678
|
}>;
|
|
5321
|
-
|
|
5322
|
-
name: "
|
|
5679
|
+
loanToken: drizzle_orm_pg_core0.PgColumn<{
|
|
5680
|
+
name: "loan_token";
|
|
5681
|
+
tableName: EnumTableName.OBLIGATIONS;
|
|
5682
|
+
dataType: "string";
|
|
5683
|
+
columnType: "PgVarchar";
|
|
5684
|
+
data: string;
|
|
5685
|
+
driverParam: string;
|
|
5686
|
+
notNull: true;
|
|
5687
|
+
hasDefault: false;
|
|
5688
|
+
isPrimaryKey: false;
|
|
5689
|
+
isAutoincrement: false;
|
|
5690
|
+
hasRuntimeDefault: false;
|
|
5691
|
+
enumValues: [string, ...string[]];
|
|
5692
|
+
baseColumn: never;
|
|
5693
|
+
identity: undefined;
|
|
5694
|
+
generated: undefined;
|
|
5695
|
+
}, {}, {
|
|
5696
|
+
length: 42;
|
|
5697
|
+
}>;
|
|
5698
|
+
maturity: drizzle_orm_pg_core0.PgColumn<{
|
|
5699
|
+
name: "maturity";
|
|
5323
5700
|
tableName: EnumTableName.OBLIGATIONS;
|
|
5324
5701
|
dataType: "number";
|
|
5325
|
-
columnType: "
|
|
5326
|
-
data:
|
|
5702
|
+
columnType: "PgInteger";
|
|
5703
|
+
data: number;
|
|
5327
5704
|
driverParam: string | number;
|
|
5328
5705
|
notNull: true;
|
|
5329
5706
|
hasDefault: false;
|
|
@@ -5334,12 +5711,36 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5334
5711
|
baseColumn: never;
|
|
5335
5712
|
identity: undefined;
|
|
5336
5713
|
generated: undefined;
|
|
5714
|
+
}, {}, {}>;
|
|
5715
|
+
};
|
|
5716
|
+
dialect: "pg";
|
|
5717
|
+
}>;
|
|
5718
|
+
declare const obligationIdKeys: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5719
|
+
name: EnumTableName.OBLIGATION_ID_KEYS;
|
|
5720
|
+
schema: "router_v1.11";
|
|
5721
|
+
columns: {
|
|
5722
|
+
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
5723
|
+
name: "obligation_id";
|
|
5724
|
+
tableName: EnumTableName.OBLIGATION_ID_KEYS;
|
|
5725
|
+
dataType: "string";
|
|
5726
|
+
columnType: "PgVarchar";
|
|
5727
|
+
data: string;
|
|
5728
|
+
driverParam: string;
|
|
5729
|
+
notNull: true;
|
|
5730
|
+
hasDefault: false;
|
|
5731
|
+
isPrimaryKey: true;
|
|
5732
|
+
isAutoincrement: false;
|
|
5733
|
+
hasRuntimeDefault: false;
|
|
5734
|
+
enumValues: [string, ...string[]];
|
|
5735
|
+
baseColumn: never;
|
|
5736
|
+
identity: undefined;
|
|
5737
|
+
generated: undefined;
|
|
5337
5738
|
}, {}, {
|
|
5338
|
-
|
|
5739
|
+
length: 66;
|
|
5339
5740
|
}>;
|
|
5340
|
-
|
|
5341
|
-
name: "
|
|
5342
|
-
tableName: EnumTableName.
|
|
5741
|
+
obligationKey: drizzle_orm_pg_core0.PgColumn<{
|
|
5742
|
+
name: "obligation_key";
|
|
5743
|
+
tableName: EnumTableName.OBLIGATION_ID_KEYS;
|
|
5343
5744
|
dataType: "string";
|
|
5344
5745
|
columnType: "PgVarchar";
|
|
5345
5746
|
data: string;
|
|
@@ -5354,14 +5755,14 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5354
5755
|
identity: undefined;
|
|
5355
5756
|
generated: undefined;
|
|
5356
5757
|
}, {}, {
|
|
5357
|
-
length:
|
|
5758
|
+
length: 66;
|
|
5358
5759
|
}>;
|
|
5359
|
-
|
|
5360
|
-
name: "
|
|
5361
|
-
tableName: EnumTableName.
|
|
5760
|
+
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
5761
|
+
name: "chain_id";
|
|
5762
|
+
tableName: EnumTableName.OBLIGATION_ID_KEYS;
|
|
5362
5763
|
dataType: "number";
|
|
5363
|
-
columnType: "
|
|
5364
|
-
data:
|
|
5764
|
+
columnType: "PgBigInt53";
|
|
5765
|
+
data: Id;
|
|
5365
5766
|
driverParam: string | number;
|
|
5366
5767
|
notNull: true;
|
|
5367
5768
|
hasDefault: false;
|
|
@@ -5372,13 +5773,34 @@ declare const obligations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5372
5773
|
baseColumn: never;
|
|
5373
5774
|
identity: undefined;
|
|
5374
5775
|
generated: undefined;
|
|
5375
|
-
}, {}, {
|
|
5776
|
+
}, {}, {
|
|
5777
|
+
$type: Id;
|
|
5778
|
+
}>;
|
|
5779
|
+
morphoV2: drizzle_orm_pg_core0.PgColumn<{
|
|
5780
|
+
name: "morpho_v2";
|
|
5781
|
+
tableName: EnumTableName.OBLIGATION_ID_KEYS;
|
|
5782
|
+
dataType: "string";
|
|
5783
|
+
columnType: "PgVarchar";
|
|
5784
|
+
data: string;
|
|
5785
|
+
driverParam: string;
|
|
5786
|
+
notNull: true;
|
|
5787
|
+
hasDefault: false;
|
|
5788
|
+
isPrimaryKey: false;
|
|
5789
|
+
isAutoincrement: false;
|
|
5790
|
+
hasRuntimeDefault: false;
|
|
5791
|
+
enumValues: [string, ...string[]];
|
|
5792
|
+
baseColumn: never;
|
|
5793
|
+
identity: undefined;
|
|
5794
|
+
generated: undefined;
|
|
5795
|
+
}, {}, {
|
|
5796
|
+
length: 42;
|
|
5797
|
+
}>;
|
|
5376
5798
|
};
|
|
5377
5799
|
dialect: "pg";
|
|
5378
5800
|
}>;
|
|
5379
5801
|
declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5380
5802
|
name: EnumTableName.GROUPS;
|
|
5381
|
-
schema: "router_v1.
|
|
5803
|
+
schema: "router_v1.11";
|
|
5382
5804
|
columns: {
|
|
5383
5805
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
5384
5806
|
name: "chain_id";
|
|
@@ -5493,7 +5915,7 @@ declare const groups: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5493
5915
|
}>;
|
|
5494
5916
|
declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5495
5917
|
name: EnumTableName.CONSUMED_EVENTS;
|
|
5496
|
-
schema: "router_v1.
|
|
5918
|
+
schema: "router_v1.11";
|
|
5497
5919
|
columns: {
|
|
5498
5920
|
eventId: drizzle_orm_pg_core0.PgColumn<{
|
|
5499
5921
|
name: "event_id";
|
|
@@ -5627,10 +6049,10 @@ declare const consumedEvents: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5627
6049
|
}>;
|
|
5628
6050
|
declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5629
6051
|
name: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
5630
|
-
schema: "router_v1.
|
|
6052
|
+
schema: "router_v1.11";
|
|
5631
6053
|
columns: {
|
|
5632
|
-
|
|
5633
|
-
name: "
|
|
6054
|
+
obligationKey: drizzle_orm_pg_core0.PgColumn<{
|
|
6055
|
+
name: "obligation_key";
|
|
5634
6056
|
tableName: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
5635
6057
|
dataType: "string";
|
|
5636
6058
|
columnType: "PgVarchar";
|
|
@@ -5648,43 +6070,24 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5648
6070
|
}, {}, {
|
|
5649
6071
|
length: 66;
|
|
5650
6072
|
}>;
|
|
5651
|
-
asset: drizzle_orm_pg_core0.PgColumn<{
|
|
5652
|
-
name: "asset";
|
|
5653
|
-
tableName: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
5654
|
-
dataType: "string";
|
|
5655
|
-
columnType: "PgVarchar";
|
|
5656
|
-
data: string;
|
|
5657
|
-
driverParam: string;
|
|
5658
|
-
notNull: true;
|
|
5659
|
-
hasDefault: false;
|
|
5660
|
-
isPrimaryKey: false;
|
|
5661
|
-
isAutoincrement: false;
|
|
5662
|
-
hasRuntimeDefault: false;
|
|
5663
|
-
enumValues: [string, ...string[]];
|
|
5664
|
-
baseColumn: never;
|
|
5665
|
-
identity: undefined;
|
|
5666
|
-
generated: undefined;
|
|
5667
|
-
}, {}, {
|
|
5668
|
-
length: 42;
|
|
5669
|
-
}>;
|
|
5670
|
-
oracleChainId: drizzle_orm_pg_core0.PgColumn<{
|
|
5671
|
-
name: "oracle_chain_id";
|
|
6073
|
+
asset: drizzle_orm_pg_core0.PgColumn<{
|
|
6074
|
+
name: "asset";
|
|
5672
6075
|
tableName: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
5673
|
-
dataType: "
|
|
5674
|
-
columnType: "
|
|
5675
|
-
data:
|
|
5676
|
-
driverParam: string
|
|
6076
|
+
dataType: "string";
|
|
6077
|
+
columnType: "PgVarchar";
|
|
6078
|
+
data: string;
|
|
6079
|
+
driverParam: string;
|
|
5677
6080
|
notNull: true;
|
|
5678
6081
|
hasDefault: false;
|
|
5679
6082
|
isPrimaryKey: false;
|
|
5680
6083
|
isAutoincrement: false;
|
|
5681
6084
|
hasRuntimeDefault: false;
|
|
5682
|
-
enumValues:
|
|
6085
|
+
enumValues: [string, ...string[]];
|
|
5683
6086
|
baseColumn: never;
|
|
5684
6087
|
identity: undefined;
|
|
5685
6088
|
generated: undefined;
|
|
5686
6089
|
}, {}, {
|
|
5687
|
-
|
|
6090
|
+
length: 42;
|
|
5688
6091
|
}>;
|
|
5689
6092
|
oracleAddress: drizzle_orm_pg_core0.PgColumn<{
|
|
5690
6093
|
name: "oracle_address";
|
|
@@ -5722,6 +6125,23 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5722
6125
|
identity: undefined;
|
|
5723
6126
|
generated: undefined;
|
|
5724
6127
|
}, {}, {}>;
|
|
6128
|
+
collateralIndex: drizzle_orm_pg_core0.PgColumn<{
|
|
6129
|
+
name: "collateral_index";
|
|
6130
|
+
tableName: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
6131
|
+
dataType: "number";
|
|
6132
|
+
columnType: "PgInteger";
|
|
6133
|
+
data: number;
|
|
6134
|
+
driverParam: string | number;
|
|
6135
|
+
notNull: true;
|
|
6136
|
+
hasDefault: false;
|
|
6137
|
+
isPrimaryKey: false;
|
|
6138
|
+
isAutoincrement: false;
|
|
6139
|
+
hasRuntimeDefault: false;
|
|
6140
|
+
enumValues: undefined;
|
|
6141
|
+
baseColumn: never;
|
|
6142
|
+
identity: undefined;
|
|
6143
|
+
generated: undefined;
|
|
6144
|
+
}, {}, {}>;
|
|
5725
6145
|
updatedAt: drizzle_orm_pg_core0.PgColumn<{
|
|
5726
6146
|
name: "updated_at";
|
|
5727
6147
|
tableName: EnumTableName.OBLIGATION_COLLATERALS_V2;
|
|
@@ -5744,7 +6164,7 @@ declare const obligationCollateralsV2: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5744
6164
|
}>;
|
|
5745
6165
|
declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5746
6166
|
name: EnumTableName.ORACLES;
|
|
5747
|
-
schema: "router_v1.
|
|
6167
|
+
schema: "router_v1.11";
|
|
5748
6168
|
columns: {
|
|
5749
6169
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
5750
6170
|
name: "chain_id";
|
|
@@ -5840,7 +6260,7 @@ declare const oracles: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5840
6260
|
}>;
|
|
5841
6261
|
declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
5842
6262
|
name: EnumTableName.OFFERS;
|
|
5843
|
-
schema: "router_v1.
|
|
6263
|
+
schema: "router_v1.11";
|
|
5844
6264
|
columns: {
|
|
5845
6265
|
hash: drizzle_orm_pg_core0.PgColumn<{
|
|
5846
6266
|
name: "hash";
|
|
@@ -5851,7 +6271,7 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
5851
6271
|
driverParam: string;
|
|
5852
6272
|
notNull: true;
|
|
5853
6273
|
hasDefault: false;
|
|
5854
|
-
isPrimaryKey:
|
|
6274
|
+
isPrimaryKey: false;
|
|
5855
6275
|
isAutoincrement: false;
|
|
5856
6276
|
hasRuntimeDefault: false;
|
|
5857
6277
|
enumValues: [string, ...string[]];
|
|
@@ -6128,6 +6548,25 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6128
6548
|
identity: undefined;
|
|
6129
6549
|
generated: undefined;
|
|
6130
6550
|
}, {}, {}>;
|
|
6551
|
+
receiverIfMakerIsSeller: drizzle_orm_pg_core0.PgColumn<{
|
|
6552
|
+
name: "receiver_if_maker_is_seller";
|
|
6553
|
+
tableName: EnumTableName.OFFERS;
|
|
6554
|
+
dataType: "string";
|
|
6555
|
+
columnType: "PgVarchar";
|
|
6556
|
+
data: string;
|
|
6557
|
+
driverParam: string;
|
|
6558
|
+
notNull: false;
|
|
6559
|
+
hasDefault: false;
|
|
6560
|
+
isPrimaryKey: false;
|
|
6561
|
+
isAutoincrement: false;
|
|
6562
|
+
hasRuntimeDefault: false;
|
|
6563
|
+
enumValues: [string, ...string[]];
|
|
6564
|
+
baseColumn: never;
|
|
6565
|
+
identity: undefined;
|
|
6566
|
+
generated: undefined;
|
|
6567
|
+
}, {}, {
|
|
6568
|
+
length: 42;
|
|
6569
|
+
}>;
|
|
6131
6570
|
blockNumber: drizzle_orm_pg_core0.PgColumn<{
|
|
6132
6571
|
name: "block_number";
|
|
6133
6572
|
tableName: EnumTableName.OFFERS;
|
|
@@ -6167,7 +6606,7 @@ declare const offers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6167
6606
|
}>;
|
|
6168
6607
|
declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6169
6608
|
name: EnumTableName.OFFERS_CALLBACKS;
|
|
6170
|
-
schema: "router_v1.
|
|
6609
|
+
schema: "router_v1.11";
|
|
6171
6610
|
columns: {
|
|
6172
6611
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
6173
6612
|
name: "offer_hash";
|
|
@@ -6188,6 +6627,25 @@ declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6188
6627
|
}, {}, {
|
|
6189
6628
|
length: 66;
|
|
6190
6629
|
}>;
|
|
6630
|
+
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
6631
|
+
name: "obligation_id";
|
|
6632
|
+
tableName: EnumTableName.OFFERS_CALLBACKS;
|
|
6633
|
+
dataType: "string";
|
|
6634
|
+
columnType: "PgVarchar";
|
|
6635
|
+
data: string;
|
|
6636
|
+
driverParam: string;
|
|
6637
|
+
notNull: true;
|
|
6638
|
+
hasDefault: false;
|
|
6639
|
+
isPrimaryKey: false;
|
|
6640
|
+
isAutoincrement: false;
|
|
6641
|
+
hasRuntimeDefault: false;
|
|
6642
|
+
enumValues: [string, ...string[]];
|
|
6643
|
+
baseColumn: never;
|
|
6644
|
+
identity: undefined;
|
|
6645
|
+
generated: undefined;
|
|
6646
|
+
}, {}, {
|
|
6647
|
+
length: 66;
|
|
6648
|
+
}>;
|
|
6191
6649
|
callbackId: drizzle_orm_pg_core0.PgColumn<{
|
|
6192
6650
|
name: "callback_id";
|
|
6193
6651
|
tableName: EnumTableName.OFFERS_CALLBACKS;
|
|
@@ -6212,7 +6670,7 @@ declare const offersCallbacks: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6212
6670
|
}>;
|
|
6213
6671
|
declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6214
6672
|
name: EnumTableName.CALLBACKS;
|
|
6215
|
-
schema: "router_v1.
|
|
6673
|
+
schema: "router_v1.11";
|
|
6216
6674
|
columns: {
|
|
6217
6675
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
6218
6676
|
name: "id";
|
|
@@ -6290,6 +6748,23 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6290
6748
|
}, {}, {
|
|
6291
6749
|
length: 42;
|
|
6292
6750
|
}>;
|
|
6751
|
+
positionTypeId: drizzle_orm_pg_core0.PgColumn<{
|
|
6752
|
+
name: "position_type_id";
|
|
6753
|
+
tableName: EnumTableName.CALLBACKS;
|
|
6754
|
+
dataType: "number";
|
|
6755
|
+
columnType: "PgInteger";
|
|
6756
|
+
data: number;
|
|
6757
|
+
driverParam: string | number;
|
|
6758
|
+
notNull: true;
|
|
6759
|
+
hasDefault: false;
|
|
6760
|
+
isPrimaryKey: false;
|
|
6761
|
+
isAutoincrement: false;
|
|
6762
|
+
hasRuntimeDefault: false;
|
|
6763
|
+
enumValues: undefined;
|
|
6764
|
+
baseColumn: never;
|
|
6765
|
+
identity: undefined;
|
|
6766
|
+
generated: undefined;
|
|
6767
|
+
}, {}, {}>;
|
|
6293
6768
|
amount: drizzle_orm_pg_core0.PgColumn<{
|
|
6294
6769
|
name: "amount";
|
|
6295
6770
|
tableName: EnumTableName.CALLBACKS;
|
|
@@ -6310,9 +6785,90 @@ declare const callbacks$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6310
6785
|
};
|
|
6311
6786
|
dialect: "pg";
|
|
6312
6787
|
}>;
|
|
6788
|
+
declare const lotsPositions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6789
|
+
name: EnumTableName.LOTS_POSITIONS;
|
|
6790
|
+
schema: "router_v1.11";
|
|
6791
|
+
columns: {
|
|
6792
|
+
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6793
|
+
name: "chain_id";
|
|
6794
|
+
tableName: EnumTableName.LOTS_POSITIONS;
|
|
6795
|
+
dataType: "number";
|
|
6796
|
+
columnType: "PgBigInt53";
|
|
6797
|
+
data: Id;
|
|
6798
|
+
driverParam: string | number;
|
|
6799
|
+
notNull: true;
|
|
6800
|
+
hasDefault: false;
|
|
6801
|
+
isPrimaryKey: false;
|
|
6802
|
+
isAutoincrement: false;
|
|
6803
|
+
hasRuntimeDefault: false;
|
|
6804
|
+
enumValues: undefined;
|
|
6805
|
+
baseColumn: never;
|
|
6806
|
+
identity: undefined;
|
|
6807
|
+
generated: undefined;
|
|
6808
|
+
}, {}, {
|
|
6809
|
+
$type: Id;
|
|
6810
|
+
}>;
|
|
6811
|
+
contract: drizzle_orm_pg_core0.PgColumn<{
|
|
6812
|
+
name: "contract";
|
|
6813
|
+
tableName: EnumTableName.LOTS_POSITIONS;
|
|
6814
|
+
dataType: "string";
|
|
6815
|
+
columnType: "PgVarchar";
|
|
6816
|
+
data: string;
|
|
6817
|
+
driverParam: string;
|
|
6818
|
+
notNull: true;
|
|
6819
|
+
hasDefault: false;
|
|
6820
|
+
isPrimaryKey: false;
|
|
6821
|
+
isAutoincrement: false;
|
|
6822
|
+
hasRuntimeDefault: false;
|
|
6823
|
+
enumValues: [string, ...string[]];
|
|
6824
|
+
baseColumn: never;
|
|
6825
|
+
identity: undefined;
|
|
6826
|
+
generated: undefined;
|
|
6827
|
+
}, {}, {
|
|
6828
|
+
length: 42;
|
|
6829
|
+
}>;
|
|
6830
|
+
user: drizzle_orm_pg_core0.PgColumn<{
|
|
6831
|
+
name: "user";
|
|
6832
|
+
tableName: EnumTableName.LOTS_POSITIONS;
|
|
6833
|
+
dataType: "string";
|
|
6834
|
+
columnType: "PgVarchar";
|
|
6835
|
+
data: string;
|
|
6836
|
+
driverParam: string;
|
|
6837
|
+
notNull: true;
|
|
6838
|
+
hasDefault: false;
|
|
6839
|
+
isPrimaryKey: false;
|
|
6840
|
+
isAutoincrement: false;
|
|
6841
|
+
hasRuntimeDefault: false;
|
|
6842
|
+
enumValues: [string, ...string[]];
|
|
6843
|
+
baseColumn: never;
|
|
6844
|
+
identity: undefined;
|
|
6845
|
+
generated: undefined;
|
|
6846
|
+
}, {}, {
|
|
6847
|
+
length: 42;
|
|
6848
|
+
}>;
|
|
6849
|
+
positionTypeId: drizzle_orm_pg_core0.PgColumn<{
|
|
6850
|
+
name: "position_type_id";
|
|
6851
|
+
tableName: EnumTableName.LOTS_POSITIONS;
|
|
6852
|
+
dataType: "number";
|
|
6853
|
+
columnType: "PgInteger";
|
|
6854
|
+
data: number;
|
|
6855
|
+
driverParam: string | number;
|
|
6856
|
+
notNull: true;
|
|
6857
|
+
hasDefault: false;
|
|
6858
|
+
isPrimaryKey: false;
|
|
6859
|
+
isAutoincrement: false;
|
|
6860
|
+
hasRuntimeDefault: false;
|
|
6861
|
+
enumValues: undefined;
|
|
6862
|
+
baseColumn: never;
|
|
6863
|
+
identity: undefined;
|
|
6864
|
+
generated: undefined;
|
|
6865
|
+
}, {}, {}>;
|
|
6866
|
+
};
|
|
6867
|
+
dialect: "pg";
|
|
6868
|
+
}>;
|
|
6313
6869
|
declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6314
6870
|
name: EnumTableName.LOTS;
|
|
6315
|
-
schema: "router_v1.
|
|
6871
|
+
schema: "router_v1.11";
|
|
6316
6872
|
columns: {
|
|
6317
6873
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6318
6874
|
name: "chain_id";
|
|
@@ -6448,7 +7004,7 @@ declare const lots: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6448
7004
|
}>;
|
|
6449
7005
|
declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6450
7006
|
name: EnumTableName.OFFSETS;
|
|
6451
|
-
schema: "router_v1.
|
|
7007
|
+
schema: "router_v1.11";
|
|
6452
7008
|
columns: {
|
|
6453
7009
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6454
7010
|
name: "chain_id";
|
|
@@ -6568,7 +7124,7 @@ declare const offsets: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6568
7124
|
declare const PositionTypes: drizzle_orm_pg_core0.PgEnum<[Type, ...Type[]]>;
|
|
6569
7125
|
declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6570
7126
|
name: "position_types";
|
|
6571
|
-
schema: "router_v1.
|
|
7127
|
+
schema: "router_v1.11";
|
|
6572
7128
|
columns: {
|
|
6573
7129
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
6574
7130
|
name: "id";
|
|
@@ -6609,7 +7165,7 @@ declare const positionTypes: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6609
7165
|
}>;
|
|
6610
7166
|
declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6611
7167
|
name: EnumTableName.POSITIONS;
|
|
6612
|
-
schema: "router_v1.
|
|
7168
|
+
schema: "router_v1.11";
|
|
6613
7169
|
columns: {
|
|
6614
7170
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
6615
7171
|
name: "chain_id";
|
|
@@ -6647,7 +7203,7 @@ declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6647
7203
|
identity: undefined;
|
|
6648
7204
|
generated: undefined;
|
|
6649
7205
|
}, {}, {
|
|
6650
|
-
length:
|
|
7206
|
+
length: 66;
|
|
6651
7207
|
}>;
|
|
6652
7208
|
user: drizzle_orm_pg_core0.PgColumn<{
|
|
6653
7209
|
name: "user";
|
|
@@ -6709,7 +7265,7 @@ declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6709
7265
|
columnType: "PgVarchar";
|
|
6710
7266
|
data: string;
|
|
6711
7267
|
driverParam: string;
|
|
6712
|
-
notNull:
|
|
7268
|
+
notNull: true;
|
|
6713
7269
|
hasDefault: false;
|
|
6714
7270
|
isPrimaryKey: false;
|
|
6715
7271
|
isAutoincrement: false;
|
|
@@ -6760,7 +7316,7 @@ declare const positions: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6760
7316
|
}>;
|
|
6761
7317
|
declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6762
7318
|
name: EnumTableName.TRANSFERS;
|
|
6763
|
-
schema: "router_v1.
|
|
7319
|
+
schema: "router_v1.11";
|
|
6764
7320
|
columns: {
|
|
6765
7321
|
eventId: drizzle_orm_pg_core0.PgColumn<{
|
|
6766
7322
|
name: "event_id";
|
|
@@ -6817,7 +7373,7 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6817
7373
|
identity: undefined;
|
|
6818
7374
|
generated: undefined;
|
|
6819
7375
|
}, {}, {
|
|
6820
|
-
length:
|
|
7376
|
+
length: 66;
|
|
6821
7377
|
}>;
|
|
6822
7378
|
from: drizzle_orm_pg_core0.PgColumn<{
|
|
6823
7379
|
name: "from";
|
|
@@ -6874,6 +7430,42 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6874
7430
|
identity: undefined;
|
|
6875
7431
|
generated: undefined;
|
|
6876
7432
|
}, {}, {}>;
|
|
7433
|
+
positionTypeId: drizzle_orm_pg_core0.PgColumn<{
|
|
7434
|
+
name: "position_type_id";
|
|
7435
|
+
tableName: EnumTableName.TRANSFERS;
|
|
7436
|
+
dataType: "number";
|
|
7437
|
+
columnType: "PgInteger";
|
|
7438
|
+
data: number;
|
|
7439
|
+
driverParam: string | number;
|
|
7440
|
+
notNull: true;
|
|
7441
|
+
hasDefault: false;
|
|
7442
|
+
isPrimaryKey: false;
|
|
7443
|
+
isAutoincrement: false;
|
|
7444
|
+
hasRuntimeDefault: false;
|
|
7445
|
+
enumValues: undefined;
|
|
7446
|
+
baseColumn: never;
|
|
7447
|
+
identity: undefined;
|
|
7448
|
+
generated: undefined;
|
|
7449
|
+
}, {}, {}>;
|
|
7450
|
+
asset: drizzle_orm_pg_core0.PgColumn<{
|
|
7451
|
+
name: "asset";
|
|
7452
|
+
tableName: EnumTableName.TRANSFERS;
|
|
7453
|
+
dataType: "string";
|
|
7454
|
+
columnType: "PgVarchar";
|
|
7455
|
+
data: string;
|
|
7456
|
+
driverParam: string;
|
|
7457
|
+
notNull: true;
|
|
7458
|
+
hasDefault: false;
|
|
7459
|
+
isPrimaryKey: false;
|
|
7460
|
+
isAutoincrement: false;
|
|
7461
|
+
hasRuntimeDefault: false;
|
|
7462
|
+
enumValues: [string, ...string[]];
|
|
7463
|
+
baseColumn: never;
|
|
7464
|
+
identity: undefined;
|
|
7465
|
+
generated: undefined;
|
|
7466
|
+
}, {}, {
|
|
7467
|
+
length: 42;
|
|
7468
|
+
}>;
|
|
6877
7469
|
blockNumber: drizzle_orm_pg_core0.PgColumn<{
|
|
6878
7470
|
name: "block_number";
|
|
6879
7471
|
tableName: EnumTableName.TRANSFERS;
|
|
@@ -6914,7 +7506,7 @@ declare const transfers: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6914
7506
|
declare const StatusCode: drizzle_orm_pg_core0.PgEnum<[Status, ...Status[]]>;
|
|
6915
7507
|
declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6916
7508
|
name: "status";
|
|
6917
|
-
schema: "router_v1.
|
|
7509
|
+
schema: "router_v1.11";
|
|
6918
7510
|
columns: {
|
|
6919
7511
|
id: drizzle_orm_pg_core0.PgColumn<{
|
|
6920
7512
|
name: "id";
|
|
@@ -6955,7 +7547,7 @@ declare const status: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6955
7547
|
}>;
|
|
6956
7548
|
declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
6957
7549
|
name: "validations";
|
|
6958
|
-
schema: "router_v1.
|
|
7550
|
+
schema: "router_v1.11";
|
|
6959
7551
|
columns: {
|
|
6960
7552
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
6961
7553
|
name: "offer_hash";
|
|
@@ -6966,7 +7558,26 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
6966
7558
|
driverParam: string;
|
|
6967
7559
|
notNull: true;
|
|
6968
7560
|
hasDefault: false;
|
|
6969
|
-
isPrimaryKey:
|
|
7561
|
+
isPrimaryKey: false;
|
|
7562
|
+
isAutoincrement: false;
|
|
7563
|
+
hasRuntimeDefault: false;
|
|
7564
|
+
enumValues: [string, ...string[]];
|
|
7565
|
+
baseColumn: never;
|
|
7566
|
+
identity: undefined;
|
|
7567
|
+
generated: undefined;
|
|
7568
|
+
}, {}, {
|
|
7569
|
+
length: 66;
|
|
7570
|
+
}>;
|
|
7571
|
+
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
7572
|
+
name: "obligation_id";
|
|
7573
|
+
tableName: "validations";
|
|
7574
|
+
dataType: "string";
|
|
7575
|
+
columnType: "PgVarchar";
|
|
7576
|
+
data: string;
|
|
7577
|
+
driverParam: string;
|
|
7578
|
+
notNull: true;
|
|
7579
|
+
hasDefault: false;
|
|
7580
|
+
isPrimaryKey: false;
|
|
6970
7581
|
isAutoincrement: false;
|
|
6971
7582
|
hasRuntimeDefault: false;
|
|
6972
7583
|
enumValues: [string, ...string[]];
|
|
@@ -7015,7 +7626,7 @@ declare const validations: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7015
7626
|
}>;
|
|
7016
7627
|
declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7017
7628
|
name: EnumTableName.COLLECTORS;
|
|
7018
|
-
schema: "router_v1.
|
|
7629
|
+
schema: "router_v1.11";
|
|
7019
7630
|
columns: {
|
|
7020
7631
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
7021
7632
|
name: "chain_id";
|
|
@@ -7041,7 +7652,7 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7041
7652
|
tableName: EnumTableName.COLLECTORS;
|
|
7042
7653
|
dataType: "string";
|
|
7043
7654
|
columnType: "PgText";
|
|
7044
|
-
data: "
|
|
7655
|
+
data: "morpho_v2" | "offers" | "positions" | "prices";
|
|
7045
7656
|
driverParam: string;
|
|
7046
7657
|
notNull: true;
|
|
7047
7658
|
hasDefault: false;
|
|
@@ -7053,7 +7664,7 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7053
7664
|
identity: undefined;
|
|
7054
7665
|
generated: undefined;
|
|
7055
7666
|
}, {}, {
|
|
7056
|
-
$type: "
|
|
7667
|
+
$type: "morpho_v2" | "offers" | "positions" | "prices";
|
|
7057
7668
|
}>;
|
|
7058
7669
|
blockNumber: drizzle_orm_pg_core0.PgColumn<{
|
|
7059
7670
|
name: "block_number";
|
|
@@ -7109,9 +7720,9 @@ declare const collectors: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7109
7720
|
};
|
|
7110
7721
|
dialect: "pg";
|
|
7111
7722
|
}>;
|
|
7112
|
-
declare const chains
|
|
7723
|
+
declare const chains: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7113
7724
|
name: EnumTableName.CHAINS;
|
|
7114
|
-
schema: "router_v1.
|
|
7725
|
+
schema: "router_v1.11";
|
|
7115
7726
|
columns: {
|
|
7116
7727
|
chainId: drizzle_orm_pg_core0.PgColumn<{
|
|
7117
7728
|
name: "chain_id";
|
|
@@ -7188,7 +7799,7 @@ declare const chains$1: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7188
7799
|
}>;
|
|
7189
7800
|
declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7190
7801
|
name: EnumTableName.TREES;
|
|
7191
|
-
schema: "router_v1.
|
|
7802
|
+
schema: "router_v1.11";
|
|
7192
7803
|
columns: {
|
|
7193
7804
|
root: drizzle_orm_pg_core0.PgColumn<{
|
|
7194
7805
|
name: "root";
|
|
@@ -7250,7 +7861,7 @@ declare const trees: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7250
7861
|
}>;
|
|
7251
7862
|
declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
7252
7863
|
name: EnumTableName.MERKLE_PATHS;
|
|
7253
|
-
schema: "router_v1.
|
|
7864
|
+
schema: "router_v1.11";
|
|
7254
7865
|
columns: {
|
|
7255
7866
|
offerHash: drizzle_orm_pg_core0.PgColumn<{
|
|
7256
7867
|
name: "offer_hash";
|
|
@@ -7261,7 +7872,26 @@ declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7261
7872
|
driverParam: string;
|
|
7262
7873
|
notNull: true;
|
|
7263
7874
|
hasDefault: false;
|
|
7264
|
-
isPrimaryKey:
|
|
7875
|
+
isPrimaryKey: false;
|
|
7876
|
+
isAutoincrement: false;
|
|
7877
|
+
hasRuntimeDefault: false;
|
|
7878
|
+
enumValues: [string, ...string[]];
|
|
7879
|
+
baseColumn: never;
|
|
7880
|
+
identity: undefined;
|
|
7881
|
+
generated: undefined;
|
|
7882
|
+
}, {}, {
|
|
7883
|
+
length: 66;
|
|
7884
|
+
}>;
|
|
7885
|
+
obligationId: drizzle_orm_pg_core0.PgColumn<{
|
|
7886
|
+
name: "obligation_id";
|
|
7887
|
+
tableName: EnumTableName.MERKLE_PATHS;
|
|
7888
|
+
dataType: "string";
|
|
7889
|
+
columnType: "PgVarchar";
|
|
7890
|
+
data: string;
|
|
7891
|
+
driverParam: string;
|
|
7892
|
+
notNull: true;
|
|
7893
|
+
hasDefault: false;
|
|
7894
|
+
isPrimaryKey: false;
|
|
7265
7895
|
isAutoincrement: false;
|
|
7266
7896
|
hasRuntimeDefault: false;
|
|
7267
7897
|
enumValues: [string, ...string[]];
|
|
@@ -7328,29 +7958,17 @@ declare const merklePaths: drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
|
7328
7958
|
dialect: "pg";
|
|
7329
7959
|
}>;
|
|
7330
7960
|
declare namespace index_d_exports$2 {
|
|
7331
|
-
export { PositionTypes, StatusCode, TABLE_NAMES, TableName, VERSION, VERSIONED_TABLE_NAMES, VersionedTableName, callbacks$1 as callbacks, chains
|
|
7961
|
+
export { PositionTypes, StatusCode, TABLE_NAMES, TableName, VERSION, VERSIONED_TABLE_NAMES, VersionedTableName, callbacks$1 as callbacks, chains, collectors, consumedEvents, groups, lots, lotsPositions, merklePaths, obligationCollateralsV2, obligationIdKeys, obligations, offers, offersCallbacks, offsets, oracles, positionTypes, positions, status, transfers, trees, validations };
|
|
7332
7962
|
}
|
|
7333
7963
|
//#endregion
|
|
7334
7964
|
//#region src/gatekeeper/morphoRules.d.ts
|
|
7335
|
-
declare const morphoRules: (
|
|
7965
|
+
declare const morphoRules: (parameters: {
|
|
7966
|
+
chains: Chain$1[];
|
|
7967
|
+
chainId: Id;
|
|
7968
|
+
}) => (Rule<Offer, "mixed_maker"> | Rule<Offer, "amount_mutual_exclusivity"> | Rule<Offer, "maturity"> | Rule<Offer, "callback"> | Rule<Offer, "loan_token"> | Rule<Offer, "collateral_token"> | Rule<Offer, "oracle">)[];
|
|
7336
7969
|
declare namespace Rules_d_exports {
|
|
7337
|
-
export {
|
|
7970
|
+
export { amountMutualExclusivity, callback, collateralToken, loanToken, maturity, oracle, sameMaker };
|
|
7338
7971
|
}
|
|
7339
|
-
type ValidityParameters = {
|
|
7340
|
-
client: PublicClient<Transport, Chain$1>;
|
|
7341
|
-
};
|
|
7342
|
-
/**
|
|
7343
|
-
* set of rules to validate offers.
|
|
7344
|
-
*
|
|
7345
|
-
* @param _parameters - Validity parameters with chain and client
|
|
7346
|
-
* @returns Array of validation rules to evaluate against offers
|
|
7347
|
-
*/
|
|
7348
|
-
declare function validity(_parameters: ValidityParameters): Rule<Offer, "expiry">[];
|
|
7349
|
-
declare const chains: ({
|
|
7350
|
-
chains
|
|
7351
|
-
}: {
|
|
7352
|
-
chains: Chain$1[];
|
|
7353
|
-
}) => Rule<Offer, "chain_ids">;
|
|
7354
7972
|
declare const maturity: ({
|
|
7355
7973
|
maturities
|
|
7356
7974
|
}: {
|
|
@@ -7368,9 +7986,11 @@ declare const callback: ({
|
|
|
7368
7986
|
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
7369
7987
|
*/
|
|
7370
7988
|
declare const loanToken: ({
|
|
7371
|
-
assetsByChainId
|
|
7989
|
+
assetsByChainId,
|
|
7990
|
+
chainId
|
|
7372
7991
|
}: {
|
|
7373
7992
|
assetsByChainId: Partial<Record<Id, Address[]>>;
|
|
7993
|
+
chainId: Id;
|
|
7374
7994
|
}) => Rule<Offer, "loan_token">;
|
|
7375
7995
|
/**
|
|
7376
7996
|
* A validation rule that checks if the offer's collateral tokens are allowed for its chain.
|
|
@@ -7378,9 +7998,11 @@ declare const loanToken: ({
|
|
|
7378
7998
|
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
7379
7999
|
*/
|
|
7380
8000
|
declare const collateralToken: ({
|
|
7381
|
-
collateralAssetsByChainId
|
|
8001
|
+
collateralAssetsByChainId,
|
|
8002
|
+
chainId
|
|
7382
8003
|
}: {
|
|
7383
8004
|
collateralAssetsByChainId: Partial<Record<Id, Address[]>>;
|
|
8005
|
+
chainId: Id;
|
|
7384
8006
|
}) => Rule<Offer, "collateral_token">;
|
|
7385
8007
|
/**
|
|
7386
8008
|
* A validation rule that checks if the offer's oracle addresses are allowed for its chain.
|
|
@@ -7388,9 +8010,11 @@ declare const collateralToken: ({
|
|
|
7388
8010
|
* @returns The issue that was found. If the offer is valid, this will be undefined.
|
|
7389
8011
|
*/
|
|
7390
8012
|
declare const oracle: ({
|
|
7391
|
-
oraclesByChainId
|
|
8013
|
+
oraclesByChainId,
|
|
8014
|
+
chainId
|
|
7392
8015
|
}: {
|
|
7393
8016
|
oraclesByChainId: Partial<Record<Id, Address[]>>;
|
|
8017
|
+
chainId: Id;
|
|
7394
8018
|
}) => Rule<Offer, "oracle">;
|
|
7395
8019
|
/**
|
|
7396
8020
|
* A batch validation rule that ensures all offers in a tree have the same maker address.
|
|
@@ -7432,7 +8056,7 @@ declare namespace from {
|
|
|
7432
8056
|
*/
|
|
7433
8057
|
declare function add(config: MempoolEVMClientConfig, offers: AddParameters): Promise<Hex>;
|
|
7434
8058
|
declare namespace add {
|
|
7435
|
-
type ErrorType = WalletAccountNotSetError | ViemClientError | InvalidOfferError |
|
|
8059
|
+
type ErrorType = WalletAccountNotSetError | ViemClientError | InvalidOfferError | MissingMorphoAddressError;
|
|
7436
8060
|
}
|
|
7437
8061
|
declare function get(config: MempoolEVMClientConfig, parameters?: GetParameters): AsyncGenerator<{
|
|
7438
8062
|
offers: Offer[];
|
|
@@ -7441,7 +8065,7 @@ declare function get(config: MempoolEVMClientConfig, parameters?: GetParameters)
|
|
|
7441
8065
|
declare namespace get {
|
|
7442
8066
|
type ErrorType = streamOffersReturnType;
|
|
7443
8067
|
}
|
|
7444
|
-
type streamOffersReturnType = WalletAccountNotSetError |
|
|
8068
|
+
type streamOffersReturnType = WalletAccountNotSetError | MissingMorphoAddressError;
|
|
7445
8069
|
declare class WalletAccountNotSetError extends BaseError {
|
|
7446
8070
|
name: string;
|
|
7447
8071
|
constructor();
|
|
@@ -7449,10 +8073,6 @@ declare class WalletAccountNotSetError extends BaseError {
|
|
|
7449
8073
|
declare class ViemClientError extends BaseError {
|
|
7450
8074
|
name: string;
|
|
7451
8075
|
}
|
|
7452
|
-
declare class ChainIdMismatchError extends BaseError {
|
|
7453
|
-
name: string;
|
|
7454
|
-
constructor(expected: Id, actual: Id);
|
|
7455
|
-
}
|
|
7456
8076
|
declare class MissingMorphoAddressError extends BaseError {
|
|
7457
8077
|
name: string;
|
|
7458
8078
|
constructor();
|
|
@@ -7503,7 +8123,7 @@ declare namespace connect {
|
|
|
7503
8123
|
type ErrorType = from.ErrorType;
|
|
7504
8124
|
}
|
|
7505
8125
|
declare namespace index_d_exports$1 {
|
|
7506
|
-
export { AddParameters,
|
|
8126
|
+
export { AddParameters, Client$2 as Client, GetParameters, MissingMorphoAddressError, ViemClientError, WalletAccountNotSetError, add, connect, from, get };
|
|
7507
8127
|
}
|
|
7508
8128
|
//#endregion
|
|
7509
8129
|
//#region src/utils/BigMath.d.ts
|
|
@@ -7638,5 +8258,5 @@ declare namespace index_d_exports$3 {
|
|
|
7638
8258
|
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 };
|
|
7639
8259
|
}
|
|
7640
8260
|
//#endregion
|
|
7641
|
-
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, ConfigContractsController, ConfigRule, ConfigRulesController, ConfigRulesPayload, Database_d_exports as Database, ERC4626_d_exports as ERC4626, ErrorPayload, Errors_d_exports as Errors, Format_d_exports as Format, 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, 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, Rules_d_exports as Rules, SuccessPayload, Tick_d_exports as Tick, 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 };
|
|
8261
|
+
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, ConfigContractsController, ConfigRule, ConfigRulesController, ConfigRulesPayload, Database_d_exports as Database, ERC4626_d_exports as ERC4626, ErrorPayload, Errors_d_exports as Errors, Format_d_exports as Format, Gatekeeper_d_exports as Gatekeeper, Client_d_exports as GatekeeperClient, Health_d_exports as Health, HealthController, Id_d_exports as Id, 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, 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, Rules_d_exports as Rules, SuccessPayload, Tick_d_exports as Tick, 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 };
|
|
7642
8262
|
//# sourceMappingURL=index.node.d.mts.map
|