@morpho-dev/router 0.0.12 → 0.0.14

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.
Files changed (33) hide show
  1. package/README.md +15 -0
  2. package/dist/drizzle/0000_add-offers-table.sql +37 -0
  3. package/dist/drizzle/0001_create_offer_status_relation.sql +10 -0
  4. package/dist/drizzle/0002_add_created_at_in_offer_status_relation.sql +3 -0
  5. package/dist/drizzle/0003_add-cursor-indices-to-offers.sql +6 -0
  6. package/dist/drizzle/0004_offer-start.sql +1 -0
  7. package/dist/drizzle/0005_rename-price-token-buy.sql +8 -0
  8. package/dist/drizzle/0006_rename-buy.sql +3 -0
  9. package/dist/drizzle/0007_rename-offering.sql +3 -0
  10. package/dist/drizzle/0008_add-consumed-relation.sql +10 -0
  11. package/dist/drizzle/meta/0000_snapshot.json +344 -0
  12. package/dist/drizzle/meta/0001_snapshot.json +426 -0
  13. package/dist/drizzle/meta/0002_snapshot.json +439 -0
  14. package/dist/drizzle/meta/0003_snapshot.json +553 -0
  15. package/dist/drizzle/meta/0004_snapshot.json +559 -0
  16. package/dist/drizzle/meta/0005_snapshot.json +559 -0
  17. package/dist/drizzle/meta/0006_snapshot.json +559 -0
  18. package/dist/drizzle/meta/0007_snapshot.json +559 -0
  19. package/dist/drizzle/meta/0008_snapshot.json +635 -0
  20. package/dist/drizzle/meta/_journal.json +69 -0
  21. package/dist/index.browser.d.cts +116 -25
  22. package/dist/index.browser.d.ts +116 -25
  23. package/dist/index.browser.js +671 -70
  24. package/dist/index.browser.js.map +1 -1
  25. package/dist/index.browser.mjs +670 -72
  26. package/dist/index.browser.mjs.map +1 -1
  27. package/dist/index.node.d.cts +934 -7
  28. package/dist/index.node.d.ts +934 -7
  29. package/dist/index.node.js +2328 -4819
  30. package/dist/index.node.js.map +1 -1
  31. package/dist/index.node.mjs +2319 -4820
  32. package/dist/index.node.mjs.map +1 -1
  33. package/package.json +17 -3
@@ -1,8 +1,11 @@
1
- import { Offer, Errors } from '@morpho-dev/mempool';
1
+ import { Offer, Errors, Format } from '@morpho-dev/mempool';
2
2
  export * from '@morpho-dev/mempool';
3
3
  import * as viem from 'viem';
4
4
  import { Address, PublicClient } from 'viem';
5
5
  import { Chain as Chain$2 } from 'viem/chains';
6
+ import * as zod_v4_core from 'zod/v4/core';
7
+ import * as zod_v4 from 'zod/v4';
8
+ import { z, ZodError } from 'zod/v4';
6
9
 
