bybit-api 3.9.6 → 3.9.8

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 { CategoryCursorListV5, CategoryV5, ContractTypeV5, InstrumentStatusV5, OptionTypeV5, OrderSideV5 } from '../v5-shared';
1
+ import { CategoryCursorListV5, CategoryV5, ContractTypeV5, CopyTradingV5, InstrumentStatusV5, MarginTradingV5, OptionTypeV5, OrderSideV5 } from '../v5-shared';
2
2
  /**
3
3
  * OHLCVT candle used by v5 APIs
4
4
  *
@@ -51,13 +51,18 @@ export interface LinearInverseInstrumentInfoV5 {
51
51
  };
52
52
  lotSizeFilter: {
53
53
  maxOrderQty: string;
54
+ maxMktOrderQty: string;
54
55
  minOrderQty: string;
55
56
  qtyStep: string;
56
57
  postOnlyMaxOrderQty?: string;
58
+ minNotionalValue?: string;
57
59
  };
58
60
  unifiedMarginTrade: boolean;
59
61
  fundingInterval: number;
60
62
  settleCoin: string;
63
+ copyTrading: CopyTradingV5;
64
+ upperFundingRate: string;
65
+ lowerFundingRate: string;
61
66
  }
62
67
  export interface OptionInstrumentInfoV5 {
63
68
  symbol: string;
@@ -86,6 +91,7 @@ export interface SpotInstrumentInfoV5 {
86
91
  quoteCoin: string;
87
92
  innovation: '0' | '1';
88
93
  status: InstrumentStatusV5;
94
+ marginTrading: MarginTradingV5;
89
95
  lotSizeFilter: {
90
96
  basePrecision: string;
91
97
  quotePrecision: string;
@@ -97,6 +103,10 @@ export interface SpotInstrumentInfoV5 {
97
103
  priceFilter: {
98
104
  tickSize: string;
99
105
  };
106
+ riskParameters: {
107
+ limitParameter: string;
108
+ marketParameter: string;
109
+ };
100
110
  }
101
111
  type InstrumentInfoV5Mapping = {
102
112
  linear: LinearInverseInstrumentInfoV5[];
@@ -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;
@@ -1,6 +1,8 @@
1
1
  export type CategoryV5 = 'spot' | 'linear' | 'inverse' | 'option';
2
2
  export type ContractTypeV5 = 'InversePerpetual' | 'LinearPerpetual' | 'InverseFutures';
3
+ export type CopyTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalOnly';
3
4
  export type InstrumentStatusV5 = 'PreLaunch' | 'Trading' | 'Settling' | 'Delivering' | 'Closed';
5
+ export type MarginTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalSpotOnly';
4
6
  export type OrderFilterV5 = 'Order' | 'tpslOrder' | 'StopOrder';
5
7
  export type OrderSideV5 = 'Buy' | 'Sell';
6
8
  export type OrderTypeV5 = 'Market' | 'Limit';
@@ -9,6 +11,59 @@ export type OrderTriggerByV5 = 'LastPrice' | 'IndexPrice' | 'MarkPrice';
9
11
  export type OCOTriggerTypeV5 = 'OcoTriggerByUnknown' | 'OcoTriggerTp' | 'OcoTriggerBySl';
10
12
  export type OrderSMPTypeV5 = 'None' | 'CancelMaker' | 'CancelTaker' | 'CancelBoth';
11
13
  export type OrderStatusV5 = 'Created' | 'New' | 'Rejected' | 'PartiallyFilled' | 'PartiallyFilledCanceled' | 'Filled' | 'Cancelled' | 'Untriggered' | 'Triggered' | 'Deactivated' | 'Active';
14
+ /**
15
+ * Defines the types of order creation mechanisms.
16
+ */
17
+ export type OrderCreateTypeV5 =
18
+ /** Represents an order created by a user. */
19
+ 'CreateByUser'
20
+ /** Represents an order created by an admin closing. */
21
+ | 'CreateByAdminClosing'
22
+ /** Futures conditional order. */
23
+ | 'CreateByStopOrder'
24
+ /** Futures take profit order. */
25
+ | 'CreateByTakeProfit'
26
+ /** Futures partial take profit order. */
27
+ | 'CreateByPartialTakeProfit'
28
+ /** Futures stop loss order. */
29
+ | 'CreateByStopLoss'
30
+ /** Futures partial stop loss order. */
31
+ | 'CreateByPartialStopLoss'
32
+ /** Futures trailing stop order. */
33
+ | 'CreateByTrailingStop'
34
+ /** Laddered liquidation to reduce the required maintenance margin. */
35
+ | 'CreateByLiq'
36
+ /**
37
+ * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level),
38
+ * the position shall be taken over by the liquidation engine and closed at the bankruptcy price.
39
+ */
40
+ | 'CreateByTakeOver_PassThrough'
41
+ /** Auto-Deleveraging(ADL) */
42
+ | 'CreateByAdl_PassThrough'
43
+ /** Order placed via Paradigm. */
44
+ | 'CreateByBlock_PassThrough'
45
+ /** Order created by move position. */
46
+ | 'CreateByBlockTradeMovePosition_PassThrough'
47
+ /** The close order placed via web or app position area - web/app. */
48
+ | 'CreateByClosing'
49
+ /** Order created via grid bot - web/app. */
50
+ | 'CreateByFGridBot'
51
+ /** Order closed via grid bot - web/app. */
52
+ | 'CloseByFGridBot'
53
+ /** Order created by TWAP - web/app. */
54
+ | 'CreateByTWAP'
55
+ /** Order created by TV webhook - web/app. */
56
+ | 'CreateByTVSignal'
57
+ /** Order created by Mm rate close function - web/app. */
58
+ | 'CreateByMmRateClose'
59
+ /** Order created by Martingale bot - web/app. */
60
+ | 'CreateByMartingaleBot'
61
+ /** Order closed by Martingale bot - web/app. */
62
+ | 'CloseByMartingaleBot'
63
+ /** Order created by Ice berg strategy - web/app. */
64
+ | 'CreateByIceBerg'
65
+ /** Order created by arbitrage - web/app. */
66
+ | 'CreateByArbitrage';
12
67
  export type OrderCancelTypeV5 = 'CancelByUser' | 'CancelByReduceOnly' | 'CancelByPrepareLiq' | 'CancelAllBeforeLiq' | 'CancelByPrepareAdl' | 'CancelAllBeforeAdl' | 'CancelByAdmin' | 'CancelByTpSlTsClear' | 'CancelByPzSideCh' | 'UNKNOWN';
13
68
  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
69
  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.8",
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",