bybit-api 3.6.1 → 3.7.1-beta.0
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.
- package/lib/contract-client.d.ts +17 -3
- package/lib/contract-client.js +17 -3
- package/lib/contract-client.js.map +1 -1
- package/lib/rest-client-v5.d.ts +259 -10
- package/lib/rest-client-v5.js +196 -7
- package/lib/rest-client-v5.js.map +1 -1
- package/lib/types/request/contract.d.ts +21 -11
- package/lib/types/request/index.d.ts +1 -0
- package/lib/types/request/index.js +1 -0
- package/lib/types/request/index.js.map +1 -1
- package/lib/types/request/v5-account.d.ts +5 -0
- package/lib/types/request/v5-market.d.ts +10 -2
- package/lib/types/request/v5-position.d.ts +13 -2
- package/lib/types/request/v5-pre-upgrade.d.ts +34 -0
- package/lib/types/request/v5-pre-upgrade.js +3 -0
- package/lib/types/request/v5-pre-upgrade.js.map +1 -0
- package/lib/types/request/v5-trade.d.ts +24 -1
- package/lib/types/response/contract.d.ts +22 -12
- package/lib/types/response/v5-account.d.ts +1 -0
- package/lib/types/response/v5-market.d.ts +6 -0
- package/lib/types/response/v5-position.d.ts +26 -0
- package/lib/types/response/v5-trade.d.ts +7 -0
- package/lib/types/v5-shared.d.ts +4 -1
- package/lib/util/websocket-util.d.ts +2 -1
- package/lib/util/websocket-util.js +2 -2
- package/lib/util/websocket-util.js.map +1 -1
- package/lib/websocket-client.js +1 -1
- package/lib/websocket-client.js.map +1 -1
- package/package.json +13 -1
- package/src/account-asset-client-v3.ts +310 -0
- package/src/account-asset-client.ts +149 -0
- package/src/constants/enum.ts +105 -0
- package/src/contract-client.ts +360 -0
- package/src/copy-trading-client.ts +159 -0
- package/src/index.ts +18 -0
- package/src/inverse-client.ts +337 -0
- package/src/inverse-futures-client.ts +403 -0
- package/src/linear-client.ts +387 -0
- package/src/rest-client-v5.ts +1638 -0
- package/src/spot-client-v3.ts +303 -0
- package/src/spot-client.ts +180 -0
- package/src/types/index.ts +5 -0
- package/src/types/request/account-asset.ts +258 -0
- package/src/types/request/contract.ts +139 -0
- package/src/types/request/copy-trading.ts +53 -0
- package/src/types/request/index.ts +18 -0
- package/src/types/request/inverse.ts +135 -0
- package/src/types/request/linear.ts +201 -0
- package/src/types/request/spot.ts +89 -0
- package/src/types/request/unified-margin.ts +247 -0
- package/src/types/request/usdc-options.ts +134 -0
- package/src/types/request/usdc-perp.ts +100 -0
- package/src/types/request/usdc-shared.ts +39 -0
- package/src/types/request/v5-account.ts +40 -0
- package/src/types/request/v5-asset.ts +133 -0
- package/src/types/request/v5-market.ts +127 -0
- package/src/types/request/v5-position.ts +107 -0
- package/src/types/request/v5-pre-upgrade.ts +37 -0
- package/src/types/request/v5-spot-leverage-token.ts +23 -0
- package/src/types/request/v5-trade.ts +133 -0
- package/src/types/request/v5-user.ts +21 -0
- package/src/types/response/account-asset.ts +236 -0
- package/src/types/response/contract.ts +74 -0
- package/src/types/response/index.ts +13 -0
- package/src/types/response/shared.ts +19 -0
- package/src/types/response/spot.ts +17 -0
- package/src/types/response/unified-margin.ts +71 -0
- package/src/types/response/usdt-perp.ts +58 -0
- package/src/types/response/v5-account.ts +122 -0
- package/src/types/response/v5-asset.ts +170 -0
- package/src/types/response/v5-market.ts +271 -0
- package/src/types/response/v5-position.ts +118 -0
- package/src/types/response/v5-spot-leverage-token.ts +70 -0
- package/src/types/response/v5-trade.ts +103 -0
- package/src/types/response/v5-user.ts +58 -0
- package/src/types/shared.ts +175 -0
- package/src/types/v5-shared.ts +213 -0
- package/src/types/websockets.ts +115 -0
- package/src/types/ws-events/failed-topic-subscription-confirmation.ts +6 -0
- package/src/types/ws-events/succeeded-topic-subscription-confirmation.ts +6 -0
- package/src/types/ws-events/topic-subscription-confirmation.ts +7 -0
- package/src/unified-margin-client.ts +400 -0
- package/src/usdc-option-client.ts +333 -0
- package/src/usdc-perpetual-client.ts +312 -0
- package/src/util/BaseRestClient.ts +502 -0
- package/src/util/WsStore.ts +160 -0
- package/src/util/browser-support.ts +29 -0
- package/src/util/index.ts +5 -0
- package/src/util/logger.ts +26 -0
- package/src/util/node-support.ts +9 -0
- package/src/util/requestUtils.ts +171 -0
- package/src/util/websocket-util.ts +550 -0
- package/src/websocket-client.ts +1262 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LinearPositionIdx,
|
|
3
|
+
linearPositionModeEnum,
|
|
4
|
+
positionTpSlModeEnum,
|
|
5
|
+
} from '../../constants/enum';
|
|
6
|
+
import { OrderSide } from '../shared';
|
|
7
|
+
|
|
8
|
+
export interface LinearGetOrdersRequest {
|
|
9
|
+
order_id?: string;
|
|
10
|
+
order_link_id?: string;
|
|
11
|
+
symbol: string;
|
|
12
|
+
order?: string;
|
|
13
|
+
page?: number;
|
|
14
|
+
limit?: number;
|
|
15
|
+
order_status?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface LinearCancelOrderRequest {
|
|
19
|
+
symbol: string;
|
|
20
|
+
order_id?: string;
|
|
21
|
+
order_link_id?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface LinearReplaceOrderRequest {
|
|
25
|
+
order_id?: string;
|
|
26
|
+
order_link_id?: string;
|
|
27
|
+
symbol: string;
|
|
28
|
+
p_r_qty?: number;
|
|
29
|
+
p_r_price?: number;
|
|
30
|
+
take_profit?: number;
|
|
31
|
+
stop_loss?: number;
|
|
32
|
+
tp_trigger_by?: string;
|
|
33
|
+
sl_trigger_by?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface LinearGetOrderRequest {
|
|
37
|
+
order_id?: string;
|
|
38
|
+
order_link_id?: string;
|
|
39
|
+
symbol: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type LinearOrderType = 'Limit' | 'Market';
|
|
43
|
+
|
|
44
|
+
export type LinearTimeInForce =
|
|
45
|
+
| 'GoodTillCancel'
|
|
46
|
+
| 'ImmediateOrCancel'
|
|
47
|
+
| 'FillOrKill'
|
|
48
|
+
| 'PostOnly';
|
|
49
|
+
|
|
50
|
+
export interface NewLinearOrder {
|
|
51
|
+
side: OrderSide;
|
|
52
|
+
symbol: string;
|
|
53
|
+
order_type: LinearOrderType;
|
|
54
|
+
qty: number;
|
|
55
|
+
price?: number;
|
|
56
|
+
time_in_force: LinearTimeInForce;
|
|
57
|
+
take_profit?: number;
|
|
58
|
+
stop_loss?: number;
|
|
59
|
+
tp_trigger_by?: string;
|
|
60
|
+
sl_trigger_by?: string;
|
|
61
|
+
reduce_only: boolean;
|
|
62
|
+
close_on_trigger: boolean;
|
|
63
|
+
order_link_id?: string;
|
|
64
|
+
position_idx?: LinearPositionIdx;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface LinearConditionalOrderRequest {
|
|
68
|
+
side: string;
|
|
69
|
+
symbol: string;
|
|
70
|
+
order_type: string;
|
|
71
|
+
qty: number;
|
|
72
|
+
price?: number;
|
|
73
|
+
base_price: number;
|
|
74
|
+
stop_px: number;
|
|
75
|
+
time_in_force: string;
|
|
76
|
+
trigger_by?: string;
|
|
77
|
+
close_on_trigger?: boolean;
|
|
78
|
+
order_link_id?: string;
|
|
79
|
+
reduce_only: boolean;
|
|
80
|
+
take_profit?: number;
|
|
81
|
+
stop_loss?: number;
|
|
82
|
+
tp_trigger_by?: string;
|
|
83
|
+
sl_trigger_by?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface LinearGetConditionalOrderRequest {
|
|
87
|
+
stop_order_id?: string;
|
|
88
|
+
order_link_id?: string;
|
|
89
|
+
symbol: string;
|
|
90
|
+
stop_order_status?: string;
|
|
91
|
+
order?: string;
|
|
92
|
+
page?: number;
|
|
93
|
+
limit?: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface LinearCancelConditionalOrderRequest {
|
|
97
|
+
symbol: string;
|
|
98
|
+
stop_order_id?: string;
|
|
99
|
+
order_link_id?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface LinearReplaceConditionalOrderRequest {
|
|
103
|
+
stop_order_id?: string;
|
|
104
|
+
order_link_id?: string;
|
|
105
|
+
symbol: string;
|
|
106
|
+
p_r_qty?: number;
|
|
107
|
+
p_r_price?: number;
|
|
108
|
+
p_r_trigger_price?: number;
|
|
109
|
+
take_profit?: number;
|
|
110
|
+
stop_loss?: number;
|
|
111
|
+
tp_trigger_by?: string;
|
|
112
|
+
sl_trigger_by?: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface LinearQueryConditionalOrderRequest {
|
|
116
|
+
symbol: string;
|
|
117
|
+
stop_order_id?: string;
|
|
118
|
+
order_link_id?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface LinearSetAutoAddMarginRequest {
|
|
122
|
+
symbol: string;
|
|
123
|
+
side: string;
|
|
124
|
+
auto_add_margin: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface LinearSetMarginSwitchRequest {
|
|
128
|
+
symbol: string;
|
|
129
|
+
is_isolated: boolean;
|
|
130
|
+
buy_leverage: number;
|
|
131
|
+
sell_leverage: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface LinearSetPositionModeRequest {
|
|
135
|
+
symbol: string;
|
|
136
|
+
mode: typeof linearPositionModeEnum[keyof typeof linearPositionModeEnum];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface LinearSetPositionTpSlModeRequest {
|
|
140
|
+
symbol: string;
|
|
141
|
+
tp_sl_mode: typeof positionTpSlModeEnum[keyof typeof positionTpSlModeEnum];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface LinearSetAddReduceMarginRequest {
|
|
145
|
+
symbol: string;
|
|
146
|
+
side: string;
|
|
147
|
+
margin: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface LinearSetUserLeverageRequest {
|
|
151
|
+
symbol: string;
|
|
152
|
+
buy_leverage: number;
|
|
153
|
+
sell_leverage: number;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface LinearSetTradingStopRequest {
|
|
157
|
+
symbol: string;
|
|
158
|
+
side: string;
|
|
159
|
+
take_profit?: number;
|
|
160
|
+
stop_loss?: number;
|
|
161
|
+
trailing_stop?: number;
|
|
162
|
+
tp_trigger_by?: string;
|
|
163
|
+
sl_trigger_by?: string;
|
|
164
|
+
sl_size?: number;
|
|
165
|
+
tp_size?: number;
|
|
166
|
+
position_idx?: 0 | 1 | 2;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface LinearGetTradeRecordsRequest {
|
|
170
|
+
symbol: string;
|
|
171
|
+
start_time?: number;
|
|
172
|
+
end_time?: number;
|
|
173
|
+
exec_type?: string;
|
|
174
|
+
page?: number;
|
|
175
|
+
limit?: number;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface LinearGetHistoryTradeRecordsRequest {
|
|
179
|
+
symbol: string;
|
|
180
|
+
start_time?: number;
|
|
181
|
+
end_time?: number;
|
|
182
|
+
exec_type?: string;
|
|
183
|
+
page?: number;
|
|
184
|
+
limit?: number;
|
|
185
|
+
page_token?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface LinearGetClosedPnlRequest {
|
|
189
|
+
symbol: string;
|
|
190
|
+
start_time?: number;
|
|
191
|
+
end_time?: number;
|
|
192
|
+
exec_type?: string;
|
|
193
|
+
page?: number;
|
|
194
|
+
limit?: number;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface LinearSetRiskLimitRequest {
|
|
198
|
+
symbol: string;
|
|
199
|
+
side: string;
|
|
200
|
+
risk_id: number;
|
|
201
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { OrderSide, numberInString } from '../shared';
|
|
2
|
+
|
|
3
|
+
export type OrderTypeSpot = 'LIMIT' | 'MARKET' | 'LIMIT_MAKER';
|
|
4
|
+
export type OrderTimeInForce = 'GTC' | 'FOK' | 'IOC';
|
|
5
|
+
|
|
6
|
+
export interface NewSpotOrder {
|
|
7
|
+
symbol: string;
|
|
8
|
+
qty: number;
|
|
9
|
+
side: OrderSide;
|
|
10
|
+
type: OrderTypeSpot;
|
|
11
|
+
timeInForce?: OrderTimeInForce;
|
|
12
|
+
price?: number;
|
|
13
|
+
orderLinkId?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface NewSpotOrderV3 {
|
|
17
|
+
symbol: string;
|
|
18
|
+
orderQty: string;
|
|
19
|
+
side: OrderSide;
|
|
20
|
+
orderType: OrderTypeSpot;
|
|
21
|
+
timeInForce?: OrderTimeInForce;
|
|
22
|
+
orderPrice?: string;
|
|
23
|
+
orderLinkId?: string;
|
|
24
|
+
orderCategory?: 0 | 1;
|
|
25
|
+
triggerPrice?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface SpotCancelOrderBatchRequest {
|
|
29
|
+
symbol: string;
|
|
30
|
+
side?: OrderSide;
|
|
31
|
+
orderTypes: OrderTypeSpot[];
|
|
32
|
+
orderCategory?: 0 | 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface SpotOrderQueryById {
|
|
36
|
+
orderId?: string;
|
|
37
|
+
orderLinkId?: string;
|
|
38
|
+
orderCategory?: 0 | 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface SpotSymbolInfo {
|
|
42
|
+
name: string;
|
|
43
|
+
alias: string;
|
|
44
|
+
baseCurrency: string;
|
|
45
|
+
quoteCurrency: string;
|
|
46
|
+
basePrecision: numberInString;
|
|
47
|
+
quotePrecision: numberInString;
|
|
48
|
+
minTradeQuantity: numberInString;
|
|
49
|
+
minTradeAmount: numberInString;
|
|
50
|
+
minPricePrecision: numberInString;
|
|
51
|
+
maxTradeQuantity: numberInString;
|
|
52
|
+
maxTradeAmount: numberInString;
|
|
53
|
+
category: numberInString;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SpotMyTradesRequest {
|
|
57
|
+
symbol?: string;
|
|
58
|
+
orderId?: string;
|
|
59
|
+
limit?: string;
|
|
60
|
+
startTime?: number;
|
|
61
|
+
endTime?: number;
|
|
62
|
+
fromTradeId?: string;
|
|
63
|
+
toTradeId?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface SpotLeveragedTokenPRHistoryRequest {
|
|
67
|
+
ltCode?: string;
|
|
68
|
+
orderId?: string;
|
|
69
|
+
startTime?: number;
|
|
70
|
+
endTime?: number;
|
|
71
|
+
limit?: number;
|
|
72
|
+
orderType?: 1 | 2;
|
|
73
|
+
serialNo?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface SpotCrossMarginBorrowingInfoRequest {
|
|
77
|
+
startTime?: number;
|
|
78
|
+
endTime?: number;
|
|
79
|
+
coin?: string;
|
|
80
|
+
status?: 0 | 1 | 2;
|
|
81
|
+
limit?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface SpotCrossMarginRepaymentHistoryRequest {
|
|
85
|
+
startTime?: number;
|
|
86
|
+
endTime?: number;
|
|
87
|
+
coin?: string;
|
|
88
|
+
limit?: number;
|
|
89
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { KlineIntervalV3, OrderSide } from '../shared';
|
|
2
|
+
import { USDCOrderFilter, USDCTimeInForce } from './usdc-shared';
|
|
3
|
+
|
|
4
|
+
export type UMCategory = 'linear' | 'inverse' | 'option';
|
|
5
|
+
export type UMOrderType = 'Limit' | 'Market';
|
|
6
|
+
export type UMDirection = 'prev' | 'next';
|
|
7
|
+
|
|
8
|
+
export interface UMCandlesRequest {
|
|
9
|
+
category: UMCategory;
|
|
10
|
+
symbol: string;
|
|
11
|
+
interval: KlineIntervalV3;
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
limit?: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface UMInstrumentInfoRequest {
|
|
18
|
+
category: UMCategory;
|
|
19
|
+
symbol?: string;
|
|
20
|
+
baseCoin?: string;
|
|
21
|
+
limit?: string;
|
|
22
|
+
cursor?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface UMFundingRateHistoryRequest {
|
|
26
|
+
category: UMCategory;
|
|
27
|
+
symbol: string;
|
|
28
|
+
startTime?: number;
|
|
29
|
+
endTime?: number;
|
|
30
|
+
limit?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface UMOptionDeliveryPriceRequest {
|
|
34
|
+
category: UMCategory;
|
|
35
|
+
symbol?: string;
|
|
36
|
+
baseCoin?: string;
|
|
37
|
+
direction?: UMDirection;
|
|
38
|
+
limit?: string;
|
|
39
|
+
cursor?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface UMPublicTradesRequest {
|
|
43
|
+
category: UMCategory;
|
|
44
|
+
symbol: string;
|
|
45
|
+
baseCoin?: string;
|
|
46
|
+
optionType?: 'Call' | 'Put';
|
|
47
|
+
limit?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface UMOpenInterestRequest {
|
|
51
|
+
category: UMCategory;
|
|
52
|
+
symbol: string;
|
|
53
|
+
interval: '5min' | '15min' | '30min' | '1h' | '4h' | '1d';
|
|
54
|
+
startTime?: number;
|
|
55
|
+
endTime?: number;
|
|
56
|
+
limit?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface UMOrderRequest {
|
|
60
|
+
category: UMCategory;
|
|
61
|
+
symbol: string;
|
|
62
|
+
side: OrderSide;
|
|
63
|
+
positionIdx?: '0' | '1' | '2';
|
|
64
|
+
orderType: UMOrderType;
|
|
65
|
+
qty: string;
|
|
66
|
+
price?: string;
|
|
67
|
+
basePrice?: string;
|
|
68
|
+
triggerPrice?: string;
|
|
69
|
+
triggerBy?: string;
|
|
70
|
+
iv?: string;
|
|
71
|
+
timeInForce: USDCTimeInForce;
|
|
72
|
+
orderLinkId?: string;
|
|
73
|
+
takeProfit?: number;
|
|
74
|
+
stopLoss?: number;
|
|
75
|
+
tpTriggerBy?: string;
|
|
76
|
+
slTriggerBy?: string;
|
|
77
|
+
reduceOnly?: boolean;
|
|
78
|
+
closeOnTrigger?: boolean;
|
|
79
|
+
mmp?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface UMModifyOrderRequest {
|
|
83
|
+
category: UMCategory;
|
|
84
|
+
symbol: string;
|
|
85
|
+
orderId?: string;
|
|
86
|
+
orderLinkId?: string;
|
|
87
|
+
iv?: string;
|
|
88
|
+
triggerPrice?: string;
|
|
89
|
+
qty?: string;
|
|
90
|
+
price?: string;
|
|
91
|
+
takeProfit?: number;
|
|
92
|
+
stopLoss?: number;
|
|
93
|
+
tpTriggerBy?: string;
|
|
94
|
+
slTriggerBy?: string;
|
|
95
|
+
triggerBy?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface UMCancelOrderRequest {
|
|
99
|
+
category: UMCategory;
|
|
100
|
+
symbol: string;
|
|
101
|
+
orderId?: string;
|
|
102
|
+
orderLinkId?: string;
|
|
103
|
+
orderFilter?: USDCOrderFilter;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface UMActiveOrdersRequest {
|
|
107
|
+
category: UMCategory;
|
|
108
|
+
symbol?: string;
|
|
109
|
+
baseCoin?: string;
|
|
110
|
+
orderId?: string;
|
|
111
|
+
orderLinkId?: string;
|
|
112
|
+
orderFilter?: USDCOrderFilter;
|
|
113
|
+
direction?: UMDirection;
|
|
114
|
+
limit?: number;
|
|
115
|
+
cursor?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface UMHistoricOrdersRequest {
|
|
119
|
+
category: UMCategory;
|
|
120
|
+
symbol?: string;
|
|
121
|
+
baseCoin?: string;
|
|
122
|
+
orderId?: string;
|
|
123
|
+
orderLinkId?: string;
|
|
124
|
+
orderStatus?: string;
|
|
125
|
+
orderFilter?: USDCOrderFilter;
|
|
126
|
+
direction?: UMDirection;
|
|
127
|
+
limit?: number;
|
|
128
|
+
cursor?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface UMBatchOrder {
|
|
132
|
+
symbol: string;
|
|
133
|
+
side: OrderSide;
|
|
134
|
+
positionIdx?: '0';
|
|
135
|
+
orderType: UMOrderType;
|
|
136
|
+
qty: string;
|
|
137
|
+
price?: string;
|
|
138
|
+
iv?: string;
|
|
139
|
+
timeInForce: USDCTimeInForce;
|
|
140
|
+
orderLinkId?: string;
|
|
141
|
+
reduceOnly?: boolean;
|
|
142
|
+
closeOnTrigger?: boolean;
|
|
143
|
+
mmp?: boolean;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface UMBatchOrderReplace {
|
|
147
|
+
symbol: string;
|
|
148
|
+
orderId?: string;
|
|
149
|
+
orderLinkId?: string;
|
|
150
|
+
iv?: string;
|
|
151
|
+
qty?: string;
|
|
152
|
+
price?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface UMBatchOrderCancel {
|
|
156
|
+
symbol: string;
|
|
157
|
+
orderId?: string;
|
|
158
|
+
orderLinkId?: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface UMCancelAllOrdersRequest {
|
|
162
|
+
category: UMCategory;
|
|
163
|
+
baseCoin?: string;
|
|
164
|
+
settleCoin?: string;
|
|
165
|
+
symbol?: string;
|
|
166
|
+
orderFilter?: USDCOrderFilter;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface UMPositionsRequest {
|
|
170
|
+
category: UMCategory;
|
|
171
|
+
symbol?: string;
|
|
172
|
+
baseCoin?: string;
|
|
173
|
+
direction?: UMDirection;
|
|
174
|
+
limit?: number;
|
|
175
|
+
cursor?: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface UMSetTPSLRequest {
|
|
179
|
+
category: UMCategory;
|
|
180
|
+
symbol: string;
|
|
181
|
+
takeProfit?: string;
|
|
182
|
+
stopLoss?: string;
|
|
183
|
+
trailingStop?: string;
|
|
184
|
+
tpTriggerBy?: string;
|
|
185
|
+
slTriggerBy?: string;
|
|
186
|
+
activePrice?: string;
|
|
187
|
+
slSize?: string;
|
|
188
|
+
tpSize?: string;
|
|
189
|
+
positionIdx?: '0';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface UM7DayTradingHistoryRequest {
|
|
193
|
+
category: UMCategory;
|
|
194
|
+
symbol: string;
|
|
195
|
+
baseCoin?: string;
|
|
196
|
+
orderId?: string;
|
|
197
|
+
orderLinkId?: string;
|
|
198
|
+
startTime?: number;
|
|
199
|
+
endTime?: number;
|
|
200
|
+
direction?: UMDirection;
|
|
201
|
+
limit?: number;
|
|
202
|
+
cursor?: string;
|
|
203
|
+
execType?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface UMOptionsSettlementHistoryRequest {
|
|
207
|
+
category: UMCategory;
|
|
208
|
+
symbol?: string;
|
|
209
|
+
expDate?: string;
|
|
210
|
+
direction?: UMDirection;
|
|
211
|
+
limit?: number;
|
|
212
|
+
cursor?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface UMPerpSettlementHistoryRequest {
|
|
216
|
+
category: UMCategory;
|
|
217
|
+
symbol?: string;
|
|
218
|
+
direction?: UMDirection;
|
|
219
|
+
limit?: number;
|
|
220
|
+
cursor?: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface UMTransactionLogRequest {
|
|
224
|
+
category: UMCategory;
|
|
225
|
+
currency: string;
|
|
226
|
+
baseCoin?: string;
|
|
227
|
+
type?: string;
|
|
228
|
+
startTime?: number;
|
|
229
|
+
endTime?: number;
|
|
230
|
+
direction?: UMDirection;
|
|
231
|
+
limit?: number;
|
|
232
|
+
cursor?: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface UMExchangeCoinsRequest {
|
|
236
|
+
fromCoin?: string;
|
|
237
|
+
toCoin?: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface UMBorrowHistoryRequest {
|
|
241
|
+
currency: string;
|
|
242
|
+
startTime?: number;
|
|
243
|
+
endTime?: number;
|
|
244
|
+
direction?: UMDirection;
|
|
245
|
+
limit?: number;
|
|
246
|
+
cursor?: string;
|
|
247
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { OrderSide } from '../shared';
|
|
2
|
+
import { USDCAPICategory, USDCOrderType, USDCTimeInForce } from './usdc-shared';
|
|
3
|
+
|
|
4
|
+
export interface USDCOptionsContractInfoRequest {
|
|
5
|
+
symbol?: string;
|
|
6
|
+
status?: 'WAITING_ONLINE' | 'ONLINE' | 'DELIVERING' | 'OFFLINE';
|
|
7
|
+
baseCoin?: string;
|
|
8
|
+
direction?: string;
|
|
9
|
+
limit?: string;
|
|
10
|
+
cursor?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface USDCOptionsDeliveryPriceRequest {
|
|
14
|
+
symbol?: string;
|
|
15
|
+
baseCoin?: string;
|
|
16
|
+
direction?: string;
|
|
17
|
+
limit?: string;
|
|
18
|
+
cursor?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface USDCOptionsRecentTradesRequest {
|
|
22
|
+
category: USDCAPICategory;
|
|
23
|
+
symbol?: string;
|
|
24
|
+
baseCoin?: string;
|
|
25
|
+
optionType?: 'Call' | 'Put';
|
|
26
|
+
limit?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface USDCOptionsHistoricalVolatilityRequest {
|
|
30
|
+
baseCoin?: string;
|
|
31
|
+
period?: string;
|
|
32
|
+
startTime?: string;
|
|
33
|
+
endTime?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface USDCOptionsOrderRequest {
|
|
37
|
+
symbol: string;
|
|
38
|
+
orderType: USDCOrderType;
|
|
39
|
+
side: OrderSide;
|
|
40
|
+
orderPrice?: string;
|
|
41
|
+
orderQty: string;
|
|
42
|
+
iv?: string;
|
|
43
|
+
timeInForce?: USDCTimeInForce;
|
|
44
|
+
orderLinkId?: string;
|
|
45
|
+
reduceOnly?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface USDCOptionsModifyOrderRequest {
|
|
49
|
+
symbol: string;
|
|
50
|
+
orderId?: string;
|
|
51
|
+
orderLinkId?: string;
|
|
52
|
+
orderPrice?: string;
|
|
53
|
+
orderQty?: string;
|
|
54
|
+
iv?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface USDCOptionsCancelOrderRequest {
|
|
58
|
+
symbol: string;
|
|
59
|
+
orderId?: string;
|
|
60
|
+
orderLinkId?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface USDCOptionsCancelAllOrdersRequest {
|
|
64
|
+
symbol?: string;
|
|
65
|
+
baseCoin?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface USDCOptionsActiveOrdersRealtimeRequest {
|
|
69
|
+
orderId?: string;
|
|
70
|
+
orderLinkId?: string;
|
|
71
|
+
symbol?: string;
|
|
72
|
+
baseCoin?: string;
|
|
73
|
+
direction?: string;
|
|
74
|
+
limit?: number;
|
|
75
|
+
cursor?: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface USDCOptionsActiveOrdersRequest {
|
|
79
|
+
category: 'OPTION';
|
|
80
|
+
symbol?: string;
|
|
81
|
+
baseCoin?: string;
|
|
82
|
+
orderId?: string;
|
|
83
|
+
orderLinkId?: string;
|
|
84
|
+
direction?: string;
|
|
85
|
+
limit?: number;
|
|
86
|
+
cursor?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface USDCOptionsHistoricOrdersRequest {
|
|
90
|
+
category: 'OPTION';
|
|
91
|
+
symbol?: string;
|
|
92
|
+
baseCoin?: string;
|
|
93
|
+
orderId?: string;
|
|
94
|
+
orderLinkId?: string;
|
|
95
|
+
orderStatus?: string;
|
|
96
|
+
direction?: string;
|
|
97
|
+
limit?: number;
|
|
98
|
+
cursor?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface USDCOptionsOrderExecutionRequest {
|
|
102
|
+
category: 'OPTION';
|
|
103
|
+
symbol?: string;
|
|
104
|
+
baseCoin?: string;
|
|
105
|
+
orderId?: string;
|
|
106
|
+
orderLinkId?: string;
|
|
107
|
+
startTime?: string;
|
|
108
|
+
direction?: string;
|
|
109
|
+
limit?: number;
|
|
110
|
+
cursor?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface USDCOptionsDeliveryHistoryRequest {
|
|
114
|
+
symbol: string;
|
|
115
|
+
expDate?: string;
|
|
116
|
+
direction?: string;
|
|
117
|
+
limit?: string;
|
|
118
|
+
cursor?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface USDCOptionsPositionsInfoExpiryRequest {
|
|
122
|
+
expDate?: string;
|
|
123
|
+
direction?: string;
|
|
124
|
+
limit?: string;
|
|
125
|
+
cursor?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface USDCOptionsModifyMMPRequest {
|
|
129
|
+
currency: string;
|
|
130
|
+
windowMs: number;
|
|
131
|
+
frozenPeriodMs: number;
|
|
132
|
+
qtyLimit: string;
|
|
133
|
+
deltaLimit: string;
|
|
134
|
+
}
|