ccxt 4.1.52 → 4.1.53

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 (198) hide show
  1. package/README.md +6 -8
  2. package/dist/ccxt.browser.js +1311 -2712
  3. package/dist/ccxt.browser.min.js +7 -7
  4. package/dist/cjs/ccxt.js +1 -7
  5. package/dist/cjs/src/ace.js +56 -59
  6. package/dist/cjs/src/ascendex.js +1 -2
  7. package/dist/cjs/src/base/Exchange.js +1 -11
  8. package/dist/cjs/src/bingx.js +48 -8
  9. package/dist/cjs/src/bybit.js +2 -11
  10. package/dist/cjs/src/cryptocom.js +1 -0
  11. package/dist/cjs/src/digifinex.js +9 -6
  12. package/dist/cjs/src/lbank.js +2333 -443
  13. package/dist/cjs/src/ndax.js +59 -61
  14. package/dist/cjs/src/novadax.js +57 -59
  15. package/dist/cjs/src/oceanex.js +58 -60
  16. package/dist/cjs/src/okcoin.js +1 -9
  17. package/dist/cjs/src/okx.js +0 -7
  18. package/dist/cjs/src/poloniex.js +55 -57
  19. package/dist/cjs/src/poloniexfutures.js +67 -70
  20. package/dist/cjs/src/pro/bingx.js +18 -11
  21. package/dist/cjs/src/pro/poloniexfutures.js +9 -0
  22. package/dist/cjs/src/probit.js +62 -65
  23. package/dist/cjs/src/timex.js +1 -5
  24. package/dist/cjs/src/upbit.js +56 -58
  25. package/dist/cjs/src/wazirx.js +72 -74
  26. package/dist/cjs/src/whitebit.js +88 -91
  27. package/dist/cjs/src/woo.js +75 -77
  28. package/dist/cjs/src/zaif.js +57 -71
  29. package/dist/cjs/src/zonda.js +67 -70
  30. package/js/ccxt.d.ts +2 -8
  31. package/js/ccxt.js +2 -6
  32. package/js/src/abstract/bybit.d.ts +1 -0
  33. package/js/src/abstract/lbank.d.ts +57 -15
  34. package/js/src/ace.d.ts +8 -7
  35. package/js/src/ace.js +56 -59
  36. package/js/src/alpaca.d.ts +4 -4
  37. package/js/src/ascendex.d.ts +12 -12
  38. package/js/src/ascendex.js +1 -2
  39. package/js/src/base/Exchange.js +1 -11
  40. package/js/src/base/types.d.ts +73 -71
  41. package/js/src/bigone.d.ts +10 -10
  42. package/js/src/binance.d.ts +27 -27
  43. package/js/src/bingx.d.ts +15 -15
  44. package/js/src/bingx.js +48 -8
  45. package/js/src/bit2c.d.ts +5 -5
  46. package/js/src/bitbank.d.ts +5 -5
  47. package/js/src/bitbns.d.ts +7 -7
  48. package/js/src/bitfinex.d.ts +8 -8
  49. package/js/src/bitfinex2.d.ts +12 -12
  50. package/js/src/bitflyer.d.ts +9 -9
  51. package/js/src/bitforex.d.ts +6 -6
  52. package/js/src/bitget.d.ts +24 -24
  53. package/js/src/bithumb.d.ts +4 -4
  54. package/js/src/bitmart.d.ts +21 -21
  55. package/js/src/bitmex.d.ts +14 -14
  56. package/js/src/bitopro.d.ts +12 -12
  57. package/js/src/bitpanda.d.ts +11 -11
  58. package/js/src/bitrue.d.ts +8 -8
  59. package/js/src/bitso.d.ts +11 -11
  60. package/js/src/bitstamp.d.ts +10 -10
  61. package/js/src/bitstamp1.d.ts +4 -4
  62. package/js/src/bittrex.d.ts +14 -14
  63. package/js/src/bitvavo.d.ts +9 -9
  64. package/js/src/bl3p.d.ts +2 -2
  65. package/js/src/blockchaincom.d.ts +13 -13
  66. package/js/src/btcalpha.d.ts +9 -9
  67. package/js/src/btcbox.d.ts +6 -6
  68. package/js/src/btcmarkets.d.ts +12 -12
  69. package/js/src/btcturk.d.ts +5 -5
  70. package/js/src/bybit.d.ts +28 -28
  71. package/js/src/bybit.js +2 -11
  72. package/js/src/cex.d.ts +6 -6
  73. package/js/src/coinbase.d.ts +17 -17
  74. package/js/src/coinbasepro.d.ts +13 -13
  75. package/js/src/coincheck.d.ts +6 -6
  76. package/js/src/coinex.d.ts +18 -18
  77. package/js/src/coinlist.d.ts +14 -14
  78. package/js/src/coinmate.d.ts +7 -7
  79. package/js/src/coinone.d.ts +5 -5
  80. package/js/src/coinsph.d.ts +10 -10
  81. package/js/src/coinspot.d.ts +3 -3
  82. package/js/src/cryptocom.d.ts +16 -16
  83. package/js/src/cryptocom.js +1 -0
  84. package/js/src/currencycom.d.ts +10 -10
  85. package/js/src/delta.d.ts +10 -10
  86. package/js/src/deribit.d.ts +13 -13
  87. package/js/src/digifinex.d.ts +17 -17
  88. package/js/src/digifinex.js +9 -6
  89. package/js/src/exmo.d.ts +12 -12
  90. package/js/src/gate.d.ts +20 -20
  91. package/js/src/gemini.d.ts +6 -6
  92. package/js/src/hitbtc.d.ts +15 -15
  93. package/js/src/hollaex.d.ts +12 -12
  94. package/js/src/htx.d.ts +27 -27
  95. package/js/src/huobijp.d.ts +16 -16
  96. package/js/src/idex.d.ts +13 -13
  97. package/js/src/independentreserve.d.ts +6 -6
  98. package/js/src/indodax.d.ts +6 -6
  99. package/js/src/kraken.d.ts +16 -16
  100. package/js/src/krakenfutures.d.ts +9 -9
  101. package/js/src/kucoin.d.ts +15 -15
  102. package/js/src/kucoinfutures.d.ts +11 -11
  103. package/js/src/kuna.d.ts +12 -12
  104. package/js/src/latoken.d.ts +9 -9
  105. package/js/src/lbank.d.ts +65 -12
  106. package/js/src/lbank.js +2334 -444
  107. package/js/src/lbank2.d.ts +11 -11
  108. package/js/src/luno.d.ts +10 -10
  109. package/js/src/lykke.d.ts +8 -8
  110. package/js/src/mercado.d.ts +6 -6
  111. package/js/src/mexc.d.ts +23 -23
  112. package/js/src/ndax.d.ts +13 -12
  113. package/js/src/ndax.js +59 -61
  114. package/js/src/novadax.d.ts +13 -12
  115. package/js/src/novadax.js +57 -59
  116. package/js/src/oceanex.d.ts +10 -9
  117. package/js/src/oceanex.js +58 -60
  118. package/js/src/okcoin.d.ts +12 -13
  119. package/js/src/okcoin.js +1 -9
  120. package/js/src/okx.d.ts +26 -27
  121. package/js/src/okx.js +0 -7
  122. package/js/src/paymium.d.ts +2 -2
  123. package/js/src/phemex.d.ts +16 -16
  124. package/js/src/poloniex.d.ts +15 -14
  125. package/js/src/poloniex.js +55 -57
  126. package/js/src/poloniexfutures.d.ts +11 -10
  127. package/js/src/poloniexfutures.js +67 -70
  128. package/js/src/pro/alpaca.d.ts +3 -3
  129. package/js/src/pro/ascendex.d.ts +2 -2
  130. package/js/src/pro/binance.d.ts +9 -9
  131. package/js/src/pro/bingx.d.ts +3 -3
  132. package/js/src/pro/bingx.js +19 -12
  133. package/js/src/pro/bitfinex.d.ts +3 -3
  134. package/js/src/pro/bitfinex2.d.ts +3 -3
  135. package/js/src/pro/bitget.d.ts +3 -3
  136. package/js/src/pro/bitmart.d.ts +2 -2
  137. package/js/src/pro/bitmex.d.ts +3 -3
  138. package/js/src/pro/bitpanda.d.ts +3 -3
  139. package/js/src/pro/bitrue.d.ts +2 -2
  140. package/js/src/pro/bitstamp.d.ts +2 -2
  141. package/js/src/pro/bittrex.d.ts +3 -3
  142. package/js/src/pro/bitvavo.d.ts +3 -3
  143. package/js/src/pro/blockchaincom.d.ts +2 -2
  144. package/js/src/pro/bybit.d.ts +4 -4
  145. package/js/src/pro/cex.d.ts +3 -3
  146. package/js/src/pro/coinbasepro.d.ts +3 -3
  147. package/js/src/pro/coinex.d.ts +2 -2
  148. package/js/src/pro/cryptocom.d.ts +5 -5
  149. package/js/src/pro/deribit.d.ts +3 -3
  150. package/js/src/pro/exmo.d.ts +2 -2
  151. package/js/src/pro/gate.d.ts +3 -3
  152. package/js/src/pro/gemini.d.ts +2 -2
  153. package/js/src/pro/hitbtc.d.ts +3 -3
  154. package/js/src/pro/hollaex.d.ts +3 -3
  155. package/js/src/pro/htx.d.ts +3 -3
  156. package/js/src/pro/idex.d.ts +3 -3
  157. package/js/src/pro/kraken.d.ts +7 -7
  158. package/js/src/pro/krakenfutures.d.ts +4 -4
  159. package/js/src/pro/kucoin.d.ts +3 -3
  160. package/js/src/pro/kucoinfutures.d.ts +3 -3
  161. package/js/src/pro/mexc.d.ts +3 -3
  162. package/js/src/pro/okcoin.d.ts +2 -2
  163. package/js/src/pro/okx.d.ts +6 -6
  164. package/js/src/pro/phemex.d.ts +3 -3
  165. package/js/src/pro/poloniex.d.ts +3 -3
  166. package/js/src/pro/poloniexfutures.d.ts +3 -3
  167. package/js/src/pro/poloniexfutures.js +9 -0
  168. package/js/src/pro/probit.d.ts +3 -3
  169. package/js/src/pro/wazirx.d.ts +3 -3
  170. package/js/src/pro/whitebit.d.ts +3 -3
  171. package/js/src/pro/woo.d.ts +2 -2
  172. package/js/src/probit.d.ts +11 -10
  173. package/js/src/probit.js +62 -65
  174. package/js/src/tidex.d.ts +5 -5
  175. package/js/src/timex.d.ts +10 -10
  176. package/js/src/timex.js +1 -5
  177. package/js/src/tokocrypto.d.ts +9 -9
  178. package/js/src/upbit.d.ts +11 -10
  179. package/js/src/upbit.js +56 -58
  180. package/js/src/wavesexchange.d.ts +7 -7
  181. package/js/src/wazirx.d.ts +7 -6
  182. package/js/src/wazirx.js +72 -74
  183. package/js/src/whitebit.d.ts +12 -11
  184. package/js/src/whitebit.js +88 -91
  185. package/js/src/woo.d.ts +20 -19
  186. package/js/src/woo.js +75 -77
  187. package/js/src/yobit.d.ts +5 -5
  188. package/js/src/zaif.d.ts +6 -5
  189. package/js/src/zaif.js +57 -71
  190. package/js/src/zonda.d.ts +7 -6
  191. package/js/src/zonda.js +67 -70
  192. package/package.json +1 -1
  193. package/skip-tests.json +0 -15
  194. package/test.ts +0 -0
  195. package/js/src/abstract/bitstamp1.d.ts +0 -26
  196. package/js/src/abstract/bitstamp1.js +0 -11
  197. package/js/src/abstract/lbank2.d.ts +0 -64
  198. package/js/src/abstract/lbank2.js +0 -11