7
10
  type Compute<type> = {
8
11
  [key in keyof type]: type[key];
@@ -42,16 +45,91 @@ type OfferMetadata = {
42
45
  issue: string;
43
46
  };
44
47
  type RouterOffer = Offer.Offer & {
48
+ consumed: bigint;
45
49
  status: OfferStatus;
46
50
  metadata?: OfferMetadata;
47
51
  };
52
+ declare const RouterOfferSchema: (parameters?: {
53
+ omitHash?: boolean;
54
+ }) => zod_v4.ZodObject<{
55
+ offering: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
56
+ assets: zod_v4.ZodBigInt;
57
+ rate: zod_v4.ZodBigInt;
58
+ maturity: zod_v4.ZodNumber;
59
+ expiry: zod_v4.ZodNumber;
60
+ start: zod_v4.ZodNumber;
61
+ nonce: zod_v4.ZodBigInt;
62
+ buy: zod_v4.ZodBoolean;
63
+ chainId: zod_v4.ZodBigInt;
64
+ loanToken: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
65
+ collaterals: zod_v4.ZodArray<zod_v4.ZodObject<{
66
+ asset: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
67
+ oracle: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
68
+ lltv: zod_v4.ZodBigInt;
69
+ }, zod_v4_core.$strip>>;
70
+ callback: zod_v4.ZodObject<{
71
+ address: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
72
+ data: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
73
+ gasLimit: zod_v4.ZodBigInt;
74
+ }, zod_v4_core.$strip>;
75
+ signature: zod_v4.ZodOptional<zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>>;
76
+ createdAt: zod_v4.ZodOptional<zod_v4.ZodNumber>;
77
+ consumed: z.ZodBigInt;
78
+ status: z.ZodEnum<{
79
+ valid: "valid";
80
+ callback_not_supported: "callback_not_supported";
81
+ callback_error: "callback_error";
82
+ unverified: "unverified";
83
+ }>;
84
+ metadata: z.ZodOptional<z.ZodObject<{
85
+ issue: z.ZodString;
86
+ }, z.core.$strip>>;
87
+ }, zod_v4_core.$strip>;
88
+ /**
89
+ * Creates a router offer from a plain object.
90
+ * @throws {InvalidRouterOfferError} If the router offer is invalid.
91
+ * @param input - The router offer to create.
92
+ * @returns The created router offer with its hash.
93
+ */
94
+ declare function from(input: Omit<RouterOffer, "hash">): RouterOffer;
95
+ declare namespace from {
96
+ type ErrorType = InvalidRouterOfferError;
97
+ }
98
+ /**
99
+ * Creates a router offer from a snake case object.
100
+ * @throws {InvalidRouterOfferError} If the router offer is invalid.
101
+ * @param input - The router offer to create.
102
+ * @returns The created router offer with its hash.
103
+ */
104
+ declare function fromSnakeCase(input: Format.Snake<Omit<RouterOffer, "hash">>): RouterOffer;
105
+ declare namespace fromSnakeCase {
106
+ type ErrorType = InvalidRouterOfferError;
107
+ }
108
+ /**
109
+ * Converts a router offer to a snake case object.
110
+ * @param offer - The router offer to convert.
111
+ * @returns The converted router offer.
112
+ */
113
+ declare function toSnakeCase(offer: RouterOffer): Format.Snake<RouterOffer>;
114
+ declare function random(): RouterOffer;
115
+ declare class InvalidRouterOfferError extends Errors.BaseError<ZodError | Error> {
116
+ readonly name = "RouterOffer.InvalidRouterOfferError";
117
+ constructor(error: ZodError | Error);
118
+ }
48
119
 
120
+ type RouterOffer$1_InvalidRouterOfferError = InvalidRouterOfferError;
121
+ declare const RouterOffer$1_InvalidRouterOfferError: typeof InvalidRouterOfferError;
49
122
  type RouterOffer$1_OfferMetadata = OfferMetadata;
50
123
  type RouterOffer$1_OfferStatus = OfferStatus;
51
124
  declare const RouterOffer$1_OfferStatusValues: typeof OfferStatusValues;
52
125
  type RouterOffer$1_RouterOffer = RouterOffer;
126
+ declare const RouterOffer$1_RouterOfferSchema: typeof RouterOfferSchema;
127
+ declare const RouterOffer$1_from: typeof from;
128
+ declare const RouterOffer$1_fromSnakeCase: typeof fromSnakeCase;
129
+ declare const RouterOffer$1_random: typeof random;
130
+ declare const RouterOffer$1_toSnakeCase: typeof toSnakeCase;
53
131
  declare namespace RouterOffer$1 {
54
- export { type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer };
132
+ export { RouterOffer$1_InvalidRouterOfferError as InvalidRouterOfferError, type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer, RouterOffer$1_RouterOfferSchema as RouterOfferSchema, RouterOffer$1_from as from, RouterOffer$1_fromSnakeCase as fromSnakeCase, RouterOffer$1_random as random, RouterOffer$1_toSnakeCase as toSnakeCase };
55
133
  }
56
134
 
57
135
  type GetParameters = {
@@ -203,38 +281,38 @@ declare class HttpGetOffersFailedError extends Errors.BaseError {
203
281
  });
204
282
  }
205
283
 
