ccxt 4.1.80 → 4.1.82

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 (46) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.js +445 -175
  3. package/dist/ccxt.browser.min.js +5 -5
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/bybit.js +4 -2
  6. package/dist/cjs/src/coinex.js +191 -71
  7. package/dist/cjs/src/digifinex.js +42 -8
  8. package/dist/cjs/src/htx.js +12 -10
  9. package/dist/cjs/src/lbank.js +70 -38
  10. package/dist/cjs/src/okx.js +52 -7
  11. package/dist/cjs/src/pro/binance.js +1 -1
  12. package/dist/cjs/src/pro/bingx.js +1 -1
  13. package/dist/cjs/src/pro/bitget.js +1 -1
  14. package/dist/cjs/src/pro/bybit.js +1 -1
  15. package/dist/cjs/src/pro/cex.js +1 -1
  16. package/dist/cjs/src/pro/coinbasepro.js +1 -1
  17. package/dist/cjs/src/pro/cryptocom.js +1 -1
  18. package/dist/cjs/src/pro/gate.js +1 -1
  19. package/dist/cjs/src/pro/kucoin.js +1 -1
  20. package/dist/cjs/src/pro/kucoinfutures.js +1 -1
  21. package/dist/cjs/src/pro/okx.js +1 -1
  22. package/dist/cjs/src/whitebit.js +62 -27
  23. package/js/ccxt.d.ts +1 -1
  24. package/js/ccxt.js +1 -1
  25. package/js/src/abstract/bybit.d.ts +1 -0
  26. package/js/src/bybit.js +4 -2
  27. package/js/src/coinex.js +191 -71
  28. package/js/src/digifinex.d.ts +1 -0
  29. package/js/src/digifinex.js +42 -8
  30. package/js/src/htx.js +12 -10
  31. package/js/src/lbank.d.ts +1 -0
  32. package/js/src/lbank.js +71 -39
  33. package/js/src/okx.js +52 -7
  34. package/js/src/pro/binance.js +1 -1
  35. package/js/src/pro/bingx.js +1 -1
  36. package/js/src/pro/bitget.js +1 -1
  37. package/js/src/pro/bybit.js +1 -1
  38. package/js/src/pro/cex.js +1 -1
  39. package/js/src/pro/coinbasepro.js +1 -1
  40. package/js/src/pro/cryptocom.js +1 -1
  41. package/js/src/pro/gate.js +1 -1
  42. package/js/src/pro/kucoin.js +1 -1
  43. package/js/src/pro/kucoinfutures.js +1 -1
  44. package/js/src/pro/okx.js +1 -1
  45. package/js/src/whitebit.js +62 -27
  46. package/package.json +1 -1
