ccxt 4.4.43 → 4.4.45

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 (95) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +6 -6
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/binance.js +216 -82
  5. package/dist/cjs/src/bingx.js +20 -9
  6. package/dist/cjs/src/bitfinex.js +7 -3
  7. package/dist/cjs/src/bitget.js +6 -4
  8. package/dist/cjs/src/bitmart.js +7 -10
  9. package/dist/cjs/src/bitmex.js +4 -6
  10. package/dist/cjs/src/bitstamp.js +5 -0
  11. package/dist/cjs/src/blofin.js +22 -0
  12. package/dist/cjs/src/bybit.js +11 -26
  13. package/dist/cjs/src/coinbase.js +14 -10
  14. package/dist/cjs/src/coinbaseinternational.js +13 -9
  15. package/dist/cjs/src/coincatch.js +2 -2
  16. package/dist/cjs/src/coinex.js +6 -6
  17. package/dist/cjs/src/cryptocom.js +4 -2
  18. package/dist/cjs/src/defx.js +2 -2
  19. package/dist/cjs/src/delta.js +1 -1
  20. package/dist/cjs/src/exmo.js +18 -8
  21. package/dist/cjs/src/gate.js +8 -3
  22. package/dist/cjs/src/gemini.js +5 -0
  23. package/dist/cjs/src/hashkey.js +16 -10
  24. package/dist/cjs/src/htx.js +107 -4
  25. package/dist/cjs/src/hyperliquid.js +6 -1
  26. package/dist/cjs/src/kraken.js +10 -3
  27. package/dist/cjs/src/krakenfutures.js +6 -1
  28. package/dist/cjs/src/kucoin.js +10 -8
  29. package/dist/cjs/src/kucoinfutures.js +7 -8
  30. package/dist/cjs/src/lykke.js +1 -1
  31. package/dist/cjs/src/mexc.js +18 -12
  32. package/dist/cjs/src/myokx.js +8 -0
  33. package/dist/cjs/src/ndax.js +1 -1
  34. package/dist/cjs/src/oceanex.js +1 -1
  35. package/dist/cjs/src/okx.js +8 -9
  36. package/dist/cjs/src/onetrading.js +2 -1
  37. package/dist/cjs/src/pro/binance.js +2 -1
  38. package/dist/cjs/src/pro/bitcoincom.js +4 -1
  39. package/dist/cjs/src/pro/bitopro.js +1 -1
  40. package/dist/cjs/src/pro/myokx.js +5 -0
  41. package/dist/cjs/src/whitebit.js +38 -10
  42. package/dist/cjs/src/woo.js +6 -4
  43. package/dist/cjs/src/woofipro.js +7 -4
  44. package/js/ccxt.d.ts +1 -1
  45. package/js/ccxt.js +1 -1
  46. package/js/src/abstract/binance.d.ts +1 -0
  47. package/js/src/abstract/binancecoinm.d.ts +1 -0
  48. package/js/src/abstract/binanceus.d.ts +1 -0
  49. package/js/src/abstract/binanceusdm.d.ts +1 -0
  50. package/js/src/abstract/blofin.d.ts +22 -0
  51. package/js/src/binance.d.ts +37 -32
  52. package/js/src/binance.js +216 -82
  53. package/js/src/bingx.js +20 -9
  54. package/js/src/bitfinex.js +7 -3
  55. package/js/src/bitget.js +6 -4
  56. package/js/src/bitmart.js +7 -10
  57. package/js/src/bitmex.js +4 -6
  58. package/js/src/bitstamp.js +5 -0
  59. package/js/src/blofin.js +22 -0
  60. package/js/src/bybit.js +11 -26
  61. package/js/src/coinbase.js +14 -10
  62. package/js/src/coinbaseinternational.js +13 -9
  63. package/js/src/coincatch.js +2 -2
  64. package/js/src/coinex.js +6 -6
  65. package/js/src/cryptocom.js +4 -2
  66. package/js/src/defx.js +2 -2
  67. package/js/src/delta.js +1 -1
  68. package/js/src/exmo.d.ts +1 -0
  69. package/js/src/exmo.js +18 -8
  70. package/js/src/gate.js +8 -3
  71. package/js/src/gemini.js +5 -0
  72. package/js/src/hashkey.js +16 -10
  73. package/js/src/htx.d.ts +13 -1
  74. package/js/src/htx.js +107 -4
  75. package/js/src/hyperliquid.js +6 -1
  76. package/js/src/kraken.js +10 -3
  77. package/js/src/krakenfutures.js +6 -1
  78. package/js/src/kucoin.js +10 -8
  79. package/js/src/kucoinfutures.js +7 -8
  80. package/js/src/lykke.js +1 -1
  81. package/js/src/mexc.js +18 -12
  82. package/js/src/myokx.js +8 -0
  83. package/js/src/ndax.js +1 -1
  84. package/js/src/oceanex.js +1 -1
  85. package/js/src/okx.js +8 -9
  86. package/js/src/onetrading.js +2 -1
  87. package/js/src/pro/binance.js +2 -1
  88. package/js/src/pro/bitcoincom.js +4 -1
  89. package/js/src/pro/bitopro.js +1 -1
  90. package/js/src/pro/myokx.js +5 -0
  91. package/js/src/whitebit.d.ts +2 -1
  92. package/js/src/whitebit.js +38 -10
  93. package/js/src/woo.js +6 -4
  94. package/js/src/woofipro.js +7 -4
  95. package/package.json +1 -1