@@ -211,83 +211,81 @@ class wazirx extends wazirx$1 {
211
211
  // },
212
212
  //
213
213
  const markets = this.safeValue(response, 'symbols', []);
214
- const result = [];
215
- for (let i = 0; i < markets.length; i++) {
216
- const market = markets[i];
217
- const id = this.safeString(market, 'symbol');
218
- const baseId = this.safeString(market, 'baseAsset');
219
- const quoteId = this.safeString(market, 'quoteAsset');
220
- const base = this.safeCurrencyCode(baseId);
221
- const quote = this.safeCurrencyCode(quoteId);
222
- const isSpot = this.safeValue(market, 'isSpotTradingAllowed');
223
- const filters = this.safeValue(market, 'filters');
224
- let minPrice = undefined;
225
- for (let j = 0; j < filters.length; j++) {
226
- const filter = filters[j];
227
- const filterType = this.safeString(filter, 'filterType');
228
- if (filterType === 'PRICE_FILTER') {
229
- minPrice = this.safeNumber(filter, 'minPrice');
230
- }
214
+ return this.parseMarkets(markets);
215
+ }
216
+ parseMarket(market) {
217
+ const id = this.safeString(market, 'symbol');
218
+ const baseId = this.safeString(market, 'baseAsset');
219
+ const quoteId = this.safeString(market, 'quoteAsset');
220
+ const base = this.safeCurrencyCode(baseId);
221
+ const quote = this.safeCurrencyCode(quoteId);
222
+ const isSpot = this.safeValue(market, 'isSpotTradingAllowed');
223
+ const filters = this.safeValue(market, 'filters');
224
+ let minPrice = undefined;
225
+ for (let j = 0; j < filters.length; j++) {
226
+ const filter = filters[j];
227
+ const filterType = this.safeString(filter, 'filterType');
228
+ if (filterType === 'PRICE_FILTER') {
229
+ minPrice = this.safeNumber(filter, 'minPrice');
231
230
  }
232
- const fee = this.safeValue(this.fees, quote, {});
233
- let takerString = this.safeString(fee, 'taker', '0.2');
234
- takerString = Precise["default"].stringDiv(takerString, '100');
235
- let makerString = this.safeString(fee, 'maker', '0.2');
236
- makerString = Precise["default"].stringDiv(makerString, '100');
237
- const status = this.safeString(market, 'status');
238
- result.push({
239
- 'id': id,
240
- 'symbol': base + '/' + quote,
241
- 'base': base,
242
- 'quote': quote,
243
- 'settle': undefined,
244
- 'baseId': baseId,
245
- 'quoteId': quoteId,
246
- 'settleId': undefined,
247
- 'type': 'spot',
248
- 'spot': isSpot,
249
- 'margin': false,
250
- 'swap': false,
251
- 'future': false,
252
- 'option': false,
253
- 'active': (status === 'trading'),
254
- 'contract': false,
255
- 'linear': undefined,
256
- 'inverse': undefined,
257
- 'taker': this.parseNumber(takerString),
258
- 'maker': this.parseNumber(makerString),
259
- 'contractSize': undefined,
260
- 'expiry': undefined,
261
- 'expiryDatetime': undefined,
262
- 'strike': undefined,
263
- 'optionType': undefined,
264
- 'precision': {
265
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))),
266
- 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteAssetPrecision'))),
231
+ }
232
+ const fee = this.safeValue(this.fees, quote, {});
233
+ let takerString = this.safeString(fee, 'taker', '0.2');
234
+ takerString = Precise["default"].stringDiv(takerString, '100');
235
+ let makerString = this.safeString(fee, 'maker', '0.2');
236
+ makerString = Precise["default"].stringDiv(makerString, '100');
237
+ const status = this.safeString(market, 'status');
238
+ return {
239
+ 'id': id,
240
+ 'symbol': base + '/' + quote,
241
+ 'base': base,
242
+ 'quote': quote,
243
+ 'settle': undefined,
244
+ 'baseId': baseId,
245
+ 'quoteId': quoteId,
246
+ 'settleId': undefined,
247
+ 'type': 'spot',
248
+ 'spot': isSpot,
249
+ 'margin': false,
250
+ 'swap': false,
251
+ 'future': false,
252
+ 'option': false,
253
+ 'active': (status === 'trading'),
254
+ 'contract': false,
255
+ 'linear': undefined,
256
+ 'inverse': undefined,
257
+ 'taker': this.parseNumber(takerString),
258
+ 'maker': this.parseNumber(makerString),
259
+ 'contractSize': undefined,
260
+ 'expiry': undefined,
261
+ 'expiryDatetime': undefined,
262
+ 'strike': undefined,
263
+ 'optionType': undefined,
264
+ 'precision': {
265
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))),
266
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteAssetPrecision'))),
267
+ },
268
+ 'limits': {
269
+ 'leverage': {
270
+ 'min': undefined,
271
+ 'max': undefined,
267
272
  },
268
- 'limits': {
269
- 'leverage': {
270
- 'min': undefined,
271
- 'max': undefined,
272
- },
273
- 'price': {
274
- 'min': minPrice,
275
- 'max': undefined,
276
- },
277
- 'amount': {
278
- 'min': undefined,
279
- 'max': undefined,
280
- },
281
- 'cost': {
282
- 'min': undefined,
283
- 'max': undefined,
284
- },
273
+ 'price': {
274
+ 'min': minPrice,
275
+ 'max': undefined,
285
276
  },
286
- 'created': undefined,
287
- 'info': market,
288
- });
289
- }
290
- return result;
277
+ 'amount': {
278
+ 'min': undefined,
279
+ 'max': undefined,
280
+ },
281
+ 'cost': {
282
+ 'min': undefined,
283
+ 'max': undefined,
284
+ },
285
+ },
286
+ 'created': undefined,
287
+ 'info': market,
288
+ };
291
289
  }
