ccxt 4.1.50 → 4.1.52

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 (183) hide show
  1. package/README.md +110 -113
  2. package/dist/ccxt.browser.js +1377 -2931
  3. package/dist/ccxt.browser.min.js +7 -7
  4. package/dist/cjs/ccxt.js +1 -7
  5. package/dist/cjs/src/alpaca.js +62 -64
  6. package/dist/cjs/src/ascendex.js +3 -1
  7. package/dist/cjs/src/base/Exchange.js +10 -0
  8. package/dist/cjs/src/bigone.js +60 -77
  9. package/dist/cjs/src/binance.js +1 -0
  10. package/dist/cjs/src/bingx.js +4 -11
  11. package/dist/cjs/src/bitbank.js +58 -59
  12. package/dist/cjs/src/bitbns.js +1 -0
  13. package/dist/cjs/src/bitfinex.js +1 -0
  14. package/dist/cjs/src/bitfinex2.js +1 -0
  15. package/dist/cjs/src/bitflyer.js +1 -0
  16. package/dist/cjs/src/bitget.js +3 -8
  17. package/dist/cjs/src/bithumb.js +1 -0
  18. package/dist/cjs/src/bitmart.js +10 -1
  19. package/dist/cjs/src/bitmex.js +114 -119
  20. package/dist/cjs/src/bitopro.js +63 -65
  21. package/dist/cjs/src/bitpanda.js +60 -60
  22. package/dist/cjs/src/bitrue.js +67 -71
  23. package/dist/cjs/src/bitso.js +1 -0
  24. package/dist/cjs/src/bitstamp.js +1 -0
  25. package/dist/cjs/src/bittrex.js +57 -57
  26. package/dist/cjs/src/bitvavo.js +10 -2
  27. package/dist/cjs/src/blockchaincom.js +2 -2
  28. package/dist/cjs/src/btcalpha.js +59 -60
  29. package/dist/cjs/src/btcmarkets.js +68 -69
  30. package/dist/cjs/src/btcturk.js +72 -74
  31. package/dist/cjs/src/bybit.js +3 -1
  32. package/dist/cjs/src/coinbase.js +7 -2
  33. package/dist/cjs/src/coinbasepro.js +1 -0
  34. package/dist/cjs/src/coincheck.js +1 -0
  35. package/dist/cjs/src/coinex.js +4 -0
  36. package/dist/cjs/src/coinlist.js +60 -60
  37. package/dist/cjs/src/coinmate.js +1 -0
  38. package/dist/cjs/src/coinsph.js +2 -4
  39. package/dist/cjs/src/cryptocom.js +1 -0
  40. package/dist/cjs/src/currencycom.js +2 -2
  41. package/dist/cjs/src/deribit.js +2 -0
  42. package/dist/cjs/src/digifinex.js +5 -2
  43. package/dist/cjs/src/exmo.js +1 -0
  44. package/dist/cjs/src/gate.js +2 -0
  45. package/dist/cjs/src/gemini.js +2 -0
  46. package/dist/cjs/src/hitbtc.js +4 -0
  47. package/dist/cjs/src/hollaex.js +2 -0
  48. package/dist/cjs/src/htx.js +4 -0
  49. package/dist/cjs/src/huobijp.js +2 -0
  50. package/dist/cjs/src/idex.js +2 -0
  51. package/dist/cjs/src/indodax.js +1 -0
  52. package/dist/cjs/src/kraken.js +10 -13
  53. package/dist/cjs/src/kucoin.js +6 -5
  54. package/dist/cjs/src/kuna.js +3 -1
  55. package/dist/cjs/src/latoken.js +1 -0
  56. package/dist/cjs/src/lbank.js +1 -0
  57. package/dist/cjs/src/lykke.js +2 -0
  58. package/dist/cjs/src/mercado.js +1 -0
  59. package/dist/cjs/src/mexc.js +2 -0
  60. package/dist/cjs/src/ndax.js +2 -0
  61. package/dist/cjs/src/novadax.js +1 -0
  62. package/dist/cjs/src/okcoin.js +2 -0
  63. package/dist/cjs/src/okx.js +2 -0
  64. package/dist/cjs/src/phemex.js +2 -0
  65. package/dist/cjs/src/poloniex.js +1 -0
  66. package/dist/cjs/src/pro/binance.js +5 -3
  67. package/dist/cjs/src/pro/coinbase.js +12 -3
  68. package/dist/cjs/src/pro/cryptocom.js +17 -17
  69. package/dist/cjs/src/pro/krakenfutures.js +24 -3
  70. package/dist/cjs/src/probit.js +4 -2
  71. package/dist/cjs/src/tidex.js +1 -0
  72. package/dist/cjs/src/timex.js +2 -0
  73. package/dist/cjs/src/upbit.js +2 -0
  74. package/dist/cjs/src/wavesexchange.js +2 -1
  75. package/dist/cjs/src/whitebit.js +1 -0
  76. package/dist/cjs/src/woo.js +1 -0
  77. package/dist/cjs/src/zaif.js +1 -0
  78. package/dist/cjs/src/zonda.js +1 -0
  79. package/js/ccxt.d.ts +2 -8
  80. package/js/ccxt.js +2 -6
  81. package/js/src/abstract/kraken.d.ts +0 -5
  82. package/js/src/alpaca.d.ts +3 -2
  83. package/js/src/alpaca.js +62 -64
  84. package/js/src/ascendex.js +3 -1
  85. package/js/src/base/Exchange.d.ts +2 -0
  86. package/js/src/base/Exchange.js +10 -0
  87. package/js/src/base/types.d.ts +6 -3
  88. package/js/src/bigone.d.ts +3 -3
  89. package/js/src/bigone.js +60 -77
  90. package/js/src/binance.js +1 -0
  91. package/js/src/bingx.d.ts +2 -2
  92. package/js/src/bingx.js +4 -11
  93. package/js/src/bitbank.d.ts +3 -2
  94. package/js/src/bitbank.js +58 -59
  95. package/js/src/bitbns.js +1 -0
  96. package/js/src/bitfinex.js +1 -0
  97. package/js/src/bitfinex2.js +1 -0
  98. package/js/src/bitflyer.js +1 -0
  99. package/js/src/bitget.d.ts +1 -2
  100. package/js/src/bitget.js +3 -8
  101. package/js/src/bithumb.js +1 -0
  102. package/js/src/bitmart.js +10 -1
  103. package/js/src/bitmex.d.ts +3 -2
  104. package/js/src/bitmex.js +114 -119
  105. package/js/src/bitopro.d.ts +3 -2
  106. package/js/src/bitopro.js +63 -65
  107. package/js/src/bitpanda.d.ts +3 -2
  108. package/js/src/bitpanda.js +60 -60
  109. package/js/src/bitrue.d.ts +3 -2
  110. package/js/src/bitrue.js +67 -71
  111. package/js/src/bitso.js +1 -0
  112. package/js/src/bitstamp.js +1 -0
  113. package/js/src/bittrex.d.ts +3 -2
  114. package/js/src/bittrex.js +57 -57
  115. package/js/src/bitvavo.js +10 -2
  116. package/js/src/blockchaincom.js +2 -2
  117. package/js/src/btcalpha.d.ts +3 -2
  118. package/js/src/btcalpha.js +59 -60
  119. package/js/src/btcmarkets.d.ts +3 -2
  120. package/js/src/btcmarkets.js +68 -69
  121. package/js/src/btcturk.d.ts +3 -2
  122. package/js/src/btcturk.js +72 -74
  123. package/js/src/bybit.js +3 -1
  124. package/js/src/coinbase.js +7 -2
  125. package/js/src/coinbasepro.js +1 -0
  126. package/js/src/coincheck.js +1 -0
  127. package/js/src/coinex.js +4 -0
  128. package/js/src/coinlist.d.ts +3 -2
  129. package/js/src/coinlist.js +60 -60
  130. package/js/src/coinmate.js +1 -0
  131. package/js/src/coinsph.js +2 -4
  132. package/js/src/cryptocom.js +1 -0
  133. package/js/src/currencycom.js +2 -2
  134. package/js/src/deribit.js +2 -0
  135. package/js/src/digifinex.js +5 -2
  136. package/js/src/exmo.js +1 -0
  137. package/js/src/gate.js +2 -0
  138. package/js/src/gemini.js +2 -0
  139. package/js/src/hitbtc.js +4 -0
  140. package/js/src/hollaex.js +2 -0
  141. package/js/src/htx.js +4 -0
  142. package/js/src/huobijp.js +2 -0
  143. package/js/src/idex.js +2 -0
  144. package/js/src/indodax.js +1 -0
  145. package/js/src/kraken.js +10 -13
  146. package/js/src/kucoin.js +6 -5
  147. package/js/src/kuna.js +3 -1
  148. package/js/src/latoken.js +1 -0
  149. package/js/src/lbank.js +1 -0
  150. package/js/src/lykke.js +2 -0
  151. package/js/src/mercado.js +1 -0
  152. package/js/src/mexc.js +2 -0
  153. package/js/src/ndax.js +2 -0
  154. package/js/src/novadax.js +1 -0
  155. package/js/src/okcoin.js +2 -0
  156. package/js/src/okx.js +2 -0
  157. package/js/src/phemex.js +2 -0
  158. package/js/src/poloniex.js +1 -0
  159. package/js/src/pro/binance.js +5 -3
  160. package/js/src/pro/coinbase.js +12 -3
  161. package/js/src/pro/cryptocom.js +17 -17
  162. package/js/src/pro/krakenfutures.js +24 -3
  163. package/js/src/probit.js +4 -2
  164. package/js/src/tidex.js +1 -0
  165. package/js/src/timex.js +2 -0
  166. package/js/src/upbit.js +2 -0
  167. package/js/src/wavesexchange.js +2 -1
  168. package/js/src/whitebit.js +1 -0
  169. package/js/src/woo.js +1 -0
  170. package/js/src/zaif.js +1 -0
  171. package/js/src/zonda.js +1 -0
  172. package/package.json +1 -1
  173. package/skip-tests.json +2 -3
  174. package/dist/cjs/src/btctradeua.js +0 -571
  175. package/dist/cjs/src/coinfalcon.js +0 -1012
  176. package/js/src/abstract/btctradeua.d.ts +0 -20
  177. package/js/src/abstract/btctradeua.js +0 -11
  178. package/js/src/abstract/coinfalcon.d.ts +0 -26
  179. package/js/src/abstract/coinfalcon.js +0 -11
  180. package/js/src/btctradeua.d.ts +0 -30
  181. package/js/src/btctradeua.js +0 -572
  182. package/js/src/coinfalcon.d.ts +0 -53
  183. package/js/src/coinfalcon.js +0 -1013
