ccxt 4.5.6 → 4.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/apex.js +2 -2
  5. package/dist/cjs/src/binance.js +3 -0
  6. package/dist/cjs/src/bitbank.js +1 -0
  7. package/dist/cjs/src/bitbns.js +1 -0
  8. package/dist/cjs/src/bitflyer.js +1 -0
  9. package/dist/cjs/src/bithumb.js +1 -0
  10. package/dist/cjs/src/bitso.js +1 -0
  11. package/dist/cjs/src/bitvavo.js +26 -40
  12. package/dist/cjs/src/blockchaincom.js +1 -0
  13. package/dist/cjs/src/btcalpha.js +1 -0
  14. package/dist/cjs/src/btcbox.js +1 -0
  15. package/dist/cjs/src/btcmarkets.js +1 -0
  16. package/dist/cjs/src/btcturk.js +1 -0
  17. package/dist/cjs/src/deribit.js +3 -2
  18. package/dist/cjs/src/digifinex.js +1 -1
  19. package/dist/cjs/src/gate.js +8 -12
  20. package/dist/cjs/src/gemini.js +3 -3
  21. package/dist/cjs/src/htx.js +11 -1
  22. package/dist/cjs/src/independentreserve.js +1 -0
  23. package/dist/cjs/src/indodax.js +17 -6
  24. package/dist/cjs/src/kraken.js +25 -6
  25. package/dist/cjs/src/krakenfutures.js +1 -0
  26. package/dist/cjs/src/mercado.js +1 -0
  27. package/dist/cjs/src/mexc.js +80 -36
  28. package/dist/cjs/src/novadax.js +1 -0
  29. package/dist/cjs/src/oceanex.js +1 -0
  30. package/dist/cjs/src/okx.js +18 -5
  31. package/dist/cjs/src/pro/apex.js +7 -4
  32. package/dist/cjs/src/pro/backpack.js +6 -4
  33. package/dist/cjs/src/pro/bingx.js +206 -220
  34. package/dist/cjs/src/pro/htx.js +1 -1
  35. package/dist/cjs/src/upbit.js +1 -0
  36. package/dist/cjs/src/wavesexchange.js +1 -0
  37. package/dist/cjs/src/yobit.js +1 -0
  38. package/dist/cjs/src/zaif.js +1 -0
  39. package/dist/cjs/src/zonda.js +1 -0
  40. package/js/ccxt.d.ts +1 -1
  41. package/js/ccxt.js +1 -1
  42. package/js/src/abstract/mexc.d.ts +1 -0
  43. package/js/src/apex.js +2 -2
  44. package/js/src/binance.js +3 -0
  45. package/js/src/bitbank.js +1 -0
  46. package/js/src/bitbns.js +1 -0
  47. package/js/src/bitflyer.js +1 -0
  48. package/js/src/bithumb.js +1 -0
  49. package/js/src/bitso.js +1 -0
  50. package/js/src/bitvavo.d.ts +0 -2
  51. package/js/src/bitvavo.js +27 -41
  52. package/js/src/blockchaincom.js +1 -0
  53. package/js/src/btcalpha.js +1 -0
  54. package/js/src/btcbox.js +1 -0
  55. package/js/src/btcmarkets.js +1 -0
  56. package/js/src/btcturk.js +1 -0
  57. package/js/src/deribit.js +3 -2
  58. package/js/src/digifinex.js +1 -1
  59. package/js/src/gate.d.ts +2 -2
  60. package/js/src/gate.js +8 -12
  61. package/js/src/gemini.js +3 -3
  62. package/js/src/htx.js +11 -1
  63. package/js/src/independentreserve.js +1 -0
  64. package/js/src/indodax.js +17 -6
  65. package/js/src/kraken.d.ts +1 -1
  66. package/js/src/kraken.js +25 -6
  67. package/js/src/krakenfutures.js +1 -0
  68. package/js/src/mercado.js +1 -0
  69. package/js/src/mexc.d.ts +4 -1
  70. package/js/src/mexc.js +80 -36
  71. package/js/src/novadax.js +1 -0
  72. package/js/src/oceanex.js +1 -0
  73. package/js/src/okx.js +18 -5
  74. package/js/src/pro/apex.js +7 -4
  75. package/js/src/pro/backpack.js +6 -4
  76. package/js/src/pro/bingx.d.ts +53 -33
  77. package/js/src/pro/bingx.js +207 -221
  78. package/js/src/pro/htx.js +1 -1
  79. package/js/src/upbit.js +1 -0
  80. package/js/src/wavesexchange.js +1 -0
  81. package/js/src/yobit.js +1 -0
  82. package/js/src/zaif.js +1 -0
  83. package/js/src/zonda.js +1 -0
  84. package/package.json +1 -1
