bybit-api 3.9.6 → 3.9.7

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.
@@ -1,4 +1,4 @@
1
- import { CategoryV5, OrderCancelTypeV5, OrderRejectReasonV5, OrderSideV5, OrderStatusV5, OrderTimeInForceV5, OrderTriggerByV5, OrderTypeV5, PositionIdx, StopOrderTypeV5 } from '../v5-shared';
1
+ import { CategoryV5, OrderCancelTypeV5, OrderCreateTypeV5, OrderRejectReasonV5, OrderSideV5, OrderStatusV5, OrderTimeInForceV5, OrderTriggerByV5, OrderTypeV5, PositionIdx, StopOrderTypeV5 } from '../v5-shared';
2
2
  export interface OrderResultV5 {
3
3
  orderId: string;
4
4
  orderLinkId: string;
@@ -11,9 +11,10 @@ export interface AccountOrderV5 {
11
11
  price: string;
12
12
  qty: string;
13
13
  side: OrderSideV5;
14
- isLeverage: string;
14
+ isLeverage: '0' | '1';
15
15
  positionIdx: PositionIdx;
16
16
  orderStatus: OrderStatusV5;
17
+ createType: OrderCreateTypeV5;
17
18
  cancelType: OrderCancelTypeV5;
18
19
  rejectReason: OrderRejectReasonV5;
19
20
  avgPrice: string;
@@ -26,15 +27,17 @@ export interface AccountOrderV5 {
26
27
  orderType: OrderTypeV5;
27
28
  stopOrderType: StopOrderTypeV5;
28
29
  orderIv: string;
30
+ marketUnit: 'baseCoin' | 'quoteCoin';
29
31
  triggerPrice: string;
30
32
  takeProfit: string;
31
33
  stopLoss: string;
32
34
  tpslMode: 'Full' | 'Partial' | '';
35
+ ocoTriggerType: 'OcoTriggerByUnknown' | 'OcoTriggerTp' | 'OcoTriggerBySl' | '';
33
36
  tpLimitPrice: string;
34
37
  slLimitPrice: string;
35
38
  tpTriggerBy: OrderTriggerByV5;
36
39
  slTriggerBy: OrderTriggerByV5;
37
- triggerDirection: number;
40
+ triggerDirection: 1 | 2;
38
41
  triggerBy: OrderTriggerByV5;
39
42
  lastPriceOnCreated: string;
40
43
  reduceOnly: boolean;
@@ -9,6 +9,59 @@ export type OrderTriggerByV5 = 'LastPrice' | 'IndexPrice' | 'MarkPrice';
9
9
  export type OCOTriggerTypeV5 = 'OcoTriggerByUnknown' | 'OcoTriggerTp' | 'OcoTriggerBySl';
10
10
  export type OrderSMPTypeV5 = 'None' | 'CancelMaker' | 'CancelTaker' | 'CancelBoth';
11
11
  export type OrderStatusV5 = 'Created' | 'New' | 'Rejected' | 'PartiallyFilled' | 'PartiallyFilledCanceled' | 'Filled' | 'Cancelled' | 'Untriggered' | 'Triggered' | 'Deactivated' | 'Active';
12
+ /**
13
+ * Defines the types of order creation mechanisms.
14
+ */
15
+ export type OrderCreateTypeV5 =
16
+ /** Represents an order created by a user. */
17
+ 'CreateByUser'
18
+ /** Represents an order created by an admin closing. */
19
+ | 'CreateByAdminClosing'
20
+ /** Futures conditional order. */
21
+ | 'CreateByStopOrder'
22
+ /** Futures take profit order. */
23
+ | 'CreateByTakeProfit'
24
+ /** Futures partial take profit order. */
25
+ | 'CreateByPartialTakeProfit'
26
+ /** Futures stop loss order. */
27
+ | 'CreateByStopLoss'
28
+ /** Futures partial stop loss order. */
29
+ | 'CreateByPartialStopLoss'
30
+ /** Futures trailing stop order. */
31
+ | 'CreateByTrailingStop'
32
+ /** Laddered liquidation to reduce the required maintenance margin. */
33
+ | 'CreateByLiq'
34
+ /**
35
+ * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level),
36
+ * the position shall be taken over by the liquidation engine and closed at the bankruptcy price.
37
+ */
38
+ | 'CreateByTakeOver_PassThrough'
39
+ /** Auto-Deleveraging(ADL) */
40
+ | 'CreateByAdl_PassThrough'
41
+ /** Order placed via Paradigm. */
42
+ | 'CreateByBlock_PassThrough'
43
+ /** Order created by move position. */
44
+ | 'CreateByBlockTradeMovePosition_PassThrough'
45
+ /** The close order placed via web or app position area - web/app. */
46
+ | 'CreateByClosing'
47
+ /** Order created via grid bot - web/app. */
48
+ | 'CreateByFGridBot'
49
+ /** Order closed via grid bot - web/app. */
50
+ | 'CloseByFGridBot'
51
+ /** Order created by TWAP - web/app. */
52
+ | 'CreateByTWAP'
53
+ /** Order created by TV webhook - web/app. */
54
+ | 'CreateByTVSignal'
55
+ /** Order created by Mm rate close function - web/app. */
56
+ | 'CreateByMmRateClose'
57
+ /** Order created by Martingale bot - web/app. */
58
+ | 'CreateByMartingaleBot'
59
+ /** Order closed by Martingale bot - web/app. */
60
+ | 'CloseByMartingaleBot'
61
+ /** Order created by Ice berg strategy - web/app. */
62
+ | 'CreateByIceBerg'
63
+ /** Order created by arbitrage - web/app. */
64
+ | 'CreateByArbitrage';
12
65
  export type OrderCancelTypeV5 = 'CancelByUser' | 'CancelByReduceOnly' | 'CancelByPrepareLiq' | 'CancelAllBeforeLiq' | 'CancelByPrepareAdl' | 'CancelAllBeforeAdl' | 'CancelByAdmin' | 'CancelByTpSlTsClear' | 'CancelByPzSideCh' | 'UNKNOWN';
13
66
  export type OrderRejectReasonV5 = 'EC_NoError' | 'EC_Others' | 'EC_UnknownMessageType' | 'EC_MissingClOrdID' | 'EC_MissingOrigClOrdID' | 'EC_ClOrdIDOrigClOrdIDAreTheSame' | 'EC_DuplicatedClOrdID' | 'EC_OrigClOrdIDDoesNotExist' | 'EC_TooLateToCancel' | 'EC_UnknownOrderType' | 'EC_UnknownSide' | 'EC_UnknownTimeInForce' | 'EC_WronglyRouted' | 'EC_MarketOrderPriceIsNotZero' | 'EC_LimitOrderInvalidPrice' | 'EC_NoEnoughQtyToFill' | 'EC_NoImmediateQtyToFill' | 'EC_PerCancelRequest' | 'EC_MarketOrderCannotBePostOnly' | 'EC_PostOnlyWillTakeLiquidity' | 'EC_CancelReplaceOrder' | 'EC_InvalidSymbolStatus';
14
67
  export type StopOrderTypeV5 = 'TakeProfit' | 'StopLoss' | 'TrailingStop' | 'Stop' | 'PartialTakeProfit' | 'PartialStopLoss' | 'tpslOrder';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bybit-api",
3
- "version": "3.9.6",
3
+ "version": "3.9.7",
4
4
  "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",