@binance/alpha 1.0.15 → 2.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.js CHANGED
@@ -14,14 +14,14 @@ let __binance_common = require("@binance/common");
14
14
 
15
15
  //#region package.json
16
16
  var name = "@binance/alpha";
17
- var version = "1.0.15";
17
+ var version = "2.0.0";
18
18
 
19
19
  //#endregion
20
20
  //#region src/rest-api/modules/market-data-api.ts
21
21
  /**
22
- * Binance Alpha REST API
22
+ * Alpha Trading REST API
23
23
  *
24
- * OpenAPI Specification for the Binance Alpha REST API
24
+ * APIs for Binance Alpha Trading.
25
25
  *
26
26
  * The version of the OpenAPI document: 1.0.0
27
27
  *
@@ -56,6 +56,24 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
56
56
  timeUnit: _timeUnit
57
57
  };
58
58
  },
59
+ fullDepth: async (symbol, limit) => {
60
+ (0, __binance_common.assertParamExists)("fullDepth", "symbol", symbol);
61
+ const localVarQueryParameter = {};
62
+ const localVarBodyParameter = {};
63
+ const localVarHeaderParameter = {};
64
+ if (symbol !== void 0 && symbol !== null) localVarQueryParameter["symbol"] = symbol;
65
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
66
+ let _timeUnit;
67
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
68
+ return {
69
+ endpoint: "/bapi/defi/v1/public/alpha-trade/fullDepth",
70
+ method: "GET",
71
+ queryParams: localVarQueryParameter,
72
+ bodyParams: localVarBodyParameter,
73
+ headerParams: localVarHeaderParameter,
74
+ timeUnit: _timeUnit
75
+ };
76
+ },
59
77
  getExchangeInfo: async () => {
60
78
  const localVarQueryParameter = {};
61
79
  const localVarBodyParameter = {};
@@ -139,29 +157,39 @@ var MarketDataApi = class {
139
157
  /**
140
158
  * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.
141
159
  *
142
- * Weight: 0
143
- *
144
160
  * @summary Aggregated Trades
145
161
  * @param {AggregatedTradesRequest} requestParameters Request parameters.
146
162
  * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}
147
163
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
148
164
  * @memberof MarketDataApi
149
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}
165
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#aggregated-trades Binance API Documentation}
150
166
  */
151
167
  async aggregatedTrades(requestParameters) {
152
168
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.aggregatedTrades(requestParameters?.symbol, requestParameters?.fromId, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.limit);
153
169
  return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
154
170
  }
155
171
  /**
156
- * Fetches general exchange information, such as supported symbols, rate limits, and server time.
172
+ * Fetches the full order book depth (UI & API orders) for a symbol, including bid and ask orders with their prices and quantities.
157
173
  *
158
- * Weight: 0
174
+ * @summary Full Depth
175
+ * @param {FullDepthRequest} requestParameters Request parameters.
176
+ * @returns {Promise<RestApiResponse<FullDepthResponse>>}
177
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
178
+ * @memberof MarketDataApi
179
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#full-depth Binance API Documentation}
180
+ */
181
+ async fullDepth(requestParameters) {
182
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.fullDepth(requestParameters?.symbol, requestParameters?.limit);
183
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
184
+ }
185
+ /**
186
+ * Fetches general exchange information, such as supported symbols, rate limits, and server time.
159
187
  *
160
188
  * @summary Get Exchange Info
161
189
  * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}
162
190
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
163
191
  * @memberof MarketDataApi
164
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}
192
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#get-exchange-info Binance API Documentation}
165
193
  */
