@0xmonaco/core 1.0.40 → 1.0.41

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.
@@ -88,6 +88,7 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
88
88
  leverage?: string;
89
89
  reduceOnly?: boolean;
90
90
  postOnly?: boolean;
91
+ clientOrderId?: string;
91
92
  takeProfit?: ParentTpSlLegParams;
92
93
  stopLoss?: ParentTpSlLegParams;
93
94
  }): Promise<CreateOrderResponse>;
@@ -147,6 +148,7 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
147
148
  reduceOnly?: boolean;
148
149
  takeProfit?: ParentTpSlLegParams;
149
150
  stopLoss?: ParentTpSlLegParams;
151
+ clientOrderId?: string;
150
152
  }): Promise<CreateOrderResponse>;
151
153
  /**
152
154
  * Cancels an existing order.
@@ -203,6 +205,7 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
203
205
  quantity?: string;
204
206
  useMasterBalance?: boolean;
205
207
  postOnly?: boolean;
208
+ clientOrderId?: string;
206
209
  }): Promise<ReplaceOrderResponse>;
207
210
  /**
208
211
  * Batch creates multiple orders in a single request.
@@ -34,6 +34,11 @@ function parentTpSlLegToRequest(leg) {
34
34
  timeInForce: leg.timeInForce,
35
35
  slippageToleranceBps: leg.slippageToleranceBps,
36
36
  expiresAt: leg.expiresAt,
37
+ // The leg's sizing contract. Omitting these sends neither field, which the
38
+ // server reads as the legacy "size from the parent order" shape — so a
39
+ // caller asking to track the position would silently get a frozen partial.
40
+ quantity: leg.quantity,
41
+ closePosition: leg.closePosition,
37
42
  };
38
43
  }
39
44
  export class TradingAPIImpl extends BaseAPI {
@@ -115,6 +120,7 @@ export class TradingAPIImpl extends BaseAPI {
115
120
  leverage: options?.leverage,
116
121
  reduceOnly: options?.reduceOnly,
117
122
  postOnly: options?.postOnly,
123
+ clientOrderId: options?.clientOrderId,
118
124
  takeProfit: parentTpSlLegToRequest(options?.takeProfit),
119
125
  stopLoss: parentTpSlLegToRequest(options?.stopLoss),
120
126
  };
@@ -192,6 +198,7 @@ export class TradingAPIImpl extends BaseAPI {
192
198
  reduceOnly: options?.reduceOnly,
193
199
  takeProfit: parentTpSlLegToRequest(options?.takeProfit),
194
200
  stopLoss: parentTpSlLegToRequest(options?.stopLoss),
201
+ clientOrderId: options?.clientOrderId,
195
202
  };
196
203
  return await this.makeAuthenticatedRequest(perpRoutes.orders.create(), {
197
204
  method: "POST",
@@ -308,6 +315,9 @@ export class TradingAPIImpl extends BaseAPI {
308
315
  if (newOrder.postOnly !== undefined) {
309
316
  requestBody.postOnly = newOrder.postOnly;
310
317
  }
318
+ if (newOrder.clientOrderId !== undefined) {
319
+ requestBody.clientOrderId = newOrder.clientOrderId;
320
+ }
311
321
  return await this.makeAuthenticatedRequest(perpRoutes.orders.replace(orderId), {
312
322
  method: "PUT",
313
323
  body: JSON.stringify(requestBody),
@@ -366,6 +376,7 @@ export class TradingAPIImpl extends BaseAPI {
366
376
  leverage: order.leverage,
367
377
  reduceOnly: order.reduceOnly,
368
378
  postOnly: order.postOnly,
379
+ clientOrderId: order.clientOrderId,
369
380
  })),
370
381
  };
371
382
  return this.makeAuthenticatedRequest(perpRoutes.orders.batchCreate(), {
@@ -407,6 +418,7 @@ export class TradingAPIImpl extends BaseAPI {
407
418
  quantity: order.quantity,
408
419
  useMasterBalance: order.useMasterBalance,
409
420
  postOnly: order.postOnly,
421
+ clientOrderId: order.clientOrderId,
410
422
  })),
411
423
  };
412
424
  return this.makeAuthenticatedRequest(perpRoutes.orders.batchReplace(), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,8 +23,8 @@
23
23
  "viem": "^2.45.2"
24
24
  },
25
25
  "dependencies": {
26
- "@0xmonaco/contracts": "1.0.40",
27
- "@0xmonaco/types": "1.0.40",
26
+ "@0xmonaco/contracts": "1.0.41",
27
+ "@0xmonaco/types": "1.0.41",
28
28
  "@noble/curves": "^1.9.1",
29
29
  "@noble/hashes": "^1.8.0",
30
30
  "http-status-codes": "^2.3.0"