ccxt 4.4.82 → 4.4.85

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 (103) hide show
  1. package/README.md +5 -7
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +1 -9
  4. package/dist/cjs/src/apex.js +2 -1
  5. package/dist/cjs/src/base/Exchange.js +15 -2
  6. package/dist/cjs/src/bitget.js +1 -3
  7. package/dist/cjs/src/bitrue.js +14 -35
  8. package/dist/cjs/src/bitso.js +33 -0
  9. package/dist/cjs/src/bitstamp.js +33 -0
  10. package/dist/cjs/src/blofin.js +154 -13
  11. package/dist/cjs/src/btcbox.js +25 -5
  12. package/dist/cjs/src/bybit.js +16 -40
  13. package/dist/cjs/src/cex.js +2 -4
  14. package/dist/cjs/src/coinbase.js +56 -40
  15. package/dist/cjs/src/coinbaseexchange.js +142 -32
  16. package/dist/cjs/src/coincatch.js +14 -67
  17. package/dist/cjs/src/coinex.js +29 -32
  18. package/dist/cjs/src/coinlist.js +16 -15
  19. package/dist/cjs/src/coinmetro.js +22 -11
  20. package/dist/cjs/src/coinone.js +8 -10
  21. package/dist/cjs/src/coinsph.js +126 -1
  22. package/dist/cjs/src/cryptocom.js +111 -1
  23. package/dist/cjs/src/cryptomus.js +43 -89
  24. package/dist/cjs/src/delta.js +76 -36
  25. package/dist/cjs/src/derive.js +46 -10
  26. package/dist/cjs/src/ellipx.js +175 -79
  27. package/dist/cjs/src/gate.js +1 -1
  28. package/dist/cjs/src/gemini.js +3 -5
  29. package/dist/cjs/src/hitbtc.js +56 -69
  30. package/dist/cjs/src/hyperliquid.js +2 -2
  31. package/dist/cjs/src/kraken.js +29 -24
  32. package/dist/cjs/src/kucoinfutures.js +6 -0
  33. package/dist/cjs/src/lbank.js +1 -1
  34. package/dist/cjs/src/paradex.js +119 -3
  35. package/dist/cjs/src/pro/binance.js +31 -33
  36. package/dist/cjs/src/pro/bithumb.js +5 -3
  37. package/dist/cjs/src/pro/kraken.js +289 -79
  38. package/dist/cjs/src/pro/mexc.js +302 -8
  39. package/dist/cjs/src/pro/poloniex.js +6 -2
  40. package/examples/js/cli.js +127 -13
  41. package/js/ccxt.d.ts +2 -11
  42. package/js/ccxt.js +2 -8
  43. package/js/src/abstract/blofin.d.ts +8 -0
  44. package/js/src/abstract/btcbox.d.ts +1 -0
  45. package/js/src/apex.js +2 -1
  46. package/js/src/base/Exchange.d.ts +15 -1
  47. package/js/src/base/Exchange.js +15 -2
  48. package/js/src/base/types.d.ts +3 -0
  49. package/js/src/bitget.js +1 -3
  50. package/js/src/bitrue.js +14 -35
  51. package/js/src/bitso.js +33 -0
  52. package/js/src/bitstamp.js +33 -0
  53. package/js/src/blofin.d.ts +42 -2
  54. package/js/src/blofin.js +154 -13
  55. package/js/src/btcbox.js +25 -5
  56. package/js/src/bybit.js +16 -40
  57. package/js/src/cex.js +2 -4
  58. package/js/src/coinbase.js +56 -40
  59. package/js/src/coinbaseexchange.js +142 -32
  60. package/js/src/coincatch.js +14 -67
  61. package/js/src/coinex.js +28 -29
  62. package/js/src/coinlist.js +16 -15
  63. package/js/src/coinmetro.js +22 -11
  64. package/js/src/coinone.js +8 -10
  65. package/js/src/coinsph.d.ts +10 -1
  66. package/js/src/coinsph.js +126 -1
  67. package/js/src/cryptocom.d.ts +10 -1
  68. package/js/src/cryptocom.js +111 -1
  69. package/js/src/cryptomus.js +43 -89
  70. package/js/src/delta.js +76 -36
  71. package/js/src/derive.js +46 -10
  72. package/js/src/ellipx.d.ts +2 -3
  73. package/js/src/ellipx.js +175 -80
  74. package/js/src/gate.js +1 -1
  75. package/js/src/gemini.js +3 -5
  76. package/js/src/hitbtc.js +56 -69
  77. package/js/src/hyperliquid.js +2 -2
  78. package/js/src/kraken.js +29 -24
  79. package/js/src/kucoinfutures.d.ts +1 -0
  80. package/js/src/kucoinfutures.js +6 -0
  81. package/js/src/lbank.js +1 -1
  82. package/js/src/paradex.d.ts +12 -1
  83. package/js/src/paradex.js +119 -3
  84. package/js/src/pro/binance.d.ts +26 -26
  85. package/js/src/pro/binance.js +31 -33
  86. package/js/src/pro/bithumb.js +5 -3
  87. package/js/src/pro/kraken.d.ts +7 -6
  88. package/js/src/pro/kraken.js +290 -80
  89. package/js/src/pro/mexc.d.ts +58 -0
  90. package/js/src/pro/mexc.js +302 -8
  91. package/js/src/pro/poloniex.d.ts +1 -1
  92. package/js/src/pro/poloniex.js +6 -2
  93. package/package.json +1 -1
  94. package/js/src/abstract/bl3p.d.ts +0 -22
  95. package/js/src/abstract/bl3p.js +0 -11
  96. package/js/src/abstract/idex.d.ts +0 -29
  97. package/js/src/abstract/idex.js +0 -11
  98. package/js/src/bl3p.d.ts +0 -116
  99. package/js/src/bl3p.js +0 -552
  100. package/js/src/idex.d.ts +0 -312
  101. package/js/src/idex.js +0 -1961
  102. package/js/src/pro/idex.d.ts +0 -81
  103. package/js/src/pro/idex.js +0 -720