166
194
  async getExchangeInfo() {
167
195
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.getExchangeInfo();
@@ -170,14 +198,12 @@ var MarketDataApi = class {
170
198
  /**
171
199
  * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.
172
200
  *
173
- * Weight: 0
174
- *
175
- * @summary Klines (Candlestick Data)
201
+ * @summary Klines
176
202
  * @param {KlinesRequest} requestParameters Request parameters.
177
203
  * @returns {Promise<RestApiResponse<KlinesResponse>>}
178
204
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
179
205
  * @memberof MarketDataApi
180
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}
206
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#klines Binance API Documentation}
181
207
  */
182
208
  async klines(requestParameters) {
183
209
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.klines(requestParameters?.symbol, requestParameters?.interval, requestParameters?.limit, requestParameters?.startTime, requestParameters?.endTime);
@@ -186,14 +212,12 @@ var MarketDataApi = class {
186
212
  /**
187
213
  * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.
188
214
  *
189
- * Weight: 0
190
- *
191
- * @summary Ticker (24hr Price Statistics)
215
+ * @summary Ticker
192
216
  * @param {TickerRequest} requestParameters Request parameters.
193
217
  * @returns {Promise<RestApiResponse<TickerResponse>>}
194
218
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
195
219
  * @memberof MarketDataApi
196
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}
220
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#ticker Binance API Documentation}
197
221
  */
198
222
  async ticker(requestParameters) {
199
223
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.ticker(requestParameters?.symbol);
@@ -202,26 +226,54 @@ var MarketDataApi = class {
202
226
  /**
203
227
  * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.
204
228
  *
205
- * Weight: 0
206
- *
207
229
  * @summary Token List
208
230
  * @returns {Promise<RestApiResponse<TokenListResponse>>}
209
231
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
210
232
  * @memberof MarketDataApi
211
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}
233
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#token-list Binance API Documentation}
212
234
  */
213
235
  async tokenList() {
214
236
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.tokenList();
215
237
  return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
216
238
  }
217
239
  };
240
+ let FullDepthLimitEnum = /* @__PURE__ */ function(FullDepthLimitEnum$1) {
241
+ FullDepthLimitEnum$1[FullDepthLimitEnum$1["LIMIT_5"] = 5] = "LIMIT_5";
242
+ FullDepthLimitEnum$1[FullDepthLimitEnum$1["LIMIT_10"] = 10] = "LIMIT_10";
243
+ FullDepthLimitEnum$1[FullDepthLimitEnum$1["LIMIT_20"] = 20] = "LIMIT_20";
244
+ FullDepthLimitEnum$1[FullDepthLimitEnum$1["LIMIT_50"] = 50] = "LIMIT_50";
245
+ FullDepthLimitEnum$1[FullDepthLimitEnum$1["LIMIT_100"] = 100] = "LIMIT_100";
246
+ FullDepthLimitEnum$1[FullDepthLimitEnum$1["LIMIT_500"] = 500] = "LIMIT_500";
247
+ FullDepthLimitEnum$1[FullDepthLimitEnum$1["LIMIT_1000"] = 1e3] = "LIMIT_1000";
248
+ return FullDepthLimitEnum$1;
249
+ }({});
250
+ let KlinesIntervalEnum = /* @__PURE__ */ function(KlinesIntervalEnum$1) {
251
+ KlinesIntervalEnum$1["INTERVAL_1s"] = "1s";
252
+ KlinesIntervalEnum$1["INTERVAL_15s"] = "15s";
253
+ KlinesIntervalEnum$1["INTERVAL_1m"] = "1m";
254
+ KlinesIntervalEnum$1["INTERVAL_3m"] = "3m";
255
+ KlinesIntervalEnum$1["INTERVAL_5m"] = "5m";
256
+ KlinesIntervalEnum$1["INTERVAL_15m"] = "15m";
257
+ KlinesIntervalEnum$1["INTERVAL_30m"] = "30m";
258
+ KlinesIntervalEnum$1["INTERVAL_1h"] = "1h";
259
+ KlinesIntervalEnum$1["INTERVAL_2h"] = "2h";
260
+ KlinesIntervalEnum$1["INTERVAL_4h"] = "4h";
261
+ KlinesIntervalEnum$1["INTERVAL_6h"] = "6h";
262
+ KlinesIntervalEnum$1["INTERVAL_8h"] = "8h";
263
+ KlinesIntervalEnum$1["INTERVAL_12h"] = "12h";
264
+ KlinesIntervalEnum$1["INTERVAL_1d"] = "1d";
265
+ KlinesIntervalEnum$1["INTERVAL_3d"] = "3d";
266
+ KlinesIntervalEnum$1["INTERVAL_1w"] = "1w";
267
+ KlinesIntervalEnum$1["INTERVAL_1M"] = "1M";
268
+ return KlinesIntervalEnum$1;
269
+ }({});
218
270
 
219
271
  //#endregion
220
272
  //#region src/rest-api/rest-api.ts
221
273
  /**
222
- * Binance Alpha REST API
274
+ * Alpha Trading REST API
223
275
  *
224
- * OpenAPI Specification for the Binance Alpha REST API
276
+ * APIs for Binance Alpha Trading.
225
277
  *
226
278
  * The version of the OpenAPI document: 1.0.0
227
279
  *
@@ -262,28 +314,37 @@ var RestAPI = class {
262
314
  /**
263
315
  * Retrieves compressed, aggregated historical trades for a specific symbol. Useful for recent trade history.
264
316
  *
265
- * Weight: 0
266
- *
267
317
  * @summary Aggregated Trades
268
318
  * @param {AggregatedTradesRequest} requestParameters Request parameters.
269
319
  *
270
320
  * @returns {Promise<RestApiResponse<AggregatedTradesResponse>>}
271
321
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
272
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Aggregated-Trades Binance API Documentation}
322
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#aggregated-trades Binance API Documentation}
273
323
  */
274
324
  aggregatedTrades(requestParameters) {
275
325
  return this.marketDataApi.aggregatedTrades(requestParameters);
276
326
  }
277
327
  /**
278
- * Fetches general exchange information, such as supported symbols, rate limits, and server time.
328
+ * Fetches the full order book depth (UI & API orders) for a symbol, including bid and ask orders with their prices and quantities.
329
+ *
330
+ * @summary Full Depth
331
+ * @param {FullDepthRequest} requestParameters Request parameters.
279
332
  *
280
- * Weight: 0
333
+ * @returns {Promise<RestApiResponse<FullDepthResponse>>}
334
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
335
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#full-depth Binance API Documentation}
336
+ */
337
+ fullDepth(requestParameters) {
338
+ return this.marketDataApi.fullDepth(requestParameters);
339
+ }
340
+ /**
341
+ * Fetches general exchange information, such as supported symbols, rate limits, and server time.
281
342
  *
282
343
  * @summary Get Exchange Info
283
344
  *
284
345
  * @returns {Promise<RestApiResponse<GetExchangeInfoResponse>>}
285
346
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
286
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Get-Exchange-Info Binance API Documentation}
347
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#get-exchange-info Binance API Documentation}
287
348
  */
288
349
  getExchangeInfo() {
289
350
  return this.marketDataApi.getExchangeInfo();
@@ -291,14 +352,12 @@ var RestAPI = class {
291
352
  /**
292
353
  * Fetches Kline/candlestick bars for a symbol, which include open/high/low/close prices and volume over intervals. Useful for charting and analysis.
293
354
  *
294
- * Weight: 0
295
- *
296
- * @summary Klines (Candlestick Data)
355
+ * @summary Klines
297
356
  * @param {KlinesRequest} requestParameters Request parameters.
298
357
  *
299
358
  * @returns {Promise<RestApiResponse<KlinesResponse>>}
300
359
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
301
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Klines Binance API Documentation}
360
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#klines Binance API Documentation}
302
361
  */
303
362
  klines(requestParameters) {
304
363
  return this.marketDataApi.klines(requestParameters);
@@ -306,14 +365,12 @@ var RestAPI = class {
306
365
  /**
307
366
  * Gets the 24-hour rolling window price change statistics for a symbol, including volume and price changes.
308
367
  *
309
- * Weight: 0
310
- *
311
- * @summary Ticker (24hr Price Statistics)
368
+ * @summary Ticker
312
369
  * @param {TickerRequest} requestParameters Request parameters.
313
370
  *
314
371
  * @returns {Promise<RestApiResponse<TickerResponse>>}
315
372
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
316
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/24hr-ticker-price-change Binance API Documentation}
373
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#ticker Binance API Documentation}
317
374
  */
318
375
  ticker(requestParameters) {
319
376
  return this.marketDataApi.ticker(requestParameters);
@@ -321,13 +378,11 @@ var RestAPI = class {
321
378
  /**
322
379
  * Retrieves a list of all available ALPHA tokens, including their IDs and symbols. Use this to find the token ID for constructing symbols in other endpoints.
323
380
  *
324
- * Weight: 0
325
- *
326
381
  * @summary Token List
327
382
  *
328
383
  * @returns {Promise<RestApiResponse<TokenListResponse>>}
329
384
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
330
- * @see {@link https://developers.binance.com/docs/alpha/market-data/rest-api/Token-List Binance API Documentation}
385
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/rest-api/market-data#token-list Binance API Documentation}
331
386
  */
332
387
  tokenList() {
333
388
  return this.marketDataApi.tokenList();
@@ -337,10 +392,658 @@ var RestAPI = class {
337
392
  //#endregion
338
393
  //#region src/rest-api/index.ts
339
394
  var rest_api_exports = /* @__PURE__ */ __export({
395
+ FullDepthLimitEnum: () => FullDepthLimitEnum,
396
+ KlinesIntervalEnum: () => KlinesIntervalEnum,
340
397
  MarketDataApi: () => MarketDataApi,
341
398
  RestAPI: () => RestAPI
342
399
  });
343
400
 
401
+ //#endregion
402
+ //#region src/websocket-streams/modules/api.ts
403
+ /**
404
+ * Alpha WebSocket Market Streams
405
+ *
406
+ * Access Alpha market streams over WebSocket.
407
+ *
408
+ * The version of the OpenAPI document: 1.0.0
409
+ *
410
+ *
411
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
412
+ * https://openapi-generator.tech
413
+ * Do not edit the class manually.
414
+ */
415
+ const ApiParamCreator = function() {
416
+ return {
417
+ aggregateTradeStream: (symbol, id) => {
418
+ (0, __binance_common.assertParamExists)("aggregateTradeStream", "symbol", symbol);
419
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@aggTrade".slice(1), {
420
+ symbol,
421
+ id
422
+ });
423
+ },
424
+ allBookTickerStream: (id) => {
425
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/!bookTicker".slice(1), { id });
426
+ },
427
+ allMiniTickerStream: (id) => {
428
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/!miniTicker@arr".slice(1), { id });
429
+ },
430
+ allTickerStream: (id) => {
431
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/!ticker@arr".slice(1), { id });
432
+ },
433
+ allTokens24hTickerStream: (id) => {
434
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/came@allTokens@ticker24".slice(1), { id });
435
+ },
436
+ bookTickerStream: (symbol, id) => {
437
+ (0, __binance_common.assertParamExists)("bookTickerStream", "symbol", symbol);
438
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@bookTicker".slice(1), {
439
+ symbol,
440
+ id
441
+ });
442
+ },
443
+ contractKlineStream: (contractAddress, chainId, interval, id) => {
444
+ (0, __binance_common.assertParamExists)("contractKlineStream", "contractAddress", contractAddress);
445
+ (0, __binance_common.assertParamExists)("contractKlineStream", "chainId", chainId);
446
+ (0, __binance_common.assertParamExists)("contractKlineStream", "interval", interval);
447
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/came@<contractAddress>@<chainId>@kline_<interval>".slice(1), {
448
+ contractAddress,
449
+ chainId,
450
+ interval,
451
+ id
452
+ });
453
+ },
454
+ fullDepthStream: (symbol, interval, id) => {
455
+ (0, __binance_common.assertParamExists)("fullDepthStream", "symbol", symbol);
456
+ (0, __binance_common.assertParamExists)("fullDepthStream", "interval", interval);
457
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@fulldepth@<interval>".slice(1), {
458
+ symbol,
459
+ interval,
460
+ id
461
+ });
462
+ },
463
+ klineStream: (symbol, interval, id) => {
464
+ (0, __binance_common.assertParamExists)("klineStream", "symbol", symbol);
465
+ (0, __binance_common.assertParamExists)("klineStream", "interval", interval);
466
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@kline_<interval>".slice(1), {
467
+ symbol,
468
+ interval,
469
+ id
470
+ });
471
+ },
472
+ miniTickerStream: (symbol, id) => {
473
+ (0, __binance_common.assertParamExists)("miniTickerStream", "symbol", symbol);
474
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@miniTicker".slice(1), {
475
+ symbol,
476
+ id
477
+ });
478
+ },
479
+ partialDepthStream: (symbol, levels, interval, id) => {
480
+ (0, __binance_common.assertParamExists)("partialDepthStream", "symbol", symbol);
481
+ (0, __binance_common.assertParamExists)("partialDepthStream", "levels", levels);
482
+ (0, __binance_common.assertParamExists)("partialDepthStream", "interval", interval);
483
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@depth<levels>@<interval>".slice(1), {
484
+ symbol,
485
+ levels,
486
+ interval,
487
+ id
488
+ });
489
+ },
490
+ tickerStream: (symbol, id) => {
491
+ (0, __binance_common.assertParamExists)("tickerStream", "symbol", symbol);
492
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@ticker".slice(1), {
493
+ symbol,
494
+ id
495
+ });
496
+ },
497
+ tradeStream: (symbol, id) => {
498
+ (0, __binance_common.assertParamExists)("tradeStream", "symbol", symbol);
499
+ return (0, __binance_common.replaceWebsocketStreamsPlaceholders)("/<symbol>@trade".slice(1), {
500
+ symbol,
501
+ id
502
+ });
503
+ }
504
+ };
505
+ };
506
+ /**
507
+ * Api - interface
508
+ * @class Api
509
+ * @extends {WebsocketStreamsBase}
510
+ */
511
+ var Api = class {
512
+ constructor(websocketBase) {
513
+ this.websocketBase = websocketBase;
514
+ this.localVarParamCreator = ApiParamCreator();
515
+ }
516
+ /**
517
+ * Pushes aggregate trade updates for a symbol.
518
+ *
519
+ * @summary Aggregate Trade Stream
520
+ * @param {AggregateTradeStreamRequest} requestParameters Request parameters.
521
+ * @returns {WebsocketStream<AggregateTradeStreamResponse>}
522
+ * @throws {RequiredError}
523
+ * @memberof Api
524
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#aggregate-trade-stream Binance API Documentation}
525
+ */
526
+ aggregateTradeStream(requestParameters) {
527
+ const stream = this.localVarParamCreator.aggregateTradeStream(requestParameters?.symbol, requestParameters?.id);
528
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
529
+ }
530
+ /**
531
+ * Pushes best bid/ask updates for all symbols.
532
+ *
533
+ * @summary All Book Ticker Stream
534
+ * @param {AllBookTickerStreamRequest} requestParameters Request parameters.
535
+ * @returns {WebsocketStream<AllBookTickerStreamResponse>}
536
+ * @throws {RequiredError}
537
+ * @memberof Api
538
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-book-ticker-stream Binance API Documentation}
539
+ */
540
+ allBookTickerStream(requestParameters = {}) {
541
+ const stream = this.localVarParamCreator.allBookTickerStream(requestParameters?.id);
542
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
543
+ }
544
+ /**
545
+ * Pushes mini ticker statistics for all symbols.
546
+ *
547
+ * @summary All Mini Ticker Stream
548
+ * @param {AllMiniTickerStreamRequest} requestParameters Request parameters.
549
+ * @returns {WebsocketStream<AllMiniTickerStreamResponse>}
550
+ * @throws {RequiredError}
551
+ * @memberof Api
552
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-mini-ticker-stream Binance API Documentation}
553
+ */
554
+ allMiniTickerStream(requestParameters = {}) {
555
+ const stream = this.localVarParamCreator.allMiniTickerStream(requestParameters?.id);
556
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
557
+ }
558
+ /**
559
+ * Pushes full ticker statistics for all symbols.
560
+ *
561
+ * @summary All Ticker Stream
562
+ * @param {AllTickerStreamRequest} requestParameters Request parameters.
563
+ * @returns {WebsocketStream<AllTickerStreamResponse>}
564
+ * @throws {RequiredError}
565
+ * @memberof Api
566
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-ticker-stream Binance API Documentation}
567
+ */
568
+ allTickerStream(requestParameters = {}) {
569
+ const stream = this.localVarParamCreator.allTickerStream(requestParameters?.id);
570
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
571
+ }
572
+ /**
573
+ * Pushes 24h ticker-like metrics for all tokens.
574
+ *
575
+ * @summary All Tokens 24h Ticker Stream
576
+ * @param {AllTokens24hTickerStreamRequest} requestParameters Request parameters.
577
+ * @returns {WebsocketStream<AllTokens24hTickerStreamResponse>}
578
+ * @throws {RequiredError}
579
+ * @memberof Api
580
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-tokens24h-ticker-stream Binance API Documentation}
581
+ */
582
+ allTokens24hTickerStream(requestParameters = {}) {
583
+ const stream = this.localVarParamCreator.allTokens24hTickerStream(requestParameters?.id);
584
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
585
+ }
586
+ /**
587
+ * Pushes best bid/ask updates for a symbol.
588
+ *
589
+ * @summary Book Ticker Stream
590
+ * @param {BookTickerStreamRequest} requestParameters Request parameters.
591
+ * @returns {WebsocketStream<BookTickerStreamResponse>}
592
+ * @throws {RequiredError}
593
+ * @memberof Api
594
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#book-ticker-stream Binance API Documentation}
595
+ */
596
+ bookTickerStream(requestParameters) {
597
+ const stream = this.localVarParamCreator.bookTickerStream(requestParameters?.symbol, requestParameters?.id);
598
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
599
+ }
600
+ /**
601
+ * Pushes kline updates by contractAddress@chainId.
602
+ *
603
+ * @summary Contract Kline Stream
604
+ * @param {ContractKlineStreamRequest} requestParameters Request parameters.
605
+ * @returns {WebsocketStream<ContractKlineStreamResponse>}
606
+ * @throws {RequiredError}
607
+ * @memberof Api
608
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#contract-kline-stream Binance API Documentation}
609
+ */
610
+ contractKlineStream(requestParameters) {
611
+ const stream = this.localVarParamCreator.contractKlineStream(requestParameters?.contractAddress, requestParameters?.chainId, requestParameters?.interval, requestParameters?.id);
612
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
613
+ }
614
+ /**
615
+ * Returns all available depth, including UI and API orders.
616
+ *
617
+ * @summary Full Depth Stream
618
+ * @param {FullDepthStreamRequest} requestParameters Request parameters.
619
+ * @returns {WebsocketStream<FullDepthStreamResponse>}
620
+ * @throws {RequiredError}
621
+ * @memberof Api
622
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#full-depth-stream Binance API Documentation}
623
+ */
624
+ fullDepthStream(requestParameters) {
625
+ const stream = this.localVarParamCreator.fullDepthStream(requestParameters?.symbol, requestParameters?.interval, requestParameters?.id);
626
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
627
+ }
628
+ /**
629
+ * Pushes kline updates for a symbol.
630
+ *
631
+ * @summary Kline Stream
632
+ * @param {KlineStreamRequest} requestParameters Request parameters.
633
+ * @returns {WebsocketStream<KlineStreamResponse>}
634
+ * @throws {RequiredError}
635
+ * @memberof Api
636
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#kline-stream Binance API Documentation}
637
+ */
638
+ klineStream(requestParameters) {
639
+ const stream = this.localVarParamCreator.klineStream(requestParameters?.symbol, requestParameters?.interval, requestParameters?.id);
640
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
641
+ }
642
+ /**
643
+ * Pushes 24h rolling mini ticker statistics.
644
+ *
645
+ * @summary Mini Ticker Stream
646
+ * @param {MiniTickerStreamRequest} requestParameters Request parameters.
647
+ * @returns {WebsocketStream<MiniTickerStreamResponse>}
648
+ * @throws {RequiredError}
649
+ * @memberof Api
650
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#mini-ticker-stream Binance API Documentation}
651
+ */
652
+ miniTickerStream(requestParameters) {
653
+ const stream = this.localVarParamCreator.miniTickerStream(requestParameters?.symbol, requestParameters?.id);
654
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
655
+ }
656
+ /**
657
+ * Pushes partial depth updates (UI orders only).
658
+ *
659
+ * @summary Partial Depth Stream
660
+ * @param {PartialDepthStreamRequest} requestParameters Request parameters.
661
+ * @returns {WebsocketStream<PartialDepthStreamResponse>}
662
+ * @throws {RequiredError}
663
+ * @memberof Api
664
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#partial-depth-stream Binance API Documentation}
665
+ */
666
+ partialDepthStream(requestParameters) {
667
+ const stream = this.localVarParamCreator.partialDepthStream(requestParameters?.symbol, requestParameters?.levels, requestParameters?.interval, requestParameters?.id);
668
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
669
+ }
670
+ /**
671
+ * Pushes full 24h rolling ticker statistics.
672
+ *
673
+ * @summary Ticker Stream
674
+ * @param {TickerStreamRequest} requestParameters Request parameters.
675
+ * @returns {WebsocketStream<TickerStreamResponse>}
676
+ * @throws {RequiredError}
677
+ * @memberof Api
678
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#ticker-stream Binance API Documentation}
679
+ */
680
+ tickerStream(requestParameters) {
681
+ const stream = this.localVarParamCreator.tickerStream(requestParameters?.symbol, requestParameters?.id);
682
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
683
+ }
684
+ /**
685
+ * Pushes raw trade updates for a symbol.
686
+ *
687
+ * @summary Trade Stream
688
+ * @param {TradeStreamRequest} requestParameters Request parameters.
689
+ * @returns {WebsocketStream<TradeStreamResponse>}
690
+ * @throws {RequiredError}
691
+ * @memberof Api
692
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#trade-stream Binance API Documentation}
693
+ */
694
+ tradeStream(requestParameters) {
695
+ const stream = this.localVarParamCreator.tradeStream(requestParameters?.symbol, requestParameters?.id);
696
+ return (0, __binance_common.createStreamHandler)(this.websocketBase, stream, requestParameters?.id);
697
+ }
698
+ };
699
+ let ContractKlineStreamIntervalEnum = /* @__PURE__ */ function(ContractKlineStreamIntervalEnum$1) {
700
+ ContractKlineStreamIntervalEnum$1["INTERVAL_1s"] = "1s";
701
+ ContractKlineStreamIntervalEnum$1["INTERVAL_1m"] = "1m";
702
+ ContractKlineStreamIntervalEnum$1["INTERVAL_5m"] = "5m";
703
+ ContractKlineStreamIntervalEnum$1["INTERVAL_15m"] = "15m";
704
+ ContractKlineStreamIntervalEnum$1["INTERVAL_1h"] = "1h";
705
+ ContractKlineStreamIntervalEnum$1["INTERVAL_4h"] = "4h";
706
+ ContractKlineStreamIntervalEnum$1["INTERVAL_1d"] = "1d";
707
+ return ContractKlineStreamIntervalEnum$1;
708
+ }({});
709
+ let FullDepthStreamIntervalEnum = /* @__PURE__ */ function(FullDepthStreamIntervalEnum$1) {
710
+ FullDepthStreamIntervalEnum$1["INTERVAL_0ms"] = "0ms";
711
+ FullDepthStreamIntervalEnum$1["INTERVAL_100ms"] = "100ms";
712
+ FullDepthStreamIntervalEnum$1["INTERVAL_500ms"] = "500ms";
713
+ return FullDepthStreamIntervalEnum$1;
714
+ }({});
715
+ let KlineStreamIntervalEnum = /* @__PURE__ */ function(KlineStreamIntervalEnum$1) {
716
+ KlineStreamIntervalEnum$1["INTERVAL_1m"] = "1m";
717
+ KlineStreamIntervalEnum$1["INTERVAL_3m"] = "3m";
718
+ KlineStreamIntervalEnum$1["INTERVAL_5m"] = "5m";
719
+ KlineStreamIntervalEnum$1["INTERVAL_15m"] = "15m";
720
+ KlineStreamIntervalEnum$1["INTERVAL_30m"] = "30m";
721
+ KlineStreamIntervalEnum$1["INTERVAL_1h"] = "1h";
722
+ KlineStreamIntervalEnum$1["INTERVAL_2h"] = "2h";
723
+ KlineStreamIntervalEnum$1["INTERVAL_4h"] = "4h";
724
+ KlineStreamIntervalEnum$1["INTERVAL_6h"] = "6h";
725
+ KlineStreamIntervalEnum$1["INTERVAL_8h"] = "8h";
726
+ KlineStreamIntervalEnum$1["INTERVAL_12h"] = "12h";
727
+ KlineStreamIntervalEnum$1["INTERVAL_1d"] = "1d";
728
+ KlineStreamIntervalEnum$1["INTERVAL_3d"] = "3d";
729
+ KlineStreamIntervalEnum$1["INTERVAL_1w"] = "1w";
730
+ KlineStreamIntervalEnum$1["INTERVAL_1M"] = "1M";
731
+ return KlineStreamIntervalEnum$1;
732
+ }({});
733
+ let PartialDepthStreamLevelsEnum = /* @__PURE__ */ function(PartialDepthStreamLevelsEnum$1) {
734
+ PartialDepthStreamLevelsEnum$1["LEVELS_5"] = "5";
735
+ PartialDepthStreamLevelsEnum$1["LEVELS_10"] = "10";
736
+ PartialDepthStreamLevelsEnum$1["LEVELS_20"] = "20";
737
+ return PartialDepthStreamLevelsEnum$1;
738
+ }({});
739
+ let PartialDepthStreamIntervalEnum = /* @__PURE__ */ function(PartialDepthStreamIntervalEnum$1) {
740
+ PartialDepthStreamIntervalEnum$1["INTERVAL_0ms"] = "0ms";
741
+ PartialDepthStreamIntervalEnum$1["INTERVAL_100ms"] = "100ms";
742
+ PartialDepthStreamIntervalEnum$1["INTERVAL_500ms"] = "500ms";
743
+ return PartialDepthStreamIntervalEnum$1;
744
+ }({});
745
+
746
+ //#endregion
747
+ //#region src/websocket-streams/websocket-streams-connection.ts
748
+ var WebsocketStreamsConnection = class {
749
+ constructor(websocketBase) {
750
+ this.websocketBase = websocketBase;
751
+ this.api = new Api(websocketBase);
752
+ }
753
+ /**
754
+ * Adds an event listener for the specified WebSocket event.
755
+ * @param event - The WebSocket event to listen for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
756
+ * @param listener - The callback function to be executed when the event is triggered. The function can accept any number of arguments.
757
+ */
758
+ on(event, listener) {
759
+ this.websocketBase.on(event, listener);
760
+ }
761
+ /**
762
+ * Removes an event listener for the specified WebSocket event.
763
+ * @param event - The WebSocket event to stop listening for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
764
+ * @param listener - The callback function that was previously added as the event listener.
765
+ */
766
+ off(event, listener) {
767
+ this.websocketBase.off(event, listener);
768
+ }
769
+ /**
770
+ * Disconnects from the WebSocket server.
771
+ * If there is no active connection, a warning is logged.
772
+ * Otherwise, all connections in the connection pool are closed gracefully,
773
+ * and a message is logged indicating that the connection has been disconnected.
774
+ * @returns A Promise that resolves when all connections have been closed.
775
+ * @throws Error if the WebSocket client is not set.
776
+ */
777
+ disconnect() {
778
+ return this.websocketBase.disconnect();
779
+ }
780
+ /**
781
+ * Checks if the WebSocket connection is currently open.
782
+ * @returns `true` if the connection is open, `false` otherwise.
783
+ */
784
+ isConnected() {
785
+ return this.websocketBase.isConnected();
786
+ }
787
+ /**
788
+ * Sends a ping message to all connected Websocket servers in the pool.
789
+ * If no connections are ready, a warning is logged.
790
+ * For each active connection, the ping message is sent, and debug logs provide details.
791
+ * @throws Error if a Websocket client is not set for a connection.
792
+ */
793
+ pingServer() {
794
+ this.websocketBase.pingServer();
795
+ }
796
+ /**
797
+ * Subscribes to one or multiple WebSocket streams
798
+ * Handles both single and pool modes
799
+ * @param stream Single stream name or array of stream names to subscribe to
800
+ * @param id Optional subscription ID
801
+ * @returns void
802
+ */
803
+ subscribe(stream, id) {
804
+ this.websocketBase.subscribe(stream, id);
805
+ }
806
+ /**
807
+ * Unsubscribes from one or multiple WebSocket streams
808
+ * Handles both single and pool modes
809
+ * @param stream Single stream name or array of stream names to unsubscribe from
810
+ * @param id Optional unsubscription ID
811
+ * @returns void
812
+ */
813
+ unsubscribe(stream, id) {
814
+ this.websocketBase.unsubscribe(stream, id);
815
+ }
816
+ /**
817
+ * Checks if the WebSocket connection is subscribed to the specified stream.
818
+ * @param stream The name of the WebSocket stream to check.
819
+ * @returns `true` if the connection is subscribed to the stream, `false` otherwise.
820
+ */
821
+ isSubscribed(stream) {
822
+ return this.websocketBase.isSubscribed(stream);
823
+ }
824
+ /**
825
+ * Pushes aggregate trade updates for a symbol.
826
+ *
827
+ * @summary Aggregate Trade Stream
828
+ * @param {AggregateTradeStreamRequest} requestParameters Request parameters.
829
+ *
830
+ * @returns {WebsocketStream<AggregateTradeStreamResponse>}
831
+ * @throws {RequiredError}
832
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#aggregate-trade-stream Binance API Documentation}
833
+ */
834
+ aggregateTradeStream(requestParameters) {
835
+ return this.api.aggregateTradeStream(requestParameters);
836
+ }
837
+ /**
838
+ * Pushes best bid/ask updates for all symbols.
839
+ *
840
+ * @summary All Book Ticker Stream
841
+ * @param {AllBookTickerStreamRequest} requestParameters Request parameters.
842
+ *
843
+ * @returns {WebsocketStream<AllBookTickerStreamResponse>}
844
+ * @throws {RequiredError}
845
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-book-ticker-stream Binance API Documentation}
846
+ */
847
+ allBookTickerStream(requestParameters = {}) {
848
+ return this.api.allBookTickerStream(requestParameters);
849
+ }
850
+ /**
851
+ * Pushes mini ticker statistics for all symbols.
852
+ *
853
+ * @summary All Mini Ticker Stream
854
+ * @param {AllMiniTickerStreamRequest} requestParameters Request parameters.
855
+ *
856
+ * @returns {WebsocketStream<AllMiniTickerStreamResponse>}
857
+ * @throws {RequiredError}
858
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-mini-ticker-stream Binance API Documentation}
859
+ */
860
+ allMiniTickerStream(requestParameters = {}) {
861
+ return this.api.allMiniTickerStream(requestParameters);
862
+ }
863
+ /**
864
+ * Pushes full ticker statistics for all symbols.
865
+ *
866
+ * @summary All Ticker Stream
867
+ * @param {AllTickerStreamRequest} requestParameters Request parameters.
868
+ *
869
+ * @returns {WebsocketStream<AllTickerStreamResponse>}
870
+ * @throws {RequiredError}
871
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-ticker-stream Binance API Documentation}
872
+ */
873
+ allTickerStream(requestParameters = {}) {
874
+ return this.api.allTickerStream(requestParameters);
875
+ }
876
+ /**
877
+ * Pushes 24h ticker-like metrics for all tokens.
878
+ *
879
+ * @summary All Tokens 24h Ticker Stream
880
+ * @param {AllTokens24hTickerStreamRequest} requestParameters Request parameters.
881
+ *
882
+ * @returns {WebsocketStream<AllTokens24hTickerStreamResponse>}
883
+ * @throws {RequiredError}
884
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#all-tokens24h-ticker-stream Binance API Documentation}
885
+ */
886
+ allTokens24hTickerStream(requestParameters = {}) {
887
+ return this.api.allTokens24hTickerStream(requestParameters);
888
+ }
889
+ /**
890
+ * Pushes best bid/ask updates for a symbol.
891
+ *
892
+ * @summary Book Ticker Stream
893
+ * @param {BookTickerStreamRequest} requestParameters Request parameters.
894
+ *
895
+ * @returns {WebsocketStream<BookTickerStreamResponse>}
896
+ * @throws {RequiredError}
897
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#book-ticker-stream Binance API Documentation}
898
+ */
899
+ bookTickerStream(requestParameters) {
900
+ return this.api.bookTickerStream(requestParameters);
901
+ }
902
+ /**
903
+ * Pushes kline updates by contractAddress@chainId.
904
+ *
905
+ * @summary Contract Kline Stream
906
+ * @param {ContractKlineStreamRequest} requestParameters Request parameters.
907
+ *
908
+ * @returns {WebsocketStream<ContractKlineStreamResponse>}
909
+ * @throws {RequiredError}
910
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#contract-kline-stream Binance API Documentation}
911
+ */
912
+ contractKlineStream(requestParameters) {
913
+ return this.api.contractKlineStream(requestParameters);
914
+ }
915
+ /**
916
+ * Returns all available depth, including UI and API orders.
917
+ *
918
+ * @summary Full Depth Stream
919
+ * @param {FullDepthStreamRequest} requestParameters Request parameters.
920
+ *
921
+ * @returns {WebsocketStream<FullDepthStreamResponse>}
922
+ * @throws {RequiredError}
923
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#full-depth-stream Binance API Documentation}
924
+ */
925
+ fullDepthStream(requestParameters) {
926
+ return this.api.fullDepthStream(requestParameters);
927
+ }
928
+ /**
929
+ * Pushes kline updates for a symbol.
930
+ *
931
+ * @summary Kline Stream
932
+ * @param {KlineStreamRequest} requestParameters Request parameters.
933
+ *
934
+ * @returns {WebsocketStream<KlineStreamResponse>}
935
+ * @throws {RequiredError}
936
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#kline-stream Binance API Documentation}
937
+ */
938
+ klineStream(requestParameters) {
939
+ return this.api.klineStream(requestParameters);
940
+ }
941
+ /**
942
+ * Pushes 24h rolling mini ticker statistics.
943
+ *
944
+ * @summary Mini Ticker Stream
945
+ * @param {MiniTickerStreamRequest} requestParameters Request parameters.
946
+ *
947
+ * @returns {WebsocketStream<MiniTickerStreamResponse>}
948
+ * @throws {RequiredError}
949
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#mini-ticker-stream Binance API Documentation}
950
+ */
951
+ miniTickerStream(requestParameters) {
952
+ return this.api.miniTickerStream(requestParameters);
953
+ }
954
+ /**
955
+ * Pushes partial depth updates (UI orders only).
956
+ *
957
+ * @summary Partial Depth Stream
958
+ * @param {PartialDepthStreamRequest} requestParameters Request parameters.
959
+ *
960
+ * @returns {WebsocketStream<PartialDepthStreamResponse>}
961
+ * @throws {RequiredError}
962
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#partial-depth-stream Binance API Documentation}
963
+ */
964
+ partialDepthStream(requestParameters) {
965
+ return this.api.partialDepthStream(requestParameters);
966
+ }
967
+ /**
968
+ * Pushes full 24h rolling ticker statistics.
969
+ *
970
+ * @summary Ticker Stream
971
+ * @param {TickerStreamRequest} requestParameters Request parameters.
972
+ *
973
+ * @returns {WebsocketStream<TickerStreamResponse>}
974
+ * @throws {RequiredError}
975
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#ticker-stream Binance API Documentation}
976
+ */
977
+ tickerStream(requestParameters) {
978
+ return this.api.tickerStream(requestParameters);
979
+ }
980
+ /**
981
+ * Pushes raw trade updates for a symbol.
982
+ *
983
+ * @summary Trade Stream
984
+ * @param {TradeStreamRequest} requestParameters Request parameters.
985
+ *
986
+ * @returns {WebsocketStream<TradeStreamResponse>}
987
+ * @throws {RequiredError}
988
+ * @see {@link https://developers.binance.com/en/docs/catalog/advanced-trading-alpha-trading/api/ws-streams/~#trade-stream Binance API Documentation}
989
+ */
990
+ tradeStream(requestParameters) {
991
+ return this.api.tradeStream(requestParameters);
992
+ }
993
+ };
994
+
995
+ //#endregion
996
+ //#region src/websocket-streams/websocket-streams.ts
997
+ /**
998
+ * Alpha WebSocket Market Streams
999
+ *
1000
+ * Access Alpha market streams over WebSocket.
1001
+ *
1002
+ * The version of the OpenAPI document: 1.0.0
1003
+ *
1004
+ *
1005
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1006
+ * https://openapi-generator.tech
1007
+ * Do not edit the class manually.
1008
+ */
1009
+ var WebsocketStreams = class {
1010
+ constructor(configuration) {
1011
+ this.configuration = configuration;
1012
+ }
1013
+ /**
1014
+ * Connects to the Binance WebSocket streams and returns a `WebsocketStreamsConnection` instance.
1015
+ *
1016
+ * @param {object} [options] - Optional connection options.
1017
+ * @param {string|string[]} [options.stream] - The stream(s) to connect to.
1018
+ * @param {'single'|'pool'} [options.mode] - The connection mode, either 'single' or 'pool'. Overwrite the `mode` option in the configuration.
1019
+ * @param {number} [options.poolSize] - The number of connections to use in pool mode. Overwrite the `poolSize` option in the configuration.
1020
+ * @returns {Promise<WebsocketStreamsConnection>} - A promise that resolves to a `WebsocketStreamsConnection` instance.
1021
+ */
1022
+ async connect({ stream, mode, poolSize } = {}) {
1023
+ const websocketBase = new __binance_common.WebsocketStreamsBase({
1024
+ ...this.configuration,
1025
+ ...mode && { mode },
1026
+ ...poolSize && { poolSize }
1027
+ });
1028
+ const websocketStreamsConnection = new WebsocketStreamsConnection(websocketBase);
1029
+ await websocketBase.connect(stream);
1030
+ return websocketStreamsConnection;
1031
+ }
1032
+ };
1033
+
1034
+ //#endregion
1035
+ //#region src/websocket-streams/index.ts
1036
+ var websocket_streams_exports = /* @__PURE__ */ __export({
1037
+ Api: () => Api,
1038
+ ContractKlineStreamIntervalEnum: () => ContractKlineStreamIntervalEnum,
1039
+ FullDepthStreamIntervalEnum: () => FullDepthStreamIntervalEnum,
1040
+ KlineStreamIntervalEnum: () => KlineStreamIntervalEnum,
1041
+ PartialDepthStreamIntervalEnum: () => PartialDepthStreamIntervalEnum,
1042
+ PartialDepthStreamLevelsEnum: () => PartialDepthStreamLevelsEnum,
1043
+ WebsocketStreams: () => WebsocketStreams,
1044
+ WebsocketStreamsConnection: () => WebsocketStreamsConnection
1045
+ });
1046
+
344
1047
  //#endregion