package/js/src/bitopro.js CHANGED
@@ -304,71 +304,68 @@ export default class bitopro extends Exchange {
304
304
  // ]
305
305
  // }
306
306
  //
307
- const result = [];
308
- for (let i = 0; i < markets.length; i++) {
309
- const market = markets[i];
310
- const active = !this.safeValue(market, 'maintain');
311
- const id = this.safeString(market, 'pair');
312
- const uppercaseId = id.toUpperCase();
313
- const baseId = this.safeString(market, 'base');
314
- const quoteId = this.safeString(market, 'quote');
315
- const base = this.safeCurrencyCode(baseId);
316
- const quote = this.safeCurrencyCode(quoteId);
317
- const symbol = base + '/' + quote;
318
- const limits = {
319
- 'amount': {
320
- 'min': this.safeNumber(market, 'minLimitBaseAmount'),
321
- 'max': this.safeNumber(market, 'maxLimitBaseAmount'),
322
- },
323
- 'price': {
324
- 'min': undefined,
325
- 'max': undefined,
326
- },
327
- 'cost': {
328
- 'min': undefined,
329
- 'max': undefined,
330
- },
331
- 'leverage': {
332
- 'min': undefined,
333
- 'max': undefined,
334
- },
335
- };
336
- result.push({
337
- 'id': id,
338
- 'uppercaseId': uppercaseId,
339
- 'symbol': symbol,
340
- 'base': base,
341
- 'quote': quote,
342
- 'baseId': base,
343
- 'quoteId': quote,
344
- 'settle': undefined,
345
- 'settleId': undefined,
346
- 'type': 'spot',
347
- 'spot': true,
348
- 'margin': false,
349
- 'swap': false,
350
- 'future': false,
351
- 'option': false,
352
- 'derivative': false,
353
- 'contract': false,
354
- 'linear': undefined,
355
- 'inverse': undefined,
356
- 'contractSize': undefined,
357
- 'expiry': undefined,
358
- 'expiryDatetime': undefined,
359
- 'strike': undefined,
360
- 'optionType': undefined,
361
- 'limits': limits,
362
- 'precision': {
363
- 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
364
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'basePrecision'))),
365
- },
366
- 'active': active,
367
- 'created': undefined,
368
- 'info': market,
369
- });
370
- }
371
- return result;
307
+ return this.parseMarkets(markets);
308
+ }
309
+ parseMarket(market) {
310
+ const active = !this.safeValue(market, 'maintain');
311
+ const id = this.safeString(market, 'pair');
312
+ const uppercaseId = id.toUpperCase();
313
+ const baseId = this.safeString(market, 'base');
314
+ const quoteId = this.safeString(market, 'quote');
315
+ const base = this.safeCurrencyCode(baseId);
316
+ const quote = this.safeCurrencyCode(quoteId);
317
+ const symbol = base + '/' + quote;
318
+ const limits = {
319
+ 'amount': {
320
+ 'min': this.safeNumber(market, 'minLimitBaseAmount'),
321
+ 'max': this.safeNumber(market, 'maxLimitBaseAmount'),
322
+ },
323
+ 'price': {
324
+ 'min': undefined,
325
+ 'max': undefined,
326
+ },
327
+ 'cost': {
328
+ 'min': undefined,
329
+ 'max': undefined,
330
+ },
331
+ 'leverage': {
332
+ 'min': undefined,
333
+ 'max': undefined,
334
+ },
335
+ };
336
+ return {
337
+ 'id': id,
338
+ 'uppercaseId': uppercaseId,
339
+ 'symbol': symbol,
340
+ 'base': base,
341
+ 'quote': quote,
342
+ 'baseId': base,
343
+ 'quoteId': quote,
344
+ 'settle': undefined,
345
+ 'settleId': undefined,
346
+ 'type': 'spot',
347
+ 'spot': true,
348
+ 'margin': false,
349
+ 'swap': false,
350
+ 'future': false,
351
+ 'option': false,
352
+ 'contract': false,
353
+ 'linear': undefined,
354
+ 'inverse': undefined,
355
+ 'contractSize': undefined,
356
+ 'expiry': undefined,
357
+ 'expiryDatetime': undefined,
358
+ 'strike': undefined,
359
+ 'optionType': undefined,
360
+ 'limits': limits,
361
+ 'precision': {
362
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
363
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'basePrecision'))),
364
+ },
365
+ 'active': active,
366
+ 'created': undefined,
367
+ 'info': market,
368
+ };
372
369
  }
