v3.9.7: feat(#324) add new account order v5 properties

This commit is contained in:
tiagosiebler
2024-03-11 10:28:28 +00:00
parent a907986e0a
commit 76d7059f68
4 changed files with 67 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bybit-api",
"version": "3.9.6",
"version": "3.9.7",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "bybit-api",
"version": "3.9.6",
"version": "3.9.7",
"license": "MIT",
"dependencies": {
"axios": "^1.6.6",

View File

@@ -1,6 +1,6 @@
{
"name": "bybit-api",
"version": "3.9.6",
"version": "3.9.7",
"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

@@ -1,6 +1,7 @@
import {
CategoryV5,
OrderCancelTypeV5,
OrderCreateTypeV5,
OrderRejectReasonV5,
OrderSideV5,
OrderStatusV5,
@@ -24,9 +25,10 @@ export interface AccountOrderV5 {
price: string;
qty: string;
side: OrderSideV5;
isLeverage: string;
isLeverage: '0' | '1';
positionIdx: PositionIdx;
orderStatus: OrderStatusV5;
createType: OrderCreateTypeV5;
cancelType: OrderCancelTypeV5;
rejectReason: OrderRejectReasonV5;
avgPrice: string;
@@ -39,15 +41,21 @@ export interface AccountOrderV5 {
orderType: OrderTypeV5;
stopOrderType: StopOrderTypeV5;
orderIv: string;
marketUnit: 'baseCoin' | 'quoteCoin';
triggerPrice: string;
takeProfit: string;
stopLoss: string;
tpslMode: 'Full' | 'Partial' | '';
ocoTriggerType:
| 'OcoTriggerByUnknown'
| 'OcoTriggerTp'
| 'OcoTriggerBySl'
| '';
tpLimitPrice: string;
slLimitPrice: string;
tpTriggerBy: OrderTriggerByV5;
slTriggerBy: OrderTriggerByV5;
triggerDirection: number;
triggerDirection: 1 | 2;
triggerBy: OrderTriggerByV5;
lastPriceOnCreated: string;
reduceOnly: boolean;

View File

@@ -40,6 +40,60 @@ export type OrderStatusV5 =
| 'Deactivated'
| 'Active';
/**
* Defines the types of order creation mechanisms.
*/
export type OrderCreateTypeV5 =
/** Represents an order created by a user. */
| 'CreateByUser'
/** Represents an order created by an admin closing. */
| 'CreateByAdminClosing'
/** Futures conditional order. */
| 'CreateByStopOrder'
/** Futures take profit order. */
| 'CreateByTakeProfit'
/** Futures partial take profit order. */
| 'CreateByPartialTakeProfit'
/** Futures stop loss order. */
| 'CreateByStopLoss'
/** Futures partial stop loss order. */
| 'CreateByPartialStopLoss'
/** Futures trailing stop order. */
| 'CreateByTrailingStop'
/** Laddered liquidation to reduce the required maintenance margin. */
| 'CreateByLiq'
/**
* If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level),
* the position shall be taken over by the liquidation engine and closed at the bankruptcy price.
*/
| 'CreateByTakeOver_PassThrough'
/** Auto-Deleveraging(ADL) */
| 'CreateByAdl_PassThrough'
/** Order placed via Paradigm. */
| 'CreateByBlock_PassThrough'
/** Order created by move position. */
| 'CreateByBlockTradeMovePosition_PassThrough'
/** The close order placed via web or app position area - web/app. */
| 'CreateByClosing'
/** Order created via grid bot - web/app. */
| 'CreateByFGridBot'
/** Order closed via grid bot - web/app. */
| 'CloseByFGridBot'
/** Order created by TWAP - web/app. */
| 'CreateByTWAP'
/** Order created by TV webhook - web/app. */
| 'CreateByTVSignal'
/** Order created by Mm rate close function - web/app. */
| 'CreateByMmRateClose'
/** Order created by Martingale bot - web/app. */
| 'CreateByMartingaleBot'
/** Order closed by Martingale bot - web/app. */
| 'CloseByMartingaleBot'
/** Order created by Ice berg strategy - web/app. */
| 'CreateByIceBerg'
/** Order created by arbitrage - web/app. */
| 'CreateByArbitrage';
export type OrderCancelTypeV5 =
| 'CancelByUser'
| 'CancelByReduceOnly'