345
1048
  //#region src/alpha.ts
346
1049
  var Alpha = class {
@@ -356,6 +1059,12 @@ var Alpha = class {
356
1059
  };
357
1060
  this.restAPI = new RestAPI(configRestAPI);
358
1061
  }
1062
+ if (config?.configurationWebsocketStreams) {
1063
+ const configWebsocketStreams = new __binance_common.ConfigurationWebsocketStreams(config.configurationWebsocketStreams);
1064
+ configWebsocketStreams.wsURL = configWebsocketStreams.wsURL || __binance_common.ALPHA_WS_STREAMS_PROD_URL;
1065
+ configWebsocketStreams.userAgent = userAgent;
1066
+ this.websocketStreams = new WebsocketStreams(configWebsocketStreams);
1067
+ }
359
1068
  }
360
1069
  };
361
1070
 
@@ -366,6 +1075,12 @@ Object.defineProperty(exports, 'ALPHA_REST_API_PROD_URL', {
366
1075
  return __binance_common.ALPHA_REST_API_PROD_URL;
367
1076
  }
368
1077
  });
1078
+ Object.defineProperty(exports, 'ALPHA_WS_STREAMS_PROD_URL', {
1079
+ enumerable: true,
1080
+ get: function () {
1081
+ return __binance_common.ALPHA_WS_STREAMS_PROD_URL;
1082
+ }
1083
+ });
369
1084
  exports.Alpha = Alpha;
370
1085
  Object.defineProperty(exports, 'AlphaRestAPI', {
371
1086
  enumerable: true,
@@ -373,6 +1088,12 @@ Object.defineProperty(exports, 'AlphaRestAPI', {
373
1088
  return rest_api_exports;
374
1089
  }
375
1090
  });
1091
+ Object.defineProperty(exports, 'AlphaWebsocketStreams', {
1092
+ enumerable: true,
1093
+ get: function () {
1094
+ return websocket_streams_exports;
1095
+ }
1096
+ });
376
1097
  Object.defineProperty(exports, 'BadRequestError', {
377
1098
  enumerable: true,
378
1099
  get: function () {