ccxt 4.4.50 → 4.4.57

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 (277) hide show
  1. package/README.md +227 -142
  2. package/dist/ccxt.browser.min.js +8 -8
  3. package/dist/cjs/ccxt.js +1 -4
  4. package/dist/cjs/src/ace.js +3 -0
  5. package/dist/cjs/src/alpaca.js +6 -1
  6. package/dist/cjs/src/ascendex.js +2 -1
  7. package/dist/cjs/src/base/Exchange.js +151 -59
  8. package/dist/cjs/src/bigone.js +5 -0
  9. package/dist/cjs/src/binance.js +87 -68
  10. package/dist/cjs/src/bingx.js +27 -30
  11. package/dist/cjs/src/bit2c.js +3 -0
  12. package/dist/cjs/src/bitbank.js +3 -0
  13. package/dist/cjs/src/bitbns.js +3 -0
  14. package/dist/cjs/src/bitfinex.js +7 -2
  15. package/dist/cjs/src/bitflyer.js +5 -0
  16. package/dist/cjs/src/bitget.js +9 -5
  17. package/dist/cjs/src/bithumb.js +2 -0
  18. package/dist/cjs/src/bitmart.js +20 -8
  19. package/dist/cjs/src/bitmex.js +99 -93
  20. package/dist/cjs/src/bitopro.js +5 -0
  21. package/dist/cjs/src/bitrue.js +4 -0
  22. package/dist/cjs/src/bitso.js +3 -0
  23. package/dist/cjs/src/bitstamp.js +3 -0
  24. package/dist/cjs/src/bitteam.js +5 -0
  25. package/dist/cjs/src/bitvavo.js +4 -0
  26. package/dist/cjs/src/blockchaincom.js +5 -1
  27. package/dist/cjs/src/blofin.js +7 -0
  28. package/dist/cjs/src/btcalpha.js +5 -0
  29. package/dist/cjs/src/btcbox.js +3 -3
  30. package/dist/cjs/src/btcmarkets.js +5 -0
  31. package/dist/cjs/src/btcturk.js +3 -0
  32. package/dist/cjs/src/bybit.js +12 -2
  33. package/dist/cjs/src/cex.js +2 -0
  34. package/dist/cjs/src/coinbase.js +16 -8
  35. package/dist/cjs/src/coinbaseexchange.js +5 -0
  36. package/dist/cjs/src/coinbaseinternational.js +7 -3
  37. package/dist/cjs/src/coincatch.js +4 -1
  38. package/dist/cjs/src/coincheck.js +2 -0
  39. package/dist/cjs/src/coinex.js +6 -2
  40. package/dist/cjs/src/coinlist.js +5 -0
  41. package/dist/cjs/src/coinmate.js +5 -1
  42. package/dist/cjs/src/coinmetro.js +29 -8
  43. package/dist/cjs/src/coinone.js +4 -1
  44. package/dist/cjs/src/coinsph.js +5 -1
  45. package/dist/cjs/src/coinspot.js +2 -1
  46. package/dist/cjs/src/cryptocom.js +5 -0
  47. package/dist/cjs/src/currencycom.js +4 -1
  48. package/dist/cjs/src/defx.js +5 -0
  49. package/dist/cjs/src/delta.js +3 -0
  50. package/dist/cjs/src/deribit.js +37 -36
  51. package/dist/cjs/src/digifinex.js +10 -5
  52. package/dist/cjs/src/ellipx.js +9 -5
  53. package/dist/cjs/src/exmo.js +5 -2
  54. package/dist/cjs/src/gate.js +5 -1
  55. package/dist/cjs/src/gemini.js +3 -0
  56. package/dist/cjs/src/hashkey.js +5 -4
  57. package/dist/cjs/src/hitbtc.js +4 -0
  58. package/dist/cjs/src/hollaex.js +8 -2
  59. package/dist/cjs/src/htx.js +15 -5
  60. package/dist/cjs/src/huobijp.js +5 -0
  61. package/dist/cjs/src/hyperliquid.js +9 -4
  62. package/dist/cjs/src/idex.js +6 -2
  63. package/dist/cjs/src/independentreserve.js +4 -0
  64. package/dist/cjs/src/indodax.js +3 -0
  65. package/dist/cjs/src/kraken.js +7 -5
  66. package/dist/cjs/src/krakenfutures.js +5 -2
  67. package/dist/cjs/src/kucoin.js +18 -10
  68. package/dist/cjs/src/kucoinfutures.js +5 -1
  69. package/dist/cjs/src/kuna.js +3 -0
  70. package/dist/cjs/src/latoken.js +4 -0
  71. package/dist/cjs/src/lbank.js +6 -1
  72. package/dist/cjs/src/luno.js +7 -2
  73. package/dist/cjs/src/mercado.js +5 -1
  74. package/dist/cjs/src/mexc.js +36 -15
  75. package/dist/cjs/src/ndax.js +7 -2
  76. package/dist/cjs/src/novadax.js +6 -1
  77. package/dist/cjs/src/oceanex.js +4 -0
  78. package/dist/cjs/src/okcoin.js +6 -2
  79. package/dist/cjs/src/okx.js +18 -4
  80. package/dist/cjs/src/onetrading.js +6 -2
  81. package/dist/cjs/src/oxfun.js +3 -0
  82. package/dist/cjs/src/p2b.js +3 -0
  83. package/dist/cjs/src/paradex.js +10 -4
  84. package/dist/cjs/src/phemex.js +12 -5
  85. package/dist/cjs/src/poloniex.js +6 -3
  86. package/dist/cjs/src/poloniexfutures.js +5 -1
  87. package/dist/cjs/src/pro/binance.js +4 -2
  88. package/dist/cjs/src/pro/bitcoincom.js +1 -4
  89. package/dist/cjs/src/pro/bitget.js +3 -3
  90. package/dist/cjs/src/pro/bitopro.js +1 -1
  91. package/dist/cjs/src/pro/blofin.js +8 -0
  92. package/dist/cjs/src/pro/bybit.js +10 -2
  93. package/dist/cjs/src/pro/cex.js +1 -1
  94. package/dist/cjs/src/pro/coincatch.js +3 -3
  95. package/dist/cjs/src/pro/coinex.js +4 -1
  96. package/dist/cjs/src/pro/htx.js +8 -8
  97. package/dist/cjs/src/pro/mexc.js +3 -3
  98. package/dist/cjs/src/pro/okx.js +1 -1
  99. package/dist/cjs/src/probit.js +14 -9
  100. package/dist/cjs/src/timex.js +5 -1
  101. package/dist/cjs/src/tokocrypto.js +6 -1
  102. package/dist/cjs/src/tradeogre.js +2 -0
  103. package/dist/cjs/src/upbit.js +3 -0
  104. package/dist/cjs/src/vertex.js +71 -4
  105. package/dist/cjs/src/wavesexchange.js +96 -3
  106. package/dist/cjs/src/wazirx.js +61 -3
  107. package/dist/cjs/src/whitebit.js +74 -4
  108. package/dist/cjs/src/woo.js +15 -5
  109. package/dist/cjs/src/woofipro.js +25 -9
  110. package/dist/cjs/src/xt.js +117 -0
  111. package/dist/cjs/src/yobit.js +59 -0
  112. package/dist/cjs/src/zaif.js +57 -0
  113. package/dist/cjs/src/zonda.js +58 -0
  114. package/js/ccxt.d.ts +3 -6
  115. package/js/ccxt.js +2 -4
  116. package/js/src/abstract/binance.d.ts +0 -1
  117. package/js/src/abstract/binancecoinm.d.ts +0 -1
  118. package/js/src/abstract/binanceus.d.ts +0 -1
  119. package/js/src/abstract/binanceusdm.d.ts +0 -1
  120. package/js/src/ace.js +3 -0
  121. package/js/src/alpaca.js +6 -1
  122. package/js/src/ascendex.js +2 -1
  123. package/js/src/base/Exchange.d.ts +9 -3
  124. package/js/src/base/Exchange.js +151 -59
  125. package/js/src/base/types.d.ts +2 -0
  126. package/js/src/bigone.d.ts +1 -1
  127. package/js/src/bigone.js +5 -0
  128. package/js/src/binance.d.ts +33 -33
  129. package/js/src/binance.js +87 -68
  130. package/js/src/bingx.d.ts +1 -1
  131. package/js/src/bingx.js +27 -30
  132. package/js/src/bit2c.js +3 -0
  133. package/js/src/bitbank.js +3 -0
  134. package/js/src/bitbns.js +3 -0
  135. package/js/src/bitfinex.js +7 -2
  136. package/js/src/bitflyer.js +5 -0
  137. package/js/src/bitget.js +9 -5
  138. package/js/src/bithumb.js +2 -0
  139. package/js/src/bitmart.d.ts +5 -5
  140. package/js/src/bitmart.js +20 -8
  141. package/js/src/bitmex.js +99 -93
  142. package/js/src/bitopro.d.ts +2 -2
  143. package/js/src/bitopro.js +5 -0
  144. package/js/src/bitrue.js +4 -0
  145. package/js/src/bitso.d.ts +2 -2
  146. package/js/src/bitso.js +3 -0
  147. package/js/src/bitstamp.js +3 -0
  148. package/js/src/bitteam.js +5 -0
  149. package/js/src/bitvavo.js +4 -0
  150. package/js/src/blockchaincom.js +5 -1
  151. package/js/src/blofin.js +7 -0
  152. package/js/src/btcalpha.js +5 -0
  153. package/js/src/btcbox.js +3 -3
  154. package/js/src/btcmarkets.js +5 -0
  155. package/js/src/btcturk.js +3 -0
  156. package/js/src/bybit.d.ts +3 -3
  157. package/js/src/bybit.js +12 -2
  158. package/js/src/cex.js +2 -0
  159. package/js/src/coinbase.d.ts +4 -4
  160. package/js/src/coinbase.js +16 -8
  161. package/js/src/coinbaseexchange.js +5 -0
  162. package/js/src/coinbaseinternational.d.ts +1 -1
  163. package/js/src/coinbaseinternational.js +7 -3
  164. package/js/src/coincatch.js +4 -1
  165. package/js/src/coincheck.js +2 -0
  166. package/js/src/coinex.d.ts +1 -1
  167. package/js/src/coinex.js +6 -2
  168. package/js/src/coinlist.js +5 -0
  169. package/js/src/coinmate.js +5 -1
  170. package/js/src/coinmetro.js +29 -8
  171. package/js/src/coinone.js +4 -1
  172. package/js/src/coinsph.js +5 -1
  173. package/js/src/coinspot.js +2 -1
  174. package/js/src/cryptocom.js +5 -0
  175. package/js/src/currencycom.js +4 -1
  176. package/js/src/defx.js +5 -0
  177. package/js/src/delta.js +3 -0
  178. package/js/src/deribit.d.ts +5 -3
  179. package/js/src/deribit.js +37 -36
  180. package/js/src/digifinex.js +10 -5
  181. package/js/src/ellipx.d.ts +1 -1
  182. package/js/src/ellipx.js +9 -5
  183. package/js/src/exmo.d.ts +3 -3
  184. package/js/src/exmo.js +5 -2
  185. package/js/src/gate.js +5 -1
  186. package/js/src/gemini.js +3 -0
  187. package/js/src/hashkey.js +5 -4
  188. package/js/src/hitbtc.d.ts +2 -2
  189. package/js/src/hitbtc.js +4 -0
  190. package/js/src/hollaex.d.ts +2 -2
  191. package/js/src/hollaex.js +8 -2
  192. package/js/src/htx.d.ts +1 -1
  193. package/js/src/htx.js +15 -5
  194. package/js/src/huobijp.js +5 -0
  195. package/js/src/hyperliquid.d.ts +1 -1
  196. package/js/src/hyperliquid.js +9 -4
  197. package/js/src/idex.d.ts +1 -1
  198. package/js/src/idex.js +6 -2
  199. package/js/src/independentreserve.js +4 -0
  200. package/js/src/indodax.js +3 -0
  201. package/js/src/kraken.js +7 -5
  202. package/js/src/krakenfutures.js +5 -2
  203. package/js/src/kucoin.d.ts +2 -1
  204. package/js/src/kucoin.js +18 -10
  205. package/js/src/kucoinfutures.d.ts +1 -1
  206. package/js/src/kucoinfutures.js +5 -1
  207. package/js/src/kuna.js +3 -0
  208. package/js/src/latoken.js +4 -0
  209. package/js/src/lbank.js +6 -1
  210. package/js/src/luno.d.ts +1 -1
  211. package/js/src/luno.js +7 -2
  212. package/js/src/mercado.js +5 -1
  213. package/js/src/mexc.d.ts +1 -1
  214. package/js/src/mexc.js +36 -15
  215. package/js/src/ndax.js +7 -2
  216. package/js/src/novadax.js +6 -1
  217. package/js/src/oceanex.d.ts +2 -2
  218. package/js/src/oceanex.js +4 -0
  219. package/js/src/okcoin.js +6 -2
  220. package/js/src/okx.js +18 -4
  221. package/js/src/onetrading.d.ts +1 -1
  222. package/js/src/onetrading.js +6 -2
  223. package/js/src/oxfun.js +3 -0
  224. package/js/src/p2b.js +3 -0
  225. package/js/src/paradex.js +10 -4
  226. package/js/src/phemex.d.ts +1 -1
  227. package/js/src/phemex.js +12 -5
  228. package/js/src/poloniex.js +6 -3
  229. package/js/src/poloniexfutures.d.ts +1 -1
  230. package/js/src/poloniexfutures.js +5 -1
  231. package/js/src/pro/binance.js +4 -2
  232. package/js/src/pro/bitcoincom.js +1 -4
  233. package/js/src/pro/bitget.js +3 -3
  234. package/js/src/pro/bitopro.js +1 -1
  235. package/js/src/pro/blofin.js +8 -0
  236. package/js/src/pro/bybit.js +10 -2
  237. package/js/src/pro/cex.js +1 -1
  238. package/js/src/pro/coincatch.js +3 -3
  239. package/js/src/pro/coinex.js +4 -1
  240. package/js/src/pro/htx.d.ts +8 -8
  241. package/js/src/pro/htx.js +8 -8
  242. package/js/src/pro/mexc.js +3 -3
  243. package/js/src/pro/okx.js +1 -1
  244. package/js/src/probit.d.ts +1 -0
  245. package/js/src/probit.js +14 -9
  246. package/js/src/static_dependencies/node-fetch/headers.d.ts +5 -0
  247. package/js/src/static_dependencies/proxies/agent-base/helpers.d.ts +1 -0
  248. package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.d.ts +1 -0
  249. package/js/src/timex.js +5 -1
  250. package/js/src/tokocrypto.js +6 -1
  251. package/js/src/tradeogre.js +2 -0
  252. package/js/src/upbit.d.ts +2 -2
  253. package/js/src/upbit.js +3 -0
  254. package/js/src/vertex.js +71 -4
  255. package/js/src/wavesexchange.d.ts +2 -1
  256. package/js/src/wavesexchange.js +96 -3
  257. package/js/src/wazirx.js +61 -3
  258. package/js/src/whitebit.js +74 -4
  259. package/js/src/woo.d.ts +1 -1
  260. package/js/src/woo.js +15 -5
  261. package/js/src/woofipro.d.ts +1 -1
  262. package/js/src/woofipro.js +25 -9
  263. package/js/src/xt.js +117 -0
  264. package/js/src/yobit.d.ts +2 -2
  265. package/js/src/yobit.js +59 -0
  266. package/js/src/zaif.js +57 -0
  267. package/js/src/zonda.d.ts +1 -0
  268. package/js/src/zonda.js +58 -0
  269. package/package.json +25 -7
  270. package/dist/cjs/src/abstract/lykke.js +0 -9
  271. package/dist/cjs/src/lykke.js +0 -1401
  272. package/js/src/abstract/lykke.d.ts +0 -32
  273. package/js/src/abstract/lykke.js +0 -11
  274. package/js/src/hitbtc3.d.ts +0 -8
  275. package/js/src/hitbtc3.js +0 -20
  276. package/js/src/lykke.d.ts +0 -212
  277. package/js/src/lykke.js +0 -1402
