@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.mts
CHANGED
|
@@ -34,9 +34,9 @@ declare const CollectorHealth: z.ZodObject<{
|
|
|
34
34
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
35
35
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
36
36
|
status: z.ZodEnum<{
|
|
37
|
-
unknown: "unknown";
|
|
38
37
|
live: "live";
|
|
39
38
|
lagging: "lagging";
|
|
39
|
+
unknown: "unknown";
|
|
40
40
|
}>;
|
|
41
41
|
initialized: z.ZodBoolean;
|
|
42
42
|
}, z.core.$strip>;
|
|
@@ -47,9 +47,9 @@ declare const CollectorsHealthResponse: z.ZodArray<z.ZodObject<{
|
|
|
47
47
|
updated_at: z.ZodNullable<z.ZodString>;
|
|
48
48
|
lag: z.ZodNullable<z.ZodNumber>;
|
|
49
49
|
status: z.ZodEnum<{
|
|
50
|
-
unknown: "unknown";
|
|
51
50
|
live: "live";
|
|
52
51
|
lagging: "lagging";
|
|
52
|
+
unknown: "unknown";
|
|
53
53
|
}>;
|
|
54
54
|
initialized: z.ZodBoolean;
|
|
55
55
|
}, z.core.$strip>>;
|
|
@@ -344,94 +344,19 @@ declare const Morpho: readonly [{
|
|
|
344
344
|
}];
|
|
345
345
|
readonly stateMutability: "view";
|
|
346
346
|
}];
|
|
347
|
-
//#endregion
|
|
348
|
-
//#region src/core/types.d.ts
|
|
349
|
-
/** Combines members of an intersection into a readable type. */
|
|
350
|
-
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
351
|
-
declare const BrandTypeId: unique symbol;
|
|
352
|
-
type Brand<in out ID extends string | symbol> = {
|
|
353
|
-
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
354
|
-
};
|
|
355
347
|
declare namespace Callback_d_exports {
|
|
356
|
-
export {
|
|
348
|
+
export { Callback, Type$1 as Type, isEmptyCallback };
|
|
357
349
|
}
|
|
358
|
-
/** A position decoded from callback data. */
|
|
359
|
-
type CallbackPosition = {
|
|
360
|
-
/** The ERC20 token contract address. */contract: Address; /** The maximum amount available from this position. */
|
|
361
|
-
amount: bigint;
|
|
362
|
-
};
|
|
363
350
|
type Callback = {
|
|
364
351
|
type: Type$1.BuyWithEmptyCallback;
|
|
365
|
-
} |
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
} & {
|
|
369
|
-
type: Type$1.BuyERC20; /** The decoded callback inputs. */
|
|
370
|
-
inputs: {
|
|
371
|
-
/** The ERC20 positions available for the callback. */positions: CallbackPosition[];
|
|
372
|
-
};
|
|
373
|
-
}) & Brand<"Callback">);
|
|
352
|
+
} | {
|
|
353
|
+
type: Type$1.SellWithEmptyCallback;
|
|
354
|
+
};
|
|
374
355
|
declare enum Type$1 {
|
|
375
356
|
BuyWithEmptyCallback = "buy_with_empty_callback",
|
|
376
|
-
|
|
377
|
-
BuyVaultV1Callback = "buy_vault_v1_callback",
|
|
378
|
-
SellERC20Callback = "sell_erc20_callback"
|
|
357
|
+
SellWithEmptyCallback = "sell_with_empty_callback"
|
|
379
358
|
}
|
|
380
359
|
declare const isEmptyCallback: (offer: Offer) => boolean;
|
|
381
|
-
declare function decode$2(type: Type$1, data: Hex): {
|
|
382
|
-
contract: Address;
|
|
383
|
-
amount: bigint;
|
|
384
|
-
}[];
|
|
385
|
-
type BuyERC20Data = {
|
|
386
|
-
tokens: Address[];
|
|
387
|
-
amounts: bigint[];
|
|
388
|
-
};
|
|
389
|
-
type BuyVaultV1CallbackData = {
|
|
390
|
-
vaults: Address[];
|
|
391
|
-
amounts: bigint[];
|
|
392
|
-
};
|
|
393
|
-
type SellERC20CallbackData = {
|
|
394
|
-
collaterals: Address[];
|
|
395
|
-
amounts: bigint[];
|
|
396
|
-
};
|
|
397
|
-
declare function encode$2(type: Type$1.BuyERC20, data: BuyERC20Data): Hex;
|
|
398
|
-
declare function encode$2(type: Type$1.BuyVaultV1Callback, data: BuyVaultV1CallbackData): Hex;
|
|
399
|
-
declare function encode$2(type: Type$1.SellERC20Callback, data: SellERC20CallbackData): Hex;
|
|
400
|
-
/**
|
|
401
|
-
* Decodes BuyERC20 callback data into positions.
|
|
402
|
-
* @param data - The ABI-encoded callback data containing token addresses and amounts.
|
|
403
|
-
* @returns Array of positions with contract address and amount.
|
|
404
|
-
* @throws If data is empty, malformed, or arrays have mismatched lengths.
|
|
405
|
-
*/
|
|
406
|
-
declare function decodeBuyERC20(data: Hex): Array<{
|
|
407
|
-
contract: Address;
|
|
408
|
-
amount: bigint;
|
|
409
|
-
}>;
|
|
410
|
-
/**
|
|
411
|
-
* Encodes BuyERC20 callback parameters into ABI-encoded data.
|
|
412
|
-
* @param parameters - The tokens and amounts to encode.
|
|
413
|
-
* @returns ABI-encoded hex string.
|
|
414
|
-
*/
|
|
415
|
-
declare function encodeBuyERC20(parameters: {
|
|
416
|
-
tokens: Address[];
|
|
417
|
-
amounts: bigint[];
|
|
418
|
-
}): Hex;
|
|
419
|
-
declare function decodeBuyVaultV1Callback(data: Hex): Array<{
|
|
420
|
-
contract: Address;
|
|
421
|
-
amount: bigint;
|
|
422
|
-
}>;
|
|
423
|
-
declare function decodeSellERC20Callback(data: Hex): Array<{
|
|
424
|
-
contract: Address;
|
|
425
|
-
amount: bigint;
|
|
426
|
-
}>;
|
|
427
|
-
declare function encodeBuyVaultV1Callback(parameters: {
|
|
428
|
-
vaults: Address[];
|
|
429
|
-
amounts: bigint[];
|
|
430
|
-
}): Hex;
|
|
431
|
-
declare function encodeSellERC20Callback(parameters: {
|
|
432
|
-
collaterals: Address[];
|
|
433
|
-
amounts: bigint[];
|
|
434
|
-
}): Hex;
|
|
435
360
|
declare namespace Errors_d_exports {
|
|
436
361
|
export { BaseError, GlobalErrorType, ReorgError };
|
|
437
362
|
}
|
|
@@ -551,6 +476,14 @@ type ChainRegistry = {
|
|
|
551
476
|
* @returns A registry for looking up chains by ID. {@link ChainRegistry}
|
|
552
477
|
*/
|
|
553
478
|
declare function create$1(chains: Chain$1[]): ChainRegistry;
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region src/core/types.d.ts
|
|
481
|
+
/** Combines members of an intersection into a readable type. */
|
|
482
|
+
type Compute<type> = { [key in keyof type]: type[key] } & unknown;
|
|
483
|
+
declare const BrandTypeId: unique symbol;
|
|
484
|
+
type Brand<in out ID extends string | symbol> = {
|
|
485
|
+
readonly [BrandTypeId]: { readonly [id in ID]: ID };
|
|
486
|
+
};
|
|
554
487
|
declare namespace LLTV_d_exports {
|
|
555
488
|
export { InvalidLLTVError, InvalidOptionError$1 as InvalidOptionError, LLTV, LLTVSchema, Options, from$14 as from };
|
|
556
489
|
}
|
|
@@ -697,7 +630,7 @@ declare class DenominatorIsZeroError extends BaseError {
|
|
|
697
630
|
constructor();
|
|
698
631
|
}
|
|
699
632
|
declare namespace Liquidity_d_exports {
|
|
700
|
-
export { LiquidityLink, LiquidityPool, OfferLiquidityPool, calculateMaxDebt, generateAllowancePoolId, generateBalancePoolId,
|
|
633
|
+
export { LiquidityLink, LiquidityPool, OfferLiquidityPool, calculateMaxDebt, generateAllowancePoolId, generateBalancePoolId, generateDebtPoolId, generateMarketLiquidityPoolId, generateObligationCollateralPoolId, generateUserVaultPositionPoolId, generateVaultPositionPoolId };
|
|
701
634
|
}
|
|
702
635
|
/**
|
|
703
636
|
* Represents a liquidity pool with a unique ID and amount.
|
|
@@ -722,10 +655,7 @@ type OfferLiquidityPool = {
|
|
|
722
655
|
poolId: string;
|
|
723
656
|
/**
|
|
724
657
|
* The available capacity/liquidity from this pool for this offer.
|
|
725
|
-
*
|
|
726
|
-
* - BuyWithEmptyCallback: Matches allowance amount from pool bellow
|
|
727
|
-
* - SellERC20Callback: Sell Callback/Predeposited -> Maximum debt capacity calculated from collateral (collateralAmount * oraclePrice * lltv)
|
|
728
|
-
* - SellERC20Callback: Existing debt as negative value (reduces available capacity)
|
|
658
|
+
* Matches allowance amount from pool below.
|
|
729
659
|
*/
|
|
730
660
|
amount: bigint;
|
|
731
661
|
};
|
|
@@ -753,17 +683,6 @@ declare function generateAllowancePoolId(parameters: {
|
|
|
753
683
|
chainId: Id;
|
|
754
684
|
token: Address;
|
|
755
685
|
}): string;
|
|
756
|
-
/**
|
|
757
|
-
* Generate pool ID for sell ERC20 callback pools.
|
|
758
|
-
* Each offer has its own callback pool to prevent liquidity conflicts.
|
|
759
|
-
*/
|
|
760
|
-
declare function generateSellERC20CallbackPoolId(parameters: {
|
|
761
|
-
user: Address;
|
|
762
|
-
chainId: Id;
|
|
763
|
-
obligationId: Hex;
|
|
764
|
-
token: Address;
|
|
765
|
-
offerHash: Hex;
|
|
766
|
-
}): string;
|
|
767
686
|
/**
|
|
768
687
|
* Generate pool ID for obligation collateral pools.
|
|
769
688
|
* Obligation collateral pools represent collateral already deposited in the obligation.
|
|
@@ -775,15 +694,6 @@ declare function generateObligationCollateralPoolId(parameters: {
|
|
|
775
694
|
obligationId: Hex;
|
|
776
695
|
token: Address;
|
|
777
696
|
}): string;
|
|
778
|
-
/**
|
|
779
|
-
* Generate pool ID for buy vault callback pools.
|
|
780
|
-
*/
|
|
781
|
-
declare function generateBuyVaultCallbackPoolId(parameters: {
|
|
782
|
-
user: Address;
|
|
783
|
-
chainId: Id;
|
|
784
|
-
vault: Address;
|
|
785
|
-
offerHash: Hex;
|
|
786
|
-
}): string;
|
|
787
697
|
/**
|
|
788
698
|
* Generate pool ID for debt pools.
|
|
789
699
|
*/
|
|
@@ -1020,7 +930,7 @@ declare class CollateralsAreNotSortedError extends BaseError {
|
|
|
1020
930
|
constructor();
|
|
1021
931
|
}
|
|
1022
932
|
declare namespace Offer_d_exports {
|
|
1023
|
-
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 };
|
|
933
|
+
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 };
|
|
1024
934
|
}
|
|
1025
935
|
type Offer = {
|
|
1026
936
|
/** The address that made the offer. */readonly maker: Address; /** The amount of assets offered. Mutually exclusive with obligationUnits and obligationShares. */
|
|
@@ -1277,6 +1187,80 @@ type OfferConsumed = {
|
|
|
1277
1187
|
amount: bigint;
|
|
1278
1188
|
blockNumber: number;
|
|
1279
1189
|
};
|
|
1190
|
+
/**
|
|
1191
|
+
* ABI for the Take event emitted by the Morpho V2 contract.
|
|
1192
|
+
*/
|
|
1193
|
+
declare const takeEvent: {
|
|
1194
|
+
readonly type: "event";
|
|
1195
|
+
readonly name: "Take";
|
|
1196
|
+
readonly inputs: readonly [{
|
|
1197
|
+
readonly name: "caller";
|
|
1198
|
+
readonly type: "address";
|
|
1199
|
+
readonly indexed: false;
|
|
1200
|
+
readonly internalType: "address";
|
|
1201
|
+
}, {
|
|
1202
|
+
readonly name: "id";
|
|
1203
|
+
readonly type: "bytes32";
|
|
1204
|
+
readonly indexed: true;
|
|
1205
|
+
readonly internalType: "bytes32";
|
|
1206
|
+
}, {
|
|
1207
|
+
readonly name: "maker";
|
|
1208
|
+
readonly type: "address";
|
|
1209
|
+
readonly indexed: true;
|
|
1210
|
+
readonly internalType: "address";
|
|
1211
|
+
}, {
|
|
1212
|
+
readonly name: "taker";
|
|
1213
|
+
readonly type: "address";
|
|
1214
|
+
readonly indexed: true;
|
|
1215
|
+
readonly internalType: "address";
|
|
1216
|
+
}, {
|
|
1217
|
+
readonly name: "offerIsBuy";
|
|
1218
|
+
readonly type: "bool";
|
|
1219
|
+
readonly indexed: false;
|
|
1220
|
+
readonly internalType: "bool";
|
|
1221
|
+
}, {
|
|
1222
|
+
readonly name: "buyerAssets";
|
|
1223
|
+
readonly type: "uint256";
|
|
1224
|
+
readonly indexed: false;
|
|
1225
|
+
readonly internalType: "uint256";
|
|
1226
|
+
}, {
|
|
1227
|
+
readonly name: "sellerAssets";
|
|
1228
|
+
readonly type: "uint256";
|
|
1229
|
+
readonly indexed: false;
|
|
1230
|
+
readonly internalType: "uint256";
|
|
1231
|
+
}, {
|
|
1232
|
+
readonly name: "obligationUnits";
|
|
1233
|
+
readonly type: "uint256";
|
|
1234
|
+
readonly indexed: false;
|
|
1235
|
+
readonly internalType: "uint256";
|
|
1236
|
+
}, {
|
|
1237
|
+
readonly name: "obligationShares";
|
|
1238
|
+
readonly type: "uint256";
|
|
1239
|
+
readonly indexed: false;
|
|
1240
|
+
readonly internalType: "uint256";
|
|
1241
|
+
}, {
|
|
1242
|
+
readonly name: "buyerIsLender";
|
|
1243
|
+
readonly type: "bool";
|
|
1244
|
+
readonly indexed: false;
|
|
1245
|
+
readonly internalType: "bool";
|
|
1246
|
+
}, {
|
|
1247
|
+
readonly name: "sellerIsBorrower";
|
|
1248
|
+
readonly type: "bool";
|
|
1249
|
+
readonly indexed: false;
|
|
1250
|
+
readonly internalType: "bool";
|
|
1251
|
+
}, {
|
|
1252
|
+
readonly name: "group";
|
|
1253
|
+
readonly type: "bytes32";
|
|
1254
|
+
readonly indexed: false;
|
|
1255
|
+
readonly internalType: "bytes32";
|
|
1256
|
+
}, {
|
|
1257
|
+
readonly name: "consumed";
|
|
1258
|
+
readonly type: "uint256";
|
|
1259
|
+
readonly indexed: false;
|
|
1260
|
+
readonly internalType: "uint256";
|
|
1261
|
+
}];
|
|
1262
|
+
readonly anonymous: false;
|
|
1263
|
+
};
|
|
1280
1264
|
/**
|
|
1281
1265
|
* ABI for the Consume event emitted by the Obligation contract.
|
|
1282
1266
|
*/
|
|
@@ -1974,7 +1958,7 @@ interface paths {
|
|
|
1974
1958
|
};
|
|
1975
1959
|
/**
|
|
1976
1960
|
* Get config rules
|
|
1977
|
-
* @description Returns configured rules for supported chains.
|
|
1961
|
+
* @description Returns configured rules (maturities, loan tokens, oracles) for supported chains.
|
|
1978
1962
|
*/
|
|
1979
1963
|
get: {
|
|
1980
1964
|
parameters: {
|
|
@@ -2431,7 +2415,7 @@ interface paths {
|
|
|
2431
2415
|
put?: never;
|
|
2432
2416
|
/**
|
|
2433
2417
|
* Validate offers
|
|
2434
|
-
* @description Validates offers against router validation rules. Returns unsigned payload + root on success, or issues only on validation failure.
|
|
2418
|
+
* @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.
|
|
2435
2419
|
*/
|
|
2436
2420
|
post: {
|
|
2437
2421
|
parameters: {
|
|
@@ -2470,56 +2454,6 @@ interface paths {
|
|
|
2470
2454
|
patch?: never;
|
|
2471
2455
|
trace?: never;
|
|
2472
2456
|
};
|
|
2473
|
-
"/v1/callbacks": {
|
|
2474
|
-
parameters: {
|
|
2475
|
-
query?: never;
|
|
2476
|
-
header?: never;
|
|
2477
|
-
path?: never;
|
|
2478
|
-
cookie?: never;
|
|
2479
|
-
};
|
|
2480
|
-
get?: never;
|
|
2481
|
-
put?: never;
|
|
2482
|
-
/**
|
|
2483
|
-
* Resolve callback types
|
|
2484
|
-
* @description Returns callback types for callback addresses grouped by chain.
|
|
2485
|
-
*/
|
|
2486
|
-
post: {
|
|
2487
|
-
parameters: {
|
|
2488
|
-
query?: never;
|
|
2489
|
-
header?: never;
|
|
2490
|
-
path?: never;
|
|
2491
|
-
cookie?: never;
|
|
2492
|
-
};
|
|
2493
|
-
requestBody?: {
|
|
2494
|
-
content: {
|
|
2495
|
-
"application/json": components["schemas"]["CallbackTypesRequest"];
|
|
2496
|
-
};
|
|
2497
|
-
};
|
|
2498
|
-
responses: {
|
|
2499
|
-
/** @description Success */200: {
|
|
2500
|
-
headers: {
|
|
2501
|
-
[name: string]: unknown;
|
|
2502
|
-
};
|
|
2503
|
-
content: {
|
|
2504
|
-
"application/json": components["schemas"]["CallbackTypesSuccessResponse"];
|
|
2505
|
-
};
|
|
2506
|
-
}; /** @description Bad Request */
|
|
2507
|
-
400: {
|
|
2508
|
-
headers: {
|
|
2509
|
-
[name: string]: unknown;
|
|
2510
|
-
};
|
|
2511
|
-
content: {
|
|
2512
|
-
"application/json": components["schemas"]["BadRequestResponse"];
|
|
2513
|
-
};
|
|
2514
|
-
};
|
|
2515
|
-
};
|
|
2516
|
-
};
|
|
2517
|
-
delete?: never;
|
|
2518
|
-
options?: never;
|
|
2519
|
-
head?: never;
|
|
2520
|
-
patch?: never;
|
|
2521
|
-
trace?: never;
|
|
2522
|
-
};
|
|
2523
2457
|
}
|
|
2524
2458
|
interface components {
|
|
2525
2459
|
schemas: {
|
|
@@ -2604,12 +2538,6 @@ interface components {
|
|
|
2604
2538
|
* "timestamp": 1730415600
|
|
2605
2539
|
* },
|
|
2606
2540
|
* {
|
|
2607
|
-
* "type": "callback",
|
|
2608
|
-
* "chain_id": 1,
|
|
2609
|
-
* "address": "0x1111111111111111111111111111111111111111",
|
|
2610
|
-
* "callback_type": "sell_erc20_callback"
|
|
2611
|
-
* },
|
|
2612
|
-
* {
|
|
2613
2541
|
* "type": "loan_token",
|
|
2614
2542
|
* "chain_id": 1,
|
|
2615
2543
|
* "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
@@ -2631,9 +2559,8 @@ interface components {
|
|
|
2631
2559
|
/** @example maturity */type: string; /** @example 1 */
|
|
2632
2560
|
chain_id: number; /** @example end_of_next_month */
|
|
2633
2561
|
name?: string; /** @example 1730415600 */
|
|
2634
|
-
timestamp?: number; /** @example
|
|
2635
|
-
address?: string;
|
|
2636
|
-
callback_type?: string;
|
|
2562
|
+
timestamp?: number; /** @example 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 */
|
|
2563
|
+
address?: string;
|
|
2637
2564
|
};
|
|
2638
2565
|
OfferListResponse: {
|
|
2639
2566
|
meta: components["schemas"]["Meta"];
|
|
@@ -2668,8 +2595,8 @@ interface components {
|
|
|
2668
2595
|
* "price": "2750000000000000000",
|
|
2669
2596
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
2670
2597
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
2671
|
-
* "callback": "
|
|
2672
|
-
* "callback_data": "
|
|
2598
|
+
* "callback": "0x0000000000000000000000000000000000000000",
|
|
2599
|
+
* "callback_data": "0x"
|
|
2673
2600
|
* },
|
|
2674
2601
|
* "offer_hash": "0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427",
|
|
2675
2602
|
* "obligation_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9abc",
|
|
@@ -2712,8 +2639,8 @@ interface components {
|
|
|
2712
2639
|
* "price": "2750000000000000000",
|
|
2713
2640
|
* "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
|
|
2714
2641
|
* "session": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
2715
|
-
* "callback": "
|
|
2716
|
-
* "callback_data": "
|
|
2642
|
+
* "callback": "0x0000000000000000000000000000000000000000",
|
|
2643
|
+
* "callback_data": "0x"
|
|
2717
2644
|
* }
|
|
2718
2645
|
*/
|
|
2719
2646
|
offer: components["schemas"]["OfferDataResponse"]; /** @example 0xac4bd8318ec914f89f8af913f162230575b0ac0696a19256bc12138c5cfe1427 */
|
|
@@ -2757,8 +2684,8 @@ interface components {
|
|
|
2757
2684
|
expiry: number; /** @example 2750000000000000000 */
|
|
2758
2685
|
price: string; /** @example 0x000000000000000000000000000000000000000000000000000000000008b8f4 */
|
|
2759
2686
|
group: string; /** @example 0x0000000000000000000000000000000000000000000000000000000000000000 */
|
|
2760
|
-
session: string; /** @example
|
|
2761
|
-
callback: string; /** @example
|
|
2687
|
+
session: string; /** @example 0x0000000000000000000000000000000000000000 */
|
|
2688
|
+
callback: string; /** @example 0x */
|
|
2762
2689
|
callback_data: string;
|
|
2763
2690
|
};
|
|
2764
2691
|
ObligationOfferResponse: {
|
|
@@ -2947,8 +2874,8 @@ interface components {
|
|
|
2947
2874
|
collaterals: components["schemas"]["ValidateCollateralRequest"][];
|
|
2948
2875
|
/**
|
|
2949
2876
|
* @example {
|
|
2950
|
-
* "address": "
|
|
2951
|
-
* "data": "
|
|
2877
|
+
* "address": "0x0000000000000000000000000000000000000000",
|
|
2878
|
+
* "data": "0x"
|
|
2952
2879
|
* }
|
|
2953
2880
|
*/
|
|
2954
2881
|
callback: components["schemas"]["ValidateCallbackRequest"];
|
|
@@ -2959,7 +2886,7 @@ interface components {
|
|
|
2959
2886
|
lltv: string;
|
|
2960
2887
|
};
|
|
2961
2888
|
ValidateCallbackRequest: {
|
|
2962
|
-
/** @example
|
|
2889
|
+
/** @example 0x0000000000000000000000000000000000000000 */address: string; /** @example 0x */
|
|
2963
2890
|
data: string;
|
|
2964
2891
|
};
|
|
2965
2892
|
ValidationSuccessResponse: {
|
|
@@ -2979,84 +2906,6 @@ interface components {
|
|
|
2979
2906
|
*/
|
|
2980
2907
|
root: string;
|
|
2981
2908
|
};
|
|
2982
|
-
CallbackTypesRequest: {
|
|
2983
|
-
/**
|
|
2984
|
-
* @example [
|
|
2985
|
-
* {
|
|
2986
|
-
* "chain_id": 1,
|
|
2987
|
-
* "addresses": [
|
|
2988
|
-
* "0x1111111111111111111111111111111111111111",
|
|
2989
|
-
* "0x3333333333333333333333333333333333333333",
|
|
2990
|
-
* "0x9999999999999999999999999999999999999999"
|
|
2991
|
-
* ]
|
|
2992
|
-
* }
|
|
2993
|
-
* ]
|
|
2994
|
-
*/
|
|
2995
|
-
callbacks: components["schemas"]["CallbackTypesChainRequest"][];
|
|
2996
|
-
};
|
|
2997
|
-
CallbackTypesChainRequest: {
|
|
2998
|
-
/** @example 1 */chain_id: number;
|
|
2999
|
-
/**
|
|
3000
|
-
* @example [
|
|
3001
|
-
* "0x1111111111111111111111111111111111111111",
|
|
3002
|
-
* "0x3333333333333333333333333333333333333333",
|
|
3003
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3004
|
-
* ]
|
|
3005
|
-
*/
|
|
3006
|
-
addresses: string[];
|
|
3007
|
-
};
|
|
3008
|
-
CallbackTypesSuccessResponse: {
|
|
3009
|
-
meta: components["schemas"]["Meta"]; /** @example maturity:1:1730415600:end_of_next_month */
|
|
3010
|
-
cursor: string | null;
|
|
3011
|
-
/**
|
|
3012
|
-
* @description Callback types grouped by chain.
|
|
3013
|
-
* @example [
|
|
3014
|
-
* {
|
|
3015
|
-
* "chain_id": 1,
|
|
3016
|
-
* "sell_erc20_callback": [
|
|
3017
|
-
* "0x1111111111111111111111111111111111111111"
|
|
3018
|
-
* ],
|
|
3019
|
-
* "buy_erc20": [
|
|
3020
|
-
* "0x5555555555555555555555555555555555555555"
|
|
3021
|
-
* ],
|
|
3022
|
-
* "buy_vault_v1_callback": [
|
|
3023
|
-
* "0x3333333333333333333333333333333333333333"
|
|
3024
|
-
* ],
|
|
3025
|
-
* "not_supported": [
|
|
3026
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3027
|
-
* ]
|
|
3028
|
-
* }
|
|
3029
|
-
* ]
|
|
3030
|
-
*/
|
|
3031
|
-
data: components["schemas"]["CallbackTypesChainResponse"][];
|
|
3032
|
-
};
|
|
3033
|
-
CallbackTypesChainResponse: {
|
|
3034
|
-
/** @example 1 */chain_id: number;
|
|
3035
|
-
/**
|
|
3036
|
-
* @example [
|
|
3037
|
-
* "0x3333333333333333333333333333333333333333"
|
|
3038
|
-
* ]
|
|
3039
|
-
*/
|
|
3040
|
-
buy_vault_v1_callback?: string[];
|
|
3041
|
-
/**
|
|
3042
|
-
* @example [
|
|
3043
|
-
* "0x1111111111111111111111111111111111111111"
|
|
3044
|
-
* ]
|
|
3045
|
-
*/
|
|
3046
|
-
sell_erc20_callback?: string[];
|
|
3047
|
-
/**
|
|
3048
|
-
* @example [
|
|
3049
|
-
* "0x5555555555555555555555555555555555555555"
|
|
3050
|
-
* ]
|
|
3051
|
-
*/
|
|
3052
|
-
buy_erc20?: string[];
|
|
3053
|
-
/**
|
|
3054
|
-
* @example [
|
|
3055
|
-
* "0x9999999999999999999999999999999999999999"
|
|
3056
|
-
* ]
|
|
3057
|
-
*/
|
|
3058
|
-
not_supported: string[];
|
|
3059
|
-
};
|
|
3060
2909
|
};
|
|
3061
2910
|
responses: never;
|
|
3062
2911
|
parameters: never;
|
|
@@ -3125,9 +2974,6 @@ declare class BooksController {
|
|
|
3125
2974
|
declare class ValidateController {
|
|
3126
2975
|
validateOffers(): Promise<void>;
|
|
3127
2976
|
}
|
|
3128
|
-
declare class CallbacksController {
|
|
3129
|
-
resolveCallbackTypes(): Promise<void>;
|
|
3130
|
-
}
|
|
3131
2977
|
declare class OffersController {
|
|
3132
2978
|
getOffers(): Promise<void>;
|
|
3133
2979
|
}
|
|
@@ -3277,12 +3123,6 @@ declare const schemas: {
|
|
|
3277
3123
|
readonly validate_offers: z$1.ZodObject<{
|
|
3278
3124
|
offers: z$1.ZodArray<z$1.ZodUnknown>;
|
|
3279
3125
|
}, z$1.core.$strict>;
|
|
3280
|
-
readonly callback_types: z$1.ZodObject<{
|
|
3281
|
-
callbacks: z$1.ZodArray<z$1.ZodObject<{
|
|
3282
|
-
chain_id: z$1.ZodNumber;
|
|
3283
|
-
addresses: z$1.ZodArray<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>>;
|
|
3284
|
-
}, z$1.core.$strict>>;
|
|
3285
|
-
}, z$1.core.$strict>;
|
|
3286
3126
|
readonly get_user_positions: z$1.ZodObject<{
|
|
3287
3127
|
user_address: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<`0x${string}`, string>>;
|
|
3288
3128
|
cursor: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -3293,7 +3133,7 @@ type Action = keyof typeof schemas;
|
|
|
3293
3133
|
declare function parse<A extends Action>(action: A, query: unknown): z$1.infer<(typeof schemas)[A]>;
|
|
3294
3134
|
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]>>;
|
|
3295
3135
|
declare namespace index_d_exports$1 {
|
|
3296
|
-
export { BookResponse_d_exports as BookResponse, BooksController,
|
|
3136
|
+
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 };
|
|
3297
3137
|
}
|
|
3298
3138
|
declare namespace Client_d_exports$1 {
|
|
3299
3139
|
export { Client$2 as Client, ConnectOptions, HttpForbiddenError, HttpGetApiFailedError, HttpRateLimitError, HttpUnauthorizedError, InvalidUrlError, connect$1 as connect, getObligations, getOffers };
|
|
@@ -3525,16 +3365,6 @@ type ValidateOffersIssues = {
|
|
|
3525
3365
|
issues: ValidationIssue[];
|
|
3526
3366
|
};
|
|
3527
3367
|
type ValidateOffersData = ValidateOffersSuccess | ValidateOffersIssues;
|
|
3528
|
-
type CallbackType = Type$1 | "not_supported";
|
|
3529
|
-
type CallbackTypesRequest = {
|
|
3530
|
-
callbacks: Array<{
|
|
3531
|
-
chain_id: Id;
|
|
3532
|
-
addresses: Address[];
|
|
3533
|
-
}>;
|
|
3534
|
-
};
|
|
3535
|
-
type CallbackTypesResponse = Array<{
|
|
3536
|
-
chain_id: Id;
|
|
3537
|
-
} & Partial<Record<CallbackType, Address[]>>>;
|
|
3538
3368
|
type ConfigRulesPayload = SuccessPayload<ConfigRule[]> | ErrorPayload;
|
|
3539
3369
|
type SuccessPayload<T> = {
|
|
3540
3370
|
meta: {
|
|
@@ -3571,8 +3401,7 @@ type GatekeeperClient = {
|
|
|
3571
3401
|
statusCode: number;
|
|
3572
3402
|
body: ConfigRulesPayload;
|
|
3573
3403
|
}>; /** Validate offers and return decision results. */
|
|
3574
|
-
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>; /**
|
|
3575
|
-
getCallbackTypes: (request: CallbackTypesRequest) => Promise<CallbackTypesResponse>; /** Base URL for the gatekeeper service. */
|
|
3404
|
+
isAllowed: (offers: Offer[]) => Promise<Result<Offer, string>>; /** Base URL for the gatekeeper service. */
|
|
3576
3405
|
baseUrl: string;
|
|
3577
3406
|
};
|
|
3578
3407
|
type ClientConfig = {
|
|
@@ -3615,10 +3444,10 @@ type ValidityParameters = {
|
|
|
3615
3444
|
/**
|
|
3616
3445
|
* set of rules to validate offers.
|
|
3617
3446
|
*
|
|
3618
|
-
* @param
|
|
3447
|
+
* @param _parameters - Validity parameters with chain and client
|
|
3619
3448
|
* @returns Array of validation rules to evaluate against offers
|
|
3620
3449
|
*/
|
|
3621
|
-
declare function validity(
|
|
3450
|
+
declare function validity(_parameters: ValidityParameters): Rule<Offer, "expiry">[];
|
|
3622
3451
|
declare const chains: ({
|
|
3623
3452
|
chains
|
|
3624
3453
|
}: {
|
|
@@ -3630,8 +3459,7 @@ declare const maturity: ({
|
|
|
3630
3459
|
maturities: MaturityType[];
|
|
3631
3460
|
}) => Rule<Offer, "maturity">;
|
|
3632
3461
|
declare const callback: ({
|
|
3633
|
-
callbacks
|
|
3634
|
-
allowedAddresses
|
|
3462
|
+
callbacks
|
|
3635
3463
|
}: {
|
|
3636
3464
|
callbacks: Type$1[];
|
|
3637
3465
|
allowedAddresses: Address[];
|
|
@@ -3860,5 +3688,5 @@ declare namespace index_d_exports$2 {
|
|
|
3860
3688
|
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 };
|
|
3861
3689
|
}
|
|
3862
3690
|
//#endregion
|
|
3863
|
-
export { index_d_exports as Abi, Brand, BrandTypeId, Callback_d_exports as Callback,
|
|
3691
|
+
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 };
|
|
3864
3692
|
//# sourceMappingURL=index.browser.d.mts.map
|