206
- type index_Client = Client;
207
- type index_GetParameters = GetParameters;
208
- type index_HttpForbiddenError = HttpForbiddenError;
209
- declare const index_HttpForbiddenError: typeof HttpForbiddenError;
210
- type index_HttpGetOffersFailedError = HttpGetOffersFailedError;
211
- declare const index_HttpGetOffersFailedError: typeof HttpGetOffersFailedError;
212
- type index_HttpRateLimitError = HttpRateLimitError;
213
- declare const index_HttpRateLimitError: typeof HttpRateLimitError;
214
- type index_HttpUnauthorizedError = HttpUnauthorizedError;
215
- declare const index_HttpUnauthorizedError: typeof HttpUnauthorizedError;
216
- type index_InvalidUrlError = InvalidUrlError;
217
- declare const index_InvalidUrlError: typeof InvalidUrlError;
218
- type index_MatchParameters = MatchParameters;
219
- type index_RouterClientConfig = RouterClientConfig;
220
- declare const index_connect: typeof connect;
221
- declare const index_get: typeof get;
222
- declare const index_match: typeof match;
223
- declare namespace index {
224
- export { type index_Client as Client, type index_GetParameters as GetParameters, index_HttpForbiddenError as HttpForbiddenError, index_HttpGetOffersFailedError as HttpGetOffersFailedError, index_HttpRateLimitError as HttpRateLimitError, index_HttpUnauthorizedError as HttpUnauthorizedError, index_InvalidUrlError as InvalidUrlError, type index_MatchParameters as MatchParameters, type index_RouterClientConfig as RouterClientConfig, index_connect as connect, index_get as get, index_match as match };
284
+ type Client$1_Client = Client;
285
+ type Client$1_GetParameters = GetParameters;
286
+ type Client$1_HttpForbiddenError = HttpForbiddenError;
287
+ declare const Client$1_HttpForbiddenError: typeof HttpForbiddenError;
288
+ type Client$1_HttpGetOffersFailedError = HttpGetOffersFailedError;
289
+ declare const Client$1_HttpGetOffersFailedError: typeof HttpGetOffersFailedError;
290
+ type Client$1_HttpRateLimitError = HttpRateLimitError;
291
+ declare const Client$1_HttpRateLimitError: typeof HttpRateLimitError;
292
+ type Client$1_HttpUnauthorizedError = HttpUnauthorizedError;
293
+ declare const Client$1_HttpUnauthorizedError: typeof HttpUnauthorizedError;
294
+ type Client$1_InvalidUrlError = InvalidUrlError;
295
+ declare const Client$1_InvalidUrlError: typeof InvalidUrlError;
296
+ type Client$1_MatchParameters = MatchParameters;
297
+ type Client$1_RouterClientConfig = RouterClientConfig;
298
+ declare const Client$1_connect: typeof connect;
299
+ declare const Client$1_get: typeof get;
300
+ declare const Client$1_match: typeof match;
301
+ declare namespace Client$1 {
302
+ 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 };
225
303
  }
226
304
 
227
305
  declare const types: readonly ["offer_created", "offer_matched", "offer_validation"];
228
306
  type Type = (typeof types)[number];
229
307
  type EventPayload = {
230
308
  offer_created: {
231
- readonly offer: RouterOffer;
309
+ readonly offer: Offer.Offer;
232
310
  };
233
311
  offer_matched: {
234
- readonly offer: RouterOffer;
312
+ readonly offer: Offer.Offer;
235
313
  };
236
314
  offer_validation: {
237
- readonly offer: RouterOffer;
315
+ readonly offer: Offer.Offer;
238
316
  };
239
317
  };
