From 6b19c6503b2482cbb5d0e8d643a75aec6b297afb Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 2 Nov 2023 15:59:33 +0000 Subject: [PATCH] v3.7.6: feat() update batch order types & categories --- package-lock.json | 4 ++-- package.json | 2 +- src/rest-client-v5.ts | 15 +++++++++------ src/types/request/v5-trade.ts | 28 +++++++++++++++++++++++++--- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5449efa..0fafd4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "3.7.4", + "version": "3.7.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "3.7.4", + "version": "3.7.6", "license": "MIT", "dependencies": { "axios": "^0.21.0", diff --git a/package.json b/package.json index b4b6116..105b272 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "3.7.5", + "version": "3.7.6", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index 646cfee..fac72de 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -432,7 +432,8 @@ export class RestClientV5 extends BaseRestClient { } /** - * This endpoint allows you to place more than one order in a single request. Covers: option (unified account). + * This endpoint allows you to place more than one order in a single request. + * Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro) * * Make sure you have sufficient funds in your account when placing an order. * Once an order is placed, according to the funds required by the order, @@ -443,7 +444,7 @@ export class RestClientV5 extends BaseRestClient { * The structure of the two lists are completely consistent. */ batchSubmitOrders( - category: 'option', + category: 'option' | 'linear', orders: BatchOrderParamsV5[], ): Promise< APIResponseV3WithTime> @@ -455,14 +456,15 @@ export class RestClientV5 extends BaseRestClient { } /** - * This endpoint allows you to amend more than one open order in a single request. Covers: option (unified account). + * This endpoint allows you to amend more than one open order in a single request. + * Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro) * * You can modify unfilled or partially filled orders. Conditional orders are not supported. * * A maximum of 20 orders can be amended per request. */ batchAmendOrders( - category: 'option', + category: 'option' | 'linear', orders: BatchAmendOrderParamsV5[], ): Promise< APIResponseV3WithTime> @@ -474,14 +476,15 @@ export class RestClientV5 extends BaseRestClient { } /** - * This endpoint allows you to cancel more than one open order in a single request. Covers: option (unified account). + * This endpoint allows you to cancel more than one open order in a single request. + * Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro) * * You must specify orderId or orderLinkId. If orderId and orderLinkId is not matched, the system will process orderId first. * * You can cancel unfilled or partially filled orders. A maximum of 20 orders can be cancelled per request. */ batchCancelOrders( - category: 'option', + category: 'option' | 'linear', orders: BatchCancelOrderParamsV5[], ): Promise< APIResponseV3WithTime> diff --git a/src/types/request/v5-trade.ts b/src/types/request/v5-trade.ts index 3751c38..9e871f0 100644 --- a/src/types/request/v5-trade.ts +++ b/src/types/request/v5-trade.ts @@ -109,21 +109,43 @@ export interface BatchOrderParamsV5 { orderType: OrderTypeV5; qty: string; price?: string; + triggerDirection?: 1 | 2; + triggerBy?: OrderTriggerByV5; orderIv?: string; timeInForce?: OrderTimeInForceV5; - orderLinkId: string; + positionIdx?: PositionIdx; + orderLinkId?: string; + takeProfit?: string; + stopLoss?: string; + tpTriggerBy?: OrderTriggerByV5; + slTriggerBy?: OrderTriggerByV5; reduceOnly?: boolean; - mmp?: boolean; + closeOnTrigger?: boolean; smpType?: OrderSMPTypeV5; + mmp?: boolean; + tpslMode?: 'Full' | 'Partial'; + tpLimitPrice?: string; + slLimitPrice?: string; + tpOrderType?: OrderTypeV5; + slOrderType?: OrderTypeV5; } export interface BatchAmendOrderParamsV5 { symbol: string; orderId?: string; orderLinkId?: string; + orderIv?: string; + triggerPrice?: string; qty?: string; price?: string; - orderIv?: string; + tpslMode?: 'Full' | 'Partial'; + takeProfit?: string; + stopLoss?: string; + tpTriggerBy?: OrderTriggerByV5; + slTriggerBy?: OrderTriggerByV5; + triggerBy?: OrderTriggerByV5; + tpLimitPrice?: string; + slLimitPrice?: string; } export interface BatchCancelOrderParamsV5 {