@binance/derivatives-trading-options 1.0.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/dist/index.mjs ADDED
@@ -0,0 +1,4452 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name2 in all)
4
+ __defProp(target, name2, { get: all[name2], enumerable: true });
5
+ };
6
+
7
+ // src/derivatives-trading-options.ts
8
+ import { platform, arch } from "os";
9
+ import {
10
+ ConfigurationRestAPI as ConfigurationRestAPI8,
11
+ ConfigurationWebsocketStreams as ConfigurationWebsocketStreams2,
12
+ DERIVATIVES_TRADING_OPTIONS_REST_API_PROD_URL,
13
+ DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_PROD_URL
14
+ } from "@binance/common";
15
+
16
+ // package.json
17
+ var name = "@binance/derivatives-trading-options";
18
+ var version = "1.0.0";
19
+
20
+ // src/rest-api/index.ts
21
+ var rest_api_exports = {};
22
+ __export(rest_api_exports, {
23
+ AccountApi: () => AccountApi,
24
+ MarketDataApi: () => MarketDataApi,
25
+ MarketMakerBlockTradeApi: () => MarketMakerBlockTradeApi,
26
+ MarketMakerEndpointsApi: () => MarketMakerEndpointsApi,
27
+ NewBlockTradeOrderSideEnum: () => NewBlockTradeOrderSideEnum,
28
+ NewOrderNewOrderRespTypeEnum: () => NewOrderNewOrderRespTypeEnum,
29
+ NewOrderSideEnum: () => NewOrderSideEnum,
30
+ NewOrderTimeInForceEnum: () => NewOrderTimeInForceEnum,
31
+ NewOrderTypeEnum: () => NewOrderTypeEnum,
32
+ PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum: () => PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum,
33
+ PlaceMultipleOrdersOrdersParameterInnerSideEnum: () => PlaceMultipleOrdersOrdersParameterInnerSideEnum,
34
+ PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum: () => PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum,
35
+ PlaceMultipleOrdersOrdersParameterInnerTypeEnum: () => PlaceMultipleOrdersOrdersParameterInnerTypeEnum,
36
+ RestAPI: () => RestAPI,
37
+ TradeApi: () => TradeApi,
38
+ UserDataStreamsApi: () => UserDataStreamsApi
39
+ });
40
+
41
+ // src/rest-api/types/place-multiple-orders-orders-parameter-inner.ts
42
+ var PlaceMultipleOrdersOrdersParameterInnerSideEnum = {
43
+ BUY: "BUY",
44
+ SELL: "SELL"
45
+ };
46
+ var PlaceMultipleOrdersOrdersParameterInnerTypeEnum = {
47
+ LIMIT: "LIMIT"
48
+ };
49
+ var PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum = {
50
+ GTC: "GTC",
51
+ IOC: "IOC",
52
+ FOK: "FOK"
53
+ };
54
+ var PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum = {
55
+ ACK: "ACK",
56
+ RESULT: "RESULT"
57
+ };
58
+
59
+ // src/rest-api/modules/account-api.ts
60
+ import {
61
+ assertParamExists,
62
+ sendRequest
63
+ } from "@binance/common";
64
+ var AccountApiAxiosParamCreator = function(configuration) {
65
+ return {
66
+ /**
67
+ * Query account funding flows.
68
+ *
69
+ * Weight: 1
70
+ *
71
+ * @summary Account Funding Flow (USER_DATA)
72
+ * @param {string} currency Asset type, only support USDT as of now
73
+ * @param {number} [recordId] Return the recordId and subsequent data, the latest data is returned by default, e.g 100000
74
+ * @param {number} [startTime] Start Time, e.g 1593511200000
75
+ * @param {number} [endTime] End Time, e.g 1593512200000
76
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
77
+ * @param {number} [recvWindow]
78
+ *
79
+ * @throws {RequiredError}
80
+ */
81
+ accountFundingFlow: async (currency, recordId, startTime, endTime, limit, recvWindow) => {
82
+ assertParamExists("accountFundingFlow", "currency", currency);
83
+ const localVarQueryParameter = {};
84
+ if (currency !== void 0 && currency !== null) {
85
+ localVarQueryParameter["currency"] = currency;
86
+ }
87
+ if (recordId !== void 0 && recordId !== null) {
88
+ localVarQueryParameter["recordId"] = recordId;
89
+ }
90
+ if (startTime !== void 0 && startTime !== null) {
91
+ localVarQueryParameter["startTime"] = startTime;
92
+ }
93
+ if (endTime !== void 0 && endTime !== null) {
94
+ localVarQueryParameter["endTime"] = endTime;
95
+ }
96
+ if (limit !== void 0 && limit !== null) {
97
+ localVarQueryParameter["limit"] = limit;
98
+ }
99
+ if (recvWindow !== void 0 && recvWindow !== null) {
100
+ localVarQueryParameter["recvWindow"] = recvWindow;
101
+ }
102
+ let _timeUnit;
103
+ if ("timeUnit" in configuration)
104
+ _timeUnit = configuration.timeUnit;
105
+ return {
106
+ endpoint: "/eapi/v1/bill",
107
+ method: "GET",
108
+ params: localVarQueryParameter,
109
+ timeUnit: _timeUnit
110
+ };
111
+ },
112
+ /**
113
+ * Get download id for option transaction history
114
+ *
115
+ * Request Limitation is 5 times per month, shared by > front end download page and rest api
116
+ * The time between `startTime` and `endTime` can not be longer than 1 year
117
+ *
118
+ * Weight: 5
119
+ *
120
+ * @summary Get Download Id For Option Transaction History (USER_DATA)
121
+ * @param {number} startTime Timestamp in ms
122
+ * @param {number} endTime Timestamp in ms
123
+ * @param {number} [recvWindow]
124
+ *
125
+ * @throws {RequiredError}
126
+ */
127
+ getDownloadIdForOptionTransactionHistory: async (startTime, endTime, recvWindow) => {
128
+ assertParamExists("getDownloadIdForOptionTransactionHistory", "startTime", startTime);
129
+ assertParamExists("getDownloadIdForOptionTransactionHistory", "endTime", endTime);
130
+ const localVarQueryParameter = {};
131
+ if (startTime !== void 0 && startTime !== null) {
132
+ localVarQueryParameter["startTime"] = startTime;
133
+ }
134
+ if (endTime !== void 0 && endTime !== null) {
135
+ localVarQueryParameter["endTime"] = endTime;
136
+ }
137
+ if (recvWindow !== void 0 && recvWindow !== null) {
138
+ localVarQueryParameter["recvWindow"] = recvWindow;
139
+ }
140
+ let _timeUnit;
141
+ if ("timeUnit" in configuration)
142
+ _timeUnit = configuration.timeUnit;
143
+ return {
144
+ endpoint: "/eapi/v1/income/asyn",
145
+ method: "GET",
146
+ params: localVarQueryParameter,
147
+ timeUnit: _timeUnit
148
+ };
149
+ },
150
+ /**
151
+ * Get option transaction history download Link by Id
152
+ *
153
+ * Download link expiration: 24h
154
+ *
155
+ * Weight: 5
156
+ *
157
+ * @summary Get Option Transaction History Download Link by Id (USER_DATA)
158
+ * @param {string} downloadId get by download id api
159
+ * @param {number} [recvWindow]
160
+ *
161
+ * @throws {RequiredError}
162
+ */
163
+ getOptionTransactionHistoryDownloadLinkById: async (downloadId, recvWindow) => {
164
+ assertParamExists(
165
+ "getOptionTransactionHistoryDownloadLinkById",
166
+ "downloadId",
167
+ downloadId
168
+ );
169
+ const localVarQueryParameter = {};
170
+ if (downloadId !== void 0 && downloadId !== null) {
171
+ localVarQueryParameter["downloadId"] = downloadId;
172
+ }
173
+ if (recvWindow !== void 0 && recvWindow !== null) {
174
+ localVarQueryParameter["recvWindow"] = recvWindow;
175
+ }
176
+ let _timeUnit;
177
+ if ("timeUnit" in configuration)
178
+ _timeUnit = configuration.timeUnit;
179
+ return {
180
+ endpoint: "/eapi/v1/income/asyn/id",
181
+ method: "GET",
182
+ params: localVarQueryParameter,
183
+ timeUnit: _timeUnit
184
+ };
185
+ },
186
+ /**
187
+ * Get current account information.
188
+ *
189
+ * Weight: 3
190
+ *
191
+ * @summary Option Account Information(TRADE)
192
+ * @param {number} [recvWindow]
193
+ *
194
+ * @throws {RequiredError}
195
+ */
196
+ optionAccountInformation: async (recvWindow) => {
197
+ const localVarQueryParameter = {};
198
+ if (recvWindow !== void 0 && recvWindow !== null) {
199
+ localVarQueryParameter["recvWindow"] = recvWindow;
200
+ }
201
+ let _timeUnit;
202
+ if ("timeUnit" in configuration)
203
+ _timeUnit = configuration.timeUnit;
204
+ return {
205
+ endpoint: "/eapi/v1/account",
206
+ method: "GET",
207
+ params: localVarQueryParameter,
208
+ timeUnit: _timeUnit
209
+ };
210
+ }
211
+ };
212
+ };
213
+ var AccountApi = class {
214
+ constructor(configuration) {
215
+ this.configuration = configuration;
216
+ this.localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);
217
+ }
218
+ /**
219
+ * Query account funding flows.
220
+ *
221
+ * Weight: 1
222
+ *
223
+ * @summary Account Funding Flow (USER_DATA)
224
+ * @param {AccountFundingFlowRequest} requestParameters Request parameters.
225
+ * @returns {Promise<RestApiResponse<AccountFundingFlowResponse>>}
226
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
227
+ * @memberof AccountApi
228
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow Binance API Documentation}
229
+ */
230
+ async accountFundingFlow(requestParameters) {
231
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountFundingFlow(
232
+ requestParameters?.currency,
233
+ requestParameters?.recordId,
234
+ requestParameters?.startTime,
235
+ requestParameters?.endTime,
236
+ requestParameters?.limit,
237
+ requestParameters?.recvWindow
238
+ );
239
+ return sendRequest(
240
+ this.configuration,
241
+ localVarAxiosArgs.endpoint,
242
+ localVarAxiosArgs.method,
243
+ localVarAxiosArgs.params,
244
+ localVarAxiosArgs?.timeUnit,
245
+ { isSigned: true }
246
+ );
247
+ }
248
+ /**
249
+ * Get download id for option transaction history
250
+ *
251
+ * Request Limitation is 5 times per month, shared by > front end download page and rest api
252
+ * The time between `startTime` and `endTime` can not be longer than 1 year
253
+ *
254
+ * Weight: 5
255
+ *
256
+ * @summary Get Download Id For Option Transaction History (USER_DATA)
257
+ * @param {GetDownloadIdForOptionTransactionHistoryRequest} requestParameters Request parameters.
258
+ * @returns {Promise<RestApiResponse<GetDownloadIdForOptionTransactionHistoryResponse>>}
259
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
260
+ * @memberof AccountApi
261
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Get-Download-Id-For-Option-Transaction-History Binance API Documentation}
262
+ */
263
+ async getDownloadIdForOptionTransactionHistory(requestParameters) {
264
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDownloadIdForOptionTransactionHistory(
265
+ requestParameters?.startTime,
266
+ requestParameters?.endTime,
267
+ requestParameters?.recvWindow
268
+ );
269
+ return sendRequest(
270
+ this.configuration,
271
+ localVarAxiosArgs.endpoint,
272
+ localVarAxiosArgs.method,
273
+ localVarAxiosArgs.params,
274
+ localVarAxiosArgs?.timeUnit,
275
+ { isSigned: true }
276
+ );
277
+ }
278
+ /**
279
+ * Get option transaction history download Link by Id
280
+ *
281
+ * Download link expiration: 24h
282
+ *
283
+ * Weight: 5
284
+ *
285
+ * @summary Get Option Transaction History Download Link by Id (USER_DATA)
286
+ * @param {GetOptionTransactionHistoryDownloadLinkByIdRequest} requestParameters Request parameters.
287
+ * @returns {Promise<RestApiResponse<GetOptionTransactionHistoryDownloadLinkByIdResponse>>}
288
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
289
+ * @memberof AccountApi
290
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Get-Option-Transaction-History-Download-Link-by-Id Binance API Documentation}
291
+ */
292
+ async getOptionTransactionHistoryDownloadLinkById(requestParameters) {
293
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOptionTransactionHistoryDownloadLinkById(
294
+ requestParameters?.downloadId,
295
+ requestParameters?.recvWindow
296
+ );
297
+ return sendRequest(
298
+ this.configuration,
299
+ localVarAxiosArgs.endpoint,
300
+ localVarAxiosArgs.method,
301
+ localVarAxiosArgs.params,
302
+ localVarAxiosArgs?.timeUnit,
303
+ { isSigned: true }
304
+ );
305
+ }
306
+ /**
307
+ * Get current account information.
308
+ *
309
+ * Weight: 3
310
+ *
311
+ * @summary Option Account Information(TRADE)
312
+ * @param {OptionAccountInformationRequest} requestParameters Request parameters.
313
+ * @returns {Promise<RestApiResponse<OptionAccountInformationResponse>>}
314
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
315
+ * @memberof AccountApi
316
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information Binance API Documentation}
317
+ */
318
+ async optionAccountInformation(requestParameters = {}) {
319
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.optionAccountInformation(
320
+ requestParameters?.recvWindow
321
+ );
322
+ return sendRequest(
323
+ this.configuration,
324
+ localVarAxiosArgs.endpoint,
325
+ localVarAxiosArgs.method,
326
+ localVarAxiosArgs.params,
327
+ localVarAxiosArgs?.timeUnit,
328
+ { isSigned: true }
329
+ );
330
+ }
331
+ };
332
+
333
+ // src/rest-api/modules/market-data-api.ts
334
+ import {
335
+ assertParamExists as assertParamExists2,
336
+ sendRequest as sendRequest2
337
+ } from "@binance/common";
338
+ var MarketDataApiAxiosParamCreator = function(configuration) {
339
+ return {
340
+ /**
341
+ * Test connectivity to the Rest API and get the current server time.
342
+ *
343
+ * Weight: 1
344
+ *
345
+ * @summary Check Server Time
346
+ *
347
+ * @throws {RequiredError}
348
+ */
349
+ checkServerTime: async () => {
350
+ const localVarQueryParameter = {};
351
+ let _timeUnit;
352
+ if ("timeUnit" in configuration)
353
+ _timeUnit = configuration.timeUnit;
354
+ return {
355
+ endpoint: "/eapi/v1/time",
356
+ method: "GET",
357
+ params: localVarQueryParameter,
358
+ timeUnit: _timeUnit
359
+ };
360
+ },
361
+ /**
362
+ * Current exchange trading rules and symbol information
363
+ *
364
+ * Weight: 1
365
+ *
366
+ * @summary Exchange Information
367
+ *
368
+ * @throws {RequiredError}
369
+ */
370
+ exchangeInformation: async () => {
371
+ const localVarQueryParameter = {};
372
+ let _timeUnit;
373
+ if ("timeUnit" in configuration)
374
+ _timeUnit = configuration.timeUnit;
375
+ return {
376
+ endpoint: "/eapi/v1/exchangeInfo",
377
+ method: "GET",
378
+ params: localVarQueryParameter,
379
+ timeUnit: _timeUnit
380
+ };
381
+ },
382
+ /**
383
+ * Get historical exercise records.
384
+ * REALISTIC_VALUE_STRICKEN -> Exercised
385
+ * EXTRINSIC_VALUE_EXPIRED -> Expired OTM
386
+ *
387
+ * Weight: 3
388
+ *
389
+ * @summary Historical Exercise Records
390
+ * @param {string} [underlying] underlying, e.g BTCUSDT
391
+ * @param {number} [startTime] Start Time, e.g 1593511200000
392
+ * @param {number} [endTime] End Time, e.g 1593512200000
393
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
394
+ *
395
+ * @throws {RequiredError}
396
+ */
397
+ historicalExerciseRecords: async (underlying, startTime, endTime, limit) => {
398
+ const localVarQueryParameter = {};
399
+ if (underlying !== void 0 && underlying !== null) {
400
+ localVarQueryParameter["underlying"] = underlying;
401
+ }
402
+ if (startTime !== void 0 && startTime !== null) {
403
+ localVarQueryParameter["startTime"] = startTime;
404
+ }
405
+ if (endTime !== void 0 && endTime !== null) {
406
+ localVarQueryParameter["endTime"] = endTime;
407
+ }
408
+ if (limit !== void 0 && limit !== null) {
409
+ localVarQueryParameter["limit"] = limit;
410
+ }
411
+ let _timeUnit;
412
+ if ("timeUnit" in configuration)
413
+ _timeUnit = configuration.timeUnit;
414
+ return {
415
+ endpoint: "/eapi/v1/exerciseHistory",
416
+ method: "GET",
417
+ params: localVarQueryParameter,
418
+ timeUnit: _timeUnit
419
+ };
420
+ },
421
+ /**
422
+ * Kline/candlestick bars for an option symbol.
423
+ * Klines are uniquely identified by their open time.
424
+ *
425
+ * If startTime and endTime are not sent, the most recent klines are returned.
426
+ *
427
+ * Weight: 1
428
+ *
429
+ * @summary Kline/Candlestick Data
430
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
431
+ * @param {string} interval Time interval
432
+ * @param {number} [startTime] Start Time, e.g 1593511200000
433
+ * @param {number} [endTime] End Time, e.g 1593512200000
434
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
435
+ *
436
+ * @throws {RequiredError}
437
+ */
438
+ klineCandlestickData: async (symbol, interval, startTime, endTime, limit) => {
439
+ assertParamExists2("klineCandlestickData", "symbol", symbol);
440
+ assertParamExists2("klineCandlestickData", "interval", interval);
441
+ const localVarQueryParameter = {};
442
+ if (symbol !== void 0 && symbol !== null) {
443
+ localVarQueryParameter["symbol"] = symbol;
444
+ }
445
+ if (interval !== void 0 && interval !== null) {
446
+ localVarQueryParameter["interval"] = interval;
447
+ }
448
+ if (startTime !== void 0 && startTime !== null) {
449
+ localVarQueryParameter["startTime"] = startTime;
450
+ }
451
+ if (endTime !== void 0 && endTime !== null) {
452
+ localVarQueryParameter["endTime"] = endTime;
453
+ }
454
+ if (limit !== void 0 && limit !== null) {
455
+ localVarQueryParameter["limit"] = limit;
456
+ }
457
+ let _timeUnit;
458
+ if ("timeUnit" in configuration)
459
+ _timeUnit = configuration.timeUnit;
460
+ return {
461
+ endpoint: "/eapi/v1/klines",
462
+ method: "GET",
463
+ params: localVarQueryParameter,
464
+ timeUnit: _timeUnit
465
+ };
466
+ },
467
+ /**
468
+ * Get older market historical trades.
469
+ *
470
+ * Weight: 20
471
+ *
472
+ * @summary Old Trades Lookup (MARKET_DATA)
473
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
474
+ * @param {number} [fromId] The UniqueId ID from which to return. The latest deal record is returned by default
475
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
476
+ *
477
+ * @throws {RequiredError}
478
+ */
479
+ oldTradesLookup: async (symbol, fromId, limit) => {
480
+ assertParamExists2("oldTradesLookup", "symbol", symbol);
481
+ const localVarQueryParameter = {};
482
+ if (symbol !== void 0 && symbol !== null) {
483
+ localVarQueryParameter["symbol"] = symbol;
484
+ }
485
+ if (fromId !== void 0 && fromId !== null) {
486
+ localVarQueryParameter["fromId"] = fromId;
487
+ }
488
+ if (limit !== void 0 && limit !== null) {
489
+ localVarQueryParameter["limit"] = limit;
490
+ }
491
+ let _timeUnit;
492
+ if ("timeUnit" in configuration)
493
+ _timeUnit = configuration.timeUnit;
494
+ return {
495
+ endpoint: "/eapi/v1/historicalTrades",
496
+ method: "GET",
497
+ params: localVarQueryParameter,
498
+ timeUnit: _timeUnit
499
+ };
500
+ },
501
+ /**
502
+ * Get open interest for specific underlying asset on specific expiration date.
503
+ *
504
+ * Weight: 0
505
+ *
506
+ * @summary Open Interest
507
+ * @param {string} underlyingAsset underlying asset, e.g ETH/BTC
508
+ * @param {string} expiration expiration date, e.g 221225
509
+ *
510
+ * @throws {RequiredError}
511
+ */
512
+ openInterest: async (underlyingAsset, expiration) => {
513
+ assertParamExists2("openInterest", "underlyingAsset", underlyingAsset);
514
+ assertParamExists2("openInterest", "expiration", expiration);
515
+ const localVarQueryParameter = {};
516
+ if (underlyingAsset !== void 0 && underlyingAsset !== null) {
517
+ localVarQueryParameter["underlyingAsset"] = underlyingAsset;
518
+ }
519
+ if (expiration !== void 0 && expiration !== null) {
520
+ localVarQueryParameter["expiration"] = expiration;
521
+ }
522
+ let _timeUnit;
523
+ if ("timeUnit" in configuration)
524
+ _timeUnit = configuration.timeUnit;
525
+ return {
526
+ endpoint: "/eapi/v1/openInterest",
527
+ method: "GET",
528
+ params: localVarQueryParameter,
529
+ timeUnit: _timeUnit
530
+ };
531
+ },
532
+ /**
533
+ * Option mark price and greek info.
534
+ *
535
+ * Weight: 5
536
+ *
537
+ * @summary Option Mark Price
538
+ * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C
539
+ *
540
+ * @throws {RequiredError}
541
+ */
542
+ optionMarkPrice: async (symbol) => {
543
+ const localVarQueryParameter = {};
544
+ if (symbol !== void 0 && symbol !== null) {
545
+ localVarQueryParameter["symbol"] = symbol;
546
+ }
547
+ let _timeUnit;
548
+ if ("timeUnit" in configuration)
549
+ _timeUnit = configuration.timeUnit;
550
+ return {
551
+ endpoint: "/eapi/v1/mark",
552
+ method: "GET",
553
+ params: localVarQueryParameter,
554
+ timeUnit: _timeUnit
555
+ };
556
+ },
557
+ /**
558
+ * Check orderbook depth on specific symbol
559
+ *
560
+ * Weight: limit | weight
561
+ * ------------ | ------------
562
+ * 5, 10, 20, 50 | 2
563
+ * 100 | 5
564
+ * 500 | 10
565
+ * 1000 | 20
566
+ *
567
+ * @summary Order Book
568
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
569
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
570
+ *
571
+ * @throws {RequiredError}
572
+ */
573
+ orderBook: async (symbol, limit) => {
574
+ assertParamExists2("orderBook", "symbol", symbol);
575
+ const localVarQueryParameter = {};
576
+ if (symbol !== void 0 && symbol !== null) {
577
+ localVarQueryParameter["symbol"] = symbol;
578
+ }
579
+ if (limit !== void 0 && limit !== null) {
580
+ localVarQueryParameter["limit"] = limit;
581
+ }
582
+ let _timeUnit;
583
+ if ("timeUnit" in configuration)
584
+ _timeUnit = configuration.timeUnit;
585
+ return {
586
+ endpoint: "/eapi/v1/depth",
587
+ method: "GET",
588
+ params: localVarQueryParameter,
589
+ timeUnit: _timeUnit
590
+ };
591
+ },
592
+ /**
593
+ * Get recent block trades
594
+ *
595
+ * Weight: 5
596
+ *
597
+ * @summary Recent Block Trades List
598
+ * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C
599
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
600
+ *
601
+ * @throws {RequiredError}
602
+ */
603
+ recentBlockTradesList: async (symbol, limit) => {
604
+ const localVarQueryParameter = {};
605
+ if (symbol !== void 0 && symbol !== null) {
606
+ localVarQueryParameter["symbol"] = symbol;
607
+ }
608
+ if (limit !== void 0 && limit !== null) {
609
+ localVarQueryParameter["limit"] = limit;
610
+ }
611
+ let _timeUnit;
612
+ if ("timeUnit" in configuration)
613
+ _timeUnit = configuration.timeUnit;
614
+ return {
615
+ endpoint: "/eapi/v1/blockTrades",
616
+ method: "GET",
617
+ params: localVarQueryParameter,
618
+ timeUnit: _timeUnit
619
+ };
620
+ },
621
+ /**
622
+ * Get recent market trades
623
+ *
624
+ * Weight: 5
625
+ *
626
+ * @summary Recent Trades List
627
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
628
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
629
+ *
630
+ * @throws {RequiredError}
631
+ */
632
+ recentTradesList: async (symbol, limit) => {
633
+ assertParamExists2("recentTradesList", "symbol", symbol);
634
+ const localVarQueryParameter = {};
635
+ if (symbol !== void 0 && symbol !== null) {
636
+ localVarQueryParameter["symbol"] = symbol;
637
+ }
638
+ if (limit !== void 0 && limit !== null) {
639
+ localVarQueryParameter["limit"] = limit;
640
+ }
641
+ let _timeUnit;
642
+ if ("timeUnit" in configuration)
643
+ _timeUnit = configuration.timeUnit;
644
+ return {
645
+ endpoint: "/eapi/v1/trades",
646
+ method: "GET",
647
+ params: localVarQueryParameter,
648
+ timeUnit: _timeUnit
649
+ };
650
+ },
651
+ /**
652
+ * Get spot index price for option underlying.
653
+ *
654
+ * Weight: 1
655
+ *
656
+ * @summary Symbol Price Ticker
657
+ * @param {string} underlying Option underlying, e.g BTCUSDT
658
+ *
659
+ * @throws {RequiredError}
660
+ */
661
+ symbolPriceTicker: async (underlying) => {
662
+ assertParamExists2("symbolPriceTicker", "underlying", underlying);
663
+ const localVarQueryParameter = {};
664
+ if (underlying !== void 0 && underlying !== null) {
665
+ localVarQueryParameter["underlying"] = underlying;
666
+ }
667
+ let _timeUnit;
668
+ if ("timeUnit" in configuration)
669
+ _timeUnit = configuration.timeUnit;
670
+ return {
671
+ endpoint: "/eapi/v1/index",
672
+ method: "GET",
673
+ params: localVarQueryParameter,
674
+ timeUnit: _timeUnit
675
+ };
676
+ },
677
+ /**
678
+ * Test connectivity to the Rest API.
679
+ *
680
+ * Weight: 1
681
+ *
682
+ * @summary Test Connectivity
683
+ *
684
+ * @throws {RequiredError}
685
+ */
686
+ testConnectivity: async () => {
687
+ const localVarQueryParameter = {};
688
+ let _timeUnit;
689
+ if ("timeUnit" in configuration)
690
+ _timeUnit = configuration.timeUnit;
691
+ return {
692
+ endpoint: "/eapi/v1/ping",
693
+ method: "GET",
694
+ params: localVarQueryParameter,
695
+ timeUnit: _timeUnit
696
+ };
697
+ },
698
+ /**
699
+ * 24 hour rolling window price change statistics.
700
+ *
701
+ * Weight: 5
702
+ *
703
+ * @summary 24hr Ticker Price Change Statistics
704
+ * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C
705
+ *
706
+ * @throws {RequiredError}
707
+ */
708
+ ticker24hrPriceChangeStatistics: async (symbol) => {
709
+ const localVarQueryParameter = {};
710
+ if (symbol !== void 0 && symbol !== null) {
711
+ localVarQueryParameter["symbol"] = symbol;
712
+ }
713
+ let _timeUnit;
714
+ if ("timeUnit" in configuration)
715
+ _timeUnit = configuration.timeUnit;
716
+ return {
717
+ endpoint: "/eapi/v1/ticker",
718
+ method: "GET",
719
+ params: localVarQueryParameter,
720
+ timeUnit: _timeUnit
721
+ };
722
+ }
723
+ };
724
+ };
725
+ var MarketDataApi = class {
726
+ constructor(configuration) {
727
+ this.configuration = configuration;
728
+ this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);
729
+ }
730
+ /**
731
+ * Test connectivity to the Rest API and get the current server time.
732
+ *
733
+ * Weight: 1
734
+ *
735
+ * @summary Check Server Time
736
+ * @returns {Promise<RestApiResponse<CheckServerTimeResponse>>}
737
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
738
+ * @memberof MarketDataApi
739
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Check-Server-Time Binance API Documentation}
740
+ */
741
+ async checkServerTime() {
742
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkServerTime();
743
+ return sendRequest2(
744
+ this.configuration,
745
+ localVarAxiosArgs.endpoint,
746
+ localVarAxiosArgs.method,
747
+ localVarAxiosArgs.params,
748
+ localVarAxiosArgs?.timeUnit,
749
+ { isSigned: false }
750
+ );
751
+ }
752
+ /**
753
+ * Current exchange trading rules and symbol information
754
+ *
755
+ * Weight: 1
756
+ *
757
+ * @summary Exchange Information
758
+ * @returns {Promise<RestApiResponse<ExchangeInformationResponse>>}
759
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
760
+ * @memberof MarketDataApi
761
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information Binance API Documentation}
762
+ */
763
+ async exchangeInformation() {
764
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.exchangeInformation();
765
+ return sendRequest2(
766
+ this.configuration,
767
+ localVarAxiosArgs.endpoint,
768
+ localVarAxiosArgs.method,
769
+ localVarAxiosArgs.params,
770
+ localVarAxiosArgs?.timeUnit,
771
+ { isSigned: false }
772
+ );
773
+ }
774
+ /**
775
+ * Get historical exercise records.
776
+ * REALISTIC_VALUE_STRICKEN -> Exercised
777
+ * EXTRINSIC_VALUE_EXPIRED -> Expired OTM
778
+ *
779
+ * Weight: 3
780
+ *
781
+ * @summary Historical Exercise Records
782
+ * @param {HistoricalExerciseRecordsRequest} requestParameters Request parameters.
783
+ * @returns {Promise<RestApiResponse<HistoricalExerciseRecordsResponse>>}
784
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
785
+ * @memberof MarketDataApi
786
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records Binance API Documentation}
787
+ */
788
+ async historicalExerciseRecords(requestParameters = {}) {
789
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.historicalExerciseRecords(
790
+ requestParameters?.underlying,
791
+ requestParameters?.startTime,
792
+ requestParameters?.endTime,
793
+ requestParameters?.limit
794
+ );
795
+ return sendRequest2(
796
+ this.configuration,
797
+ localVarAxiosArgs.endpoint,
798
+ localVarAxiosArgs.method,
799
+ localVarAxiosArgs.params,
800
+ localVarAxiosArgs?.timeUnit,
801
+ { isSigned: false }
802
+ );
803
+ }
804
+ /**
805
+ * Kline/candlestick bars for an option symbol.
806
+ * Klines are uniquely identified by their open time.
807
+ *
808
+ * If startTime and endTime are not sent, the most recent klines are returned.
809
+ *
810
+ * Weight: 1
811
+ *
812
+ * @summary Kline/Candlestick Data
813
+ * @param {KlineCandlestickDataRequest} requestParameters Request parameters.
814
+ * @returns {Promise<RestApiResponse<KlineCandlestickDataResponse>>}
815
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
816
+ * @memberof MarketDataApi
817
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data Binance API Documentation}
818
+ */
819
+ async klineCandlestickData(requestParameters) {
820
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.klineCandlestickData(
821
+ requestParameters?.symbol,
822
+ requestParameters?.interval,
823
+ requestParameters?.startTime,
824
+ requestParameters?.endTime,
825
+ requestParameters?.limit
826
+ );
827
+ return sendRequest2(
828
+ this.configuration,
829
+ localVarAxiosArgs.endpoint,
830
+ localVarAxiosArgs.method,
831
+ localVarAxiosArgs.params,
832
+ localVarAxiosArgs?.timeUnit,
833
+ { isSigned: false }
834
+ );
835
+ }
836
+ /**
837
+ * Get older market historical trades.
838
+ *
839
+ * Weight: 20
840
+ *
841
+ * @summary Old Trades Lookup (MARKET_DATA)
842
+ * @param {OldTradesLookupRequest} requestParameters Request parameters.
843
+ * @returns {Promise<RestApiResponse<OldTradesLookupResponse>>}
844
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
845
+ * @memberof MarketDataApi
846
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup Binance API Documentation}
847
+ */
848
+ async oldTradesLookup(requestParameters) {
849
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.oldTradesLookup(
850
+ requestParameters?.symbol,
851
+ requestParameters?.fromId,
852
+ requestParameters?.limit
853
+ );
854
+ return sendRequest2(
855
+ this.configuration,
856
+ localVarAxiosArgs.endpoint,
857
+ localVarAxiosArgs.method,
858
+ localVarAxiosArgs.params,
859
+ localVarAxiosArgs?.timeUnit,
860
+ { isSigned: false }
861
+ );
862
+ }
863
+ /**
864
+ * Get open interest for specific underlying asset on specific expiration date.
865
+ *
866
+ * Weight: 0
867
+ *
868
+ * @summary Open Interest
869
+ * @param {OpenInterestRequest} requestParameters Request parameters.
870
+ * @returns {Promise<RestApiResponse<OpenInterestResponse>>}
871
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
872
+ * @memberof MarketDataApi
873
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest Binance API Documentation}
874
+ */
875
+ async openInterest(requestParameters) {
876
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.openInterest(
877
+ requestParameters?.underlyingAsset,
878
+ requestParameters?.expiration
879
+ );
880
+ return sendRequest2(
881
+ this.configuration,
882
+ localVarAxiosArgs.endpoint,
883
+ localVarAxiosArgs.method,
884
+ localVarAxiosArgs.params,
885
+ localVarAxiosArgs?.timeUnit,
886
+ { isSigned: false }
887
+ );
888
+ }
889
+ /**
890
+ * Option mark price and greek info.
891
+ *
892
+ * Weight: 5
893
+ *
894
+ * @summary Option Mark Price
895
+ * @param {OptionMarkPriceRequest} requestParameters Request parameters.
896
+ * @returns {Promise<RestApiResponse<OptionMarkPriceResponse>>}
897
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
898
+ * @memberof MarketDataApi
899
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price Binance API Documentation}
900
+ */
901
+ async optionMarkPrice(requestParameters = {}) {
902
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.optionMarkPrice(
903
+ requestParameters?.symbol
904
+ );
905
+ return sendRequest2(
906
+ this.configuration,
907
+ localVarAxiosArgs.endpoint,
908
+ localVarAxiosArgs.method,
909
+ localVarAxiosArgs.params,
910
+ localVarAxiosArgs?.timeUnit,
911
+ { isSigned: false }
912
+ );
913
+ }
914
+ /**
915
+ * Check orderbook depth on specific symbol
916
+ *
917
+ * Weight: limit | weight
918
+ * ------------ | ------------
919
+ * 5, 10, 20, 50 | 2
920
+ * 100 | 5
921
+ * 500 | 10
922
+ * 1000 | 20
923
+ *
924
+ * @summary Order Book
925
+ * @param {OrderBookRequest} requestParameters Request parameters.
926
+ * @returns {Promise<RestApiResponse<OrderBookResponse>>}
927
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
928
+ * @memberof MarketDataApi
929
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Order-Book Binance API Documentation}
930
+ */
931
+ async orderBook(requestParameters) {
932
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.orderBook(
933
+ requestParameters?.symbol,
934
+ requestParameters?.limit
935
+ );
936
+ return sendRequest2(
937
+ this.configuration,
938
+ localVarAxiosArgs.endpoint,
939
+ localVarAxiosArgs.method,
940
+ localVarAxiosArgs.params,
941
+ localVarAxiosArgs?.timeUnit,
942
+ { isSigned: false }
943
+ );
944
+ }
945
+ /**
946
+ * Get recent block trades
947
+ *
948
+ * Weight: 5
949
+ *
950
+ * @summary Recent Block Trades List
951
+ * @param {RecentBlockTradesListRequest} requestParameters Request parameters.
952
+ * @returns {Promise<RestApiResponse<RecentBlockTradesListResponse>>}
953
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
954
+ * @memberof MarketDataApi
955
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Recent-Block-Trade-List Binance API Documentation}
956
+ */
957
+ async recentBlockTradesList(requestParameters = {}) {
958
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.recentBlockTradesList(
959
+ requestParameters?.symbol,
960
+ requestParameters?.limit
961
+ );
962
+ return sendRequest2(
963
+ this.configuration,
964
+ localVarAxiosArgs.endpoint,
965
+ localVarAxiosArgs.method,
966
+ localVarAxiosArgs.params,
967
+ localVarAxiosArgs?.timeUnit,
968
+ { isSigned: false }
969
+ );
970
+ }
971
+ /**
972
+ * Get recent market trades
973
+ *
974
+ * Weight: 5
975
+ *
976
+ * @summary Recent Trades List
977
+ * @param {RecentTradesListRequest} requestParameters Request parameters.
978
+ * @returns {Promise<RestApiResponse<RecentTradesListResponse>>}
979
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
980
+ * @memberof MarketDataApi
981
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List Binance API Documentation}
982
+ */
983
+ async recentTradesList(requestParameters) {
984
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.recentTradesList(
985
+ requestParameters?.symbol,
986
+ requestParameters?.limit
987
+ );
988
+ return sendRequest2(
989
+ this.configuration,
990
+ localVarAxiosArgs.endpoint,
991
+ localVarAxiosArgs.method,
992
+ localVarAxiosArgs.params,
993
+ localVarAxiosArgs?.timeUnit,
994
+ { isSigned: false }
995
+ );
996
+ }
997
+ /**
998
+ * Get spot index price for option underlying.
999
+ *
1000
+ * Weight: 1
1001
+ *
1002
+ * @summary Symbol Price Ticker
1003
+ * @param {SymbolPriceTickerRequest} requestParameters Request parameters.
1004
+ * @returns {Promise<RestApiResponse<SymbolPriceTickerResponse>>}
1005
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1006
+ * @memberof MarketDataApi
1007
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Symbol-Price-Ticker Binance API Documentation}
1008
+ */
1009
+ async symbolPriceTicker(requestParameters) {
1010
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.symbolPriceTicker(
1011
+ requestParameters?.underlying
1012
+ );
1013
+ return sendRequest2(
1014
+ this.configuration,
1015
+ localVarAxiosArgs.endpoint,
1016
+ localVarAxiosArgs.method,
1017
+ localVarAxiosArgs.params,
1018
+ localVarAxiosArgs?.timeUnit,
1019
+ { isSigned: false }
1020
+ );
1021
+ }
1022
+ /**
1023
+ * Test connectivity to the Rest API.
1024
+ *
1025
+ * Weight: 1
1026
+ *
1027
+ * @summary Test Connectivity
1028
+ * @returns {Promise<RestApiResponse<void>>}
1029
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1030
+ * @memberof MarketDataApi
1031
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Test-Connectivity Binance API Documentation}
1032
+ */
1033
+ async testConnectivity() {
1034
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.testConnectivity();
1035
+ return sendRequest2(
1036
+ this.configuration,
1037
+ localVarAxiosArgs.endpoint,
1038
+ localVarAxiosArgs.method,
1039
+ localVarAxiosArgs.params,
1040
+ localVarAxiosArgs?.timeUnit,
1041
+ { isSigned: false }
1042
+ );
1043
+ }
1044
+ /**
1045
+ * 24 hour rolling window price change statistics.
1046
+ *
1047
+ * Weight: 5
1048
+ *
1049
+ * @summary 24hr Ticker Price Change Statistics
1050
+ * @param {Ticker24hrPriceChangeStatisticsRequest} requestParameters Request parameters.
1051
+ * @returns {Promise<RestApiResponse<Ticker24hrPriceChangeStatisticsResponse>>}
1052
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1053
+ * @memberof MarketDataApi
1054
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics Binance API Documentation}
1055
+ */
1056
+ async ticker24hrPriceChangeStatistics(requestParameters = {}) {
1057
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.ticker24hrPriceChangeStatistics(
1058
+ requestParameters?.symbol
1059
+ );
1060
+ return sendRequest2(
1061
+ this.configuration,
1062
+ localVarAxiosArgs.endpoint,
1063
+ localVarAxiosArgs.method,
1064
+ localVarAxiosArgs.params,
1065
+ localVarAxiosArgs?.timeUnit,
1066
+ { isSigned: false }
1067
+ );
1068
+ }
1069
+ };
1070
+
1071
+ // src/rest-api/modules/market-maker-block-trade-api.ts
1072
+ import {
1073
+ assertParamExists as assertParamExists3,
1074
+ sendRequest as sendRequest3
1075
+ } from "@binance/common";
1076
+ var MarketMakerBlockTradeApiAxiosParamCreator = function(configuration) {
1077
+ return {
1078
+ /**
1079
+ * Accept a block trade order
1080
+ *
1081
+ * Weight: 5
1082
+ *
1083
+ * @summary Accept Block Trade Order (TRADE)
1084
+ * @param {string} blockOrderMatchingKey
1085
+ * @param {number} [recvWindow]
1086
+ *
1087
+ * @throws {RequiredError}
1088
+ */
1089
+ acceptBlockTradeOrder: async (blockOrderMatchingKey, recvWindow) => {
1090
+ assertParamExists3(
1091
+ "acceptBlockTradeOrder",
1092
+ "blockOrderMatchingKey",
1093
+ blockOrderMatchingKey
1094
+ );
1095
+ const localVarQueryParameter = {};
1096
+ if (blockOrderMatchingKey !== void 0 && blockOrderMatchingKey !== null) {
1097
+ localVarQueryParameter["blockOrderMatchingKey"] = blockOrderMatchingKey;
1098
+ }
1099
+ if (recvWindow !== void 0 && recvWindow !== null) {
1100
+ localVarQueryParameter["recvWindow"] = recvWindow;
1101
+ }
1102
+ let _timeUnit;
1103
+ if ("timeUnit" in configuration)
1104
+ _timeUnit = configuration.timeUnit;
1105
+ return {
1106
+ endpoint: "/eapi/v1/block/order/execute",
1107
+ method: "POST",
1108
+ params: localVarQueryParameter,
1109
+ timeUnit: _timeUnit
1110
+ };
1111
+ },
1112
+ /**
1113
+ * Gets block trades for a specific account.
1114
+ *
1115
+ * Weight: 5
1116
+ *
1117
+ * @summary Account Block Trade List (USER_DATA)
1118
+ * @param {number} [endTime] End Time, e.g 1593512200000
1119
+ * @param {number} [startTime] Start Time, e.g 1593511200000
1120
+ * @param {string} [underlying] underlying, e.g BTCUSDT
1121
+ * @param {number} [recvWindow]
1122
+ *
1123
+ * @throws {RequiredError}
1124
+ */
1125
+ accountBlockTradeList: async (endTime, startTime, underlying, recvWindow) => {
1126
+ const localVarQueryParameter = {};
1127
+ if (endTime !== void 0 && endTime !== null) {
1128
+ localVarQueryParameter["endTime"] = endTime;
1129
+ }
1130
+ if (startTime !== void 0 && startTime !== null) {
1131
+ localVarQueryParameter["startTime"] = startTime;
1132
+ }
1133
+ if (underlying !== void 0 && underlying !== null) {
1134
+ localVarQueryParameter["underlying"] = underlying;
1135
+ }
1136
+ if (recvWindow !== void 0 && recvWindow !== null) {
1137
+ localVarQueryParameter["recvWindow"] = recvWindow;
1138
+ }
1139
+ let _timeUnit;
1140
+ if ("timeUnit" in configuration)
1141
+ _timeUnit = configuration.timeUnit;
1142
+ return {
1143
+ endpoint: "/eapi/v1/block/user-trades",
1144
+ method: "GET",
1145
+ params: localVarQueryParameter,
1146
+ timeUnit: _timeUnit
1147
+ };
1148
+ },
1149
+ /**
1150
+ * Cancel a block trade order.
1151
+ *
1152
+ * Weight: 5
1153
+ *
1154
+ * @summary Cancel Block Trade Order (TRADE)
1155
+ * @param {string} blockOrderMatchingKey
1156
+ * @param {number} [recvWindow]
1157
+ *
1158
+ * @throws {RequiredError}
1159
+ */
1160
+ cancelBlockTradeOrder: async (blockOrderMatchingKey, recvWindow) => {
1161
+ assertParamExists3(
1162
+ "cancelBlockTradeOrder",
1163
+ "blockOrderMatchingKey",
1164
+ blockOrderMatchingKey
1165
+ );
1166
+ const localVarQueryParameter = {};
1167
+ if (blockOrderMatchingKey !== void 0 && blockOrderMatchingKey !== null) {
1168
+ localVarQueryParameter["blockOrderMatchingKey"] = blockOrderMatchingKey;
1169
+ }
1170
+ if (recvWindow !== void 0 && recvWindow !== null) {
1171
+ localVarQueryParameter["recvWindow"] = recvWindow;
1172
+ }
1173
+ let _timeUnit;
1174
+ if ("timeUnit" in configuration)
1175
+ _timeUnit = configuration.timeUnit;
1176
+ return {
1177
+ endpoint: "/eapi/v1/block/order/create",
1178
+ method: "DELETE",
1179
+ params: localVarQueryParameter,
1180
+ timeUnit: _timeUnit
1181
+ };
1182
+ },
1183
+ /**
1184
+ * Extends a block trade expire time by 30 mins from the current time.
1185
+ *
1186
+ * Weight: 5
1187
+ *
1188
+ * @summary Extend Block Trade Order (TRADE)
1189
+ * @param {string} blockOrderMatchingKey
1190
+ * @param {number} [recvWindow]
1191
+ *
1192
+ * @throws {RequiredError}
1193
+ */
1194
+ extendBlockTradeOrder: async (blockOrderMatchingKey, recvWindow) => {
1195
+ assertParamExists3(
1196
+ "extendBlockTradeOrder",
1197
+ "blockOrderMatchingKey",
1198
+ blockOrderMatchingKey
1199
+ );
1200
+ const localVarQueryParameter = {};
1201
+ if (blockOrderMatchingKey !== void 0 && blockOrderMatchingKey !== null) {
1202
+ localVarQueryParameter["blockOrderMatchingKey"] = blockOrderMatchingKey;
1203
+ }
1204
+ if (recvWindow !== void 0 && recvWindow !== null) {
1205
+ localVarQueryParameter["recvWindow"] = recvWindow;
1206
+ }
1207
+ let _timeUnit;
1208
+ if ("timeUnit" in configuration)
1209
+ _timeUnit = configuration.timeUnit;
1210
+ return {
1211
+ endpoint: "/eapi/v1/block/order/create",
1212
+ method: "PUT",
1213
+ params: localVarQueryParameter,
1214
+ timeUnit: _timeUnit
1215
+ };
1216
+ },
1217
+ /**
1218
+ * Send in a new block trade order.
1219
+ *
1220
+ * Weight: 5
1221
+ *
1222
+ * @summary New Block Trade Order (TRADE)
1223
+ * @param {string} liquidity Taker or Maker
1224
+ * @param {Array<object>} legs Max 1 (only single leg supported), list of legs parameters in JSON; example: eapi/v1/block/order/create?orders=[{"symbol":"BTC-210115-35000-C", "price":"100","quantity":"0.0002","side":"BUY","type":"LIMIT"}]
1225
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
1226
+ * @param {NewBlockTradeOrderSideEnum} side BUY or SELL
1227
+ * @param {number} price Order Price
1228
+ * @param {number} quantity Order Quantity
1229
+ * @param {number} [recvWindow]
1230
+ *
1231
+ * @throws {RequiredError}
1232
+ */
1233
+ newBlockTradeOrder: async (liquidity, legs, symbol, side, price, quantity, recvWindow) => {
1234
+ assertParamExists3("newBlockTradeOrder", "liquidity", liquidity);
1235
+ assertParamExists3("newBlockTradeOrder", "legs", legs);
1236
+ assertParamExists3("newBlockTradeOrder", "symbol", symbol);
1237
+ assertParamExists3("newBlockTradeOrder", "side", side);
1238
+ assertParamExists3("newBlockTradeOrder", "price", price);
1239
+ assertParamExists3("newBlockTradeOrder", "quantity", quantity);
1240
+ const localVarQueryParameter = {};
1241
+ if (liquidity !== void 0 && liquidity !== null) {
1242
+ localVarQueryParameter["liquidity"] = liquidity;
1243
+ }
1244
+ if (legs) {
1245
+ localVarQueryParameter["legs"] = legs;
1246
+ }
1247
+ if (symbol !== void 0 && symbol !== null) {
1248
+ localVarQueryParameter["symbol"] = symbol;
1249
+ }
1250
+ if (side !== void 0 && side !== null) {
1251
+ localVarQueryParameter["side"] = side;
1252
+ }
1253
+ if (price !== void 0 && price !== null) {
1254
+ localVarQueryParameter["price"] = price;
1255
+ }
1256
+ if (quantity !== void 0 && quantity !== null) {
1257
+ localVarQueryParameter["quantity"] = quantity;
1258
+ }
1259
+ if (recvWindow !== void 0 && recvWindow !== null) {
1260
+ localVarQueryParameter["recvWindow"] = recvWindow;
1261
+ }
1262
+ let _timeUnit;
1263
+ if ("timeUnit" in configuration)
1264
+ _timeUnit = configuration.timeUnit;
1265
+ return {
1266
+ endpoint: "/eapi/v1/block/order/create",
1267
+ method: "POST",
1268
+ params: localVarQueryParameter,
1269
+ timeUnit: _timeUnit
1270
+ };
1271
+ },
1272
+ /**
1273
+ * Query block trade details; returns block trade details from counterparty's perspective.
1274
+ *
1275
+ * Weight: 5
1276
+ *
1277
+ * @summary Query Block Trade Details (USER_DATA)
1278
+ * @param {string} blockOrderMatchingKey
1279
+ * @param {number} [recvWindow]
1280
+ *
1281
+ * @throws {RequiredError}
1282
+ */
1283
+ queryBlockTradeDetails: async (blockOrderMatchingKey, recvWindow) => {
1284
+ assertParamExists3(
1285
+ "queryBlockTradeDetails",
1286
+ "blockOrderMatchingKey",
1287
+ blockOrderMatchingKey
1288
+ );
1289
+ const localVarQueryParameter = {};
1290
+ if (blockOrderMatchingKey !== void 0 && blockOrderMatchingKey !== null) {
1291
+ localVarQueryParameter["blockOrderMatchingKey"] = blockOrderMatchingKey;
1292
+ }
1293
+ if (recvWindow !== void 0 && recvWindow !== null) {
1294
+ localVarQueryParameter["recvWindow"] = recvWindow;
1295
+ }
1296
+ let _timeUnit;
1297
+ if ("timeUnit" in configuration)
1298
+ _timeUnit = configuration.timeUnit;
1299
+ return {
1300
+ endpoint: "/eapi/v1/block/order/execute",
1301
+ method: "GET",
1302
+ params: localVarQueryParameter,
1303
+ timeUnit: _timeUnit
1304
+ };
1305
+ },
1306
+ /**
1307
+ * Check block trade order status.
1308
+ *
1309
+ * Weight: 5
1310
+ *
1311
+ * @summary Query Block Trade Order (TRADE)
1312
+ * @param {string} [blockOrderMatchingKey] If specified, returns the specific block trade associated with the blockOrderMatchingKey
1313
+ * @param {number} [endTime] End Time, e.g 1593512200000
1314
+ * @param {number} [startTime] Start Time, e.g 1593511200000
1315
+ * @param {string} [underlying] underlying, e.g BTCUSDT
1316
+ * @param {number} [recvWindow]
1317
+ *
1318
+ * @throws {RequiredError}
1319
+ */
1320
+ queryBlockTradeOrder: async (blockOrderMatchingKey, endTime, startTime, underlying, recvWindow) => {
1321
+ const localVarQueryParameter = {};
1322
+ if (blockOrderMatchingKey !== void 0 && blockOrderMatchingKey !== null) {
1323
+ localVarQueryParameter["blockOrderMatchingKey"] = blockOrderMatchingKey;
1324
+ }
1325
+ if (endTime !== void 0 && endTime !== null) {
1326
+ localVarQueryParameter["endTime"] = endTime;
1327
+ }
1328
+ if (startTime !== void 0 && startTime !== null) {
1329
+ localVarQueryParameter["startTime"] = startTime;
1330
+ }
1331
+ if (underlying !== void 0 && underlying !== null) {
1332
+ localVarQueryParameter["underlying"] = underlying;
1333
+ }
1334
+ if (recvWindow !== void 0 && recvWindow !== null) {
1335
+ localVarQueryParameter["recvWindow"] = recvWindow;
1336
+ }
1337
+ let _timeUnit;
1338
+ if ("timeUnit" in configuration)
1339
+ _timeUnit = configuration.timeUnit;
1340
+ return {
1341
+ endpoint: "/eapi/v1/block/order/orders",
1342
+ method: "GET",
1343
+ params: localVarQueryParameter,
1344
+ timeUnit: _timeUnit
1345
+ };
1346
+ }
1347
+ };
1348
+ };
1349
+ var MarketMakerBlockTradeApi = class {
1350
+ constructor(configuration) {
1351
+ this.configuration = configuration;
1352
+ this.localVarAxiosParamCreator = MarketMakerBlockTradeApiAxiosParamCreator(configuration);
1353
+ }
1354
+ /**
1355
+ * Accept a block trade order
1356
+ *
1357
+ * Weight: 5
1358
+ *
1359
+ * @summary Accept Block Trade Order (TRADE)
1360
+ * @param {AcceptBlockTradeOrderRequest} requestParameters Request parameters.
1361
+ * @returns {Promise<RestApiResponse<AcceptBlockTradeOrderResponse>>}
1362
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1363
+ * @memberof MarketMakerBlockTradeApi
1364
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Accept-Block-Trade-Order Binance API Documentation}
1365
+ */
1366
+ async acceptBlockTradeOrder(requestParameters) {
1367
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.acceptBlockTradeOrder(
1368
+ requestParameters?.blockOrderMatchingKey,
1369
+ requestParameters?.recvWindow
1370
+ );
1371
+ return sendRequest3(
1372
+ this.configuration,
1373
+ localVarAxiosArgs.endpoint,
1374
+ localVarAxiosArgs.method,
1375
+ localVarAxiosArgs.params,
1376
+ localVarAxiosArgs?.timeUnit,
1377
+ { isSigned: true }
1378
+ );
1379
+ }
1380
+ /**
1381
+ * Gets block trades for a specific account.
1382
+ *
1383
+ * Weight: 5
1384
+ *
1385
+ * @summary Account Block Trade List (USER_DATA)
1386
+ * @param {AccountBlockTradeListRequest} requestParameters Request parameters.
1387
+ * @returns {Promise<RestApiResponse<AccountBlockTradeListResponse>>}
1388
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1389
+ * @memberof MarketMakerBlockTradeApi
1390
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Account-Block-Trade-List Binance API Documentation}
1391
+ */
1392
+ async accountBlockTradeList(requestParameters = {}) {
1393
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountBlockTradeList(
1394
+ requestParameters?.endTime,
1395
+ requestParameters?.startTime,
1396
+ requestParameters?.underlying,
1397
+ requestParameters?.recvWindow
1398
+ );
1399
+ return sendRequest3(
1400
+ this.configuration,
1401
+ localVarAxiosArgs.endpoint,
1402
+ localVarAxiosArgs.method,
1403
+ localVarAxiosArgs.params,
1404
+ localVarAxiosArgs?.timeUnit,
1405
+ { isSigned: true }
1406
+ );
1407
+ }
1408
+ /**
1409
+ * Cancel a block trade order.
1410
+ *
1411
+ * Weight: 5
1412
+ *
1413
+ * @summary Cancel Block Trade Order (TRADE)
1414
+ * @param {CancelBlockTradeOrderRequest} requestParameters Request parameters.
1415
+ * @returns {Promise<RestApiResponse<void>>}
1416
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1417
+ * @memberof MarketMakerBlockTradeApi
1418
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Cancel-Block-Trade-Order Binance API Documentation}
1419
+ */
1420
+ async cancelBlockTradeOrder(requestParameters) {
1421
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelBlockTradeOrder(
1422
+ requestParameters?.blockOrderMatchingKey,
1423
+ requestParameters?.recvWindow
1424
+ );
1425
+ return sendRequest3(
1426
+ this.configuration,
1427
+ localVarAxiosArgs.endpoint,
1428
+ localVarAxiosArgs.method,
1429
+ localVarAxiosArgs.params,
1430
+ localVarAxiosArgs?.timeUnit,
1431
+ { isSigned: true }
1432
+ );
1433
+ }
1434
+ /**
1435
+ * Extends a block trade expire time by 30 mins from the current time.
1436
+ *
1437
+ * Weight: 5
1438
+ *
1439
+ * @summary Extend Block Trade Order (TRADE)
1440
+ * @param {ExtendBlockTradeOrderRequest} requestParameters Request parameters.
1441
+ * @returns {Promise<RestApiResponse<ExtendBlockTradeOrderResponse>>}
1442
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1443
+ * @memberof MarketMakerBlockTradeApi
1444
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Extend-Block-Trade-Order Binance API Documentation}
1445
+ */
1446
+ async extendBlockTradeOrder(requestParameters) {
1447
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.extendBlockTradeOrder(
1448
+ requestParameters?.blockOrderMatchingKey,
1449
+ requestParameters?.recvWindow
1450
+ );
1451
+ return sendRequest3(
1452
+ this.configuration,
1453
+ localVarAxiosArgs.endpoint,
1454
+ localVarAxiosArgs.method,
1455
+ localVarAxiosArgs.params,
1456
+ localVarAxiosArgs?.timeUnit,
1457
+ { isSigned: true }
1458
+ );
1459
+ }
1460
+ /**
1461
+ * Send in a new block trade order.
1462
+ *
1463
+ * Weight: 5
1464
+ *
1465
+ * @summary New Block Trade Order (TRADE)
1466
+ * @param {NewBlockTradeOrderRequest} requestParameters Request parameters.
1467
+ * @returns {Promise<RestApiResponse<NewBlockTradeOrderResponse>>}
1468
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1469
+ * @memberof MarketMakerBlockTradeApi
1470
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/New-Block-Trade-Order Binance API Documentation}
1471
+ */
1472
+ async newBlockTradeOrder(requestParameters) {
1473
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.newBlockTradeOrder(
1474
+ requestParameters?.liquidity,
1475
+ requestParameters?.legs,
1476
+ requestParameters?.symbol,
1477
+ requestParameters?.side,
1478
+ requestParameters?.price,
1479
+ requestParameters?.quantity,
1480
+ requestParameters?.recvWindow
1481
+ );
1482
+ return sendRequest3(
1483
+ this.configuration,
1484
+ localVarAxiosArgs.endpoint,
1485
+ localVarAxiosArgs.method,
1486
+ localVarAxiosArgs.params,
1487
+ localVarAxiosArgs?.timeUnit,
1488
+ { isSigned: true }
1489
+ );
1490
+ }
1491
+ /**
1492
+ * Query block trade details; returns block trade details from counterparty's perspective.
1493
+ *
1494
+ * Weight: 5
1495
+ *
1496
+ * @summary Query Block Trade Details (USER_DATA)
1497
+ * @param {QueryBlockTradeDetailsRequest} requestParameters Request parameters.
1498
+ * @returns {Promise<RestApiResponse<QueryBlockTradeDetailsResponse>>}
1499
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1500
+ * @memberof MarketMakerBlockTradeApi
1501
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Query-Block-Trade-Detail Binance API Documentation}
1502
+ */
1503
+ async queryBlockTradeDetails(requestParameters) {
1504
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryBlockTradeDetails(
1505
+ requestParameters?.blockOrderMatchingKey,
1506
+ requestParameters?.recvWindow
1507
+ );
1508
+ return sendRequest3(
1509
+ this.configuration,
1510
+ localVarAxiosArgs.endpoint,
1511
+ localVarAxiosArgs.method,
1512
+ localVarAxiosArgs.params,
1513
+ localVarAxiosArgs?.timeUnit,
1514
+ { isSigned: true }
1515
+ );
1516
+ }
1517
+ /**
1518
+ * Check block trade order status.
1519
+ *
1520
+ * Weight: 5
1521
+ *
1522
+ * @summary Query Block Trade Order (TRADE)
1523
+ * @param {QueryBlockTradeOrderRequest} requestParameters Request parameters.
1524
+ * @returns {Promise<RestApiResponse<QueryBlockTradeOrderResponse>>}
1525
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1526
+ * @memberof MarketMakerBlockTradeApi
1527
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Query-Block-Trade-Order Binance API Documentation}
1528
+ */
1529
+ async queryBlockTradeOrder(requestParameters = {}) {
1530
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryBlockTradeOrder(
1531
+ requestParameters?.blockOrderMatchingKey,
1532
+ requestParameters?.endTime,
1533
+ requestParameters?.startTime,
1534
+ requestParameters?.underlying,
1535
+ requestParameters?.recvWindow
1536
+ );
1537
+ return sendRequest3(
1538
+ this.configuration,
1539
+ localVarAxiosArgs.endpoint,
1540
+ localVarAxiosArgs.method,
1541
+ localVarAxiosArgs.params,
1542
+ localVarAxiosArgs?.timeUnit,
1543
+ { isSigned: true }
1544
+ );
1545
+ }
1546
+ };
1547
+ var NewBlockTradeOrderSideEnum = {
1548
+ BUY: "BUY",
1549
+ SELL: "SELL"
1550
+ };
1551
+
1552
+ // src/rest-api/modules/market-maker-endpoints-api.ts
1553
+ import {
1554
+ assertParamExists as assertParamExists4,
1555
+ sendRequest as sendRequest4
1556
+ } from "@binance/common";
1557
+ var MarketMakerEndpointsApiAxiosParamCreator = function(configuration) {
1558
+ return {
1559
+ /**
1560
+ * This endpoint resets the time from which the countdown will begin to the time this messaged is received. It should be called repeatedly as heartbeats. Multiple heartbeats can be updated at once by specifying the underlying symbols as a list (ex. BTCUSDT,ETHUSDT) in the underlyings parameter.
1561
+ *
1562
+ * The response will only include underlying symbols where the heartbeat has been successfully updated.
1563
+ *
1564
+ * Weight: 10
1565
+ *
1566
+ * @summary Auto-Cancel All Open Orders (Kill-Switch) Heartbeat (TRADE)
1567
+ * @param {string} underlyings Option Underlying Symbols, e.g BTCUSDT,ETHUSDT
1568
+ * @param {number} [recvWindow]
1569
+ *
1570
+ * @throws {RequiredError}
1571
+ */
1572
+ autoCancelAllOpenOrders: async (underlyings, recvWindow) => {
1573
+ assertParamExists4("autoCancelAllOpenOrders", "underlyings", underlyings);
1574
+ const localVarQueryParameter = {};
1575
+ if (underlyings !== void 0 && underlyings !== null) {
1576
+ localVarQueryParameter["underlyings"] = underlyings;
1577
+ }
1578
+ if (recvWindow !== void 0 && recvWindow !== null) {
1579
+ localVarQueryParameter["recvWindow"] = recvWindow;
1580
+ }
1581
+ let _timeUnit;
1582
+ if ("timeUnit" in configuration)
1583
+ _timeUnit = configuration.timeUnit;
1584
+ return {
1585
+ endpoint: "/eapi/v1/countdownCancelAllHeartBeat",
1586
+ method: "POST",
1587
+ params: localVarQueryParameter,
1588
+ timeUnit: _timeUnit
1589
+ };
1590
+ },
1591
+ /**
1592
+ * This endpoint returns the auto-cancel parameters for each underlying symbol. Note only active auto-cancel parameters will be returned, if countdownTime is set to 0 (ie. countdownTime has been turned off), the underlying symbol and corresponding countdownTime parameter will not be returned in the response.
1593
+ *
1594
+ * countdownTime = 0 means the function is disabled.
1595
+ *
1596
+ * Weight: 1
1597
+ *
1598
+ * @summary Get Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE)
1599
+ * @param {string} [underlying] underlying, e.g BTCUSDT
1600
+ * @param {number} [recvWindow]
1601
+ *
1602
+ * @throws {RequiredError}
1603
+ */
1604
+ getAutoCancelAllOpenOrders: async (underlying, recvWindow) => {
1605
+ const localVarQueryParameter = {};
1606
+ if (underlying !== void 0 && underlying !== null) {
1607
+ localVarQueryParameter["underlying"] = underlying;
1608
+ }
1609
+ if (recvWindow !== void 0 && recvWindow !== null) {
1610
+ localVarQueryParameter["recvWindow"] = recvWindow;
1611
+ }
1612
+ let _timeUnit;
1613
+ if ("timeUnit" in configuration)
1614
+ _timeUnit = configuration.timeUnit;
1615
+ return {
1616
+ endpoint: "/eapi/v1/countdownCancelAll",
1617
+ method: "GET",
1618
+ params: localVarQueryParameter,
1619
+ timeUnit: _timeUnit
1620
+ };
1621
+ },
1622
+ /**
1623
+ * Get config for MMP.
1624
+ *
1625
+ * Weight: 1
1626
+ *
1627
+ * @summary Get Market Maker Protection Config (TRADE)
1628
+ * @param {string} [underlying] underlying, e.g BTCUSDT
1629
+ * @param {number} [recvWindow]
1630
+ *
1631
+ * @throws {RequiredError}
1632
+ */
1633
+ getMarketMakerProtectionConfig: async (underlying, recvWindow) => {
1634
+ const localVarQueryParameter = {};
1635
+ if (underlying !== void 0 && underlying !== null) {
1636
+ localVarQueryParameter["underlying"] = underlying;
1637
+ }
1638
+ if (recvWindow !== void 0 && recvWindow !== null) {
1639
+ localVarQueryParameter["recvWindow"] = recvWindow;
1640
+ }
1641
+ let _timeUnit;
1642
+ if ("timeUnit" in configuration)
1643
+ _timeUnit = configuration.timeUnit;
1644
+ return {
1645
+ endpoint: "/eapi/v1/mmp",
1646
+ method: "GET",
1647
+ params: localVarQueryParameter,
1648
+ timeUnit: _timeUnit
1649
+ };
1650
+ },
1651
+ /**
1652
+ * Get current account information.
1653
+ *
1654
+ * Weight: 3
1655
+ *
1656
+ * @summary Option Margin Account Information (USER_DATA)
1657
+ * @param {number} [recvWindow]
1658
+ *
1659
+ * @throws {RequiredError}
1660
+ */
1661
+ optionMarginAccountInformation: async (recvWindow) => {
1662
+ const localVarQueryParameter = {};
1663
+ if (recvWindow !== void 0 && recvWindow !== null) {
1664
+ localVarQueryParameter["recvWindow"] = recvWindow;
1665
+ }
1666
+ let _timeUnit;
1667
+ if ("timeUnit" in configuration)
1668
+ _timeUnit = configuration.timeUnit;
1669
+ return {
1670
+ endpoint: "/eapi/v1/marginAccount",
1671
+ method: "GET",
1672
+ params: localVarQueryParameter,
1673
+ timeUnit: _timeUnit
1674
+ };
1675
+ },
1676
+ /**
1677
+ * Reset MMP, start MMP order again.
1678
+ *
1679
+ * Weight: 1
1680
+ *
1681
+ * @summary Reset Market Maker Protection Config (TRADE)
1682
+ * @param {string} [underlying] underlying, e.g BTCUSDT
1683
+ * @param {number} [recvWindow]
1684
+ *
1685
+ * @throws {RequiredError}
1686
+ */
1687
+ resetMarketMakerProtectionConfig: async (underlying, recvWindow) => {
1688
+ const localVarQueryParameter = {};
1689
+ if (underlying !== void 0 && underlying !== null) {
1690
+ localVarQueryParameter["underlying"] = underlying;
1691
+ }
1692
+ if (recvWindow !== void 0 && recvWindow !== null) {
1693
+ localVarQueryParameter["recvWindow"] = recvWindow;
1694
+ }
1695
+ let _timeUnit;
1696
+ if ("timeUnit" in configuration)
1697
+ _timeUnit = configuration.timeUnit;
1698
+ return {
1699
+ endpoint: "/eapi/v1/mmpReset",
1700
+ method: "POST",
1701
+ params: localVarQueryParameter,
1702
+ timeUnit: _timeUnit
1703
+ };
1704
+ },
1705
+ /**
1706
+ * This endpoint sets the parameters of the auto-cancel feature which cancels all open orders (both market maker protection and non market maker protection order types) of the underlying symbol at the end of the specified countdown time period if no heartbeat message is sent. After the countdown time period, all open orders will be cancelled and new orders will be rejected with error code -2010 until either a heartbeat message is sent or the auto-cancel feature is turned off by setting countdownTime to 0.
1707
+ *
1708
+ *
1709
+ * This rest endpoint sets up the parameters to cancel your open orders in case of an outage or disconnection.
1710
+ * Example usage:
1711
+ * Call this endpoint with a countdownTime value of 10000 (10 seconds) to turn on the auto-cancel feature. If the corresponding countdownCancelAllHeartBeat endpoint is not called within 10 seconds with the specified underlying symbol, all open orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped.
1712
+ * The system will check all countdowns approximately every 1000 milliseconds, **please note that sufficient redundancy should be considered when using this function**. We do not recommend setting the countdown time to be too precise or too small.
1713
+ *
1714
+ * Weight: 1
1715
+ *
1716
+ * @summary Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE)
1717
+ * @param {string} underlying Option underlying, e.g BTCUSDT
1718
+ * @param {number} countdownTime Countdown time in milliseconds (ex. 1,000 for 1 second). 0 to disable the timer. Negative values (ex. -10000) are not accepted. Minimum acceptable value is 5,000
1719
+ * @param {number} [recvWindow]
1720
+ *
1721
+ * @throws {RequiredError}
1722
+ */
1723
+ setAutoCancelAllOpenOrders: async (underlying, countdownTime, recvWindow) => {
1724
+ assertParamExists4("setAutoCancelAllOpenOrders", "underlying", underlying);
1725
+ assertParamExists4("setAutoCancelAllOpenOrders", "countdownTime", countdownTime);
1726
+ const localVarQueryParameter = {};
1727
+ if (underlying !== void 0 && underlying !== null) {
1728
+ localVarQueryParameter["underlying"] = underlying;
1729
+ }
1730
+ if (countdownTime !== void 0 && countdownTime !== null) {
1731
+ localVarQueryParameter["countdownTime"] = countdownTime;
1732
+ }
1733
+ if (recvWindow !== void 0 && recvWindow !== null) {
1734
+ localVarQueryParameter["recvWindow"] = recvWindow;
1735
+ }
1736
+ let _timeUnit;
1737
+ if ("timeUnit" in configuration)
1738
+ _timeUnit = configuration.timeUnit;
1739
+ return {
1740
+ endpoint: "/eapi/v1/countdownCancelAll",
1741
+ method: "POST",
1742
+ params: localVarQueryParameter,
1743
+ timeUnit: _timeUnit
1744
+ };
1745
+ },
1746
+ /**
1747
+ * Set config for MMP.
1748
+ * Market Maker Protection(MMP) is a set of protection mechanism for option market maker, this mechanism is able to prevent mass trading in short period time. Once market maker's account branches the threshold, the Market Maker Protection will be triggered. When Market Maker Protection triggers, all the current MMP orders will be canceled, new MMP orders will be rejected. Market maker can use this time to reevaluate market and modify order price.
1749
+ *
1750
+ * Weight: 1
1751
+ *
1752
+ * @summary Set Market Maker Protection Config (TRADE)
1753
+ * @param {string} [underlying] underlying, e.g BTCUSDT
1754
+ * @param {number} [windowTimeInMilliseconds] MMP Interval in milliseconds; Range (0,5000]
1755
+ * @param {number} [frozenTimeInMilliseconds] MMP frozen time in milliseconds, if set to 0 manual reset is required
1756
+ * @param {number} [qtyLimit] quantity limit
1757
+ * @param {number} [deltaLimit] net delta limit
1758
+ * @param {number} [recvWindow]
1759
+ *
1760
+ * @throws {RequiredError}
1761
+ */
1762
+ setMarketMakerProtectionConfig: async (underlying, windowTimeInMilliseconds, frozenTimeInMilliseconds, qtyLimit, deltaLimit, recvWindow) => {
1763
+ const localVarQueryParameter = {};
1764
+ if (underlying !== void 0 && underlying !== null) {
1765
+ localVarQueryParameter["underlying"] = underlying;
1766
+ }
1767
+ if (windowTimeInMilliseconds !== void 0 && windowTimeInMilliseconds !== null) {
1768
+ localVarQueryParameter["windowTimeInMilliseconds"] = windowTimeInMilliseconds;
1769
+ }
1770
+ if (frozenTimeInMilliseconds !== void 0 && frozenTimeInMilliseconds !== null) {
1771
+ localVarQueryParameter["frozenTimeInMilliseconds"] = frozenTimeInMilliseconds;
1772
+ }
1773
+ if (qtyLimit !== void 0 && qtyLimit !== null) {
1774
+ localVarQueryParameter["qtyLimit"] = qtyLimit;
1775
+ }
1776
+ if (deltaLimit !== void 0 && deltaLimit !== null) {
1777
+ localVarQueryParameter["deltaLimit"] = deltaLimit;
1778
+ }
1779
+ if (recvWindow !== void 0 && recvWindow !== null) {
1780
+ localVarQueryParameter["recvWindow"] = recvWindow;
1781
+ }
1782
+ let _timeUnit;
1783
+ if ("timeUnit" in configuration)
1784
+ _timeUnit = configuration.timeUnit;
1785
+ return {
1786
+ endpoint: "/eapi/v1/mmpSet",
1787
+ method: "POST",
1788
+ params: localVarQueryParameter,
1789
+ timeUnit: _timeUnit
1790
+ };
1791
+ }
1792
+ };
1793
+ };
1794
+ var MarketMakerEndpointsApi = class {
1795
+ constructor(configuration) {
1796
+ this.configuration = configuration;
1797
+ this.localVarAxiosParamCreator = MarketMakerEndpointsApiAxiosParamCreator(configuration);
1798
+ }
1799
+ /**
1800
+ * This endpoint resets the time from which the countdown will begin to the time this messaged is received. It should be called repeatedly as heartbeats. Multiple heartbeats can be updated at once by specifying the underlying symbols as a list (ex. BTCUSDT,ETHUSDT) in the underlyings parameter.
1801
+ *
1802
+ * The response will only include underlying symbols where the heartbeat has been successfully updated.
1803
+ *
1804
+ * Weight: 10
1805
+ *
1806
+ * @summary Auto-Cancel All Open Orders (Kill-Switch) Heartbeat (TRADE)
1807
+ * @param {AutoCancelAllOpenOrdersRequest} requestParameters Request parameters.
1808
+ * @returns {Promise<RestApiResponse<AutoCancelAllOpenOrdersResponse>>}
1809
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1810
+ * @memberof MarketMakerEndpointsApi
1811
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat Binance API Documentation}
1812
+ */
1813
+ async autoCancelAllOpenOrders(requestParameters) {
1814
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.autoCancelAllOpenOrders(
1815
+ requestParameters?.underlyings,
1816
+ requestParameters?.recvWindow
1817
+ );
1818
+ return sendRequest4(
1819
+ this.configuration,
1820
+ localVarAxiosArgs.endpoint,
1821
+ localVarAxiosArgs.method,
1822
+ localVarAxiosArgs.params,
1823
+ localVarAxiosArgs?.timeUnit,
1824
+ { isSigned: true }
1825
+ );
1826
+ }
1827
+ /**
1828
+ * This endpoint returns the auto-cancel parameters for each underlying symbol. Note only active auto-cancel parameters will be returned, if countdownTime is set to 0 (ie. countdownTime has been turned off), the underlying symbol and corresponding countdownTime parameter will not be returned in the response.
1829
+ *
1830
+ * countdownTime = 0 means the function is disabled.
1831
+ *
1832
+ * Weight: 1
1833
+ *
1834
+ * @summary Get Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE)
1835
+ * @param {GetAutoCancelAllOpenOrdersRequest} requestParameters Request parameters.
1836
+ * @returns {Promise<RestApiResponse<GetAutoCancelAllOpenOrdersResponse>>}
1837
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1838
+ * @memberof MarketMakerEndpointsApi
1839
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config Binance API Documentation}
1840
+ */
1841
+ async getAutoCancelAllOpenOrders(requestParameters = {}) {
1842
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getAutoCancelAllOpenOrders(
1843
+ requestParameters?.underlying,
1844
+ requestParameters?.recvWindow
1845
+ );
1846
+ return sendRequest4(
1847
+ this.configuration,
1848
+ localVarAxiosArgs.endpoint,
1849
+ localVarAxiosArgs.method,
1850
+ localVarAxiosArgs.params,
1851
+ localVarAxiosArgs?.timeUnit,
1852
+ { isSigned: true }
1853
+ );
1854
+ }
1855
+ /**
1856
+ * Get config for MMP.
1857
+ *
1858
+ * Weight: 1
1859
+ *
1860
+ * @summary Get Market Maker Protection Config (TRADE)
1861
+ * @param {GetMarketMakerProtectionConfigRequest} requestParameters Request parameters.
1862
+ * @returns {Promise<RestApiResponse<GetMarketMakerProtectionConfigResponse>>}
1863
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1864
+ * @memberof MarketMakerEndpointsApi
1865
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Get-Market-Maker-Protection-Config Binance API Documentation}
1866
+ */
1867
+ async getMarketMakerProtectionConfig(requestParameters = {}) {
1868
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getMarketMakerProtectionConfig(
1869
+ requestParameters?.underlying,
1870
+ requestParameters?.recvWindow
1871
+ );
1872
+ return sendRequest4(
1873
+ this.configuration,
1874
+ localVarAxiosArgs.endpoint,
1875
+ localVarAxiosArgs.method,
1876
+ localVarAxiosArgs.params,
1877
+ localVarAxiosArgs?.timeUnit,
1878
+ { isSigned: true }
1879
+ );
1880
+ }
1881
+ /**
1882
+ * Get current account information.
1883
+ *
1884
+ * Weight: 3
1885
+ *
1886
+ * @summary Option Margin Account Information (USER_DATA)
1887
+ * @param {OptionMarginAccountInformationRequest} requestParameters Request parameters.
1888
+ * @returns {Promise<RestApiResponse<OptionMarginAccountInformationResponse>>}
1889
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1890
+ * @memberof MarketMakerEndpointsApi
1891
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Option-Margin-Account-Information Binance API Documentation}
1892
+ */
1893
+ async optionMarginAccountInformation(requestParameters = {}) {
1894
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.optionMarginAccountInformation(
1895
+ requestParameters?.recvWindow
1896
+ );
1897
+ return sendRequest4(
1898
+ this.configuration,
1899
+ localVarAxiosArgs.endpoint,
1900
+ localVarAxiosArgs.method,
1901
+ localVarAxiosArgs.params,
1902
+ localVarAxiosArgs?.timeUnit,
1903
+ { isSigned: true }
1904
+ );
1905
+ }
1906
+ /**
1907
+ * Reset MMP, start MMP order again.
1908
+ *
1909
+ * Weight: 1
1910
+ *
1911
+ * @summary Reset Market Maker Protection Config (TRADE)
1912
+ * @param {ResetMarketMakerProtectionConfigRequest} requestParameters Request parameters.
1913
+ * @returns {Promise<RestApiResponse<ResetMarketMakerProtectionConfigResponse>>}
1914
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1915
+ * @memberof MarketMakerEndpointsApi
1916
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Reset-Market-Maker-Protection-Config Binance API Documentation}
1917
+ */
1918
+ async resetMarketMakerProtectionConfig(requestParameters = {}) {
1919
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.resetMarketMakerProtectionConfig(
1920
+ requestParameters?.underlying,
1921
+ requestParameters?.recvWindow
1922
+ );
1923
+ return sendRequest4(
1924
+ this.configuration,
1925
+ localVarAxiosArgs.endpoint,
1926
+ localVarAxiosArgs.method,
1927
+ localVarAxiosArgs.params,
1928
+ localVarAxiosArgs?.timeUnit,
1929
+ { isSigned: true }
1930
+ );
1931
+ }
1932
+ /**
1933
+ * This endpoint sets the parameters of the auto-cancel feature which cancels all open orders (both market maker protection and non market maker protection order types) of the underlying symbol at the end of the specified countdown time period if no heartbeat message is sent. After the countdown time period, all open orders will be cancelled and new orders will be rejected with error code -2010 until either a heartbeat message is sent or the auto-cancel feature is turned off by setting countdownTime to 0.
1934
+ *
1935
+ *
1936
+ * This rest endpoint sets up the parameters to cancel your open orders in case of an outage or disconnection.
1937
+ * Example usage:
1938
+ * Call this endpoint with a countdownTime value of 10000 (10 seconds) to turn on the auto-cancel feature. If the corresponding countdownCancelAllHeartBeat endpoint is not called within 10 seconds with the specified underlying symbol, all open orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped.
1939
+ * The system will check all countdowns approximately every 1000 milliseconds, **please note that sufficient redundancy should be considered when using this function**. We do not recommend setting the countdown time to be too precise or too small.
1940
+ *
1941
+ * Weight: 1
1942
+ *
1943
+ * @summary Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE)
1944
+ * @param {SetAutoCancelAllOpenOrdersRequest} requestParameters Request parameters.
1945
+ * @returns {Promise<RestApiResponse<SetAutoCancelAllOpenOrdersResponse>>}
1946
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1947
+ * @memberof MarketMakerEndpointsApi
1948
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config Binance API Documentation}
1949
+ */
1950
+ async setAutoCancelAllOpenOrders(requestParameters) {
1951
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.setAutoCancelAllOpenOrders(
1952
+ requestParameters?.underlying,
1953
+ requestParameters?.countdownTime,
1954
+ requestParameters?.recvWindow
1955
+ );
1956
+ return sendRequest4(
1957
+ this.configuration,
1958
+ localVarAxiosArgs.endpoint,
1959
+ localVarAxiosArgs.method,
1960
+ localVarAxiosArgs.params,
1961
+ localVarAxiosArgs?.timeUnit,
1962
+ { isSigned: true }
1963
+ );
1964
+ }
1965
+ /**
1966
+ * Set config for MMP.
1967
+ * Market Maker Protection(MMP) is a set of protection mechanism for option market maker, this mechanism is able to prevent mass trading in short period time. Once market maker's account branches the threshold, the Market Maker Protection will be triggered. When Market Maker Protection triggers, all the current MMP orders will be canceled, new MMP orders will be rejected. Market maker can use this time to reevaluate market and modify order price.
1968
+ *
1969
+ * Weight: 1
1970
+ *
1971
+ * @summary Set Market Maker Protection Config (TRADE)
1972
+ * @param {SetMarketMakerProtectionConfigRequest} requestParameters Request parameters.
1973
+ * @returns {Promise<RestApiResponse<SetMarketMakerProtectionConfigResponse>>}
1974
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1975
+ * @memberof MarketMakerEndpointsApi
1976
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Set-Market-Maker-Protection-Config Binance API Documentation}
1977
+ */
1978
+ async setMarketMakerProtectionConfig(requestParameters = {}) {
1979
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.setMarketMakerProtectionConfig(
1980
+ requestParameters?.underlying,
1981
+ requestParameters?.windowTimeInMilliseconds,
1982
+ requestParameters?.frozenTimeInMilliseconds,
1983
+ requestParameters?.qtyLimit,
1984
+ requestParameters?.deltaLimit,
1985
+ requestParameters?.recvWindow
1986
+ );
1987
+ return sendRequest4(
1988
+ this.configuration,
1989
+ localVarAxiosArgs.endpoint,
1990
+ localVarAxiosArgs.method,
1991
+ localVarAxiosArgs.params,
1992
+ localVarAxiosArgs?.timeUnit,
1993
+ { isSigned: true }
1994
+ );
1995
+ }
1996
+ };
1997
+
1998
+ // src/rest-api/modules/trade-api.ts
1999
+ import {
2000
+ assertParamExists as assertParamExists5,
2001
+ sendRequest as sendRequest5
2002
+ } from "@binance/common";
2003
+ var TradeApiAxiosParamCreator = function(configuration) {
2004
+ return {
2005
+ /**
2006
+ * Get trades for a specific account and symbol.
2007
+ *
2008
+ * Weight: 5
2009
+ *
2010
+ * @summary Account Trade List (USER_DATA)
2011
+ * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C
2012
+ * @param {number} [fromId] The UniqueId ID from which to return. The latest deal record is returned by default
2013
+ * @param {number} [startTime] Start Time, e.g 1593511200000
2014
+ * @param {number} [endTime] End Time, e.g 1593512200000
2015
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
2016
+ * @param {number} [recvWindow]
2017
+ *
2018
+ * @throws {RequiredError}
2019
+ */
2020
+ accountTradeList: async (symbol, fromId, startTime, endTime, limit, recvWindow) => {
2021
+ const localVarQueryParameter = {};
2022
+ if (symbol !== void 0 && symbol !== null) {
2023
+ localVarQueryParameter["symbol"] = symbol;
2024
+ }
2025
+ if (fromId !== void 0 && fromId !== null) {
2026
+ localVarQueryParameter["fromId"] = fromId;
2027
+ }
2028
+ if (startTime !== void 0 && startTime !== null) {
2029
+ localVarQueryParameter["startTime"] = startTime;
2030
+ }
2031
+ if (endTime !== void 0 && endTime !== null) {
2032
+ localVarQueryParameter["endTime"] = endTime;
2033
+ }
2034
+ if (limit !== void 0 && limit !== null) {
2035
+ localVarQueryParameter["limit"] = limit;
2036
+ }
2037
+ if (recvWindow !== void 0 && recvWindow !== null) {
2038
+ localVarQueryParameter["recvWindow"] = recvWindow;
2039
+ }
2040
+ let _timeUnit;
2041
+ if ("timeUnit" in configuration)
2042
+ _timeUnit = configuration.timeUnit;
2043
+ return {
2044
+ endpoint: "/eapi/v1/userTrades",
2045
+ method: "GET",
2046
+ params: localVarQueryParameter,
2047
+ timeUnit: _timeUnit
2048
+ };
2049
+ },
2050
+ /**
2051
+ * Cancel all active orders on specified underlying.
2052
+ *
2053
+ * Weight: 1
2054
+ *
2055
+ * @summary Cancel All Option Orders By Underlying (TRADE)
2056
+ * @param {string} underlying Option underlying, e.g BTCUSDT
2057
+ * @param {number} [recvWindow]
2058
+ *
2059
+ * @throws {RequiredError}
2060
+ */
2061
+ cancelAllOptionOrdersByUnderlying: async (underlying, recvWindow) => {
2062
+ assertParamExists5("cancelAllOptionOrdersByUnderlying", "underlying", underlying);
2063
+ const localVarQueryParameter = {};
2064
+ if (underlying !== void 0 && underlying !== null) {
2065
+ localVarQueryParameter["underlying"] = underlying;
2066
+ }
2067
+ if (recvWindow !== void 0 && recvWindow !== null) {
2068
+ localVarQueryParameter["recvWindow"] = recvWindow;
2069
+ }
2070
+ let _timeUnit;
2071
+ if ("timeUnit" in configuration)
2072
+ _timeUnit = configuration.timeUnit;
2073
+ return {
2074
+ endpoint: "/eapi/v1/allOpenOrdersByUnderlying",
2075
+ method: "DELETE",
2076
+ params: localVarQueryParameter,
2077
+ timeUnit: _timeUnit
2078
+ };
2079
+ },
2080
+ /**
2081
+ * Cancel all active order on a symbol.
2082
+ *
2083
+ * Weight: 1
2084
+ *
2085
+ * @summary Cancel all Option orders on specific symbol (TRADE)
2086
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
2087
+ * @param {number} [recvWindow]
2088
+ *
2089
+ * @throws {RequiredError}
2090
+ */
2091
+ cancelAllOptionOrdersOnSpecificSymbol: async (symbol, recvWindow) => {
2092
+ assertParamExists5("cancelAllOptionOrdersOnSpecificSymbol", "symbol", symbol);
2093
+ const localVarQueryParameter = {};
2094
+ if (symbol !== void 0 && symbol !== null) {
2095
+ localVarQueryParameter["symbol"] = symbol;
2096
+ }
2097
+ if (recvWindow !== void 0 && recvWindow !== null) {
2098
+ localVarQueryParameter["recvWindow"] = recvWindow;
2099
+ }
2100
+ let _timeUnit;
2101
+ if ("timeUnit" in configuration)
2102
+ _timeUnit = configuration.timeUnit;
2103
+ return {
2104
+ endpoint: "/eapi/v1/allOpenOrders",
2105
+ method: "DELETE",
2106
+ params: localVarQueryParameter,
2107
+ timeUnit: _timeUnit
2108
+ };
2109
+ },
2110
+ /**
2111
+ * Cancel multiple orders.
2112
+ *
2113
+ * At least one instance of `orderId` and `clientOrderId` must be sent.
2114
+ *
2115
+ * Weight: 1
2116
+ *
2117
+ * @summary Cancel Multiple Option Orders (TRADE)
2118
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
2119
+ * @param {Array<number>} [orderIds] Order ID, e.g [4611875134427365377,4611875134427365378]
2120
+ * @param {Array<string>} [clientOrderIds] User-defined order ID, e.g ["my_id_1","my_id_2"]
2121
+ * @param {number} [recvWindow]
2122
+ *
2123
+ * @throws {RequiredError}
2124
+ */
2125
+ cancelMultipleOptionOrders: async (symbol, orderIds, clientOrderIds, recvWindow) => {
2126
+ assertParamExists5("cancelMultipleOptionOrders", "symbol", symbol);
2127
+ const localVarQueryParameter = {};
2128
+ if (symbol !== void 0 && symbol !== null) {
2129
+ localVarQueryParameter["symbol"] = symbol;
2130
+ }
2131
+ if (orderIds) {
2132
+ localVarQueryParameter["orderIds"] = orderIds;
2133
+ }
2134
+ if (clientOrderIds) {
2135
+ localVarQueryParameter["clientOrderIds"] = clientOrderIds;
2136
+ }
2137
+ if (recvWindow !== void 0 && recvWindow !== null) {
2138
+ localVarQueryParameter["recvWindow"] = recvWindow;
2139
+ }
2140
+ let _timeUnit;
2141
+ if ("timeUnit" in configuration)
2142
+ _timeUnit = configuration.timeUnit;
2143
+ return {
2144
+ endpoint: "/eapi/v1/batchOrders",
2145
+ method: "DELETE",
2146
+ params: localVarQueryParameter,
2147
+ timeUnit: _timeUnit
2148
+ };
2149
+ },
2150
+ /**
2151
+ * Cancel an active order.
2152
+ *
2153
+ * At least one instance of `orderId` and `clientOrderId` must be sent.
2154
+ *
2155
+ * Weight: 1
2156
+ *
2157
+ * @summary Cancel Option Order (TRADE)
2158
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
2159
+ * @param {number} [orderId] Order ID, e.g 4611875134427365377
2160
+ * @param {string} [clientOrderId] User-defined order ID, e.g 10000
2161
+ * @param {number} [recvWindow]
2162
+ *
2163
+ * @throws {RequiredError}
2164
+ */
2165
+ cancelOptionOrder: async (symbol, orderId, clientOrderId, recvWindow) => {
2166
+ assertParamExists5("cancelOptionOrder", "symbol", symbol);
2167
+ const localVarQueryParameter = {};
2168
+ if (symbol !== void 0 && symbol !== null) {
2169
+ localVarQueryParameter["symbol"] = symbol;
2170
+ }
2171
+ if (orderId !== void 0 && orderId !== null) {
2172
+ localVarQueryParameter["orderId"] = orderId;
2173
+ }
2174
+ if (clientOrderId !== void 0 && clientOrderId !== null) {
2175
+ localVarQueryParameter["clientOrderId"] = clientOrderId;
2176
+ }
2177
+ if (recvWindow !== void 0 && recvWindow !== null) {
2178
+ localVarQueryParameter["recvWindow"] = recvWindow;
2179
+ }
2180
+ let _timeUnit;
2181
+ if ("timeUnit" in configuration)
2182
+ _timeUnit = configuration.timeUnit;
2183
+ return {
2184
+ endpoint: "/eapi/v1/order",
2185
+ method: "DELETE",
2186
+ params: localVarQueryParameter,
2187
+ timeUnit: _timeUnit
2188
+ };
2189
+ },
2190
+ /**
2191
+ * Send a new order.
2192
+ *
2193
+ * Weight: 0
2194
+ *
2195
+ * @summary New Order (TRADE)
2196
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
2197
+ * @param {NewOrderSideEnum} side BUY or SELL
2198
+ * @param {NewOrderTypeEnum} type Order Type: LIMIT(only support limit)
2199
+ * @param {number} quantity Order Quantity
2200
+ * @param {number} [price] Order Price
2201
+ * @param {NewOrderTimeInForceEnum} [timeInForce] Time in force method(Default GTC)
2202
+ * @param {boolean} [reduceOnly] Reduce Only(Default false)
2203
+ * @param {boolean} [postOnly] Post Only(Default false)
2204
+ * @param {NewOrderNewOrderRespTypeEnum} [newOrderRespType] "ACK", "RESULT", Default "ACK"
2205
+ * @param {string} [clientOrderId] User-defined order ID, e.g 10000
2206
+ * @param {boolean} [isMmp] is market maker protection order, true/false
2207
+ * @param {number} [recvWindow]
2208
+ *
2209
+ * @throws {RequiredError}
2210
+ */
2211
+ newOrder: async (symbol, side, type, quantity, price, timeInForce, reduceOnly, postOnly, newOrderRespType, clientOrderId, isMmp, recvWindow) => {
2212
+ assertParamExists5("newOrder", "symbol", symbol);
2213
+ assertParamExists5("newOrder", "side", side);
2214
+ assertParamExists5("newOrder", "type", type);
2215
+ assertParamExists5("newOrder", "quantity", quantity);
2216
+ const localVarQueryParameter = {};
2217
+ if (symbol !== void 0 && symbol !== null) {
2218
+ localVarQueryParameter["symbol"] = symbol;
2219
+ }
2220
+ if (side !== void 0 && side !== null) {
2221
+ localVarQueryParameter["side"] = side;
2222
+ }
2223
+ if (type !== void 0 && type !== null) {
2224
+ localVarQueryParameter["type"] = type;
2225
+ }
2226
+ if (quantity !== void 0 && quantity !== null) {
2227
+ localVarQueryParameter["quantity"] = quantity;
2228
+ }
2229
+ if (price !== void 0 && price !== null) {
2230
+ localVarQueryParameter["price"] = price;
2231
+ }
2232
+ if (timeInForce !== void 0 && timeInForce !== null) {
2233
+ localVarQueryParameter["timeInForce"] = timeInForce;
2234
+ }
2235
+ if (reduceOnly !== void 0 && reduceOnly !== null) {
2236
+ localVarQueryParameter["reduceOnly"] = reduceOnly;
2237
+ }
2238
+ if (postOnly !== void 0 && postOnly !== null) {
2239
+ localVarQueryParameter["postOnly"] = postOnly;
2240
+ }
2241
+ if (newOrderRespType !== void 0 && newOrderRespType !== null) {
2242
+ localVarQueryParameter["newOrderRespType"] = newOrderRespType;
2243
+ }
2244
+ if (clientOrderId !== void 0 && clientOrderId !== null) {
2245
+ localVarQueryParameter["clientOrderId"] = clientOrderId;
2246
+ }
2247
+ if (isMmp !== void 0 && isMmp !== null) {
2248
+ localVarQueryParameter["isMmp"] = isMmp;
2249
+ }
2250
+ if (recvWindow !== void 0 && recvWindow !== null) {
2251
+ localVarQueryParameter["recvWindow"] = recvWindow;
2252
+ }
2253
+ let _timeUnit;
2254
+ if ("timeUnit" in configuration)
2255
+ _timeUnit = configuration.timeUnit;
2256
+ return {
2257
+ endpoint: "/eapi/v1/order",
2258
+ method: "POST",
2259
+ params: localVarQueryParameter,
2260
+ timeUnit: _timeUnit
2261
+ };
2262
+ },
2263
+ /**
2264
+ * Get current position information.
2265
+ *
2266
+ * Weight: 5
2267
+ *
2268
+ * @summary Option Position Information (USER_DATA)
2269
+ * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C
2270
+ * @param {number} [recvWindow]
2271
+ *
2272
+ * @throws {RequiredError}
2273
+ */
2274
+ optionPositionInformation: async (symbol, recvWindow) => {
2275
+ const localVarQueryParameter = {};
2276
+ if (symbol !== void 0 && symbol !== null) {
2277
+ localVarQueryParameter["symbol"] = symbol;
2278
+ }
2279
+ if (recvWindow !== void 0 && recvWindow !== null) {
2280
+ localVarQueryParameter["recvWindow"] = recvWindow;
2281
+ }
2282
+ let _timeUnit;
2283
+ if ("timeUnit" in configuration)
2284
+ _timeUnit = configuration.timeUnit;
2285
+ return {
2286
+ endpoint: "/eapi/v1/position",
2287
+ method: "GET",
2288
+ params: localVarQueryParameter,
2289
+ timeUnit: _timeUnit
2290
+ };
2291
+ },
2292
+ /**
2293
+ * Send multiple option orders.
2294
+ *
2295
+ * Parameter rules are same with New Order
2296
+ * Batch orders are processed concurrently, and the order of matching is not guaranteed.
2297
+ *
2298
+ * Weight: 5
2299
+ *
2300
+ * @summary Place Multiple Orders(TRADE)
2301
+ * @param {Array<PlaceMultipleOrdersOrdersParameterInner>} orders order list. Max 5 orders
2302
+ * @param {number} [recvWindow]
2303
+ *
2304
+ * @throws {RequiredError}
2305
+ */
2306
+ placeMultipleOrders: async (orders, recvWindow) => {
2307
+ assertParamExists5("placeMultipleOrders", "orders", orders);
2308
+ const localVarQueryParameter = {};
2309
+ if (orders) {
2310
+ localVarQueryParameter["orders"] = orders;
2311
+ }
2312
+ if (recvWindow !== void 0 && recvWindow !== null) {
2313
+ localVarQueryParameter["recvWindow"] = recvWindow;
2314
+ }
2315
+ let _timeUnit;
2316
+ if ("timeUnit" in configuration)
2317
+ _timeUnit = configuration.timeUnit;
2318
+ return {
2319
+ endpoint: "/eapi/v1/batchOrders",
2320
+ method: "POST",
2321
+ params: localVarQueryParameter,
2322
+ timeUnit: _timeUnit
2323
+ };
2324
+ },
2325
+ /**
2326
+ * Query current all open orders, status: ACCEPTED PARTIALLY_FILLED
2327
+ *
2328
+ * Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2329
+ *
2330
+ * @summary Query Current Open Option Orders (USER_DATA)
2331
+ * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C
2332
+ * @param {number} [orderId] Order ID, e.g 4611875134427365377
2333
+ * @param {number} [startTime] Start Time, e.g 1593511200000
2334
+ * @param {number} [endTime] End Time, e.g 1593512200000
2335
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
2336
+ * @param {number} [recvWindow]
2337
+ *
2338
+ * @throws {RequiredError}
2339
+ */
2340
+ queryCurrentOpenOptionOrders: async (symbol, orderId, startTime, endTime, limit, recvWindow) => {
2341
+ const localVarQueryParameter = {};
2342
+ if (symbol !== void 0 && symbol !== null) {
2343
+ localVarQueryParameter["symbol"] = symbol;
2344
+ }
2345
+ if (orderId !== void 0 && orderId !== null) {
2346
+ localVarQueryParameter["orderId"] = orderId;
2347
+ }
2348
+ if (startTime !== void 0 && startTime !== null) {
2349
+ localVarQueryParameter["startTime"] = startTime;
2350
+ }
2351
+ if (endTime !== void 0 && endTime !== null) {
2352
+ localVarQueryParameter["endTime"] = endTime;
2353
+ }
2354
+ if (limit !== void 0 && limit !== null) {
2355
+ localVarQueryParameter["limit"] = limit;
2356
+ }
2357
+ if (recvWindow !== void 0 && recvWindow !== null) {
2358
+ localVarQueryParameter["recvWindow"] = recvWindow;
2359
+ }
2360
+ let _timeUnit;
2361
+ if ("timeUnit" in configuration)
2362
+ _timeUnit = configuration.timeUnit;
2363
+ return {
2364
+ endpoint: "/eapi/v1/openOrders",
2365
+ method: "GET",
2366
+ params: localVarQueryParameter,
2367
+ timeUnit: _timeUnit
2368
+ };
2369
+ },
2370
+ /**
2371
+ * Query all finished orders within 5 days, finished status: CANCELLED FILLED REJECTED.
2372
+ *
2373
+ * Weight: 3
2374
+ *
2375
+ * @summary Query Option Order History (TRADE)
2376
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
2377
+ * @param {number} [orderId] Order ID, e.g 4611875134427365377
2378
+ * @param {number} [startTime] Start Time, e.g 1593511200000
2379
+ * @param {number} [endTime] End Time, e.g 1593512200000
2380
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
2381
+ * @param {number} [recvWindow]
2382
+ *
2383
+ * @throws {RequiredError}
2384
+ */
2385
+ queryOptionOrderHistory: async (symbol, orderId, startTime, endTime, limit, recvWindow) => {
2386
+ assertParamExists5("queryOptionOrderHistory", "symbol", symbol);
2387
+ const localVarQueryParameter = {};
2388
+ if (symbol !== void 0 && symbol !== null) {
2389
+ localVarQueryParameter["symbol"] = symbol;
2390
+ }
2391
+ if (orderId !== void 0 && orderId !== null) {
2392
+ localVarQueryParameter["orderId"] = orderId;
2393
+ }
2394
+ if (startTime !== void 0 && startTime !== null) {
2395
+ localVarQueryParameter["startTime"] = startTime;
2396
+ }
2397
+ if (endTime !== void 0 && endTime !== null) {
2398
+ localVarQueryParameter["endTime"] = endTime;
2399
+ }
2400
+ if (limit !== void 0 && limit !== null) {
2401
+ localVarQueryParameter["limit"] = limit;
2402
+ }
2403
+ if (recvWindow !== void 0 && recvWindow !== null) {
2404
+ localVarQueryParameter["recvWindow"] = recvWindow;
2405
+ }
2406
+ let _timeUnit;
2407
+ if ("timeUnit" in configuration)
2408
+ _timeUnit = configuration.timeUnit;
2409
+ return {
2410
+ endpoint: "/eapi/v1/historyOrders",
2411
+ method: "GET",
2412
+ params: localVarQueryParameter,
2413
+ timeUnit: _timeUnit
2414
+ };
2415
+ },
2416
+ /**
2417
+ * Check an order status.
2418
+ *
2419
+ * These orders will not be found:
2420
+ * order status is `CANCELED` or `REJECTED`, **AND**
2421
+ * order has NO filled trade, **AND**
2422
+ * created time + 3 days < current time
2423
+ *
2424
+ *
2425
+ * Either `orderId` or `clientOrderId ` must be sent.
2426
+ *
2427
+ * Weight: 1
2428
+ *
2429
+ * @summary Query Single Order (TRADE)
2430
+ * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C
2431
+ * @param {number} [orderId] Order ID, e.g 4611875134427365377
2432
+ * @param {string} [clientOrderId] User-defined order ID, e.g 10000
2433
+ * @param {number} [recvWindow]
2434
+ *
2435
+ * @throws {RequiredError}
2436
+ */
2437
+ querySingleOrder: async (symbol, orderId, clientOrderId, recvWindow) => {
2438
+ assertParamExists5("querySingleOrder", "symbol", symbol);
2439
+ const localVarQueryParameter = {};
2440
+ if (symbol !== void 0 && symbol !== null) {
2441
+ localVarQueryParameter["symbol"] = symbol;
2442
+ }
2443
+ if (orderId !== void 0 && orderId !== null) {
2444
+ localVarQueryParameter["orderId"] = orderId;
2445
+ }
2446
+ if (clientOrderId !== void 0 && clientOrderId !== null) {
2447
+ localVarQueryParameter["clientOrderId"] = clientOrderId;
2448
+ }
2449
+ if (recvWindow !== void 0 && recvWindow !== null) {
2450
+ localVarQueryParameter["recvWindow"] = recvWindow;
2451
+ }
2452
+ let _timeUnit;
2453
+ if ("timeUnit" in configuration)
2454
+ _timeUnit = configuration.timeUnit;
2455
+ return {
2456
+ endpoint: "/eapi/v1/order",
2457
+ method: "GET",
2458
+ params: localVarQueryParameter,
2459
+ timeUnit: _timeUnit
2460
+ };
2461
+ },
2462
+ /**
2463
+ * Get account exercise records.
2464
+ *
2465
+ * Weight: 5
2466
+ *
2467
+ * @summary User Exercise Record (USER_DATA)
2468
+ * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C
2469
+ * @param {number} [startTime] Start Time, e.g 1593511200000
2470
+ * @param {number} [endTime] End Time, e.g 1593512200000
2471
+ * @param {number} [limit] Number of result sets returned Default:100 Max:1000
2472
+ * @param {number} [recvWindow]
2473
+ *
2474
+ * @throws {RequiredError}
2475
+ */
2476
+ userExerciseRecord: async (symbol, startTime, endTime, limit, recvWindow) => {
2477
+ const localVarQueryParameter = {};
2478
+ if (symbol !== void 0 && symbol !== null) {
2479
+ localVarQueryParameter["symbol"] = symbol;
2480
+ }
2481
+ if (startTime !== void 0 && startTime !== null) {
2482
+ localVarQueryParameter["startTime"] = startTime;
2483
+ }
2484
+ if (endTime !== void 0 && endTime !== null) {
2485
+ localVarQueryParameter["endTime"] = endTime;
2486
+ }
2487
+ if (limit !== void 0 && limit !== null) {
2488
+ localVarQueryParameter["limit"] = limit;
2489
+ }
2490
+ if (recvWindow !== void 0 && recvWindow !== null) {
2491
+ localVarQueryParameter["recvWindow"] = recvWindow;
2492
+ }
2493
+ let _timeUnit;
2494
+ if ("timeUnit" in configuration)
2495
+ _timeUnit = configuration.timeUnit;
2496
+ return {
2497
+ endpoint: "/eapi/v1/exerciseRecord",
2498
+ method: "GET",
2499
+ params: localVarQueryParameter,
2500
+ timeUnit: _timeUnit
2501
+ };
2502
+ }
2503
+ };
2504
+ };
2505
+ var TradeApi = class {
2506
+ constructor(configuration) {
2507
+ this.configuration = configuration;
2508
+ this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);
2509
+ }
2510
+ /**
2511
+ * Get trades for a specific account and symbol.
2512
+ *
2513
+ * Weight: 5
2514
+ *
2515
+ * @summary Account Trade List (USER_DATA)
2516
+ * @param {AccountTradeListRequest} requestParameters Request parameters.
2517
+ * @returns {Promise<RestApiResponse<AccountTradeListResponse>>}
2518
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2519
+ * @memberof TradeApi
2520
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List Binance API Documentation}
2521
+ */
2522
+ async accountTradeList(requestParameters = {}) {
2523
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountTradeList(
2524
+ requestParameters?.symbol,
2525
+ requestParameters?.fromId,
2526
+ requestParameters?.startTime,
2527
+ requestParameters?.endTime,
2528
+ requestParameters?.limit,
2529
+ requestParameters?.recvWindow
2530
+ );
2531
+ return sendRequest5(
2532
+ this.configuration,
2533
+ localVarAxiosArgs.endpoint,
2534
+ localVarAxiosArgs.method,
2535
+ localVarAxiosArgs.params,
2536
+ localVarAxiosArgs?.timeUnit,
2537
+ { isSigned: true }
2538
+ );
2539
+ }
2540
+ /**
2541
+ * Cancel all active orders on specified underlying.
2542
+ *
2543
+ * Weight: 1
2544
+ *
2545
+ * @summary Cancel All Option Orders By Underlying (TRADE)
2546
+ * @param {CancelAllOptionOrdersByUnderlyingRequest} requestParameters Request parameters.
2547
+ * @returns {Promise<RestApiResponse<CancelAllOptionOrdersByUnderlyingResponse>>}
2548
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2549
+ * @memberof TradeApi
2550
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-All-Option-Orders-By-Underlying Binance API Documentation}
2551
+ */
2552
+ async cancelAllOptionOrdersByUnderlying(requestParameters) {
2553
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelAllOptionOrdersByUnderlying(
2554
+ requestParameters?.underlying,
2555
+ requestParameters?.recvWindow
2556
+ );
2557
+ return sendRequest5(
2558
+ this.configuration,
2559
+ localVarAxiosArgs.endpoint,
2560
+ localVarAxiosArgs.method,
2561
+ localVarAxiosArgs.params,
2562
+ localVarAxiosArgs?.timeUnit,
2563
+ { isSigned: true }
2564
+ );
2565
+ }
2566
+ /**
2567
+ * Cancel all active order on a symbol.
2568
+ *
2569
+ * Weight: 1
2570
+ *
2571
+ * @summary Cancel all Option orders on specific symbol (TRADE)
2572
+ * @param {CancelAllOptionOrdersOnSpecificSymbolRequest} requestParameters Request parameters.
2573
+ * @returns {Promise<RestApiResponse<CancelAllOptionOrdersOnSpecificSymbolResponse>>}
2574
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2575
+ * @memberof TradeApi
2576
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol Binance API Documentation}
2577
+ */
2578
+ async cancelAllOptionOrdersOnSpecificSymbol(requestParameters) {
2579
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelAllOptionOrdersOnSpecificSymbol(
2580
+ requestParameters?.symbol,
2581
+ requestParameters?.recvWindow
2582
+ );
2583
+ return sendRequest5(
2584
+ this.configuration,
2585
+ localVarAxiosArgs.endpoint,
2586
+ localVarAxiosArgs.method,
2587
+ localVarAxiosArgs.params,
2588
+ localVarAxiosArgs?.timeUnit,
2589
+ { isSigned: true }
2590
+ );
2591
+ }
2592
+ /**
2593
+ * Cancel multiple orders.
2594
+ *
2595
+ * At least one instance of `orderId` and `clientOrderId` must be sent.
2596
+ *
2597
+ * Weight: 1
2598
+ *
2599
+ * @summary Cancel Multiple Option Orders (TRADE)
2600
+ * @param {CancelMultipleOptionOrdersRequest} requestParameters Request parameters.
2601
+ * @returns {Promise<RestApiResponse<CancelMultipleOptionOrdersResponse>>}
2602
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2603
+ * @memberof TradeApi
2604
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-Multiple-Option-Orders Binance API Documentation}
2605
+ */
2606
+ async cancelMultipleOptionOrders(requestParameters) {
2607
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelMultipleOptionOrders(
2608
+ requestParameters?.symbol,
2609
+ requestParameters?.orderIds,
2610
+ requestParameters?.clientOrderIds,
2611
+ requestParameters?.recvWindow
2612
+ );
2613
+ return sendRequest5(
2614
+ this.configuration,
2615
+ localVarAxiosArgs.endpoint,
2616
+ localVarAxiosArgs.method,
2617
+ localVarAxiosArgs.params,
2618
+ localVarAxiosArgs?.timeUnit,
2619
+ { isSigned: true }
2620
+ );
2621
+ }
2622
+ /**
2623
+ * Cancel an active order.
2624
+ *
2625
+ * At least one instance of `orderId` and `clientOrderId` must be sent.
2626
+ *
2627
+ * Weight: 1
2628
+ *
2629
+ * @summary Cancel Option Order (TRADE)
2630
+ * @param {CancelOptionOrderRequest} requestParameters Request parameters.
2631
+ * @returns {Promise<RestApiResponse<CancelOptionOrderResponse>>}
2632
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2633
+ * @memberof TradeApi
2634
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order Binance API Documentation}
2635
+ */
2636
+ async cancelOptionOrder(requestParameters) {
2637
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelOptionOrder(
2638
+ requestParameters?.symbol,
2639
+ requestParameters?.orderId,
2640
+ requestParameters?.clientOrderId,
2641
+ requestParameters?.recvWindow
2642
+ );
2643
+ return sendRequest5(
2644
+ this.configuration,
2645
+ localVarAxiosArgs.endpoint,
2646
+ localVarAxiosArgs.method,
2647
+ localVarAxiosArgs.params,
2648
+ localVarAxiosArgs?.timeUnit,
2649
+ { isSigned: true }
2650
+ );
2651
+ }
2652
+ /**
2653
+ * Send a new order.
2654
+ *
2655
+ * Weight: 0
2656
+ *
2657
+ * @summary New Order (TRADE)
2658
+ * @param {NewOrderRequest} requestParameters Request parameters.
2659
+ * @returns {Promise<RestApiResponse<NewOrderResponse>>}
2660
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2661
+ * @memberof TradeApi
2662
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/New-Order Binance API Documentation}
2663
+ */
2664
+ async newOrder(requestParameters) {
2665
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.newOrder(
2666
+ requestParameters?.symbol,
2667
+ requestParameters?.side,
2668
+ requestParameters?.type,
2669
+ requestParameters?.quantity,
2670
+ requestParameters?.price,
2671
+ requestParameters?.timeInForce,
2672
+ requestParameters?.reduceOnly,
2673
+ requestParameters?.postOnly,
2674
+ requestParameters?.newOrderRespType,
2675
+ requestParameters?.clientOrderId,
2676
+ requestParameters?.isMmp,
2677
+ requestParameters?.recvWindow
2678
+ );
2679
+ return sendRequest5(
2680
+ this.configuration,
2681
+ localVarAxiosArgs.endpoint,
2682
+ localVarAxiosArgs.method,
2683
+ localVarAxiosArgs.params,
2684
+ localVarAxiosArgs?.timeUnit,
2685
+ { isSigned: true }
2686
+ );
2687
+ }
2688
+ /**
2689
+ * Get current position information.
2690
+ *
2691
+ * Weight: 5
2692
+ *
2693
+ * @summary Option Position Information (USER_DATA)
2694
+ * @param {OptionPositionInformationRequest} requestParameters Request parameters.
2695
+ * @returns {Promise<RestApiResponse<OptionPositionInformationResponse>>}
2696
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2697
+ * @memberof TradeApi
2698
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information Binance API Documentation}
2699
+ */
2700
+ async optionPositionInformation(requestParameters = {}) {
2701
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.optionPositionInformation(
2702
+ requestParameters?.symbol,
2703
+ requestParameters?.recvWindow
2704
+ );
2705
+ return sendRequest5(
2706
+ this.configuration,
2707
+ localVarAxiosArgs.endpoint,
2708
+ localVarAxiosArgs.method,
2709
+ localVarAxiosArgs.params,
2710
+ localVarAxiosArgs?.timeUnit,
2711
+ { isSigned: true }
2712
+ );
2713
+ }
2714
+ /**
2715
+ * Send multiple option orders.
2716
+ *
2717
+ * Parameter rules are same with New Order
2718
+ * Batch orders are processed concurrently, and the order of matching is not guaranteed.
2719
+ *
2720
+ * Weight: 5
2721
+ *
2722
+ * @summary Place Multiple Orders(TRADE)
2723
+ * @param {PlaceMultipleOrdersRequest} requestParameters Request parameters.
2724
+ * @returns {Promise<RestApiResponse<PlaceMultipleOrdersResponse>>}
2725
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2726
+ * @memberof TradeApi
2727
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders Binance API Documentation}
2728
+ */
2729
+ async placeMultipleOrders(requestParameters) {
2730
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.placeMultipleOrders(
2731
+ requestParameters?.orders,
2732
+ requestParameters?.recvWindow
2733
+ );
2734
+ return sendRequest5(
2735
+ this.configuration,
2736
+ localVarAxiosArgs.endpoint,
2737
+ localVarAxiosArgs.method,
2738
+ localVarAxiosArgs.params,
2739
+ localVarAxiosArgs?.timeUnit,
2740
+ { isSigned: true }
2741
+ );
2742
+ }
2743
+ /**
2744
+ * Query current all open orders, status: ACCEPTED PARTIALLY_FILLED
2745
+ *
2746
+ * Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
2747
+ *
2748
+ * @summary Query Current Open Option Orders (USER_DATA)
2749
+ * @param {QueryCurrentOpenOptionOrdersRequest} requestParameters Request parameters.
2750
+ * @returns {Promise<RestApiResponse<QueryCurrentOpenOptionOrdersResponse>>}
2751
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2752
+ * @memberof TradeApi
2753
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders Binance API Documentation}
2754
+ */
2755
+ async queryCurrentOpenOptionOrders(requestParameters = {}) {
2756
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryCurrentOpenOptionOrders(
2757
+ requestParameters?.symbol,
2758
+ requestParameters?.orderId,
2759
+ requestParameters?.startTime,
2760
+ requestParameters?.endTime,
2761
+ requestParameters?.limit,
2762
+ requestParameters?.recvWindow
2763
+ );
2764
+ return sendRequest5(
2765
+ this.configuration,
2766
+ localVarAxiosArgs.endpoint,
2767
+ localVarAxiosArgs.method,
2768
+ localVarAxiosArgs.params,
2769
+ localVarAxiosArgs?.timeUnit,
2770
+ { isSigned: true }
2771
+ );
2772
+ }
2773
+ /**
2774
+ * Query all finished orders within 5 days, finished status: CANCELLED FILLED REJECTED.
2775
+ *
2776
+ * Weight: 3
2777
+ *
2778
+ * @summary Query Option Order History (TRADE)
2779
+ * @param {QueryOptionOrderHistoryRequest} requestParameters Request parameters.
2780
+ * @returns {Promise<RestApiResponse<QueryOptionOrderHistoryResponse>>}
2781
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2782
+ * @memberof TradeApi
2783
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History Binance API Documentation}
2784
+ */
2785
+ async queryOptionOrderHistory(requestParameters) {
2786
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryOptionOrderHistory(
2787
+ requestParameters?.symbol,
2788
+ requestParameters?.orderId,
2789
+ requestParameters?.startTime,
2790
+ requestParameters?.endTime,
2791
+ requestParameters?.limit,
2792
+ requestParameters?.recvWindow
2793
+ );
2794
+ return sendRequest5(
2795
+ this.configuration,
2796
+ localVarAxiosArgs.endpoint,
2797
+ localVarAxiosArgs.method,
2798
+ localVarAxiosArgs.params,
2799
+ localVarAxiosArgs?.timeUnit,
2800
+ { isSigned: true }
2801
+ );
2802
+ }
2803
+ /**
2804
+ * Check an order status.
2805
+ *
2806
+ * These orders will not be found:
2807
+ * order status is `CANCELED` or `REJECTED`, **AND**
2808
+ * order has NO filled trade, **AND**
2809
+ * created time + 3 days < current time
2810
+ *
2811
+ *
2812
+ * Either `orderId` or `clientOrderId ` must be sent.
2813
+ *
2814
+ * Weight: 1
2815
+ *
2816
+ * @summary Query Single Order (TRADE)
2817
+ * @param {QuerySingleOrderRequest} requestParameters Request parameters.
2818
+ * @returns {Promise<RestApiResponse<QuerySingleOrderResponse>>}
2819
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2820
+ * @memberof TradeApi
2821
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order Binance API Documentation}
2822
+ */
2823
+ async querySingleOrder(requestParameters) {
2824
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.querySingleOrder(
2825
+ requestParameters?.symbol,
2826
+ requestParameters?.orderId,
2827
+ requestParameters?.clientOrderId,
2828
+ requestParameters?.recvWindow
2829
+ );
2830
+ return sendRequest5(
2831
+ this.configuration,
2832
+ localVarAxiosArgs.endpoint,
2833
+ localVarAxiosArgs.method,
2834
+ localVarAxiosArgs.params,
2835
+ localVarAxiosArgs?.timeUnit,
2836
+ { isSigned: true }
2837
+ );
2838
+ }
2839
+ /**
2840
+ * Get account exercise records.
2841
+ *
2842
+ * Weight: 5
2843
+ *
2844
+ * @summary User Exercise Record (USER_DATA)
2845
+ * @param {UserExerciseRecordRequest} requestParameters Request parameters.
2846
+ * @returns {Promise<RestApiResponse<UserExerciseRecordResponse>>}
2847
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2848
+ * @memberof TradeApi
2849
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record Binance API Documentation}
2850
+ */
2851
+ async userExerciseRecord(requestParameters = {}) {
2852
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.userExerciseRecord(
2853
+ requestParameters?.symbol,
2854
+ requestParameters?.startTime,
2855
+ requestParameters?.endTime,
2856
+ requestParameters?.limit,
2857
+ requestParameters?.recvWindow
2858
+ );
2859
+ return sendRequest5(
2860
+ this.configuration,
2861
+ localVarAxiosArgs.endpoint,
2862
+ localVarAxiosArgs.method,
2863
+ localVarAxiosArgs.params,
2864
+ localVarAxiosArgs?.timeUnit,
2865
+ { isSigned: true }
2866
+ );
2867
+ }
2868
+ };
2869
+ var NewOrderSideEnum = {
2870
+ BUY: "BUY",
2871
+ SELL: "SELL"
2872
+ };
2873
+ var NewOrderTypeEnum = {
2874
+ LIMIT: "LIMIT"
2875
+ };
2876
+ var NewOrderTimeInForceEnum = {
2877
+ GTC: "GTC",
2878
+ IOC: "IOC",
2879
+ FOK: "FOK"
2880
+ };
2881
+ var NewOrderNewOrderRespTypeEnum = {
2882
+ ACK: "ACK",
2883
+ RESULT: "RESULT"
2884
+ };
2885
+
2886
+ // src/rest-api/modules/user-data-streams-api.ts
2887
+ import {
2888
+ sendRequest as sendRequest6
2889
+ } from "@binance/common";
2890
+ var UserDataStreamsApiAxiosParamCreator = function(configuration) {
2891
+ return {
2892
+ /**
2893
+ * Close out a user data stream.
2894
+ *
2895
+ * Weight: 1
2896
+ *
2897
+ * @summary Close User Data Stream (USER_STREAM)
2898
+ *
2899
+ * @throws {RequiredError}
2900
+ */
2901
+ closeUserDataStream: async () => {
2902
+ const localVarQueryParameter = {};
2903
+ let _timeUnit;
2904
+ if ("timeUnit" in configuration)
2905
+ _timeUnit = configuration.timeUnit;
2906
+ return {
2907
+ endpoint: "/eapi/v1/listenKey",
2908
+ method: "DELETE",
2909
+ params: localVarQueryParameter,
2910
+ timeUnit: _timeUnit
2911
+ };
2912
+ },
2913
+ /**
2914
+ * Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.
2915
+ *
2916
+ * Weight: 1
2917
+ *
2918
+ * @summary Keepalive User Data Stream (USER_STREAM)
2919
+ *
2920
+ * @throws {RequiredError}
2921
+ */
2922
+ keepaliveUserDataStream: async () => {
2923
+ const localVarQueryParameter = {};
2924
+ let _timeUnit;
2925
+ if ("timeUnit" in configuration)
2926
+ _timeUnit = configuration.timeUnit;
2927
+ return {
2928
+ endpoint: "/eapi/v1/listenKey",
2929
+ method: "PUT",
2930
+ params: localVarQueryParameter,
2931
+ timeUnit: _timeUnit
2932
+ };
2933
+ },
2934
+ /**
2935
+ * Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes.
2936
+ *
2937
+ * Weight: 1
2938
+ *
2939
+ * @summary Start User Data Stream (USER_STREAM)
2940
+ *
2941
+ * @throws {RequiredError}
2942
+ */
2943
+ startUserDataStream: async () => {
2944
+ const localVarQueryParameter = {};
2945
+ let _timeUnit;
2946
+ if ("timeUnit" in configuration)
2947
+ _timeUnit = configuration.timeUnit;
2948
+ return {
2949
+ endpoint: "/eapi/v1/listenKey",
2950
+ method: "POST",
2951
+ params: localVarQueryParameter,
2952
+ timeUnit: _timeUnit
2953
+ };
2954
+ }
2955
+ };
2956
+ };
2957
+ var UserDataStreamsApi = class {
2958
+ constructor(configuration) {
2959
+ this.configuration = configuration;
2960
+ this.localVarAxiosParamCreator = UserDataStreamsApiAxiosParamCreator(configuration);
2961
+ }
2962
+ /**
2963
+ * Close out a user data stream.
2964
+ *
2965
+ * Weight: 1
2966
+ *
2967
+ * @summary Close User Data Stream (USER_STREAM)
2968
+ * @returns {Promise<RestApiResponse<void>>}
2969
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2970
+ * @memberof UserDataStreamsApi
2971
+ * @see {@link https://developers.binance.com/docs/derivatives/option/user-data-streams/Close-User-Data-Stream Binance API Documentation}
2972
+ */
2973
+ async closeUserDataStream() {
2974
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.closeUserDataStream();
2975
+ return sendRequest6(
2976
+ this.configuration,
2977
+ localVarAxiosArgs.endpoint,
2978
+ localVarAxiosArgs.method,
2979
+ localVarAxiosArgs.params,
2980
+ localVarAxiosArgs?.timeUnit,
2981
+ { isSigned: false }
2982
+ );
2983
+ }
2984
+ /**
2985
+ * Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.
2986
+ *
2987
+ * Weight: 1
2988
+ *
2989
+ * @summary Keepalive User Data Stream (USER_STREAM)
2990
+ * @returns {Promise<RestApiResponse<void>>}
2991
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2992
+ * @memberof UserDataStreamsApi
2993
+ * @see {@link https://developers.binance.com/docs/derivatives/option/user-data-streams/Keepalive-User-Data-Stream Binance API Documentation}
2994
+ */
2995
+ async keepaliveUserDataStream() {
2996
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.keepaliveUserDataStream();
2997
+ return sendRequest6(
2998
+ this.configuration,
2999
+ localVarAxiosArgs.endpoint,
3000
+ localVarAxiosArgs.method,
3001
+ localVarAxiosArgs.params,
3002
+ localVarAxiosArgs?.timeUnit,
3003
+ { isSigned: false }
3004
+ );
3005
+ }
3006
+ /**
3007
+ * Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes.
3008
+ *
3009
+ * Weight: 1
3010
+ *
3011
+ * @summary Start User Data Stream (USER_STREAM)
3012
+ * @returns {Promise<RestApiResponse<StartUserDataStreamResponse>>}
3013
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3014
+ * @memberof UserDataStreamsApi
3015
+ * @see {@link https://developers.binance.com/docs/derivatives/option/user-data-streams/Start-User-Data-Stream Binance API Documentation}
3016
+ */
3017
+ async startUserDataStream() {
3018
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.startUserDataStream();
3019
+ return sendRequest6(
3020
+ this.configuration,
3021
+ localVarAxiosArgs.endpoint,
3022
+ localVarAxiosArgs.method,
3023
+ localVarAxiosArgs.params,
3024
+ localVarAxiosArgs?.timeUnit,
3025
+ { isSigned: false }
3026
+ );
3027
+ }
3028
+ };
3029
+
3030
+ // src/rest-api/rest-api.ts
3031
+ import { sendRequest as sendRequest7 } from "@binance/common";
3032
+ var RestAPI = class {
3033
+ constructor(configuration) {
3034
+ this.configuration = configuration;
3035
+ this.accountApi = new AccountApi(configuration);
3036
+ this.marketDataApi = new MarketDataApi(configuration);
3037
+ this.marketMakerBlockTradeApi = new MarketMakerBlockTradeApi(configuration);
3038
+ this.marketMakerEndpointsApi = new MarketMakerEndpointsApi(configuration);
3039
+ this.tradeApi = new TradeApi(configuration);
3040
+ this.userDataStreamsApi = new UserDataStreamsApi(configuration);
3041
+ }
3042
+ /**
3043
+ * Generic function to send a request.
3044
+ * @param endpoint - The API endpoint to call.
3045
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
3046
+ * @param params - Query parameters for the request.
3047
+ *
3048
+ * @returns A promise resolving to the response data object.
3049
+ */
3050
+ sendRequest(endpoint, method, params = {}) {
3051
+ return sendRequest7(this.configuration, endpoint, method, params, void 0);
3052
+ }
3053
+ /**
3054
+ * Generic function to send a signed request.
3055
+ * @param endpoint - The API endpoint to call.
3056
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
3057
+ * @param params - Query parameters for the request.
3058
+ *
3059
+ * @returns A promise resolving to the response data object.
3060
+ */
3061
+ sendSignedRequest(endpoint, method, params = {}) {
3062
+ return sendRequest7(this.configuration, endpoint, method, params, void 0, {
3063
+ isSigned: true
3064
+ });
3065
+ }
3066
+ /**
3067
+ * Query account funding flows.
3068
+ *
3069
+ * Weight: 1
3070
+ *
3071
+ * @summary Account Funding Flow (USER_DATA)
3072
+ * @param {AccountFundingFlowRequest} requestParameters Request parameters.
3073
+ * @returns {Promise<RestApiResponse<AccountFundingFlowResponse>>}
3074
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3075
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow Binance API Documentation}
3076
+ */
3077
+ accountFundingFlow(requestParameters) {
3078
+ return this.accountApi.accountFundingFlow(requestParameters);
3079
+ }
3080
+ /**
3081
+ * Get download id for option transaction history
3082
+ *
3083
+ * Request Limitation is 5 times per month, shared by > front end download page and rest api
3084
+ * The time between `startTime` and `endTime` can not be longer than 1 year
3085
+ *
3086
+ * Weight: 5
3087
+ *
3088
+ * @summary Get Download Id For Option Transaction History (USER_DATA)
3089
+ * @param {GetDownloadIdForOptionTransactionHistoryRequest} requestParameters Request parameters.
3090
+ * @returns {Promise<RestApiResponse<GetDownloadIdForOptionTransactionHistoryResponse>>}
3091
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3092
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Get-Download-Id-For-Option-Transaction-History Binance API Documentation}
3093
+ */
3094
+ getDownloadIdForOptionTransactionHistory(requestParameters) {
3095
+ return this.accountApi.getDownloadIdForOptionTransactionHistory(requestParameters);
3096
+ }
3097
+ /**
3098
+ * Get option transaction history download Link by Id
3099
+ *
3100
+ * Download link expiration: 24h
3101
+ *
3102
+ * Weight: 5
3103
+ *
3104
+ * @summary Get Option Transaction History Download Link by Id (USER_DATA)
3105
+ * @param {GetOptionTransactionHistoryDownloadLinkByIdRequest} requestParameters Request parameters.
3106
+ * @returns {Promise<RestApiResponse<GetOptionTransactionHistoryDownloadLinkByIdResponse>>}
3107
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3108
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Get-Option-Transaction-History-Download-Link-by-Id Binance API Documentation}
3109
+ */
3110
+ getOptionTransactionHistoryDownloadLinkById(requestParameters) {
3111
+ return this.accountApi.getOptionTransactionHistoryDownloadLinkById(requestParameters);
3112
+ }
3113
+ /**
3114
+ * Get current account information.
3115
+ *
3116
+ * Weight: 3
3117
+ *
3118
+ * @summary Option Account Information(TRADE)
3119
+ * @param {OptionAccountInformationRequest} requestParameters Request parameters.
3120
+ * @returns {Promise<RestApiResponse<OptionAccountInformationResponse>>}
3121
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3122
+ * @see {@link https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information Binance API Documentation}
3123
+ */
3124
+ optionAccountInformation(requestParameters = {}) {
3125
+ return this.accountApi.optionAccountInformation(requestParameters);
3126
+ }
3127
+ /**
3128
+ * Test connectivity to the Rest API and get the current server time.
3129
+ *
3130
+ * Weight: 1
3131
+ *
3132
+ * @summary Check Server Time
3133
+ * @returns {Promise<RestApiResponse<CheckServerTimeResponse>>}
3134
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3135
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Check-Server-Time Binance API Documentation}
3136
+ */
3137
+ checkServerTime() {
3138
+ return this.marketDataApi.checkServerTime();
3139
+ }
3140
+ /**
3141
+ * Current exchange trading rules and symbol information
3142
+ *
3143
+ * Weight: 1
3144
+ *
3145
+ * @summary Exchange Information
3146
+ * @returns {Promise<RestApiResponse<ExchangeInformationResponse>>}
3147
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3148
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information Binance API Documentation}
3149
+ */
3150
+ exchangeInformation() {
3151
+ return this.marketDataApi.exchangeInformation();
3152
+ }
3153
+ /**
3154
+ * Get historical exercise records.
3155
+ * REALISTIC_VALUE_STRICKEN -> Exercised
3156
+ * EXTRINSIC_VALUE_EXPIRED -> Expired OTM
3157
+ *
3158
+ * Weight: 3
3159
+ *
3160
+ * @summary Historical Exercise Records
3161
+ * @param {HistoricalExerciseRecordsRequest} requestParameters Request parameters.
3162
+ * @returns {Promise<RestApiResponse<HistoricalExerciseRecordsResponse>>}
3163
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3164
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records Binance API Documentation}
3165
+ */
3166
+ historicalExerciseRecords(requestParameters = {}) {
3167
+ return this.marketDataApi.historicalExerciseRecords(requestParameters);
3168
+ }
3169
+ /**
3170
+ * Kline/candlestick bars for an option symbol.
3171
+ * Klines are uniquely identified by their open time.
3172
+ *
3173
+ * If startTime and endTime are not sent, the most recent klines are returned.
3174
+ *
3175
+ * Weight: 1
3176
+ *
3177
+ * @summary Kline/Candlestick Data
3178
+ * @param {KlineCandlestickDataRequest} requestParameters Request parameters.
3179
+ * @returns {Promise<RestApiResponse<KlineCandlestickDataResponse>>}
3180
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3181
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data Binance API Documentation}
3182
+ */
3183
+ klineCandlestickData(requestParameters) {
3184
+ return this.marketDataApi.klineCandlestickData(requestParameters);
3185
+ }
3186
+ /**
3187
+ * Get older market historical trades.
3188
+ *
3189
+ * Weight: 20
3190
+ *
3191
+ * @summary Old Trades Lookup (MARKET_DATA)
3192
+ * @param {OldTradesLookupRequest} requestParameters Request parameters.
3193
+ * @returns {Promise<RestApiResponse<OldTradesLookupResponse>>}
3194
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3195
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup Binance API Documentation}
3196
+ */
3197
+ oldTradesLookup(requestParameters) {
3198
+ return this.marketDataApi.oldTradesLookup(requestParameters);
3199
+ }
3200
+ /**
3201
+ * Get open interest for specific underlying asset on specific expiration date.
3202
+ *
3203
+ * Weight: 0
3204
+ *
3205
+ * @summary Open Interest
3206
+ * @param {OpenInterestRequest} requestParameters Request parameters.
3207
+ * @returns {Promise<RestApiResponse<OpenInterestResponse>>}
3208
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3209
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest Binance API Documentation}
3210
+ */
3211
+ openInterest(requestParameters) {
3212
+ return this.marketDataApi.openInterest(requestParameters);
3213
+ }
3214
+ /**
3215
+ * Option mark price and greek info.
3216
+ *
3217
+ * Weight: 5
3218
+ *
3219
+ * @summary Option Mark Price
3220
+ * @param {OptionMarkPriceRequest} requestParameters Request parameters.
3221
+ * @returns {Promise<RestApiResponse<OptionMarkPriceResponse>>}
3222
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3223
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price Binance API Documentation}
3224
+ */
3225
+ optionMarkPrice(requestParameters = {}) {
3226
+ return this.marketDataApi.optionMarkPrice(requestParameters);
3227
+ }
3228
+ /**
3229
+ * Check orderbook depth on specific symbol
3230
+ *
3231
+ * Weight: limit | weight
3232
+ * ------------ | ------------
3233
+ * 5, 10, 20, 50 | 2
3234
+ * 100 | 5
3235
+ * 500 | 10
3236
+ * 1000 | 20
3237
+ *
3238
+ * @summary Order Book
3239
+ * @param {OrderBookRequest} requestParameters Request parameters.
3240
+ * @returns {Promise<RestApiResponse<OrderBookResponse>>}
3241
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3242
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Order-Book Binance API Documentation}
3243
+ */
3244
+ orderBook(requestParameters) {
3245
+ return this.marketDataApi.orderBook(requestParameters);
3246
+ }
3247
+ /**
3248
+ * Get recent block trades
3249
+ *
3250
+ * Weight: 5
3251
+ *
3252
+ * @summary Recent Block Trades List
3253
+ * @param {RecentBlockTradesListRequest} requestParameters Request parameters.
3254
+ * @returns {Promise<RestApiResponse<RecentBlockTradesListResponse>>}
3255
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3256
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Recent-Block-Trade-List Binance API Documentation}
3257
+ */
3258
+ recentBlockTradesList(requestParameters = {}) {
3259
+ return this.marketDataApi.recentBlockTradesList(requestParameters);
3260
+ }
3261
+ /**
3262
+ * Get recent market trades
3263
+ *
3264
+ * Weight: 5
3265
+ *
3266
+ * @summary Recent Trades List
3267
+ * @param {RecentTradesListRequest} requestParameters Request parameters.
3268
+ * @returns {Promise<RestApiResponse<RecentTradesListResponse>>}
3269
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3270
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List Binance API Documentation}
3271
+ */
3272
+ recentTradesList(requestParameters) {
3273
+ return this.marketDataApi.recentTradesList(requestParameters);
3274
+ }
3275
+ /**
3276
+ * Get spot index price for option underlying.
3277
+ *
3278
+ * Weight: 1
3279
+ *
3280
+ * @summary Symbol Price Ticker
3281
+ * @param {SymbolPriceTickerRequest} requestParameters Request parameters.
3282
+ * @returns {Promise<RestApiResponse<SymbolPriceTickerResponse>>}
3283
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3284
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Symbol-Price-Ticker Binance API Documentation}
3285
+ */
3286
+ symbolPriceTicker(requestParameters) {
3287
+ return this.marketDataApi.symbolPriceTicker(requestParameters);
3288
+ }
3289
+ /**
3290
+ * Test connectivity to the Rest API.
3291
+ *
3292
+ * Weight: 1
3293
+ *
3294
+ * @summary Test Connectivity
3295
+ * @returns {Promise<RestApiResponse<void>>}
3296
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3297
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/Test-Connectivity Binance API Documentation}
3298
+ */
3299
+ testConnectivity() {
3300
+ return this.marketDataApi.testConnectivity();
3301
+ }
3302
+ /**
3303
+ * 24 hour rolling window price change statistics.
3304
+ *
3305
+ * Weight: 5
3306
+ *
3307
+ * @summary 24hr Ticker Price Change Statistics
3308
+ * @param {Ticker24hrPriceChangeStatisticsRequest} requestParameters Request parameters.
3309
+ * @returns {Promise<RestApiResponse<Ticker24hrPriceChangeStatisticsResponse>>}
3310
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3311
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics Binance API Documentation}
3312
+ */
3313
+ ticker24hrPriceChangeStatistics(requestParameters = {}) {
3314
+ return this.marketDataApi.ticker24hrPriceChangeStatistics(requestParameters);
3315
+ }
3316
+ /**
3317
+ * Accept a block trade order
3318
+ *
3319
+ * Weight: 5
3320
+ *
3321
+ * @summary Accept Block Trade Order (TRADE)
3322
+ * @param {AcceptBlockTradeOrderRequest} requestParameters Request parameters.
3323
+ * @returns {Promise<RestApiResponse<AcceptBlockTradeOrderResponse>>}
3324
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3325
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Accept-Block-Trade-Order Binance API Documentation}
3326
+ */
3327
+ acceptBlockTradeOrder(requestParameters) {
3328
+ return this.marketMakerBlockTradeApi.acceptBlockTradeOrder(requestParameters);
3329
+ }
3330
+ /**
3331
+ * Gets block trades for a specific account.
3332
+ *
3333
+ * Weight: 5
3334
+ *
3335
+ * @summary Account Block Trade List (USER_DATA)
3336
+ * @param {AccountBlockTradeListRequest} requestParameters Request parameters.
3337
+ * @returns {Promise<RestApiResponse<AccountBlockTradeListResponse>>}
3338
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3339
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Account-Block-Trade-List Binance API Documentation}
3340
+ */
3341
+ accountBlockTradeList(requestParameters = {}) {
3342
+ return this.marketMakerBlockTradeApi.accountBlockTradeList(requestParameters);
3343
+ }
3344
+ /**
3345
+ * Cancel a block trade order.
3346
+ *
3347
+ * Weight: 5
3348
+ *
3349
+ * @summary Cancel Block Trade Order (TRADE)
3350
+ * @param {CancelBlockTradeOrderRequest} requestParameters Request parameters.
3351
+ * @returns {Promise<RestApiResponse<void>>}
3352
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3353
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Cancel-Block-Trade-Order Binance API Documentation}
3354
+ */
3355
+ cancelBlockTradeOrder(requestParameters) {
3356
+ return this.marketMakerBlockTradeApi.cancelBlockTradeOrder(requestParameters);
3357
+ }
3358
+ /**
3359
+ * Extends a block trade expire time by 30 mins from the current time.
3360
+ *
3361
+ * Weight: 5
3362
+ *
3363
+ * @summary Extend Block Trade Order (TRADE)
3364
+ * @param {ExtendBlockTradeOrderRequest} requestParameters Request parameters.
3365
+ * @returns {Promise<RestApiResponse<ExtendBlockTradeOrderResponse>>}
3366
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3367
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Extend-Block-Trade-Order Binance API Documentation}
3368
+ */
3369
+ extendBlockTradeOrder(requestParameters) {
3370
+ return this.marketMakerBlockTradeApi.extendBlockTradeOrder(requestParameters);
3371
+ }
3372
+ /**
3373
+ * Send in a new block trade order.
3374
+ *
3375
+ * Weight: 5
3376
+ *
3377
+ * @summary New Block Trade Order (TRADE)
3378
+ * @param {NewBlockTradeOrderRequest} requestParameters Request parameters.
3379
+ * @returns {Promise<RestApiResponse<NewBlockTradeOrderResponse>>}
3380
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3381
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/New-Block-Trade-Order Binance API Documentation}
3382
+ */
3383
+ newBlockTradeOrder(requestParameters) {
3384
+ return this.marketMakerBlockTradeApi.newBlockTradeOrder(requestParameters);
3385
+ }
3386
+ /**
3387
+ * Query block trade details; returns block trade details from counterparty's perspective.
3388
+ *
3389
+ * Weight: 5
3390
+ *
3391
+ * @summary Query Block Trade Details (USER_DATA)
3392
+ * @param {QueryBlockTradeDetailsRequest} requestParameters Request parameters.
3393
+ * @returns {Promise<RestApiResponse<QueryBlockTradeDetailsResponse>>}
3394
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3395
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Query-Block-Trade-Detail Binance API Documentation}
3396
+ */
3397
+ queryBlockTradeDetails(requestParameters) {
3398
+ return this.marketMakerBlockTradeApi.queryBlockTradeDetails(requestParameters);
3399
+ }
3400
+ /**
3401
+ * Check block trade order status.
3402
+ *
3403
+ * Weight: 5
3404
+ *
3405
+ * @summary Query Block Trade Order (TRADE)
3406
+ * @param {QueryBlockTradeOrderRequest} requestParameters Request parameters.
3407
+ * @returns {Promise<RestApiResponse<QueryBlockTradeOrderResponse>>}
3408
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3409
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Query-Block-Trade-Order Binance API Documentation}
3410
+ */
3411
+ queryBlockTradeOrder(requestParameters = {}) {
3412
+ return this.marketMakerBlockTradeApi.queryBlockTradeOrder(requestParameters);
3413
+ }
3414
+ /**
3415
+ * This endpoint resets the time from which the countdown will begin to the time this messaged is received. It should be called repeatedly as heartbeats. Multiple heartbeats can be updated at once by specifying the underlying symbols as a list (ex. BTCUSDT,ETHUSDT) in the underlyings parameter.
3416
+ *
3417
+ * The response will only include underlying symbols where the heartbeat has been successfully updated.
3418
+ *
3419
+ * Weight: 10
3420
+ *
3421
+ * @summary Auto-Cancel All Open Orders (Kill-Switch) Heartbeat (TRADE)
3422
+ * @param {AutoCancelAllOpenOrdersRequest} requestParameters Request parameters.
3423
+ * @returns {Promise<RestApiResponse<AutoCancelAllOpenOrdersResponse>>}
3424
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3425
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat Binance API Documentation}
3426
+ */
3427
+ autoCancelAllOpenOrders(requestParameters) {
3428
+ return this.marketMakerEndpointsApi.autoCancelAllOpenOrders(requestParameters);
3429
+ }
3430
+ /**
3431
+ * This endpoint returns the auto-cancel parameters for each underlying symbol. Note only active auto-cancel parameters will be returned, if countdownTime is set to 0 (ie. countdownTime has been turned off), the underlying symbol and corresponding countdownTime parameter will not be returned in the response.
3432
+ *
3433
+ * countdownTime = 0 means the function is disabled.
3434
+ *
3435
+ * Weight: 1
3436
+ *
3437
+ * @summary Get Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE)
3438
+ * @param {GetAutoCancelAllOpenOrdersRequest} requestParameters Request parameters.
3439
+ * @returns {Promise<RestApiResponse<GetAutoCancelAllOpenOrdersResponse>>}
3440
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3441
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config Binance API Documentation}
3442
+ */
3443
+ getAutoCancelAllOpenOrders(requestParameters = {}) {
3444
+ return this.marketMakerEndpointsApi.getAutoCancelAllOpenOrders(requestParameters);
3445
+ }
3446
+ /**
3447
+ * Get config for MMP.
3448
+ *
3449
+ * Weight: 1
3450
+ *
3451
+ * @summary Get Market Maker Protection Config (TRADE)
3452
+ * @param {GetMarketMakerProtectionConfigRequest} requestParameters Request parameters.
3453
+ * @returns {Promise<RestApiResponse<GetMarketMakerProtectionConfigResponse>>}
3454
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3455
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Get-Market-Maker-Protection-Config Binance API Documentation}
3456
+ */
3457
+ getMarketMakerProtectionConfig(requestParameters = {}) {
3458
+ return this.marketMakerEndpointsApi.getMarketMakerProtectionConfig(requestParameters);
3459
+ }
3460
+ /**
3461
+ * Get current account information.
3462
+ *
3463
+ * Weight: 3
3464
+ *
3465
+ * @summary Option Margin Account Information (USER_DATA)
3466
+ * @param {OptionMarginAccountInformationRequest} requestParameters Request parameters.
3467
+ * @returns {Promise<RestApiResponse<OptionMarginAccountInformationResponse>>}
3468
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3469
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Option-Margin-Account-Information Binance API Documentation}
3470
+ */
3471
+ optionMarginAccountInformation(requestParameters = {}) {
3472
+ return this.marketMakerEndpointsApi.optionMarginAccountInformation(requestParameters);
3473
+ }
3474
+ /**
3475
+ * Reset MMP, start MMP order again.
3476
+ *
3477
+ * Weight: 1
3478
+ *
3479
+ * @summary Reset Market Maker Protection Config (TRADE)
3480
+ * @param {ResetMarketMakerProtectionConfigRequest} requestParameters Request parameters.
3481
+ * @returns {Promise<RestApiResponse<ResetMarketMakerProtectionConfigResponse>>}
3482
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3483
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Reset-Market-Maker-Protection-Config Binance API Documentation}
3484
+ */
3485
+ resetMarketMakerProtectionConfig(requestParameters = {}) {
3486
+ return this.marketMakerEndpointsApi.resetMarketMakerProtectionConfig(requestParameters);
3487
+ }
3488
+ /**
3489
+ * This endpoint sets the parameters of the auto-cancel feature which cancels all open orders (both market maker protection and non market maker protection order types) of the underlying symbol at the end of the specified countdown time period if no heartbeat message is sent. After the countdown time period, all open orders will be cancelled and new orders will be rejected with error code -2010 until either a heartbeat message is sent or the auto-cancel feature is turned off by setting countdownTime to 0.
3490
+ *
3491
+ *
3492
+ * This rest endpoint sets up the parameters to cancel your open orders in case of an outage or disconnection.
3493
+ * Example usage:
3494
+ * Call this endpoint with a countdownTime value of 10000 (10 seconds) to turn on the auto-cancel feature. If the corresponding countdownCancelAllHeartBeat endpoint is not called within 10 seconds with the specified underlying symbol, all open orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped.
3495
+ * The system will check all countdowns approximately every 1000 milliseconds, **please note that sufficient redundancy should be considered when using this function**. We do not recommend setting the countdown time to be too precise or too small.
3496
+ *
3497
+ * Weight: 1
3498
+ *
3499
+ * @summary Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE)
3500
+ * @param {SetAutoCancelAllOpenOrdersRequest} requestParameters Request parameters.
3501
+ * @returns {Promise<RestApiResponse<SetAutoCancelAllOpenOrdersResponse>>}
3502
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3503
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config Binance API Documentation}
3504
+ */
3505
+ setAutoCancelAllOpenOrders(requestParameters) {
3506
+ return this.marketMakerEndpointsApi.setAutoCancelAllOpenOrders(requestParameters);
3507
+ }
3508
+ /**
3509
+ * Set config for MMP.
3510
+ * Market Maker Protection(MMP) is a set of protection mechanism for option market maker, this mechanism is able to prevent mass trading in short period time. Once market maker's account branches the threshold, the Market Maker Protection will be triggered. When Market Maker Protection triggers, all the current MMP orders will be canceled, new MMP orders will be rejected. Market maker can use this time to reevaluate market and modify order price.
3511
+ *
3512
+ * Weight: 1
3513
+ *
3514
+ * @summary Set Market Maker Protection Config (TRADE)
3515
+ * @param {SetMarketMakerProtectionConfigRequest} requestParameters Request parameters.
3516
+ * @returns {Promise<RestApiResponse<SetMarketMakerProtectionConfigResponse>>}
3517
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3518
+ * @see {@link https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Set-Market-Maker-Protection-Config Binance API Documentation}
3519
+ */
3520
+ setMarketMakerProtectionConfig(requestParameters = {}) {
3521
+ return this.marketMakerEndpointsApi.setMarketMakerProtectionConfig(requestParameters);
3522
+ }
3523
+ /**
3524
+ * Get trades for a specific account and symbol.
3525
+ *
3526
+ * Weight: 5
3527
+ *
3528
+ * @summary Account Trade List (USER_DATA)
3529
+ * @param {AccountTradeListRequest} requestParameters Request parameters.
3530
+ * @returns {Promise<RestApiResponse<AccountTradeListResponse>>}
3531
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3532
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List Binance API Documentation}
3533
+ */
3534
+ accountTradeList(requestParameters = {}) {
3535
+ return this.tradeApi.accountTradeList(requestParameters);
3536
+ }
3537
+ /**
3538
+ * Cancel all active orders on specified underlying.
3539
+ *
3540
+ * Weight: 1
3541
+ *
3542
+ * @summary Cancel All Option Orders By Underlying (TRADE)
3543
+ * @param {CancelAllOptionOrdersByUnderlyingRequest} requestParameters Request parameters.
3544
+ * @returns {Promise<RestApiResponse<CancelAllOptionOrdersByUnderlyingResponse>>}
3545
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3546
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-All-Option-Orders-By-Underlying Binance API Documentation}
3547
+ */
3548
+ cancelAllOptionOrdersByUnderlying(requestParameters) {
3549
+ return this.tradeApi.cancelAllOptionOrdersByUnderlying(requestParameters);
3550
+ }
3551
+ /**
3552
+ * Cancel all active order on a symbol.
3553
+ *
3554
+ * Weight: 1
3555
+ *
3556
+ * @summary Cancel all Option orders on specific symbol (TRADE)
3557
+ * @param {CancelAllOptionOrdersOnSpecificSymbolRequest} requestParameters Request parameters.
3558
+ * @returns {Promise<RestApiResponse<CancelAllOptionOrdersOnSpecificSymbolResponse>>}
3559
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3560
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol Binance API Documentation}
3561
+ */
3562
+ cancelAllOptionOrdersOnSpecificSymbol(requestParameters) {
3563
+ return this.tradeApi.cancelAllOptionOrdersOnSpecificSymbol(requestParameters);
3564
+ }
3565
+ /**
3566
+ * Cancel multiple orders.
3567
+ *
3568
+ * At least one instance of `orderId` and `clientOrderId` must be sent.
3569
+ *
3570
+ * Weight: 1
3571
+ *
3572
+ * @summary Cancel Multiple Option Orders (TRADE)
3573
+ * @param {CancelMultipleOptionOrdersRequest} requestParameters Request parameters.
3574
+ * @returns {Promise<RestApiResponse<CancelMultipleOptionOrdersResponse>>}
3575
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3576
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-Multiple-Option-Orders Binance API Documentation}
3577
+ */
3578
+ cancelMultipleOptionOrders(requestParameters) {
3579
+ return this.tradeApi.cancelMultipleOptionOrders(requestParameters);
3580
+ }
3581
+ /**
3582
+ * Cancel an active order.
3583
+ *
3584
+ * At least one instance of `orderId` and `clientOrderId` must be sent.
3585
+ *
3586
+ * Weight: 1
3587
+ *
3588
+ * @summary Cancel Option Order (TRADE)
3589
+ * @param {CancelOptionOrderRequest} requestParameters Request parameters.
3590
+ * @returns {Promise<RestApiResponse<CancelOptionOrderResponse>>}
3591
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3592
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order Binance API Documentation}
3593
+ */
3594
+ cancelOptionOrder(requestParameters) {
3595
+ return this.tradeApi.cancelOptionOrder(requestParameters);
3596
+ }
3597
+ /**
3598
+ * Send a new order.
3599
+ *
3600
+ * Weight: 0
3601
+ *
3602
+ * @summary New Order (TRADE)
3603
+ * @param {NewOrderRequest} requestParameters Request parameters.
3604
+ * @returns {Promise<RestApiResponse<NewOrderResponse>>}
3605
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3606
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/New-Order Binance API Documentation}
3607
+ */
3608
+ newOrder(requestParameters) {
3609
+ return this.tradeApi.newOrder(requestParameters);
3610
+ }
3611
+ /**
3612
+ * Get current position information.
3613
+ *
3614
+ * Weight: 5
3615
+ *
3616
+ * @summary Option Position Information (USER_DATA)
3617
+ * @param {OptionPositionInformationRequest} requestParameters Request parameters.
3618
+ * @returns {Promise<RestApiResponse<OptionPositionInformationResponse>>}
3619
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3620
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information Binance API Documentation}
3621
+ */
3622
+ optionPositionInformation(requestParameters = {}) {
3623
+ return this.tradeApi.optionPositionInformation(requestParameters);
3624
+ }
3625
+ /**
3626
+ * Send multiple option orders.
3627
+ *
3628
+ * Parameter rules are same with New Order
3629
+ * Batch orders are processed concurrently, and the order of matching is not guaranteed.
3630
+ *
3631
+ * Weight: 5
3632
+ *
3633
+ * @summary Place Multiple Orders(TRADE)
3634
+ * @param {PlaceMultipleOrdersRequest} requestParameters Request parameters.
3635
+ * @returns {Promise<RestApiResponse<PlaceMultipleOrdersResponse>>}
3636
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3637
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders Binance API Documentation}
3638
+ */
3639
+ placeMultipleOrders(requestParameters) {
3640
+ return this.tradeApi.placeMultipleOrders(requestParameters);
3641
+ }
3642
+ /**
3643
+ * Query current all open orders, status: ACCEPTED PARTIALLY_FILLED
3644
+ *
3645
+ * Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
3646
+ *
3647
+ * @summary Query Current Open Option Orders (USER_DATA)
3648
+ * @param {QueryCurrentOpenOptionOrdersRequest} requestParameters Request parameters.
3649
+ * @returns {Promise<RestApiResponse<QueryCurrentOpenOptionOrdersResponse>>}
3650
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3651
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders Binance API Documentation}
3652
+ */
3653
+ queryCurrentOpenOptionOrders(requestParameters = {}) {
3654
+ return this.tradeApi.queryCurrentOpenOptionOrders(requestParameters);
3655
+ }
3656
+ /**
3657
+ * Query all finished orders within 5 days, finished status: CANCELLED FILLED REJECTED.
3658
+ *
3659
+ * Weight: 3
3660
+ *
3661
+ * @summary Query Option Order History (TRADE)
3662
+ * @param {QueryOptionOrderHistoryRequest} requestParameters Request parameters.
3663
+ * @returns {Promise<RestApiResponse<QueryOptionOrderHistoryResponse>>}
3664
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3665
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History Binance API Documentation}
3666
+ */
3667
+ queryOptionOrderHistory(requestParameters) {
3668
+ return this.tradeApi.queryOptionOrderHistory(requestParameters);
3669
+ }
3670
+ /**
3671
+ * Check an order status.
3672
+ *
3673
+ * These orders will not be found:
3674
+ * order status is `CANCELED` or `REJECTED`, **AND**
3675
+ * order has NO filled trade, **AND**
3676
+ * created time + 3 days < current time
3677
+ *
3678
+ *
3679
+ * Either `orderId` or `clientOrderId ` must be sent.
3680
+ *
3681
+ * Weight: 1
3682
+ *
3683
+ * @summary Query Single Order (TRADE)
3684
+ * @param {QuerySingleOrderRequest} requestParameters Request parameters.
3685
+ * @returns {Promise<RestApiResponse<QuerySingleOrderResponse>>}
3686
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3687
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order Binance API Documentation}
3688
+ */
3689
+ querySingleOrder(requestParameters) {
3690
+ return this.tradeApi.querySingleOrder(requestParameters);
3691
+ }
3692
+ /**
3693
+ * Get account exercise records.
3694
+ *
3695
+ * Weight: 5
3696
+ *
3697
+ * @summary User Exercise Record (USER_DATA)
3698
+ * @param {UserExerciseRecordRequest} requestParameters Request parameters.
3699
+ * @returns {Promise<RestApiResponse<UserExerciseRecordResponse>>}
3700
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3701
+ * @see {@link https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record Binance API Documentation}
3702
+ */
3703
+ userExerciseRecord(requestParameters = {}) {
3704
+ return this.tradeApi.userExerciseRecord(requestParameters);
3705
+ }
3706
+ /**
3707
+ * Close out a user data stream.
3708
+ *
3709
+ * Weight: 1
3710
+ *
3711
+ * @summary Close User Data Stream (USER_STREAM)
3712
+ * @returns {Promise<RestApiResponse<void>>}
3713
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3714
+ * @see {@link https://developers.binance.com/docs/derivatives/option/user-data-streams/Close-User-Data-Stream Binance API Documentation}
3715
+ */
3716
+ closeUserDataStream() {
3717
+ return this.userDataStreamsApi.closeUserDataStream();
3718
+ }
3719
+ /**
3720
+ * Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.
3721
+ *
3722
+ * Weight: 1
3723
+ *
3724
+ * @summary Keepalive User Data Stream (USER_STREAM)
3725
+ * @returns {Promise<RestApiResponse<void>>}
3726
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3727
+ * @see {@link https://developers.binance.com/docs/derivatives/option/user-data-streams/Keepalive-User-Data-Stream Binance API Documentation}
3728
+ */
3729
+ keepaliveUserDataStream() {
3730
+ return this.userDataStreamsApi.keepaliveUserDataStream();
3731
+ }
3732
+ /**
3733
+ * Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes.
3734
+ *
3735
+ * Weight: 1
3736
+ *
3737
+ * @summary Start User Data Stream (USER_STREAM)
3738
+ * @returns {Promise<RestApiResponse<StartUserDataStreamResponse>>}
3739
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3740
+ * @see {@link https://developers.binance.com/docs/derivatives/option/user-data-streams/Start-User-Data-Stream Binance API Documentation}
3741
+ */
3742
+ startUserDataStream() {
3743
+ return this.userDataStreamsApi.startUserDataStream();
3744
+ }
3745
+ };
3746
+
3747
+ // src/websocket-streams/index.ts
3748
+ var websocket_streams_exports = {};
3749
+ __export(websocket_streams_exports, {
3750
+ WebsocketMarketStreamsApi: () => WebsocketMarketStreamsApi,
3751
+ WebsocketStreams: () => WebsocketStreams,
3752
+ WebsocketStreamsConnection: () => WebsocketStreamsConnection
3753
+ });
3754
+
3755
+ // src/websocket-streams/modules/websocket-market-streams-api.ts
3756
+ import {
3757
+ assertParamExists as assertParamExists6,
3758
+ replaceWebsocketStreamsPlaceholders,
3759
+ createStreamHandler
3760
+ } from "@binance/common";
3761
+ var WebsocketMarketStreamsApiParamCreator = function() {
3762
+ return {
3763
+ /**
3764
+ * Underlying(e.g ETHUSDT) index stream.
3765
+ *
3766
+ * Update Speed: 1000ms
3767
+ *
3768
+ * @summary Index Price Streams
3769
+ * @param {string} symbol The symbol parameter
3770
+ * @param {string} [id] Unique WebSocket request ID.
3771
+ *
3772
+ * @throws {RequiredError}
3773
+ */
3774
+ indexPriceStreams: (symbol, id) => {
3775
+ assertParamExists6("indexPriceStreams", "symbol", symbol);
3776
+ return replaceWebsocketStreamsPlaceholders("/<symbol>@index".slice(1), { symbol, id });
3777
+ },
3778
+ /**
3779
+ * The Kline/Candlestick Stream push updates to the current klines/candlestick every 1000 milliseconds (if existing).
3780
+ *
3781
+ * Update Speed: 1000ms
3782
+ *
3783
+ * @summary Kline/Candlestick Streams
3784
+ * @param {string} symbol The symbol parameter
3785
+ * @param {string} interval The interval parameter
3786
+ * @param {string} [id] Unique WebSocket request ID.
3787
+ *
3788
+ * @throws {RequiredError}
3789
+ */
3790
+ klineCandlestickStreams: (symbol, interval, id) => {
3791
+ assertParamExists6("klineCandlestickStreams", "symbol", symbol);
3792
+ assertParamExists6("klineCandlestickStreams", "interval", interval);
3793
+ return replaceWebsocketStreamsPlaceholders("/<symbol>@kline_<interval>".slice(1), {
3794
+ symbol,
3795
+ interval,
3796
+ id
3797
+ });
3798
+ },
3799
+ /**
3800
+ * The mark price for all option symbols on specific underlying asset. E.g.[ETH@markPrice](wss://nbstream.binance.com/eoptions/stream?streams=ETH@markPrice)
3801
+ *
3802
+ * Update Speed: 1000ms
3803
+ *
3804
+ * @summary Mark Price
3805
+ * @param {string} underlyingAsset The underlyingAsset parameter
3806
+ * @param {string} [id] Unique WebSocket request ID.
3807
+ *
3808
+ * @throws {RequiredError}
3809
+ */
3810
+ markPrice: (underlyingAsset, id) => {
3811
+ assertParamExists6("markPrice", "underlyingAsset", underlyingAsset);
3812
+ return replaceWebsocketStreamsPlaceholders("/<underlyingAsset>@markPrice".slice(1), {
3813
+ underlyingAsset,
3814
+ id
3815
+ });
3816
+ },
3817
+ /**
3818
+ * New symbol listing stream.
3819
+ *
3820
+ * Update Speed: 50ms
3821
+ *
3822
+ * @summary New Symbol Info
3823
+ * @param {string} [id] Unique WebSocket request ID.
3824
+ *
3825
+ * @throws {RequiredError}
3826
+ */
3827
+ newSymbolInfo: (id) => {
3828
+ return replaceWebsocketStreamsPlaceholders("/option_pair".slice(1), { id });
3829
+ },
3830
+ /**
3831
+ * Option open interest for specific underlying asset on specific expiration date. E.g.[ETH@openInterest@221125](wss://nbstream.binance.com/eoptions/stream?streams=ETH@openInterest@221125)
3832
+ *
3833
+ * Update Speed: 60s
3834
+ *
3835
+ * @summary Open Interest
3836
+ * @param {string} underlyingAsset The underlyingAsset parameter
3837
+ * @param {string} expirationDate The expirationDate parameter
3838
+ * @param {string} [id] Unique WebSocket request ID.
3839
+ *
3840
+ * @throws {RequiredError}
3841
+ */
3842
+ openInterest: (underlyingAsset, expirationDate, id) => {
3843
+ assertParamExists6("openInterest", "underlyingAsset", underlyingAsset);
3844
+ assertParamExists6("openInterest", "expirationDate", expirationDate);
3845
+ return replaceWebsocketStreamsPlaceholders(
3846
+ "/<underlyingAsset>@openInterest@<expirationDate>".slice(1),
3847
+ { underlyingAsset, expirationDate, id }
3848
+ );
3849
+ },
3850
+ /**
3851
+ * Top **<levels\>** bids and asks, Valid levels are **<levels\>** are 10, 20, 50, 100.
3852
+ *
3853
+ * Update Speed: 100ms or 1000ms, 500ms(default when update speed isn't used)
3854
+ *
3855
+ * @summary Partial Book Depth Streams
3856
+ * @param {string} symbol The symbol parameter
3857
+ * @param {number} levels The levels parameter
3858
+ * @param {string} [id] Unique WebSocket request ID.
3859
+ * @param {string} [updateSpeed] WebSocket stream update speed
3860
+ *
3861
+ * @throws {RequiredError}
3862
+ */
3863
+ partialBookDepthStreams: (symbol, levels, id, updateSpeed) => {
3864
+ assertParamExists6("partialBookDepthStreams", "symbol", symbol);
3865
+ assertParamExists6("partialBookDepthStreams", "levels", levels);
3866
+ return replaceWebsocketStreamsPlaceholders(
3867
+ "/<symbol>@depth<levels><updateSpeed>".slice(1),
3868
+ { symbol, levels, id, updateSpeed }
3869
+ );
3870
+ },
3871
+ /**
3872
+ * 24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent.
3873
+ *
3874
+ * Update Speed: 1000ms
3875
+ *
3876
+ * @summary 24-hour TICKER
3877
+ * @param {string} symbol The symbol parameter
3878
+ * @param {string} [id] Unique WebSocket request ID.
3879
+ *
3880
+ * @throws {RequiredError}
3881
+ */
3882
+ ticker24Hour: (symbol, id) => {
3883
+ assertParamExists6("ticker24Hour", "symbol", symbol);
3884
+ return replaceWebsocketStreamsPlaceholders("/<symbol>@ticker".slice(1), { symbol, id });
3885
+ },
3886
+ /**
3887
+ * 24hr ticker info by underlying asset and expiration date. E.g.[ETH@ticker@220930](wss://nbstream.binance.com/eoptions/stream?streams=ETH@ticker@220930)
3888
+ *
3889
+ * Update Speed: 1000ms
3890
+ *
3891
+ * @summary 24-hour TICKER by underlying asset and expiration data
3892
+ * @param {string} underlyingAsset The underlyingAsset parameter
3893
+ * @param {string} expirationDate The expirationDate parameter
3894
+ * @param {string} [id] Unique WebSocket request ID.
3895
+ *
3896
+ * @throws {RequiredError}
3897
+ */
3898
+ ticker24HourByUnderlyingAssetAndExpirationData: (underlyingAsset, expirationDate, id) => {
3899
+ assertParamExists6(
3900
+ "ticker24HourByUnderlyingAssetAndExpirationData",
3901
+ "underlyingAsset",
3902
+ underlyingAsset
3903
+ );
3904
+ assertParamExists6(
3905
+ "ticker24HourByUnderlyingAssetAndExpirationData",
3906
+ "expirationDate",
3907
+ expirationDate
3908
+ );
3909
+ return replaceWebsocketStreamsPlaceholders(
3910
+ "/<underlyingAsset>@ticker@<expirationDate>".slice(1),
3911
+ { underlyingAsset, expirationDate, id }
3912
+ );
3913
+ },
3914
+ /**
3915
+ * The Trade Streams push raw trade information for specific symbol or underlying asset. E.g.[ETH@trade](wss://nbstream.binance.com/eoptions/stream?streams=ETH@trade)
3916
+ *
3917
+ * Update Speed: 50ms
3918
+ *
3919
+ * @summary Trade Streams
3920
+ * @param {string} symbol The symbol parameter
3921
+ * @param {string} [id] Unique WebSocket request ID.
3922
+ *
3923
+ * @throws {RequiredError}
3924
+ */
3925
+ tradeStreams: (symbol, id) => {
3926
+ assertParamExists6("tradeStreams", "symbol", symbol);
3927
+ return replaceWebsocketStreamsPlaceholders("/<symbol>@trade".slice(1), { symbol, id });
3928
+ }
3929
+ };
3930
+ };
3931
+ var WebsocketMarketStreamsApi = class {
3932
+ constructor(websocketBase) {
3933
+ this.websocketBase = websocketBase;
3934
+ this.localVarParamCreator = WebsocketMarketStreamsApiParamCreator();
3935
+ }
3936
+ /**
3937
+ * Underlying(e.g ETHUSDT) index stream.
3938
+ *
3939
+ * Update Speed: 1000ms
3940
+ *
3941
+ * @summary Index Price Streams
3942
+ * @param {IndexPriceStreamsRequest} requestParameters Request parameters.
3943
+ * @returns {WebsocketStream<IndexPriceStreamsResponse>}
3944
+ * @throws {RequiredError}
3945
+ * @memberof WebsocketMarketStreamsApi
3946
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Index-Price-Streams Binance API Documentation}
3947
+ */
3948
+ indexPriceStreams(requestParameters) {
3949
+ const stream = this.localVarParamCreator.indexPriceStreams(
3950
+ requestParameters?.symbol,
3951
+ requestParameters?.id
3952
+ );
3953
+ return createStreamHandler(
3954
+ this.websocketBase,
3955
+ stream,
3956
+ requestParameters?.id
3957
+ );
3958
+ }
3959
+ /**
3960
+ * The Kline/Candlestick Stream push updates to the current klines/candlestick every 1000 milliseconds (if existing).
3961
+ *
3962
+ * Update Speed: 1000ms
3963
+ *
3964
+ * @summary Kline/Candlestick Streams
3965
+ * @param {KlineCandlestickStreamsRequest} requestParameters Request parameters.
3966
+ * @returns {WebsocketStream<KlineCandlestickStreamsResponse>}
3967
+ * @throws {RequiredError}
3968
+ * @memberof WebsocketMarketStreamsApi
3969
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Kline-Candlestick-Streams Binance API Documentation}
3970
+ */
3971
+ klineCandlestickStreams(requestParameters) {
3972
+ const stream = this.localVarParamCreator.klineCandlestickStreams(
3973
+ requestParameters?.symbol,
3974
+ requestParameters?.interval,
3975
+ requestParameters?.id
3976
+ );
3977
+ return createStreamHandler(
3978
+ this.websocketBase,
3979
+ stream,
3980
+ requestParameters?.id
3981
+ );
3982
+ }
3983
+ /**
3984
+ * The mark price for all option symbols on specific underlying asset. E.g.[ETH@markPrice](wss://nbstream.binance.com/eoptions/stream?streams=ETH@markPrice)
3985
+ *
3986
+ * Update Speed: 1000ms
3987
+ *
3988
+ * @summary Mark Price
3989
+ * @param {MarkPriceRequest} requestParameters Request parameters.
3990
+ * @returns {WebsocketStream<MarkPriceResponse>}
3991
+ * @throws {RequiredError}
3992
+ * @memberof WebsocketMarketStreamsApi
3993
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Mark-Price Binance API Documentation}
3994
+ */
3995
+ markPrice(requestParameters) {
3996
+ const stream = this.localVarParamCreator.markPrice(
3997
+ requestParameters?.underlyingAsset,
3998
+ requestParameters?.id
3999
+ );
4000
+ return createStreamHandler(
4001
+ this.websocketBase,
4002
+ stream,
4003
+ requestParameters?.id
4004
+ );
4005
+ }
4006
+ /**
4007
+ * New symbol listing stream.
4008
+ *
4009
+ * Update Speed: 50ms
4010
+ *
4011
+ * @summary New Symbol Info
4012
+ * @param {NewSymbolInfoRequest} requestParameters Request parameters.
4013
+ * @returns {WebsocketStream<NewSymbolInfoResponse>}
4014
+ * @throws {RequiredError}
4015
+ * @memberof WebsocketMarketStreamsApi
4016
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/New-Symbol-Info Binance API Documentation}
4017
+ */
4018
+ newSymbolInfo(requestParameters = {}) {
4019
+ const stream = this.localVarParamCreator.newSymbolInfo(requestParameters?.id);
4020
+ return createStreamHandler(
4021
+ this.websocketBase,
4022
+ stream,
4023
+ requestParameters?.id
4024
+ );
4025
+ }
4026
+ /**
4027
+ * Option open interest for specific underlying asset on specific expiration date. E.g.[ETH@openInterest@221125](wss://nbstream.binance.com/eoptions/stream?streams=ETH@openInterest@221125)
4028
+ *
4029
+ * Update Speed: 60s
4030
+ *
4031
+ * @summary Open Interest
4032
+ * @param {OpenInterestRequest} requestParameters Request parameters.
4033
+ * @returns {WebsocketStream<OpenInterestResponse>}
4034
+ * @throws {RequiredError}
4035
+ * @memberof WebsocketMarketStreamsApi
4036
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Open-Interest Binance API Documentation}
4037
+ */
4038
+ openInterest(requestParameters) {
4039
+ const stream = this.localVarParamCreator.openInterest(
4040
+ requestParameters?.underlyingAsset,
4041
+ requestParameters?.expirationDate,
4042
+ requestParameters?.id
4043
+ );
4044
+ return createStreamHandler(
4045
+ this.websocketBase,
4046
+ stream,
4047
+ requestParameters?.id
4048
+ );
4049
+ }
4050
+ /**
4051
+ * Top **<levels\>** bids and asks, Valid levels are **<levels\>** are 10, 20, 50, 100.
4052
+ *
4053
+ * Update Speed: 100ms or 1000ms, 500ms(default when update speed isn't used)
4054
+ *
4055
+ * @summary Partial Book Depth Streams
4056
+ * @param {PartialBookDepthStreamsRequest} requestParameters Request parameters.
4057
+ * @returns {WebsocketStream<PartialBookDepthStreamsResponse>}
4058
+ * @throws {RequiredError}
4059
+ * @memberof WebsocketMarketStreamsApi
4060
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Partial-Book-Depth-Streams Binance API Documentation}
4061
+ */
4062
+ partialBookDepthStreams(requestParameters) {
4063
+ const stream = this.localVarParamCreator.partialBookDepthStreams(
4064
+ requestParameters?.symbol,
4065
+ requestParameters?.levels,
4066
+ requestParameters?.id,
4067
+ requestParameters?.updateSpeed
4068
+ );
4069
+ return createStreamHandler(
4070
+ this.websocketBase,
4071
+ stream,
4072
+ requestParameters?.id
4073
+ );
4074
+ }
4075
+ /**
4076
+ * 24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent.
4077
+ *
4078
+ * Update Speed: 1000ms
4079
+ *
4080
+ * @summary 24-hour TICKER
4081
+ * @param {Ticker24HourRequest} requestParameters Request parameters.
4082
+ * @returns {WebsocketStream<Ticker24HourResponse>}
4083
+ * @throws {RequiredError}
4084
+ * @memberof WebsocketMarketStreamsApi
4085
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/24-hour-TICKER Binance API Documentation}
4086
+ */
4087
+ ticker24Hour(requestParameters) {
4088
+ const stream = this.localVarParamCreator.ticker24Hour(
4089
+ requestParameters?.symbol,
4090
+ requestParameters?.id
4091
+ );
4092
+ return createStreamHandler(
4093
+ this.websocketBase,
4094
+ stream,
4095
+ requestParameters?.id
4096
+ );
4097
+ }
4098
+ /**
4099
+ * 24hr ticker info by underlying asset and expiration date. E.g.[ETH@ticker@220930](wss://nbstream.binance.com/eoptions/stream?streams=ETH@ticker@220930)
4100
+ *
4101
+ * Update Speed: 1000ms
4102
+ *
4103
+ * @summary 24-hour TICKER by underlying asset and expiration data
4104
+ * @param {Ticker24HourByUnderlyingAssetAndExpirationDataRequest} requestParameters Request parameters.
4105
+ * @returns {WebsocketStream<Ticker24HourByUnderlyingAssetAndExpirationDataResponse>}
4106
+ * @throws {RequiredError}
4107
+ * @memberof WebsocketMarketStreamsApi
4108
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/24-hour-TICKER-by-underlying-asset-and-expiration-data Binance API Documentation}
4109
+ */
4110
+ ticker24HourByUnderlyingAssetAndExpirationData(requestParameters) {
4111
+ const stream = this.localVarParamCreator.ticker24HourByUnderlyingAssetAndExpirationData(
4112
+ requestParameters?.underlyingAsset,
4113
+ requestParameters?.expirationDate,
4114
+ requestParameters?.id
4115
+ );
4116
+ return createStreamHandler(
4117
+ this.websocketBase,
4118
+ stream,
4119
+ requestParameters?.id
4120
+ );
4121
+ }
4122
+ /**
4123
+ * The Trade Streams push raw trade information for specific symbol or underlying asset. E.g.[ETH@trade](wss://nbstream.binance.com/eoptions/stream?streams=ETH@trade)
4124
+ *
4125
+ * Update Speed: 50ms
4126
+ *
4127
+ * @summary Trade Streams
4128
+ * @param {TradeStreamsRequest} requestParameters Request parameters.
4129
+ * @returns {WebsocketStream<TradeStreamsResponse>}
4130
+ * @throws {RequiredError}
4131
+ * @memberof WebsocketMarketStreamsApi
4132
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Trade-Streams Binance API Documentation}
4133
+ */
4134
+ tradeStreams(requestParameters) {
4135
+ const stream = this.localVarParamCreator.tradeStreams(
4136
+ requestParameters?.symbol,
4137
+ requestParameters?.id
4138
+ );
4139
+ return createStreamHandler(
4140
+ this.websocketBase,
4141
+ stream,
4142
+ requestParameters?.id
4143
+ );
4144
+ }
4145
+ };
4146
+
4147
+ // src/websocket-streams/websocket-streams.ts
4148
+ import { WebsocketStreamsBase as WebsocketStreamsBase3 } from "@binance/common";
4149
+
4150
+ // src/websocket-streams/websocket-streams-connection.ts
4151
+ import { createStreamHandler as createStreamHandler2 } from "@binance/common";
4152
+ var WebsocketStreamsConnection = class {
4153
+ constructor(websocketBase) {
4154
+ this.websocketBase = websocketBase;
4155
+ this.websocketMarketStreamsApi = new WebsocketMarketStreamsApi(websocketBase);
4156
+ }
4157
+ /**
4158
+ * Adds an event listener for the specified WebSocket event.
4159
+ * @param event - The WebSocket event to listen for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
4160
+ * @param listener - The callback function to be executed when the event is triggered. The function can accept any number of arguments.
4161
+ */
4162
+ on(event, listener) {
4163
+ this.websocketBase.on(event, listener);
4164
+ }
4165
+ /**
4166
+ * Removes an event listener for the specified WebSocket event.
4167
+ * @param event - The WebSocket event to stop listening for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
4168
+ * @param listener - The callback function that was previously added as the event listener.
4169
+ */
4170
+ off(event, listener) {
4171
+ this.websocketBase.off(event, listener);
4172
+ }
4173
+ /**
4174
+ * Disconnects from the WebSocket server.
4175
+ * If there is no active connection, a warning is logged.
4176
+ * Otherwise, all connections in the connection pool are closed gracefully,
4177
+ * and a message is logged indicating that the connection has been disconnected.
4178
+ * @returns A Promise that resolves when all connections have been closed.
4179
+ * @throws Error if the WebSocket client is not set.
4180
+ */
4181
+ disconnect() {
4182
+ return this.websocketBase.disconnect();
4183
+ }
4184
+ /**
4185
+ * Checks if the WebSocket connection is currently open.
4186
+ * @returns `true` if the connection is open, `false` otherwise.
4187
+ */
4188
+ isConnected() {
4189
+ return this.websocketBase.isConnected();
4190
+ }
4191
+ /**
4192
+ * Sends a ping message to all connected Websocket servers in the pool.
4193
+ * If no connections are ready, a warning is logged.
4194
+ * For each active connection, the ping message is sent, and debug logs provide details.
4195
+ * @throws Error if a Websocket client is not set for a connection.
4196
+ */
4197
+ pingServer() {
4198
+ this.websocketBase.pingServer();
4199
+ }
4200
+ /**
4201
+ * Subscribes to one or multiple WebSocket streams
4202
+ * Handles both single and pool modes
4203
+ * @param stream Single stream name or array of stream names to subscribe to
4204
+ * @param id Optional subscription ID
4205
+ * @returns void
4206
+ */
4207
+ subscribe(stream, id) {
4208
+ this.websocketBase.subscribe(stream, id);
4209
+ }
4210
+ /**
4211
+ * Unsubscribes from one or multiple WebSocket streams
4212
+ * Handles both single and pool modes
4213
+ * @param stream Single stream name or array of stream names to unsubscribe from
4214
+ * @param id Optional unsubscription ID
4215
+ * @returns void
4216
+ */
4217
+ unsubscribe(stream, id) {
4218
+ this.websocketBase.unsubscribe(stream, id);
4219
+ }
4220
+ /**
4221
+ * Checks if the WebSocket connection is subscribed to the specified stream.
4222
+ * @param stream The name of the WebSocket stream to check.
4223
+ * @returns `true` if the connection is subscribed to the stream, `false` otherwise.
4224
+ */
4225
+ isSubscribed(stream) {
4226
+ return this.websocketBase.isSubscribed(stream);
4227
+ }
4228
+ /**
4229
+ * Subscribes to the user data WebSocket stream using the provided listen key.
4230
+ * @param listenKey - The listen key for the user data WebSocket stream.
4231
+ * @param id - Optional user data stream ID
4232
+ * @returns A WebSocket stream handler for the user data stream.
4233
+ */
4234
+ userData(listenKey, id) {
4235
+ return createStreamHandler2(this.websocketBase, listenKey, id);
4236
+ }
4237
+ /**
4238
+ * Underlying(e.g ETHUSDT) index stream.
4239
+ *
4240
+ * Update Speed: 1000ms
4241
+ *
4242
+ * @summary Index Price Streams
4243
+ * @param {IndexPriceStreamsRequest} requestParameters Request parameters.
4244
+ * @returns {WebsocketStream<IndexPriceStreamsResponse>}
4245
+ * @throws {RequiredError}
4246
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Index-Price-Streams Binance API Documentation}
4247
+ */
4248
+ indexPriceStreams(requestParameters) {
4249
+ return this.websocketMarketStreamsApi.indexPriceStreams(requestParameters);
4250
+ }
4251
+ /**
4252
+ * The Kline/Candlestick Stream push updates to the current klines/candlestick every 1000 milliseconds (if existing).
4253
+ *
4254
+ * Update Speed: 1000ms
4255
+ *
4256
+ * @summary Kline/Candlestick Streams
4257
+ * @param {KlineCandlestickStreamsRequest} requestParameters Request parameters.
4258
+ * @returns {WebsocketStream<KlineCandlestickStreamsResponse>}
4259
+ * @throws {RequiredError}
4260
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Kline-Candlestick-Streams Binance API Documentation}
4261
+ */
4262
+ klineCandlestickStreams(requestParameters) {
4263
+ return this.websocketMarketStreamsApi.klineCandlestickStreams(requestParameters);
4264
+ }
4265
+ /**
4266
+ * The mark price for all option symbols on specific underlying asset. E.g.[ETH@markPrice](wss://nbstream.binance.com/eoptions/stream?streams=ETH@markPrice)
4267
+ *
4268
+ * Update Speed: 1000ms
4269
+ *
4270
+ * @summary Mark Price
4271
+ * @param {MarkPriceRequest} requestParameters Request parameters.
4272
+ * @returns {WebsocketStream<MarkPriceResponse>}
4273
+ * @throws {RequiredError}
4274
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Mark-Price Binance API Documentation}
4275
+ */
4276
+ markPrice(requestParameters) {
4277
+ return this.websocketMarketStreamsApi.markPrice(requestParameters);
4278
+ }
4279
+ /**
4280
+ * New symbol listing stream.
4281
+ *
4282
+ * Update Speed: 50ms
4283
+ *
4284
+ * @summary New Symbol Info
4285
+ * @param {NewSymbolInfoRequest} requestParameters Request parameters.
4286
+ * @returns {WebsocketStream<NewSymbolInfoResponse>}
4287
+ * @throws {RequiredError}
4288
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/New-Symbol-Info Binance API Documentation}
4289
+ */
4290
+ newSymbolInfo(requestParameters = {}) {
4291
+ return this.websocketMarketStreamsApi.newSymbolInfo(requestParameters);
4292
+ }
4293
+ /**
4294
+ * Option open interest for specific underlying asset on specific expiration date. E.g.[ETH@openInterest@221125](wss://nbstream.binance.com/eoptions/stream?streams=ETH@openInterest@221125)
4295
+ *
4296
+ * Update Speed: 60s
4297
+ *
4298
+ * @summary Open Interest
4299
+ * @param {OpenInterestRequest} requestParameters Request parameters.
4300
+ * @returns {WebsocketStream<OpenInterestResponse>}
4301
+ * @throws {RequiredError}
4302
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Open-Interest Binance API Documentation}
4303
+ */
4304
+ openInterest(requestParameters) {
4305
+ return this.websocketMarketStreamsApi.openInterest(requestParameters);
4306
+ }
4307
+ /**
4308
+ * Top **<levels\>** bids and asks, Valid levels are **<levels\>** are 10, 20, 50, 100.
4309
+ *
4310
+ * Update Speed: 100ms or 1000ms, 500ms(default when update speed isn't used)
4311
+ *
4312
+ * @summary Partial Book Depth Streams
4313
+ * @param {PartialBookDepthStreamsRequest} requestParameters Request parameters.
4314
+ * @returns {WebsocketStream<PartialBookDepthStreamsResponse>}
4315
+ * @throws {RequiredError}
4316
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Partial-Book-Depth-Streams Binance API Documentation}
4317
+ */
4318
+ partialBookDepthStreams(requestParameters) {
4319
+ return this.websocketMarketStreamsApi.partialBookDepthStreams(requestParameters);
4320
+ }
4321
+ /**
4322
+ * 24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent.
4323
+ *
4324
+ * Update Speed: 1000ms
4325
+ *
4326
+ * @summary 24-hour TICKER
4327
+ * @param {Ticker24HourRequest} requestParameters Request parameters.
4328
+ * @returns {WebsocketStream<Ticker24HourResponse>}
4329
+ * @throws {RequiredError}
4330
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/24-hour-TICKER Binance API Documentation}
4331
+ */
4332
+ ticker24Hour(requestParameters) {
4333
+ return this.websocketMarketStreamsApi.ticker24Hour(requestParameters);
4334
+ }
4335
+ /**
4336
+ * 24hr ticker info by underlying asset and expiration date. E.g.[ETH@ticker@220930](wss://nbstream.binance.com/eoptions/stream?streams=ETH@ticker@220930)
4337
+ *
4338
+ * Update Speed: 1000ms
4339
+ *
4340
+ * @summary 24-hour TICKER by underlying asset and expiration data
4341
+ * @param {Ticker24HourByUnderlyingAssetAndExpirationDataRequest} requestParameters Request parameters.
4342
+ * @returns {WebsocketStream<Ticker24HourByUnderlyingAssetAndExpirationDataResponse>}
4343
+ * @throws {RequiredError}
4344
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/24-hour-TICKER-by-underlying-asset-and-expiration-data Binance API Documentation}
4345
+ */
4346
+ ticker24HourByUnderlyingAssetAndExpirationData(requestParameters) {
4347
+ return this.websocketMarketStreamsApi.ticker24HourByUnderlyingAssetAndExpirationData(
4348
+ requestParameters
4349
+ );
4350
+ }
4351
+ /**
4352
+ * The Trade Streams push raw trade information for specific symbol or underlying asset. E.g.[ETH@trade](wss://nbstream.binance.com/eoptions/stream?streams=ETH@trade)
4353
+ *
4354
+ * Update Speed: 50ms
4355
+ *
4356
+ * @summary Trade Streams
4357
+ * @param {TradeStreamsRequest} requestParameters Request parameters.
4358
+ * @returns {WebsocketStream<TradeStreamsResponse>}
4359
+ * @throws {RequiredError}
4360
+ * @see {@link https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Trade-Streams Binance API Documentation}
4361
+ */
4362
+ tradeStreams(requestParameters) {
4363
+ return this.websocketMarketStreamsApi.tradeStreams(requestParameters);
4364
+ }
4365
+ };
4366
+
4367
+ // src/websocket-streams/websocket-streams.ts
4368
+ var WebsocketStreams = class {
4369
+ constructor(configuration) {
4370
+ this.configuration = configuration;
4371
+ }
4372
+ /**
4373
+ * Connects to the Binance WebSocket streams and returns a `WebsocketStreamsConnection` instance.
4374
+ *
4375
+ * @param {object} [options] - Optional connection options.
4376
+ * @param {string|string[]} [options.stream] - The stream(s) to connect to.
4377
+ * @param {'single'|'pool'} [options.mode] - The connection mode, either 'single' or 'pool'. Overwrite the `mode` option in the configuration.
4378
+ * @param {number} [options.poolSize] - The number of connections to use in pool mode. Overwrite the `poolSize` option in the configuration.
4379
+ * @returns {Promise<WebsocketStreamsConnection>} - A promise that resolves to a `WebsocketStreamsConnection` instance.
4380
+ */
4381
+ async connect({
4382
+ stream,
4383
+ mode,
4384
+ poolSize
4385
+ } = {}) {
4386
+ const websocketBase = new WebsocketStreamsBase3({
4387
+ ...this.configuration,
4388
+ ...mode && { mode },
4389
+ ...poolSize && { poolSize }
4390
+ });
4391
+ const websocketStreamsConnection = new WebsocketStreamsConnection(websocketBase);
4392
+ await websocketBase.connect(stream);
4393
+ return websocketStreamsConnection;
4394
+ }
4395
+ };
4396
+
4397
+ // src/derivatives-trading-options.ts
4398
+ var DerivativesTradingOptions = class {
4399
+ constructor(config) {
4400
+ if (config?.configurationRestAPI) {
4401
+ const configRestAPI = new ConfigurationRestAPI8(config.configurationRestAPI);
4402
+ configRestAPI.basePath = configRestAPI.basePath || DERIVATIVES_TRADING_OPTIONS_REST_API_PROD_URL;
4403
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
4404
+ configRestAPI.baseOptions.headers = {
4405
+ ...configRestAPI.baseOptions.headers || {},
4406
+ "User-Agent": `${name}/${version} (Node.js/${process.version}; ${platform()}; ${arch()})`
4407
+ };
4408
+ this.restAPI = new RestAPI(configRestAPI);
4409
+ }
4410
+ if (config?.configurationWebsocketStreams) {
4411
+ const configWebsocketStreams = new ConfigurationWebsocketStreams2(
4412
+ config.configurationWebsocketStreams
4413
+ );
4414
+ configWebsocketStreams.wsURL = configWebsocketStreams.wsURL || DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_PROD_URL;
4415
+ this.websocketStreams = new WebsocketStreams(configWebsocketStreams);
4416
+ }
4417
+ }
4418
+ };
4419
+
4420
+ // src/index.ts
4421
+ import {
4422
+ DERIVATIVES_TRADING_OPTIONS_REST_API_PROD_URL as DERIVATIVES_TRADING_OPTIONS_REST_API_PROD_URL2,
4423
+ DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_PROD_URL as DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_PROD_URL2,
4424
+ ConnectorClientError,
4425
+ RequiredError,
4426
+ UnauthorizedError,
4427
+ ForbiddenError,
4428
+ TooManyRequestsError,
4429
+ RateLimitBanError,
4430
+ ServerError,
4431
+ NetworkError,
4432
+ NotFoundError,
4433
+ BadRequestError
4434
+ } from "@binance/common";
4435
+ export {
4436
+ BadRequestError,
4437
+ ConnectorClientError,
4438
+ DERIVATIVES_TRADING_OPTIONS_REST_API_PROD_URL2 as DERIVATIVES_TRADING_OPTIONS_REST_API_PROD_URL,
4439
+ DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_PROD_URL2 as DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_PROD_URL,
4440
+ DerivativesTradingOptions,
4441
+ rest_api_exports as DerivativesTradingOptionsRestAPI,
4442
+ websocket_streams_exports as DerivativesTradingOptionsWebsocketStreams,
4443
+ ForbiddenError,
4444
+ NetworkError,
4445
+ NotFoundError,
4446
+ RateLimitBanError,
4447
+ RequiredError,
4448
+ ServerError,
4449
+ TooManyRequestsError,
4450
+ UnauthorizedError
4451
+ };
4452
+ //# sourceMappingURL=index.mjs.map