240
318
  type BaseEvent<T extends Type> = {
@@ -278,6 +356,19 @@ declare namespace RouterEvent$1 {
278
356
  */
279
357
  declare function batch$1<T>(array: Array<T>, batchSize: number): Generator<T[], void, unknown>;
280
358
 
359
+ type Cursor = {
360
+ sort: "rate" | "maturity" | "expiry" | "amount";
361
+ dir: "asc" | "desc";
362
+ rate?: string;
363
+ maturity?: number;
364
+ expiry?: number;
365
+ assets?: string;
366
+ hash: string;
367
+ };
368
+ declare function validateCursor(cursor: unknown): cursor is Cursor;
369
+ declare function encodeCursor(c: Cursor): string;
370
+ declare function decodeCursor(token?: string): Cursor | null;
371
+
281
372
  /**
282
373
  * Polls a function at a specified interval.
283
374
  * Inspired by https://github.com/wevm/viem/blob/845994d20275d08ff892018e237a4b599eeefb6a/src/utils/poll.ts
@@ -537,4 +628,4 @@ declare namespace Validation {
537
628
  export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
538
629
  }
539
630
 
540
- export { Chain$1 as Chain, type Compute, index as Router, RouterEvent$1 as RouterEvent, RouterOffer$1 as RouterOffer, Validation, ValidationRule, batch$1 as batch, poll, wait };
631
+ export { Chain$1 as Chain, type Compute, type Cursor, Client$1 as Router, RouterEvent$1 as RouterEvent, RouterOffer$1 as RouterOffer, Validation, ValidationRule, batch$1 as batch, decodeCursor, encodeCursor, poll, validateCursor, wait };
@@ -1,8 +1,11 @@
1
- import { Offer, Errors } from '@morpho-dev/mempool';
1
+ import { Offer, Errors, Format } from '@morpho-dev/mempool';
2
2
  export * from '@morpho-dev/mempool';
3
3
  import * as viem from 'viem';
4
4
  import { Address, PublicClient } from 'viem';
5
5
  import { Chain as Chain$2 } from 'viem/chains';
6
+ import * as zod_v4_core from 'zod/v4/core';
7
+ import * as zod_v4 from 'zod/v4';
8
+ import { z, ZodError } from 'zod/v4';
6
9
 
7
10
  type Compute<type> = {
8
11
  [key in keyof type]: type[key];
@@ -42,16 +45,91 @@ type OfferMetadata = {
42
45
  issue: string;
43
46
  };
44
47
  type RouterOffer = Offer.Offer & {
48
+ consumed: bigint;
45
49
  status: OfferStatus;
46
50
  metadata?: OfferMetadata;
47
51
  };
52
+ declare const RouterOfferSchema: (parameters?: {
53
+ omitHash?: boolean;
54
+ }) => zod_v4.ZodObject<{
55
+ offering: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
56
+ assets: zod_v4.ZodBigInt;
57
+ rate: zod_v4.ZodBigInt;
58
+ maturity: zod_v4.ZodNumber;
59
+ expiry: zod_v4.ZodNumber;
60
+ start: zod_v4.ZodNumber;
61
+ nonce: zod_v4.ZodBigInt;
62
+ buy: zod_v4.ZodBoolean;
63
+ chainId: zod_v4.ZodBigInt;
64
+ loanToken: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
65
+ collaterals: zod_v4.ZodArray<zod_v4.ZodObject<{
66
+ asset: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
67
+ oracle: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
68
+ lltv: zod_v4.ZodBigInt;
69
+ }, zod_v4_core.$strip>>;
70
+ callback: zod_v4.ZodObject<{
71
+ address: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
72
+ data: zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>;
73
+ gasLimit: zod_v4.ZodBigInt;
74
+ }, zod_v4_core.$strip>;
75
+ signature: zod_v4.ZodOptional<zod_v4.ZodPipe<zod_v4.ZodString, zod_v4.ZodTransform<`0x${string}`, string>>>;
76
+ createdAt: zod_v4.ZodOptional<zod_v4.ZodNumber>;
77
+ consumed: z.ZodBigInt;
78
+ status: z.ZodEnum<{
79
+ valid: "valid";
80
+ callback_not_supported: "callback_not_supported";
81
+ callback_error: "callback_error";
82
+ unverified: "unverified";
83
+ }>;
84
+ metadata: z.ZodOptional<z.ZodObject<{
85
+ issue: z.ZodString;
86
+ }, z.core.$strip>>;
87
+ }, zod_v4_core.$strip>;
88
+ /**
89
+ * Creates a router offer from a plain object.
90
+ * @throws {InvalidRouterOfferError} If the router offer is invalid.
91
+ * @param input - The router offer to create.
92
+ * @returns The created router offer with its hash.
93
+ */
94
+ declare function from(input: Omit<RouterOffer, "hash">): RouterOffer;
95
+ declare namespace from {
96
+ type ErrorType = InvalidRouterOfferError;
97
+ }
98
+ /**
99
+ * Creates a router offer from a snake case object.
100
+ * @throws {InvalidRouterOfferError} If the router offer is invalid.
101
+ * @param input - The router offer to create.
102
+ * @returns The created router offer with its hash.
103
+ */
104
+ declare function fromSnakeCase(input: Format.Snake<Omit<RouterOffer, "hash">>): RouterOffer;
105
+ declare namespace fromSnakeCase {
106
+ type ErrorType = InvalidRouterOfferError;
107
+ }
108
+ /**
109
+ * Converts a router offer to a snake case object.
110
+ * @param offer - The router offer to convert.
111
+ * @returns The converted router offer.
112
+ */
113
+ declare function toSnakeCase(offer: RouterOffer): Format.Snake<RouterOffer>;
114
+ declare function random(): RouterOffer;
115
+ declare class InvalidRouterOfferError extends Errors.BaseError<ZodError | Error> {
116
+ readonly name = "RouterOffer.InvalidRouterOfferError";
117
+ constructor(error: ZodError | Error);
118
+ }
48
119
 
120
+ type RouterOffer$1_InvalidRouterOfferError = InvalidRouterOfferError;
121
+ declare const RouterOffer$1_InvalidRouterOfferError: typeof InvalidRouterOfferError;
49
122
  type RouterOffer$1_OfferMetadata = OfferMetadata;
50
123
  type RouterOffer$1_OfferStatus = OfferStatus;
51
124
  declare const RouterOffer$1_OfferStatusValues: typeof OfferStatusValues;
52
125
  type RouterOffer$1_RouterOffer = RouterOffer;
126
+ declare const RouterOffer$1_RouterOfferSchema: typeof RouterOfferSchema;
127
+ declare const RouterOffer$1_from: typeof from;
128
+ declare const RouterOffer$1_fromSnakeCase: typeof fromSnakeCase;
129
+ declare const RouterOffer$1_random: typeof random;
130
+ declare const RouterOffer$1_toSnakeCase: typeof toSnakeCase;
53
131
  declare namespace RouterOffer$1 {
54
- export { type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer };
132
+ export { RouterOffer$1_InvalidRouterOfferError as InvalidRouterOfferError, type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer, RouterOffer$1_RouterOfferSchema as RouterOfferSchema, RouterOffer$1_from as from, RouterOffer$1_fromSnakeCase as fromSnakeCase, RouterOffer$1_random as random, RouterOffer$1_toSnakeCase as toSnakeCase };
55
133
  }
56
134
 
57
135
  type GetParameters = {
@@ -203,38 +281,38 @@ declare class HttpGetOffersFailedError extends Errors.BaseError {
203
281
  });
204
282
  }
205
283
 
206
- type index_Client = Client;
207
- type index_GetParameters = GetParameters;
208
- type index_HttpForbiddenError = HttpForbiddenError;
209
- declare const index_HttpForbiddenError: typeof HttpForbiddenError;
210
- type index_HttpGetOffersFailedError = HttpGetOffersFailedError;
211
- declare const index_HttpGetOffersFailedError: typeof HttpGetOffersFailedError;
212
- type index_HttpRateLimitError = HttpRateLimitError;
213
- declare const index_HttpRateLimitError: typeof HttpRateLimitError;
214
- type index_HttpUnauthorizedError = HttpUnauthorizedError;
215
- declare const index_HttpUnauthorizedError: typeof HttpUnauthorizedError;
216
- type index_InvalidUrlError = InvalidUrlError;
217
- declare const index_InvalidUrlError: typeof InvalidUrlError;
218
- type index_MatchParameters = MatchParameters;
219
- type index_RouterClientConfig = RouterClientConfig;
220
- declare const index_connect: typeof connect;
221
- declare const index_get: typeof get;
222
- declare const index_match: typeof match;
223
- declare namespace index {
224
- export { type index_Client as Client, type index_GetParameters as GetParameters, index_HttpForbiddenError as HttpForbiddenError, index_HttpGetOffersFailedError as HttpGetOffersFailedError, index_HttpRateLimitError as HttpRateLimitError, index_HttpUnauthorizedError as HttpUnauthorizedError, index_InvalidUrlError as InvalidUrlError, type index_MatchParameters as MatchParameters, type index_RouterClientConfig as RouterClientConfig, index_connect as connect, index_get as get, index_match as match };
284
+ type Client$1_Client = Client;
285
+ type Client$1_GetParameters = GetParameters;
286
+ type Client$1_HttpForbiddenError = HttpForbiddenError;
287
+ declare const Client$1_HttpForbiddenError: typeof HttpForbiddenError;
288
+ type Client$1_HttpGetOffersFailedError = HttpGetOffersFailedError;
289
+ declare const Client$1_HttpGetOffersFailedError: typeof HttpGetOffersFailedError;
290
+ type Client$1_HttpRateLimitError = HttpRateLimitError;
291
+ declare const Client$1_HttpRateLimitError: typeof HttpRateLimitError;
292
+ type Client$1_HttpUnauthorizedError = HttpUnauthorizedError;
293
+ declare const Client$1_HttpUnauthorizedError: typeof HttpUnauthorizedError;
294
+ type Client$1_InvalidUrlError = InvalidUrlError;
295
+ declare const Client$1_InvalidUrlError: typeof InvalidUrlError;
296
+ type Client$1_MatchParameters = MatchParameters;
297
+ type Client$1_RouterClientConfig = RouterClientConfig;
298
+ declare const Client$1_connect: typeof connect;
299
+ declare const Client$1_get: typeof get;
300
+ declare const Client$1_match: typeof match;
301
+ declare namespace Client$1 {
302
+ 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 };
225
303
  }
226
304
 
227
305
  declare const types: readonly ["offer_created", "offer_matched", "offer_validation"];
228
306
  type Type = (typeof types)[number];
229
307
  type EventPayload = {
230
308
  offer_created: {
231
- readonly offer: RouterOffer;
309
+ readonly offer: Offer.Offer;
232
310
  };
233
311
  offer_matched: {
234
- readonly offer: RouterOffer;
312
+ readonly offer: Offer.Offer;
235
313
  };
236
314
  offer_validation: {
237
- readonly offer: RouterOffer;
315
+ readonly offer: Offer.Offer;
238
316
  };
239
317
  };
240
318
  type BaseEvent<T extends Type> = {
@@ -278,6 +356,19 @@ declare namespace RouterEvent$1 {
278
356
  */
279
357
  declare function batch$1<T>(array: Array<T>, batchSize: number): Generator<T[], void, unknown>;
280
358
 
359
+ type Cursor = {
360
+ sort: "rate" | "maturity" | "expiry" | "amount";
361
+ dir: "asc" | "desc";
362
+ rate?: string;
363
+ maturity?: number;
364
+ expiry?: number;
365
+ assets?: string;
366
+ hash: string;
367
+ };
368
+ declare function validateCursor(cursor: unknown): cursor is Cursor;
369
+ declare function encodeCursor(c: Cursor): string;
370
+ declare function decodeCursor(token?: string): Cursor | null;
371
+
281
372
  /**
282
373
  * Polls a function at a specified interval.
283
374
  * Inspired by https://github.com/wevm/viem/blob/845994d20275d08ff892018e237a4b599eeefb6a/src/utils/poll.ts
@@ -537,4 +628,4 @@ declare namespace Validation {
537
628
  export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
538
629
  }
539
630
 
540
- export { Chain$1 as Chain, type Compute, index as Router, RouterEvent$1 as RouterEvent, RouterOffer$1 as RouterOffer, Validation, ValidationRule, batch$1 as batch, poll, wait };
631
+ export { Chain$1 as Chain, type Compute, type Cursor, Client$1 as Router, RouterEvent$1 as RouterEvent, RouterOffer$1 as RouterOffer, Validation, ValidationRule, batch$1 as batch, decodeCursor, encodeCursor, poll, validateCursor, wait };