package/js/src/mexc.js CHANGED
@@ -227,6 +227,7 @@ export default class mexc extends Exchange {
227
227
  'mxDeduct/enable': 1,
228
228
  'userDataStream': 1,
229
229
  'selfSymbols': 1,
230
+ 'asset/internal/transfer/record': 10,
230
231
  },
231
232
  'post': {
232
233
  'order': 1,
@@ -5265,7 +5266,7 @@ export default class mexc extends Exchange {
5265
5266
  const request = {
5266
5267
  'transact_id': id,
5267
5268
  };
5268
- const response = await this.spot2PrivateGetAssetInternalTransferInfo(this.extend(request, query));
5269
+ const response = await this.spotPrivateGetAssetInternalTransferRecord(this.extend(request, query));
5269
5270
  //
5270
5271
  // {
5271
5272
  // "code": "200",
@@ -5293,60 +5294,84 @@ export default class mexc extends Exchange {
5293
5294
  * @description fetch a history of internal transfers made on an account
5294
5295
  * @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
5295
5296
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
5296
- * @param {string} code unified currency code of the currency transferred
5297
+ * @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history * @param {string} code unified currency code of the currency transferred
5298
+ * @param code
5297
5299
  * @param {int} [since] the earliest time in ms to fetch transfers for
5298
5300
  * @param {int} [limit] the maximum number of transfers structures to retrieve
5299
5301
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5302
+ * @param {string} [params.fromAccountType] 'SPOT' for spot wallet, 'FUTURES' for contract wallet
5303
+ * @param {string} [params.toAccountType] 'SPOT' for spot wallet, 'FUTURES' for contract wallet
5300
5304
  * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
5301
5305
  */
5302
5306
  async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
5303
- const [marketType, query] = this.handleMarketTypeAndParams('fetchTransfers', undefined, params);
5307
+ let marketType = undefined;
5308
+ [marketType, params] = this.handleMarketTypeAndParams('fetchTransfers', undefined, params);
5304
5309
  await this.loadMarkets();
5305
5310
  const request = {};
5306
5311
  let currency = undefined;
5307
- let resultList = undefined;
5308
5312
  if (code !== undefined) {
5309
5313
  currency = this.currency(code);
5310
- request['currency'] = currency['id'];
5311
5314
  }
5315
+ let fromAccountType = undefined;
5316
+ [fromAccountType, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'fromAccountType');
5317
+ const accountTypes = {
5318
+ 'spot': 'SPOT',
5319
+ 'swap': 'FUTURES',
5320
+ 'futures': 'FUTURES',
5321
+ 'future': 'FUTURES',
5322
+ 'margin': 'SPOT',
5323
+ };
5324
+ if (fromAccountType !== undefined) {
5325
+ request['fromAccountType'] = this.safeString(accountTypes, fromAccountType, fromAccountType);
5326
+ }
5327
+ else {
5328
+ throw new ArgumentsRequired(this.id + ' fetchTransfers() requires a fromAccountType parameter, one of "SPOT", "FUTURES"');
5329
+ }
5330
+ let toAccountType = undefined;
5331
+ [toAccountType, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'toAccountType');
5332
+ if (toAccountType !== undefined) {
5333
+ request['toAccountType'] = this.safeString(accountTypes, toAccountType, toAccountType);
5334
+ }
5335
+ else {
5336
+ throw new ArgumentsRequired(this.id + ' fetchTransfers() requires a toAccountType parameter, one of "SPOT", "FUTURES"');
5337
+ }
5338
+ let resultList = [];
5312
5339
  if (marketType === 'spot') {
5313
5340
  if (since !== undefined) {
5314
- request['start_time'] = since;
5341
+ request['startTime'] = since;
5315
5342
  }
5316
5343
  if (limit !== undefined) {
5317
- if (limit > 50) {
5344
+ if (limit > 100) {
5318
5345
  throw new ExchangeError('This exchange supports a maximum limit of 50');
5319
5346
  }
5320
- request['page-size'] = limit;
5347
+ request['size'] = limit;
5321
5348
  }
5322
- const response = await this.spot2PrivateGetAssetInternalTransferRecord(this.extend(request, query));
5349
+ const response = await this.spotPrivateGetCapitalTransfer(this.extend(request, params));
5323
5350
  //
5324
- // {
5325
- // "code": "200",
5326
- // "data": {
5327
- // "total_page": "1",
5328
- // "total_size": "5",
5329
- // "result_list": [{
5330
- // "currency": "USDT",
5331
- // "amount": "1",
5332
- // "transact_id": "954877a2ef54499db9b28a7cf9ebcf41",
5333
- // "from": "MAIN",
5334
- // "to": "CONTRACT",
5335
- // "transact_state": "SUCCESS"
5336
- // },
5337
- // ...
5338
- // ]
5339
- // }
5340
- // }
5341
5351
  //
5342
- const data = this.safeValue(response, 'data', {});
5343
- resultList = this.safeValue(data, 'result_list', []);
5352
+ // {
5353
+ // "rows": [
5354
+ // {
5355
+ // "tranId": "cdf0d2a618b5458c965baefe6b1d0859",
5356
+ // "clientTranId": null,
5357
+ // "asset": "USDT",
5358
+ // "amount": "1",
5359
+ // "fromAccountType": "FUTURES",
5360
+ // "toAccountType": "SPOT",
5361
+ // "symbol": null,
5362
+ // "status": "SUCCESS",
5363
+ // "timestamp": 1759328309000
5364
+ // }
5365
+ // ],
5366
+ // "total": 1
5367
+ // }
5368
+ resultList = this.safeList(response, 'rows', []);
5344
5369
  }
5345
5370
  else if (marketType === 'swap') {
5346
5371
  if (limit !== undefined) {
5347
5372
  request['page_size'] = limit;
5348
5373
  }
5349
- const response = await this.contractPrivateGetAccountTransferRecord(this.extend(request, query));
5374
+ const response = await this.contractPrivateGetAccountTransferRecord(this.extend(request, params));
5350
5375
  const data = this.safeValue(response, 'data');
5351
5376
  resultList = this.safeValue(data, 'resultList');
5352
5377
  //
@@ -5395,10 +5420,10 @@ export default class mexc extends Exchange {
5395
5420
  const accounts = {
5396
5421
  'spot': 'SPOT',
5397
5422
  'swap': 'FUTURES',
5398
- 'margin': 'ISOLATED_MARGIN',
5423
+ 'future': 'FUTURES',
5399
5424
  };
5400
- const fromId = this.safeString(accounts, fromAccount);
5401
- const toId = this.safeString(accounts, toAccount);
5425
+ const fromId = this.safeString(accounts, fromAccount, fromAccount);
5426
+ const toId = this.safeString(accounts, toAccount, toAccount);
5402
5427
  if (fromId === undefined) {
5403
5428
  const keys = Object.keys(accounts);
5404
5429
  throw new ExchangeError(this.id + ' fromAccount must be one of ' + keys.join(', '));
@@ -5460,6 +5485,17 @@ export default class mexc extends Exchange {
5460
5485
  // "createTime": "1648849076000",
5461
5486
  // "updateTime": "1648849076000"
5462
5487
  // }
5488
+ // {
5489
+ // "tranId": "cdf0d2a618b5458c965baefe6b1d0859",
5490
+ // "clientTranId": null,
5491
+ // "asset": "USDT",
5492
+ // "amount": "1",
5493
+ // "fromAccountType": "FUTURES",
5494
+ // "toAccountType": "SPOT",
5495
+ // "symbol": null,
5496
+ // "status": "SUCCESS",
5497
+ // "timestamp": 1759328309000
5498
+ // }
5463
5499
  //
5464
5500
  // transfer
5465
5501
  //
@@ -5467,14 +5503,20 @@ export default class mexc extends Exchange {
5467
5503
  // "tranId": "ebb06123e6a64f4ab234b396c548d57e"
5468
5504
  // }
5469
5505
  //
5470
- const currencyId = this.safeString(transfer, 'currency');
5506
+ const currencyId = this.safeString2(transfer, 'currency', 'asset');
5471
5507
  const id = this.safeStringN(transfer, ['transact_id', 'txid', 'tranId']);
5472
- const timestamp = this.safeInteger(transfer, 'createTime');
5508
+ const timestamp = this.safeInteger2(transfer, 'createTime', 'timestamp');
5473
5509
  const datetime = (timestamp !== undefined) ? this.iso8601(timestamp) : undefined;
5474
5510
  const direction = this.safeString(transfer, 'type');
5475
5511
  let accountFrom = undefined;
5476
5512
  let accountTo = undefined;
5477
- if (direction !== undefined) {
5513
+ const fromAccountType = this.safeString(transfer, 'fromAccountType');
5514
+ const toAccountType = this.safeString(transfer, 'toAccountType');
5515
+ if ((fromAccountType !== undefined) && (toAccountType !== undefined)) {
5516
+ accountFrom = fromAccountType;
5517
+ accountTo = toAccountType;
5518
+ }
5519
+ else if (direction !== undefined) {
5478
5520
  accountFrom = (direction === 'IN') ? 'MAIN' : 'CONTRACT';
5479
5521
  accountTo = (direction === 'IN') ? 'CONTRACT' : 'MAIN';
5480
5522
  }
@@ -5491,11 +5533,13 @@ export default class mexc extends Exchange {
5491
5533
  'amount': this.safeNumber(transfer, 'amount'),
5492
5534
  'fromAccount': this.parseAccountId(accountFrom),
5493
5535
  'toAccount': this.parseAccountId(accountTo),
5494
- 'status': this.parseTransferStatus(this.safeString2(transfer, 'transact_state', 'state')),
5536
+ 'status': this.parseTransferStatus(this.safeStringN(transfer, ['transact_state', 'state', 'status'])),
5495
5537
  };
5496
5538
  }
5497
5539
  parseAccountId(status) {
5498
5540
  const statuses = {
5541
+ 'SPOT': 'spot',
5542
+ 'FUTURES': 'swap',
5499
5543
  'MAIN': 'spot',
5500
5544
  'CONTRACT': 'swap',
5501
5545
  };
package/js/src/novadax.js CHANGED
@@ -55,6 +55,7 @@ export default class novadax extends Exchange {
55
55
  'fetchClosedOrders': true,
56
56
  'fetchCrossBorrowRate': false,
57
57
  'fetchCrossBorrowRates': false,
58
+ 'fetchCurrencies': false,
58
59
  'fetchDepositAddress': false,
59
60
  'fetchDepositAddresses': false,
60
61
  'fetchDepositAddressesByNetwork': false,
package/js/src/oceanex.js CHANGED
@@ -44,6 +44,7 @@ export default class oceanex extends Exchange {
44
44
  'fetchClosedOrders': true,
45
45
  'fetchCrossBorrowRate': false,
46
46
  'fetchCrossBorrowRates': false,
47
+ 'fetchCurrencies': false,
47
48
  'fetchDepositAddress': 'emulated',
48
49
  'fetchDepositAddresses': undefined,
49
50
  'fetchDepositAddressesByNetwork': true,
package/js/src/okx.js CHANGED
@@ -3636,10 +3636,18 @@ export default class okx extends Exchange {
3636
3636
  }
3637
3637
  else {
3638
3638
  for (let i = 0; i < clientOrderIds.length; i++) {
3639
- request.push({
3640
- 'instId': market['id'],
3641
- 'clOrdId': clientOrderIds[i],
3642
- });
3639
+ if (trailing || trigger) {
3640
+ request.push({
3641
+ 'instId': market['id'],
3642
+ 'algoClOrdId': clientOrderIds[i],
3643
+ });
3644
+ }
3645
+ else {
3646
+ request.push({
3647
+ 'instId': market['id'],
3648
+ 'clOrdId': clientOrderIds[i],
3649
+ });
3650
+ }
3643
3651
  }
3644
3652
  }
3645
3653
  let response = undefined;
@@ -3716,7 +3724,12 @@ export default class okx extends Exchange {
3716
3724
  idKey = 'algoId';
3717
3725
  }
3718
3726
  else if (clientOrderId !== undefined) {
3719
- idKey = 'clOrdId';
3727
+ if (isStopOrTrailing) {
3728
+ idKey = 'algoClOrdId';
3729
+ }
3730
+ else {
3731
+ idKey = 'clOrdId';
3732
+ }
3720
3733
  }
3721
3734
  const requestItem = {
3722
3735
  'instId': market['id'],
@@ -112,9 +112,10 @@ export default class apex extends apexRest {
112
112
  // "v": "0.001",
113
113
  // "p": "16578.50",
114
114
  // "L": "PlusTick",
115
- // "i": "20f43950-d8dd-5b31-9112-a178eb6023af",
115
+ // "i": "20f43950-d8dd-5b31-9112-a178eb6023ef",
116
116
  // "BT": false
117
- // }
117
+ // },
118
+ // // sorted by newest first
118
119
  // ]
119
120
  // }
120
121
  //
@@ -131,8 +132,10 @@ export default class apex extends apexRest {
131
132
  stored = new ArrayCache(limit);
132
133
  this.trades[symbol] = stored;
133
134
  }
134
- for (let j = 0; j < trades.length; j++) {
135
- const parsed = this.parseWsTrade(trades[j], market);
135
+ const length = trades.length;
136
+ for (let j = 0; j < length; j++) {
137
+ const index = length - j - 1;
138
+ const parsed = this.parseWsTrade(trades[index], market);
136
139
  stored.append(parsed);
137
140
  }
138
141
  const messageHash = 'trade' + ':' + symbol;
@@ -859,7 +859,7 @@ export default class backpack extends backpackRest {
859
859
  storedOrderBook.cache.push(data);
860
860
  return;
861
861
  }
862
- else if (nonce >= deltaNonce) {
862
+ else if (nonce > deltaNonce) {
863
863
  return;
864
864
  }
865
865
  this.handleDelta(storedOrderBook, data);
@@ -884,16 +884,18 @@ export default class backpack extends backpackRest {
884
884
  }
885
885
  }
886
886
  getCacheIndex(orderbook, cache) {
887
+ //
888
+ // {"E":"1759338824897386","T":"1759338824895616","U":1662976171,"a":[],"b":[["117357.0","0.00000"]],"e":"depth","s":"BTC_USDC_PERP","u":1662976171}
887
889
  const firstDelta = this.safeDict(cache, 0);
888
890
  const nonce = this.safeInteger(orderbook, 'nonce');
889
- const firstDeltaStart = this.safeInteger(firstDelta, 'sequenceStart');
891
+ const firstDeltaStart = this.safeInteger(firstDelta, 'U');
890
892
  if (nonce < firstDeltaStart - 1) {
891
893
  return -1;
892
894
  }
893
895
  for (let i = 0; i < cache.length; i++) {
894
896
  const delta = cache[i];
895
- const deltaStart = this.safeInteger(delta, 'sequenceStart');
896
- const deltaEnd = this.safeInteger(delta, 'sequenceEnd');
897
+ const deltaStart = this.safeInteger(delta, 'U');
898
+ const deltaEnd = this.safeInteger(delta, 'u');
897
899
  if ((nonce >= deltaStart - 1) && (nonce < deltaEnd)) {
898
900
  return i;
899
901
  }
@@ -1,8 +1,9 @@
1
1
  import bingxRest from '../bingx.js';
2
- import type { Int, OHLCV, Str, Strings, OrderBook, Order, Trade, Balances, Ticker, Tickers } from '../base/types.js';
2
+ import type { Int, Market, OHLCV, Str, OrderBook, Order, Trade, Balances, Ticker, Dict } from '../base/types.js';
3
3
  import Client from '../base/ws/Client.js';
4
4
  export default class bingx extends bingxRest {
5
5
  describe(): any;
6
+ unWatch(messageHash: string, subMessageHash: string, subscribeHash: string, dataType: string, topic: string, market: Market, methodName: string, params?: {}): Promise<any>;
6
7
  /**
7
8
  * @method
8
9
  * @name bingx#watchTicker
@@ -15,49 +16,28 @@ export default class bingx extends bingxRest {
15
16
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
16
17
  */
17
18
  watchTicker(symbol: string, params?: {}): Promise<Ticker>;
18
- handleTicker(client: Client, message: any): void;
19
- parseWsTicker(message: any, market?: any): Ticker;
20
19
  /**
21
20
  * @method
22
- * @name bingx#watchTickers
23
- * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
24
- * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20to%2024-hour%20price%20changes%20of%20all%20trading%20pairs
25
- * @param {string[]} symbols unified symbol of the market to watch the tickers for
21
+ * @name bingx#unWatchTicker
22
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
23
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscribe%20to%2024-hour%20Price%20Change
24
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20to%2024-hour%20price%20changes
25
+ * @see https://bingx-api.github.io/docs/#/en-us/cswap/socket/market.html#Subscribe%20to%2024-Hour%20Price%20Change
26
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
26
27
  * @param {object} [params] extra parameters specific to the exchange API endpoint
27
28
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
28
29
  */
29
- watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
30
- /**
31
- * @method
32
- * @name bingx#watchOrderBookForSymbols
33
- * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
34
- * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20Market%20Depth%20Data%20of%20all%20trading%20pairs
35
- * @param {string[]} symbols unified array of symbols
36
- * @param {int} [limit] the maximum amount of order book entries to return
37
- * @param {object} [params] extra parameters specific to the exchange API endpoint
38
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
39
- */
40
- watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
41
- /**
42
- * @method
43
- * @name bingx#watchOHLCVForSymbols
44
- * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
45
- * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20K-Line%20Data%20of%20all%20trading%20pairs
46
- * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
47
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
48
- * @param {int} [limit] the maximum amount of candles to fetch
49
- * @param {object} [params] extra parameters specific to the exchange API endpoint
50
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
51
- */
52
- watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
30
+ unWatchTicker(symbol: string, params?: {}): Promise<any>;
31
+ handleTicker(client: Client, message: any): void;
32
+ parseWsTicker(message: any, market?: any): Ticker;
53
33
  getOrderBookLimitByMarketType(marketType: string, limit?: Int): number;
54
34
  getMessageHash(unifiedChannel: string, symbol?: Str, extra?: Str): string;
55
35
  /**
56
36
  * @method
57
37
  * @name bingx#watchTrades
58
38
  * @description watches information on multiple trades made in a market
59
- * @see https://bingx-api.github.io/docs/#/spot/socket/market.html#Subscribe%20to%20tick-by-tick
60
- * @see https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
39
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscription%20transaction%20by%20transaction
40
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
61
41
  * @see https://bingx-api.github.io/docs/#/en-us/cswap/socket/market.html#Subscription%20transaction%20by%20transaction
62
42
  * @param {string} symbol unified market symbol of the market orders were made in
63
43
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -66,6 +46,19 @@ export default class bingx extends bingxRest {
66
46
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
67
47
  */
68
48
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
49
+ /**
50
+ * @method
51
+ * @name bingx#unWatchTrades
52
+ * @description unsubscribes from the trades channel
53
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscription%20transaction%20by%20transaction
54
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
55
+ * @see https://bingx-api.github.io/docs/#/en-us/cswap/socket/market.html#Subscription%20transaction%20by%20transaction
56
+ * @param {string} symbol unified symbol of the market to fetch trades for
57
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
58
+ * @param {string} [params.name] the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
59
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
60
+ */
61
+ unWatchTrades(symbol: string, params?: {}): Promise<any>;
69
62
  handleTrades(client: Client, message: any): void;
70
63
  /**
71
64
  * @method
@@ -80,6 +73,18 @@ export default class bingx extends bingxRest {
80
73
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
81
74
  */
82
75
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
76
+ /**
77
+ * @method
78
+ * @name bingx#unWatchOrderBook
79
+ * @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
80
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscribe%20Market%20Depth%20Data
81
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20Market%20Depth%20Data
82
+ * @see https://bingx-api.github.io/docs/#/en-us/cswap/socket/market.html#Subscribe%20to%20Limited%20Depth
83
+ * @param {string} symbol unified symbol of the market
84
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
85
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
86
+ */
87
+ unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
83
88
  handleDelta(bookside: any, delta: any): void;
84
89
  handleOrderBook(client: Client, message: any): void;
85
90
  parseWsOHLCV(ohlcv: any, market?: any): OHLCV;
@@ -99,6 +104,19 @@ export default class bingx extends bingxRest {
99
104
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
100
105
  */
101
106
  watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
107
+ /**
108
+ * @method
109
+ * @name bingx#unWatchOHLCV
110
+ * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
111
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#K-line%20Streams
112
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20K-Line%20Data
113
+ * @see https://bingx-api.github.io/docs/#/en-us/cswap/socket/market.html#Subscribe%20to%20Latest%20Trading%20Pair%20K-Line
114
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
115
+ * @param {string} timeframe the length of time each candle represents
116
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
117
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
118
+ */
119
+ unWatchOHLCV(symbol: string, timeframe?: string, params?: {}): Promise<any>;
102
120
  /**
103
121
  * @method
104
122
  * @name bingx#watchOrders
@@ -148,4 +166,6 @@ export default class bingx extends bingxRest {
148
166
  handleMyTrades(client: Client, message: any): void;
149
167
  handleBalance(client: Client, message: any): void;
150
168
  handleMessage(client: Client, message: any): void;
169
+ handleSubscriptionStatus(client: Client, message: any): any;
170
+ handleUnSubscription(client: Client, subscription: Dict): void;
151
171
  }