ccxt 4.4.91 → 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.
package/dist/cjs/ccxt.js CHANGED
@@ -193,7 +193,7 @@ var xt$1 = require('./src/pro/xt.js');
193
193
 
194
194
  //-----------------------------------------------------------------------------
195
195
  // this is updated by vss.js when building
196
- const version = '4.4.91';
196
+ const version = '4.4.92';
197
197
  Exchange["default"].ccxtVersion = version;
198
198
  const exchanges = {
199
199
  'alpaca': alpaca,
@@ -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
@@ -2817,14 +2823,14 @@ class Exchange {
2817
2823
  }
2818
2824
  values.push(market);
2819
2825
  }
2820
- this.markets = this.indexBy(values, 'symbol');
2826
+ this.markets = this.mapToSafeMap(this.indexBy(values, 'symbol'));
2821
2827
  const marketsSortedBySymbol = this.keysort(this.markets);
2822
2828
  const marketsSortedById = this.keysort(this.markets_by_id);
2823
2829
  this.symbols = Object.keys(marketsSortedBySymbol);
2824
2830
  this.ids = Object.keys(marketsSortedById);
2825
2831
  if (currencies !== undefined) {
2826
2832
  // currencies is always undefined when called in constructor but not when called from loadMarkets
2827
- this.currencies = this.deepExtend(this.currencies, currencies);
2833
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
2828
2834
  }
2829
2835
  else {
2830
2836
  let baseCurrencies = [];
@@ -2854,8 +2860,8 @@ class Exchange {
2854
2860
  }
2855
2861
  baseCurrencies = this.sortBy(baseCurrencies, 'code', false, '');
2856
2862
  quoteCurrencies = this.sortBy(quoteCurrencies, 'code', false, '');
2857
- this.baseCurrencies = this.indexBy(baseCurrencies, 'code');
2858
- this.quoteCurrencies = this.indexBy(quoteCurrencies, 'code');
2863
+ this.baseCurrencies = this.mapToSafeMap(this.indexBy(baseCurrencies, 'code'));
2864
+ this.quoteCurrencies = this.mapToSafeMap(this.indexBy(quoteCurrencies, 'code'));
2859
2865
  const allCurrencies = this.arrayConcat(baseCurrencies, quoteCurrencies);
2860
2866
  const groupedCurrencies = this.groupBy(allCurrencies, 'code');
2861
2867
  const codes = Object.keys(groupedCurrencies);
@@ -2876,7 +2882,7 @@ class Exchange {
2876
2882
  resultingCurrencies.push(highestPrecisionCurrency);
2877
2883
  }
2878
2884
  const sortedCurrencies = this.sortBy(resultingCurrencies, 'code');
2879
- this.currencies = this.deepExtend(this.currencies, this.indexBy(sortedCurrencies, 'code'));
2885
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, this.indexBy(sortedCurrencies, 'code')));
2880
2886
  }
2881
2887
  this.currencies_by_id = this.indexBySafe(this.currencies, 'id');
2882
2888
  const currenciesSortedByCode = this.keysort(this.currencies);
@@ -7049,7 +7055,7 @@ class Exchange {
7049
7055
  return reconstructedDate;
7050
7056
  }
