@0xmonaco/types 1.0.42-develop.791e6f3 → 1.0.43
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/trading/index.d.ts
CHANGED
|
@@ -92,7 +92,9 @@ export interface TradingAPI extends BaseAPI {
|
|
|
92
92
|
* @param orderId - ID of the order to cancel
|
|
93
93
|
* @returns Promise resolving to the cancellation result
|
|
94
94
|
*/
|
|
95
|
-
cancelOrder(orderId: string
|
|
95
|
+
cancelOrder(orderId: string, options?: {
|
|
96
|
+
remainingQuantityTarget?: string;
|
|
97
|
+
}): Promise<CancelOrderResponse>;
|
|
96
98
|
/**
|
|
97
99
|
* Cancels an active conditional TP/SL order.
|
|
98
100
|
*/
|
|
@@ -228,6 +228,7 @@ export declare const PlaceMarketOrderSchema: z.ZodObject<{
|
|
|
228
228
|
*/
|
|
229
229
|
export declare const CancelOrderSchema: z.ZodObject<{
|
|
230
230
|
orderId: z.ZodUUID;
|
|
231
|
+
remainingQuantityTarget: z.ZodOptional<z.ZodString>;
|
|
231
232
|
}, z.core.$strip>;
|
|
232
233
|
/**
|
|
233
234
|
* Replace Order validation schema
|
|
@@ -282,6 +282,14 @@ export const PlaceMarketOrderSchema = z
|
|
|
282
282
|
*/
|
|
283
283
|
export const CancelOrderSchema = z.object({
|
|
284
284
|
orderId: UUIDSchema,
|
|
285
|
+
/**
|
|
286
|
+
* Partial cancel: reduce the resting order in place to this remaining
|
|
287
|
+
* quantity, keeping its queue position. A target ("leave this much
|
|
288
|
+
* resting"), not an amount to remove, so a retried request converges. Must
|
|
289
|
+
* be a positive multiple of the market's quantity step, strictly below the
|
|
290
|
+
* order's current remaining quantity. Omit for a full cancel.
|
|
291
|
+
*/
|
|
292
|
+
remainingQuantityTarget: PositiveDecimalStringSchema.optional(),
|
|
285
293
|
});
|
|
286
294
|
/**
|
|
287
295
|
* Replace Order validation schema
|
|
@@ -9,7 +9,7 @@ import type { RawEventMessage } from "../base";
|
|
|
9
9
|
/**
|
|
10
10
|
* Order event types
|
|
11
11
|
*/
|
|
12
|
-
export type OrderEventType = "OrderPlaced" | "OrderMatched" | "OrderPartiallyFilled" | "OrderFilled" | "OrderCancelled" | "OrderRejected" | "OrderExpired";
|
|
12
|
+
export type OrderEventType = "OrderPlaced" | "OrderMatched" | "OrderPartiallyFilled" | "OrderFilled" | "OrderCancelled" | "OrderPartiallyCancelled" | "OrderRejected" | "OrderExpired";
|
|
13
13
|
/**
|
|
14
14
|
* Base order event structure
|
|
15
15
|
* All order events share these common fields
|
|
@@ -320,10 +320,36 @@ export interface OrderExpiredEvent extends OrderEvent {
|
|
|
320
320
|
reason: string;
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Partial cancel: the order was reduced IN PLACE to a smaller remaining
|
|
325
|
+
* quantity and is STILL RESTING at its original queue position. NOT a
|
|
326
|
+
* terminal event — an `OrderCancelled` (or fill) still follows eventually.
|
|
327
|
+
* `quantity` is the reduced TOTAL, so `quantity = filledQuantity +
|
|
328
|
+
* remainingQuantity` holds.
|
|
329
|
+
*/
|
|
330
|
+
export interface OrderPartiallyCancelledEvent extends OrderEvent {
|
|
331
|
+
eventType: "OrderPartiallyCancelled";
|
|
332
|
+
data: CommonOrderEventData & {
|
|
333
|
+
/** Order status — non-terminal (the order still rests) */
|
|
334
|
+
status: OrderStatus;
|
|
335
|
+
/** Cumulative filled quantity, unchanged by the reduction */
|
|
336
|
+
filledQuantity: string;
|
|
337
|
+
/** Cumulative filled quantity in RAW precision. Wire: `filled_quantity_raw`. */
|
|
338
|
+
filledQuantityRaw: string;
|
|
339
|
+
/** Remaining quantity after the reduction (the requested target) */
|
|
340
|
+
remainingQuantity: string;
|
|
341
|
+
/** Remaining quantity in RAW precision. Wire: `remaining_quantity_raw`. */
|
|
342
|
+
remainingQuantityRaw: string;
|
|
343
|
+
/** Caller-supplied cancel reason; explicit `null` when none was given */
|
|
344
|
+
reason: string | null;
|
|
345
|
+
/** When the reduction happened (RFC3339 `Z`). Wire: `reduced_at`. */
|
|
346
|
+
reducedAt: string;
|
|
347
|
+
};
|
|
348
|
+
}
|
|
323
349
|
/**
|
|
324
350
|
* Union type of all possible order event data
|
|
325
351
|
*/
|
|
326
|
-
export type OrderEventData = OrderPlacedEvent["data"] | OrderMatchedEvent["data"] | OrderPartiallyFilledEvent["data"] | OrderFilledEvent["data"] | OrderCancelledEvent["data"] | OrderRejectedEvent["data"] | OrderExpiredEvent["data"];
|
|
352
|
+
export type OrderEventData = OrderPlacedEvent["data"] | OrderMatchedEvent["data"] | OrderPartiallyFilledEvent["data"] | OrderFilledEvent["data"] | OrderCancelledEvent["data"] | OrderPartiallyCancelledEvent["data"] | OrderRejectedEvent["data"] | OrderExpiredEvent["data"];
|
|
327
353
|
/**
|
|
328
354
|
* Subscription configuration for order events
|
|
329
355
|
*/
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -2905,6 +2905,11 @@ export interface components {
|
|
|
2905
2905
|
* @example 123e4567-e89b-12d3-a456-426614174000
|
|
2906
2906
|
*/
|
|
2907
2907
|
orderId: string;
|
|
2908
|
+
/**
|
|
2909
|
+
* @description Partial cancel: reduce the resting order in place to this remaining quantity, keeping its queue position. A target ("leave this much resting"), not an amount to remove, so a retried request converges. Must be a positive multiple of the market's quantity step, strictly below the order's current remaining quantity; the delta is released exactly as a cancel releases it (spot unlock / margin reserve). Omit for a full cancel.
|
|
2910
|
+
* @example 0.5
|
|
2911
|
+
*/
|
|
2912
|
+
remainingQuantityTarget?: string | null;
|
|
2908
2913
|
};
|
|
2909
2914
|
CancelOrderResponse: {
|
|
2910
2915
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
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.
|
|
23
|
+
"@0xmonaco/contracts": "1.0.43",
|
|
24
24
|
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|