@morpho-dev/router 0.7.0 → 0.7.1
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 +1854 -2122
- package/dist/index.browser.d.mts +111 -283
- package/dist/index.browser.d.mts.map +1 -1
- package/dist/index.browser.d.ts +111 -283
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +120 -451
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +120 -451
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +117 -299
- package/dist/index.node.d.mts.map +1 -1
- package/dist/index.node.d.ts +116 -298
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +4244 -4573
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +4245 -4568
- package/dist/index.node.mjs.map +1 -1
- package/docs/integrator.md +5 -6
- package/package.json +1 -1
package/dist/index.node.d.ts
CHANGED
|
@@ -274,94 +274,19 @@ declare const Morpho: readonly [{
|
|
|
274
274
|
}];
|
|
275
275
|
readonly stateMutability: "view";
|
|
276
276
|
}];
|
|
277
|
-
//#endregion
|
|
278
|
-
//#region src/core/types.d.ts
|
|
279
|
-
/** Combines members of an intersection into a readable type. */
|
|
280
|
-
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
281
|
-
declare const BrandTypeId: unique symbol;
|
|
282
|
-
type Brand<in out ID extends string | symbol> = {
|
|
283
|
-
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
284
|
-
};
|
|
285
277
|
declare namespace Callback_d_exports {
|
|
286
|
-
export {
|
|
278
|
+
export { Callback, Type$1 as Type, isEmptyCallback };
|
|
287
279
|
}
|
|
288
|
-
/** A position decoded from callback data. */
|
|
289
|
-
type CallbackPosition = {
|
|
290
|
-
/** The ERC20 token contract address. */contract: Address; /** The maximum amount available from this position. */
|
|
291
|
-
amount: bigint;
|
|
292
|
-
};
|
|
293
280
|
type Callback = {
|
|
294
281
|
type: Type$1.BuyWithEmptyCallback;
|
|
295
|
-
} |
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
} & {
|
|
299
|
-
type: Type$1.BuyERC20; /** The decoded callback inputs. */
|
|
300
|
-
inputs: {
|
|
301
|
-
/** The ERC20 positions available for the callback. */positions: CallbackPosition[];
|
|
302
|
-
};
|
|
303
|
-
}) & Brand<"Callback">);
|
|
282
|
+
} | {
|
|
283
|
+
type: Type$1.SellWithEmptyCallback;
|
|
284
|
+
};
|
|
304
285
|
declare enum Type$1 {
|
|
305
286
|
BuyWithEmptyCallback = "buy_with_empty_callback",
|
|
306
|
-
|
|
307
|
-
BuyVaultV1Callback = "buy_vault_v1_callback",
|
|
308
|
-
SellERC20Callback = "sell_erc20_callback"
|
|
287
|
+
SellWithEmptyCallback = "sell_with_empty_callback"
|
|
309
288
|
}
|
|
310
289
|
declare const isEmptyCallback: (offer: Offer) => boolean;
|
|
311
|
-
declare function decode$2(type: Type$1, data: Hex): {
|
|
312
|
-
contract: Address;
|
|
313
|
-
amount: bigint;
|
|
314
|
-
}[];
|
|
315
|
-
type BuyERC20Data = {
|
|
316
|
-
tokens: Address[];
|
|
317
|
-
amounts: bigint[];
|
|
318
|
-
};
|
|
319
|
-
type BuyVaultV1CallbackData = {
|
|
320
|
-
vaults: Address[];
|
|
321
|
-
amounts: bigint[];
|
|
322
|
-
};
|
|
323
|
-
type SellERC20CallbackData = {
|
|
324
|
-
collaterals: Address[];
|
|
325
|
-
amounts: bigint[];
|
|
326
|
-
};
|
|
327
|
-
declare function encode$2(type: Type$1.BuyERC20, data: BuyERC20Data): Hex;
|
|
328
|
-
declare function encode$2(type: Type$1.BuyVaultV1Callback, data: BuyVaultV1CallbackData): Hex;
|
|
329
|
-
declare function encode$2(type: Type$1.SellERC20Callback, data: SellERC20CallbackData): Hex;
|
|
330
|
-
/**
|
|
331
|
-
* Decodes BuyERC20 callback data into positions.
|
|
332
|
-
* @param data - The ABI-encoded callback data containing token addresses and amounts.
|
|
333
|
-
* @returns Array of positions with contract address and amount.
|
|
334
|
-
* @throws If data is empty, malformed, or arrays have mismatched lengths.
|
|
335
|
-
*/
|
|
336
|
-
declare function decodeBuyERC20(data: Hex): Array<{
|
|
337
|
-
contract: Address;
|
|
338
|
-
amount: bigint;
|
|
339
|
-
}>;
|
|
340
|
-
/**
|
|
341
|
-
* Encodes BuyERC20 callback parameters into ABI-encoded data.
|
|
342
|
-
* @param parameters - The tokens and amounts to encode.
|
|
343
|
-
* @returns ABI-encoded hex string.
|
|
344
|
-
*/
|
|
345
|
-
declare function encodeBuyERC20(parameters: {
|
|
346
|
-
tokens: Address[];
|
|
347
|
-
amounts: bigint[];
|
|
348
|
-
}): Hex;
|
|
349
|
-
declare function decodeBuyVaultV1Callback(data: Hex): Array<{
|
|
350
|
-
contract: Address;
|
|
351
|
-
amount: bigint;
|
|
352
|
-
}>;
|
|
353
|
-
declare function decodeSellERC20Callback(data: Hex): Array<{
|
|
354
|
-
contract: Address;
|
|
355
|
-
amount: bigint;
|
|
356
|
-
}>;
|
|
357
|
-
declare function encodeBuyVaultV1Callback(parameters: {
|
|
358
|
-
vaults: Address[];
|
|
359
|
-
amounts: bigint[];
|
|
360
|
-
}): Hex;
|
|
361
|
-
declare function encodeSellERC20Callback(parameters: {
|
|
362
|
-
collaterals: Address[];
|
|
363
|
-
amounts: bigint[];
|
|
364
|
-
}): Hex;
|
|
365
290
|
declare namespace Errors_d_exports {
|
|
366
291
|
export { BaseError, GlobalErrorType, ReorgError };
|
|
367
292
|
}
|
|
@@ -481,6 +406,14 @@ type ChainRegistry = {
|
|
|
481
406
|
* @returns A registry for looking up chains by ID. {@link ChainRegistry}
|
|
482
407
|
*/
|
|
483
408
|
declare function create$6(chains: Chain$1[]): ChainRegistry;
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/core/types.d.ts
|
|
411
|
+
/** Combines members of an intersection into a readable type. */
|
|
412
|
+
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
413
|
+
declare const BrandTypeId: unique symbol;
|
|
414
|
+
type Brand<in out ID extends string | symbol> = {
|
|
415
|
+
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
416
|
+
};
|
|
484
417
|
declare namespace LLTV_d_exports {
|
|
485
418
|
export { InvalidLLTVError, InvalidOptionError$1 as InvalidOptionError, LLTV, LLTVSchema, Options, from$17 as from };
|
|
486
419
|
}
|
|
@@ -627,7 +560,7 @@ declare class DenominatorIsZeroError extends BaseError {
|
|
|
627
560
|
constructor();
|
|
628
561
|
}
|
|
629
562
|
declare namespace Liquidity_d_exports {
|
|
630
|
-
export { LiquidityLink, LiquidityPool, OfferLiquidityPool, calculateMaxDebt, generateAllowancePoolId, generateBalancePoolId,
|
|
563
|
+
export { LiquidityLink, LiquidityPool, OfferLiquidityPool, calculateMaxDebt, generateAllowancePoolId, generateBalancePoolId, generateDebtPoolId, generateMarketLiquidityPoolId, generateObligationCollateralPoolId, generateUserVaultPositionPoolId, generateVaultPositionPoolId };
|
|
631
564
|
}
|
|
632
565
|
/**
|
|
633
566
|
* Represents a liquidity pool with a unique ID and amount.
|
|
@@ -652,10 +585,7 @@ type OfferLiquidityPool = {
|
|
|
652
585
|
poolId: string;
|
|
653
586
|
/**
|
|
654
587
|
* The available capacity/liquidity from this pool for this offer.
|
|
655
|
-
*
|
|
656
|
-
* - BuyWithEmptyCallback: Matches allowance amount from pool bellow
|
|
657
|
-
* - SellERC20Callback: Sell Callback/Predeposited -> Maximum debt capacity calculated from collateral (collateralAmount * oraclePrice * lltv)
|
|
658
|
-
* - SellERC20Callback: Existing debt as negative value (reduces available capacity)
|
|
588
|
+
* Matches allowance amount from pool below.
|
|
659
589
|
*/
|
|
660
590
|
amount: bigint;
|
|
661
591
|
};
|
|
@@ -683,17 +613,6 @@ declare function generateAllowancePoolId(parameters: {
|
|
|
683
613
|
chainId: Id;
|
|
684
614
|
token: Address;
|
|
685
615
|
}): string;
|
|
686
|
-
/**
|
|
687
|
-
* Generate pool ID for sell ERC20 callback pools.
|
|
688
|
-
* Each offer has its own callback pool to prevent liquidity conflicts.
|
|
689
|
-
*/
|
|
690
|
-
declare function generateSellERC20CallbackPoolId(parameters: {
|
|
691
|
-
user: Address;
|
|
692
|
-
chainId: Id;
|
|
693
|
-
obligationId: Hex;
|
|
694
|
-
token: Address;
|
|
695
|
-
offerHash: Hex;
|
|
696
|
-
}): string;
|
|
697
616
|
/**
|
|
698
617
|
* Generate pool ID for obligation collateral pools.
|
|
699
618
|
* Obligation collateral pools represent collateral already deposited in the obligation.
|
|
@@ -705,15 +624,6 @@ declare function generateObligationCollateralPoolId(parameters: {
|
|
|
705
624
|
obligationId: Hex;
|
|
706
625
|
token: Address;
|
|
707
626
|
}): string;
|
|
708
|
-
/**
|
|
709
|
-
* Generate pool ID for buy vault callback pools.
|
|
710
|
-
*/
|
|
711
|
-
declare function generateBuyVaultCallbackPoolId(parameters: {
|
|
712
|
-
user: Address;
|
|
713
|
-
chainId: Id;
|
|
714
|
-
vault: Address;
|
|
715
|
-
offerHash: Hex;
|
|
716
|
-
}): string;
|
|
717
627
|
/**
|
|
718
628
|
* Generate pool ID for debt pools.
|
|
719
629
|
*/
|
|
@@ -950,7 +860,7 @@ declare class CollateralsAreNotSortedError extends BaseError {
|
|
|
950
860
|
constructor();
|
|
951
861
|
}
|
|
952
862
|
declare namespace Offer_d_exports {
|
|
953
|
-
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, domain, encode$1 as encode, from$13 as from, fromSnakeCase$1 as fromSnakeCase, hash, obligationId, random$1 as random, serialize, toSnakeCase, types };
|
|
863
|
+
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, domain, encode$1 as encode, from$13 as from, fromSnakeCase$1 as fromSnakeCase, hash, obligationId, random$1 as random, serialize, takeEvent, toSnakeCase, types };
|
|
954
864
|
}
|
|
955
865
|
type Offer = {
|
|
956
866
|
/** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
|
|
@@ -1207,6 +1117,80 @@ type OfferConsumed = {
|
|
|
1207
1117
|
amount: bigint;
|
|
1208
1118
|
blockNumber: number;
|
|
1209
1119
|
};
|
|
1120
|
+
/**
|
|
1121
|
+
* ABI for the Take event emitted by the Morpho V2 contract.
|
|
1122
|
+
*/
|
|
1123
|
+
declare const takeEvent: {
|
|
1124
|
+
readonly type: "event";
|
|
1125
|
+
readonly name: "Take";
|
|
1126
|
+
readonly inputs: readonly [{
|
|
1127
|
+
readonly name: "caller";
|
|
1128
|
+
readonly type: "address";
|
|
1129
|
+
readonly indexed: false;
|
|
1130
|
+
readonly internalType: "address";
|
|
1131
|
+
}, {
|
|
1132
|
+
readonly name: "id";
|
|
1133
|
+
readonly type: "bytes32";
|
|
1134
|
+
readonly indexed: true;
|
|
1135
|
+
readonly internalType: "bytes32";
|
|
1136
|
+
}, {
|
|
1137
|
+
readonly name: "maker";
|
|
1138
|
+
readonly type: "address";
|
|
1139
|
+
readonly indexed: true;
|
|
1140
|
+
readonly internalType: "address";
|
|
1141
|
+
}, {
|
|
1142
|
+
readonly name: "taker";
|
|
1143
|
+
readonly type: "address";
|
|
1144
|
+
readonly indexed: true;
|
|
1145
|
+
readonly internalType: "address";
|
|
1146
|
+
}, {
|
|
1147
|
+
readonly name: "offerIsBuy";
|
|
1148
|
+
readonly type: "bool";
|
|
1149
|
+
readonly indexed: false;
|
|
1150
|
+
readonly internalType: "bool";
|
|
1151
|
+
}, {
|
|
1152
|
+
readonly name: "buyerAssets";
|
|
1153
|
+
readonly type: "uint256";
|
|
1154
|
+
readonly indexed: false;
|
|
1155
|
+
readonly internalType: "uint256";
|
|
1156
|
+
}, {
|
|
1157
|
+
readonly name: "sellerAssets";
|
|
1158
|
+
readonly type: "uint256";
|
|
1159
|
+
readonly indexed: false;
|
|
1160
|
+
readonly internalType: "uint256";
|
|
1161
|
+
}, {
|
|
1162
|
+
readonly name: "obligationUnits";
|
|
1163
|
+
readonly type: "uint256";
|
|
1164
|
+
readonly indexed: false;
|
|
1165
|
+
readonly internalType: "uint256";
|
|
1166
|
+
}, {
|
|
1167
|
+
readonly name: "obligationShares";
|
|
1168
|
+
readonly type: "uint256";
|
|
1169
|
+
readonly indexed: false;
|
|
1170
|
+
readonly internalType: "uint256";
|
|
1171
|
+
}, {
|
|
1172
|
+
readonly name: "buyerIsLender";
|
|
1173
|
+
readonly type: "bool";
|
|
1174
|
+
readonly indexed: false;
|
|
1175
|
+
readonly internalType: "bool";
|
|
1176
|
+
}, {
|
|
1177
|
+
readonly name: "sellerIsBorrower";
|
|
1178
|
+
readonly type: "bool";
|
|
1179
|
+
readonly indexed: false;
|
|
1180
|
+
readonly internalType: "bool";
|
|
1181
|
+
}, {
|
|
1182
|
+
readonly name: "group";
|
|
1183
|
+
readonly type: "bytes32";
|
|
1184
|
+
readonly indexed: false;
|
|
1185
|
+
readonly internalType: "bytes32";
|
|
1186
|
+
}, {
|
|
1187
|
+
readonly name: "consumed";
|
|
1188
|
+
readonly type: "uint256";
|
|
1189
|
+
readonly indexed: false;
|
|
1190
|
+
readonly internalType: "uint256";
|
|
1191
|
+
}];
|
|
1192
|
+
readonly anonymous: false;
|
|
1193
|
+
};
|
|
1210
1194
|
/**
|
|
1211
1195
|
* ABI for the Consume event emitted by the Obligation contract.
|
|
1212
1196
|
*/
|
|
@@ -2412,16 +2396,6 @@ type ValidateOffersIssues = {
|
|
|
2412
2396
|
issues: ValidationIssue[];
|
|
2413
2397
|
};
|
|
2414
2398
|
type ValidateOffersData = ValidateOffersSuccess | ValidateOffersIssues;
|
|
2415
|
-
type CallbackType = Type$1 | "not_supported";
|
|
2416
|
-
type CallbackTypesRequest = {
|
|
2417
|
-
callbacks: Array<{
|
|
2418
|
-
chain_id: Id;
|
|
2419
|
-
addresses: Address[];
|
|
2420
|
-
}>;
|
|
2421
|
-
};
|
|
2422
|
-
type CallbackTypesResponse = Array<{
|
|
2423
|
-
chain_id: Id;
|
|
2424
|
-
} & Partial<Record<CallbackType, Address[]>>>;
|
|
2425
2399
|
type ConfigRulesPayload = SuccessPayload<ConfigRule[]> | ErrorPayload;
|
|
2426
2400
|
type SuccessPayload<T> = {
|
|
2427
2401
|
meta: {
|
|
@@ -2458,8 +2432,7 @@ type GatekeeperClient = {
|
|
|
2458
2432
|
statusCode: number;
|
|
2459
2433
|
body: ConfigRulesPayload;
|
|
2460
2434
|
}>; /** Validate offers and return decision results. */
|
|
2461
|
-
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>; /**
|
|
2462
|
-
getCallbackTypes: (request: CallbackTypesRequest) => Promise<CallbackTypesResponse>; /** Base URL for the gatekeeper service. */
|
|
2435
|
+
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>; /** Base URL for the gatekeeper service. */
|
|
2463
2436
|
baseUrl: string;
|
|
2464
2437
|
};
|
|
2465
2438
|
type ClientConfig = {
|
|
@@ -2781,7 +2754,7 @@ interface paths {
|
|
|
2781
2754
|
};
|
|
2782
2755
|
/**
|
|
2783
2756
|
* Get config rules
|
|
2784
|
-
* @description Returns configured rules for supported chains.
|
|
2757
|
+
* @description Returns configured rules (maturities, loan tokens, oracles) for supported chains.
|
|
2785
2758
|
*/
|
|
2786
2759
|
get: {
|
|
2787
2760
|
parameters: {
|
|
@@ -3238,7 +3211,7 @@ interface paths {
|
|
|
3238
3211
|
put?: never;
|
|
3239
3212
|
/**
|
|
3240
3213
|
* Validate offers
|
|
3241
|
-
* @description Validates offers against router validation rules. Returns unsigned payload + root on success, or issues only on validation failure.
|
|
3214
|
+
* @description Validates offers against router validation rules. Only empty callbacks (zero address, 0x data) are accepted. Returns unsigned payload + root on success, or issues only on validation failure.
|
|
3242
3215
|
*/
|
|
3243
3216
|
post: {
|
|
3244
3217
|
parameters: {
|
|
@@ -3277,56 +3250,6 @@ interface paths {
|
|
|
3277
3250
|
patch?: never;
|
|
3278
3251
|
trace?: never;
|
|
3279
3252
|
};
|
|
3280
|
-
"/v1/callbacks": {
|
|
3281
|
-
parameters: {
|
|
3282
|
-
query?: never;
|
|
3283
|
-
header?: never;
|
|
3284
|
-
path?: never;
|
|
3285
|
-
cookie?: never;
|
|
3286
|
-
};
|
|
3287
|
-
get?: never;
|
|
3288
|
-
put?: never;
|
|
3289
|
-
/**
|
|
3290
|
-
* Resolve callback types
|
|
3291
|
-
* @description Returns callback types for callback addresses grouped by chain.
|
|
3292
|
-
*/
|
|
3293
|
-
post: {
|
|
3294
|
-
parameters: {
|
|
3295
|
-
query?: never;
|
|
3296
|
-
header?: never;
|
|
3297
|
-
path?: never;
|
|
3298
|
-
cookie?: never;
|
|
3299
|
-
};
|
|
3300
|
-
requestBody?: {
|
|
3301
|
-
content: {
|
|
3302
|
-
"application/json": components["schemas"]["CallbackTypesRequest"];
|
|
3303
|
-
};
|
|
3304
|
-
};
|
|
3305
|
-
responses: {
|
|
3306
|
-
/** @description Success */200: {
|
|
3307
|
-
headers: {
|
|
3308
|
-
[name: string]: unknown;
|
|
3309
|
-
};
|
|
3310
|
-
content: {
|
|
3311
|
-
"application/json": components["schemas"]["CallbackTypesSuccessResponse"];
|
|
3312
|
-
};
|
|
3313
|
-
}; /** @description Bad Request */
|
|
3314
|
-
400: {
|
|
3315
|
-
headers: {
|
|
3316
|
-
[name: string]: unknown;
|
|
3317
|
-
};
|
|
3318
|
-
content: {
|
|
3319
|
-
"application/json": components["schemas"]["BadRequestResponse"];
|
|
3320
|
-
};
|
|
3321
|
-
};
|
|
3322
|
-
};
|
|
3323
|
-
};
|
|
3324
|
-
delete?: never;
|
|
3325
|
-
options?: never;
|
|
3326
|
-
head?: never;
|
|
3327
|
-
patch?: never;
|
|
3328
|
-
trace?: never;
|
|
3329
|
-
};
|
|
3330
3253
|
}
|
|
3331
3254
|
interface components {
|
|
3332
3255
|
schemas: {
|
|
@@ -3411,12 +3334,6 @@ interface components {
|
|
|
3411
3334
|
* "timestamp": 1730415600
|
|
3412
3335
|
* },
|
|
3413
3336
|
* {
|
|
3414
|
-
* "type": "callback",
|
|
3415
|
-
* "chain_id": 1,
|
|
3416
|
-
* "address": "0x1111111111111111111111111111111111111111",
|
|
3417
|
-
* "callback_type": "sell_erc20_callback"
|
|
3418
|
-
* },
|
|
3419
|
-
* {
|
|
3420
3337
|
* "type": "loan_token",
|
|
3421
3338
|
* "chain_id": 1,
|
|
3422
3339
|
* "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
@@ -3438,9 +3355,8 @@ interface components {
|
|
|
3438
3355
|
/** @example maturity */type: string; /** @example 1 */
|
|
3439
3356
|
chain_id: number; /** @example end_of_next_month */
|
|
3440
3357
|
name?: string; /** @example 1730415600 */
|
|
3441
|
-
timestamp?: number; /** @example
|
|
3442
|
-
address?: string;
|
|
3443
|
-
callback_type?: string;
|
|
3358
|
+
timestamp?: number; /** @example 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 */
|
|
3359
|
+
address?: string;
|
|
3444
3360
|
};
|
|
3445
3361
|
OfferListResponse: {
|
|
3446
3362
|
meta: components["schemas"]["Meta"];
|
|
@@ -3475,8 +3391,8 @@ interface components {
|
|
|
3475
3391
|
* "price": "2750000000000000000",
|
|
3476
3392
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
3477
3393
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3478
|
-
* "callback": "
|
|
3479
|
-
* "callback_data": "
|
|
3394
|
+
* "callback": "0x0000000000000000000000000000000000000000",
|
|
3395
|
+
* "callback_data": "0x"
|
|
3480
3396
|
* },
|
|
3481
3397
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
3482
3398
|
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc",
|
|
@@ -3519,8 +3435,8 @@ interface components {
|
|
|
3519
3435
|
* "price": "2750000000000000000",
|
|
3520
3436
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
3521
3437
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3522
|
-
* "callback": "
|
|
3523
|
-
* "callback_data": "
|
|
3438
|
+
* "callback": "0x0000000000000000000000000000000000000000",
|
|
3439
|
+
* "callback_data": "0x"
|
|
3524
3440
|
* }
|
|
3525
3441
|
*/
|
|
3526
3442
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
@@ -3564,8 +3480,8 @@ interface components {
|
|
|
3564
3480
|
expiry: number; /** @example 2750000000000000000 */
|
|
3565
3481
|
price: string; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
3566
3482
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
3567
|
-
session: string; /** @example
|
|
3568
|
-
callback: string; /** @example
|
|
3483
|
+
session: string; /** @example 0x0000000000000000000000000000000000000000 */
|
|
3484
|
+
callback: string; /** @example 0x */
|
|
3569
3485
|
callback_data: string;
|
|
3570
3486
|
};
|
|
3571
3487
|
ObligationOfferResponse: {
|
|
@@ -3754,8 +3670,8 @@ interface components {
|
|
|
3754
3670
|
collaterals: components["schemas"]["ValidateCollateralRequest"][];
|
|
3755
3671
|
/**
|
|
3756
3672
|
* @example {
|
|
3757
|
-
* "address": "
|
|
3758
|
-
* "data": "
|
|
3673
|
+
* "address": "0x0000000000000000000000000000000000000000",
|
|
3674
|
+
* "data": "0x"
|
|
3759
3675
|
* }
|
|
3760
3676
|
*/
|
|
3761
3677
|
callback: components["schemas"]["ValidateCallbackRequest"];
|
|
@@ -3766,7 +3682,7 @@ interface components {
|
|
|
3766
3682
|
lltv: string;
|
|
3767
3683
|
};
|
|
3768
3684
|
ValidateCallbackRequest: {
|
|
3769
|
-
/** @example
|
|
3685
|
+
/** @example 0x0000000000000000000000000000000000000000 */address: string; /** @example 0x */
|
|
3770
3686
|
data: string;
|
|
3771
3687
|
};
|
|
3772
3688
|
ValidationSuccessResponse: {
|
|
@@ -3786,84 +3702,6 @@ interface components {
|
|
|
3786
3702
|
*/
|
|
3787
3703
|
root: string;
|
|
3788
3704
|
};
|
|
3789
|
-
CallbackTypesRequest: {
|
|
3790
|
-
/**
|
|
3791
|
-
* @example [
|
|
3792
|
-
* {
|
|
3793
|
-
* "chain_id": 1,
|
|
3794
|
-
* "addresses": [
|
|
3795
|
-
* "0x1111111111111111111111111111111111111111",
|
|
3796
|
-
* "0x3333333333333333333333333333333333333333",
|
|
3797
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3798
|
-
* ]
|
|
3799
|
-
* }
|
|
3800
|
-
* ]
|
|
3801
|
-
*/
|
|
3802
|
-
callbacks: components["schemas"]["CallbackTypesChainRequest"][];
|
|
3803
|
-
};
|
|
3804
|
-
CallbackTypesChainRequest: {
|
|
3805
|
-
/** @example 1 */chain_id: number;
|
|
3806
|
-
/**
|
|
3807
|
-
* @example [
|
|
3808
|
-
* "0x1111111111111111111111111111111111111111",
|
|
3809
|
-
* "0x3333333333333333333333333333333333333333",
|
|
3810
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3811
|
-
* ]
|
|
3812
|
-
*/
|
|
3813
|
-
addresses: string[];
|
|
3814
|
-
};
|
|
3815
|
-
CallbackTypesSuccessResponse: {
|
|
3816
|
-
meta: components["schemas"]["Meta"]; /** @example maturity:1:1730415600:end_of_next_month */
|
|
3817
|
-
cursor: string | null;
|
|
3818
|
-
/**
|
|
3819
|
-
* @description Callback types grouped by chain.
|
|
3820
|
-
* @example [
|
|
3821
|
-
* {
|
|
3822
|
-
* "chain_id": 1,
|
|
3823
|
-
* "sell_erc20_callback": [
|
|
3824
|
-
* "0x1111111111111111111111111111111111111111"
|
|
3825
|
-
* ],
|
|
3826
|
-
* "buy_erc20": [
|
|
3827
|
-
* "0x5555555555555555555555555555555555555555"
|
|
3828
|
-
* ],
|
|
3829
|
-
* "buy_vault_v1_callback": [
|
|
3830
|
-
* "0x3333333333333333333333333333333333333333"
|
|
3831
|
-
* ],
|
|
3832
|
-
* "not_supported": [
|
|
3833
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3834
|
-
* ]
|
|
3835
|
-
* }
|
|
3836
|
-
* ]
|
|
3837
|
-
*/
|
|
3838
|
-
data: components["schemas"]["CallbackTypesChainResponse"][];
|
|
3839
|
-
};
|
|
3840
|
-
CallbackTypesChainResponse: {
|
|
3841
|
-
/** @example 1 */chain_id: number;
|
|
3842
|
-
/**
|
|
3843
|
-
* @example [
|
|
3844
|
-
* "0x3333333333333333333333333333333333333333"
|
|
3845
|
-
* ]
|
|
3846
|
-
*/
|
|
3847
|
-
buy_vault_v1_callback?: string[];
|
|
3848
|
-
/**
|
|
3849
|
-
* @example [
|
|
3850
|
-
* "0x1111111111111111111111111111111111111111"
|
|
3851
|
-
* ]
|
|
3852
|
-
*/
|
|
3853
|
-
sell_erc20_callback?: string[];
|
|
3854
|
-
/**
|
|
3855
|
-
* @example [
|
|
3856
|
-
* "0x5555555555555555555555555555555555555555"
|
|
3857
|
-
* ]
|
|
3858
|
-
*/
|
|
3859
|
-
buy_erc20?: string[];
|
|
3860
|
-
/**
|
|
3861
|
-
* @example [
|
|
3862
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3863
|
-
* ]
|
|
3864
|
-
*/
|
|
3865
|
-
not_supported: string[];
|
|
3866
|
-
};
|
|
3867
3705
|
};
|
|
3868
3706
|
responses: never;
|
|
3869
3707
|
parameters: never;
|
|
@@ -3932,9 +3770,6 @@ declare class BooksController {
|
|
|
3932
3770
|
declare class ValidateController {
|
|
3933
3771
|
validateOffers(): Promise<void>;
|
|
3934
3772
|
}
|
|
3935
|
-
declare class CallbacksController {
|
|
3936
|
-
resolveCallbackTypes(): Promise<void>;
|
|
3937
|
-
}
|
|
3938
3773
|
declare class OffersController {
|
|
3939
3774
|
getOffers(): Promise<void>;
|
|
3940
3775
|
}
|
|
@@ -3981,25 +3816,25 @@ declare const schemas: {
|
|
|
3981
3816
|
strict: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodEnum<{
|
|
3982
3817
|
0: "0";
|
|
3983
3818
|
1: "1";
|
|
3984
|
-
false: "false";
|
|
3985
3819
|
true: "true";
|
|
3986
|
-
|
|
3820
|
+
false: "false";
|
|
3821
|
+
}>, z$1.ZodTransform<boolean, "0" | "1" | "true" | "false">>>;
|
|
3987
3822
|
}, z$1.core.$strip>;
|
|
3988
3823
|
readonly get_health_collectors: z$1.ZodObject<{
|
|
3989
3824
|
strict: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodEnum<{
|
|
3990
3825
|
0: "0";
|
|
3991
3826
|
1: "1";
|
|
3992
|
-
false: "false";
|
|
3993
3827
|
true: "true";
|
|
3994
|
-
|
|
3828
|
+
false: "false";
|
|
3829
|
+
}>, z$1.ZodTransform<boolean, "0" | "1" | "true" | "false">>>;
|
|
3995
3830
|
}, z$1.core.$strip>;
|
|
3996
3831
|
readonly get_health_chains: z$1.ZodObject<{
|
|
3997
3832
|
strict: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodEnum<{
|
|
3998
3833
|
0: "0";
|
|
3999
3834
|
1: "1";
|
|
4000
|
-
false: "false";
|
|
4001
3835
|
true: "true";
|
|
4002
|
-
|
|
3836
|
+
false: "false";
|
|
3837
|
+
}>, z$1.ZodTransform<boolean, "0" | "1" | "true" | "false">>>;
|
|
4003
3838
|
}, z$1.core.$strip>;
|
|
4004
3839
|
readonly get_config_contracts: z$1.ZodObject<{
|
|
4005
3840
|
cursor: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -4062,12 +3897,6 @@ declare const schemas: {
|
|
|
4062
3897
|
readonly validate_offers: z$1.ZodObject<{
|
|
4063
3898
|
offers: z$1.ZodArray<z$1.ZodUnknown>;
|
|
4064
3899
|
}, z$1.core.$strict>;
|
|
4065
|
-
readonly callback_types: z$1.ZodObject<{
|
|
4066
|
-
callbacks: z$1.ZodArray<z$1.ZodObject<{
|
|
4067
|
-
chain_id: z$1.ZodNumber;
|
|
4068
|
-
addresses: z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>>;
|
|
4069
|
-
}, z$1.core.$strict>>;
|
|
4070
|
-
}, z$1.core.$strict>;
|
|
4071
3900
|
readonly get_user_positions: z$1.ZodObject<{
|
|
4072
3901
|
user_address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
4073
3902
|
cursor: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -4195,16 +4024,6 @@ declare function getOffers$1(queryParameters: object, db: Database): Promise<Pay
|
|
|
4195
4024
|
* @returns Paginated list of positions with remaining balances.
|
|
4196
4025
|
*/
|
|
4197
4026
|
declare function getUserPositions(queryParameters: object, db: Database): Promise<Payload<PositionResponse[]>>;
|
|
4198
|
-
//#endregion
|
|
4199
|
-
//#region src/api/Controllers/resolveCallbackTypes.d.ts
|
|
4200
|
-
type CallbackTypesPayload = SuccessPayload$1<CallbackTypesResponse>;
|
|
4201
|
-
/**
|
|
4202
|
-
* Resolve callback types for a list of callback addresses grouped by chain.
|
|
4203
|
-
* @param body - Request body with callback addresses. {@link CallbackTypesRequest}
|
|
4204
|
-
* @param chains - Chains to resolve callback types against. {@link Chain.Chain}
|
|
4205
|
-
* @returns Callback types grouped by chain. {@link CallbackTypesPayload}
|
|
4206
|
-
*/
|
|
4207
|
-
declare function resolveCallbackTypes(body: object, chains: Chain$1[]): Promise<CallbackTypesPayload | ErrorPayload$1>;
|
|
4208
4027
|
declare namespace Gatekeeper_d_exports {
|
|
4209
4028
|
export { Gatekeeper, Rules, create };
|
|
4210
4029
|
}
|
|
@@ -4238,10 +4057,10 @@ type ValidateOffersIssuesPayload = SuccessPayload$1<{
|
|
|
4238
4057
|
type ValidateOffersResponse = ValidateOffersSuccessPayload | ValidateOffersIssuesPayload;
|
|
4239
4058
|
declare function validateOffers(body: object, gatekeeper: Gatekeeper): Promise<ValidateOffersResponse | ErrorPayload$1>;
|
|
4240
4059
|
declare namespace index_d_exports$4 {
|
|
4241
|
-
export { CONFIG_CONTRACT_NAMES, ConfigContract, ConfigContractName, GetOffersQueryParams, ValidationIssue$1 as ValidationIssue, getBook, getConfigContracts, getConfigRules, getDocsHtml, getHealth, getHealthChains, getHealthCollectors, getIntegratorDocsHtml, getObligation, getObligations$1 as getObligations, getOffers$1 as getOffers, getOffersQuery, getSwaggerJson, getUserPositions,
|
|
4060
|
+
export { CONFIG_CONTRACT_NAMES, ConfigContract, ConfigContractName, GetOffersQueryParams, ValidationIssue$1 as ValidationIssue, getBook, getConfigContracts, getConfigRules, getDocsHtml, getHealth, getHealthChains, getHealthCollectors, getIntegratorDocsHtml, getObligation, getObligations$1 as getObligations, getOffers$1 as getOffers, getOffersQuery, getSwaggerJson, getUserPositions, validateOffers };
|
|
4242
4061
|
}
|
|
4243
4062
|
declare namespace RouterApi_d_exports {
|
|
4244
|
-
export { ApiConfig, BookResponse_d_exports as BookResponse, BooksController,
|
|
4063
|
+
export { ApiConfig, BookResponse_d_exports as BookResponse, BooksController, ChainHealth, ChainsHealthResponse, CollectorHealth, CollectorsHealthResponse, ConfigContractsController, ConfigRulesController, index_d_exports$4 as Controllers, HealthController, ObligationResponse_d_exports as ObligationResponse, ObligationsController, OfferResponse_d_exports as OfferResponse, OffersController, OpenApi, PositionResponse_d_exports as PositionResponse, RouterApi, RouterStatusResponse, UsersController, ValidateController, create$1 as create, from$5 as from, parse, safeParse };
|
|
4245
4064
|
}
|
|
4246
4065
|
declare namespace Client_d_exports$1 {
|
|
4247
4066
|
export { Client$3 as Client, ConnectOptions, HttpForbiddenError, HttpGetApiFailedError, HttpRateLimitError, HttpUnauthorizedError, InvalidUrlError, connect$1 as connect, getObligations, getOffers };
|
|
@@ -6408,10 +6227,10 @@ type ValidityParameters = {
|
|
|
6408
6227
|
/**
|
|
6409
6228
|
* set of rules to validate offers.
|
|
6410
6229
|
*
|
|
6411
|
-
* @param
|
|
6230
|
+
* @param _parameters - Validity parameters with chain and client
|
|
6412
6231
|
* @returns Array of validation rules to evaluate against offers
|
|
6413
6232
|
*/
|
|
6414
|
-
declare function validity(
|
|
6233
|
+
declare function validity(_parameters: ValidityParameters): Rule<Offer, "expiry">[];
|
|
6415
6234
|
declare const chains: ({
|
|
6416
6235
|
chains
|
|
6417
6236
|
}: {
|
|
@@ -6423,8 +6242,7 @@ declare const maturity: ({
|
|
|
6423
6242
|
maturities: MaturityType[];
|
|
6424
6243
|
}) => Rule<Offer, "maturity">;
|
|
6425
6244
|
declare const callback: ({
|
|
6426
|
-
callbacks
|
|
6427
|
-
allowedAddresses
|
|
6245
|
+
callbacks
|
|
6428
6246
|
}: {
|
|
6429
6247
|
callbacks: Type$1[];
|
|
6430
6248
|
allowedAddresses: Address[];
|
|
@@ -6695,5 +6513,5 @@ declare namespace index_d_exports$3 {
|
|
|
6695
6513
|
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 };
|
|
6696
6514
|
}
|
|
6697
6515
|
//#endregion
|
|
6698
|
-
export { index_d_exports as Abi, BookResponse_d_exports as BookResponse, BooksController, Brand, BrandTypeId, Callback_d_exports as Callback,
|
|
6516
|
+
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, 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 };
|
|
6699
6517
|
//# sourceMappingURL=index.node.d.ts.map
|