package/js/src/kraken.js CHANGED
@@ -1649,6 +1649,8 @@ export default class kraken extends Exchange {
1649
1649
  'volume': this.amountToPrecision(symbol, amount),
1650
1650
  };
1651
1651
  const orderRequest = this.orderRequest('createOrder', symbol, type, request, amount, price, params);
1652
+ const flags = this.safeString(orderRequest[0], 'oflags', '');
1653
+ const isUsingCost = flags.indexOf('viqc') > -1;
1652
1654
  const response = await this.privatePostAddOrder(this.extend(orderRequest[0], orderRequest[1]));
1653
1655
  //
1654
1656
  // {
@@ -1660,6 +1662,10 @@ export default class kraken extends Exchange {
1660
1662
  // }
1661
1663
  //
1662
1664
  const result = this.safeDict(response, 'result');
1665
+ result['usingCost'] = isUsingCost;
1666
+ // it's impossible to know if the order was created using cost or base currency
1667
+ // becuase kraken only returns something like this: { order: 'buy 10.00000000 LTCUSD @ market' }
1668
+ // this usingCost flag is used to help the parsing but omited from the order
1663
1669
  return this.parseOrder(result);
1664
1670
  }
1665
1671
  findMarketByAltnameOrId(id) {
@@ -1752,22 +1758,15 @@ export default class kraken extends Exchange {
1752
1758
  // }
1753
1759
  //
1754
1760
  // ws - createOrder
1755
- // {
1756
- // "descr": 'sell 0.00010000 XBTUSDT @ market',
1757
- // "event": 'addOrderStatus',
1758
- // "reqid": 1,
1759
- // "status": 'ok',
1760
- // "txid": 'OAVXZH-XIE54-JCYYDG'
1761
- // }
1761
+ // {
1762
+ // "order_id": "OXM2QD-EALR2-YBAVEU"
1763
+ // }
1764
+ //
1762
1765
  // ws - editOrder
1763
- // {
1764
- // "descr": "order edited price = 9000.00000000",
1765
- // "event": "editOrderStatus",
1766
- // "originaltxid": "O65KZW-J4AW3-VFS74A",
1767
- // "reqid": 3,
1768
- // "status": "ok",
1769
- // "txid": "OTI672-HJFAO-XOIPPK"
1770
- // }
1766
+ // {
1767
+ // "amend_id": "TJSMEH-AA67V-YUSQ6O",
1768
+ // "order_id": "OXM2QD-EALR2-YBAVEU"
1769
+ // }
1771
1770
  //
1772
1771
  // {
1773
1772
  // "error": [],
@@ -1835,6 +1834,8 @@ export default class kraken extends Exchange {
1835
1834
  // "oflags": "fciq"
1836
1835
  // }
1837
1836
  //
1837
+ const isUsingCost = this.safeBool(order, 'usingCost', false);
1838
+ order = this.omit(order, 'usingCost');
1838
1839
  const description = this.safeDict(order, 'descr', {});
1839
1840
  const orderDescriptionObj = this.safeDict(order, 'descr'); // can be null
1840
1841
  let orderDescription = undefined;
@@ -1849,11 +1850,17 @@ export default class kraken extends Exchange {
1849
1850
  let marketId = undefined;
1850
1851
  let price = undefined;
1851
1852
  let amount = undefined;
1853
+ let cost = undefined;
1852
1854
  let triggerPrice = undefined;
1853
1855
  if (orderDescription !== undefined) {
1854
1856
  const parts = orderDescription.split(' ');
1855
1857
  side = this.safeString(parts, 0);
1856
- amount = this.safeString(parts, 1);
1858
+ if (!isUsingCost) {
1859
+ amount = this.safeString(parts, 1);
1860
+ }
1861
+ else {
1862
+ cost = this.safeString(parts, 1);
1863
+ }
1857
1864
  marketId = this.safeString(parts, 2);
1858
1865
  const part4 = this.safeString(parts, 4);
1859
1866
  const part5 = this.safeString(parts, 5);
@@ -1890,15 +1897,13 @@ export default class kraken extends Exchange {
1890
1897
  // kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
1891
1898
  // const cost = this.safeString (order, 'cost');
1892
1899
  price = this.safeString(description, 'price', price);
1893
- // when type = trailling stop returns price = '+50.0000%'
1894
- if ((price !== undefined) && price.endsWith('%')) {
1900
+ // when type = trailing stop returns price = '+50.0000%'
1901
+ if ((price !== undefined) && (price.endsWith('%') || Precise.stringEquals(price, '0.00000') || Precise.stringEquals(price, '0'))) {
1895
1902
  price = undefined; // this is not the price we want
1896
1903
  }
1897
- if ((price === undefined) || Precise.stringEquals(price, '0')) {
1904
+ if (price === undefined) {
1898
1905
  price = this.safeString(description, 'price2');
1899
- }
1900
- if ((price === undefined) || Precise.stringEquals(price, '0')) {
1901
- price = this.safeString(order, 'price', price);
1906
+ price = this.safeString2(order, 'limitprice', 'price', price);
1902
1907
  }
1903
1908
  const flags = this.safeString(order, 'oflags', '');
1904
1909
  let isPostOnly = flags.indexOf('post') > -1;
@@ -1920,7 +1925,7 @@ export default class kraken extends Exchange {
1920
1925
  }
1921
1926
  }
1922
1927
  const status = this.parseOrderStatus(this.safeString(order, 'status'));
1923
- let id = this.safeStringN(order, ['id', 'txid', 'amend_id']);
1928
+ let id = this.safeStringN(order, ['id', 'txid', 'order_id', 'amend_id']);
1924
1929
  if ((id === undefined) || (id.startsWith('['))) {
1925
1930
  const txid = this.safeList(order, 'txid');
1926
1931
  id = this.safeString(txid, 0);
@@ -1988,7 +1993,7 @@ export default class kraken extends Exchange {
1988
1993
  'triggerPrice': triggerPrice,
1989
1994
  'takeProfitPrice': takeProfitPrice,
1990
1995
  'stopLossPrice': stopLossPrice,
1991
- 'cost': undefined,
1996
+ 'cost': cost,
1992
1997
  'amount': amount,
1993
1998
  'filled': filled,
1994
1999
  'average': average,
@@ -184,6 +184,7 @@ export default class kucoinfutures extends kucoin {
184
184
  * @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
185
185
  * @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
186
186
  * @param {float} [params.cost] the cost of the order in units of USDT
187
+ * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'isolated'
187
188
  * ----------------- Exchange Specific Parameters -----------------
188
189
  * @param {float} [params.leverage] Leverage size of the order (mandatory param in request, default is 1)
189
190
  * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
@@ -1534,6 +1534,7 @@ export default class kucoinfutures extends kucoin {
1534
1534
  * @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
1535
1535
  * @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
1536
1536
  * @param {float} [params.cost] the cost of the order in units of USDT
1537
+ * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'isolated'
1537
1538
  * ----------------- Exchange Specific Parameters -----------------
1538
1539
  * @param {float} [params.leverage] Leverage size of the order (mandatory param in request, default is 1)
1539
1540
  * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
@@ -1637,6 +1638,11 @@ export default class kucoinfutures extends kucoin {
1637
1638
  'type': type,
1638
1639
  'leverage': 1,
1639
1640
  };
1641
+ const marginModeUpper = this.safeStringUpper(params, 'marginMode');
1642
+ if (marginModeUpper !== undefined) {
1643
+ params = this.omit(params, 'marginMode');
1644
+ request['marginMode'] = marginModeUpper;
1645
+ }
1640
1646
  const cost = this.safeString(params, 'cost');
1641
1647
  params = this.omit(params, 'cost');
1642
1648
  if (cost !== undefined) {
package/js/src/lbank.js CHANGED
@@ -879,7 +879,7 @@ export default class lbank extends Exchange {
879
879
  if (market['swap']) {
880
880
  return this.parseOrderBook(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'price', 'volume');
881
881
  }
882
- return this.parseOrderBook(orderbook, market['symbol'], timestamp);
882
+ return this.parseOrderBook(orderbook, market['symbol'], timestamp, 'bids', 'asks', 1, 0);
883
883
  }
884
884
  parseTrade(trade, market = undefined) {
885
885
  //
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/paradex.js';
2
- import type { Str, Num, Dict, Int, Market, OrderType, OrderSide, Order, OrderBook, Strings, Ticker, Tickers, Trade, Balances, Currency, Transaction, OHLCV, Position, int, MarginMode, Leverage } from './base/types.js';
2
+ import type { Str, Num, Dict, Int, Market, OrderType, OrderSide, Order, OrderBook, Strings, Ticker, Tickers, Trade, Balances, Currency, Transaction, OHLCV, Position, int, MarginMode, Leverage, Greeks } from './base/types.js';
3
3
  /**
4
4
  * @class paradex
5
5
  * @description Paradex is a decentralized exchange built on the StarkWare layer 2 scaling solution. To access private methods you can either use the ETH public key and private key by setting (exchange.privateKey and exchange.walletAddress)
@@ -358,6 +358,17 @@ export default class paradex extends Exchange {
358
358
  * @returns {object} response from the exchange
359
359
  */
360
360
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
361
+ /**
362
+ * @method
363
+ * @name paradex#fetchGreeks
364
+ * @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
365
+ * @see https://docs.api.testnet.paradex.trade/#list-available-markets-summary
366
+ * @param {string} symbol unified symbol of the market to fetch greeks for
367
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
368
+ * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
369
+ */
370
+ fetchGreeks(symbol: string, params?: {}): Promise<Greeks>;
371
+ parseGreeks(greeks: Dict, market?: Market): Greeks;
361
372
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
362
373
  url: string;
363
374
  method: string;
package/js/src/paradex.js CHANGED
@@ -75,6 +75,7 @@ export default class paradex extends Exchange {
75
75
  'fetchFundingRate': false,
76
76
  'fetchFundingRateHistory': false,
77
77
  'fetchFundingRates': false,
78
+ 'fetchGreeks': true,
78
79
  'fetchIndexOHLCV': false,
79
80
  'fetchIsolatedBorrowRate': false,
80
81
  'fetchIsolatedBorrowRates': false,
@@ -557,15 +558,16 @@ export default class paradex extends Exchange {
557
558
  let expiry = this.safeInteger(market, 'expiry_at');
558
559
  const optionType = this.safeString(market, 'option_type');
559
560
  const strikePrice = this.safeString(market, 'strike_price');
561
+ const takerFee = this.parseNumber('0.0003');
562
+ let makerFee = this.parseNumber('-0.00005');
560
563
  if (isOption) {
561
564
  const optionTypeSuffix = (optionType === 'CALL') ? 'C' : 'P';
562
565
  symbol = symbol + '-' + strikePrice + '-' + optionTypeSuffix;
566
+ makerFee = this.parseNumber('0.0003');
563
567
  }
564
568
  else {
565
569
  expiry = undefined;
566
570
  }
567
- const takerFee = this.parseNumber('0.0003');
568
- const makerFee = this.parseNumber('-0.00005');
569
571
  return this.safeMarketStructure({
570
572
  'id': marketId,
571
573
  'symbol': symbol,
@@ -1278,7 +1280,7 @@ export default class paradex extends Exchange {
1278
1280
  'status': this.parseOrderStatus(status),
1279
1281
  'symbol': symbol,
1280
1282
  'type': this.parseOrderType(orderType),
1281
- 'timeInForce': this.parseTimeInForce(this.safeString(order, 'instrunction')),
1283
+ 'timeInForce': this.parseTimeInForce(this.safeString(order, 'instruction')),
1282
1284
  'postOnly': undefined,
1283
1285
  'reduceOnly': reduceOnly,
1284
1286
  'side': side,
@@ -2348,6 +2350,120 @@ export default class paradex extends Exchange {
2348
2350
  };
2349
2351
  return await this.privatePostAccountMarginMarket(this.extend(request, params));
2350
2352
  }
2353
+ /**
2354
+ * @method
2355
+ * @name paradex#fetchGreeks
2356
+ * @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
2357
+ * @see https://docs.api.testnet.paradex.trade/#list-available-markets-summary
2358
+ * @param {string} symbol unified symbol of the market to fetch greeks for
2359
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2360
+ * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
2361
+ */
2362
+ async fetchGreeks(symbol, params = {}) {
2363
+ await this.loadMarkets();
2364
+ const market = this.market(symbol);
2365
+ const request = {
2366
+ 'market': market['id'],
2367
+ };
2368
+ const response = await this.publicGetMarketsSummary(this.extend(request, params));
2369
+ //
2370
+ // {
2371
+ // "results": [
2372
+ // {
2373
+ // "symbol": "BTC-USD-114000-P",
2374
+ // "mark_price": "10835.66892602",
2375
+ // "mark_iv": "0.71781855",
2376
+ // "delta": "-0.98726024",
2377
+ // "greeks": {
2378
+ // "delta": "-0.9872602390817709",
2379
+ // "gamma": "0.000004560958862297231",
2380
+ // "vega": "227.11344863639806",
2381
+ // "rho": "-302.0617972461581",
2382
+ // "vanna": "0.06609830491614832",
2383
+ // "volga": "925.9501532805552"
2384
+ // },
2385
+ // "last_traded_price": "10551.5",
2386
+ // "bid": "10794.9",
2387
+ // "bid_iv": "0.05",
2388
+ // "ask": "10887.3",
2389
+ // "ask_iv": "0.8783283",
2390
+ // "last_iv": "0.05",
2391
+ // "volume_24h": "0",
2392
+ // "total_volume": "195240.72672261014",
2393
+ // "created_at": 1747644009995,
2394
+ // "underlying_price": "103164.79162649",
2395
+ // "open_interest": "0",
2396
+ // "funding_rate": "0.000004464241170536191",
2397
+ // "price_change_rate_24h": "0.074915",
2398
+ // "future_funding_rate": "0.0001"
2399
+ // }
2400
+ // ]
2401
+ // }
2402
+ //
2403
+ const data = this.safeList(response, 'results', []);
2404
+ const greeks = this.safeDict(data, 0, {});
2405
+ return this.parseGreeks(greeks, market);
2406
+ }
2407
+ parseGreeks(greeks, market = undefined) {
2408
+ //
2409
+ // {
2410
+ // "symbol": "BTC-USD-114000-P",
2411
+ // "mark_price": "10835.66892602",
2412
+ // "mark_iv": "0.71781855",
2413
+ // "delta": "-0.98726024",
2414
+ // "greeks": {
2415
+ // "delta": "-0.9872602390817709",
2416
+ // "gamma": "0.000004560958862297231",
2417
+ // "vega": "227.11344863639806",
2418
+ // "rho": "-302.0617972461581",
2419
+ // "vanna": "0.06609830491614832",
2420
+ // "volga": "925.9501532805552"
2421
+ // },
2422
+ // "last_traded_price": "10551.5",
2423
+ // "bid": "10794.9",
2424
+ // "bid_iv": "0.05",
2425
+ // "ask": "10887.3",
2426
+ // "ask_iv": "0.8783283",
2427
+ // "last_iv": "0.05",
2428
+ // "volume_24h": "0",
2429
+ // "total_volume": "195240.72672261014",
2430
+ // "created_at": 1747644009995,
2431
+ // "underlying_price": "103164.79162649",
2432
+ // "open_interest": "0",
2433
+ // "funding_rate": "0.000004464241170536191",
2434
+ // "price_change_rate_24h": "0.074915",
2435
+ // "future_funding_rate": "0.0001"
2436
+ // }
2437
+ //
2438
+ const marketId = this.safeString(greeks, 'symbol');
2439
+ market = this.safeMarket(marketId, market, undefined, 'option');
2440
+ const symbol = market['symbol'];
2441
+ const timestamp = this.safeInteger(greeks, 'created_at');
2442
+ const greeksData = this.safeDict(greeks, 'greeks', {});
2443
+ return {
2444
+ 'symbol': symbol,
2445
+ 'timestamp': timestamp,
2446
+ 'datetime': this.iso8601(timestamp),
2447
+ 'delta': this.safeNumber(greeksData, 'delta'),
2448
+ 'gamma': this.safeNumber(greeksData, 'gamma'),
2449
+ 'theta': undefined,
2450
+ 'vega': this.safeNumber(greeksData, 'vega'),
2451
+ 'rho': this.safeNumber(greeksData, 'rho'),
2452
+ 'vanna': this.safeNumber(greeksData, 'vanna'),
2453
+ 'volga': this.safeNumber(greeksData, 'volga'),
2454
+ 'bidSize': undefined,
2455
+ 'askSize': undefined,
2456
+ 'bidImpliedVolatility': this.safeNumber(greeks, 'bid_iv'),
2457
+ 'askImpliedVolatility': this.safeNumber(greeks, 'ask_iv'),
2458
+ 'markImpliedVolatility': this.safeNumber(greeks, 'mark_iv'),
2459
+ 'bidPrice': this.safeNumber(greeks, 'bid'),
2460
+ 'askPrice': this.safeNumber(greeks, 'ask'),
2461
+ 'markPrice': this.safeNumber(greeks, 'mark_price'),
2462
+ 'lastPrice': this.safeNumber(greeks, 'last_traded_price'),
2463
+ 'underlyingPrice': this.safeNumber(greeks, 'underlying_price'),
2464
+ 'info': greeks,
2465
+ };
2466
+ }
2351
2467
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
2352
2468
  let url = this.implodeHostname(this.urls['api'][this.version]) + '/' + this.implodeParams(path, params);
2353
2469
  const query = this.omit(params, this.extractParams(path));
@@ -271,7 +271,7 @@ export default class binance extends binanceRest {
271
271
  * @method
272
272
  * @name binance#fetchOrderBookWs
273
273
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
274
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#order-book
274
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#order-book
275
275
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book
276
276
  * @param {string} symbol unified symbol of the market to fetch the order book for
277
277
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -292,8 +292,8 @@ export default class binance extends binanceRest {
292
292
  * @method
293
293
  * @name binance#watchTradesForSymbols
294
294
  * @description get the list of most recent trades for a list of symbols
295
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
296
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
295
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
296
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
297
297
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
298
298
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
299
299
  * @param {string[]} symbols unified symbol of the market to fetch trades for
@@ -308,8 +308,8 @@ export default class binance extends binanceRest {
308
308
  * @method
309
309
  * @name binance#unWatchTradesForSymbols
310
310
  * @description unsubscribes from the trades channel
311
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
312
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
311
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
312
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
313
313
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
314
314
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
315
315
  * @param {string[]} symbols unified symbol of the market to fetch trades for
@@ -322,8 +322,8 @@ export default class binance extends binanceRest {
322
322
  * @method
323
323
  * @name binance#unWatchTrades
324
324
  * @description unsubscribes from the trades channel
325
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
326
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
325
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
326
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
327
327
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
328
328
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
329
329
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -336,8 +336,8 @@ export default class binance extends binanceRest {
336
336
  * @method
337
337
  * @name binance#watchTrades
338
338
  * @description get the list of most recent trades for a particular symbol
339
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
340
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
339
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#aggregate-trades
340
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
341
341
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
342
342
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
343
343
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -354,7 +354,7 @@ export default class binance extends binanceRest {
354
354
  * @method
355
355
  * @name binance#watchOHLCV
356
356
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
357
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
357
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
358
358
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
359
359
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
360
360
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -370,7 +370,7 @@ export default class binance extends binanceRest {
370
370
  * @method
371
371
  * @name binance#watchOHLCVForSymbols
372
372
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
373
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
373
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
374
374
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
375
375
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
376
376
  * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
@@ -385,7 +385,7 @@ export default class binance extends binanceRest {
385
385
  * @method
386
386
  * @name binance#unWatchOHLCVForSymbols
387
387
  * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
388
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
388
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
389
389
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
390
390
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
391
391
  * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
@@ -398,7 +398,7 @@ export default class binance extends binanceRest {
398
398
  * @method
399
399
  * @name binance#unWatchOHLCV
400
400
  * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
401
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
401
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
402
402
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
403
403
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
404
404
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -424,7 +424,7 @@ export default class binance extends binanceRest {
424
424
  * @method
425
425
  * @name binance#fetchOHLCVWs
426
426
  * @description query historical candlestick data containing the open, high, low, and close price, and the volume of a market
427
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
427
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
428
428
  * @param {string} symbol unified symbol of the market to query OHLCV data for
429
429
  * @param {string} timeframe the length of time each candle represents
430
430
  * @param {int} since timestamp in ms of the earliest candle to fetch
@@ -525,7 +525,7 @@ export default class binance extends binanceRest {
525
525
  * @method
526
526
  * @name binance#watchBidsAsks
527
527
  * @description watches best bid & ask for symbols
528
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#symbol-order-book-ticker
528
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-order-book-ticker
529
529
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
530
530
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
531
531
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
@@ -550,7 +550,7 @@ export default class binance extends binanceRest {
550
550
  * @name binance#fetchBalanceWs
551
551
  * @description fetch balance and get the amount of funds available for trading or funds locked in orders
552
552
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
553
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/account-requests#account-information-user_data
553
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-information-user_data
554
554
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api
555
555
  * @param {object} [params] extra parameters specific to the exchange API endpoint
556
556
  * @param {string|undefined} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
@@ -601,7 +601,7 @@ export default class binance extends binanceRest {
601
601
  * @method
602
602
  * @name binance#createOrderWs
603
603
  * @description create a trade order
604
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#place-new-order-trade
604
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade
605
605
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
606
606
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api
607
607
  * @param {string} symbol unified symbol of the market to create an order in
@@ -621,7 +621,7 @@ export default class binance extends binanceRest {
621
621
  * @method
622
622
  * @name binance#editOrderWs
623
623
  * @description edit a trade order
624
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-and-replace-order-trade
624
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-and-replace-order-trade
625
625
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
626
626
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order
627
627
  * @param {string} id order id
@@ -639,7 +639,7 @@ export default class binance extends binanceRest {
639
639
  * @method
640
640
  * @name binance#cancelOrderWs
641
641
  * @description cancel multiple orders
642
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-order-trade
642
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade
643
643
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
644
644
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order
645
645
  * @param {string} id order id
@@ -653,7 +653,7 @@ export default class binance extends binanceRest {
653
653
  * @method
654
654
  * @name binance#cancelAllOrdersWs
655
655
  * @description cancel all open orders in a market
656
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-open-orders-trade
656
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade
657
657
  * @param {string} [symbol] unified market symbol of the market to cancel orders in
658
658
  * @param {object} [params] extra parameters specific to the exchange API endpoint
659
659
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -663,7 +663,7 @@ export default class binance extends binanceRest {
663
663
  * @method
664
664
  * @name binance#fetchOrderWs
665
665
  * @description fetches information on an order made by the user
666
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#query-order-user_data
666
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#query-order-user_data
667
667
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
668
668
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order
669
669
  * @param {string} id order id
@@ -676,7 +676,7 @@ export default class binance extends binanceRest {
676
676
  * @method
677
677
  * @name binance#fetchOrdersWs
678
678
  * @description fetches information on multiple orders made by the user
679
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#order-lists
679
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
680
680
  * @param {string} symbol unified market symbol of the market orders were made in
681
681
  * @param {int|undefined} [since] the earliest time in ms to fetch orders for
682
682
  * @param {int|undefined} [limit] the maximum number of order structures to retrieve
@@ -692,7 +692,7 @@ export default class binance extends binanceRest {
692
692
  * @method
693
693
  * @name binance#fetchClosedOrdersWs
694
694
  * @description fetch closed orders
695
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#order-lists
695
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
696
696
  * @param {string} symbol unified market symbol
697
697
  * @param {int} [since] the earliest time in ms to fetch open orders for
698
698
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -704,7 +704,7 @@ export default class binance extends binanceRest {
704
704
  * @method
705
705
  * @name binance#fetchOpenOrdersWs
706
706
  * @description fetch all unfilled currently open orders
707
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#current-open-orders-user_data
707
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#current-open-orders-user_data
708
708
  * @param {string} symbol unified market symbol
709
709
  * @param {int|undefined} [since] the earliest time in ms to fetch open orders for
710
710
  * @param {int|undefined} [limit] the maximum number of open orders structures to retrieve
@@ -750,7 +750,7 @@ export default class binance extends binanceRest {
750
750
  * @method
751
751
  * @name binance#fetchMyTradesWs
752
752
  * @description fetch all trades made by the user
753
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/account-requests#account-trade-history-user_data
753
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data
754
754
  * @param {string} symbol unified market symbol
755
755
  * @param {int|undefined} [since] the earliest time in ms to fetch trades for
756
756
  * @param {int|undefined} [limit] the maximum number of trades structures to retrieve
@@ -764,7 +764,7 @@ export default class binance extends binanceRest {
764
764
  * @method
765
765
  * @name binance#fetchTradesWs
766
766
  * @description fetch all trades made by the user
767
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
767
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades
768
768
  * @param {string} symbol unified market symbol
769
769
  * @param {int} [since] the earliest time in ms to fetch trades for
770
770
  * @param {int} [limit] the maximum number of trades structures to retrieve, default=500, max=1000