@morpho-dev/router 0.0.17 → 0.0.19
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/index.browser.d.cts +139 -12
- package/dist/index.browser.d.ts +139 -12
- package/dist/index.browser.js +533 -92
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +534 -89
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.cts +132 -750
- package/dist/index.node.d.ts +132 -750
- package/dist/index.node.js +895 -1302
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +894 -1291
- package/dist/index.node.mjs.map +1 -1
- package/package.json +3 -12
- package/dist/drizzle/0000_add-offers-table.sql +0 -37
- package/dist/drizzle/0001_create_offer_status_relation.sql +0 -10
- package/dist/drizzle/0002_add_created_at_in_offer_status_relation.sql +0 -3
- package/dist/drizzle/0003_add-cursor-indices-to-offers.sql +0 -6
- package/dist/drizzle/0004_offer-start.sql +0 -1
- package/dist/drizzle/0005_rename-price-token-buy.sql +0 -8
- package/dist/drizzle/0006_rename-buy.sql +0 -3
- package/dist/drizzle/0007_rename-offering.sql +0 -3
- package/dist/drizzle/0008_add-consumed-relation.sql +0 -10
- package/dist/drizzle/meta/0000_snapshot.json +0 -344
- package/dist/drizzle/meta/0001_snapshot.json +0 -426
- package/dist/drizzle/meta/0002_snapshot.json +0 -439
- package/dist/drizzle/meta/0003_snapshot.json +0 -553
- package/dist/drizzle/meta/0004_snapshot.json +0 -559
- package/dist/drizzle/meta/0005_snapshot.json +0 -559
- package/dist/drizzle/meta/0006_snapshot.json +0 -559
- package/dist/drizzle/meta/0007_snapshot.json +0 -559
- package/dist/drizzle/meta/0008_snapshot.json +0 -635
- package/dist/drizzle/meta/_journal.json +0 -69
package/dist/index.browser.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _morpho_dev_mempool from '@morpho-dev/mempool';
|
|
2
|
-
import { Compute, Offer, Errors, Format } from '@morpho-dev/mempool';
|
|
2
|
+
import { Compute, Offer, Errors, Format, Maturity, LLTV } from '@morpho-dev/mempool';
|
|
3
3
|
export * from '@morpho-dev/mempool';
|
|
4
4
|
import * as viem from 'viem';
|
|
5
|
-
import { Address, PublicClient } from 'viem';
|
|
5
|
+
import { Address, Hex, PublicClient } from 'viem';
|
|
6
6
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
7
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
8
8
|
import * as zod_v4 from 'zod/v4';
|
|
@@ -158,9 +158,9 @@ type GetParameters = {
|
|
|
158
158
|
/** Maximum rate per asset (in wei) */
|
|
159
159
|
maxRate?: bigint;
|
|
160
160
|
/** Minimum maturity timestamp (Unix timestamp in seconds) */
|
|
161
|
-
minMaturity?:
|
|
161
|
+
minMaturity?: Maturity.Maturity;
|
|
162
162
|
/** Maximum maturity timestamp (Unix timestamp in seconds) */
|
|
163
|
-
maxMaturity?:
|
|
163
|
+
maxMaturity?: Maturity.Maturity;
|
|
164
164
|
/** Minimum expiry timestamp (Unix timestamp in seconds) */
|
|
165
165
|
minExpiry?: number;
|
|
166
166
|
/** Maximum expiry timestamp (Unix timestamp in seconds) */
|
|
@@ -173,12 +173,12 @@ type GetParameters = {
|
|
|
173
173
|
collateralTuple?: Array<{
|
|
174
174
|
asset: string;
|
|
175
175
|
oracle?: string;
|
|
176
|
-
lltv?:
|
|
176
|
+
lltv?: LLTV.LLTV;
|
|
177
177
|
}>;
|
|
178
178
|
/** Minimum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
179
|
-
minLltv?:
|
|
179
|
+
minLltv?: LLTV.LLTV;
|
|
180
180
|
/** Maximum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
181
|
-
maxLltv?:
|
|
181
|
+
maxLltv?: LLTV.LLTV;
|
|
182
182
|
/** Field to sort results by */
|
|
183
183
|
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
184
184
|
/** Sort direction: asc (ascending) or desc (descending, default) */
|
|
@@ -199,14 +199,14 @@ type MatchParameters = {
|
|
|
199
199
|
collaterals?: Array<{
|
|
200
200
|
asset: string;
|
|
201
201
|
oracle: string;
|
|
202
|
-
lltv:
|
|
202
|
+
lltv: LLTV.LLTV;
|
|
203
203
|
}>;
|
|
204
204
|
/** Exact maturity timestamp (Unix timestamp in seconds) */
|
|
205
|
-
maturity?:
|
|
205
|
+
maturity?: Maturity.Maturity;
|
|
206
206
|
/** Minimum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
207
|
-
minMaturity?:
|
|
207
|
+
minMaturity?: Maturity.Maturity;
|
|
208
208
|
/** Maximum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
209
|
-
maxMaturity?:
|
|
209
|
+
maxMaturity?: Maturity.Maturity;
|
|
210
210
|
/** The loan asset address to match against */
|
|
211
211
|
loanToken?: string;
|
|
212
212
|
/** Filter by a specific offer creator address */
|
|
@@ -306,6 +306,120 @@ declare namespace Client$1 {
|
|
|
306
306
|
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 };
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
/**
|
|
310
|
+
* The `OfferStore` is responsible for managing offer data in the database.
|
|
311
|
+
*/
|
|
312
|
+
type OfferStore = {
|
|
313
|
+
/** Create a single offer in the database. */
|
|
314
|
+
create: (parameters: {
|
|
315
|
+
offer: Offer.Offer;
|
|
316
|
+
status: OfferStatus;
|
|
317
|
+
metadata?: OfferMetadata;
|
|
318
|
+
}) => Promise<string>;
|
|
319
|
+
/** Create multiple offers in the database. */
|
|
320
|
+
createMany: (parameters: {
|
|
321
|
+
offer: Offer.Offer;
|
|
322
|
+
status: OfferStatus;
|
|
323
|
+
metadata?: OfferMetadata;
|
|
324
|
+
}[]) => Promise<string[]>;
|
|
325
|
+
/** Get all offers from the database with optional filtering, sorting, and pagination. */
|
|
326
|
+
getAll: (params?: GetAllParams) => Promise<{
|
|
327
|
+
offers: RouterOffer[];
|
|
328
|
+
nextCursor: string | null;
|
|
329
|
+
}>;
|
|
330
|
+
/** Find offers that match the specified parameters, with cursor pagination. */
|
|
331
|
+
findMatchingOffers: (params: FindMatchingOffersParams) => Promise<{
|
|
332
|
+
offers: RouterOffer[];
|
|
333
|
+
nextCursor: string | null;
|
|
334
|
+
}>;
|
|
335
|
+
/** Delete an offer and its associated collaterals by hash. */
|
|
336
|
+
delete: (hash: Offer.Offer["hash"]) => Promise<boolean>;
|
|
337
|
+
/** Delete multiple offers and their associated collaterals by hashes. */
|
|
338
|
+
deleteMany: (hashes: Offer.Offer["hash"][]) => Promise<number>;
|
|
339
|
+
/** Update the status of an offer. */
|
|
340
|
+
updateStatus: (parameters: {
|
|
341
|
+
offerHash: Offer.Offer["hash"];
|
|
342
|
+
status: OfferStatus;
|
|
343
|
+
metadata?: OfferMetadata;
|
|
344
|
+
}) => Promise<void>;
|
|
345
|
+
updateConsumedAmount: (parameters: {
|
|
346
|
+
chainId: Offer.Offer["chainId"];
|
|
347
|
+
offering: Offer.Offer["offering"];
|
|
348
|
+
nonce: Offer.Offer["nonce"];
|
|
349
|
+
consumed: bigint;
|
|
350
|
+
}) => Promise<void>;
|
|
351
|
+
};
|
|
352
|
+
type GetOffersFilters = {
|
|
353
|
+
creators?: string[];
|
|
354
|
+
side?: "buy" | "sell";
|
|
355
|
+
chains?: number[];
|
|
356
|
+
loanTokens?: string[];
|
|
357
|
+
status?: OfferStatus[];
|
|
358
|
+
callbackAddresses?: string[];
|
|
359
|
+
minAmount?: bigint;
|
|
360
|
+
maxAmount?: bigint;
|
|
361
|
+
minRate?: bigint;
|
|
362
|
+
maxRate?: bigint;
|
|
363
|
+
minMaturity?: Maturity.Maturity;
|
|
364
|
+
maxMaturity?: Maturity.Maturity;
|
|
365
|
+
minExpiry?: number;
|
|
366
|
+
maxExpiry?: number;
|
|
367
|
+
collateralAssets?: string[];
|
|
368
|
+
collateralOracles?: string[];
|
|
369
|
+
collateralTuple?: Array<{
|
|
370
|
+
asset: string;
|
|
371
|
+
oracle?: string;
|
|
372
|
+
lltv?: LLTV.LLTV;
|
|
373
|
+
}>;
|
|
374
|
+
minLltv?: LLTV.LLTV;
|
|
375
|
+
maxLltv?: LLTV.LLTV;
|
|
376
|
+
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
377
|
+
sortOrder?: "asc" | "desc";
|
|
378
|
+
cursor?: string;
|
|
379
|
+
limit?: number;
|
|
380
|
+
};
|
|
381
|
+
type FindMatchingOffersParams = {
|
|
382
|
+
side: "buy" | "sell";
|
|
383
|
+
chainId: number;
|
|
384
|
+
rate?: bigint;
|
|
385
|
+
collaterals?: Array<{
|
|
386
|
+
asset: string;
|
|
387
|
+
oracle: string;
|
|
388
|
+
lltv: LLTV.LLTV;
|
|
389
|
+
}>;
|
|
390
|
+
maturity?: Maturity.Maturity;
|
|
391
|
+
minMaturity?: Maturity.Maturity;
|
|
392
|
+
maxMaturity?: Maturity.Maturity;
|
|
393
|
+
loanToken?: string;
|
|
394
|
+
creator?: string;
|
|
395
|
+
/** Filter by offer status; if omitted defaults to ["valid"] */
|
|
396
|
+
status?: OfferStatus[];
|
|
397
|
+
/** Cursor string returned by a previous call, for pagination */
|
|
398
|
+
cursor?: string;
|
|
399
|
+
/** Page size; defaults to 20 */
|
|
400
|
+
limit?: number;
|
|
401
|
+
};
|
|
402
|
+
type GetAllParams = {
|
|
403
|
+
query?: GetOffersFilters;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
declare function memory(parameters: {
|
|
407
|
+
offers: Map<Hex, Offer.Offer & {
|
|
408
|
+
status: OfferStatus;
|
|
409
|
+
metadata?: OfferMetadata;
|
|
410
|
+
}>;
|
|
411
|
+
filled: Map<ChainId, Map<Address, Map<bigint, bigint>>>;
|
|
412
|
+
}): OfferStore;
|
|
413
|
+
|
|
414
|
+
type index$1_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
415
|
+
type index$1_GetAllParams = GetAllParams;
|
|
416
|
+
type index$1_GetOffersFilters = GetOffersFilters;
|
|
417
|
+
type index$1_OfferStore = OfferStore;
|
|
418
|
+
declare const index$1_memory: typeof memory;
|
|
419
|
+
declare namespace index$1 {
|
|
420
|
+
export { type index$1_FindMatchingOffersParams as FindMatchingOffersParams, type index$1_GetAllParams as GetAllParams, type index$1_GetOffersFilters as GetOffersFilters, type index$1_OfferStore as OfferStore, index$1_memory as memory };
|
|
421
|
+
}
|
|
422
|
+
|
|
309
423
|
declare const types: readonly ["offer_created", "offer_matched", "offer_validation"];
|
|
310
424
|
type Type = (typeof types)[number];
|
|
311
425
|
type EventPayload = {
|
|
@@ -383,8 +497,21 @@ declare function poll<data>(fn: ({ unpoll }: {
|
|
|
383
497
|
interval: number;
|
|
384
498
|
}): () => boolean;
|
|
385
499
|
|
|
500
|
+
declare const retry: <T>(fn: () => Promise<T>, attempts?: number, delayMs?: number) => Promise<T>;
|
|
501
|
+
|
|
386
502
|
declare function wait(time: number): Promise<unknown>;
|
|
387
503
|
|
|
504
|
+
type index_Cursor = Cursor;
|
|
505
|
+
declare const index_decodeCursor: typeof decodeCursor;
|
|
506
|
+
declare const index_encodeCursor: typeof encodeCursor;
|
|
507
|
+
declare const index_poll: typeof poll;
|
|
508
|
+
declare const index_retry: typeof retry;
|
|
509
|
+
declare const index_validateCursor: typeof validateCursor;
|
|
510
|
+
declare const index_wait: typeof wait;
|
|
511
|
+
declare namespace index {
|
|
512
|
+
export { type index_Cursor as Cursor, batch$1 as batch, index_decodeCursor as decodeCursor, index_encodeCursor as encodeCursor, index_poll as poll, index_retry as retry, index_validateCursor as validateCursor, index_wait as wait };
|
|
513
|
+
}
|
|
514
|
+
|
|
388
515
|
/**
|
|
389
516
|
* A validation rule.
|
|
390
517
|
*/
|
|
@@ -632,4 +759,4 @@ declare namespace Validation {
|
|
|
632
759
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
633
760
|
}
|
|
634
761
|
|
|
635
|
-
export { Chain$1 as Chain,
|
|
762
|
+
export { Chain$1 as Chain, index$1 as OfferStore, Client$1 as Router, RouterEvent$1 as RouterEvent, RouterOffer$1 as RouterOffer, index as Utils, Validation, ValidationRule };
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _morpho_dev_mempool from '@morpho-dev/mempool';
|
|
2
|
-
import { Compute, Offer, Errors, Format } from '@morpho-dev/mempool';
|
|
2
|
+
import { Compute, Offer, Errors, Format, Maturity, LLTV } from '@morpho-dev/mempool';
|
|
3
3
|
export * from '@morpho-dev/mempool';
|
|
4
4
|
import * as viem from 'viem';
|
|
5
|
-
import { Address, PublicClient } from 'viem';
|
|
5
|
+
import { Address, Hex, PublicClient } from 'viem';
|
|
6
6
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
7
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
8
8
|
import * as zod_v4 from 'zod/v4';
|
|
@@ -158,9 +158,9 @@ type GetParameters = {
|
|
|
158
158
|
/** Maximum rate per asset (in wei) */
|
|
159
159
|
maxRate?: bigint;
|
|
160
160
|
/** Minimum maturity timestamp (Unix timestamp in seconds) */
|
|
161
|
-
minMaturity?:
|
|
161
|
+
minMaturity?: Maturity.Maturity;
|
|
162
162
|
/** Maximum maturity timestamp (Unix timestamp in seconds) */
|
|
163
|
-
maxMaturity?:
|
|
163
|
+
maxMaturity?: Maturity.Maturity;
|
|
164
164
|
/** Minimum expiry timestamp (Unix timestamp in seconds) */
|
|
165
165
|
minExpiry?: number;
|
|
166
166
|
/** Maximum expiry timestamp (Unix timestamp in seconds) */
|
|
@@ -173,12 +173,12 @@ type GetParameters = {
|
|
|
173
173
|
collateralTuple?: Array<{
|
|
174
174
|
asset: string;
|
|
175
175
|
oracle?: string;
|
|
176
|
-
lltv?:
|
|
176
|
+
lltv?: LLTV.LLTV;
|
|
177
177
|
}>;
|
|
178
178
|
/** Minimum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
179
|
-
minLltv?:
|
|
179
|
+
minLltv?: LLTV.LLTV;
|
|
180
180
|
/** Maximum Loan-to-Value ratio (LLTV) for collateral (percentage as decimal) */
|
|
181
|
-
maxLltv?:
|
|
181
|
+
maxLltv?: LLTV.LLTV;
|
|
182
182
|
/** Field to sort results by */
|
|
183
183
|
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
184
184
|
/** Sort direction: asc (ascending) or desc (descending, default) */
|
|
@@ -199,14 +199,14 @@ type MatchParameters = {
|
|
|
199
199
|
collaterals?: Array<{
|
|
200
200
|
asset: string;
|
|
201
201
|
oracle: string;
|
|
202
|
-
lltv:
|
|
202
|
+
lltv: LLTV.LLTV;
|
|
203
203
|
}>;
|
|
204
204
|
/** Exact maturity timestamp (Unix timestamp in seconds) */
|
|
205
|
-
maturity?:
|
|
205
|
+
maturity?: Maturity.Maturity;
|
|
206
206
|
/** Minimum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
207
|
-
minMaturity?:
|
|
207
|
+
minMaturity?: Maturity.Maturity;
|
|
208
208
|
/** Maximum maturity timestamp (Unix timestamp in seconds, inclusive) */
|
|
209
|
-
maxMaturity?:
|
|
209
|
+
maxMaturity?: Maturity.Maturity;
|
|
210
210
|
/** The loan asset address to match against */
|
|
211
211
|
loanToken?: string;
|
|
212
212
|
/** Filter by a specific offer creator address */
|
|
@@ -306,6 +306,120 @@ declare namespace Client$1 {
|
|
|
306
306
|
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 };
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
/**
|
|
310
|
+
* The `OfferStore` is responsible for managing offer data in the database.
|
|
311
|
+
*/
|
|
312
|
+
type OfferStore = {
|
|
313
|
+
/** Create a single offer in the database. */
|
|
314
|
+
create: (parameters: {
|
|
315
|
+
offer: Offer.Offer;
|
|
316
|
+
status: OfferStatus;
|
|
317
|
+
metadata?: OfferMetadata;
|
|
318
|
+
}) => Promise<string>;
|
|
319
|
+
/** Create multiple offers in the database. */
|
|
320
|
+
createMany: (parameters: {
|
|
321
|
+
offer: Offer.Offer;
|
|
322
|
+
status: OfferStatus;
|
|
323
|
+
metadata?: OfferMetadata;
|
|
324
|
+
}[]) => Promise<string[]>;
|
|
325
|
+
/** Get all offers from the database with optional filtering, sorting, and pagination. */
|
|
326
|
+
getAll: (params?: GetAllParams) => Promise<{
|
|
327
|
+
offers: RouterOffer[];
|
|
328
|
+
nextCursor: string | null;
|
|
329
|
+
}>;
|
|
330
|
+
/** Find offers that match the specified parameters, with cursor pagination. */
|
|
331
|
+
findMatchingOffers: (params: FindMatchingOffersParams) => Promise<{
|
|
332
|
+
offers: RouterOffer[];
|
|
333
|
+
nextCursor: string | null;
|
|
334
|
+
}>;
|
|
335
|
+
/** Delete an offer and its associated collaterals by hash. */
|
|
336
|
+
delete: (hash: Offer.Offer["hash"]) => Promise<boolean>;
|
|
337
|
+
/** Delete multiple offers and their associated collaterals by hashes. */
|
|
338
|
+
deleteMany: (hashes: Offer.Offer["hash"][]) => Promise<number>;
|
|
339
|
+
/** Update the status of an offer. */
|
|
340
|
+
updateStatus: (parameters: {
|
|
341
|
+
offerHash: Offer.Offer["hash"];
|
|
342
|
+
status: OfferStatus;
|
|
343
|
+
metadata?: OfferMetadata;
|
|
344
|
+
}) => Promise<void>;
|
|
345
|
+
updateConsumedAmount: (parameters: {
|
|
346
|
+
chainId: Offer.Offer["chainId"];
|
|
347
|
+
offering: Offer.Offer["offering"];
|
|
348
|
+
nonce: Offer.Offer["nonce"];
|
|
349
|
+
consumed: bigint;
|
|
350
|
+
}) => Promise<void>;
|
|
351
|
+
};
|
|
352
|
+
type GetOffersFilters = {
|
|
353
|
+
creators?: string[];
|
|
354
|
+
side?: "buy" | "sell";
|
|
355
|
+
chains?: number[];
|
|
356
|
+
loanTokens?: string[];
|
|
357
|
+
status?: OfferStatus[];
|
|
358
|
+
callbackAddresses?: string[];
|
|
359
|
+
minAmount?: bigint;
|
|
360
|
+
maxAmount?: bigint;
|
|
361
|
+
minRate?: bigint;
|
|
362
|
+
maxRate?: bigint;
|
|
363
|
+
minMaturity?: Maturity.Maturity;
|
|
364
|
+
maxMaturity?: Maturity.Maturity;
|
|
365
|
+
minExpiry?: number;
|
|
366
|
+
maxExpiry?: number;
|
|
367
|
+
collateralAssets?: string[];
|
|
368
|
+
collateralOracles?: string[];
|
|
369
|
+
collateralTuple?: Array<{
|
|
370
|
+
asset: string;
|
|
371
|
+
oracle?: string;
|
|
372
|
+
lltv?: LLTV.LLTV;
|
|
373
|
+
}>;
|
|
374
|
+
minLltv?: LLTV.LLTV;
|
|
375
|
+
maxLltv?: LLTV.LLTV;
|
|
376
|
+
sortBy?: "rate" | "maturity" | "expiry" | "amount";
|
|
377
|
+
sortOrder?: "asc" | "desc";
|
|
378
|
+
cursor?: string;
|
|
379
|
+
limit?: number;
|
|
380
|
+
};
|
|
381
|
+
type FindMatchingOffersParams = {
|
|
382
|
+
side: "buy" | "sell";
|
|
383
|
+
chainId: number;
|
|
384
|
+
rate?: bigint;
|
|
385
|
+
collaterals?: Array<{
|
|
386
|
+
asset: string;
|
|
387
|
+
oracle: string;
|
|
388
|
+
lltv: LLTV.LLTV;
|
|
389
|
+
}>;
|
|
390
|
+
maturity?: Maturity.Maturity;
|
|
391
|
+
minMaturity?: Maturity.Maturity;
|
|
392
|
+
maxMaturity?: Maturity.Maturity;
|
|
393
|
+
loanToken?: string;
|
|
394
|
+
creator?: string;
|
|
395
|
+
/** Filter by offer status; if omitted defaults to ["valid"] */
|
|
396
|
+
status?: OfferStatus[];
|
|
397
|
+
/** Cursor string returned by a previous call, for pagination */
|
|
398
|
+
cursor?: string;
|
|
399
|
+
/** Page size; defaults to 20 */
|
|
400
|
+
limit?: number;
|
|
401
|
+
};
|
|
402
|
+
type GetAllParams = {
|
|
403
|
+
query?: GetOffersFilters;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
declare function memory(parameters: {
|
|
407
|
+
offers: Map<Hex, Offer.Offer & {
|
|
408
|
+
status: OfferStatus;
|
|
409
|
+
metadata?: OfferMetadata;
|
|
410
|
+
}>;
|
|
411
|
+
filled: Map<ChainId, Map<Address, Map<bigint, bigint>>>;
|
|
412
|
+
}): OfferStore;
|
|
413
|
+
|
|
414
|
+
type index$1_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
415
|
+
type index$1_GetAllParams = GetAllParams;
|
|
416
|
+
type index$1_GetOffersFilters = GetOffersFilters;
|
|
417
|
+
type index$1_OfferStore = OfferStore;
|
|
418
|
+
declare const index$1_memory: typeof memory;
|
|
419
|
+
declare namespace index$1 {
|
|
420
|
+
export { type index$1_FindMatchingOffersParams as FindMatchingOffersParams, type index$1_GetAllParams as GetAllParams, type index$1_GetOffersFilters as GetOffersFilters, type index$1_OfferStore as OfferStore, index$1_memory as memory };
|
|
421
|
+
}
|
|
422
|
+
|
|
309
423
|
declare const types: readonly ["offer_created", "offer_matched", "offer_validation"];
|
|
310
424
|
type Type = (typeof types)[number];
|
|
311
425
|
type EventPayload = {
|
|
@@ -383,8 +497,21 @@ declare function poll<data>(fn: ({ unpoll }: {
|
|
|
383
497
|
interval: number;
|
|
384
498
|
}): () => boolean;
|
|
385
499
|
|
|
500
|
+
declare const retry: <T>(fn: () => Promise<T>, attempts?: number, delayMs?: number) => Promise<T>;
|
|
501
|
+
|
|
386
502
|
declare function wait(time: number): Promise<unknown>;
|
|
387
503
|
|
|
504
|
+
type index_Cursor = Cursor;
|
|
505
|
+
declare const index_decodeCursor: typeof decodeCursor;
|
|
506
|
+
declare const index_encodeCursor: typeof encodeCursor;
|
|
507
|
+
declare const index_poll: typeof poll;
|
|
508
|
+
declare const index_retry: typeof retry;
|
|
509
|
+
declare const index_validateCursor: typeof validateCursor;
|
|
510
|
+
declare const index_wait: typeof wait;
|
|
511
|
+
declare namespace index {
|
|
512
|
+
export { type index_Cursor as Cursor, batch$1 as batch, index_decodeCursor as decodeCursor, index_encodeCursor as encodeCursor, index_poll as poll, index_retry as retry, index_validateCursor as validateCursor, index_wait as wait };
|
|
513
|
+
}
|
|
514
|
+
|
|
388
515
|
/**
|
|
389
516
|
* A validation rule.
|
|
390
517
|
*/
|
|
@@ -632,4 +759,4 @@ declare namespace Validation {
|
|
|
632
759
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
633
760
|
}
|
|
634
761
|
|
|
635
|
-
export { Chain$1 as Chain,
|
|
762
|
+
export { Chain$1 as Chain, index$1 as OfferStore, Client$1 as Router, RouterEvent$1 as RouterEvent, RouterOffer$1 as RouterOffer, index as Utils, Validation, ValidationRule };
|