ccxt 4.1.51 → 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 (182) hide show
  1. package/README.md +110 -113
  2. package/dist/ccxt.browser.js +1361 -2933
  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 +3 -3
  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 +15 -15
  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/alpaca.d.ts +3 -2
  82. package/js/src/alpaca.js +62 -64
  83. package/js/src/ascendex.js +3 -1
  84. package/js/src/base/Exchange.d.ts +2 -0
  85. package/js/src/base/Exchange.js +10 -0
  86. package/js/src/base/types.d.ts +6 -3
  87. package/js/src/bigone.d.ts +3 -3
  88. package/js/src/bigone.js +60 -77
  89. package/js/src/binance.js +1 -0
  90. package/js/src/bingx.d.ts +2 -2
  91. package/js/src/bingx.js +4 -11
  92. package/js/src/bitbank.d.ts +3 -2
  93. package/js/src/bitbank.js +58 -59
  94. package/js/src/bitbns.js +1 -0
  95. package/js/src/bitfinex.js +1 -0
  96. package/js/src/bitfinex2.js +1 -0
  97. package/js/src/bitflyer.js +1 -0
  98. package/js/src/bitget.d.ts +1 -2
  99. package/js/src/bitget.js +3 -8
  100. package/js/src/bithumb.js +1 -0
  101. package/js/src/bitmart.js +10 -1
  102. package/js/src/bitmex.d.ts +3 -2
  103. package/js/src/bitmex.js +114 -119
  104. package/js/src/bitopro.d.ts +3 -2
  105. package/js/src/bitopro.js +63 -65
  106. package/js/src/bitpanda.d.ts +3 -2
  107. package/js/src/bitpanda.js +60 -60
  108. package/js/src/bitrue.d.ts +3 -2
  109. package/js/src/bitrue.js +67 -71
  110. package/js/src/bitso.js +1 -0
  111. package/js/src/bitstamp.js +1 -0
  112. package/js/src/bittrex.d.ts +3 -2
  113. package/js/src/bittrex.js +57 -57
  114. package/js/src/bitvavo.js +10 -2
  115. package/js/src/blockchaincom.js +2 -2
  116. package/js/src/btcalpha.d.ts +3 -2
  117. package/js/src/btcalpha.js +59 -60
  118. package/js/src/btcmarkets.d.ts +3 -2
  119. package/js/src/btcmarkets.js +68 -69
  120. package/js/src/btcturk.d.ts +3 -2
  121. package/js/src/btcturk.js +72 -74
  122. package/js/src/bybit.js +3 -1
  123. package/js/src/coinbase.js +7 -2
  124. package/js/src/coinbasepro.js +1 -0
  125. package/js/src/coincheck.js +1 -0
  126. package/js/src/coinex.js +4 -0
  127. package/js/src/coinlist.d.ts +3 -2
  128. package/js/src/coinlist.js +60 -60
  129. package/js/src/coinmate.js +1 -0
  130. package/js/src/coinsph.js +2 -4
  131. package/js/src/cryptocom.js +1 -0
  132. package/js/src/currencycom.js +2 -2
  133. package/js/src/deribit.js +2 -0
  134. package/js/src/digifinex.js +5 -2
  135. package/js/src/exmo.js +1 -0
  136. package/js/src/gate.js +2 -0
  137. package/js/src/gemini.js +2 -0
  138. package/js/src/hitbtc.js +4 -0
  139. package/js/src/hollaex.js +2 -0
  140. package/js/src/htx.js +4 -0
  141. package/js/src/huobijp.js +2 -0
  142. package/js/src/idex.js +2 -0
  143. package/js/src/indodax.js +1 -0
  144. package/js/src/kraken.js +3 -3
  145. package/js/src/kucoin.js +6 -5
  146. package/js/src/kuna.js +3 -1
  147. package/js/src/latoken.js +1 -0
  148. package/js/src/lbank.js +1 -0
  149. package/js/src/lykke.js +2 -0
  150. package/js/src/mercado.js +1 -0
  151. package/js/src/mexc.js +2 -0
  152. package/js/src/ndax.js +2 -0
  153. package/js/src/novadax.js +1 -0
  154. package/js/src/okcoin.js +2 -0
  155. package/js/src/okx.js +2 -0
  156. package/js/src/phemex.js +2 -0
  157. package/js/src/poloniex.js +1 -0
  158. package/js/src/pro/binance.js +5 -3
  159. package/js/src/pro/coinbase.js +12 -3
  160. package/js/src/pro/cryptocom.js +17 -17
  161. package/js/src/pro/krakenfutures.js +15 -15
  162. package/js/src/probit.js +4 -2
  163. package/js/src/tidex.js +1 -0
  164. package/js/src/timex.js +2 -0
  165. package/js/src/upbit.js +2 -0
  166. package/js/src/wavesexchange.js +2 -1
  167. package/js/src/whitebit.js +1 -0
  168. package/js/src/woo.js +1 -0
  169. package/js/src/zaif.js +1 -0
  170. package/js/src/zonda.js +1 -0
  171. package/package.json +1 -1
  172. package/skip-tests.json +2 -3
  173. package/dist/cjs/src/btctradeua.js +0 -571
  174. package/dist/cjs/src/coinfalcon.js +0 -1012
  175. package/js/src/abstract/btctradeua.d.ts +0 -20
  176. package/js/src/abstract/btctradeua.js +0 -11
  177. package/js/src/abstract/coinfalcon.d.ts +0 -26
  178. package/js/src/abstract/coinfalcon.js +0 -11
  179. package/js/src/btctradeua.d.ts +0 -30
  180. package/js/src/btctradeua.js +0 -572
  181. package/js/src/coinfalcon.d.ts +0 -53
  182. package/js/src/coinfalcon.js +0 -1013