373
370
  parseTicker(ticker, market = undefined) {
374
371
  //
@@ -1399,6 +1396,7 @@ export default class bitopro extends Exchange {
1399
1396
  'tagTo': tag,
1400
1397
  'updated': undefined,
1401
1398
  'comment': undefined,
1399
+ 'internal': undefined,
1402
1400
  'fee': {
1403
1401
  'currency': code,
1404
1402
  'cost': this.safeNumber(transaction, 'fee'),
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitpanda.js';
2
- import { Balances, Int, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction } from './base/types.js';
2
+ import { Balances, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction } from './base/types.js';
3
3
  /**
4
4
  * @class bitpanda
5
5
  * @extends Exchange
@@ -8,7 +8,8 @@ export default class bitpanda extends Exchange {
8
8
  describe(): any;
9
9
  fetchTime(params?: {}): Promise<number>;
10
10
  fetchCurrencies(params?: {}): Promise<{}>;
11
- fetchMarkets(params?: {}): Promise<any[]>;
11
+ fetchMarkets(params?: {}): Promise<Market[]>;
12
+ parseMarket(market: any): Market;
12
13
  fetchTradingFees(params?: {}): Promise<any>;
13
14
  fetchPublicTradingFees(params?: {}): Promise<{}>;
14
15
  fetchPrivateTradingFees(params?: {}): Promise<{}>;
@@ -376,68 +376,66 @@ export default class bitpanda extends Exchange {
376
376
  // }
377
377
  // ]
378
378
  //
379
- const result = [];
380
- for (let i = 0; i < response.length; i++) {
381
- const market = response[i];
382
- const baseAsset = this.safeValue(market, 'base', {});
383
- const quoteAsset = this.safeValue(market, 'quote', {});
384
- const baseId = this.safeString(baseAsset, 'code');
385
- const quoteId = this.safeString(quoteAsset, 'code');
386
- const id = baseId + '_' + quoteId;
387
- const base = this.safeCurrencyCode(baseId);
388
- const quote = this.safeCurrencyCode(quoteId);
389
- const state = this.safeString(market, 'state');
390
- result.push({
391
- 'id': id,
392
- 'symbol': base + '/' + quote,
393
- 'base': base,
394
- 'quote': quote,
395
- 'settle': undefined,
396
- 'baseId': baseId,
397
- 'quoteId': quoteId,
398
- 'settleId': undefined,
399
- 'type': 'spot',
400
- 'spot': true,
401
- 'margin': false,
402
- 'swap': false,
403
- 'future': false,
404
- 'option': false,
405
- 'active': (state === 'ACTIVE'),
406
- 'contract': false,
407
- 'linear': undefined,
408
- 'inverse': undefined,
409
- 'contractSize': undefined,
410
- 'expiry': undefined,
411
- 'expiryDatetime': undefined,
412
- 'strike': undefined,
413
- 'optionType': undefined,
414
- 'precision': {
415
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'amount_precision'))),
416
- 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'market_precision'))),
379
+ return this.parseMarkets(response);
380
+ }
381
+ parseMarket(market) {
382
+ const baseAsset = this.safeValue(market, 'base', {});
383
+ const quoteAsset = this.safeValue(market, 'quote', {});
384
+ const baseId = this.safeString(baseAsset, 'code');
385
+ const quoteId = this.safeString(quoteAsset, 'code');
386
+ const id = baseId + '_' + quoteId;
387
+ const base = this.safeCurrencyCode(baseId);
388
+ const quote = this.safeCurrencyCode(quoteId);
389
+ const state = this.safeString(market, 'state');
390
+ return {
391
+ 'id': id,
392
+ 'symbol': base + '/' + quote,
393
+ 'base': base,
394
+ 'quote': quote,
395
+ 'settle': undefined,
396
+ 'baseId': baseId,
397
+ 'quoteId': quoteId,
398
+ 'settleId': undefined,
399
+ 'type': 'spot',
400
+ 'spot': true,
401
+ 'margin': false,
402
+ 'swap': false,
403
+ 'future': false,
404
+ 'option': false,
405
+ 'active': (state === 'ACTIVE'),
406
+ 'contract': false,
407
+ 'linear': undefined,
408
+ 'inverse': undefined,
409
+ 'contractSize': undefined,
410
+ 'expiry': undefined,
411
+ 'expiryDatetime': undefined,
412
+ 'strike': undefined,
413
+ 'optionType': undefined,
414
+ 'precision': {
415
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'amount_precision'))),
416
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'market_precision'))),
417
+ },
418
+ 'limits': {
419
+ 'leverage': {
420
+ 'min': undefined,
421
+ 'max': undefined,
417
422
  },
418
- 'limits': {
419
- 'leverage': {
420
- 'min': undefined,
421
- 'max': undefined,
422
- },
423
- 'amount': {
424
- 'min': undefined,
425
- 'max': undefined,
426
- },
427
- 'price': {
428
- 'min': undefined,
429
- 'max': undefined,
430
- },
431
- 'cost': {
432
- 'min': this.safeNumber(market, 'min_size'),
433
- 'max': undefined,
434
- },
423
+ 'amount': {
424
+ 'min': undefined,
425
+ 'max': undefined,
435
426
  },
436
- 'created': undefined,
437
- 'info': market,
438
- });
439
- }
440
- return result;
427
+ 'price': {
428
+ 'min': undefined,
429
+ 'max': undefined,
430
+ },
431
+ 'cost': {
432
+ 'min': this.safeNumber(market, 'min_size'),
433
+ 'max': undefined,
434
+ },
435
+ },
436
+ 'created': undefined,
437
+ 'info': market,
438
+ };
441
439
  }
442
440
  async fetchTradingFees(params = {}) {
443
441
  /**
@@ -1351,6 +1349,8 @@ export default class bitpanda extends Exchange {
1351
1349
  'type': undefined,
1352
1350
  'updated': undefined,
1353
1351
  'txid': this.safeString(transaction, 'blockchain_transaction_id'),
1352
+ 'comment': undefined,
1353
+ 'internal': undefined,
1354
1354
  'timestamp': timestamp,
1355
1355
  'datetime': this.iso8601(timestamp),
1356
1356
  'fee': fee,
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitrue.js';
2
- import { Balances, Int, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction } from './base/types.js';
2
+ import { Balances, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction } from './base/types.js';
3
3
  /**
4
4
  * @class bitrue
5
5
  * @extends Exchange
@@ -19,7 +19,8 @@ export default class bitrue extends Exchange {
19
19
  fetchTime(params?: {}): Promise<number>;
20
20
  safeNetwork(networkId: any): string;
21
21
  fetchCurrencies(params?: {}): Promise<{}>;
22
- fetchMarkets(params?: {}): Promise<any[]>;
22
+ fetchMarkets(params?: {}): Promise<Market[]>;
23
+ parseMarket(market: any): Market;
23
24
  parseBalance(response: any): Balances;
24
25
  fetchBalance(params?: {}): Promise<Balances>;
25
26
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
package/js/src/bitrue.js CHANGED
@@ -638,79 +638,74 @@ export default class bitrue extends Exchange {
638
638
  await this.loadTimeDifference();
639
639
  }
640
640
  const markets = this.safeValue(response, 'symbols', []);
641
- const result = [];
642
- for (let i = 0; i < markets.length; i++) {
643
- const market = markets[i];
644
- const id = this.safeString(market, 'symbol');
645
- const lowercaseId = this.safeStringLower(market, 'symbol');
646
- const baseId = this.safeString(market, 'baseAsset');
647
- const quoteId = this.safeString(market, 'quoteAsset');
648
- const base = this.safeCurrencyCode(baseId);
649
- const quote = this.safeCurrencyCode(quoteId);
650
- const filters = this.safeValue(market, 'filters', []);
651
- const filtersByType = this.indexBy(filters, 'filterType');
652
- const status = this.safeString(market, 'status');
653
- const priceFilter = this.safeValue(filtersByType, 'PRICE_FILTER', {});
654
- const amountFilter = this.safeValue(filtersByType, 'LOT_SIZE', {});
655
- const defaultPricePrecision = this.safeString(market, 'pricePrecision');
656
- const defaultAmountPrecision = this.safeString(market, 'quantityPrecision');
657
- const pricePrecision = this.safeString(priceFilter, 'priceScale', defaultPricePrecision);
658
- const amountPrecision = this.safeString(amountFilter, 'volumeScale', defaultAmountPrecision);
659
- const entry = {
660
- 'id': id,
661
- 'lowercaseId': lowercaseId,
662
- 'symbol': base + '/' + quote,
663
- 'base': base,
664
- 'quote': quote,
665
- 'settle': undefined,
666
- 'baseId': baseId,
667
- 'quoteId': quoteId,
668
- 'settleId': undefined,
669
- 'type': 'spot',
670
- 'spot': true,
671
- 'margin': false,
672
- 'swap': false,
673
- 'future': false,
674
- 'option': false,
675
- 'active': (status === 'TRADING'),
676
- 'contract': false,
677
- 'linear': undefined,
678
- 'inverse': undefined,
679
- 'contractSize': undefined,
680
- 'expiry': undefined,
681
- 'expiryDatetime': undefined,
682
- 'strike': undefined,
683
- 'optionType': undefined,
684
- 'precision': {
685
- 'amount': this.parseNumber(this.parsePrecision(amountPrecision)),
686
- 'price': this.parseNumber(this.parsePrecision(pricePrecision)),
687
- 'base': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))),
688
- 'quote': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
641
+ return this.parseMarkets(markets);
642
+ }
643
+ parseMarket(market) {
644
+ const id = this.safeString(market, 'symbol');
645
+ const lowercaseId = this.safeStringLower(market, 'symbol');
646
+ const baseId = this.safeString(market, 'baseAsset');
647
+ const quoteId = this.safeString(market, 'quoteAsset');
648
+ const base = this.safeCurrencyCode(baseId);
649
+ const quote = this.safeCurrencyCode(quoteId);
650
+ const filters = this.safeValue(market, 'filters', []);
651
+ const filtersByType = this.indexBy(filters, 'filterType');
652
+ const status = this.safeString(market, 'status');
653
+ const priceFilter = this.safeValue(filtersByType, 'PRICE_FILTER', {});
654
+ const amountFilter = this.safeValue(filtersByType, 'LOT_SIZE', {});
655
+ const defaultPricePrecision = this.safeString(market, 'pricePrecision');
656
+ const defaultAmountPrecision = this.safeString(market, 'quantityPrecision');
657
+ const pricePrecision = this.safeString(priceFilter, 'priceScale', defaultPricePrecision);
658
+ const amountPrecision = this.safeString(amountFilter, 'volumeScale', defaultAmountPrecision);
659
+ return {
660
+ 'id': id,
661
+ 'lowercaseId': lowercaseId,
662
+ 'symbol': base + '/' + quote,
663
+ 'base': base,
664
+ 'quote': quote,
665
+ 'settle': undefined,
666
+ 'baseId': baseId,
667
+ 'quoteId': quoteId,
668
+ 'settleId': undefined,
669
+ 'type': 'spot',
670
+ 'spot': true,
671
+ 'margin': false,
672
+ 'swap': false,
673
+ 'future': false,
674
+ 'option': false,
675
+ 'active': (status === 'TRADING'),
676
+ 'contract': false,
677
+ 'linear': undefined,
678
+ 'inverse': undefined,
679
+ 'contractSize': undefined,
680
+ 'expiry': undefined,
681
+ 'expiryDatetime': undefined,
682
+ 'strike': undefined,
683
+ 'optionType': undefined,
684
+ 'precision': {
685
+ 'amount': this.parseNumber(this.parsePrecision(amountPrecision)),
686
+ 'price': this.parseNumber(this.parsePrecision(pricePrecision)),
687
+ },
688
+ 'limits': {
689
+ 'leverage': {
690
+ 'min': undefined,
691
+ 'max': undefined,
689
692
  },
690
- 'limits': {
691
- 'leverage': {
692
- 'min': undefined,
693
- 'max': undefined,
694
- },
695
- 'amount': {
696
- 'min': this.safeNumber(amountFilter, 'minQty'),
697
- 'max': this.safeNumber(amountFilter, 'maxQty'),
698
- },
699
- 'price': {
700
- 'min': this.safeNumber(priceFilter, 'minPrice'),
701
- 'max': this.safeNumber(priceFilter, 'maxPrice'),
702
- },
703
- 'cost': {
704
- 'min': this.safeNumber(amountFilter, 'minVal'),
705
- 'max': undefined,
706
- },
693
+ 'amount': {
694
+ 'min': this.safeNumber(amountFilter, 'minQty'),
695
+ 'max': this.safeNumber(amountFilter, 'maxQty'),
707
696
  },
708
- 'created': undefined,
709
- 'info': market,
710
- };
711
- result.push(entry);
712
- }
713
- return result;
697
+ 'price': {
698
+ 'min': this.safeNumber(priceFilter, 'minPrice'),
699
+ 'max': this.safeNumber(priceFilter, 'maxPrice'),
700
+ },
701
+ 'cost': {
702
+ 'min': this.safeNumber(amountFilter, 'minVal'),
703
+ 'max': undefined,
704
+ },
705
+ },
706
+ 'created': undefined,
707
+ 'info': market,
708
+ };
714
709
  }
715
710
  parseBalance(response) {
716
711
  const result = {
@@ -1833,6 +1828,7 @@ export default class bitrue extends Exchange {
1833
1828
  'status': status,
1834
1829
  'updated': updated,
1835
1830
  'internal': false,
1831
+ 'comment': undefined,
1836
1832
  'fee': fee,
1837
1833
  };
1838
1834
  }
package/js/src/bitso.js CHANGED
@@ -1673,6 +1673,7 @@ export default class bitso extends Exchange {
1673
1673
  'tag': undefined,
1674
1674
  'tagTo': undefined,
1675
1675
  'comment': undefined,
1676
+ 'internal': undefined,
1676
1677
  'fee': undefined,
1677
1678
  'info': transaction,
1678
1679
  };
@@ -1714,6 +1714,7 @@ export default class bitstamp extends Exchange {
1714
1714
  'tagTo': tag,
1715
1715
  'updated': undefined,
1716
1716
  'comment': undefined,
1717
+ 'internal': undefined,
1717
1718
  'fee': fee,
1718
1719
  };
1719
1720
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bittrex.js';
2
- import { Int, OrderSide, OrderType, OHLCV, Order, Trade, Balances, Transaction, Ticker, OrderBook, Tickers } from './base/types.js';
2
+ import { Int, OrderSide, OrderType, OHLCV, Order, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market } from './base/types.js';
3
3
  /**
4
4
  * @class bittrex
5
5
  * @extends Exchange
@@ -7,7 +7,8 @@ import { Int, OrderSide, OrderType, OHLCV, Order, Trade, Balances, Transaction,
7
7
  export default class bittrex extends Exchange {
8
8
  describe(): any;
9
9
  feeToPrecision(symbol: any, fee: any): any;
10
- fetchMarkets(params?: {}): Promise<any[]>;
10
+ fetchMarkets(params?: {}): Promise<Market[]>;
11
+ parseMarket(market: any): Market;
11
12
  parseBalance(response: any): Balances;
12
13
  fetchBalance(params?: {}): Promise<Balances>;
13
14
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
package/js/src/bittrex.js CHANGED
@@ -315,65 +315,63 @@ export default class bittrex extends Exchange {
315
315
  // }
316
316
  // ]
317
317
  //
318
- const result = [];
319
- for (let i = 0; i < response.length; i++) {
320
- const market = response[i];
321
- const baseId = this.safeString(market, 'baseCurrencySymbol');
322
- const quoteId = this.safeString(market, 'quoteCurrencySymbol');
323
- const base = this.safeCurrencyCode(baseId);
324
- const quote = this.safeCurrencyCode(quoteId);
325
- const status = this.safeString(market, 'status');
326
- result.push({
327
- 'id': this.safeString(market, 'symbol'),
328
- 'symbol': base + '/' + quote,
329
- 'base': base,
330
- 'quote': quote,
331
- 'settle': undefined,
332
- 'baseId': baseId,
333
- 'quoteId': quoteId,
334
- 'settleId': undefined,
335
- 'type': 'spot',
336
- 'spot': true,
337
- 'margin': false,
338
- 'swap': false,
339
- 'future': false,
340
- 'option': false,
341
- 'active': (status === 'ONLINE'),
342
- 'contract': false,
343
- 'linear': undefined,
344
- 'inverse': undefined,
345
- 'contractSize': undefined,
346
- 'expiry': undefined,
347
- 'expiryDatetime': undefined,
348
- 'strike': undefined,
349
- 'optionType': undefined,
350
- 'precision': {
351
- 'amount': this.parseNumber('1e-8'),
352
- 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'precision'))),
318
+ return this.parseMarkets(response);
319
+ }
320
+ parseMarket(market) {
321
+ const baseId = this.safeString(market, 'baseCurrencySymbol');
322
+ const quoteId = this.safeString(market, 'quoteCurrencySymbol');
323
+ const base = this.safeCurrencyCode(baseId);
324
+ const quote = this.safeCurrencyCode(quoteId);
325
+ const status = this.safeString(market, 'status');
326
+ return {
327
+ 'id': this.safeString(market, 'symbol'),
328
+ 'symbol': base + '/' + quote,
329
+ 'base': base,
330
+ 'quote': quote,
331
+ 'settle': undefined,
332
+ 'baseId': baseId,
333
+ 'quoteId': quoteId,
334
+ 'settleId': undefined,
335
+ 'type': 'spot',
336
+ 'spot': true,
337
+ 'margin': false,
338
+ 'swap': false,
339
+ 'future': false,
340
+ 'option': false,
341
+ 'active': (status === 'ONLINE'),
342
+ 'contract': false,
343
+ 'linear': undefined,
344
+ 'inverse': undefined,
345
+ 'contractSize': undefined,
346
+ 'expiry': undefined,
347
+ 'expiryDatetime': undefined,
348
+ 'strike': undefined,
349
+ 'optionType': undefined,
350
+ 'precision': {
351
+ 'amount': this.parseNumber('1e-8'),
352
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'precision'))),
353
+ },
354
+ 'limits': {
355
+ 'leverage': {
356
+ 'min': undefined,
357
+ 'max': undefined,
353
358
  },
354
- 'limits': {
355
- 'leverage': {
356
- 'min': undefined,
357
- 'max': undefined,
358
- },
359
- 'amount': {
360
- 'min': this.safeNumber(market, 'minTradeSize'),
361
- 'max': undefined,
362
- },
363
- 'price': {
364
- 'min': undefined,
365
- 'max': undefined,
366
- },
367
- 'cost': {
368
- 'min': undefined,
369
- 'max': undefined,
370
- },
359
+ 'amount': {
360
+ 'min': this.safeNumber(market, 'minTradeSize'),
361
+ 'max': undefined,
371
362
  },
372
- 'created': this.parse8601(this.safeString(market, 'createdAt')),
373
- 'info': market,
374
- });
375
- }
376
- return result;
363
+ 'price': {
364
+ 'min': undefined,
365
+ 'max': undefined,
366
+ },
367
+ 'cost': {
368
+ 'min': undefined,
369
+ 'max': undefined,
370
+ },
371
+ },
372
+ 'created': this.parse8601(this.safeString(market, 'createdAt')),
373
+ 'info': market,
374
+ };
377
375
  }
378
376
  parseBalance(response) {
379
377
  const result = { 'info': response };
@@ -1673,6 +1671,8 @@ export default class bittrex extends Exchange {
1673
1671
  'txid': txid,
1674
1672
  'timestamp': timestamp,
1675
1673
  'datetime': this.iso8601(timestamp),
1674
+ 'comment': undefined,
1675
+ 'internal': undefined,
1676
1676
  'fee': {
1677
1677
  'currency': code,
1678
1678
  'cost': feeCost,