ccxt 4.4.90 → 4.4.92

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 (71) hide show
  1. package/README.md +5 -6
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -4
  4. package/dist/cjs/src/base/Exchange.js +23 -33
  5. package/dist/cjs/src/base/ws/Client.js +4 -34
  6. package/dist/cjs/src/binance.js +1 -1
  7. package/dist/cjs/src/bitmart.js +7 -0
  8. package/dist/cjs/src/bitmex.js +2 -1
  9. package/dist/cjs/src/bitvavo.js +10 -1
  10. package/dist/cjs/src/cex.js +61 -0
  11. package/dist/cjs/src/cryptocom.js +21 -2
  12. package/dist/cjs/src/cryptomus.js +1 -1
  13. package/dist/cjs/src/exmo.js +25 -10
  14. package/dist/cjs/src/fmfwio.js +1 -1
  15. package/dist/cjs/src/gate.js +2 -2
  16. package/dist/cjs/src/htx.js +1 -1
  17. package/dist/cjs/src/hyperliquid.js +115 -59
  18. package/dist/cjs/src/kraken.js +29 -1
  19. package/dist/cjs/src/krakenfutures.js +1 -1
  20. package/dist/cjs/src/lbank.js +116 -32
  21. package/dist/cjs/src/mexc.js +1 -0
  22. package/dist/cjs/src/modetrade.js +2 -2
  23. package/dist/cjs/src/okx.js +2 -2
  24. package/dist/cjs/src/paradex.js +1 -1
  25. package/dist/cjs/src/pro/bitstamp.js +1 -1
  26. package/dist/cjs/src/pro/bybit.js +10 -149
  27. package/dist/cjs/src/pro/kraken.js +251 -264
  28. package/dist/cjs/src/pro/mexc.js +0 -1
  29. package/js/ccxt.d.ts +2 -5
  30. package/js/ccxt.js +2 -4
  31. package/js/src/abstract/lbank.d.ts +1 -0
  32. package/js/src/base/Exchange.d.ts +4 -1
  33. package/js/src/base/Exchange.js +24 -34
  34. package/js/src/base/ws/Client.d.ts +0 -2
  35. package/js/src/base/ws/Client.js +4 -34
  36. package/js/src/binance.js +1 -1
  37. package/js/src/bitmart.d.ts +7 -0
  38. package/js/src/bitmart.js +7 -0
  39. package/js/src/bitmex.js +2 -1
  40. package/js/src/bitvavo.js +10 -1
  41. package/js/src/cex.js +61 -0
  42. package/js/src/cryptocom.js +21 -2
  43. package/js/src/cryptomus.js +1 -1
  44. package/js/src/exmo.js +25 -10
  45. package/js/src/fmfwio.js +2 -2
  46. package/js/src/gate.js +2 -2
  47. package/js/src/htx.js +1 -1
  48. package/js/src/hyperliquid.d.ts +1 -0
  49. package/js/src/hyperliquid.js +115 -59
  50. package/js/src/kraken.js +29 -1
  51. package/js/src/krakenfutures.js +1 -1
  52. package/js/src/lbank.d.ts +9 -1
  53. package/js/src/lbank.js +116 -32
  54. package/js/src/mexc.js +1 -0
  55. package/js/src/modetrade.js +2 -2
  56. package/js/src/okx.d.ts +1 -1
  57. package/js/src/okx.js +2 -2
  58. package/js/src/p2b.d.ts +1 -2
  59. package/js/src/paradex.js +1 -1
  60. package/js/src/pro/bitstamp.js +1 -1
  61. package/js/src/pro/bybit.d.ts +0 -1
  62. package/js/src/pro/bybit.js +11 -150
  63. package/js/src/pro/kraken.d.ts +17 -17
  64. package/js/src/pro/kraken.js +251 -264
  65. package/js/src/pro/mexc.js +0 -1
  66. package/js/src/tradeogre.d.ts +1 -2
  67. package/package.json +1 -1
  68. package/js/src/abstract/coinlist.d.ts +0 -60
  69. package/js/src/abstract/coinlist.js +0 -11
  70. package/js/src/coinlist.d.ts +0 -384
  71. package/js/src/coinlist.js +0 -2610
package/dist/cjs/ccxt.js CHANGED
@@ -53,7 +53,6 @@ var coinbaseinternational = require('./src/coinbaseinternational.js');
53
53
  var coincatch = require('./src/coincatch.js');