@@ -818,9 +818,22 @@ class whitebit extends whitebit$1 {
818
818
  // "last": "55913.88",
819
819
  // "period": 86400
820
820
  // }
821
- market = this.safeMarket(undefined, market);
821
+ // v2
822
+ // {
823
+ // lastUpdateTimestamp: '2025-01-02T09:16:36.000Z',
824
+ // tradingPairs: 'ARB_USDC',
825
+ // lastPrice: '0.7727',
826
+ // lowestAsk: '0.7735',
827
+ // highestBid: '0.7732',
828
+ // baseVolume24h: '1555793.74',
829
+ // quoteVolume24h: '1157602.622406',
830
+ // tradesEnabled: true
831
+ // }
832
+ //
833
+ const marketId = this.safeString(ticker, 'tradingPairs');
834
+ market = this.safeMarket(marketId, market);
822
835
  // last price is provided as "last" or "last_price"
823
- const last = this.safeString2(ticker, 'last', 'last_price');
836
+ const last = this.safeStringN(ticker, ['last', 'last_price', 'lastPrice']);
824
837
  // if "close" is provided, use it, otherwise use <last>
825
838
  const close = this.safeString(ticker, 'close', last);
826
839
  return this.safeTicker({
@@ -829,9 +842,9 @@ class whitebit extends whitebit$1 {
829
842
  'datetime': undefined,
830
843
  'high': this.safeString(ticker, 'high'),
831
844
  'low': this.safeString(ticker, 'low'),
832
- 'bid': this.safeString(ticker, 'bid'),
845
+ 'bid': this.safeString2(ticker, 'bid', 'highestBid'),
833
846
  'bidVolume': undefined,
834
- 'ask': this.safeString(ticker, 'ask'),
847
+ 'ask': this.safeString2(ticker, 'ask', 'lowestAsk'),
835
848
  'askVolume': undefined,
836
849
  'vwap': undefined,
837
850
  'open': this.safeString(ticker, 'open'),
@@ -841,8 +854,8 @@ class whitebit extends whitebit$1 {
841
854
  'change': undefined,
842
855
  'percentage': this.safeString(ticker, 'change'),
843
856
  'average': undefined,
844
- 'baseVolume': this.safeString2(ticker, 'base_volume', 'volume'),
845
- 'quoteVolume': this.safeString2(ticker, 'quote_volume', 'deal'),
857
+ 'baseVolume': this.safeStringN(ticker, ['base_volume', 'volume', 'baseVolume24h']),
858
+ 'quoteVolume': this.safeStringN(ticker, ['quote_volume', 'deal', 'quoteVolume24h']),
846
859
  'info': ticker,
847
860
  }, market);
848
861
  }
@@ -851,14 +864,23 @@ class whitebit extends whitebit$1 {
851
864
  * @name whitebit#fetchTickers
852
865
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
853
866
  * @see https://docs.whitebit.com/public/http-v4/#market-activity
854
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
867
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
855
868
  * @param {object} [params] extra parameters specific to the exchange API endpoint
869
+ * @param {string} [params.method] either v2PublicGetTicker or v4PublicGetTicker default is v4PublicGetTicker
856
870
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
857
871
  */
858
872
  async fetchTickers(symbols = undefined, params = {}) {
859
873
  await this.loadMarkets();
860
874
  symbols = this.marketSymbols(symbols);
861
- const response = await this.v4PublicGetTicker(params);
875
+ let method = 'v4PublicGetTicker';
876
+ [method, params] = this.handleOptionAndParams(params, 'fetchTickers', 'method', method);
877
+ let response = undefined;
878
+ if (method === 'v4PublicGetTicker') {
879
+ response = await this.v4PublicGetTicker(params);
880
+ }
881
+ else {
882
+ response = await this.v2PublicGetTicker(params);
883
+ }
862
884
  //
863
885
  // "BCH_RUB": {
864
886
  // "base_id":1831,
@@ -870,6 +892,10 @@ class whitebit extends whitebit$1 {
870
892
  // "change":"2.12"
871
893
  // },
872
894
  //
895
+ const resultList = this.safeList(response, 'result');
896
+ if (resultList !== undefined) {
897
+ return this.parseTickers(resultList, symbols);
898
+ }
873
899
  const marketIds = Object.keys(response);
874
900
  const result = {};
875
901
  for (let i = 0; i < marketIds.length; i++) {
@@ -1228,9 +1254,11 @@ class whitebit extends whitebit$1 {
1228
1254
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1229
1255
  */
1230
1256
  async createMarketOrderWithCost(symbol, side, cost, params = {}) {
1231
- params['cost'] = cost;
1257
+ const req = {
1258
+ 'cost': cost,
1259
+ };
1232
1260
  // only buy side is supported
1233
- return await this.createOrder(symbol, 'market', side, 0, undefined, params);
1261
+ return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
1234
1262
  }
1235
1263
  /**
1236
1264
  * @method
@@ -333,9 +333,11 @@ class woo extends woo$1 {
333
333
  },
334
334
  'hedged': false,
335
335
  'trailing': true,
336
- // exchange specific params:
337
- // 'iceberg': true,
338
- // 'oco': true,
336
+ 'leverage': false,
337
+ 'marketBuyByCost': true,
338
+ 'marketBuyRequiresPrice': false,
339
+ 'selfTradePrevention': false,
340
+ 'iceberg': true, // todo implement
339
341
  },
340
342
  'createOrders': undefined,
341
343
  'fetchMyTrades': {
@@ -366,7 +368,7 @@ class woo extends woo$1 {
366
368
  'fetchClosedOrders': {
367
369
  'marginMode': false,
368
370
  'limit': 500,
369
- 'daysBackClosed': undefined,
371
+ 'daysBack': undefined,
370
372
  'daysBackCanceled': undefined,
371
373
  'untilDays': 100000,
372
374
  'trigger': true,
@@ -320,8 +320,11 @@ class woofipro extends woofipro$1 {
320
320
  },
321
321
  'hedged': false,
322
322
  'trailing': true,
323
- // exchange specific
324
- // 'iceberg': true,
323
+ 'leverage': true,
324
+ 'marketBuyByCost': false,
325
+ 'marketBuyRequiresPrice': false,
326
+ 'selfTradePrevention': false,
327
+ 'iceberg': true, // todo implement
325
328
  },
326
329
  'createOrders': {
327
330
  'max': 10,
@@ -347,7 +350,7 @@ class woofipro extends woofipro$1 {
347
350
  'fetchClosedOrders': {
348
351
  'marginMode': false,
349
352
  'limit': 500,
350
- 'daysBackClosed': undefined,
353
+ 'daysBack': undefined,
351
354
  'daysBackCanceled': undefined,
352
355
  'untilDays': 100000,
353
356
  'trigger': true,
@@ -368,7 +371,7 @@ class woofipro extends woofipro$1 {
368
371
  'attachedStopLossTakeProfit': {
369
372
  // todo: implementation needs unification
370
373
  'triggerPriceType': undefined,
371
- 'limitPrice': false,
374
+ 'price': false,
372
375
  },
373
376
  },
374
377
  },
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OpenInterests } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.4.42";
7
+ declare const version = "4.4.44";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.4.43';
41
+ const version = '4.4.45';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -761,6 +761,7 @@ interface Exchange {
761
761
  papiDeleteMarginAllOpenOrders(params?: {}): Promise<implicitReturnType>;
762
762
  papiDeleteMarginOrderList(params?: {}): Promise<implicitReturnType>;
763
763
  papiDeleteListenKey(params?: {}): Promise<implicitReturnType>;
764
+ papiV2GetUmAccount(params?: {}): Promise<implicitReturnType>;
764
765
  }
765
766
  declare abstract class Exchange extends _Exchange {
766
767
  }
@@ -761,6 +761,7 @@ interface binance {
761
761
  papiDeleteMarginAllOpenOrders(params?: {}): Promise<implicitReturnType>;
762
762
  papiDeleteMarginOrderList(params?: {}): Promise<implicitReturnType>;
763
763
  papiDeleteListenKey(params?: {}): Promise<implicitReturnType>;
764
+ papiV2GetUmAccount(params?: {}): Promise<implicitReturnType>;
764
765
  }
765
766
  declare abstract class binance extends _binance {
766
767
  }
@@ -813,6 +813,7 @@ interface binance {
813
813
  papiDeleteMarginAllOpenOrders(params?: {}): Promise<implicitReturnType>;
814
814
  papiDeleteMarginOrderList(params?: {}): Promise<implicitReturnType>;
815
815
  papiDeleteListenKey(params?: {}): Promise<implicitReturnType>;
816
+ papiV2GetUmAccount(params?: {}): Promise<implicitReturnType>;
816
817
  }
817
818
  declare abstract class binance extends _binance {
818
819
  }
@@ -761,6 +761,7 @@ interface binance {
761
761
  papiDeleteMarginAllOpenOrders(params?: {}): Promise<implicitReturnType>;
762
762
  papiDeleteMarginOrderList(params?: {}): Promise<implicitReturnType>;
763
763
  papiDeleteListenKey(params?: {}): Promise<implicitReturnType>;
764
+ papiV2GetUmAccount(params?: {}): Promise<implicitReturnType>;
764
765
  }
765
766
  declare abstract class binance extends _binance {
766
767
  }
@@ -25,6 +25,18 @@ interface Exchange {
25
25
  privateGetTradeOrdersTpslHistory(params?: {}): Promise<implicitReturnType>;
26
26
  privateGetUserQueryApikey(params?: {}): Promise<implicitReturnType>;
27
27
  privateGetAffiliateBasic(params?: {}): Promise<implicitReturnType>;
28
+ privateGetCopytradingInstruments(params?: {}): Promise<implicitReturnType>;
29
+ privateGetCopytradingAccountBalance(params?: {}): Promise<implicitReturnType>;
30
+ privateGetCopytradingAccountPositionsByOrder(params?: {}): Promise<implicitReturnType>;
31
+ privateGetCopytradingAccountPositionsDetailsByOrder(params?: {}): Promise<implicitReturnType>;
32
+ privateGetCopytradingAccountPositionsByContract(params?: {}): Promise<implicitReturnType>;
33
+ privateGetCopytradingAccountPositionMode(params?: {}): Promise<implicitReturnType>;
34
+ privateGetCopytradingAccountLeverageInfo(params?: {}): Promise<implicitReturnType>;
35
+ privateGetCopytradingTradeOrdersPending(params?: {}): Promise<implicitReturnType>;
36
+ privateGetCopytradingTradePendingTpslByContract(params?: {}): Promise<implicitReturnType>;
37
+ privateGetCopytradingTradePositionHistoryByOrder(params?: {}): Promise<implicitReturnType>;
38
+ privateGetCopytradingTradeOrdersHistory(params?: {}): Promise<implicitReturnType>;
39
+ privateGetCopytradingTradePendingTpslByOrder(params?: {}): Promise<implicitReturnType>;
28
40
  privatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
29
41
  privatePostTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
30
42
  privatePostAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
@@ -34,6 +46,16 @@ interface Exchange {
34
46
  privatePostTradeCancelTpsl(params?: {}): Promise<implicitReturnType>;
35
47
  privatePostTradeClosePosition(params?: {}): Promise<implicitReturnType>;
36
48
  privatePostAssetTransfer(params?: {}): Promise<implicitReturnType>;
49
+ privatePostCopytradingAccountSetPositionMode(params?: {}): Promise<implicitReturnType>;
50
+ privatePostCopytradingAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
51
+ privatePostCopytradingTradePlaceOrder(params?: {}): Promise<implicitReturnType>;
52
+ privatePostCopytradingTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
53
+ privatePostCopytradingTradePlaceTpslByContract(params?: {}): Promise<implicitReturnType>;
54
+ privatePostCopytradingTradeCancelTpslByContract(params?: {}): Promise<implicitReturnType>;
55
+ privatePostCopytradingTradePlaceTpslByOrder(params?: {}): Promise<implicitReturnType>;
56
+ privatePostCopytradingTradeCancelTpslByOrder(params?: {}): Promise<implicitReturnType>;
57
+ privatePostCopytradingTradeClosePositionByOrder(params?: {}): Promise<implicitReturnType>;
58
+ privatePostCopytradingTradeClosePositionByContract(params?: {}): Promise<implicitReturnType>;
37
59
  }
38
60
  declare abstract class Exchange extends _Exchange {
39
61
  }
@@ -19,7 +19,7 @@ export default class binance extends Exchange {
19
19
  * @method
20
20
  * @name binance#fetchTime
21
21
  * @description fetches the current integer timestamp in milliseconds from the exchange server
22
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
22
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#check-server-time // spot
23
23
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
24
24
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
25
25
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -41,7 +41,7 @@ export default class binance extends Exchange {
41
41
  * @method
42
42
  * @name binance#fetchMarkets
43
43
  * @description retrieves data on all markets for binance
44
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
44
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#exchange-information // spot
45
45
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
46
46
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
47
47
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
@@ -58,7 +58,7 @@ export default class binance extends Exchange {
58
58
  * @method
59
59
  * @name binance#fetchBalance
60
60
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
61
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
61
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-information-user_data // spot
62
62
  * @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
63
63
  * @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
64
64
  * @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
@@ -79,7 +79,7 @@ export default class binance extends Exchange {
79
79
  * @method
80
80
  * @name binance#fetchOrderBook
81
81
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
82
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
82
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#order-book // spot
83
83
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
84
84
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
85
85
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
@@ -109,8 +109,8 @@ export default class binance extends Exchange {
109
109
  * @method
110
110
  * @name binance#fetchTicker
111
111
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
112
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
113
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
112
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics // spot
113
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#rolling-window-price-change-statistics // spot
114
114
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
115
115
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
116
116
  * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
@@ -124,7 +124,7 @@ export default class binance extends Exchange {
124
124
  * @method
125
125
  * @name binance#fetchBidsAsks
126
126
  * @description fetches the bid and ask price and volume for multiple markets
127
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
127
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-order-book-ticker // spot
128
128
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
129
129
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
130
130
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
@@ -137,7 +137,7 @@ export default class binance extends Exchange {
137
137
  * @method
138
138
  * @name binance#fetchLastPrices
139
139
  * @description fetches the last price for multiple markets
140
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
140
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-price-ticker // spot
141
141
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
142
142
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
143
143
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
@@ -158,7 +158,7 @@ export default class binance extends Exchange {
158
158
  * @method
159
159
  * @name binance#fetchTickers
160
160
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
161
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
161
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics // spot
162
162
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
163
163
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
164
164
  * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
@@ -198,7 +198,7 @@ export default class binance extends Exchange {
198
198
  * @method
199
199
  * @name binance#fetchOHLCV
200
200
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
201
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
201
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#klinecandlestick-data
202
202
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
203
203
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
204
204
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
@@ -225,15 +225,15 @@ export default class binance extends Exchange {
225
225
  * @name binance#fetchTrades
226
226
  * @description get the list of most recent trades for a particular symbol
227
227
  * Default fetchTradesMethod
228
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
228
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#compressedaggregate-trades-list // publicGetAggTrades (spot)
229
229
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
230
230
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
231
231
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
232
232
  * Other fetchTradesMethod
233
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
233
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#recent-trades-list // publicGetTrades (spot)
234
234
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
235
235
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
236
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
236
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#old-trade-lookup // publicGetHistoricalTrades (spot)
237
237
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
238
238
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
239
239
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
@@ -255,7 +255,7 @@ export default class binance extends Exchange {
255
255
  * @name binance#editSpotOrder
256
256
  * @ignore
257
257
  * @description edit a trade order
258
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
258
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
259
259
  * @param {string} id cancel order id
260
260
  * @param {string} symbol unified symbol of the market to create an order in
261
261
  * @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
@@ -275,6 +275,8 @@ export default class binance extends Exchange {
275
275
  * @description edit a trade order
276
276
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
277
277
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
278
+ * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
279
+ * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
278
280
  * @param {string} id cancel order id
279
281
  * @param {string} symbol unified symbol of the market to create an order in
280
282
  * @param {string} type 'market' or 'limit'
@@ -282,6 +284,7 @@ export default class binance extends Exchange {
282
284
  * @param {float} amount how much of currency you want to trade in units of base currency
283
285
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
284
286
  * @param {object} [params] extra parameters specific to the exchange API endpoint
287
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
285
288
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
286
289
  */
287
290
  editContractOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
@@ -289,7 +292,7 @@ export default class binance extends Exchange {
289
292
  * @method
290
293
  * @name binance#editOrder
291
294
  * @description edit a trade order
292
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
295
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
293
296
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
294
297
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
295
298
  * @param {string} id cancel order id
@@ -299,6 +302,7 @@ export default class binance extends Exchange {
299
302
  * @param {float} amount how much of currency you want to trade in units of base currency
300
303
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
301
304
  * @param {object} [params] extra parameters specific to the exchange API endpoint
305
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
302
306
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
303
307
  */
304
308
  editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
@@ -320,13 +324,13 @@ export default class binance extends Exchange {
320
324
  * @method
321
325
  * @name binance#createOrder
322
326
  * @description create a trade order
323
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
324
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
327
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
328
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade
325
329
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
326
330
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
327
331
  * @see https://developers.binance.com/docs/derivatives/option/trade/New-Order
328
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
329
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
332
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#sor
333
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-using-sor-trade
330
334
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
331
335
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
332
336
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
@@ -351,6 +355,7 @@ export default class binance extends Exchange {
351
355
  * @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
352
356
  * @param {string} [params.positionSide] *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
353
357
  * @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
358
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
354
359
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
355
360
  */
356
361
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
@@ -359,7 +364,7 @@ export default class binance extends Exchange {
359
364
  * @method
360
365
  * @name binance#createMarketOrderWithCost
361
366
  * @description create a market order by providing the symbol, side and cost
362
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
367
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
363
368
  * @param {string} symbol unified symbol of the market to create an order in
364
369
  * @param {string} side 'buy' or 'sell'
365
370
  * @param {float} cost how much you want to trade in units of the quote currency
@@ -371,7 +376,7 @@ export default class binance extends Exchange {
371
376
  * @method
372
377
  * @name binance#createMarketBuyOrderWithCost
373
378
  * @description create a market buy order by providing the symbol and cost
374
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
379
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
375
380
  * @param {string} symbol unified symbol of the market to create an order in
376
381
  * @param {float} cost how much you want to trade in units of the quote currency
377
382
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -382,7 +387,7 @@ export default class binance extends Exchange {
382
387
  * @method
383
388
  * @name binance#createMarketSellOrderWithCost
384
389
  * @description create a market sell order by providing the symbol and cost
385
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
390
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
386
391
  * @param {string} symbol unified symbol of the market to create an order in
387
392
  * @param {float} cost how much you want to trade in units of the quote currency
388
393
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -393,7 +398,7 @@ export default class binance extends Exchange {
393
398
  * @method
394
399
  * @name binance#fetchOrder
395
400
  * @description fetches information on an order made by the user
396
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
401
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-order-user_data
397
402
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
398
403
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
399
404
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
@@ -412,7 +417,7 @@ export default class binance extends Exchange {
412
417
  * @method
413
418
  * @name binance#fetchOrders
414
419
  * @description fetches information on multiple orders made by the user
415
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
420
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
416
421
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
417
422
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
418
423
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -437,7 +442,7 @@ export default class binance extends Exchange {
437
442
  * @method
438
443
  * @name binance#fetchOpenOrders
439
444
  * @description fetch all unfilled currently open orders
440
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
445
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#current-open-orders-user_data
441
446
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
442
447
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
443
448
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
@@ -478,7 +483,7 @@ export default class binance extends Exchange {
478
483
  * @method
479
484
  * @name binance#fetchClosedOrders
480
485
  * @description fetches information on multiple closed orders made by the user
481
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
486
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
482
487
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
483
488
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
484
489
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -501,7 +506,7 @@ export default class binance extends Exchange {
501
506
  * @method
502
507
  * @name binance#fetchCanceledOrders
503
508
  * @description fetches information on multiple canceled orders made by the user
504
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
509
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
505
510
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
506
511
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
507
512
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -524,7 +529,7 @@ export default class binance extends Exchange {
524
529
  * @method
525
530
  * @name binance#fetchCanceledAndClosedOrders
526
531
  * @description fetches information on multiple canceled orders made by the user
527
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
532
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
528
533
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
529
534
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
530
535
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -547,7 +552,7 @@ export default class binance extends Exchange {
547
552
  * @method
548
553
  * @name binance#cancelOrder
549
554
  * @description cancels an open order
550
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
555
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-order-trade
551
556
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
552
557
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
553
558
  * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
@@ -569,7 +574,7 @@ export default class binance extends Exchange {
569
574
  * @method
570
575
  * @name binance#cancelAllOrders
571
576
  * @description cancel all open orders in a market
572
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
577
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-all-open-orders-on-a-symbol-trade
573
578
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
574
579
  * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
575
580
  * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
@@ -606,7 +611,7 @@ export default class binance extends Exchange {
606
611
  * @method
607
612
  * @name binance#fetchOrderTrades
608
613
  * @description fetch all the trades made from a single order
609
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
614
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
610
615
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
611
616
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
612
617
  * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
@@ -622,7 +627,7 @@ export default class binance extends Exchange {
622
627
  * @method
623
628
  * @name binance#fetchMyTrades
624
629
  * @description fetch all trades made by the user
625
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
630
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
626
631
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
627
632
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
628
633
  * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List