@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.browser.d.ts
CHANGED
|
@@ -29,9 +29,9 @@ declare const CollectorHealth: z.ZodObject<{
|
|
|
29
29
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
30
30
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
31
31
|
status: z.ZodEnum<{
|
|
32
|
-
unknown: "unknown";
|
|
33
32
|
live: "live";
|
|
34
33
|
lagging: "lagging";
|
|
34
|
+
unknown: "unknown";
|
|
35
35
|
}>;
|
|
36
36
|
initialized: z.ZodBoolean;
|
|
37
37
|
}, z.core.$strip>;
|
|
@@ -42,9 +42,9 @@ declare const CollectorsHealthResponse: z.ZodArray<z.ZodObject<{
|
|
|
42
42
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
43
43
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
44
44
|
status: z.ZodEnum<{
|
|
45
|
-
unknown: "unknown";
|
|
46
45
|
live: "live";
|
|
47
46
|
lagging: "lagging";
|
|
47
|
+
unknown: "unknown";
|
|
48
48
|
}>;
|
|
49
49
|
initialized: z.ZodBoolean;
|
|
50
50
|
}, z.core.$strip>>;
|
|
@@ -339,94 +339,19 @@ declare const Morpho: readonly [{
|
|
|
339
339
|
}];
|
|
340
340
|
readonly stateMutability: "view";
|
|
341
341
|
}];
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region src/core/types.d.ts
|
|
344
|
-
/** Combines members of an intersection into a readable type. */
|
|
345
|
-
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
346
|
-
declare const BrandTypeId: unique symbol;
|
|
347
|
-
type Brand<in out ID extends string | symbol> = {
|
|
348
|
-
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
349
|
-
};
|
|
350
342
|
declare namespace Callback_d_exports {
|
|
351
|
-
export {
|
|
343
|
+
export { Callback, Type$1 as Type, isEmptyCallback };
|
|
352
344
|
}
|
|
353
|
-
/** A position decoded from callback data. */
|
|
354
|
-
type CallbackPosition = {
|
|
355
|
-
/** The ERC20 token contract address. */contract: Address; /** The maximum amount available from this position. */
|
|
356
|
-
amount: bigint;
|
|
357
|
-
};
|
|
358
345
|
type Callback = {
|
|
359
346
|
type: Type$1.BuyWithEmptyCallback;
|
|
360
|
-
} |
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
} & {
|
|
364
|
-
type: Type$1.BuyERC20; /** The decoded callback inputs. */
|
|
365
|
-
inputs: {
|
|
366
|
-
/** The ERC20 positions available for the callback. */positions: CallbackPosition[];
|
|
367
|
-
};
|
|
368
|
-
}) & Brand<"Callback">);
|
|
347
|
+
} | {
|
|
348
|
+
type: Type$1.SellWithEmptyCallback;
|
|
349
|
+
};
|
|
369
350
|
declare enum Type$1 {
|
|
370
351
|
BuyWithEmptyCallback = "buy_with_empty_callback",
|
|
371
|
-
|
|
372
|
-
BuyVaultV1Callback = "buy_vault_v1_callback",
|
|
373
|
-
SellERC20Callback = "sell_erc20_callback"
|
|
352
|
+
SellWithEmptyCallback = "sell_with_empty_callback"
|
|
374
353
|
}
|
|
375
354
|
declare const isEmptyCallback: (offer: Offer) => boolean;
|
|
376
|
-
declare function decode$2(type: Type$1, data: Hex): {
|
|
377
|
-
contract: Address;
|
|
378
|
-
amount: bigint;
|
|
379
|
-
}[];
|
|
380
|
-
type BuyERC20Data = {
|
|
381
|
-
tokens: Address[];
|
|
382
|
-
amounts: bigint[];
|
|
383
|
-
};
|
|
384
|
-
type BuyVaultV1CallbackData = {
|
|
385
|
-
vaults: Address[];
|
|
386
|
-
amounts: bigint[];
|
|
387
|
-
};
|
|
388
|
-
type SellERC20CallbackData = {
|
|
389
|
-
collaterals: Address[];
|
|
390
|
-
amounts: bigint[];
|
|
391
|
-
};
|
|
392
|
-
declare function encode$2(type: Type$1.BuyERC20, data: BuyERC20Data): Hex;
|
|
393
|
-
declare function encode$2(type: Type$1.BuyVaultV1Callback, data: BuyVaultV1CallbackData): Hex;
|
|
394
|
-
declare function encode$2(type: Type$1.SellERC20Callback, data: SellERC20CallbackData): Hex;
|
|
395
|
-
/**
|
|
396
|
-
* Decodes BuyERC20 callback data into positions.
|
|
397
|
-
* @param data - The ABI-encoded callback data containing token addresses and amounts.
|
|
398
|
-
* @returns Array of positions with contract address and amount.
|
|
399
|
-
* @throws If data is empty, malformed, or arrays have mismatched lengths.
|
|
400
|
-
*/
|
|
401
|
-
declare function decodeBuyERC20(data: Hex): Array<{
|
|
402
|
-
contract: Address;
|
|
403
|
-
amount: bigint;
|
|
404
|
-
}>;
|
|
405
|
-
/**
|
|
406
|
-
* Encodes BuyERC20 callback parameters into ABI-encoded data.
|
|
407
|
-
* @param parameters - The tokens and amounts to encode.
|
|
408
|
-
* @returns ABI-encoded hex string.
|
|
409
|
-
*/
|
|
410
|
-
declare function encodeBuyERC20(parameters: {
|
|
411
|
-
tokens: Address[];
|
|
412
|
-
amounts: bigint[];
|
|
413
|
-
}): Hex;
|
|
414
|
-
declare function decodeBuyVaultV1Callback(data: Hex): Array<{
|
|
415
|
-
contract: Address;
|
|
416
|
-
amount: bigint;
|
|
417
|
-
}>;
|
|
418
|
-
declare function decodeSellERC20Callback(data: Hex): Array<{
|
|
419
|
-
contract: Address;
|
|
420
|
-
amount: bigint;
|
|
421
|
-
}>;
|
|
422
|
-
declare function encodeBuyVaultV1Callback(parameters: {
|
|
423
|
-
vaults: Address[];
|
|
424
|
-
amounts: bigint[];
|
|
425
|
-
}): Hex;
|
|
426
|
-
declare function encodeSellERC20Callback(parameters: {
|
|
427
|
-
collaterals: Address[];
|
|
428
|
-
amounts: bigint[];
|
|
429
|
-
}): Hex;
|
|
430
355
|
declare namespace Errors_d_exports {
|
|
431
356
|
export { BaseError, GlobalErrorType, ReorgError };
|
|
432
357
|
}
|
|
@@ -546,6 +471,14 @@ type ChainRegistry = {
|
|
|
546
471
|
* @returns A registry for looking up chains by ID. {@link ChainRegistry}
|
|
547
472
|
*/
|
|
548
473
|
declare function create$1(chains: Chain$1[]): ChainRegistry;
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/core/types.d.ts
|
|
476
|
+
/** Combines members of an intersection into a readable type. */
|
|
477
|
+
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
478
|
+
declare const BrandTypeId: unique symbol;
|
|
479
|
+
type Brand<in out ID extends string | symbol> = {
|
|
480
|
+
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
481
|
+
};
|
|
549
482
|
declare namespace LLTV_d_exports {
|
|
550
483
|
export { InvalidLLTVError, InvalidOptionError$1 as InvalidOptionError, LLTV, LLTVSchema, Options, from$14 as from };
|
|
551
484
|
}
|
|
@@ -692,7 +625,7 @@ declare class DenominatorIsZeroError extends BaseError {
|
|
|
692
625
|
constructor();
|
|
693
626
|
}
|
|
694
627
|
declare namespace Liquidity_d_exports {
|
|
695
|
-
export { LiquidityLink, LiquidityPool, OfferLiquidityPool, calculateMaxDebt, generateAllowancePoolId, generateBalancePoolId,
|
|
628
|
+
export { LiquidityLink, LiquidityPool, OfferLiquidityPool, calculateMaxDebt, generateAllowancePoolId, generateBalancePoolId, generateDebtPoolId, generateMarketLiquidityPoolId, generateObligationCollateralPoolId, generateUserVaultPositionPoolId, generateVaultPositionPoolId };
|
|
696
629
|
}
|
|
697
630
|
/**
|
|
698
631
|
* Represents a liquidity pool with a unique ID and amount.
|
|
@@ -717,10 +650,7 @@ type OfferLiquidityPool = {
|
|
|
717
650
|
poolId: string;
|
|
718
651
|
/**
|
|
719
652
|
* The available capacity/liquidity from this pool for this offer.
|
|
720
|
-
*
|
|
721
|
-
* - BuyWithEmptyCallback: Matches allowance amount from pool bellow
|
|
722
|
-
* - SellERC20Callback: Sell Callback/Predeposited -> Maximum debt capacity calculated from collateral (collateralAmount * oraclePrice * lltv)
|
|
723
|
-
* - SellERC20Callback: Existing debt as negative value (reduces available capacity)
|
|
653
|
+
* Matches allowance amount from pool below.
|
|
724
654
|
*/
|
|
725
655
|
amount: bigint;
|
|
726
656
|
};
|
|
@@ -748,17 +678,6 @@ declare function generateAllowancePoolId(parameters: {
|
|
|
748
678
|
chainId: Id;
|
|
749
679
|
token: Address;
|
|
750
680
|
}): string;
|
|
751
|
-
/**
|
|
752
|
-
* Generate pool ID for sell ERC20 callback pools.
|
|
753
|
-
* Each offer has its own callback pool to prevent liquidity conflicts.
|
|
754
|
-
*/
|
|
755
|
-
declare function generateSellERC20CallbackPoolId(parameters: {
|
|
756
|
-
user: Address;
|
|
757
|
-
chainId: Id;
|
|
758
|
-
obligationId: Hex;
|
|
759
|
-
token: Address;
|
|
760
|
-
offerHash: Hex;
|
|
761
|
-
}): string;
|
|
762
681
|
/**
|
|
763
682
|
* Generate pool ID for obligation collateral pools.
|
|
764
683
|
* Obligation collateral pools represent collateral already deposited in the obligation.
|
|
@@ -770,15 +689,6 @@ declare function generateObligationCollateralPoolId(parameters: {
|
|
|
770
689
|
obligationId: Hex;
|
|
771
690
|
token: Address;
|
|
772
691
|
}): string;
|
|
773
|
-
/**
|
|
774
|
-
* Generate pool ID for buy vault callback pools.
|
|
775
|
-
*/
|
|
776
|
-
declare function generateBuyVaultCallbackPoolId(parameters: {
|
|
777
|
-
user: Address;
|
|
778
|
-
chainId: Id;
|
|
779
|
-
vault: Address;
|
|
780
|
-
offerHash: Hex;
|
|
781
|
-
}): string;
|
|
782
692
|
/**
|
|
783
693
|
* Generate pool ID for debt pools.
|
|
784
694
|
*/
|
|
@@ -1015,7 +925,7 @@ declare class CollateralsAreNotSortedError extends BaseError {
|
|
|
1015
925
|
constructor();
|
|
1016
926
|
}
|
|
1017
927
|
declare namespace Offer_d_exports {
|
|
1018
|
-
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, domain, encode$1 as encode, from$10 as from, fromSnakeCase$1 as fromSnakeCase, hash, obligationId, random$1 as random, serialize, toSnakeCase, types };
|
|
928
|
+
export { InvalidOfferError, Offer, OfferConsumed, OfferInput, OfferSchema, RandomConfig, Status, Validation, consumedEvent, decode$1 as decode, domain, encode$1 as encode, from$10 as from, fromSnakeCase$1 as fromSnakeCase, hash, obligationId, random$1 as random, serialize, takeEvent, toSnakeCase, types };
|
|
1019
929
|
}
|
|
1020
930
|
type Offer = {
|
|
1021
931
|
/** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
|
|
@@ -1272,6 +1182,80 @@ type OfferConsumed = {
|
|
|
1272
1182
|
amount: bigint;
|
|
1273
1183
|
blockNumber: number;
|
|
1274
1184
|
};
|
|
1185
|
+
/**
|
|
1186
|
+
* ABI for the Take event emitted by the Morpho V2 contract.
|
|
1187
|
+
*/
|
|
1188
|
+
declare const takeEvent: {
|
|
1189
|
+
readonly type: "event";
|
|
1190
|
+
readonly name: "Take";
|
|
1191
|
+
readonly inputs: readonly [{
|
|
1192
|
+
readonly name: "caller";
|
|
1193
|
+
readonly type: "address";
|
|
1194
|
+
readonly indexed: false;
|
|
1195
|
+
readonly internalType: "address";
|
|
1196
|
+
}, {
|
|
1197
|
+
readonly name: "id";
|
|
1198
|
+
readonly type: "bytes32";
|
|
1199
|
+
readonly indexed: true;
|
|
1200
|
+
readonly internalType: "bytes32";
|
|
1201
|
+
}, {
|
|
1202
|
+
readonly name: "maker";
|
|
1203
|
+
readonly type: "address";
|
|
1204
|
+
readonly indexed: true;
|
|
1205
|
+
readonly internalType: "address";
|
|
1206
|
+
}, {
|
|
1207
|
+
readonly name: "taker";
|
|
1208
|
+
readonly type: "address";
|
|
1209
|
+
readonly indexed: true;
|
|
1210
|
+
readonly internalType: "address";
|
|
1211
|
+
}, {
|
|
1212
|
+
readonly name: "offerIsBuy";
|
|
1213
|
+
readonly type: "bool";
|
|
1214
|
+
readonly indexed: false;
|
|
1215
|
+
readonly internalType: "bool";
|
|
1216
|
+
}, {
|
|
1217
|
+
readonly name: "buyerAssets";
|
|
1218
|
+
readonly type: "uint256";
|
|
1219
|
+
readonly indexed: false;
|
|
1220
|
+
readonly internalType: "uint256";
|
|
1221
|
+
}, {
|
|
1222
|
+
readonly name: "sellerAssets";
|
|
1223
|
+
readonly type: "uint256";
|
|
1224
|
+
readonly indexed: false;
|
|
1225
|
+
readonly internalType: "uint256";
|
|
1226
|
+
}, {
|
|
1227
|
+
readonly name: "obligationUnits";
|
|
1228
|
+
readonly type: "uint256";
|
|
1229
|
+
readonly indexed: false;
|
|
1230
|
+
readonly internalType: "uint256";
|
|
1231
|
+
}, {
|
|
1232
|
+
readonly name: "obligationShares";
|
|
1233
|
+
readonly type: "uint256";
|
|
1234
|
+
readonly indexed: false;
|
|
1235
|
+
readonly internalType: "uint256";
|
|
1236
|
+
}, {
|
|
1237
|
+
readonly name: "buyerIsLender";
|
|
1238
|
+
readonly type: "bool";
|
|
1239
|
+
readonly indexed: false;
|
|
1240
|
+
readonly internalType: "bool";
|
|
1241
|
+
}, {
|
|
1242
|
+
readonly name: "sellerIsBorrower";
|
|
1243
|
+
readonly type: "bool";
|
|
1244
|
+
readonly indexed: false;
|
|
1245
|
+
readonly internalType: "bool";
|
|
1246
|
+
}, {
|
|
1247
|
+
readonly name: "group";
|
|
1248
|
+
readonly type: "bytes32";
|
|
1249
|
+
readonly indexed: false;
|
|
1250
|
+
readonly internalType: "bytes32";
|
|
1251
|
+
}, {
|
|
1252
|
+
readonly name: "consumed";
|
|
1253
|
+
readonly type: "uint256";
|
|
1254
|
+
readonly indexed: false;
|
|
1255
|
+
readonly internalType: "uint256";
|
|
1256
|
+
}];
|
|
1257
|
+
readonly anonymous: false;
|
|
1258
|
+
};
|
|
1275
1259
|
/**
|
|
1276
1260
|
* ABI for the Consume event emitted by the Obligation contract.
|
|
1277
1261
|
*/
|
|
@@ -1969,7 +1953,7 @@ interface paths {
|
|
|
1969
1953
|
};
|
|
1970
1954
|
/**
|
|
1971
1955
|
* Get config rules
|
|
1972
|
-
* @description Returns configured rules for supported chains.
|
|
1956
|
+
* @description Returns configured rules (maturities, loan tokens, oracles) for supported chains.
|
|
1973
1957
|
*/
|
|
1974
1958
|
get: {
|
|
1975
1959
|
parameters: {
|
|
@@ -2426,7 +2410,7 @@ interface paths {
|
|
|
2426
2410
|
put?: never;
|
|
2427
2411
|
/**
|
|
2428
2412
|
* Validate offers
|
|
2429
|
-
* @description Validates offers against router validation rules. Returns unsigned payload + root on success, or issues only on validation failure.
|
|
2413
|
+
* @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.
|
|
2430
2414
|
*/
|
|
2431
2415
|
post: {
|
|
2432
2416
|
parameters: {
|
|
@@ -2465,56 +2449,6 @@ interface paths {
|
|
|
2465
2449
|
patch?: never;
|
|
2466
2450
|
trace?: never;
|
|
2467
2451
|
};
|
|
2468
|
-
"/v1/callbacks": {
|
|
2469
|
-
parameters: {
|
|
2470
|
-
query?: never;
|
|
2471
|
-
header?: never;
|
|
2472
|
-
path?: never;
|
|
2473
|
-
cookie?: never;
|
|
2474
|
-
};
|
|
2475
|
-
get?: never;
|
|
2476
|
-
put?: never;
|
|
2477
|
-
/**
|
|
2478
|
-
* Resolve callback types
|
|
2479
|
-
* @description Returns callback types for callback addresses grouped by chain.
|
|
2480
|
-
*/
|
|
2481
|
-
post: {
|
|
2482
|
-
parameters: {
|
|
2483
|
-
query?: never;
|
|
2484
|
-
header?: never;
|
|
2485
|
-
path?: never;
|
|
2486
|
-
cookie?: never;
|
|
2487
|
-
};
|
|
2488
|
-
requestBody?: {
|
|
2489
|
-
content: {
|
|
2490
|
-
"application/json": components["schemas"]["CallbackTypesRequest"];
|
|
2491
|
-
};
|
|
2492
|
-
};
|
|
2493
|
-
responses: {
|
|
2494
|
-
/** @description Success */200: {
|
|
2495
|
-
headers: {
|
|
2496
|
-
[name: string]: unknown;
|
|
2497
|
-
};
|
|
2498
|
-
content: {
|
|
2499
|
-
"application/json": components["schemas"]["CallbackTypesSuccessResponse"];
|
|
2500
|
-
};
|
|
2501
|
-
}; /** @description Bad Request */
|
|
2502
|
-
400: {
|
|
2503
|
-
headers: {
|
|
2504
|
-
[name: string]: unknown;
|
|
2505
|
-
};
|
|
2506
|
-
content: {
|
|
2507
|
-
"application/json": components["schemas"]["BadRequestResponse"];
|
|
2508
|
-
};
|
|
2509
|
-
};
|
|
2510
|
-
};
|
|
2511
|
-
};
|
|
2512
|
-
delete?: never;
|
|
2513
|
-
options?: never;
|
|
2514
|
-
head?: never;
|
|
2515
|
-
patch?: never;
|
|
2516
|
-
trace?: never;
|
|
2517
|
-
};
|
|
2518
2452
|
}
|
|
2519
2453
|
interface components {
|
|
2520
2454
|
schemas: {
|
|
@@ -2599,12 +2533,6 @@ interface components {
|
|
|
2599
2533
|
* "timestamp": 1730415600
|
|
2600
2534
|
* },
|
|
2601
2535
|
* {
|
|
2602
|
-
* "type": "callback",
|
|
2603
|
-
* "chain_id": 1,
|
|
2604
|
-
* "address": "0x1111111111111111111111111111111111111111",
|
|
2605
|
-
* "callback_type": "sell_erc20_callback"
|
|
2606
|
-
* },
|
|
2607
|
-
* {
|
|
2608
2536
|
* "type": "loan_token",
|
|
2609
2537
|
* "chain_id": 1,
|
|
2610
2538
|
* "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
@@ -2626,9 +2554,8 @@ interface components {
|
|
|
2626
2554
|
/** @example maturity */type: string; /** @example 1 */
|
|
2627
2555
|
chain_id: number; /** @example end_of_next_month */
|
|
2628
2556
|
name?: string; /** @example 1730415600 */
|
|
2629
|
-
timestamp?: number; /** @example
|
|
2630
|
-
address?: string;
|
|
2631
|
-
callback_type?: string;
|
|
2557
|
+
timestamp?: number; /** @example 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 */
|
|
2558
|
+
address?: string;
|
|
2632
2559
|
};
|
|
2633
2560
|
OfferListResponse: {
|
|
2634
2561
|
meta: components["schemas"]["Meta"];
|
|
@@ -2663,8 +2590,8 @@ interface components {
|
|
|
2663
2590
|
* "price": "2750000000000000000",
|
|
2664
2591
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
2665
2592
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
2666
|
-
* "callback": "
|
|
2667
|
-
* "callback_data": "
|
|
2593
|
+
* "callback": "0x0000000000000000000000000000000000000000",
|
|
2594
|
+
* "callback_data": "0x"
|
|
2668
2595
|
* },
|
|
2669
2596
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
2670
2597
|
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc",
|
|
@@ -2707,8 +2634,8 @@ interface components {
|
|
|
2707
2634
|
* "price": "2750000000000000000",
|
|
2708
2635
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
2709
2636
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
2710
|
-
* "callback": "
|
|
2711
|
-
* "callback_data": "
|
|
2637
|
+
* "callback": "0x0000000000000000000000000000000000000000",
|
|
2638
|
+
* "callback_data": "0x"
|
|
2712
2639
|
* }
|
|
2713
2640
|
*/
|
|
2714
2641
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
@@ -2752,8 +2679,8 @@ interface components {
|
|
|
2752
2679
|
expiry: number; /** @example 2750000000000000000 */
|
|
2753
2680
|
price: string; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
2754
2681
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
2755
|
-
session: string; /** @example
|
|
2756
|
-
callback: string; /** @example
|
|
2682
|
+
session: string; /** @example 0x0000000000000000000000000000000000000000 */
|
|
2683
|
+
callback: string; /** @example 0x */
|
|
2757
2684
|
callback_data: string;
|
|
2758
2685
|
};
|
|
2759
2686
|
ObligationOfferResponse: {
|
|
@@ -2942,8 +2869,8 @@ interface components {
|
|
|
2942
2869
|
collaterals: components["schemas"]["ValidateCollateralRequest"][];
|
|
2943
2870
|
/**
|
|
2944
2871
|
* @example {
|
|
2945
|
-
* "address": "
|
|
2946
|
-
* "data": "
|
|
2872
|
+
* "address": "0x0000000000000000000000000000000000000000",
|
|
2873
|
+
* "data": "0x"
|
|
2947
2874
|
* }
|
|
2948
2875
|
*/
|
|
2949
2876
|
callback: components["schemas"]["ValidateCallbackRequest"];
|
|
@@ -2954,7 +2881,7 @@ interface components {
|
|
|
2954
2881
|
lltv: string;
|
|
2955
2882
|
};
|
|
2956
2883
|
ValidateCallbackRequest: {
|
|
2957
|
-
/** @example
|
|
2884
|
+
/** @example 0x0000000000000000000000000000000000000000 */address: string; /** @example 0x */
|
|
2958
2885
|
data: string;
|
|
2959
2886
|
};
|
|
2960
2887
|
ValidationSuccessResponse: {
|
|
@@ -2974,84 +2901,6 @@ interface components {
|
|
|
2974
2901
|
*/
|
|
2975
2902
|
root: string;
|
|
2976
2903
|
};
|
|
2977
|
-
CallbackTypesRequest: {
|
|
2978
|
-
/**
|
|
2979
|
-
* @example [
|
|
2980
|
-
* {
|
|
2981
|
-
* "chain_id": 1,
|
|
2982
|
-
* "addresses": [
|
|
2983
|
-
* "0x1111111111111111111111111111111111111111",
|
|
2984
|
-
* "0x3333333333333333333333333333333333333333",
|
|
2985
|
-
* "0x9999999999999999999999999999999999999999"
|
|
2986
|
-
* ]
|
|
2987
|
-
* }
|
|
2988
|
-
* ]
|
|
2989
|
-
*/
|
|
2990
|
-
callbacks: components["schemas"]["CallbackTypesChainRequest"][];
|
|
2991
|
-
};
|
|
2992
|
-
CallbackTypesChainRequest: {
|
|
2993
|
-
/** @example 1 */chain_id: number;
|
|
2994
|
-
/**
|
|
2995
|
-
* @example [
|
|
2996
|
-
* "0x1111111111111111111111111111111111111111",
|
|
2997
|
-
* "0x3333333333333333333333333333333333333333",
|
|
2998
|
-
* "0x9999999999999999999999999999999999999999"
|
|
2999
|
-
* ]
|
|
3000
|
-
*/
|
|
3001
|
-
addresses: string[];
|
|
3002
|
-
};
|
|
3003
|
-
CallbackTypesSuccessResponse: {
|
|
3004
|
-
meta: components["schemas"]["Meta"]; /** @example maturity:1:1730415600:end_of_next_month */
|
|
3005
|
-
cursor: string | null;
|
|
3006
|
-
/**
|
|
3007
|
-
* @description Callback types grouped by chain.
|
|
3008
|
-
* @example [
|
|
3009
|
-
* {
|
|
3010
|
-
* "chain_id": 1,
|
|
3011
|
-
* "sell_erc20_callback": [
|
|
3012
|
-
* "0x1111111111111111111111111111111111111111"
|
|
3013
|
-
* ],
|
|
3014
|
-
* "buy_erc20": [
|
|
3015
|
-
* "0x5555555555555555555555555555555555555555"
|
|
3016
|
-
* ],
|
|
3017
|
-
* "buy_vault_v1_callback": [
|
|
3018
|
-
* "0x3333333333333333333333333333333333333333"
|
|
3019
|
-
* ],
|
|
3020
|
-
* "not_supported": [
|
|
3021
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3022
|
-
* ]
|
|
3023
|
-
* }
|
|
3024
|
-
* ]
|
|
3025
|
-
*/
|
|
3026
|
-
data: components["schemas"]["CallbackTypesChainResponse"][];
|
|
3027
|
-
};
|
|
3028
|
-
CallbackTypesChainResponse: {
|
|
3029
|
-
/** @example 1 */chain_id: number;
|
|
3030
|
-
/**
|
|
3031
|
-
* @example [
|
|
3032
|
-
* "0x3333333333333333333333333333333333333333"
|
|
3033
|
-
* ]
|
|
3034
|
-
*/
|
|
3035
|
-
buy_vault_v1_callback?: string[];
|
|
3036
|
-
/**
|
|
3037
|
-
* @example [
|
|
3038
|
-
* "0x1111111111111111111111111111111111111111"
|
|
3039
|
-
* ]
|
|
3040
|
-
*/
|
|
3041
|
-
sell_erc20_callback?: string[];
|
|
3042
|
-
/**
|
|
3043
|
-
* @example [
|
|
3044
|
-
* "0x5555555555555555555555555555555555555555"
|
|
3045
|
-
* ]
|
|
3046
|
-
*/
|
|
3047
|
-
buy_erc20?: string[];
|
|
3048
|
-
/**
|
|
3049
|
-
* @example [
|
|
3050
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3051
|
-
* ]
|
|
3052
|
-
*/
|
|
3053
|
-
not_supported: string[];
|
|
3054
|
-
};
|
|
3055
2904
|
};
|
|
3056
2905
|
responses: never;
|
|
3057
2906
|
parameters: never;
|
|
@@ -3120,9 +2969,6 @@ declare class BooksController {
|
|
|
3120
2969
|
declare class ValidateController {
|
|
3121
2970
|
validateOffers(): Promise<void>;
|
|
3122
2971
|
}
|
|
3123
|
-
declare class CallbacksController {
|
|
3124
|
-
resolveCallbackTypes(): Promise<void>;
|
|
3125
|
-
}
|
|
3126
2972
|
declare class OffersController {
|
|
3127
2973
|
getOffers(): Promise<void>;
|
|
3128
2974
|
}
|
|
@@ -3272,12 +3118,6 @@ declare const schemas: {
|
|
|
3272
3118
|
readonly validate_offers: z$1.ZodObject<{
|
|
3273
3119
|
offers: z$1.ZodArray<z$1.ZodUnknown>;
|
|
3274
3120
|
}, z$1.core.$strict>;
|
|
3275
|
-
readonly callback_types: z$1.ZodObject<{
|
|
3276
|
-
callbacks: z$1.ZodArray<z$1.ZodObject<{
|
|
3277
|
-
chain_id: z$1.ZodNumber;
|
|
3278
|
-
addresses: z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>>;
|
|
3279
|
-
}, z$1.core.$strict>>;
|
|
3280
|
-
}, z$1.core.$strict>;
|
|
3281
3121
|
readonly get_user_positions: z$1.ZodObject<{
|
|
3282
3122
|
user_address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
3283
3123
|
cursor: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -3288,7 +3128,7 @@ type Action = keyof typeof schemas;
|
|
|
3288
3128
|
declare function parse<A extends Action>(action: A, query: unknown): z$1.infer<(typeof schemas)[A]>;
|
|
3289
3129
|
declare function safeParse<A extends Action>(action: A, query: unknown, error?: z$1.core.$ZodErrorMap<z$1.core.$ZodIssue>): z$1.ZodSafeParseResult<z$1.infer<(typeof schemas)[A]>>;
|
|
3290
3130
|
declare namespace index_d_exports$1 {
|
|
3291
|
-
export { BookResponse_d_exports as BookResponse, BooksController,
|
|
3131
|
+
export { BookResponse_d_exports as BookResponse, BooksController, ChainHealth, ChainsHealthResponse, CollectorHealth, CollectorsHealthResponse, ConfigContractsController, ConfigRulesController, HealthController, ObligationResponse_d_exports as ObligationResponse, ObligationsController, OfferResponse_d_exports as OfferResponse, OffersController, OpenApi, PositionResponse_d_exports as PositionResponse, RouterStatusResponse, UsersController, ValidateController, parse, safeParse };
|
|
3292
3132
|
}
|
|
3293
3133
|
declare namespace Client_d_exports$1 {
|
|
3294
3134
|
export { Client$2 as Client, ConnectOptions, HttpForbiddenError, HttpGetApiFailedError, HttpRateLimitError, HttpUnauthorizedError, InvalidUrlError, connect$1 as connect, getObligations, getOffers };
|
|
@@ -3520,16 +3360,6 @@ type ValidateOffersIssues = {
|
|
|
3520
3360
|
issues: ValidationIssue[];
|
|
3521
3361
|
};
|
|
3522
3362
|
type ValidateOffersData = ValidateOffersSuccess | ValidateOffersIssues;
|
|
3523
|
-
type CallbackType = Type$1 | "not_supported";
|
|
3524
|
-
type CallbackTypesRequest = {
|
|
3525
|
-
callbacks: Array<{
|
|
3526
|
-
chain_id: Id;
|
|
3527
|
-
addresses: Address[];
|
|
3528
|
-
}>;
|
|
3529
|
-
};
|
|
3530
|
-
type CallbackTypesResponse = Array<{
|
|
3531
|
-
chain_id: Id;
|
|
3532
|
-
} & Partial<Record<CallbackType, Address[]>>>;
|
|
3533
3363
|
type ConfigRulesPayload = SuccessPayload<ConfigRule[]> | ErrorPayload;
|
|
3534
3364
|
type SuccessPayload<T> = {
|
|
3535
3365
|
meta: {
|
|
@@ -3566,8 +3396,7 @@ type GatekeeperClient = {
|
|
|
3566
3396
|
statusCode: number;
|
|
3567
3397
|
body: ConfigRulesPayload;
|
|
3568
3398
|
}>; /** Validate offers and return decision results. */
|
|
3569
|
-
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>; /**
|
|
3570
|
-
getCallbackTypes: (request: CallbackTypesRequest) => Promise<CallbackTypesResponse>; /** Base URL for the gatekeeper service. */
|
|
3399
|
+
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>; /** Base URL for the gatekeeper service. */
|
|
3571
3400
|
baseUrl: string;
|
|
3572
3401
|
};
|
|
3573
3402
|
type ClientConfig = {
|
|
@@ -3610,10 +3439,10 @@ type ValidityParameters = {
|
|
|
3610
3439
|
/**
|
|
3611
3440
|
* set of rules to validate offers.
|
|
3612
3441
|
*
|
|
3613
|
-
* @param
|
|
3442
|
+
* @param _parameters - Validity parameters with chain and client
|
|
3614
3443
|
* @returns Array of validation rules to evaluate against offers
|
|
3615
3444
|
*/
|
|
3616
|
-
declare function validity(
|
|
3445
|
+
declare function validity(_parameters: ValidityParameters): Rule<Offer, "expiry">[];
|
|
3617
3446
|
declare const chains: ({
|
|
3618
3447
|
chains
|
|
3619
3448
|
}: {
|
|
@@ -3625,8 +3454,7 @@ declare const maturity: ({
|
|
|
3625
3454
|
maturities: MaturityType[];
|
|
3626
3455
|
}) => Rule<Offer, "maturity">;
|
|
3627
3456
|
declare const callback: ({
|
|
3628
|
-
callbacks
|
|
3629
|
-
allowedAddresses
|
|
3457
|
+
callbacks
|
|
3630
3458
|
}: {
|
|
3631
3459
|
callbacks: Type$1[];
|
|
3632
3460
|
allowedAddresses: Address[];
|
|
@@ -3855,5 +3683,5 @@ declare namespace index_d_exports$2 {
|
|
|
3855
3683
|
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 };
|
|
3856
3684
|
}
|
|
3857
3685
|
//#endregion
|
|
3858
|
-
export { index_d_exports as Abi, Brand, BrandTypeId, Callback_d_exports as Callback,
|
|
3686
|
+
export { index_d_exports as Abi, Brand, BrandTypeId, Callback_d_exports as Callback, Chain_d_exports as Chain, ChainRegistry_d_exports as ChainRegistry, Collateral_d_exports as Collateral, Compute, ConfigRule, ConfigRulesPayload, 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, LLTV_d_exports as LLTV, Liquidity_d_exports as Liquidity, Maturity_d_exports as Maturity, MempoolClient_d_exports as Mempool, Obligation_d_exports as Obligation, Offer_d_exports as Offer, Oracle_d_exports as Oracle, Position_d_exports as Position, Quote_d_exports as Quote, index_d_exports$1 as RouterApi, Client_d_exports$1 as RouterClient, 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, index_d_exports$2 as Utils, ValidateOffersData, ValidateOffersIssues, ValidateOffersSuccess, Gate_d_exports as Validation, ValidationIssue, morphoRules };
|
|
3859
3687
|
//# sourceMappingURL=index.browser.d.ts.map
|