@0xmonaco/types 1.0.26 → 1.0.28

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.
@@ -237,6 +237,23 @@ export interface GetUserTradesParams {
237
237
  pageSize?: number;
238
238
  /** Filter by trading pair ID (UUID) */
239
239
  tradingPairId?: string;
240
+ /**
241
+ * Pagination cursor with three distinct states:
242
+ * - Omitted (`undefined`): legacy page-number pagination via `page`,
243
+ * limited to recent history once the archive window is enabled.
244
+ * - Empty string (`""`): start a cursor walk with no prior position, from
245
+ * the newest row (this endpoint always sorts newest-first).
246
+ * - Non-empty: an opaque cursor from a previous response's
247
+ * `nextPageToken`; results resume immediately after that position.
248
+ *
249
+ * In either cursor-walk state (empty or non-empty), `page` is ignored, the
250
+ * response omits exact totals (`total`/`totalPages`/`page` are 0), and
251
+ * results cover full trade history — hot and archived rows merged —
252
+ * unlike page-number mode, which only ever sees recent history. Clients
253
+ * that need complete trade history must use the cursor form (pass `""` to
254
+ * start, then follow `nextPageToken`) rather than `page`.
255
+ */
256
+ pageToken?: string;
240
257
  }
241
258
  /**
242
259
  * Response from getting user trades
@@ -252,6 +269,21 @@ export interface GetUserTradesResponse {
252
269
  total: number;
253
270
  /** Total number of pages */
254
271
  totalPages: number;
272
+ /**
273
+ * Cursor for the next page. Empty on every page-number (legacy) response —
274
+ * page-number mode never mints a token, full page or not, since resuming
275
+ * from a legacy-minted position could silently strand archived history
276
+ * newer than wherever that page happened to end.
277
+ *
278
+ * To walk full history, start a cursor-mode request with `pageToken`
279
+ * present but empty (`""`); from then on the token is present whenever
280
+ * that page returned any rows (AIP-158 "maybe more" semantics), not only
281
+ * when the page is exactly full. Empty only when a cursor-mode page
282
+ * returned zero rows, which is the sole proof the walk is exhausted. The
283
+ * two modes never bridge — page-number pagination is deprecated for deep
284
+ * history.
285
+ */
286
+ nextPageToken: string;
255
287
  }
256
288
  /**
257
289
  * Direction of a funding payment from the user's perspective.
@@ -139,6 +139,23 @@ export interface GetPaginatedOrdersParams {
139
139
  page?: number;
140
140
  /** Number of orders per page (default: 10, max: 100) */
141
141
  pageSize?: number;
142
+ /**
143
+ * Pagination cursor with three distinct states:
144
+ * - Omitted (`undefined`): legacy page-number pagination via `page`,
145
+ * limited to recent history once the archive window is enabled.
146
+ * - Empty string (`""`): start a cursor walk with no prior position, from
147
+ * the newest row (or the oldest, when `orderBy` is `"ASC"`).
148
+ * - Non-empty: an opaque cursor from a previous response's
149
+ * `nextPageToken`; results resume immediately after that position.
150
+ *
151
+ * In either cursor-walk state (empty or non-empty), `page` is ignored, the
152
+ * response omits exact totals (`total`/`totalPages`/`page` are 0), and
153
+ * results cover full order history — hot and archived rows merged —
154
+ * unlike page-number mode, which only ever sees recent history. Clients
155
+ * that need complete order history must use the cursor form (pass `""` to
156
+ * start, then follow `nextPageToken`) rather than `page`.
157
+ */
158
+ pageToken?: string;
142
159
  }
143
160
  /**
144
161
  * Response from getting paginated orders
@@ -159,6 +176,21 @@ export interface GetPaginatedOrdersResponse {
159
176
  pageSize: number;
160
177
  /** Total number of pages */
161
178
  totalPages: number;
179
+ /**
180
+ * Cursor for the next page. Empty on every page-number (legacy) response —
181
+ * page-number mode never mints a token, full page or not, since resuming
182
+ * from a legacy-minted position could silently strand archived history
183
+ * newer than wherever that page happened to end.
184
+ *
185
+ * To walk full history, start a cursor-mode request with `pageToken`
186
+ * present but empty (`""`); from then on the token is present whenever
187
+ * that page returned any rows (AIP-158 "maybe more" semantics), not only
188
+ * when the page is exactly full. Empty only when a cursor-mode page
189
+ * returned zero rows, which is the sole proof the walk is exhausted. The
190
+ * two modes never bridge — page-number pagination is deprecated for deep
191
+ * history.
192
+ */
193
+ nextPageToken: string;
162
194
  }