292
290
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
293
291
  /**
@@ -297,99 +297,96 @@ class whitebit extends whitebit$1 {
297
297
  // }
298
298
  // ]
299
299
  //
300
- const result = [];
301
- for (let i = 0; i < markets.length; i++) {
302
- const market = markets[i];
303
- const id = this.safeString(market, 'name');
304
- const baseId = this.safeString(market, 'stock');
305
- let quoteId = this.safeString(market, 'money');
306
- quoteId = (quoteId === 'PERP') ? 'USDT' : quoteId;
307
- const base = this.safeCurrencyCode(baseId);
308
- const quote = this.safeCurrencyCode(quoteId);
309
- const active = this.safeValue(market, 'tradesEnabled');
310
- const isCollateral = this.safeValue(market, 'isCollateral');
311
- const typeId = this.safeString(market, 'type');
312
- let type = undefined;
313
- let settle = undefined;
314
- let settleId = undefined;
315
- let symbol = base + '/' + quote;
316
- const swap = typeId === 'futures';
317
- const margin = isCollateral && !swap;
318
- let contract = false;
319
- const amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'stockPrec')));
320
- const contractSize = amountPrecision;
321
- let linear = undefined;
322
- let inverse = undefined;
323
- if (swap) {
324
- settleId = quoteId;
325
- settle = this.safeCurrencyCode(settleId);
326
- symbol = symbol + ':' + settle;
327
- type = 'swap';
328
- contract = true;
329
- linear = true;
330
- inverse = false;
331
- }
332
- else {
333
- type = 'spot';
334
- }
335
- const takerFeeRate = this.safeString(market, 'takerFee');
336
- const taker = Precise["default"].stringDiv(takerFeeRate, '100');
337
- const makerFeeRate = this.safeString(market, 'makerFee');
338
- const maker = Precise["default"].stringDiv(makerFeeRate, '100');
339
- const entry = {
340
- 'id': id,
341
- 'symbol': symbol,
342
- 'base': base,
343
- 'quote': quote,
344
- 'settle': settle,
345
- 'baseId': baseId,
346
- 'quoteId': quoteId,
347
- 'settleId': settleId,
348
- 'type': type,
349
- 'spot': !swap,
350
- 'margin': margin,
351
- 'swap': swap,
352
- 'future': false,
353
- 'option': false,
354
- 'active': active,
355
- 'contract': contract,
356
- 'linear': linear,
357
- 'inverse': inverse,
358
- 'taker': this.parseNumber(taker),
359
- 'maker': this.parseNumber(maker),
360
- 'contractSize': contractSize,
361
- 'expiry': undefined,
362
- 'expiryDatetime': undefined,
363
- 'strike': undefined,
364
- 'optionType': undefined,
365
- 'precision': {
366
- 'amount': amountPrecision,
367
- 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'moneyPrec'))),
300
+ return this.parseMarkets(markets);
301
+ }
302
+ parseMarket(market) {
303
+ const id = this.safeString(market, 'name');
304
+ const baseId = this.safeString(market, 'stock');
305
+ let quoteId = this.safeString(market, 'money');
306
+ quoteId = (quoteId === 'PERP') ? 'USDT' : quoteId;
307
+ const base = this.safeCurrencyCode(baseId);
308
+ const quote = this.safeCurrencyCode(quoteId);
309
+ const active = this.safeValue(market, 'tradesEnabled');
310
+ const isCollateral = this.safeValue(market, 'isCollateral');
311
+ const typeId = this.safeString(market, 'type');
312
+ let type = undefined;
313
+ let settle = undefined;
314
+ let settleId = undefined;
315
+ let symbol = base + '/' + quote;
316
+ const swap = typeId === 'futures';
317
+ const margin = isCollateral && !swap;
318
+ let contract = false;
319
+ const amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'stockPrec')));
320
+ const contractSize = amountPrecision;
321
+ let linear = undefined;
322
+ let inverse = undefined;
323
+ if (swap) {
324
+ settleId = quoteId;
325
+ settle = this.safeCurrencyCode(settleId);
326
+ symbol = symbol + ':' + settle;
327
+ type = 'swap';
328
+ contract = true;
329
+ linear = true;
330
+ inverse = false;
331
+ }
332
+ else {
333
+ type = 'spot';
334
+ }
335
+ const takerFeeRate = this.safeString(market, 'takerFee');
336
+ const taker = Precise["default"].stringDiv(takerFeeRate, '100');
337
+ const makerFeeRate = this.safeString(market, 'makerFee');
338
+ const maker = Precise["default"].stringDiv(makerFeeRate, '100');
339
+ return {
340
+ 'id': id,
341
+ 'symbol': symbol,
342
+ 'base': base,
343
+ 'quote': quote,
344
+ 'settle': settle,
345
+ 'baseId': baseId,
346
+ 'quoteId': quoteId,
347
+ 'settleId': settleId,
348
+ 'type': type,
349
+ 'spot': !swap,
350
+ 'margin': margin,
351
+ 'swap': swap,
352
+ 'future': false,
353
+ 'option': false,
354
+ 'active': active,
355
+ 'contract': contract,
356
+ 'linear': linear,
357
+ 'inverse': inverse,
358
+ 'taker': this.parseNumber(taker),
359
+ 'maker': this.parseNumber(maker),
360
+ 'contractSize': contractSize,
361
+ 'expiry': undefined,
362
+ 'expiryDatetime': undefined,
363
+ 'strike': undefined,
364
+ 'optionType': undefined,
365
+ 'precision': {
366
+ 'amount': amountPrecision,
367
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'moneyPrec'))),
368
+ },
369
+ 'limits': {
370
+ 'leverage': {
371
+ 'min': undefined,
372
+ 'max': undefined,
368
373
  },
369
- 'limits': {
370
- 'leverage': {
371
- 'min': undefined,
372
- 'max': undefined,
373
- },
374
- 'amount': {
375
- 'min': this.safeNumber(market, 'minAmount'),
376
- 'max': undefined,
377
- },
378
- 'price': {
379
- 'min': undefined,
380
- 'max': undefined,
381
- },
382
- 'cost': {
383
- 'min': this.safeNumber(market, 'minTotal'),
384
- 'max': this.safeNumber(market, 'maxTotal'),
385
- },
374
+ 'amount': {
375
+ 'min': this.safeNumber(market, 'minAmount'),
376
+ 'max': undefined,
386
377
  },
387
- 'created': undefined,
388
- 'info': market,
389
- };
390
- result.push(entry);
391
- }
392
- return result;
378
+ 'price': {
379
+ 'min': undefined,
380
+ 'max': undefined,
381
+ },
382
+ 'cost': {
383
+ 'min': this.safeNumber(market, 'minTotal'),
384
+ 'max': this.safeNumber(market, 'maxTotal'),
385
+ },
386
+ },
387
+ 'created': undefined,
388
+ 'info': market,
389
+ };
393
390
  }
394
391
  async fetchCurrencies(params = {}) {
395
392
  /**
@@ -329,86 +329,84 @@ class woo extends woo$1 {
329
329
  // "success": true
330
330
  // }
331
331
  //
332
- const result = [];
333
332
  const data = this.safeValue(response, 'rows', []);
334
- for (let i = 0; i < data.length; i++) {
335
- const market = data[i];
336
- const marketId = this.safeString(market, 'symbol');
337
- const parts = marketId.split('_');
338
- let marketType = this.safeStringLower(parts, 0);
339
- const isSpot = marketType === 'spot';
340
- const isSwap = marketType === 'perp';
341
- const baseId = this.safeString(parts, 1);
342
- const quoteId = this.safeString(parts, 2);
343
- const base = this.safeCurrencyCode(baseId);
344
- const quote = this.safeCurrencyCode(quoteId);
345
- let settleId = undefined;
346
- let settle = undefined;
347
- let symbol = base + '/' + quote;
348
- let contractSize = undefined;
349
- let linear = undefined;
350
- let margin = true;
351
- const contract = isSwap;
352
- if (contract) {
353
- margin = false;
354
- settleId = this.safeString(parts, 2);
355
- settle = this.safeCurrencyCode(settleId);
356
- symbol = base + '/' + quote + ':' + settle;
357
- contractSize = this.parseNumber('1');
358
- marketType = 'swap';
359
- linear = true;
360
- }
361
- result.push({
362
- 'id': marketId,
363
- 'symbol': symbol,
364
- 'base': base,
365
- 'quote': quote,
366
- 'settle': settle,
367
- 'baseId': baseId,
368
- 'quoteId': quoteId,
369
- 'settleId': settleId,
370
- 'type': marketType,
371
- 'spot': isSpot,
372
- 'margin': margin,
373
- 'swap': isSwap,
374
- 'future': false,
375
- 'option': false,
376
- 'active': undefined,
377
- 'contract': contract,
378
- 'linear': linear,
379
- 'inverse': undefined,
380
- 'contractSize': contractSize,
381
- 'expiry': undefined,
382
- 'expiryDatetime': undefined,
383
- 'strike': undefined,
384
- 'optionType': undefined,
385
- 'precision': {
386
- 'amount': this.safeNumber(market, 'base_tick'),
387
- 'price': this.safeNumber(market, 'quote_tick'),
333
+ return this.parseMarkets(data);
334
+ }
335
+ parseMarket(market) {
336
+ const marketId = this.safeString(market, 'symbol');
337
+ const parts = marketId.split('_');
338
+ let marketType = this.safeStringLower(parts, 0);
339
+ const isSpot = marketType === 'spot';
340
+ const isSwap = marketType === 'perp';
341
+ const baseId = this.safeString(parts, 1);
342
+ const quoteId = this.safeString(parts, 2);
343
+ const base = this.safeCurrencyCode(baseId);
344
+ const quote = this.safeCurrencyCode(quoteId);
345
+ let settleId = undefined;
346
+ let settle = undefined;
347
+ let symbol = base + '/' + quote;
348
+ let contractSize = undefined;
349
+ let linear = undefined;
350
+ let margin = true;
351
+ const contract = isSwap;
352
+ if (contract) {
353
+ margin = false;
354
+ settleId = this.safeString(parts, 2);
355
+ settle = this.safeCurrencyCode(settleId);
356
+ symbol = base + '/' + quote + ':' + settle;
357
+ contractSize = this.parseNumber('1');
358
+ marketType = 'swap';
359
+ linear = true;
360
+ }
361
+ return {
362
+ 'id': marketId,
363
+ 'symbol': symbol,
364
+ 'base': base,
365
+ 'quote': quote,
366
+ 'settle': settle,
367
+ 'baseId': baseId,
368
+ 'quoteId': quoteId,
369
+ 'settleId': settleId,
370
+ 'type': marketType,
371
+ 'spot': isSpot,
372
+ 'margin': margin,
373
+ 'swap': isSwap,
374
+ 'future': false,
375
+ 'option': false,
376
+ 'active': undefined,
377
+ 'contract': contract,
378
+ 'linear': linear,
379
+ 'inverse': undefined,
380
+ 'contractSize': contractSize,
381
+ 'expiry': undefined,
382
+ 'expiryDatetime': undefined,
383
+ 'strike': undefined,
384
+ 'optionType': undefined,
385
+ 'precision': {
386
+ 'amount': this.safeNumber(market, 'base_tick'),
387
+ 'price': this.safeNumber(market, 'quote_tick'),
388
+ },
389
+ 'limits': {
390
+ 'leverage': {
391
+ 'min': undefined,
392
+ 'max': undefined,
388
393
  },
389
- 'limits': {
390
- 'leverage': {
391
- 'min': undefined,
392
- 'max': undefined,
393
- },
394
- 'amount': {
395
- 'min': this.safeNumber(market, 'base_min'),
396
- 'max': this.safeNumber(market, 'base_max'),
397
- },
398
- 'price': {
399
- 'min': this.safeNumber(market, 'quote_min'),
400
- 'max': this.safeNumber(market, 'quote_max'),
401
- },
402
- 'cost': {
403
- 'min': this.safeNumber(market, 'min_notional'),
404
- 'max': undefined,
405
- },
394
+ 'amount': {
395
+ 'min': this.safeNumber(market, 'base_min'),
396
+ 'max': this.safeNumber(market, 'base_max'),
406
397
  },
407
- 'created': this.safeTimestamp(market, 'created_time'),
408
- 'info': market,
409
- });
410
- }
411
- return result;
398
+ 'price': {
399
+ 'min': this.safeNumber(market, 'quote_min'),
400
+ 'max': this.safeNumber(market, 'quote_max'),
401
+ },
402
+ 'cost': {
403
+ 'min': this.safeNumber(market, 'min_notional'),
404
+ 'max': undefined,
405
+ },
406
+ },
407
+ 'created': this.safeTimestamp(market, 'created_time'),
408
+ 'info': market,
409
+ };
412
410
  }
413
411
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
414
412
  /**