7051
7057
  convertMarketIdExpireDate(date) {
7052
- // parse 03JAN24 to 240103
7058
+ // parse 03JAN24 to 240103.
7053
7059
  const monthMappping = {
7054
7060
  'JAN': '01',
7055
7061
  'FEB': '02',
@@ -7199,24 +7205,10 @@ class Exchange {
7199
7205
  }
7200
7206
  else {
7201
7207
  if (topic === 'myTrades' && (this.myTrades !== undefined)) {
7202
- // don't reset this.myTrades directly here
7203
- // because in c# we need to use a different object (thread-safe dict)
7204
- const keys = Object.keys(this.myTrades);
7205
- for (let i = 0; i < keys.length; i++) {
7206
- const key = keys[i];
7207
- if (key in this.myTrades) {
7208
- delete this.myTrades[key];
7209
- }
7210
- }
7208
+ this.myTrades = undefined;
7211
7209
  }
7212
7210
  else if (topic === 'orders' && (this.orders !== undefined)) {
7213
- const orderSymbols = Object.keys(this.orders);
7214
- for (let i = 0; i < orderSymbols.length; i++) {
7215
- const orderSymbol = orderSymbols[i];
7216
- if (orderSymbol in this.orders) {
7217
- delete this.orders[orderSymbol];
7218
- }
7219
- }
7211
+ this.orders = undefined;
7220
7212
  }
7221
7213
  else if (topic === 'ticker' && (this.tickers !== undefined)) {
7222
7214
  const tickerSymbols = Object.keys(this.tickers);
@@ -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 = {}) {
@@ -35,7 +35,6 @@ class bitmex extends bitmex$1 {
35
35
  'swap': true,
36
36
  'future': true,
37
37
  'option': false,
38
- 'index': true,
39
38
  'addMargin': undefined,
40
39
  'cancelAllOrders': true,
41
40
  'cancelAllOrdersAfter': true,
@@ -91,6 +90,7 @@ class bitmex extends bitmex$1 {
91
90
  'fetchTransactions': 'emulated',
92
91
  'fetchTransfer': false,
93
92
  'fetchTransfers': false,
93
+ 'index': true,
94
94
  'reduceMargin': undefined,
95
95
  'sandbox': true,
96
96
  'setLeverage': true,
@@ -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
  /**
@@ -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
  }
@@ -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) {
@@ -45,9 +45,9 @@ class hyperliquid extends hyperliquid$1 {
45
45
  'createMarketBuyOrderWithCost': false,
46
46
  'createMarketOrderWithCost': false,
47
47
  'createMarketSellOrderWithCost': false,
48
- 'createOrderWithTakeProfitAndStopLoss': true,
49
48
  'createOrder': true,
50
49
  'createOrders': true,
50
+ 'createOrderWithTakeProfitAndStopLoss': true,
51
51
  'createReduceOnlyOrder': true,
52
52
  'createStopOrder': true,
53
53
  'createTriggerOrder': true,
@@ -531,7 +531,7 @@ class krakenfutures extends krakenfutures$1 {
531
531
  'precision': undefined,
532
532
  });
533
533
  }
534
- this.currencies = this.deepExtend(currencies, this.currencies);
534
+ this.currencies = this.mapToSafeMap(this.deepExtend(currencies, this.currencies));
535
535
  return result;
536
536
  }
537
537
  /**
@@ -49,6 +49,7 @@ class lbank extends lbank$1 {
49
49
  'fetchClosedOrders': false,
50
50
  'fetchCrossBorrowRate': false,
51
51
  'fetchCrossBorrowRates': false,
52
+ 'fetchCurrencies': true,
52
53
  'fetchDepositAddress': true,
53
54
  'fetchDepositAddresses': false,
54
55
  'fetchDepositAddressesByNetwork': false,
@@ -123,6 +124,7 @@ class lbank extends lbank$1 {
123
124
  'currencyPairs': 2.5,
124
125
  'accuracy': 2.5,
125
126
  'usdToCny': 2.5,
127
+ 'assetConfigs': 2.5,
126
128
  'withdrawConfigs': 2.5,
127
129
  'timestamp': 2.5,
128
130
  'ticker/24hr': 2.5,
@@ -209,6 +211,7 @@ class lbank extends lbank$1 {
209
211
  },
210
212
  },
211
213
  'commonCurrencies': {
214
+ 'XBT': 'XBT',
212
215
  'HIT': 'Hiver',
213
216
  'VET_ERC20': 'VEN',
214
217
  'PNT': 'Penta',
@@ -276,21 +279,12 @@ class lbank extends lbank$1 {
276
279
  // ptx: 1
277
280
  // }
278
281
  },
279
- 'inverse-networks': {
282
+ 'networksById': {
280
283
  'erc20': 'ERC20',
281
284
  'trc20': 'TRC20',
282
- 'omni': 'OMNI',
283
- 'asa': 'ASA',
284
- 'bep20(bsc)': 'BSC',
285
- 'bep20': 'BSC',
286
- 'heco': 'HT',
287
- 'bep2': 'BNB',
288
- 'btc': 'BTC',
289
- 'dogecoin': 'DOGE',
290
- 'matic': 'MATIC',
291
- 'oec': 'OEC',
292
- 'btctron': 'BTCTRON',
293
- 'xrp': 'XRP',
285
+ 'TRX': 'TRC20',
286
+ 'bep20(bsc)': 'BEP20',
287
+ 'bep20': 'BEP20',
294
288
  },
295
289
  'defaultNetworks': {
296
290
  'USDT': 'TRC20',
@@ -413,6 +407,108 @@ class lbank extends lbank$1 {
413
407
  //
414
408
  return this.safeInteger(response, 'data');
415
409
  }
410
+ /**
411
+ * @method
412
+ * @name lbank#fetchCurrencies
413
+ * @description fetches all available currencies on an exchange
414
+ * @param {dict} [params] extra parameters specific to the exchange API endpoint
415
+ * @returns {dict} an associative dictionary of currencies
416
+ */
417
+ async fetchCurrencies(params = {}) {
418
+ const response = await this.spotPublicGetWithdrawConfigs(params);
419
+ //
420
+ // {
421
+ // "msg": "Success",
422
+ // "result": "true",
423
+ // "data": [
424
+ // {
425
+ // "amountScale": "4",
426
+ // "chain": "bep20(bsc)",
427
+ // "assetCode": "usdt",
428
+ // "min": "10",
429
+ // "transferAmtScale": "4",
430
+ // "canWithDraw": true,
431
+ // "fee": "0.0000",
432
+ // "minTransfer": "0.0001",
433
+ // "type": "1"
434
+ // },
435
+ // {
436
+ // "amountScale": "4",
437
+ // "chain": "trc20",
438
+ // "assetCode": "usdt",
439
+ // "min": "1",
440
+ // "transferAmtScale": "4",
441
+ // "canWithDraw": true,
442
+ // "fee": "1.0000",
443
+ // "minTransfer": "0.0001",
444
+ // "type": "1"
445
+ // },
446
+ // ...
447
+ // ],
448
+ // "error_code": "0",
449
+ // "ts": "1747973911431"
450
+ // }
451
+ //
452
+ const currenciesData = this.safeList(response, 'data', []);
453
+ const grouped = this.groupBy(currenciesData, 'assetCode');
454
+ const groupedKeys = Object.keys(grouped);
455
+ const result = {};
456
+ for (let i = 0; i < groupedKeys.length; i++) {
457
+ const id = (groupedKeys[i]).toString(); // some currencies are numeric
458
+ const code = this.safeCurrencyCode(id);
459
+ const networksRaw = grouped[id];
460
+ const networks = {};
461
+ for (let j = 0; j < networksRaw.length; j++) {
462
+ const networkEntry = networksRaw[j];
463
+ const networkId = this.safeString(networkEntry, 'chain');
464
+ const networkCode = this.networkIdToCode(networkId);
465
+ networks[networkCode] = {
466
+ 'id': networkId,
467
+ 'network': networkCode,
468
+ 'limits': {
469
+ 'withdraw': {
470
+ 'min': this.safeNumber(networkEntry, 'min'),
471
+ 'max': undefined,
472
+ },
473
+ 'deposit': {
474
+ 'min': this.safeNumber(networkEntry, 'minTransfer'),
475
+ 'max': undefined,
476
+ },
477
+ },
478
+ 'active': undefined,
479
+ 'deposit': undefined,
480
+ 'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
481
+ 'fee': this.safeNumber(networkEntry, 'fee'),
482
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
483
+ 'info': networkEntry,
484
+ };
485
+ }
486
+ result[code] = this.safeCurrencyStructure({
487
+ 'id': id,
488
+ 'code': code,
489
+ 'precision': undefined,
490
+ 'type': undefined,
491
+ 'name': undefined,
492
+ 'active': undefined,
493
+ 'deposit': undefined,
494
+ 'withdraw': undefined,
495
+ 'fee': undefined,
496
+ 'limits': {
497
+ 'withdraw': {
498
+ 'min': undefined,
499
+ 'max': undefined,
500
+ },
501
+ 'deposit': {
502
+ 'min': undefined,
503
+ 'max': undefined,
504
+ },
505
+ },
506
+ 'networks': networks,
507
+ 'info': networksRaw,
508
+ });
509
+ }
510
+ return result;
511
+ }
416
512
  /**
417
513
  * @method
418
514
  * @name lbank#fetchMarkets
@@ -2168,13 +2264,10 @@ class lbank extends lbank$1 {
2168
2264
  const result = this.safeValue(response, 'data');
2169
2265
  const address = this.safeString(result, 'address');
2170
2266
  const tag = this.safeString(result, 'memo');
2171
- const networkId = this.safeString(result, 'netWork');
2172
- const inverseNetworks = this.safeValue(this.options, 'inverse-networks', {});
2173
- const networkCode = this.safeStringUpper(inverseNetworks, networkId, networkId);
2174
2267
  return {
2175
2268
  'info': response,
2176
2269
  'currency': code,
2177
- 'network': networkCode,
2270
+ 'network': this.networkIdToCode(this.safeString(result, 'netWork')),
2178
2271
  'address': address,
2179
2272
  'tag': tag,
2180
2273
  };
@@ -2209,12 +2302,10 @@ class lbank extends lbank$1 {
2209
2302
  const result = this.safeValue(response, 'data');
2210
2303
  const address = this.safeString(result, 'address');
2211
2304
  const tag = this.safeString(result, 'memo');
2212
- const inverseNetworks = this.safeValue(this.options, 'inverse-networks', {});
2213
- const networkCode = this.safeStringUpper(inverseNetworks, network, network);
2214
2305
  return {
2215
2306
  'info': response,
2216
2307
  'currency': code,
2217
- 'network': networkCode,
2308
+ 'network': undefined,
2218
2309
  'address': address,
2219
2310
  'tag': tag,
2220
2311
  };
@@ -2338,9 +2429,6 @@ class lbank extends lbank$1 {
2338
2429
  }
2339
2430
  const txid = this.safeString(transaction, 'txId');
2340
2431
  const timestamp = this.safeInteger2(transaction, 'insertTime', 'applyTime');
2341
- const networks = this.safeValue(this.options, 'inverse-networks', {});
2342
- const networkId = this.safeString(transaction, 'networkName');
2343
- const network = this.safeString(networks, networkId, networkId);
2344
2432
  const address = this.safeString(transaction, 'address');
2345
2433
  let addressFrom = undefined;
2346
2434
  let addressTo = undefined;
@@ -2368,7 +2456,7 @@ class lbank extends lbank$1 {
2368
2456
  'txid': txid,
2369
2457
  'timestamp': timestamp,
2370
2458
  'datetime': this.iso8601(timestamp),
2371
- 'network': network,
2459
+ 'network': this.networkIdToCode(this.safeString(transaction, 'networkName')),
2372
2460
  'address': address,
2373
2461
  'addressTo': addressTo,
2374
2462
  'addressFrom': addressFrom,
@@ -2571,10 +2659,9 @@ class lbank extends lbank$1 {
2571
2659
  withdrawFees[code] = {};
2572
2660
  for (let j = 0; j < networkList.length; j++) {
2573
2661
  const networkEntry = networkList[j];
2574
- const networkId = this.safeString(networkEntry, 'name');
2575
- const networkCode = this.safeString(this.options['inverse-networks'], networkId, networkId);
2576
2662
  const fee = this.safeNumber(networkEntry, 'withdrawFee');
2577
2663
  if (fee !== undefined) {
2664
+ const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
2578
2665
  withdrawFees[code][networkCode] = fee;
2579
2666
  }
2580
2667
  }
@@ -2626,8 +2713,7 @@ class lbank extends lbank$1 {
2626
2713
  if (canWithdraw === 'true') {
2627
2714
  const currencyId = this.safeString(item, 'assetCode');
2628
2715
  const codeInner = this.safeCurrencyCode(currencyId);
2629
- const chain = this.safeString(item, 'chain');
2630
- let network = this.safeString(this.options['inverse-networks'], chain, chain);
2716
+ let network = this.networkIdToCode(this.safeString(item, 'chain'));
2631
2717
  if (network === undefined) {
2632
2718
  network = codeInner;
2633
2719
  }
@@ -2778,8 +2864,7 @@ class lbank extends lbank$1 {
2778
2864
  const resultCodeInfo = result[code]['info'];
2779
2865
  resultCodeInfo.push(fee);
2780
2866
  }
2781
- const chain = this.safeString(fee, 'chain');
2782
- const networkCode = this.safeString(this.options['inverse-networks'], chain, chain);
2867
+ const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'));
2783
2868
  if (networkCode !== undefined) {
2784
2869
  result[code]['networks'][networkCode] = {
2785
2870
  'withdraw': {
@@ -2835,8 +2920,7 @@ class lbank extends lbank$1 {
2835
2920
  const networkList = this.safeValue(fee, 'networkList', []);
2836
2921
  for (let j = 0; j < networkList.length; j++) {
2837
2922
  const networkEntry = networkList[j];
2838
- const networkId = this.safeString(networkEntry, 'name');
2839
- const networkCode = this.safeStringUpper(this.options['inverse-networks'], networkId, networkId);
2923
+ const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
2840
2924
  const withdrawFee = this.safeNumber(networkEntry, 'withdrawFee');
2841
2925
  const isDefault = this.safeValue(networkEntry, 'isDefault');
2842
2926
  if (withdrawFee !== undefined) {
@@ -5142,7 +5142,7 @@ class okx extends okx$1 {
5142
5142
  let fee = this.safeString(params, 'fee');
5143
5143
  if (fee === undefined) {
5144
5144
  const currencies = await this.fetchCurrencies();
5145
- this.currencies = this.deepExtend(this.currencies, currencies);
5145
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
5146
5146
  const targetNetwork = this.safeDict(currency['networks'], this.networkIdToCode(network), {});
5147
5147
  fee = this.safeString(targetNetwork, 'fee');
5148
5148
  if (fee === undefined) {
@@ -7197,7 +7197,7 @@ class okx extends okx$1 {
7197
7197
  /**
7198
7198
  * @method
7199
7199
  * @name okx#fetchBorrowInterest
7200
- * @description fetch the interest owed by the user for borrowing currency for margin trading
7200
+ * @description fetch the interest owed b the user for borrowing currency for margin trading
7201
7201
  * @see https://www.okx.com/docs-v5/en/#rest-api-account-get-interest-accrued-data
7202
7202
  * @param {string} code the unified currency code for the currency of the interest
7203
7203
  * @param {string} symbol the market symbol of an isolated margin market, if undefined, the interest for cross margin markets is returned
@@ -1279,11 +1279,10 @@ class bybit extends bybit$1 {
1279
1279
  async unWatchMyTrades(symbol = undefined, params = {}) {
1280
1280
  const method = 'watchMyTrades';
1281
1281
  const messageHash = 'unsubscribe:myTrades';
1282
- let subHash = 'myTrades';
1282
+ const subHash = 'myTrades';
1283
1283
  await this.loadMarkets();
1284
1284
  if (symbol !== undefined) {
1285
- symbol = this.symbol(symbol);
1286
- subHash += ':' + symbol;
1285
+ throw new errors.NotSupported(this.id + ' unWatchMyTrades() does not support a symbol parameter, you must unwatch all my trades');
1287
1286
  }
1288
1287
  const url = await this.getUrlByMarketType(symbol, true, method, params);
1289
1288
  await this.authenticate(url);
@@ -1728,10 +1727,9 @@ class bybit extends bybit$1 {
1728
1727
  await this.loadMarkets();
1729
1728
  const method = 'watchOrders';
1730
1729
  const messageHash = 'unsubscribe:orders';
1731
- let subHash = 'orders';
1730
+ const subHash = 'orders';
1732
1731
  if (symbol !== undefined) {
1733
- symbol = this.symbol(symbol);
1734
- subHash += ':' + symbol;
1732
+ throw new errors.NotSupported(this.id + ' unWatchOrders() does not support a symbol parameter, you must unwatch all orders');
1735
1733
  }
1736
1734
  const url = await this.getUrlByMarketType(symbol, true, method, params);
1737
1735
  await this.authenticate(url);
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, 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, OrderBooks, OpenInterests, ConstructorArgs } 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.90";
7
+ declare const version = "4.4.91";
8
8
  import alpaca from './src/alpaca.js';
9
9
  import apex from './src/apex.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.90';
41
+ const version = '4.4.91';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import alpaca from './src/alpaca.js';
@@ -4,6 +4,7 @@ interface Exchange {
4
4
  spotPublicGetCurrencyPairs(params?: {}): Promise<implicitReturnType>;
5
5
  spotPublicGetAccuracy(params?: {}): Promise<implicitReturnType>;
6
6
  spotPublicGetUsdToCny(params?: {}): Promise<implicitReturnType>;
7
+ spotPublicGetAssetConfigs(params?: {}): Promise<implicitReturnType>;
7
8
  spotPublicGetWithdrawConfigs(params?: {}): Promise<implicitReturnType>;
8
9
  spotPublicGetTimestamp(params?: {}): Promise<implicitReturnType>;
9
10
  spotPublicGetTicker24hr(params?: {}): Promise<implicitReturnType>;
@@ -362,6 +362,8 @@ export default class Exchange {
362
362
  checkOrderArguments(market: any, type: any, side: any, amount: any, price: any, params: any): void;
363
363
  handleHttpStatusCode(code: any, reason: any, url: any, method: any, body: any): void;
364
364
  remove0xPrefix(hexData: any): any;
365
+ mapToSafeMap(dict: any): any;
366
+ safeMapToMap(dict: any): any;
365
367
  spawn(method: any, ...args: any[]): import("./ws/Future.js").FutureInterface;
366
368
  delay(timeout: any, method: any, ...args: any[]): void;
367
369
  orderBook(snapshot?: {}, depth?: number): WsOrderBook;