163
195
  /**
164
196
  * Response from getting a single order by ID
@@ -66,6 +66,7 @@ export declare const GetUserTradesSchema: z.ZodObject<{
66
66
  page: z.ZodOptional<z.ZodNumber>;
67
67
  pageSize: z.ZodOptional<z.ZodNumber>;
68
68
  tradingPairId: z.ZodOptional<z.ZodUUID>;
69
+ pageToken: z.ZodOptional<z.ZodString>;
69
70
  }, z.core.$strip>;
70
71
  export declare const ListFundingPaymentsSchema: z.ZodObject<{
71
72
  page: z.ZodOptional<z.ZodNumber>;
@@ -41,6 +41,7 @@ export const GetUserTradesSchema = z.object({
41
41
  page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
42
42
  pageSize: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
43
43
  tradingPairId: UUIDSchema.optional(),
44
+ pageToken: z.string().optional(),
44
45
  });
45
46
  export const ListFundingPaymentsSchema = z.object({
46
47
  page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
@@ -261,6 +261,7 @@ export declare const GetPaginatedOrdersSchema: z.ZodObject<{
261
261
  marginAccountId: z.ZodOptional<z.ZodUUID>;
262
262
  page: z.ZodOptional<z.ZodNumber>;
263
263
  pageSize: z.ZodOptional<z.ZodNumber>;
264
+ pageToken: z.ZodOptional<z.ZodString>;
264
265
  }, z.core.$strip>;
265
266
  export declare const ConditionalOrderConditionTypeSchema: z.ZodEnum<{
266
267
  STOP_LOSS: "STOP_LOSS";
@@ -285,6 +285,7 @@ export const GetPaginatedOrdersSchema = z.object({
285
285
  marginAccountId: UUIDSchema.optional(),
286
286
  page: z.number().int().min(1, "Page must be at least 1").optional(),
287
287
  pageSize: z.number().int().min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
288
+ pageToken: z.string().optional(),
288
289
  });
289
290
  export const ConditionalOrderConditionTypeSchema = z.enum(["STOP_LOSS", "TAKE_PROFIT"], {
290
291
  message: 'conditionType must be "STOP_LOSS" or "TAKE_PROFIT"',
@@ -343,6 +344,10 @@ export const BatchCreateOrderItemSchema = z
343
344
  .refine((data) => data.orderType !== "MARKET" || data.price === undefined, {
344
345
  message: "Price must not be provided for MARKET orders",
345
346
  path: ["price"],
347
+ })
348
+ .refine((data) => data.orderType !== "MARKET" || data.timeInForce === undefined, {
349
+ message: "timeInForce must not be provided for MARKET orders",
350
+ path: ["timeInForce"],
346
351
  })
347
352
  .refine((data) => data.riskBucketCollateral === undefined || data.tradingMode === "MARGIN", {
348
353
  message: "riskBucketCollateral is only supported for MARGIN orders",
@@ -2508,7 +2508,7 @@ export interface components {
2508
2508
  */
2509
2509
  expirationDate?: string | null;
2510
2510
  /**
2511
- * @description Time in force: GTC, IOC, or FOK
2511
+ * @description Time in force: GTC, IOC, or FOK. LIMIT orders only; rejected on MARKET orders.
2512
2512
  * @example GTC
2513
2513
  */
2514
2514
  timeInForce?: string | null;