package/js/src/paradex.js CHANGED
@@ -310,18 +310,21 @@ export default class paradex extends Exchange {
310
310
  'marginMode': false,
311
311
  'limit': 100,
312
312
  'daysBack': 100000,
313
- 'untilDays': 100000, // todo
313
+ 'untilDays': 100000,
314
+ 'symbolRequired': false,
314
315
  },
315
316
  'fetchOrder': {
316
317
  'marginMode': false,
317
318
  'trigger': false,
318
319
  'trailing': false,
320
+ 'symbolRequired': false,
319
321
  },
320
322
  'fetchOpenOrders': {
321
323
  'marginMode': false,
322
324
  'limit': 100,
323
325
  'trigger': false,
324
326
  'trailing': false,
327
+ 'symbolRequired': false,
325
328
  },
326
329
  'fetchOrders': {
327
330
  'marginMode': false,
@@ -330,6 +333,7 @@ export default class paradex extends Exchange {
330
333
  'untilDays': 100000,
331
334
  'trigger': false,
332
335
  'trailing': false,
336
+ 'symbolRequired': false,
333
337
  },
334
338
  'fetchClosedOrders': undefined,
335
339
  'fetchOHLCV': {
@@ -959,7 +963,7 @@ export default class paradex extends Exchange {
959
963
  //
960
964
  // {
961
965
  // "symbol": "BTC-USD-PERP",
962
- // "oracle_price": "68465.17449906",
966
+ // "oracle_price": "68465.17449904",
963
967
  // "mark_price": "68465.17449906",
964
968
  // "last_traded_price": "68495.1",
965
969
  // "bid": "68477.6",
@@ -1039,17 +1043,19 @@ export default class paradex extends Exchange {
1039
1043
  async prepareParadexDomain(l1 = false) {
1040
1044
  const systemConfig = await this.getSystemConfig();
1041
1045
  if (l1 === true) {
1042
- return {
1046
+ const l1D = {
1043
1047
  'name': 'Paradex',
1044
1048
  'chainId': systemConfig['l1_chain_id'],
1045
1049
  'version': '1',
1046
1050
  };
1051
+ return l1D;
1047
1052
  }
1048
- return {
1053
+ const domain = {
1049
1054
  'name': 'Paradex',
1050
1055
  'chainId': systemConfig['starknet_chain_id'],
1051
1056
  'version': 1,
1052
1057
  };
1058
+ return domain;
1053
1059
  }
1054
1060
  async retrieveAccount() {
1055
1061
  const cachedAccount = this.safeDict(this.options, 'paradexAccount');
@@ -157,7 +157,7 @@ export default class phemex extends Exchange {
157
157
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
158
158
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
159
159
  */
160
- editOrder(id: string, symbol: string, type?: OrderType, side?: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
160
+ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
161
161
  /**
162
162
  * @method
163
163
  * @name phemex#cancelOrder
package/js/src/phemex.js CHANGED
@@ -328,18 +328,21 @@ export default class phemex extends Exchange {
328
328
  'marginMode': false,
329
329
  'limit': 200,
330
330
  'daysBack': 100000,
331
- 'untilDays': 2, // todo implement
331
+ 'untilDays': 2,
332
+ 'symbolRequired': false,
332
333
  },
333
334
  'fetchOrder': {
334
335
  'marginMode': false,
335
336
  'trigger': false,
336
337
  'trailing': false,
338
+ 'symbolRequired': true,
337
339
  },
338
340
  'fetchOpenOrders': {
339
341
  'marginMode': false,
340
342
  'limit': undefined,
341
343
  'trigger': false,
342
344
  'trailing': false,
345
+ 'symbolRequired': true,
343
346
  },
344
347
  'fetchOrders': {
345
348
  'marginMode': false,
@@ -348,6 +351,7 @@ export default class phemex extends Exchange {
348
351
  'untilDays': undefined,
349
352
  'trigger': false,
350
353
  'trailing': false,
354
+ 'symbolRequired': true,
351
355
  },
352
356
  'fetchClosedOrders': {
353
357
  'marginMode': false,
@@ -357,6 +361,7 @@ export default class phemex extends Exchange {
357
361
  'untilDays': 2,
358
362
  'trigger': false,
359
363
  'trailing': false,
364
+ 'symbolRequired': false,
360
365
  },
361
366
  'fetchOHLCV': {
362
367
  'limit': 1000,
@@ -1271,7 +1276,7 @@ export default class phemex extends Exchange {
1271
1276
  return this.toEn(price, market['priceScale']);
1272
1277
  }
1273
1278
  fromEn(en, scale) {
1274
- if (en === undefined) {
1279
+ if (en === undefined || scale === undefined) {
1275
1280
  return undefined;
1276
1281
  }
1277
1282
  const precise = new Precise(en);
@@ -2237,8 +2242,10 @@ export default class phemex extends Exchange {
2237
2242
  // }
2238
2243
  // }
2239
2244
  //
2240
- const result = (type === 'swap') ? this.parseSwapBalance(response) : this.parseSpotBalance(response);
2241
- return result;
2245
+ if (type === 'swap') {
2246
+ return this.parseSwapBalance(response);
2247
+ }
2248
+ return this.parseSpotBalance(response);
2242
2249
  }
2243
2250
  parseOrderStatus(status) {
2244
2251
  const statuses = {
@@ -2942,7 +2949,7 @@ export default class phemex extends Exchange {
2942
2949
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
2943
2950
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2944
2951
  */
2945
- async editOrder(id, symbol, type = undefined, side = undefined, amount = undefined, price = undefined, params = {}) {
2952
+ async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
2946
2953
  await this.loadMarkets();
2947
2954
  const market = this.market(symbol);
2948
2955
  const request = {
@@ -305,17 +305,20 @@ export default class poloniex extends Exchange {
305
305
  'limit': 1000,
306
306
  'daysBack': 100000,
307
307
  'untilDays': 100000,
308
+ 'symbolRequired': false,
308
309
  },
309
310
  'fetchOrder': {
310
311
  'marginMode': false,
311
312
  'trigger': false,
312
313
  'trailing': false,
314
+ 'symbolRequired': false,
313
315
  },
314
316
  'fetchOpenOrders': {
315
317
  'marginMode': false,
316
318
  'limit': 2000,
317
319
  'trigger': false,
318
320
  'trailing': false,
321
+ 'symbolRequired': false,
319
322
  },
320
323
  'fetchOrders': undefined,
321
324
  'fetchClosedOrders': undefined,
@@ -1825,7 +1828,7 @@ export default class poloniex extends Exchange {
1825
1828
  let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
1826
1829
  network = this.safeString(networks, network, network); // handle ERC20>ETH alias
1827
1830
  if (network !== undefined) {
1828
- request['currency'] += network; // when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
1831
+ request['currency'] = request['currency'] + network; // when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
1829
1832
  params = this.omit(params, 'network');
1830
1833
  }
1831
1834
  else {
@@ -1876,7 +1879,7 @@ export default class poloniex extends Exchange {
1876
1879
  let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
1877
1880
  network = this.safeString(networks, network, network); // handle ERC20>ETH alias
1878
1881
  if (network !== undefined) {
1879
- request['currency'] += network; // when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
1882
+ request['currency'] = request['currency'] + network; // when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
1880
1883
  params = this.omit(params, 'network');
1881
1884
  }
1882
1885
  else {
@@ -1987,7 +1990,7 @@ export default class poloniex extends Exchange {
1987
1990
  let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
1988
1991
  network = this.safeString(networks, network, network); // handle ERC20>ETH alias
1989
1992
  if (network !== undefined) {
1990
- request['currency'] += network; // when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
1993
+ request['currency'] = request['currency'] + network; // when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
1991
1994
  params = this.omit(params, 'network');
1992
1995
  }
1993
1996
  const response = await this.privatePostWalletsWithdraw(this.extend(request, params));
@@ -260,7 +260,7 @@ export default class poloniexfutures extends Exchange {
260
260
  * @param {object} [params] extra parameters specific to the exchange API endpoint
261
261
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
262
262
  */
263
- fetchOrder(id?: Str, symbol?: Str, params?: {}): Promise<Order>;
263
+ fetchOrder(id: Str, symbol?: Str, params?: {}): Promise<Order>;
264
264
  parseOrder(order: Dict, market?: Market): Order;
265
265
  /**
266
266
  * @method
@@ -217,17 +217,20 @@ export default class poloniexfutures extends Exchange {
217
217
  'limit': undefined,
218
218
  'daysBack': 100000,
219
219
  'untilDays': 7,
220
+ 'symbolRequired': false,
220
221
  },
221
222
  'fetchOrder': {
222
223
  'marginMode': false,
223
224
  'trigger': false,
224
225
  'trailing': false,
226
+ 'symbolRequired': false,
225
227
  },
226
228
  'fetchOpenOrders': {
227
229
  'marginMode': true,
228
230
  'limit': undefined,
229
231
  'trigger': false,
230
232
  'trailing': false,
233
+ 'symbolRequired': false,
231
234
  },
232
235
  'fetchOrders': undefined,
233
236
  'fetchClosedOrders': {
@@ -238,6 +241,7 @@ export default class poloniexfutures extends Exchange {
238
241
  'untilDays': 100000,
239
242
  'trigger': false,
240
243
  'trailing': false,
244
+ 'symbolRequired': false,
241
245
  },
242
246
  'fetchOHLCV': {
243
247
  'limit': 200, // todo implement
@@ -1500,7 +1504,7 @@ export default class poloniexfutures extends Exchange {
1500
1504
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1501
1505
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1502
1506
  */
1503
- async fetchOrder(id = undefined, symbol = undefined, params = {}) {
1507
+ async fetchOrder(id, symbol = undefined, params = {}) {
1504
1508
  await this.loadMarkets();
1505
1509
  const request = {};
1506
1510
  let response = undefined;
@@ -249,7 +249,7 @@ export default class binance extends binanceRest {
249
249
  let type = undefined;
250
250
  [type, params] = this.handleMarketTypeAndParams('watchLiquidationsForSymbols', firstMarket, params);
251
251
  if (type === 'spot') {
252
- throw new BadRequest(this.id + 'watchLiquidationsForSymbols is not supported for spot symbols');
252
+ throw new BadRequest(this.id + ' watchLiquidationsForSymbols is not supported for spot symbols');
253
253
  }
254
254
  let subType = undefined;
255
255
  [subType, params] = this.handleSubTypeAndParams('watchLiquidationsForSymbols', firstMarket, params);
@@ -2361,6 +2361,7 @@ export default class binance extends binanceRest {
2361
2361
  let response = undefined;
2362
2362
  if (isPortfolioMargin) {
2363
2363
  response = await this.papiPostListenKey(params);
2364
+ params = this.extend(params, { 'portfolioMargin': true });
2364
2365
  }
2365
2366
  else if (type === 'future') {
2366
2367
  response = await this.fapiPrivatePostListenKey(params);
@@ -2416,6 +2417,7 @@ export default class binance extends binanceRest {
2416
2417
  try {
2417
2418
  if (isPortfolioMargin) {
2418
2419
  await this.papiPutListenKey(this.extend(request, params));
2420
+ params = this.extend(params, { 'portfolioMargin': true });
2419
2421
  }
2420
2422
  else if (type === 'future') {
2421
2423
  await this.fapiPrivatePutListenKey(this.extend(request, params));
@@ -3967,7 +3969,7 @@ export default class binance extends binanceRest {
3967
3969
  }
3968
3970
  const fromId = this.safeInteger(params, 'fromId');
3969
3971
  if (fromId !== undefined && since !== undefined) {
3970
- throw new BadRequest(this.id + 'fetchMyTradesWs does not support fetching by both fromId and since parameters at the same time');
3972
+ throw new BadRequest(this.id + ' fetchMyTradesWs does not support fetching by both fromId and since parameters at the same time');
3971
3973
  }
3972
3974
  const message = {
3973
3975
  'id': messageHash,
@@ -20,10 +20,7 @@ export default class bitcoincom extends hitbtc {
20
20
  'urls': {
21
21
  'logo': 'https://user-images.githubusercontent.com/1294454/97296144-514fa300-1861-11eb-952b-3d55d492200b.jpg',
22
22
  'api': {
23
- 'ws': {
24
- 'public': 'wss://api.fmfw.io/api/3/ws/public',
25
- 'private': 'wss://api.fmfw.io/api/3/ws/trading',
26
- },
23
+ 'ws': 'wss://api.fmfw.io/api/2/ws',
27
24
  },
28
25
  },
29
26
  'fees': {
@@ -2020,7 +2020,7 @@ export default class bitget extends bitgetRest {
2020
2020
  if (messageHash in client.subscriptions) {
2021
2021
  delete client.subscriptions[messageHash];
2022
2022
  }
2023
- const error = new UnsubscribeError(this.id + 'orderbook ' + symbol);
2023
+ const error = new UnsubscribeError(this.id + ' orderbook ' + symbol);
2024
2024
  client.reject(error, subMessageHash);
2025
2025
  client.resolve(true, messageHash);
2026
2026
  }
@@ -2045,7 +2045,7 @@ export default class bitget extends bitgetRest {
2045
2045
  if (messageHash in client.subscriptions) {
2046
2046
  delete client.subscriptions[messageHash];
2047
2047
  }
2048
- const error = new UnsubscribeError(this.id + 'trades ' + symbol);
2048
+ const error = new UnsubscribeError(this.id + ' trades ' + symbol);
2049
2049
  client.reject(error, subMessageHash);
2050
2050
  client.resolve(true, messageHash);
2051
2051
  }
@@ -2070,7 +2070,7 @@ export default class bitget extends bitgetRest {
2070
2070
  if (messageHash in client.subscriptions) {
2071
2071
  delete client.subscriptions[messageHash];
2072
2072
  }
2073
- const error = new UnsubscribeError(this.id + 'ticker ' + symbol);
2073
+ const error = new UnsubscribeError(this.id + ' ticker ' + symbol);
2074
2074
  client.reject(error, subMessageHash);
2075
2075
  client.resolve(true, messageHash);
2076
2076
  }
@@ -77,7 +77,7 @@ export default class bitopro extends bitoproRest {
77
77
  endPart = market['id'];
78
78
  }
79
79
  else {
80
- endPart = market['id'] + ':' + this.numberToString(limit);
80
+ endPart = market['id'] + ':' + limit;
81
81
  }
82
82
  const orderbook = await this.watchPublic('order-books', messageHash, endPart);
83
83
  return orderbook.limit();
@@ -37,6 +37,14 @@ export default class blofin extends blofinRest {
37
37
  },
38
38
  },
39
39
  },
40
+ 'test': {
41
+ 'ws': {
42
+ 'swap': {
43
+ 'public': 'wss://demo-trading-openapi.blofin.com/ws/public',
44
+ 'private': 'wss://demo-trading-openapi.blofin.com/ws/private',
45
+ },
46
+ },
47
+ },
40
48
  },
41
49
  'options': {
42
50
  'defaultType': 'swap',
@@ -850,11 +850,19 @@ export default class bybit extends bybitRest {
850
850
  const market = this.market(symbols[0]);
851
851
  if (limit === undefined) {
852
852
  limit = (market['spot']) ? 50 : 500;
853
+ if (market['option']) {
854
+ limit = 100;
855
+ }
853
856
  }
854
857
  else {
855
858
  if (!market['spot']) {
856
- // bybit only support limit 1, 50, 200, 500 for contract
857
- if ((limit !== 1) && (limit !== 50) && (limit !== 200) && (limit !== 500)) {
859
+ if (market['option']) {
860
+ if ((limit !== 25) && (limit !== 100)) {
861
+ throw new BadRequest(this.id + ' watchOrderBookForSymbols() can only use limit 25 and 100 for option markets.');
862
+ }
863
+ }
864
+ else if ((limit !== 1) && (limit !== 50) && (limit !== 200) && (limit !== 500)) {
865
+ // bybit only support limit 1, 50, 200, 500 for contract
858
866
  throw new BadRequest(this.id + ' watchOrderBookForSymbols() can only use limit 1, 50, 200 and 500.');
859
867
  }
860
868
  }
package/js/src/pro/cex.js CHANGED
@@ -1232,7 +1232,7 @@ export default class cex extends cexRest {
1232
1232
  */
1233
1233
  async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1234
1234
  if (symbol === undefined) {
1235
- throw new ArgumentsRequired(this.id + 'fetchOpenOrdersWs requires a symbol.');
1235
+ throw new ArgumentsRequired(this.id + ' fetchOpenOrdersWs requires a symbol.');
1236
1236
  }
1237
1237
  await this.loadMarkets();
1238
1238
  await this.authenticate();
@@ -1491,7 +1491,7 @@ export default class coincatch extends coincatchRest {
1491
1491
  if (messageHash in client.subscriptions) {
1492
1492
  delete client.subscriptions[messageHash];
1493
1493
  }
1494
- const error = new UnsubscribeError(this.id + 'orderbook ' + symbol);
1494
+ const error = new UnsubscribeError(this.id + ' orderbook ' + symbol);
1495
1495
  client.reject(error, subMessageHash);
1496
1496
  client.resolve(true, messageHash);
1497
1497
  }
@@ -1513,7 +1513,7 @@ export default class coincatch extends coincatchRest {
1513
1513
  if (messageHash in client.subscriptions) {
1514
1514
  delete client.subscriptions[messageHash];
1515
1515
  }
1516
- const error = new UnsubscribeError(this.id + 'trades ' + symbol);
1516
+ const error = new UnsubscribeError(this.id + ' trades ' + symbol);
1517
1517
  client.reject(error, subMessageHash);
1518
1518
  client.resolve(true, messageHash);
1519
1519
  }
@@ -1535,7 +1535,7 @@ export default class coincatch extends coincatchRest {
1535
1535
  if (messageHash in client.subscriptions) {
1536
1536
  delete client.subscriptions[messageHash];
1537
1537
  }
1538
- const error = new UnsubscribeError(this.id + 'ticker ' + symbol);
1538
+ const error = new UnsubscribeError(this.id + ' ticker ' + symbol);
1539
1539
  client.reject(error, subMessageHash);
1540
1540
  client.resolve(true, messageHash);
1541
1541
  }
@@ -256,7 +256,10 @@ export default class coinex extends coinexRest {
256
256
  [type, params] = this.handleMarketTypeAndParams('watchBalance', undefined, params, 'spot');
257
257
  await this.authenticate(type);
258
258
  const url = this.urls['api']['ws'][type];
259
- let currencies = Object.keys(this.currencies_by_id);
259
+ // coinex throws a closes the websocket when subscribing over 1422 currencies, therefore we filter out inactive currencies
260
+ const activeCurrencies = this.filterBy(this.currencies_by_id, 'active', true);
261
+ const activeCurrenciesById = this.indexBy(activeCurrencies, 'id');
262
+ let currencies = Object.keys(activeCurrenciesById);
260
263
  if (currencies === undefined) {
261
264
  currencies = [];
262
265
  }
@@ -6,7 +6,7 @@ export default class htx extends htxRest {
6
6
  requestId(): any;
7
7
  /**
8
8
  * @method
9
- * @name huobi#watchTicker
9
+ * @name htx#watchTicker
10
10
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
11
11
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53561-7773-11ed-9966-0242ac110003
12
12
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33ab2-77ae-11ed-9966-0242ac110003
@@ -18,7 +18,7 @@ export default class htx extends htxRest {
18
18
  handleTicker(client: Client, message: any): any;
19
19
  /**
20
20
  * @method
21
- * @name huobi#watchTrades
21
+ * @name htx#watchTrades
22
22
  * @description get the list of most recent trades for a particular symbol
23
23
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53b69-7773-11ed-9966-0242ac110003
24
24
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33c21-77ae-11ed-9966-0242ac110003
@@ -33,7 +33,7 @@ export default class htx extends htxRest {
33
33
  handleTrades(client: Client, message: any): any;
34
34
  /**
35
35
  * @method
36
- * @name huobi#watchOHLCV
36
+ * @name htx#watchOHLCV
37
37
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
38
38
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53241-7773-11ed-9966-0242ac110003
39
39
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c3346a-77ae-11ed-9966-0242ac110003
@@ -49,7 +49,7 @@ export default class htx extends htxRest {
49
49
  handleOHLCV(client: Client, message: any): void;
50
50
  /**
51
51
  * @method
52
- * @name huobi#watchOrderBook
52
+ * @name htx#watchOrderBook
53
53
  * @see https://huobiapi.github.io/docs/dm/v1/en/#subscribe-market-depth-data
54
54
  * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#subscribe-incremental-market-depth-data
55
55
  * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-subscribe-incremental-market-depth-data
@@ -69,7 +69,7 @@ export default class htx extends htxRest {
69
69
  handleOrderBookSubscription(client: Client, message: any, subscription: any): void;
70
70
  /**
71
71
  * @method
72
- * @name huobi#watchMyTrades
72
+ * @name htx#watchMyTrades
73
73
  * @description watches information on multiple trades made by the user
74
74
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53dd5-7773-11ed-9966-0242ac110003
75
75
  * @param {string} symbol unified market symbol of the market trades were made in
@@ -82,7 +82,7 @@ export default class htx extends htxRest {
82
82
  getOrderChannelAndMessageHash(type: any, subType: any, market?: any, params?: {}): any[];
83
83
  /**
84
84
  * @method
85
- * @name huobi#watchOrders
85
+ * @name htx#watchOrders
86
86
  * @description watches information on multiple orders made by the user
87
87
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53c8f-7773-11ed-9966-0242ac110003
88
88
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -97,7 +97,7 @@ export default class htx extends htxRest {
97
97
  parseOrderTrade(trade: any, market?: any): Trade;
98
98
  /**
99
99
  * @method
100
- * @name huobi#watchPositions
100
+ * @name htx#watchPositions
101
101
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7de1c-77b5-11ed-9966-0242ac110003
102
102
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7df0f-77b5-11ed-9966-0242ac110003
103
103
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
@@ -113,7 +113,7 @@ export default class htx extends htxRest {
113
113
  handlePositions(client: any, message: any): void;
114
114
  /**
115
115
  * @method
116
- * @name huobi#watchBalance
116
+ * @name htx#watchBalance
117
117
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
118
118
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec52e28-7773-11ed-9966-0242ac110003
119
119
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000084-77b7-11ed-9966-0242ac110003
package/js/src/pro/htx.js CHANGED
@@ -132,7 +132,7 @@ export default class htx extends htxRest {
132
132
  }
133
133
  /**
134
134
  * @method
135
- * @name huobi#watchTicker
135
+ * @name htx#watchTicker
136
136
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
137
137
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53561-7773-11ed-9966-0242ac110003
138
138
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33ab2-77ae-11ed-9966-0242ac110003
@@ -202,7 +202,7 @@ export default class htx extends htxRest {
202
202
  }
203
203
  /**
204
204
  * @method
205
- * @name huobi#watchTrades
205
+ * @name htx#watchTrades
206
206
  * @description get the list of most recent trades for a particular symbol
207
207
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53b69-7773-11ed-9966-0242ac110003
208
208
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33c21-77ae-11ed-9966-0242ac110003
@@ -268,7 +268,7 @@ export default class htx extends htxRest {
268
268
  }
269
269
  /**
270
270
  * @method
271
- * @name huobi#watchOHLCV
271
+ * @name htx#watchOHLCV
272
272
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
273
273
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53241-7773-11ed-9966-0242ac110003
274
274
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c3346a-77ae-11ed-9966-0242ac110003
@@ -331,7 +331,7 @@ export default class htx extends htxRest {
331
331
  }
332
332
  /**
333
333
  * @method
334
- * @name huobi#watchOrderBook
334
+ * @name htx#watchOrderBook
335
335
  * @see https://huobiapi.github.io/docs/dm/v1/en/#subscribe-market-depth-data
336
336
  * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#subscribe-incremental-market-depth-data
337
337
  * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-subscribe-incremental-market-depth-data
@@ -677,7 +677,7 @@ export default class htx extends htxRest {
677
677
  }
678
678
  /**
679
679
  * @method
680
- * @name huobi#watchMyTrades
680
+ * @name htx#watchMyTrades
681
681
  * @description watches information on multiple trades made by the user
682
682
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53dd5-7773-11ed-9966-0242ac110003
683
683
  * @param {string} symbol unified market symbol of the market trades were made in
@@ -781,7 +781,7 @@ export default class htx extends htxRest {
781
781
  }
782
782
  /**
783
783
  * @method
784
- * @name huobi#watchOrders
784
+ * @name htx#watchOrders
785
785
  * @description watches information on multiple orders made by the user
786
786
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53c8f-7773-11ed-9966-0242ac110003
787
787
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1235,7 +1235,7 @@ export default class htx extends htxRest {
1235
1235
  }
1236
1236
  /**
1237
1237
  * @method
1238
- * @name huobi#watchPositions
1238
+ * @name htx#watchPositions
1239
1239
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7de1c-77b5-11ed-9966-0242ac110003
1240
1240
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7df0f-77b5-11ed-9966-0242ac110003
1241
1241
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
@@ -1358,7 +1358,7 @@ export default class htx extends htxRest {
1358
1358
  }
1359
1359
  /**
1360
1360
  * @method
1361
- * @name huobi#watchBalance
1361
+ * @name htx#watchBalance
1362
1362
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
1363
1363
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec52e28-7773-11ed-9966-0242ac110003
1364
1364
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000084-77b7-11ed-9966-0242ac110003
@@ -226,7 +226,7 @@ export default class mexc extends mexcRest {
226
226
  const topics = [];
227
227
  if (!miniTicker) {
228
228
  if (symbols === undefined) {
229
- throw new ArgumentsRequired(this.id + 'watchTickers required symbols argument for the bookTicker channel');
229
+ throw new ArgumentsRequired(this.id + ' watchTickers required symbols argument for the bookTicker channel');
230
230
  }
231
231
  const marketIds = this.marketIds(symbols);
232
232
  for (let i = 0; i < marketIds.length; i++) {
@@ -420,13 +420,13 @@ export default class mexc extends mexcRest {
420
420
  symbols = this.marketSymbols(symbols, undefined, true, false, true);
421
421
  let marketType = undefined;
422
422
  if (symbols === undefined) {
423
- throw new ArgumentsRequired(this.id + 'watchBidsAsks required symbols argument');
423
+ throw new ArgumentsRequired(this.id + ' watchBidsAsks required symbols argument');
424
424
  }
425
425
  const markets = this.marketsForSymbols(symbols);
426
426
  [marketType, params] = this.handleMarketTypeAndParams('watchBidsAsks', markets[0], params);
427
427
  const isSpot = marketType === 'spot';
428
428
  if (!isSpot) {
429
- throw new NotSupported(this.id + 'watchBidsAsks only support spot market');
429
+ throw new NotSupported(this.id + ' watchBidsAsks only support spot market');
430
430
  }
431
431
  const messageHashes = [];
432
432
  const topics = [];
package/js/src/pro/okx.js CHANGED
@@ -2197,7 +2197,7 @@ export default class okx extends okxRest {
2197
2197
  await this.authenticate();
2198
2198
  const market = this.market(symbol);
2199
2199
  if (market['type'] !== 'option') {
2200
- throw new BadRequest(this.id + 'cancelAllOrdersWs is only applicable to Option in Portfolio Margin mode, and MMP privilege is required.');
2200
+ throw new BadRequest(this.id + ' cancelAllOrdersWs is only applicable to Option in Portfolio Margin mode, and MMP privilege is required.');
2201
2201
  }
2202
2202
  const url = this.getUrl('private', 'private');
2203
2203
  const messageHash = this.requestId();
@@ -112,6 +112,7 @@ export default class probit extends Exchange {
112
112
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
113
113
  * @param {int} [limit] the maximum amount of candles to fetch
114
114
  * @param {object} [params] extra parameters specific to the exchange API endpoint
115
+ * @param {string} [params.until] timestamp in ms of the earliest candle to fetch
115
116
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
116
117
  */
117
118
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;