54
54
  var coincheck = require('./src/coincheck.js');
55
55
  var coinex = require('./src/coinex.js');
56
- var coinlist = require('./src/coinlist.js');
57
56
  var coinmate = require('./src/coinmate.js');
58
57
  var coinmetro = require('./src/coinmetro.js');
59
58
  var coinone = require('./src/coinone.js');
@@ -194,7 +193,7 @@ var xt$1 = require('./src/pro/xt.js');
194
193
 
195
194
  //-----------------------------------------------------------------------------
196
195
  // this is updated by vss.js when building
197
- const version = '4.4.90';
196
+ const version = '4.4.92';
198
197
  Exchange["default"].ccxtVersion = version;
199
198
  const exchanges = {
200
199
  'alpaca': alpaca,
@@ -238,7 +237,6 @@ const exchanges = {
238
237
  'coincatch': coincatch,
239
238
  'coincheck': coincheck,
240
239
  'coinex': coinex,
241
- 'coinlist': coinlist,
242
240
  'coinmate': coinmate,
243
241
  'coinmetro': coinmetro,
244
242
  'coinone': coinone,
@@ -470,7 +468,6 @@ exports.coinbaseinternational = coinbaseinternational;
470
468
  exports.coincatch = coincatch;
471
469
  exports.coincheck = coincheck;
472
470
  exports.coinex = coinex;
473
- exports.coinlist = coinlist;
474
471
  exports.coinmate = coinmate;
475
472
  exports.coinmetro = coinmetro;
476
473
  exports.coinone = coinone;
@@ -859,6 +859,12 @@ class Exchange {
859
859
  return hexData;
860
860
  }
861
861
  }
862
+ mapToSafeMap(dict) {
863
+ return dict; // wrapper for go
864
+ }
865
+ safeMapToMap(dict) {
866
+ return dict; // wrapper for go
867
+ }
862
868
  spawn(method, ...args) {
863
869
  const future = Future.Future();
864
870
  // using setTimeout 0 to force the execution to run after the future is returned
@@ -1112,17 +1118,12 @@ class Exchange {
1112
1118
  async close() {
1113
1119
  const clients = Object.values(this.clients || {});
1114
1120
  const closedClients = [];
1115
- for (let i = 0; i < clients.length; i++) {
1116
- const client = clients[i];
1117
- client.error = new errors.ExchangeClosedByUser(this.id + ' closedByUser');
1118
- closedClients.push(client.close());
1119
- }
1120
- await Promise.all(closedClients);
1121
1121
  for (let i = 0; i < clients.length; i++) {
1122
1122
  const client = clients[i];
1123
1123
  delete this.clients[client.url];
1124
+ closedClients.push(client.close());
1124
1125
  }
1125
- return;
1126
+ return Promise.all(closedClients);
1126
1127
  }
1127
1128
  async loadOrderBook(client, messageHash, symbol, limit = undefined, params = {}) {
1128
1129
  if (!(symbol in this.orderbooks)) {
@@ -2108,6 +2109,9 @@ class Exchange {
2108
2109
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
2109
2110
  throw new errors.NotSupported(this.id + ' watchTrades() is not supported yet');
2110
2111
  }
2112
+ async unWatchOrders(symbol = undefined, params = {}) {
2113
+ throw new errors.NotSupported(this.id + ' unWatchOrders() is not supported yet');
2114
+ }
2111
2115
  async unWatchTrades(symbol, params = {}) {
2112
2116
  throw new errors.NotSupported(this.id + ' unWatchTrades() is not supported yet');
2113
2117
  }
@@ -2819,14 +2823,14 @@ class Exchange {
2819
2823
  }
2820
2824
  values.push(market);
2821
2825
  }
2822
- this.markets = this.indexBy(values, 'symbol');
2826
+ this.markets = this.mapToSafeMap(this.indexBy(values, 'symbol'));
2823
2827
  const marketsSortedBySymbol = this.keysort(this.markets);
2824
2828
  const marketsSortedById = this.keysort(this.markets_by_id);
2825
2829
  this.symbols = Object.keys(marketsSortedBySymbol);
2826
2830
  this.ids = Object.keys(marketsSortedById);
2827
2831
  if (currencies !== undefined) {
2828
2832
  // currencies is always undefined when called in constructor but not when called from loadMarkets
2829
- this.currencies = this.deepExtend(this.currencies, currencies);
2833
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
2830
2834
  }
2831
2835
  else {
2832
2836
  let baseCurrencies = [];
@@ -2856,8 +2860,8 @@ class Exchange {
2856
2860
  }
2857
2861
  baseCurrencies = this.sortBy(baseCurrencies, 'code', false, '');
2858
2862
  quoteCurrencies = this.sortBy(quoteCurrencies, 'code', false, '');
2859
- this.baseCurrencies = this.indexBy(baseCurrencies, 'code');
2860
- this.quoteCurrencies = this.indexBy(quoteCurrencies, 'code');
2863
+ this.baseCurrencies = this.mapToSafeMap(this.indexBy(baseCurrencies, 'code'));
2864
+ this.quoteCurrencies = this.mapToSafeMap(this.indexBy(quoteCurrencies, 'code'));
2861
2865
  const allCurrencies = this.arrayConcat(baseCurrencies, quoteCurrencies);
2862
2866
  const groupedCurrencies = this.groupBy(allCurrencies, 'code');
2863
2867
  const codes = Object.keys(groupedCurrencies);
@@ -2878,7 +2882,7 @@ class Exchange {
2878
2882
  resultingCurrencies.push(highestPrecisionCurrency);
2879
2883
  }
2880
2884
  const sortedCurrencies = this.sortBy(resultingCurrencies, 'code');
2881
- this.currencies = this.deepExtend(this.currencies, this.indexBy(sortedCurrencies, 'code'));
2885
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, this.indexBy(sortedCurrencies, 'code')));
2882
2886
  }
2883
2887
  this.currencies_by_id = this.indexBySafe(this.currencies, 'id');
2884
2888
  const currenciesSortedByCode = this.keysort(this.currencies);
@@ -7051,7 +7055,7 @@ class Exchange {
7051
7055
  return reconstructedDate;
7052
7056
  }
7053
7057
  convertMarketIdExpireDate(date) {
7054
- // parse 03JAN24 to 240103
7058
+ // parse 03JAN24 to 240103.
7055
7059
  const monthMappping = {
7056
7060
  'JAN': '01',
7057
7061
  'FEB': '02',
@@ -7172,7 +7176,7 @@ class Exchange {
7172
7176
  const symbolAndTimeFrame = symbolsAndTimeFrames[i];
7173
7177
  const symbol = this.safeString(symbolAndTimeFrame, 0);
7174
7178
  const timeframe = this.safeString(symbolAndTimeFrame, 1);
7175
- if (symbol in this.ohlcvs) {
7179
+ if ((this.ohlcvs !== undefined) && (symbol in this.ohlcvs)) {
7176
7180
  if (timeframe in this.ohlcvs[symbol]) {
7177
7181
  delete this.ohlcvs[symbol][timeframe];
7178
7182
  }
@@ -7200,27 +7204,13 @@ class Exchange {
7200
7204
  }
7201
7205
  }
7202
7206
  else {
7203
- if (topic === 'myTrades') {
7204
- // don't reset this.myTrades directly here
7205
- // because in c# we need to use a different object (thread-safe dict)
7206
- const keys = Object.keys(this.myTrades);
7207
- for (let i = 0; i < keys.length; i++) {
7208
- const key = keys[i];
7209
- if (key in this.myTrades) {
7210
- delete this.myTrades[key];
7211
- }
7212
- }
7207
+ if (topic === 'myTrades' && (this.myTrades !== undefined)) {
7208
+ this.myTrades = undefined;
7213
7209
  }
7214
- else if (topic === 'orders') {
7215
- const orderSymbols = Object.keys(this.orders);
7216
- for (let i = 0; i < orderSymbols.length; i++) {
7217
- const orderSymbol = orderSymbols[i];
7218
- if (orderSymbol in this.orders) {
7219
- delete this.orders[orderSymbol];
7220
- }
7221
- }
7210
+ else if (topic === 'orders' && (this.orders !== undefined)) {
7211
+ this.orders = undefined;
7222
7212
  }
7223
- else if (topic === 'ticker') {
7213
+ else if (topic === 'ticker' && (this.tickers !== undefined)) {
7224
7214
  const tickerSymbols = Object.keys(this.tickers);
7225
7215
  for (let i = 0; i < tickerSymbols.length; i++) {
7226
7216
  const tickerSymbol = tickerSymbols[i];
@@ -13,7 +13,6 @@ var index = require('../../static_dependencies/scure-base/index.js');
13
13
  // ----------------------------------------------------------------------------
14
14
  class Client {
15
15
  constructor(url, onMessageCallback, onErrorCallback, onCloseCallback, onConnectedCallback, config = {}) {
16
- this.useMessageQueue = false;
17
16
  this.verbose = false;
18
17
  const defaults = {
19
18
  url,
@@ -27,8 +26,6 @@ class Client {
27
26
  futures: {},
28
27
  subscriptions: {},
29
28
  rejections: {},
30
- messageQueue: {},
31
- useMessageQueue: false,
32
29
  connected: undefined,
33
30
  error: undefined,
34
31
  connectionStarted: undefined,
@@ -59,15 +56,6 @@ class Client {
59
56
  if (messageHash in this.rejections) {
60
57
  future.reject(this.rejections[messageHash]);
61
58
  delete this.rejections[messageHash];
62
- delete this.messageQueue[messageHash];
63
- return future;
64
- }
65
- if (this.useMessageQueue) {
66
- const queue = this.messageQueue[messageHash];
67
- if (queue && queue.length) {
68
- future.resolve(queue.shift());
69
- delete this.futures[messageHash];
70
- }
71
59
  }
72
60
  return future;
73
61
  }
@@ -75,27 +63,10 @@ class Client {
75
63
  if (this.verbose && (messageHash === undefined)) {
76
64
  this.log(new Date(), 'resolve received undefined messageHash');
77
65
  }
78
- if (this.useMessageQueue === true) {
79
- if (!(messageHash in this.messageQueue)) {
80
- this.messageQueue[messageHash] = [];
81
- }
82
- const queue = this.messageQueue[messageHash];
83
- queue.push(result);
84
- while (queue.length > 10) { // limit size to 10 messages in the queue
85
- queue.shift();
86
- }
87
- if ((messageHash !== undefined) && (messageHash in this.futures)) {
88
- const promise = this.futures[messageHash];
89
- promise.resolve(queue.shift());
90
- delete this.futures[messageHash];
91
- }
92
- }
93
- else {
94
- if (messageHash in this.futures) {
95
- const promise = this.futures[messageHash];
96
- promise.resolve(result);
97
- delete this.futures[messageHash];
98
- }
66
+ if ((messageHash !== undefined) && (messageHash in this.futures)) {
67
+ const promise = this.futures[messageHash];
68
+ promise.resolve(result);
69
+ delete this.futures[messageHash];
99
70
  }
100
71
  return result;
101
72
  }
@@ -136,7 +107,6 @@ class Client {
136
107
  reset(error) {
137
108
  this.clearConnectionTimeout();
138
109
  this.clearPingInterval();
139
- this.messageQueue = {};
140
110
  this.reject(error);
141
111
  }
142
112
  onConnectionTimeout() {
@@ -3997,7 +3997,7 @@ class binance extends binance$1 {
3997
3997
  //
3998
3998
  // {
3999
3999
  // "symbol": "BTCUSDT",
4000
- // "markPrice": "11793.63104562", // mark price
4000
+ // "markPrice": "11793.63104561", // mark price
4001
4001
  // "indexPrice": "11781.80495970", // index price
4002
4002
  // "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts
4003
4003
  // "lastFundingRate": "0.00038246", // This is the lastest estimated funding rate
@@ -2208,6 +2208,7 @@ class bitmart extends bitmart$1 {
2208
2208
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2209
2209
  * @param {int} [params.until] the latest time in ms to fetch trades for
2210
2210
  * @param {boolean} [params.marginMode] *spot* whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
2211
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2211
2212
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2212
2213
  */
2213
2214
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -2323,6 +2324,7 @@ class bitmart extends bitmart$1 {
2323
2324
  * @param {int} [since] the earliest time in ms to fetch trades for
2324
2325
  * @param {int} [limit] the maximum number of trades to retrieve
2325
2326
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2327
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2326
2328
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2327
2329
  */
2328
2330
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -2784,6 +2786,7 @@ class bitmart extends bitmart$1 {
2784
2786
  * @param {string} [params.stopLossPrice] *swap only* the price to trigger a stop-loss order
2785
2787
  * @param {string} [params.takeProfitPrice] *swap only* the price to trigger a take-profit order
2786
2788
  * @param {int} [params.plan_category] *swap tp/sl only* 1: tp/sl, 2: position tp/sl, default is 1
2789
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2787
2790
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2788
2791
  */
2789
2792
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -2854,6 +2857,7 @@ class bitmart extends bitmart$1 {
2854
2857
  * @see https://developer-pro.bitmart.com/en/spot/#new-batch-order-v4-signed
2855
2858
  * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
2856
2859
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2860
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2857
2861
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2858
2862
  */
2859
2863
  async createOrders(orders, params = {}) {
@@ -3438,6 +3442,7 @@ class bitmart extends bitmart$1 {
3438
3442
  * @param {string} [params.orderType] *swap only* 'limit', 'market', or 'trailing'
3439
3443
  * @param {boolean} [params.trailing] *swap only* set to true if you want to fetch trailing orders
3440
3444
  * @param {boolean} [params.trigger] *swap only* set to true if you want to fetch trigger orders
3445
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
3441
3446
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3442
3447
  */
3443
3448
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -3564,6 +3569,7 @@ class bitmart extends bitmart$1 {
3564
3569
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3565
3570
  * @param {int} [params.until] timestamp in ms of the latest entry
3566
3571
  * @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
3572
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
3567
3573
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3568
3574
  */
3569
3575
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -3632,6 +3638,7 @@ class bitmart extends bitmart$1 {
3632
3638
  * @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
3633
3639
  * @param {string} [params.orderType] *swap only* 'limit', 'market', 'liquidate', 'bankruptcy', 'adl' or 'trailing'
3634
3640
  * @param {boolean} [params.trailing] *swap only* set to true if you want to fetch a trailing order
3641
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
3635
3642
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3636
3643
  */
3637
3644
  async fetchOrder(id, symbol = undefined, params = {}) {
@@ -90,6 +90,7 @@ class bitmex extends bitmex$1 {
90
90
  'fetchTransactions': 'emulated',
91
91
  'fetchTransfer': false,
92
92
  'fetchTransfers': false,
93
+ 'index': true,
93
94
  'reduceMargin': undefined,
94
95
  'sandbox': true,
95
96
  'setLeverage': true,
@@ -416,8 +417,8 @@ class bitmex extends bitmex$1 {
416
417
  // // "mediumPrecision": "8",
417
418
  // // "shorterPrecision": "4",
418
419
  // // "symbol": "₿",
419
- // // "weight": "1",
420
420
  // // "tickLog": "0",
421
+ // // "weight": "1",
421
422
  // "enabled": true,
422
423
  // "isMarginCurrency": true,
423
424
  // "minDepositAmount": "10000",
@@ -653,7 +653,7 @@ class bitvavo extends bitvavo$1 {
653
653
  });
654
654
  }
655
655
  // set currencies here to avoid calling publicGetAssets twice
656
- this.currencies = this.deepExtend(this.currencies, result);
656
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, result));
657
657
  return result;
658
658
  }
659
659
  /**
@@ -1225,6 +1225,9 @@ class bitvavo extends bitvavo$1 {
1225
1225
  if (operatorId !== undefined) {
1226
1226
  request['operatorId'] = this.parseToInt(operatorId);
1227
1227
  }
1228
+ else {
1229
+ throw new errors.ArgumentsRequired(this.id + ' createOrder() requires an operatorId in params or options, eg: exchange.options[\'operatorId\'] = 1234567890');
1230
+ }
1228
1231
  return this.extend(request, params);
1229
1232
  }
1230
1233
  /**
@@ -1329,6 +1332,9 @@ class bitvavo extends bitvavo$1 {
1329
1332
  if (operatorId !== undefined) {
1330
1333
  request['operatorId'] = this.parseToInt(operatorId);
1331
1334
  }
1335
+ else {
1336
+ throw new errors.ArgumentsRequired(this.id + ' editOrder() requires an operatorId in params or options, eg: exchange.options[\'operatorId\'] = 1234567890');
1337
+ }
1332
1338
  request['market'] = market['id'];
1333
1339
  return request;
1334
1340
  }
@@ -1370,6 +1376,9 @@ class bitvavo extends bitvavo$1 {
1370
1376
  if (operatorId !== undefined) {
1371
1377
  request['operatorId'] = this.parseToInt(operatorId);
1372
1378
  }
1379
+ else {
1380
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires an operatorId in params or options, eg: exchange.options[\'operatorId\'] = 1234567890');
1381
+ }
1373
1382
  return this.extend(request, params);
1374
1383
  }
1375
1384
  /**
@@ -27,34 +27,95 @@ class cex extends cex$1 {
27
27
  'swap': false,
28
28
  'future': false,
29
29
  'option': false,
30
+ 'addMargin': false,
31
+ 'borrowCrossMargin': false,
32
+ 'borrowIsolatedMargin': false,
33
+ 'borrowMargin': false,
30
34
  'cancelAllOrders': true,
31
35
  'cancelOrder': true,
36
+ 'closeAllPositions': false,
37
+ 'closePosition': false,
32
38
  'createOrder': true,
39
+ 'createOrderWithTakeProfitAndStopLoss': false,
40
+ 'createOrderWithTakeProfitAndStopLossWs': false,
41
+ 'createPostOnlyOrder': false,
33
42
  'createReduceOnlyOrder': false,
34
43
  'createStopOrder': true,
35
44
  'createTriggerOrder': true,
36
45
  'fetchAccounts': true,
37
46
  'fetchBalance': true,
47
+ 'fetchBorrowInterest': false,
48
+ 'fetchBorrowRate': false,
49
+ 'fetchBorrowRateHistories': false,
50
+ 'fetchBorrowRateHistory': false,
51
+ 'fetchBorrowRates': false,
52
+ 'fetchBorrowRatesPerSymbol': false,
38
53
  'fetchClosedOrder': true,
39
54
  'fetchClosedOrders': true,
55
+ 'fetchCrossBorrowRate': false,
56
+ 'fetchCrossBorrowRates': false,
40
57
  'fetchCurrencies': true,
41
58
  'fetchDepositAddress': true,
42
59
  'fetchDepositsWithdrawals': true,
43
60
  'fetchFundingHistory': false,
61
+ 'fetchFundingInterval': false,
62
+ 'fetchFundingIntervals': false,
44
63
  'fetchFundingRate': false,
45
64
  'fetchFundingRateHistory': false,
46
65
  'fetchFundingRates': false,
66
+ 'fetchGreeks': false,
67
+ 'fetchIndexOHLCV': false,
68
+ 'fetchIsolatedBorrowRate': false,
69
+ 'fetchIsolatedBorrowRates': false,
70
+ 'fetchIsolatedPositions': false,
47
71
  'fetchLedger': true,
72
+ 'fetchLeverage': false,
73
+ 'fetchLeverages': false,
74
+ 'fetchLeverageTiers': false,
75
+ 'fetchLiquidations': false,
76
+ 'fetchLongShortRatio': false,
77
+ 'fetchLongShortRatioHistory': false,
78
+ 'fetchMarginAdjustmentHistory': false,
79
+ 'fetchMarginMode': false,
80
+ 'fetchMarginModes': false,
81
+ 'fetchMarketLeverageTiers': false,
48
82
  'fetchMarkets': true,
83
+ 'fetchMarkOHLCV': false,
84
+ 'fetchMarkPrices': false,
85
+ 'fetchMyLiquidations': false,
86
+ 'fetchMySettlementHistory': false,
49
87
  'fetchOHLCV': true,
88
+ 'fetchOpenInterest': false,
89
+ 'fetchOpenInterestHistory': false,
90
+ 'fetchOpenInterests': false,
50
91
  'fetchOpenOrder': true,
51
92
  'fetchOpenOrders': true,
93
+ 'fetchOption': false,
94
+ 'fetchOptionChain': false,
52
95
  'fetchOrderBook': true,
96
+ 'fetchPosition': false,
97
+ 'fetchPositionHistory': false,
98
+ 'fetchPositionMode': false,
99
+ 'fetchPositions': false,
100
+ 'fetchPositionsForSymbol': false,
101
+ 'fetchPositionsHistory': false,
102
+ 'fetchPositionsRisk': false,
103
+ 'fetchPremiumIndexOHLCV': false,
104
+ 'fetchSettlementHistory': false,
53
105
  'fetchTicker': true,
54
106
  'fetchTickers': true,
55
107
  'fetchTime': true,
56
108
  'fetchTrades': true,
57
109
  'fetchTradingFees': true,
110
+ 'fetchVolatilityHistory': false,
111
+ 'reduceMargin': false,
112
+ 'repayCrossMargin': false,
113
+ 'repayIsolatedMargin': false,
114
+ 'repayMargin': false,
115
+ 'setLeverage': false,
116
+ 'setMargin': false,
117
+ 'setMarginMode': false,
118
+ 'setPositionMode': false,
58
119
  'transfer': true,
59
120
  },
60
121
  'urls': {
@@ -531,7 +531,26 @@ class cryptocom extends cryptocom$1 {
531
531
  if (!this.checkRequiredCredentials(false)) {
532
532
  return undefined;
533
533
  }
534
- const response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
534
+ let skipFetchCurrencies = false;
535
+ [skipFetchCurrencies, params] = this.handleOptionAndParams(params, 'fetchCurrencies', 'skipFetchCurrencies', false);
536
+ if (skipFetchCurrencies) {
537
+ // sub-accounts can't access this endpoint
538
+ return undefined;
539
+ }
540
+ let response = {};
541
+ try {
542
+ response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
543
+ }
544
+ catch (e) {
545
+ if (e instanceof errors.ExchangeError) {
546
+ // sub-accounts can't access this endpoint
547
+ // {"code":"10001","msg":"SYS_ERROR"}
548
+ return undefined;
549
+ }
550
+ throw e;
551
+ // do nothing
552
+ // sub-accounts can't access this endpoint
553
+ }
535
554
  //
536
555
  // {
537
556
  // "id": "1747502328559",
@@ -556,7 +575,7 @@ class cryptocom extends cryptocom$1 {
556
575
  // "network_id": "CRONOS",
557
576
  // "withdrawal_fee": "0.18000000",
558
577
  // "withdraw_enabled": true,
559
- // "min_withdrawal_amount": "0.36",
578
+ // "min_withdrawal_amount": "0.35",
560
579
  // "deposit_enabled": true,
561
580
  // "confirmation_required": "15"
562
581
  // },
@@ -460,7 +460,7 @@ class cryptomus extends cryptomus$1 {
460
460
  //
461
461
  // {
462
462
  // "currency_pair": "XMR_USDT",
463
- // "last_price": "158.04829771",
463
+ // "last_price": "158.04829772",
464
464
  // "base_volume": "0.35185785",
465
465
  // "quote_volume": "55.523761128544"
466
466
  // }
@@ -670,8 +670,9 @@ class exmo extends exmo$1 {
670
670
  * @returns {object} an associative dictionary of currencies
671
671
  */
672
672
  async fetchCurrencies(params = {}) {
673
+ const promises = [];
673
674
  //
674
- const currencyList = await this.publicGetCurrencyListExtended(params);
675
+ promises.push(this.publicGetCurrencyListExtended(params));
675
676
  //
676
677
  // [
677
678
  // {"name":"VLX","description":"Velas"},
@@ -680,7 +681,7 @@ class exmo extends exmo$1 {
680
681
  // {"name":"USD","description":"US Dollar"}
681
682
  // ]
682
683
  //
683
- const cryptoList = await this.publicGetPaymentsProvidersCryptoList(params);
684
+ promises.push(this.publicGetPaymentsProvidersCryptoList(params));
684
685
  //
685
686
  // {
686
687
  // "BTC":[
@@ -705,6 +706,9 @@ class exmo extends exmo$1 {
705
706
  // ],
706
707
  // }
707
708
  //
709
+ const responses = await Promise.all(promises);
710
+ const currencyList = responses[0];
711
+ const cryptoList = responses[1];
708
712
  const result = {};
709
713
  for (let i = 0; i < currencyList.length; i++) {
710
714
  const currency = currencyList[i];
@@ -771,6 +775,10 @@ class exmo extends exmo$1 {
771
775
  }
772
776
  }
773
777
  const code = this.safeCurrencyCode(currencyId);
778
+ const info = {
779
+ 'currency': currency,
780
+ 'providers': providers,
781
+ };
774
782
  result[code] = {
775
783
  'id': currencyId,
776
784
  'code': code,
@@ -782,7 +790,7 @@ class exmo extends exmo$1 {
782
790
  'fee': fee,
783
791
  'precision': this.parseNumber('1e-8'),
784
792
  'limits': limits,
785
- 'info': providers,
793
+ 'info': info,
786
794
  'networks': {},
787
795
  };
788
796
  }
@@ -797,7 +805,8 @@ class exmo extends exmo$1 {
797
805
  * @returns {object[]} an array of objects representing market data
798
806
  */
799
807
  async fetchMarkets(params = {}) {
800
- const response = await this.publicGetPairSettings(params);
808
+ const promises = [];
809
+ promises.push(this.publicGetPairSettings(params));
801
810
  //
802
811
  // {
803
812
  // "BTC_USD":{
@@ -814,8 +823,9 @@ class exmo extends exmo$1 {
814
823
  // }
815
824
  //
816
825
  let marginPairsDict = {};
817
- if (this.checkRequiredCredentials(false)) {
818
- const marginPairs = await this.privatePostMarginPairList(params);
826
+ const fetchMargin = this.checkRequiredCredentials(false);
827
+ if (fetchMargin) {
828
+ promises.push(this.privatePostMarginPairList(params));
819
829
  //
820
830
  // {
821
831
  // "pairs": [
@@ -845,15 +855,20 @@ class exmo extends exmo$1 {
845
855
  // ]
846
856
  // }
847
857
  //
848
- const pairs = this.safeValue(marginPairs, 'pairs');
858
+ }
859
+ const responses = await Promise.all(promises);
860
+ const spotResponse = responses[0];
861
+ if (fetchMargin) {
862
+ const marginPairs = responses[1];
863
+ const pairs = this.safeList(marginPairs, 'pairs');
849
864
  marginPairsDict = this.indexBy(pairs, 'name');
850
865
  }
851
- const keys = Object.keys(response);
866
+ const keys = Object.keys(spotResponse);
852
867
  const result = [];
853
868
  for (let i = 0; i < keys.length; i++) {
854
869
  const id = keys[i];
855
- const market = response[id];
856
- const marginMarket = this.safeValue(marginPairsDict, id);
870
+ const market = spotResponse[id];
871
+ const marginMarket = this.safeDict(marginPairsDict, id);
857
872
  const symbol = id.replace('_', '/');
858
873
  const [baseId, quoteId] = symbol.split('/');
859
874
  const base = this.safeCurrencyCode(baseId);
@@ -3,7 +3,7 @@
3
3
  var hitbtc = require('./hitbtc.js');
4
4
 
5
5
  // ----------------------------------------------------------------------------
6
- // ---------------------------------------------------------------------------
6
+ // ----------------------------------------------------------------------------
7
7
  class fmfwio extends hitbtc {
8
8
  describe() {
9
9
  return this.deepExtend(super.describe(), {
@@ -1232,7 +1232,7 @@ class gate extends gate$1 {
1232
1232
  this.fetchOptionMarkets(params),
1233
1233
  ];
1234
1234
  if (!sandboxMode) {
1235
- // gate does not have a sandbox for spot markets
1235
+ // gate doesn't have a sandbox for spot markets
1236
1236
  const mainnetOnly = [this.fetchSpotMarkets(params)];
1237
1237
  rawPromises = this.arrayConcat(rawPromises, mainnetOnly);
1238
1238
  }
@@ -1652,7 +1652,7 @@ class gate extends gate$1 {
1652
1652
  'contractSize': this.parseNumber('1'),
1653
1653
  'expiry': expiry,
1654
1654
  'expiryDatetime': this.iso8601(expiry),
1655
- 'strike': strike,
1655
+ 'strike': this.parseNumber(strike),
1656
1656
  'optionType': optionType,
1657
1657
  'precision': {
1658
1658
  'amount': this.parseNumber('1'),
@@ -6856,7 +6856,7 @@ class htx extends htx$1 {
6856
6856
  let fee = this.safeNumber(params, 'fee');
6857
6857
  if (fee === undefined) {
6858
6858
  const currencies = await this.fetchCurrencies();
6859
- this.currencies = this.deepExtend(this.currencies, currencies);
6859
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
6860
6860
  const targetNetwork = this.safeValue(currency['networks'], networkCode, {});
6861
6861
  fee = this.safeNumber(targetNetwork, 'fee');
6862
6862
  if (fee === undefined) {