@@ -2957,7 +2957,7 @@ export interface components {
2957
2957
  */
2958
2958
  expirationDate?: string | null;
2959
2959
  /**
2960
- * @description Time in force: GTC, IOC, or FOK
2960
+ * @description Time in force: GTC, IOC, or FOK. LIMIT orders only; rejected on MARKET orders.
2961
2961
  * @example GTC
2962
2962
  */
2963
2963
  timeInForce?: string | null;
@@ -4385,6 +4385,22 @@ export interface components {
4385
4385
  * @example 8
4386
4386
  */
4387
4387
  totalPages?: string | null;
4388
+ /**
4389
+ * @description Cursor for the next page. Empty on every page-number (legacy) response —
4390
+ * page-number mode never mints a token, full page or not, since resuming
4391
+ * a client from a legacy-minted position could silently strand archived
4392
+ * history newer than wherever that page happened to end. To walk full
4393
+ * history, start a cursor-mode request with `page_token` present but
4394
+ * empty (`""`); from then on the token is present whenever that page
4395
+ * returned any rows (AIP-158 "maybe more" semantics), not only when the
4396
+ * page is exactly full. Empty only when a cursor-mode page returned zero
4397
+ * rows, which is the sole proof the walk is exhausted; a non-empty token
4398
+ * does not guarantee further results, so keep following it until a
4399
+ * response returns zero rows and an empty token. The two modes never
4400
+ * bridge: a page-number response's empty token is not "done," it simply
4401
+ * means page-number mode does not participate in cursor continuation.
4402
+ */
4403
+ nextPageToken?: string | null;
4388
4404
  };
4389
4405
  IndexComponent: {
4390
4406
  provider?: string | null;
@@ -4743,6 +4759,22 @@ export interface components {
4743
4759
  * @example 8
4744
4760
  */
4745
4761
  totalPages?: number | null;
4762
+ /**
4763
+ * @description Cursor for the next page. Empty on every page-number (legacy) response —
4764
+ * page-number mode never mints a token, full page or not, since resuming
4765
+ * a client from a legacy-minted position could silently strand archived
4766
+ * history newer than wherever that page happened to end. To walk full
4767
+ * history, start a cursor-mode request with `page_token` present but
4768
+ * empty (`""`); from then on the token is present whenever that page
4769
+ * returned any rows (AIP-158 "maybe more" semantics), not only when the
4770
+ * page is exactly full. Empty only when a cursor-mode page returned zero
4771
+ * rows, which is the sole proof the walk is exhausted; a non-empty token
4772
+ * does not guarantee further results, so keep following it until a
4773
+ * response returns zero rows and an empty token. The two modes never
4774
+ * bridge: a page-number response's empty token is not "done," it simply
4775
+ * means page-number mode does not participate in cursor continuation.
4776
+ */
4777
+ nextPageToken?: string | null;
4746
4778
  };
4747
4779
  ListPendingWithdrawalsResponse: {
4748
4780
  withdrawals?: components["schemas"]["PendingWithdrawal"][] | null;
@@ -7296,6 +7328,24 @@ export interface operations {
7296
7328
  pageSize?: number;
7297
7329
  /** @description Trading pair identifier (UUID) */
7298
7330
  tradingPairId?: string;
7331
+ /**
7332
+ * @description Pagination cursor with three distinct states:
7333
+ * - Omitted: legacy page-number pagination via `page`, limited to recent
7334
+ * history once the archive window is enabled.
7335
+ * - Empty string (""): start a cursor walk with no prior position, from
7336
+ * the newest row (this endpoint always sorts newest-first).
7337
+ * - Non-empty: an opaque cursor from a previous response's
7338
+ * `next_page_token`; results resume immediately after that position.
7339
+ *
7340
+ * In either cursor-walk state (empty or non-empty), `page` is ignored, the
7341
+ * response omits exact totals (total/total_pages/page are 0), and results
7342
+ * cover full trade history — hot and archived rows merged — unlike
7343
+ * page-number mode, which only ever sees recent history. Clients that need
7344
+ * complete trade history must use the cursor form (start with an empty
7345
+ * string, then follow next_page_token) rather than `page`. Filters must
7346
+ * match the request that produced the token.
7347
+ */
7348
+ pageToken?: string;
7299
7349
  };
7300
7350
  header?: never;
7301
7351
  path?: never;
@@ -9165,6 +9215,24 @@ export interface operations {
9165
9215
  marginAccountId?: string;
9166
9216
  /** @description Sort direction for createdAt */
9167
9217
  orderBy?: "ASC" | "DESC";
9218
+ /**
9219
+ * @description Pagination cursor with three distinct states:
9220
+ * - Omitted: legacy page-number pagination via `page`, limited to recent
9221
+ * history once the archive window is enabled.
9222
+ * - Empty string (""): start a cursor walk with no prior position, from
9223
+ * the newest row (or the oldest, when `orderBy` is ASC).
9224
+ * - Non-empty: an opaque cursor from a previous response's
9225
+ * `next_page_token`; results resume immediately after that position.
9226
+ *
9227
+ * In either cursor-walk state (empty or non-empty), `page` is ignored, the
9228
+ * response omits exact totals (total/total_pages/page are 0), and results
9229
+ * cover full order history — hot and archived rows merged — unlike
9230
+ * page-number mode, which only ever sees recent history. Clients that need
9231
+ * complete order history must use the cursor form (start with an empty
9232
+ * string, then follow next_page_token) rather than `page`. Filters and
9233
+ * orderBy must match the request that produced the token.
9234
+ */
9235
+ pageToken?: string;
9168
9236
  };
9169
9237
  header?: never;
9170
9238
  path?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  "lint": "biome lint ."
21
21
  },
22
22
  "dependencies": {
23
- "@0xmonaco/contracts": "1.0.26",
23
+ "@0xmonaco/contracts": "1.0.28",
24
24
  "zod": "^4.1.12"
25
25
  },
26
26
  "peerDependencies": {