@morpho-dev/router 0.1.6 → 0.1.8
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/drizzle/offers_v1.1/0000_init.sql +95 -0
- package/dist/drizzle/offers_v1.1/0001_new_table_for_collectors_block_numbers.sql +5 -0
- package/dist/drizzle/offers_v1.1/0002_update-liquidity-tables.sql +8 -0
- package/dist/drizzle/offers_v1.1/0003_add-not-null-for-queue-id.sql +1 -0
- package/dist/drizzle/offers_v1.1/0004_add-callback-id-to-offer.sql +1 -0
- package/dist/drizzle/offers_v1.1/0005_add-missing-indices-to-liquidity-tables.sql +2 -0
- package/dist/drizzle/offers_v1.1/meta/0000_snapshot.json +827 -0
- package/dist/drizzle/offers_v1.1/meta/0001_snapshot.json +827 -0
- package/dist/drizzle/offers_v1.1/meta/0002_snapshot.json +833 -0
- package/dist/drizzle/offers_v1.1/meta/0003_snapshot.json +833 -0
- package/dist/drizzle/offers_v1.1/meta/0004_snapshot.json +839 -0
- package/dist/drizzle/offers_v1.1/meta/0005_snapshot.json +877 -0
- package/dist/drizzle/offers_v1.1/meta/_journal.json +48 -0
- package/dist/index.browser.d.cts +1 -114
- package/dist/index.browser.d.ts +1 -114
- package/dist/index.browser.js +149 -561
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +151 -562
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.cts +1446 -306
- package/dist/index.node.d.ts +1446 -306
- package/dist/index.node.js +2387 -1120
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +2321 -1064
- package/dist/index.node.mjs.map +1 -1
- package/package.json +12 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "postgresql",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"idx": 0,
|
|
7
|
+
"version": "7",
|
|
8
|
+
"when": 1757423412911,
|
|
9
|
+
"tag": "0000_init",
|
|
10
|
+
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "7",
|
|
15
|
+
"when": 1757924976654,
|
|
16
|
+
"tag": "0001_new_table_for_collectors_block_numbers",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"idx": 2,
|
|
21
|
+
"version": "7",
|
|
22
|
+
"when": 1758008817502,
|
|
23
|
+
"tag": "0002_update-liquidity-tables",
|
|
24
|
+
"breakpoints": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"idx": 3,
|
|
28
|
+
"version": "7",
|
|
29
|
+
"when": 1758052866088,
|
|
30
|
+
"tag": "0003_add-not-null-for-queue-id",
|
|
31
|
+
"breakpoints": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idx": 4,
|
|
35
|
+
"version": "7",
|
|
36
|
+
"when": 1758139247934,
|
|
37
|
+
"tag": "0004_add-callback-id-to-offer",
|
|
38
|
+
"breakpoints": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"idx": 5,
|
|
42
|
+
"version": "7",
|
|
43
|
+
"when": 1758270235112,
|
|
44
|
+
"tag": "0005_add-missing-indices-to-liquidity-tables",
|
|
45
|
+
"breakpoints": true
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
package/dist/index.browser.d.cts
CHANGED
|
@@ -436,119 +436,6 @@ declare namespace Client$1 {
|
|
|
436
436
|
export { type Client$1_Client as Client, type Client$1_GetParameters as GetParameters, Client$1_HttpForbiddenError as HttpForbiddenError, Client$1_HttpGetOffersFailedError as HttpGetOffersFailedError, Client$1_HttpRateLimitError as HttpRateLimitError, Client$1_HttpUnauthorizedError as HttpUnauthorizedError, Client$1_InvalidUrlError as InvalidUrlError, type Client$1_MatchParameters as MatchParameters, type Client$1_RouterClientConfig as RouterClientConfig, Client$1_connect as connect, Client$1_get as get, Client$1_match as match };
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
/**
|
|
440
|
-
* The `OfferStore` is responsible for managing offer data in the database.
|
|
441
|
-
*/
|
|
442
|
-
type OfferStore = {
|
|
443
|
-
/** Create a single offer in the database. */
|
|
444
|
-
create: (parameters: {
|
|
445
|
-
offer: Offer.Offer;
|
|
446
|
-
status: OfferStatus;
|
|
447
|
-
metadata?: OfferMetadata;
|
|
448
|
-
}) => Promise<string>;
|
|
449
|
-
/** Create multiple offers in the database. */
|
|
450
|
-
createMany: (parameters: {
|
|
451
|
-
offer: Offer.Offer;
|
|
452
|
-
status: OfferStatus;
|
|
453
|
-
metadata?: OfferMetadata;
|
|
454
|
-
}[]) => Promise<string[]>;
|
|
455
|
-
/** Get all offers from the database with optional filtering, sorting, and pagination. */
|
|
456
|
-
getAll: (params?: GetAllParams) => Promise<{
|
|
457
|
-
offers: RouterOffer[];
|
|
458
|
-
nextCursor: string | null;
|
|
459
|
-
}>;
|
|
460
|
-
/** Find offers that match the specified parameters, with cursor pagination. */
|
|
461
|
-
findMatchingOffers: (params: FindMatchingOffersParams) => Promise<{
|
|
462
|
-
offers: RouterOffer[];
|
|
463
|
-
nextCursor: string | null;
|
|
464
|
-
}>;
|
|
465
|
-
/** Delete an offer and its associated collaterals by hash. */
|
|
466
|
-
delete: (hash: Offer.Offer["hash"]) => Promise<boolean>;
|
|
467
|
-
/** Delete multiple offers and their associated collaterals by hashes. */
|
|
468
|
-
deleteMany: (hashes: Offer.Offer["hash"][]) => Promise<number>;
|
|
469
|
-
/** Update the status of an offer. */
|
|
470
|
-
updateStatus: (parameters: {
|
|
471
|
-
offerHash: Offer.Offer["hash"];
|
|
472
|
-
status: OfferStatus;
|
|
473
|
-
metadata?: OfferMetadata;
|
|
474
|
-
}) => Promise<void>;
|
|
475
|
-
updateConsumedAmount: (parameters: {
|
|
476
|
-
id: string;
|
|
477
|
-
chainId: Offer.Offer["chainId"];
|
|
478
|
-
offering: Offer.Offer["offering"];
|
|
479
|
-
nonce: Offer.Offer["nonce"];
|
|
480
|
-
consumed: bigint;
|
|
481
|
-
}) => Promise<void>;
|
|
482
|
-
};
|
|
483
|
-
type GetOffersFilters = {
|
|
484
|
-
creators?: string[];
|
|
485
|
-
side?: "buy" | "sell";
|
|
486
|
-
chains?: number[];
|
|
487
|
-
loanTokens?: string[];
|
|
488
|
-
status?: OfferStatus[];
|
|
489
|
-
callbackAddresses?: string[];
|
|
490
|
-
minAmount?: bigint;
|
|
491
|
-
maxAmount?: bigint;
|
|
492
|
-
minRate?: bigint;
|
|
493
|
-
maxRate?: bigint;
|
|
494
|
-
minMaturity?: number;
|
|
495
|
-
maxMaturity?: number;
|
|
496
|
-
minExpiry?: number;
|
|
497
|
-
maxExpiry?: number;
|
|
498
|
-
collateralAssets?: string[];
|
|
499
|
-
collateralOracles?: string[];
|
|
500
|
-
collateralTuple?: Array<{
|
|
501
|
-
asset: string;
|
|
502
|
-
oracle?: string;
|
|
503
|
-
lltv?: LLTV.LLTV;
|
|
504
|
-
}>;
|
|
505
|
-
minLltv?: number;
|
|
506
|
-
maxLltv?: number;
|
|
507
|
-
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
508
|
-
sortOrder?: "asc" | "desc";
|
|
509
|
-
cursor?: string;
|
|
510
|
-
limit?: number;
|
|
511
|
-
};
|
|
512
|
-
type FindMatchingOffersParams = {
|
|
513
|
-
side: "buy" | "sell";
|
|
514
|
-
chainId: number;
|
|
515
|
-
rate?: bigint;
|
|
516
|
-
collaterals?: Array<{
|
|
517
|
-
asset: string;
|
|
518
|
-
oracle: string;
|
|
519
|
-
lltv: LLTV.LLTV;
|
|
520
|
-
}>;
|
|
521
|
-
maturity?: number;
|
|
522
|
-
minMaturity?: number;
|
|
523
|
-
maxMaturity?: number;
|
|
524
|
-
loanToken?: string;
|
|
525
|
-
creator?: string;
|
|
526
|
-
/** Cursor string returned by a previous call, for pagination */
|
|
527
|
-
cursor?: string;
|
|
528
|
-
/** Page size; defaults to 20 */
|
|
529
|
-
limit?: number;
|
|
530
|
-
};
|
|
531
|
-
type GetAllParams = {
|
|
532
|
-
query?: GetOffersFilters;
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
declare function memory(parameters: {
|
|
536
|
-
offers: Map<Hex, Offer.Offer & {
|
|
537
|
-
status: OfferStatus;
|
|
538
|
-
metadata?: OfferMetadata;
|
|
539
|
-
}>;
|
|
540
|
-
filled: Map<Chain.Id, Map<Address, Map<bigint, bigint>>>;
|
|
541
|
-
}): OfferStore;
|
|
542
|
-
|
|
543
|
-
type index_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
544
|
-
type index_GetAllParams = GetAllParams;
|
|
545
|
-
type index_GetOffersFilters = GetOffersFilters;
|
|
546
|
-
type index_OfferStore = OfferStore;
|
|
547
|
-
declare const index_memory: typeof memory;
|
|
548
|
-
declare namespace index {
|
|
549
|
-
export { type index_FindMatchingOffersParams as FindMatchingOffersParams, type index_GetAllParams as GetAllParams, type index_GetOffersFilters as GetOffersFilters, type index_OfferStore as OfferStore, index_memory as memory };
|
|
550
|
-
}
|
|
551
|
-
|
|
552
439
|
/**
|
|
553
440
|
* A validation rule.
|
|
554
441
|
*/
|
|
@@ -746,4 +633,4 @@ declare namespace Validation {
|
|
|
746
633
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
747
634
|
}
|
|
748
635
|
|
|
749
|
-
export { Callback, Cursor$1 as Cursor, Liquidity$1 as Liquidity,
|
|
636
|
+
export { Callback, Cursor$1 as Cursor, Liquidity$1 as Liquidity, Client$1 as Router, RouterOffer$1 as RouterOffer, Validation, ValidationRule };
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -436,119 +436,6 @@ declare namespace Client$1 {
|
|
|
436
436
|
export { type Client$1_Client as Client, type Client$1_GetParameters as GetParameters, Client$1_HttpForbiddenError as HttpForbiddenError, Client$1_HttpGetOffersFailedError as HttpGetOffersFailedError, Client$1_HttpRateLimitError as HttpRateLimitError, Client$1_HttpUnauthorizedError as HttpUnauthorizedError, Client$1_InvalidUrlError as InvalidUrlError, type Client$1_MatchParameters as MatchParameters, type Client$1_RouterClientConfig as RouterClientConfig, Client$1_connect as connect, Client$1_get as get, Client$1_match as match };
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
/**
|
|
440
|
-
* The `OfferStore` is responsible for managing offer data in the database.
|
|
441
|
-
*/
|
|
442
|
-
type OfferStore = {
|
|
443
|
-
/** Create a single offer in the database. */
|
|
444
|
-
create: (parameters: {
|
|
445
|
-
offer: Offer.Offer;
|
|
446
|
-
status: OfferStatus;
|
|
447
|
-
metadata?: OfferMetadata;
|
|
448
|
-
}) => Promise<string>;
|
|
449
|
-
/** Create multiple offers in the database. */
|
|
450
|
-
createMany: (parameters: {
|
|
451
|
-
offer: Offer.Offer;
|
|
452
|
-
status: OfferStatus;
|
|
453
|
-
metadata?: OfferMetadata;
|
|
454
|
-
}[]) => Promise<string[]>;
|
|
455
|
-
/** Get all offers from the database with optional filtering, sorting, and pagination. */
|
|
456
|
-
getAll: (params?: GetAllParams) => Promise<{
|
|
457
|
-
offers: RouterOffer[];
|
|
458
|
-
nextCursor: string | null;
|
|
459
|
-
}>;
|
|
460
|
-
/** Find offers that match the specified parameters, with cursor pagination. */
|
|
461
|
-
findMatchingOffers: (params: FindMatchingOffersParams) => Promise<{
|
|
462
|
-
offers: RouterOffer[];
|
|
463
|
-
nextCursor: string | null;
|
|
464
|
-
}>;
|
|
465
|
-
/** Delete an offer and its associated collaterals by hash. */
|
|
466
|
-
delete: (hash: Offer.Offer["hash"]) => Promise<boolean>;
|
|
467
|
-
/** Delete multiple offers and their associated collaterals by hashes. */
|
|
468
|
-
deleteMany: (hashes: Offer.Offer["hash"][]) => Promise<number>;
|
|
469
|
-
/** Update the status of an offer. */
|
|
470
|
-
updateStatus: (parameters: {
|
|
471
|
-
offerHash: Offer.Offer["hash"];
|
|
472
|
-
status: OfferStatus;
|
|
473
|
-
metadata?: OfferMetadata;
|
|
474
|
-
}) => Promise<void>;
|
|
475
|
-
updateConsumedAmount: (parameters: {
|
|
476
|
-
id: string;
|
|
477
|
-
chainId: Offer.Offer["chainId"];
|
|
478
|
-
offering: Offer.Offer["offering"];
|
|
479
|
-
nonce: Offer.Offer["nonce"];
|
|
480
|
-
consumed: bigint;
|
|
481
|
-
}) => Promise<void>;
|
|
482
|
-
};
|
|
483
|
-
type GetOffersFilters = {
|
|
484
|
-
creators?: string[];
|
|
485
|
-
side?: "buy" | "sell";
|
|
486
|
-
chains?: number[];
|
|
487
|
-
loanTokens?: string[];
|
|
488
|
-
status?: OfferStatus[];
|
|
489
|
-
callbackAddresses?: string[];
|
|
490
|
-
minAmount?: bigint;
|
|
491
|
-
maxAmount?: bigint;
|
|
492
|
-
minRate?: bigint;
|
|
493
|
-
maxRate?: bigint;
|
|
494
|
-
minMaturity?: number;
|
|
495
|
-
maxMaturity?: number;
|
|
496
|
-
minExpiry?: number;
|
|
497
|
-
maxExpiry?: number;
|
|
498
|
-
collateralAssets?: string[];
|
|
499
|
-
collateralOracles?: string[];
|
|
500
|
-
collateralTuple?: Array<{
|
|
501
|
-
asset: string;
|
|
502
|
-
oracle?: string;
|
|
503
|
-
lltv?: LLTV.LLTV;
|
|
504
|
-
}>;
|
|
505
|
-
minLltv?: number;
|
|
506
|
-
maxLltv?: number;
|
|
507
|
-
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
508
|
-
sortOrder?: "asc" | "desc";
|
|
509
|
-
cursor?: string;
|
|
510
|
-
limit?: number;
|
|
511
|
-
};
|
|
512
|
-
type FindMatchingOffersParams = {
|
|
513
|
-
side: "buy" | "sell";
|
|
514
|
-
chainId: number;
|
|
515
|
-
rate?: bigint;
|
|
516
|
-
collaterals?: Array<{
|
|
517
|
-
asset: string;
|
|
518
|
-
oracle: string;
|
|
519
|
-
lltv: LLTV.LLTV;
|
|
520
|
-
}>;
|
|
521
|
-
maturity?: number;
|
|
522
|
-
minMaturity?: number;
|
|
523
|
-
maxMaturity?: number;
|
|
524
|
-
loanToken?: string;
|
|
525
|
-
creator?: string;
|
|
526
|
-
/** Cursor string returned by a previous call, for pagination */
|
|
527
|
-
cursor?: string;
|
|
528
|
-
/** Page size; defaults to 20 */
|
|
529
|
-
limit?: number;
|
|
530
|
-
};
|
|
531
|
-
type GetAllParams = {
|
|
532
|
-
query?: GetOffersFilters;
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
declare function memory(parameters: {
|
|
536
|
-
offers: Map<Hex, Offer.Offer & {
|
|
537
|
-
status: OfferStatus;
|
|
538
|
-
metadata?: OfferMetadata;
|
|
539
|
-
}>;
|
|
540
|
-
filled: Map<Chain.Id, Map<Address, Map<bigint, bigint>>>;
|
|
541
|
-
}): OfferStore;
|
|
542
|
-
|
|
543
|
-
type index_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
544
|
-
type index_GetAllParams = GetAllParams;
|
|
545
|
-
type index_GetOffersFilters = GetOffersFilters;
|
|
546
|
-
type index_OfferStore = OfferStore;
|
|
547
|
-
declare const index_memory: typeof memory;
|
|
548
|
-
declare namespace index {
|
|
549
|
-
export { type index_FindMatchingOffersParams as FindMatchingOffersParams, type index_GetAllParams as GetAllParams, type index_GetOffersFilters as GetOffersFilters, type index_OfferStore as OfferStore, index_memory as memory };
|
|
550
|
-
}
|
|
551
|
-
|
|
552
439
|
/**
|
|
553
440
|
* A validation rule.
|
|
554
441
|
*/
|
|
@@ -746,4 +633,4 @@ declare namespace Validation {
|
|
|
746
633
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
747
634
|
}
|
|
748
635
|
|
|
749
|
-
export { Callback, Cursor$1 as Cursor, Liquidity$1 as Liquidity,
|
|
636
|
+
export { Callback, Cursor$1 as Cursor, Liquidity$1 as Liquidity, Client$1 as Router, RouterOffer$1 as RouterOffer, Validation, ValidationRule };
|