Merge pull request #295 from tiagosiebler/batchTypes

v3.7.6: feat() update batch order types & categories
This commit is contained in:
Tiago
2023-11-02 16:14:07 +00:00
committed by GitHub
4 changed files with 37 additions and 12 deletions

4
package-lock.json generated
View File

@@ -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",

View File

@@ -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",

View File

@@ -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<BatchOrdersResponseV5<BatchCreateOrderResultV5[]>>
@@ -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<BatchOrdersResponseV5<BatchAmendOrderResultV5[]>>
@@ -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<BatchOrdersResponseV5<BatchCancelOrderResultV5[]>>

View File

@@ -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 {