package/js/src/bitvavo.js CHANGED
@@ -23,7 +23,7 @@ export default class bitvavo extends Exchange {
23
23
  'countries': ['NL'],
24
24
  'rateLimit': 60,
25
25
  'version': 'v2',
26
- 'certified': true,
26
+ 'certified': false,
27
27
  'pro': true,
28
28
  'has': {
29
29
  'CORS': undefined,
@@ -315,7 +315,10 @@ export default class bitvavo extends Exchange {
315
315
  * @returns {object[]} an array of objects representing market data
316
316
  */
317
317
  const response = await this.publicGetMarkets(params);
318
- const currencies = await this.fetchCurrencies();
318
+ let currencies = this.currencies;
319
+ if (this.currencies === undefined) {
320
+ currencies = await this.fetchCurrencies();
321
+ }
319
322
  const currenciesById = this.indexBy(currencies, 'id');
320
323
  //
321
324
  // [
@@ -332,6 +335,7 @@ export default class bitvavo extends Exchange {
332
335
  // ]
333
336
  //
334
337
  const result = [];
338
+ const fees = this.fees;
335
339
  for (let i = 0; i < response.length; i++) {
336
340
  const market = response[i];
337
341
  const id = this.safeString(market, 'market');
@@ -366,6 +370,8 @@ export default class bitvavo extends Exchange {
366
370
  'expiryDatetime': undefined,
367
371
  'strike': undefined,
368
372
  'optionType': undefined,
373
+ 'taker': fees['trading']['taker'],
374
+ 'maker': fees['trading']['maker'],
369
375
  'precision': {
370
376
  'amount': this.safeInteger(baseCurrency, 'decimals', basePrecision),
371
377
  'price': this.safeInteger(market, 'pricePrecision'),
@@ -1772,6 +1778,8 @@ export default class bitvavo extends Exchange {
1772
1778
  'updated': undefined,
1773
1779
  'fee': fee,
1774
1780
  'network': undefined,
1781
+ 'comment': undefined,
1782
+ 'internal': undefined,
1775
1783
  };
1776
1784
  }
1777
1785
  parseDepositWithdrawFee(fee, currency = undefined) {
@@ -886,7 +886,7 @@ export default class blockchaincom extends Exchange {
886
886
  }
887
887
  const address = this.safeString(transaction, 'address');
888
888
  const txid = this.safeString(transaction, 'txhash');
889
- const result = {
889
+ return {
890
890
  'info': transaction,
891
891
  'id': id,
892
892
  'txid': txid,
@@ -905,9 +905,9 @@ export default class blockchaincom extends Exchange {
905
905
  'status': this.parseTransactionState(state),
906
906
  'updated': undefined,
907
907
  'comment': undefined,
908
+ 'internal': undefined,
908
909
  'fee': fee,
909
910
  };
910
- return result;
911
911
  }
912
912
  async fetchWithdrawalWhitelist(params = {}) {
913
913
  /**
@@ -1,12 +1,13 @@
1
1
  import Exchange from './abstract/btcalpha.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 btcalpha
5
5
  * @extends Exchange
6
6
  */
7
7
  export default class btcalpha extends Exchange {
8
8
  describe(): any;
9
- fetchMarkets(params?: {}): Promise<any[]>;
9
+ fetchMarkets(params?: {}): Promise<Market[]>;
10
+ parseMarket(market: any): Market;
10
11
  fetchTickers(symbols?: string[], params?: {}): Promise<Tickers>;
11
12
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
12
13
  parseTicker(ticker: any, market?: any): Ticker;
@@ -172,68 +172,66 @@ export default class btcalpha extends Exchange {
172
172
  // },
173
173
  // ]
174
174
  //
175
- const result = [];
176
- for (let i = 0; i < response.length; i++) {
177
- const market = response[i];
178
- const id = this.safeString(market, 'name');
179
- const baseId = this.safeString(market, 'currency1');
180
- const quoteId = this.safeString(market, 'currency2');
181
- const base = this.safeCurrencyCode(baseId);
182
- const quote = this.safeCurrencyCode(quoteId);
183
- const pricePrecision = this.safeString(market, 'price_precision');
184
- const priceLimit = this.parsePrecision(pricePrecision);
185
- const amountLimit = this.safeString(market, 'minimum_order_size');
186
- result.push({
187
- 'id': id,
188
- 'symbol': base + '/' + quote,
189
- 'base': base,
190
- 'quote': quote,
191
- 'settle': undefined,
192
- 'baseId': baseId,
193
- 'quoteId': quoteId,
194
- 'settleId': undefined,
195
- 'type': 'spot',
196
- 'spot': true,
197
- 'margin': false,
198
- 'swap': false,
199
- 'future': false,
200
- 'option': false,
201
- 'active': true,
202
- 'contract': false,
203
- 'linear': undefined,
204
- 'inverse': undefined,
205
- 'contractSize': undefined,
206
- 'expiry': undefined,
207
- 'expiryDatetime': undefined,
208
- 'strike': undefined,
209
- 'optionType': undefined,
210
- 'precision': {
211
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'amount_precision'))),
212
- 'price': this.parseNumber(this.parsePrecision((pricePrecision))),
175
+ return this.parseMarkets(response);
176
+ }
177
+ parseMarket(market) {
178
+ const id = this.safeString(market, 'name');
179
+ const baseId = this.safeString(market, 'currency1');
180
+ const quoteId = this.safeString(market, 'currency2');
181
+ const base = this.safeCurrencyCode(baseId);
182
+ const quote = this.safeCurrencyCode(quoteId);
183
+ const pricePrecision = this.safeString(market, 'price_precision');
184
+ const priceLimit = this.parsePrecision(pricePrecision);
185
+ const amountLimit = this.safeString(market, 'minimum_order_size');
186
+ return {
187
+ 'id': id,
188
+ 'symbol': base + '/' + quote,
189
+ 'base': base,
190
+ 'quote': quote,
191
+ 'settle': undefined,
192
+ 'baseId': baseId,
193
+ 'quoteId': quoteId,
194
+ 'settleId': undefined,
195
+ 'type': 'spot',
196
+ 'spot': true,
197
+ 'margin': false,
198
+ 'swap': false,
199
+ 'future': false,
200
+ 'option': false,
201
+ 'active': true,
202
+ 'contract': false,
203
+ 'linear': undefined,
204
+ 'inverse': undefined,
205
+ 'contractSize': undefined,
206
+ 'expiry': undefined,
207
+ 'expiryDatetime': undefined,
208
+ 'strike': undefined,
209
+ 'optionType': undefined,
210
+ 'precision': {
211
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'amount_precision'))),
212
+ 'price': this.parseNumber(this.parsePrecision((pricePrecision))),
213
+ },
214
+ 'limits': {
215
+ 'leverage': {
216
+ 'min': undefined,
217
+ 'max': undefined,
213
218
  },
214
- 'limits': {
215
- 'leverage': {
216
- 'min': undefined,
217
- 'max': undefined,
218
- },
219
- 'amount': {
220
- 'min': this.parseNumber(amountLimit),
221
- 'max': this.safeNumber(market, 'maximum_order_size'),
222
- },
223
- 'price': {
224
- 'min': this.parseNumber(priceLimit),
225
- 'max': undefined,
226
- },
227
- 'cost': {
228
- 'min': this.parseNumber(Precise.stringMul(priceLimit, amountLimit)),
229
- 'max': undefined,
230
- },
219
+ 'amount': {
220
+ 'min': this.parseNumber(amountLimit),
221
+ 'max': this.safeNumber(market, 'maximum_order_size'),
231
222
  },
232
- 'created': undefined,
233
- 'info': market,
234
- });
235
- }
236
- return result;
223
+ 'price': {
224
+ 'min': this.parseNumber(priceLimit),
225
+ 'max': undefined,
226
+ },
227
+ 'cost': {
228
+ 'min': this.parseNumber(Precise.stringMul(priceLimit, amountLimit)),
229
+ 'max': undefined,
230
+ },
231
+ },
232
+ 'created': undefined,
233
+ 'info': market,
234
+ };
237
235
  }
238
236
  async fetchTickers(symbols = undefined, params = {}) {
239
237
  /**
@@ -545,6 +543,7 @@ export default class btcalpha extends Exchange {
545
543
  'type': undefined,
546
544
  'status': this.parseTransactionStatus(statusId),
547
545
  'comment': undefined,
546
+ 'internal': undefined,
548
547
  'fee': undefined,
549
548
  'updated': undefined,
550
549
  };
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/btcmarkets.js';
2
- import { Balances, Int, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction } from './base/types.js';
2
+ import { Balances, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction } from './base/types.js';
3
3
  /**
4
4
  * @class btcmarkets
5
5
  * @extends Exchange
@@ -13,7 +13,8 @@ export default class btcmarkets extends Exchange {
13
13
  parseTransactionStatus(status: any): string;
14
14
  parseTransactionType(type: any): string;
15
15
  parseTransaction(transaction: any, currency?: any): Transaction;
16
- fetchMarkets(params?: {}): Promise<any[]>;
16
+ fetchMarkets(params?: {}): Promise<Market[]>;
17
+ parseMarket(market: any): Market;
17
18
  fetchTime(params?: {}): Promise<number>;
18
19
  parseBalance(response: any): Balances;
19
20
  fetchBalance(params?: {}): Promise<Balances>;
@@ -338,7 +338,8 @@ export default class btcmarkets extends Exchange {
338
338
  'currency': code,
339
339
  'status': status,
340
340
  'updated': lastUpdate,
341
- 'comment': undefined,
341
+ 'comment': this.safeString(transaction, 'description'),
342
+ 'internal': undefined,
342
343
  'fee': {
343
344
  'currency': code,
344
345
  'cost': this.parseNumber(fee),
@@ -369,76 +370,74 @@ export default class btcmarkets extends Exchange {
369
370
  // }
370
371
  // ]
371
372
  //
372
- const result = [];
373
- for (let i = 0; i < response.length; i++) {
374
- const market = response[i];
375
- const baseId = this.safeString(market, 'baseAssetName');
376
- const quoteId = this.safeString(market, 'quoteAssetName');
377
- const id = this.safeString(market, 'marketId');
378
- const base = this.safeCurrencyCode(baseId);
379
- const quote = this.safeCurrencyCode(quoteId);
380
- const symbol = base + '/' + quote;
381
- const fees = this.safeValue(this.safeValue(this.options, 'fees', {}), quote, this.fees);
382
- const pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'priceDecimals')));
383
- const minAmount = this.safeNumber(market, 'minOrderAmount');
384
- const maxAmount = this.safeNumber(market, 'maxOrderAmount');
385
- let minPrice = undefined;
386
- if (quote === 'AUD') {
387
- minPrice = pricePrecision;
388
- }
389
- result.push({
390
- 'id': id,
391
- 'symbol': symbol,
392
- 'base': base,
393
- 'quote': quote,
394
- 'settle': undefined,
395
- 'baseId': baseId,
396
- 'quoteId': quoteId,
397
- 'settleId': undefined,
398
- 'type': 'spot',
399
- 'spot': true,
400
- 'margin': false,
401
- 'swap': false,
402
- 'future': false,
403
- 'option': false,
404
- 'active': undefined,
405
- 'contract': false,
406
- 'linear': undefined,
407
- 'inverse': undefined,
408
- 'taker': fees['taker'],
409
- 'maker': fees['maker'],
410
- 'contractSize': undefined,
411
- 'expiry': undefined,
412
- 'expiryDatetime': undefined,
413
- 'strike': undefined,
414
- 'optionType': undefined,
415
- 'precision': {
416
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'amountDecimals'))),
417
- 'price': pricePrecision,
373
+ return this.parseMarkets(response);
374
+ }
375
+ parseMarket(market) {
376
+ const baseId = this.safeString(market, 'baseAssetName');
377
+ const quoteId = this.safeString(market, 'quoteAssetName');
378
+ const id = this.safeString(market, 'marketId');
379
+ const base = this.safeCurrencyCode(baseId);
380
+ const quote = this.safeCurrencyCode(quoteId);
381
+ const symbol = base + '/' + quote;
382
+ const fees = this.safeValue(this.safeValue(this.options, 'fees', {}), quote, this.fees);
383
+ const pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'priceDecimals')));
384
+ const minAmount = this.safeNumber(market, 'minOrderAmount');
385
+ const maxAmount = this.safeNumber(market, 'maxOrderAmount');
386
+ let minPrice = undefined;
387
+ if (quote === 'AUD') {
388
+ minPrice = pricePrecision;
389
+ }
390
+ return {
391
+ 'id': id,
392
+ 'symbol': symbol,
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': undefined,
406
+ 'contract': false,
407
+ 'linear': undefined,
408
+ 'inverse': undefined,
409
+ 'taker': fees['taker'],
410
+ 'maker': fees['maker'],
411
+ 'contractSize': undefined,
412
+ 'expiry': undefined,
413
+ 'expiryDatetime': undefined,
414
+ 'strike': undefined,
415
+ 'optionType': undefined,
416
+ 'precision': {
417
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'amountDecimals'))),
418
+ 'price': pricePrecision,
419
+ },
420
+ 'limits': {
421
+ 'leverage': {
422
+ 'min': undefined,
423
+ 'max': undefined,
418
424
  },
419
- 'limits': {
420
- 'leverage': {
421
- 'min': undefined,
422
- 'max': undefined,
423
- },
424
- 'amount': {
425
- 'min': minAmount,
426
- 'max': maxAmount,
427
- },
428
- 'price': {
429
- 'min': minPrice,
430
- 'max': undefined,
431
- },
432
- 'cost': {
433
- 'min': undefined,
434
- 'max': undefined,
435
- },
425
+ 'amount': {
426
+ 'min': minAmount,
427
+ 'max': maxAmount,
436
428
  },
437
- 'created': undefined,
438
- 'info': market,
439
- });
440
- }
441
- return result;
429
+ 'price': {
430
+ 'min': minPrice,
431
+ 'max': undefined,
432
+ },
433
+ 'cost': {
434
+ 'min': undefined,
435
+ 'max': undefined,
436
+ },
437
+ },
438
+ 'created': undefined,
439
+ 'info': market,
440
+ };
442
441
  }
443
442
  async fetchTime(params = {}) {
444
443
  /**
@@ -1,12 +1,13 @@
1
1
  import Exchange from './abstract/btcturk.js';
2
- import { Balances, Int, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade } from './base/types.js';
2
+ import { Balances, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade } from './base/types.js';
3
3
  /**
4
4
  * @class btcturk
5
5
  * @extends Exchange
6
6
  */
7
7
  export default class btcturk extends Exchange {
8
8
  describe(): any;
9
- fetchMarkets(params?: {}): Promise<any[]>;
9
+ fetchMarkets(params?: {}): Promise<Market[]>;
10
+ parseMarket(entry: any): Market;
10
11
  parseBalance(response: any): Balances;
11
12
  fetchBalance(params?: {}): Promise<Balances>;
12
13
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
package/js/src/btcturk.js CHANGED
@@ -193,83 +193,81 @@ export default class btcturk extends Exchange {
193
193
  //
194
194
  const data = this.safeValue(response, 'data');
195
195
  const markets = this.safeValue(data, 'symbols', []);
196
- const result = [];
197
- for (let i = 0; i < markets.length; i++) {
198
- const entry = markets[i];
199
- const id = this.safeString(entry, 'name');
200
- const baseId = this.safeString(entry, 'numerator');
201
- const quoteId = this.safeString(entry, 'denominator');
202
- const base = this.safeCurrencyCode(baseId);
203
- const quote = this.safeCurrencyCode(quoteId);
204
- const filters = this.safeValue(entry, 'filters', []);
205
- let minPrice = undefined;
206
- let maxPrice = undefined;
207
- let minAmount = undefined;
208
- let maxAmount = undefined;
209
- let minCost = undefined;
210
- for (let j = 0; j < filters.length; j++) {
211
- const filter = filters[j];
212
- const filterType = this.safeString(filter, 'filterType');
213
- if (filterType === 'PRICE_FILTER') {
214
- minPrice = this.safeNumber(filter, 'minPrice');
215
- maxPrice = this.safeNumber(filter, 'maxPrice');
216
- minAmount = this.safeNumber(filter, 'minAmount');
217
- maxAmount = this.safeNumber(filter, 'maxAmount');
218
- minCost = this.safeNumber(filter, 'minExchangeValue');
219
- }
196
+ return this.parseMarkets(markets);
197
+ }
198
+ parseMarket(entry) {
199
+ const id = this.safeString(entry, 'name');
200
+ const baseId = this.safeString(entry, 'numerator');
201
+ const quoteId = this.safeString(entry, 'denominator');
202
+ const base = this.safeCurrencyCode(baseId);
203
+ const quote = this.safeCurrencyCode(quoteId);
204
+ const filters = this.safeValue(entry, 'filters', []);
205
+ let minPrice = undefined;
206
+ let maxPrice = undefined;
207
+ let minAmount = undefined;
208
+ let maxAmount = undefined;
209
+ let minCost = undefined;
210
+ for (let j = 0; j < filters.length; j++) {
211
+ const filter = filters[j];
212
+ const filterType = this.safeString(filter, 'filterType');
213
+ if (filterType === 'PRICE_FILTER') {
214
+ minPrice = this.safeNumber(filter, 'minPrice');
215
+ maxPrice = this.safeNumber(filter, 'maxPrice');
216
+ minAmount = this.safeNumber(filter, 'minAmount');
217
+ maxAmount = this.safeNumber(filter, 'maxAmount');
218
+ minCost = this.safeNumber(filter, 'minExchangeValue');
220
219
  }
221
- const status = this.safeString(entry, 'status');
222
- result.push({
223
- 'id': id,
224
- 'symbol': base + '/' + quote,
225
- 'base': base,
226
- 'quote': quote,
227
- 'settle': undefined,
228
- 'baseId': baseId,
229
- 'quoteId': quoteId,
230
- 'settleId': undefined,
231
- 'type': 'spot',
232
- 'spot': true,
233
- 'margin': false,
234
- 'swap': false,
235
- 'future': false,
236
- 'option': false,
237
- 'active': (status === 'TRADING'),
238
- 'contract': false,
239
- 'linear': undefined,
240
- 'inverse': undefined,
241
- 'contractSize': undefined,
242
- 'expiry': undefined,
243
- 'expiryDatetime': undefined,
244
- 'strike': undefined,
245
- 'optionType': undefined,
246
- 'precision': {
247
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(entry, 'numeratorScale'))),
248
- 'price': this.parseNumber(this.parsePrecision(this.safeString(entry, 'denominatorScale'))),
220
+ }
221
+ const status = this.safeString(entry, 'status');
222
+ return {
223
+ 'id': id,
224
+ 'symbol': base + '/' + quote,
225
+ 'base': base,
226
+ 'quote': quote,
227
+ 'settle': undefined,
228
+ 'baseId': baseId,
229
+ 'quoteId': quoteId,
230
+ 'settleId': undefined,
231
+ 'type': 'spot',
232
+ 'spot': true,
233
+ 'margin': false,
234
+ 'swap': false,
235
+ 'future': false,
236
+ 'option': false,
237
+ 'active': (status === 'TRADING'),
238
+ 'contract': false,
239
+ 'linear': undefined,
240
+ 'inverse': undefined,
241
+ 'contractSize': undefined,
242
+ 'expiry': undefined,
243
+ 'expiryDatetime': undefined,
244
+ 'strike': undefined,
245
+ 'optionType': undefined,
246
+ 'precision': {
247
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(entry, 'numeratorScale'))),
248
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(entry, 'denominatorScale'))),
249
+ },
250
+ 'limits': {
251
+ 'leverage': {
252
+ 'min': undefined,
253
+ 'max': undefined,
249
254
  },
250
- 'limits': {
251
- 'leverage': {
252
- 'min': undefined,
253
- 'max': undefined,
254
- },
255
- 'amount': {
256
- 'min': minAmount,
257
- 'max': maxAmount,
258
- },
259
- 'price': {
260
- 'min': minPrice,
261
- 'max': maxPrice,
262
- },
263
- 'cost': {
264
- 'min': minCost,
265
- 'max': undefined,
266
- },
255
+ 'amount': {
256
+ 'min': minAmount,
257
+ 'max': maxAmount,
267
258
  },
268
- 'created': undefined,
269
- 'info': entry,
270
- });
271
- }
272
- return result;
259
+ 'price': {
260
+ 'min': minPrice,
261
+ 'max': maxPrice,
262
+ },
263
+ 'cost': {
264
+ 'min': minCost,
265
+ 'max': undefined,
266
+ },
267
+ },
268
+ 'created': undefined,
269
+ 'info': entry,
270
+ };
273
271
  }
274
272
  parseBalance(response) {
275
273
  const data = this.safeValue(response, 'data', []);
package/js/src/bybit.js CHANGED
@@ -3595,7 +3595,7 @@ export default class bybit extends Exchange {
3595
3595
  request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
3596
3596
  request['reduceOnly'] = true;
3597
3597
  }
3598
- else if (isStopLoss || isTakeProfit) {
3598
+ if (isStopLoss || isTakeProfit) {
3599
3599
  if (isStopLoss) {
3600
3600
  const slTriggerPrice = this.safeValue2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
3601
3601
  request['stopLoss'] = this.priceToPrecision(symbol, slTriggerPrice);
@@ -5193,6 +5193,8 @@ export default class bybit extends Exchange {
5193
5193
  'status': status,
5194
5194
  'updated': updated,
5195
5195
  'fee': fee,
5196
+ 'internal': undefined,
5197
+ 'comment': undefined,
5196
5198
  };
5197
5199
  }
5198
5200
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
@@ -861,8 +861,13 @@ export default class coinbase extends Exchange {
861
861
  }
862
862
  const sizeInQuote = this.safeValue(trade, 'size_in_quote');
863
863
  const v3Price = this.safeString(trade, 'price');
864
- const v3Amount = (sizeInQuote) ? undefined : this.safeString(trade, 'size');
865
- const v3Cost = (sizeInQuote) ? this.safeString(trade, 'size') : undefined;
864
+ let v3Cost = undefined;
865
+ let v3Amount = this.safeString(trade, 'size');
866
+ if (sizeInQuote) {
867
+ // calculate base size
868
+ v3Cost = v3Amount;
869
+ v3Amount = Precise.stringDiv(v3Amount, v3Price);
870
+ }
866
871
  const v3FeeCost = this.safeString(trade, 'commission');
867
872
  const amountString = this.safeString(amountObject, 'amount', v3Amount);
868
873
  const costString = this.safeString(subtotalObject, 'amount', v3Cost);
@@ -1790,6 +1790,7 @@ export default class coinbasepro extends Exchange {
1790
1790
  'tagTo': undefined,
1791
1791
  'updated': this.parse8601(this.safeString(transaction, 'processed_at')),
1792
1792
  'comment': undefined,
1793
+ 'internal': false,
1793
1794
  'fee': fee,
1794
1795
  };
1795
1796
  }
@@ -779,6 +779,7 @@ export default class coincheck extends Exchange {
779
779
  'currency': code,
780
780
  'status': status,
781
781
  'updated': updated,
782
+ 'comment': undefined,
782
783
  'internal': undefined,
783
784
  'fee': fee,
784
785
  };
package/js/src/coinex.js CHANGED
@@ -4019,6 +4019,8 @@ export default class coinex extends Exchange {
4019
4019
  const networkId = this.safeString(transaction, 'smart_contract_name');
4020
4020
  const amount = this.safeNumber(transaction, 'actual_amount');
4021
4021
  let feeCost = this.safeString(transaction, 'tx_fee');
4022
+ const transferMethod = this.safeString(transaction, 'transfer_method');
4023
+ const internal = transferMethod === 'local';
4022
4024
  let addressTo = undefined;
4023
4025
  let addressFrom = undefined;
4024
4026
  if (type === 'deposit') {
@@ -4051,6 +4053,8 @@ export default class coinex extends Exchange {
4051
4053
  'status': status,
4052
4054
  'updated': undefined,
4053
4055
  'fee': fee,
4056
+ 'comment': undefined,
4057
+ 'internal': internal,
4054
4058
  };
4055
4059
  }
4056
4060
  async transfer(code, amount, fromAccount, toAccount, params = {}) {