@@ -30,6 +30,9 @@ class digifinex extends digifinex$1 {
30
30
  'addMargin': true,
31
31
  'cancelOrder': true,
32
32
  'cancelOrders': true,
33
+ 'createMarketBuyOrderWithCost': true,
34
+ 'createMarketOrderWithCost': false,
35
+ 'createMarketSellOrderWithCost': false,
33
36
  'createOrder': true,
34
37
  'createOrders': true,
35
38
  'createPostOnlyOrder': true,
@@ -1562,6 +1565,7 @@ class digifinex extends digifinex$1 {
1562
1565
  * @param {bool} [params.postOnly] true or false
1563
1566
  * @param {bool} [params.reduceOnly] true or false
1564
1567
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
1568
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
1565
1569
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1566
1570
  */
1567
1571
  await this.loadMarkets();
@@ -1779,16 +1783,27 @@ class digifinex extends digifinex$1 {
1779
1783
  request['type'] = side + suffix;
1780
1784
  // limit orders require the amount in the base currency, market orders require the amount in the quote currency
1781
1785
  let quantity = undefined;
1782
- const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
1783
- if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
1784
- if (price === undefined) {
1785
- throw new errors.InvalidOrder(this.id + ' createOrder() requires a price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
1786
+ let createMarketBuyOrderRequiresPrice = true;
1787
+ [createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrderRequest', 'createMarketBuyOrderRequiresPrice', true);
1788
+ if (isMarketOrder && (side === 'buy')) {
1789
+ const cost = this.safeNumber(params, 'cost');
1790
+ params = this.omit(params, 'cost');
1791
+ if (cost !== undefined) {
1792
+ quantity = this.costToPrecision(symbol, cost);
1793
+ }
1794
+ else if (createMarketBuyOrderRequiresPrice) {
1795
+ if (price === undefined) {
1796
+ throw new errors.InvalidOrder(this.id + ' createOrder() requires a price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
1797
+ }
1798
+ else {
1799
+ const amountString = this.numberToString(amount);
1800
+ const priceString = this.numberToString(price);
1801
+ const costRequest = this.parseNumber(Precise["default"].stringMul(amountString, priceString));
1802
+ quantity = this.costToPrecision(symbol, costRequest);
1803
+ }
1786
1804
  }
1787
1805
  else {
1788
- const amountString = this.numberToString(amount);
1789
- const priceString = this.numberToString(price);
1790
- const cost = this.parseNumber(Precise["default"].stringMul(amountString, priceString));
1791
- quantity = this.priceToPrecision(symbol, cost);
1806
+ quantity = this.costToPrecision(symbol, amount);
1792
1807
  }
1793
1808
  }
1794
1809
  else {
@@ -1807,6 +1822,25 @@ class digifinex extends digifinex$1 {
1807
1822
  params = this.omit(params, ['postOnly']);
1808
1823
  return this.extend(request, params);
1809
1824
  }
1825
+ async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
1826
+ /**
1827
+ * @method
1828
+ * @name digifinex#createMarketBuyOrderWithCost
1829
+ * @description create a market buy order by providing the symbol and cost
1830
+ * @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#create-new-order
1831
+ * @param {string} symbol unified symbol of the market to create an order in
1832
+ * @param {float} cost how much you want to trade in units of the quote currency
1833
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1834
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1835
+ */
1836
+ await this.loadMarkets();
1837
+ const market = this.market(symbol);
1838
+ if (!market['spot']) {
1839
+ throw new errors.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
1840
+ }
1841
+ params['createMarketBuyOrderRequiresPrice'] = false;
1842
+ return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
1843
+ }
1810
1844
  async cancelOrder(id, symbol = undefined, params = {}) {
1811
1845
  /**
1812
1846
  * @method
@@ -3372,14 +3372,16 @@ class htx extends htx$1 {
3372
3372
  // "margin_mode": "cross",
3373
3373
  // "margin_account": "USDT",
3374
3374
  // "margin_asset": "USDT",
3375
- // "margin_balance": 200.000000000000000000,
3376
- // "margin_static": 200.000000000000000000,
3377
- // "margin_position": 0,
3378
- // "margin_frozen": 0,
3379
- // "profit_real": 0E-18,
3380
- // "profit_unreal": 0,
3381
- // "withdraw_available": 2E+2,
3382
- // "risk_rate": null,
3375
+ // "margin_balance": 49.874186030200000000,
3376
+ // "money_in": 50,
3377
+ // "money_out": 0,
3378
+ // "margin_static": 49.872786030200000000,
3379
+ // "margin_position": 6.180000000000000000,
3380
+ // "margin_frozen": 6.000000000000000000,
3381
+ // "profit_unreal": 0.001400000000000000,
3382
+ // "withdraw_available": 37.6927860302,
3383
+ // "risk_rate": 271.984050521072796934,
3384
+ // "new_risk_rate": 0.001858676950514399,
3383
3385
  // "contract_detail": [
3384
3386
  // {
3385
3387
  // "symbol": "MANA",
@@ -3486,8 +3488,8 @@ class htx extends htx$1 {
3486
3488
  }
3487
3489
  else {
3488
3490
  const account = this.account();
3489
- account['free'] = this.safeString(first, 'margin_balance', 'margin_available');
3490
- account['used'] = this.safeString(first, 'margin_frozen');
3491
+ account['free'] = this.safeString(first, 'withdraw_available');
3492
+ account['total'] = this.safeString(first, 'margin_balance');
3491
3493
  const currencyId = this.safeString2(first, 'margin_asset', 'symbol');
3492
3494
  const code = this.safeCurrencyCode(currencyId);
3493
3495
  result[code] = account;
@@ -34,6 +34,9 @@ class lbank extends lbank$1 {
34
34
  'addMargin': false,
35
35
  'cancelAllOrders': true,
36
36
  'cancelOrder': true,
37
+ 'createMarketBuyOrderWithCost': true,
38
+ 'createMarketOrderWithCost': false,
39
+ 'createMarketSellOrderWithCost': false,
37
40
  'createOrder': true,
38
41
  'createReduceOnlyOrder': false,
39
42
  'createStopLimitOrder': false,
@@ -104,10 +107,10 @@ class lbank extends lbank$1 {
104
107
  'contract': 'https://lbkperp.lbank.com',
105
108
  },
106
109
  'api2': 'https://api.lbkex.com',
107
- 'www': 'https://www.lbank.info',
108
- 'doc': 'https://www.lbank.info/en-US/docs/index.html',
109
- 'fees': 'https://lbankinfo.zendesk.com/hc/en-gb/articles/360012072873-Trading-Fees',
110
- 'referral': 'https://www.lbank.info/invitevip?icode=7QCY',
110
+ 'www': 'https://www.lbank.com',
111
+ 'doc': 'https://www.lbank.com/en-US/docs/index.html',
112
+ 'fees': 'https://support.lbank.site/hc/en-gb/articles/900000535703-Trading-Fees-From-14-00-on-April-7-2020-UTC-8-',
113
+ 'referral': 'https://www.lbank.com/login/?icode=7QCY',
111
114
  },
112
115
  'api': {
113
116
  'spot': {
@@ -295,7 +298,7 @@ class lbank extends lbank$1 {
295
298
  * @method
296
299
  * @name lbank2#fetchTime
297
300
  * @description fetches the current integer timestamp in milliseconds from the exchange server
298
- * @see https://www.lbank.info/en-US/docs/index.html#get-timestamp
301
+ * @see https://www.lbank.com/en-US/docs/index.html#get-timestamp
299
302
  * @see https://www.lbank.com/en-US/docs/contract.html#get-the-current-time
300
303
  * @param {object} [params] extra parameters specific to the exchange API endpoint
301
304
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
@@ -590,7 +593,7 @@ class lbank extends lbank$1 {
590
593
  * @method
591
594
  * @name lbank2#fetchTicker
592
595
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
593
- * @see https://www.lbank.info/en-US/docs/index.html#query-current-market-data-new
596
+ * @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
594
597
  * @param {string} symbol unified symbol of the market to fetch the ticker for
595
598
  * @param {object} [params] extra parameters specific to the exchange API endpoint
596
599
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -635,7 +638,7 @@ class lbank extends lbank$1 {
635
638
  * @method
636
639
  * @name lbank2#fetchTickers
637
640
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
638
- * @see https://www.lbank.info/en-US/docs/index.html#query-current-market-data-new
641
+ * @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
639
642
  * @see https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
640
643
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
641
644
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -715,7 +718,7 @@ class lbank extends lbank$1 {
715
718
  * @method
716
719
  * @name lbank2#fetchOrderBook
717
720
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
718
- * @see https://www.lbank.info/en-US/docs/index.html#query-market-depth
721
+ * @see https://www.lbank.com/en-US/docs/index.html#query-market-depth
719
722
  * @see https://www.lbank.com/en-US/docs/contract.html#get-handicap
720
723
  * @param {string} symbol unified symbol of the market to fetch the order book for
721
724
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -904,8 +907,8 @@ class lbank extends lbank$1 {
904
907
  * @method
905
908
  * @name lbank2#fetchTrades
906
909
  * @description get the list of most recent trades for a particular symbol
907
- * @see https://www.lbank.info/en-US/docs/index.html#query-historical-transactions
908
- * @see https://www.lbank.info/en-US/docs/index.html#recent-transactions-list
910
+ * @see https://www.lbank.com/en-US/docs/index.html#query-historical-transactions
911
+ * @see https://www.lbank.com/en-US/docs/index.html#recent-transactions-list
909
912
  * @param {string} symbol unified symbol of the market to fetch trades for
910
913
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
911
914
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -977,7 +980,7 @@ class lbank extends lbank$1 {
977
980
  * @method
978
981
  * @name lbank2#fetchOHLCV
979
982
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
980
- * @see https://www.lbank.info/en-US/docs/index.html#query-k-bar-data
983
+ * @see https://www.lbank.com/en-US/docs/index.html#query-k-bar-data
981
984
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
982
985
  * @param {string} timeframe the length of time each candle represents
983
986
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -1162,9 +1165,9 @@ class lbank extends lbank$1 {
1162
1165
  * @method
1163
1166
  * @name lbank2#fetchBalance
1164
1167
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
1165
- * @see https://www.lbank.info/en-US/docs/index.html#asset-information
1166
- * @see https://www.lbank.info/en-US/docs/index.html#account-information
1167
- * @see https://www.lbank.info/en-US/docs/index.html#get-all-coins-information
1168
+ * @see https://www.lbank.com/en-US/docs/index.html#asset-information
1169
+ * @see https://www.lbank.com/en-US/docs/index.html#account-information
1170
+ * @see https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
1168
1171
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1169
1172
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1170
1173
  */
@@ -1229,7 +1232,7 @@ class lbank extends lbank$1 {
1229
1232
  * @method
1230
1233
  * @name lbank2#fetchTradingFee
1231
1234
  * @description fetch the trading fees for a market
1232
- * @see https://www.lbank.info/en-US/docs/index.html#transaction-fee-rate-query
1235
+ * @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
1233
1236
  * @param {string} symbol unified market symbol
1234
1237
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1235
1238
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -1243,7 +1246,7 @@ class lbank extends lbank$1 {
1243
1246
  * @method
1244
1247
  * @name lbank2#fetchTradingFees
1245
1248
  * @description fetch the trading fees for multiple markets
1246
- * @see https://www.lbank.info/en-US/docs/index.html#transaction-fee-rate-query
1249
+ * @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
1247
1250
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1248
1251
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
1249
1252
  */
@@ -1259,13 +1262,33 @@ class lbank extends lbank$1 {
1259
1262
  }
1260
1263
  return result;
1261
1264
  }
1265
+ async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
1266
+ /**
1267
+ * @method
1268
+ * @name lbank#createMarketBuyOrderWithCost
1269
+ * @description create a market buy order by providing the symbol and cost
1270
+ * @see https://www.lbank.com/en-US/docs/index.html#place-order
1271
+ * @see https://www.lbank.com/en-US/docs/index.html#place-an-order
1272
+ * @param {string} symbol unified symbol of the market to create an order in
1273
+ * @param {float} cost how much you want to trade in units of the quote currency
1274
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1275
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1276
+ */
1277
+ await this.loadMarkets();
1278
+ const market = this.market(symbol);
1279
+ if (!market['spot']) {
1280
+ throw new errors.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
1281
+ }
1282
+ params['createMarketBuyOrderRequiresPrice'] = false;
1283
+ return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
1284
+ }
1262
1285
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1263
1286
  /**
1264
1287
  * @method
1265
1288
  * @name lbank2#createOrder
1266
1289
  * @description create a trade order
1267
- * @see https://www.lbank.info/en-US/docs/index.html#place-order
1268
- * @see https://www.lbank.info/en-US/docs/index.html#place-an-order
1290
+ * @see https://www.lbank.com/en-US/docs/index.html#place-order
1291
+ * @see https://www.lbank.com/en-US/docs/index.html#place-an-order
1269
1292
  * @param {string} symbol unified symbol of the market to create an order in
1270
1293
  * @param {string} type 'market' or 'limit'
1271
1294
  * @param {string} side 'buy' or 'sell'
@@ -1310,21 +1333,30 @@ class lbank extends lbank$1 {
1310
1333
  }
1311
1334
  else if (side === 'buy') {
1312
1335
  request['type'] = side + '_' + 'market';
1313
- if (this.options['createMarketBuyOrderRequiresPrice']) {
1336
+ let quoteAmount = undefined;
1337
+ let createMarketBuyOrderRequiresPrice = true;
1338
+ [createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
1339
+ const cost = this.safeNumber(params, 'cost');
1340
+ params = this.omit(params, 'cost');
1341
+ if (cost !== undefined) {
1342
+ quoteAmount = this.costToPrecision(symbol, cost);
1343
+ }
1344
+ else if (createMarketBuyOrderRequiresPrice) {
1314
1345
  if (price === undefined) {
1315
- throw new errors.InvalidOrder(this.id + " createOrder () requires the price argument with market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply the price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options['createMarketBuyOrderRequiresPrice'] = false to supply the cost in the amount argument (the exchange-specific behaviour)");
1346
+ throw new errors.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
1316
1347
  }
1317
1348
  else {
1318
1349
  const amountString = this.numberToString(amount);
1319
1350
  const priceString = this.numberToString(price);
1320
- const quoteAmount = Precise["default"].stringMul(amountString, priceString);
1321
- const cost = this.parseNumber(quoteAmount);
1322
- request['price'] = this.priceToPrecision(symbol, cost);
1351
+ const costRequest = Precise["default"].stringMul(amountString, priceString);
1352
+ quoteAmount = this.costToPrecision(symbol, costRequest);
1323
1353
  }
1324
1354
  }
1325
1355
  else {
1326
- request['price'] = amount;
1356
+ quoteAmount = this.costToPrecision(symbol, amount);
1327
1357
  }
1358
+ // market buys require filling the price param instead of the amount param, for market buys the price is treated as the cost by lbank
1359
+ request['price'] = quoteAmount;
1328
1360
  }
1329
1361
  }
1330
1362
  if (clientOrderId !== undefined) {
@@ -1496,8 +1528,8 @@ class lbank extends lbank$1 {
1496
1528
  * @method
1497
1529
  * @name lbank2#fetchOrder
1498
1530
  * @description fetches information on an order made by the user
1499
- * @see https://www.lbank.info/en-US/docs/index.html#query-order
1500
- * @see https://www.lbank.info/en-US/docs/index.html#query-order-new
1531
+ * @see https://www.lbank.com/en-US/docs/index.html#query-order
1532
+ * @see https://www.lbank.com/en-US/docs/index.html#query-order-new
1501
1533
  * @param {string} symbol unified symbol of the market the order was made in
1502
1534
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1503
1535
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1600,7 +1632,7 @@ class lbank extends lbank$1 {
1600
1632
  * @method
1601
1633
  * @name lbank2#fetchMyTrades
1602
1634
  * @description fetch all trades made by the user
1603
- * @see https://www.lbank.info/en-US/docs/index.html#past-transaction-details
1635
+ * @see https://www.lbank.com/en-US/docs/index.html#past-transaction-details
1604
1636
  * @param {string} symbol unified market symbol
1605
1637
  * @param {int} [since] the earliest time in ms to fetch trades for
1606
1638
  * @param {int} [limit] the maximum number of trade structures to retrieve
@@ -1659,7 +1691,7 @@ class lbank extends lbank$1 {
1659
1691
  * @method
1660
1692
  * @name lbank2#fetchOrders
1661
1693
  * @description fetches information on multiple orders made by the user
1662
- * @see https://www.lbank.info/en-US/docs/index.html#query-all-orders
1694
+ * @see https://www.lbank.com/en-US/docs/index.html#query-all-orders
1663
1695
  * @param {string} symbol unified market symbol of the market orders were made in
1664
1696
  * @param {int} [since] the earliest time in ms to fetch orders for
1665
1697
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1719,7 +1751,7 @@ class lbank extends lbank$1 {
1719
1751
  * @method
1720
1752
  * @name lbank2#fetchOpenOrders
1721
1753
  * @description fetch all unfilled currently open orders
1722
- * @see https://www.lbank.info/en-US/docs/index.html#current-pending-order
1754
+ * @see https://www.lbank.com/en-US/docs/index.html#current-pending-order
1723
1755
  * @param {string} symbol unified market symbol
1724
1756
  * @param {int} [since] the earliest time in ms to fetch open orders for
1725
1757
  * @param {int} [limit] the maximum number of open order structures to retrieve
@@ -1776,7 +1808,7 @@ class lbank extends lbank$1 {
1776
1808
  * @method
1777
1809
  * @name lbank2#cancelOrder
1778
1810
  * @description cancels an open order
1779
- * @see https://www.lbank.info/en-US/docs/index.html#cancel-order-new
1811
+ * @see https://www.lbank.com/en-US/docs/index.html#cancel-order-new
1780
1812
  * @param {string} id order id
1781
1813
  * @param {string} symbol unified symbol of the market the order was made in
1782
1814
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1818,7 +1850,7 @@ class lbank extends lbank$1 {
1818
1850
  * @method
1819
1851
  * @name lbank2#cancelAllOrders
1820
1852
  * @description cancel all open orders in a market
1821
- * @see https://www.lbank.info/en-US/docs/index.html#cancel-all-pending-orders-for-a-single-trading-pair
1853
+ * @see https://www.lbank.com/en-US/docs/index.html#cancel-all-pending-orders-for-a-single-trading-pair
1822
1854
  * @param {string} symbol unified market symbol of the market to cancel orders in
1823
1855
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1824
1856
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1865,8 +1897,8 @@ class lbank extends lbank$1 {
1865
1897
  * @method
1866
1898
  * @name lbank2#fetchDepositAddress
1867
1899
  * @description fetch the deposit address for a currency associated with this account
1868
- * @see https://www.lbank.info/en-US/docs/index.html#get-deposit-address
1869
- * @see https://www.lbank.info/en-US/docs/index.html#the-user-obtains-the-deposit-address
1900
+ * @see https://www.lbank.com/en-US/docs/index.html#get-deposit-address
1901
+ * @see https://www.lbank.com/en-US/docs/index.html#the-user-obtains-the-deposit-address
1870
1902
  * @param {string} code unified currency code
1871
1903
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1872
1904
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -1964,7 +1996,7 @@ class lbank extends lbank$1 {
1964
1996
  * @method
1965
1997
  * @name lbank2#withdraw
1966
1998
  * @description make a withdrawal
1967
- * @see https://www.lbank.info/en-US/docs/index.html#withdrawal
1999
+ * @see https://www.lbank.com/en-US/docs/index.html#withdrawal
1968
2000
  * @param {string} code unified currency code
1969
2001
  * @param {float} amount the amount to withdraw
1970
2002
  * @param {string} address the address to withdraw to
@@ -2130,7 +2162,7 @@ class lbank extends lbank$1 {
2130
2162
  * @method
2131
2163
  * @name lbank2#fetchDeposits
2132
2164
  * @description fetch all deposits made to an account
2133
- * @see https://www.lbank.info/en-US/docs/index.html#get-recharge-history
2165
+ * @see https://www.lbank.com/en-US/docs/index.html#get-recharge-history
2134
2166
  * @param {string} code unified currency code
2135
2167
  * @param {int} [since] the earliest time in ms to fetch deposits for
2136
2168
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -2183,7 +2215,7 @@ class lbank extends lbank$1 {
2183
2215
  * @method
2184
2216
  * @name lbank2#fetchWithdrawals
2185
2217
  * @description fetch all withdrawals made from an account
2186
- * @see https://www.lbank.info/en-US/docs/index.html#get-withdrawal-history
2218
+ * @see https://www.lbank.com/en-US/docs/index.html#get-withdrawal-history
2187
2219
  * @param {string} code unified currency code
2188
2220
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
2189
2221
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -2386,8 +2418,8 @@ class lbank extends lbank$1 {
2386
2418
  * @method
2387
2419
  * @name lbank2#fetchDepositWithdrawFees
2388
2420
  * @description when using private endpoint, only returns information for currencies with non-zero balance, use public method by specifying this.options['fetchDepositWithdrawFees']['method'] = 'fetchPublicDepositWithdrawFees'
2389
- * @see https://www.lbank.info/en-US/docs/index.html#get-all-coins-information
2390
- * @see https://www.lbank.info/en-US/docs/index.html#withdrawal-configurations
2421
+ * @see https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
2422
+ * @see https://www.lbank.com/en-US/docs/index.html#withdrawal-configurations
2391
2423
  * @param {string[]|undefined} codes array of unified currency codes
2392
2424
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2393
2425
  * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -3134,7 +3134,13 @@ class okx extends okx$1 {
3134
3134
  });
3135
3135
  }
3136
3136
  }
3137
- const response = await this[method](request); // * dont extend with params, otherwise ARRAY will be turned into OBJECT
3137
+ let response = undefined;
3138
+ if (method === 'privatePostTradeCancelAlgos') {
3139
+ response = await this.privatePostTradeCancelAlgos(request); // * dont extend with params, otherwise ARRAY will be turned into OBJECT
3140
+ }
3141
+ else {
3142
+ response = await this.privatePostTradeCancelBatchOrders(request); // * dont extend with params, otherwise ARRAY will be turned into OBJECT
3143
+ }
3138
3144
  //
3139
3145
  // {
3140
3146
  // "code": "0",
@@ -3433,7 +3439,13 @@ class okx extends okx$1 {
3433
3439
  }
3434
3440
  }
3435
3441
  const query = this.omit(params, ['method', 'clOrdId', 'clientOrderId', 'stop']);
3436
- const response = await this[method](this.extend(request, query));
3442
+ let response = undefined;
3443
+ if (method === 'privateGetTradeOrderAlgo') {
3444
+ response = await this.privateGetTradeOrderAlgo(this.extend(request, query));
3445
+ }
3446
+ else {
3447
+ response = await this.privateGetTradeOrder(this.extend(request, query));
3448
+ }
3437
3449
  //
3438
3450
  // Spot and Swap
3439
3451
  //
@@ -3592,7 +3604,13 @@ class okx extends okx$1 {
3592
3604
  }
3593
3605
  }
3594
3606
  const query = this.omit(params, ['method', 'stop']);
3595
- const response = await this[method](this.extend(request, query));
3607
+ let response = undefined;
3608
+ if (method === 'privateGetTradeOrdersAlgoPending') {
3609
+ response = await this.privateGetTradeOrdersAlgoPending(this.extend(request, query));
3610
+ }
3611
+ else {
3612
+ response = await this.privateGetTradeOrdersPending(this.extend(request, query));
3613
+ }
3596
3614
  //
3597
3615
  // {
3598
3616
  // "code": "0",
@@ -3764,7 +3782,13 @@ class okx extends okx$1 {
3764
3782
  }
3765
3783
  }
3766
3784
  const send = this.omit(query, ['method', 'stop', 'ordType']);
3767
- const response = await this[method](this.extend(request, send));
3785
+ let response = undefined;
3786
+ if (method === 'privateGetTradeOrdersAlgoHistory') {
3787
+ response = await this.privateGetTradeOrdersAlgoHistory(this.extend(request, send));
3788
+ }
3789
+ else {
3790
+ response = await this.privateGetTradeOrdersHistory(this.extend(request, send));
3791
+ }
3768
3792
  //
3769
3793
  // {
3770
3794
  // "code": "0",
@@ -3941,7 +3965,13 @@ class okx extends okx$1 {
3941
3965
  request['state'] = 'filled';
3942
3966
  }
3943
3967
  const send = this.omit(query, ['method', 'stop']);
3944
- const response = await this[method](this.extend(request, send));
3968
+ let response = undefined;
3969
+ if (method === 'privateGetTradeOrdersAlgoHistory') {
3970
+ response = await this.privateGetTradeOrdersAlgoHistory(this.extend(request, send));
3971
+ }
3972
+ else {
3973
+ response = await this.privateGetTradeOrdersHistory(this.extend(request, send));
3974
+ }
3945
3975
  //
3946
3976
  // {
3947
3977
  // "code": "0",
@@ -4194,7 +4224,16 @@ class okx extends okx$1 {
4194
4224
  request['ccy'] = currency['id'];
4195
4225
  }
4196
4226
  [request, params] = this.handleUntilOption('end', request, params);
4197
- const response = await this[method](this.extend(request, query));
4227
+ let response = undefined;
4228
+ if (method === 'privateGetAccountBillsArchive') {
4229
+ response = await this.privateGetAccountBillsArchive(this.extend(request, query));
4230
+ }
4231
+ else if (method === 'privateGetAssetBills') {
4232
+ response = await this.privateGetAssetBills(this.extend(request, query));
4233
+ }
4234
+ else {
4235
+ response = await this.privateGetAccountBills(this.extend(request, query));
4236
+ }
4198
4237
  //
4199
4238
  // privateGetAccountBills, privateGetAccountBillsArchive
4200
4239
  //
@@ -5106,7 +5145,13 @@ class okx extends okx$1 {
5106
5145
  }
5107
5146
  const fetchPositionsOptions = this.safeValue(this.options, 'fetchPositions', {});
5108
5147
  const method = this.safeString(fetchPositionsOptions, 'method', 'privateGetAccountPositions');
5109
- const response = await this[method](this.extend(request, params));
5148
+ let response = undefined;
5149
+ if (method === 'privateGetAccountPositionsHistory') {
5150
+ response = await this.privateGetAccountPositionsHistory(this.extend(request, params));
5151
+ }
5152
+ else {
5153
+ response = await this.privateGetAccountPositions(this.extend(request, params));
5154
+ }
5110
5155
  //
5111
5156
  // {
5112
5157
  // "code": "0",
@@ -496,7 +496,7 @@ class binance extends binance$1 {
496
496
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
497
497
  * @param {int} [limit] the maximum amount of trades to fetch
498
498
  * @param {object} [params] extra parameters specific to the exchange API endpoint
499
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
499
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
500
500
  */
501
501
  await this.loadMarkets();
502
502
  symbols = this.marketSymbols(symbols, undefined, false, true, true);
@@ -525,7 +525,7 @@ class bingx extends bingx$1 {
525
525
  * @see https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
526
526
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
527
527
  * @param {object} [params] extra parameters specific to the exchange API endpoint
528
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/en/latest/manual.html?#balance-structure}
528
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
529
529
  */
530
530
  await this.loadMarkets();
531
531
  await this.authenticate();
@@ -661,7 +661,7 @@ class bitget extends bitget$1 {
661
661
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
662
662
  * @param {int} [limit] the maximum amount of trades to fetch
663
663
  * @param {object} [params] extra parameters specific to the exchange API endpoint
664
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
664
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
665
665
  */
666
666
  const symbolsLength = symbols.length;
667
667
  if (symbolsLength === 0) {
@@ -701,7 +701,7 @@ class bybit extends bybit$1 {
701
701
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
702
702
  * @param {int} [limit] the maximum amount of trades to fetch
703
703
  * @param {object} [params] extra parameters specific to the exchange API endpoint
704
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
704
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
705
705
  */
706
706
  await this.loadMarkets();
707
707
  symbols = this.marketSymbols(symbols);
@@ -410,7 +410,7 @@ class cex extends cex$1 {
410
410
  * @see https://docs.cex.io/#ws-api-get-balance
411
411
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
412
412
  * @param {object} [params] extra parameters specific to the cex api endpoint
413
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/en/latest/manual.html?#balance-structure}
413
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
414
414
  */
415
415
  await this.loadMarkets();
416
416
  await this.authenticate();
@@ -170,7 +170,7 @@ class coinbasepro extends coinbasepro$1 {
170
170
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
171
171
  * @param {int} [limit] the maximum amount of trades to fetch
172
172
  * @param {object} [params] extra parameters specific to the exchange API endpoint
173
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
173
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
174
174
  */
175
175
  const symbolsLength = symbols.length;
176
176
  if (symbolsLength === 0) {
@@ -176,7 +176,7 @@ class cryptocom extends cryptocom$1 {
176
176
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
177
177
  * @param {int} [limit] the maximum amount of trades to fetch
178
178
  * @param {object} [params] extra parameters specific to the exchange API endpoint
179
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
179
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
180
180
  */
181
181
  await this.loadMarkets();
182
182
  symbols = this.marketSymbols(symbols);
@@ -409,7 +409,7 @@ class gate extends gate$1 {
409
409
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
410
410
  * @param {int} [limit] the maximum amount of trades to fetch
411
411
  * @param {object} [params] extra parameters specific to the exchange API endpoint
412
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
412
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
413
413
  */
414
414
  await this.loadMarkets();
415
415
  symbols = this.marketSymbols(symbols);
@@ -354,7 +354,7 @@ class kucoin extends kucoin$1 {
354
354
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
355
355
  * @param {int} [limit] the maximum amount of trades to fetch
356
356
  * @param {object} [params] extra parameters specific to the exchange API endpoint
357
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
357
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
358
358
  */
359
359
  const symbolsLength = symbols.length;
360
360
  if (symbolsLength === 0) {
@@ -391,7 +391,7 @@ class kucoinfutures extends kucoinfutures$1 {
391
391
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
392
392
  * @param {int} [limit] the maximum amount of trades to fetch
393
393
  * @param {object} [params] extra parameters specific to the exchange API endpoint
394
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
394
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
395
395
  */
396
396
  const symbolsLength = symbols.length;
397
397
  if (symbolsLength === 0) {
@@ -182,7 +182,7 @@ class okx extends okx$1 {
182
182
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
183
183
  * @param {int} [limit] the maximum amount of trades to fetch
184
184
  * @param {object} [params] extra parameters specific to the exchange API endpoint
185
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/en/latest/manual.html?#public-trades}
185
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
186
186
  */
187
187
  const symbolsLength = symbols.length;
188
188
  if (symbolsLength === 0) {