ccxt 4.4.52__py2.py3-none-any.whl → 4.4.57__py2.py3-none-any.whl

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 (223) hide show
  1. ccxt/__init__.py +1 -3
  2. ccxt/abstract/binance.py +0 -1
  3. ccxt/abstract/binancecoinm.py +0 -1
  4. ccxt/abstract/binanceus.py +0 -1
  5. ccxt/abstract/binanceusdm.py +0 -1
  6. ccxt/ace.py +3 -0
  7. ccxt/alpaca.py +5 -0
  8. ccxt/ascendex.py +2 -1
  9. ccxt/async_support/__init__.py +1 -3
  10. ccxt/async_support/ace.py +3 -0
  11. ccxt/async_support/alpaca.py +5 -0
  12. ccxt/async_support/ascendex.py +2 -1
  13. ccxt/async_support/base/exchange.py +24 -7
  14. ccxt/async_support/bigone.py +5 -0
  15. ccxt/async_support/binance.py +54 -54
  16. ccxt/async_support/bingx.py +25 -29
  17. ccxt/async_support/bit2c.py +3 -0
  18. ccxt/async_support/bitbank.py +3 -0
  19. ccxt/async_support/bitbns.py +3 -0
  20. ccxt/async_support/bitfinex.py +6 -1
  21. ccxt/async_support/bitflyer.py +6 -1
  22. ccxt/async_support/bitget.py +9 -5
  23. ccxt/async_support/bithumb.py +3 -1
  24. ccxt/async_support/bitmart.py +22 -12
  25. ccxt/async_support/bitmex.py +99 -93
  26. ccxt/async_support/bitopro.py +7 -2
  27. ccxt/async_support/bitrue.py +4 -0
  28. ccxt/async_support/bitso.py +5 -2
  29. ccxt/async_support/bitstamp.py +3 -0
  30. ccxt/async_support/bitteam.py +5 -0
  31. ccxt/async_support/bitvavo.py +4 -0
  32. ccxt/async_support/blockchaincom.py +4 -0
  33. ccxt/async_support/blofin.py +3 -0
  34. ccxt/async_support/btcalpha.py +5 -0
  35. ccxt/async_support/btcbox.py +3 -2
  36. ccxt/async_support/btcmarkets.py +5 -0
  37. ccxt/async_support/btcturk.py +3 -0
  38. ccxt/async_support/bybit.py +13 -5
  39. ccxt/async_support/cex.py +2 -0
  40. ccxt/async_support/coinbase.py +20 -13
  41. ccxt/async_support/coinbaseexchange.py +5 -0
  42. ccxt/async_support/coinbaseinternational.py +23 -4
  43. ccxt/async_support/coincatch.py +3 -0
  44. ccxt/async_support/coincheck.py +2 -0
  45. ccxt/async_support/coinex.py +6 -2
  46. ccxt/async_support/coinlist.py +5 -0
  47. ccxt/async_support/coinmate.py +4 -0
  48. ccxt/async_support/coinmetro.py +9 -5
  49. ccxt/async_support/coinone.py +3 -0
  50. ccxt/async_support/coinsph.py +4 -0
  51. ccxt/async_support/coinspot.py +1 -0
  52. ccxt/async_support/cryptocom.py +5 -0
  53. ccxt/async_support/currencycom.py +3 -0
  54. ccxt/async_support/defx.py +5 -0
  55. ccxt/async_support/delta.py +4 -1
  56. ccxt/async_support/deribit.py +15 -28
  57. ccxt/async_support/digifinex.py +10 -5
  58. ccxt/async_support/ellipx.py +9 -5
  59. ccxt/async_support/exmo.py +7 -4
  60. ccxt/async_support/gate.py +5 -1
  61. ccxt/async_support/gemini.py +3 -0
  62. ccxt/async_support/hashkey.py +5 -4
  63. ccxt/async_support/hitbtc.py +6 -2
  64. ccxt/async_support/hollaex.py +7 -2
  65. ccxt/async_support/htx.py +8 -1
  66. ccxt/async_support/huobijp.py +5 -0
  67. ccxt/async_support/hyperliquid.py +9 -4
  68. ccxt/async_support/idex.py +5 -1
  69. ccxt/async_support/independentreserve.py +4 -0
  70. ccxt/async_support/indodax.py +3 -0
  71. ccxt/async_support/kraken.py +7 -5
  72. ccxt/async_support/krakenfutures.py +5 -2
  73. ccxt/async_support/kucoin.py +13 -6
  74. ccxt/async_support/kucoinfutures.py +5 -1
  75. ccxt/async_support/kuna.py +3 -0
  76. ccxt/async_support/latoken.py +4 -0
  77. ccxt/async_support/lbank.py +6 -1
  78. ccxt/async_support/luno.py +6 -1
  79. ccxt/async_support/mercado.py +4 -0
  80. ccxt/async_support/mexc.py +10 -9
  81. ccxt/async_support/ndax.py +6 -1
  82. ccxt/async_support/novadax.py +5 -0
  83. ccxt/async_support/oceanex.py +6 -2
  84. ccxt/async_support/okcoin.py +4 -0
  85. ccxt/async_support/okx.py +17 -5
  86. ccxt/async_support/onetrading.py +4 -0
  87. ccxt/async_support/oxfun.py +3 -0
  88. ccxt/async_support/p2b.py +3 -0
  89. ccxt/async_support/paradex.py +8 -2
  90. ccxt/async_support/phemex.py +10 -4
  91. ccxt/async_support/poloniex.py +6 -3
  92. ccxt/async_support/poloniexfutures.py +5 -1
  93. ccxt/async_support/probit.py +4 -0
  94. ccxt/async_support/timex.py +4 -0
  95. ccxt/async_support/tokocrypto.py +5 -0
  96. ccxt/async_support/tradeogre.py +2 -0
  97. ccxt/async_support/upbit.py +5 -2
  98. ccxt/async_support/vertex.py +6 -2
  99. ccxt/async_support/wavesexchange.py +20 -3
  100. ccxt/async_support/wazirx.py +2 -0
  101. ccxt/async_support/whitebit.py +5 -4
  102. ccxt/async_support/woo.py +15 -5
  103. ccxt/async_support/woofipro.py +23 -9
  104. ccxt/async_support/xt.py +5 -0
  105. ccxt/async_support/yobit.py +5 -2
  106. ccxt/async_support/zaif.py +2 -0
  107. ccxt/async_support/zonda.py +2 -0
  108. ccxt/base/exchange.py +96 -54
  109. ccxt/base/types.py +1 -1
  110. ccxt/bigone.py +5 -0
  111. ccxt/binance.py +54 -54
  112. ccxt/bingx.py +25 -29
  113. ccxt/bit2c.py +3 -0
  114. ccxt/bitbank.py +3 -0
  115. ccxt/bitbns.py +3 -0
  116. ccxt/bitfinex.py +6 -1
  117. ccxt/bitflyer.py +6 -1
  118. ccxt/bitget.py +9 -5
  119. ccxt/bithumb.py +3 -1
  120. ccxt/bitmart.py +22 -12
  121. ccxt/bitmex.py +99 -93
  122. ccxt/bitopro.py +7 -2
  123. ccxt/bitrue.py +4 -0
  124. ccxt/bitso.py +5 -2
  125. ccxt/bitstamp.py +3 -0
  126. ccxt/bitteam.py +5 -0
  127. ccxt/bitvavo.py +4 -0
  128. ccxt/blockchaincom.py +4 -0
  129. ccxt/blofin.py +3 -0
  130. ccxt/btcalpha.py +5 -0
  131. ccxt/btcbox.py +3 -2
  132. ccxt/btcmarkets.py +5 -0
  133. ccxt/btcturk.py +3 -0
  134. ccxt/bybit.py +13 -5
  135. ccxt/cex.py +2 -0
  136. ccxt/coinbase.py +20 -13
  137. ccxt/coinbaseexchange.py +5 -0
  138. ccxt/coinbaseinternational.py +23 -4
  139. ccxt/coincatch.py +3 -0
  140. ccxt/coincheck.py +2 -0
  141. ccxt/coinex.py +6 -2
  142. ccxt/coinlist.py +5 -0
  143. ccxt/coinmate.py +4 -0
  144. ccxt/coinmetro.py +9 -5
  145. ccxt/coinone.py +3 -0
  146. ccxt/coinsph.py +4 -0
  147. ccxt/coinspot.py +1 -0
  148. ccxt/cryptocom.py +5 -0
  149. ccxt/currencycom.py +3 -0
  150. ccxt/defx.py +5 -0
  151. ccxt/delta.py +4 -1
  152. ccxt/deribit.py +15 -28
  153. ccxt/digifinex.py +10 -5
  154. ccxt/ellipx.py +9 -5
  155. ccxt/exmo.py +7 -4
  156. ccxt/gate.py +5 -1
  157. ccxt/gemini.py +3 -0
  158. ccxt/hashkey.py +5 -4
  159. ccxt/hitbtc.py +6 -2
  160. ccxt/hollaex.py +7 -2
  161. ccxt/htx.py +8 -1
  162. ccxt/huobijp.py +5 -0
  163. ccxt/hyperliquid.py +9 -4
  164. ccxt/idex.py +5 -1
  165. ccxt/independentreserve.py +4 -0
  166. ccxt/indodax.py +3 -0
  167. ccxt/kraken.py +7 -5
  168. ccxt/krakenfutures.py +5 -2
  169. ccxt/kucoin.py +13 -6
  170. ccxt/kucoinfutures.py +5 -1
  171. ccxt/kuna.py +3 -0
  172. ccxt/latoken.py +4 -0
  173. ccxt/lbank.py +6 -1
  174. ccxt/luno.py +6 -1
  175. ccxt/mercado.py +4 -0
  176. ccxt/mexc.py +10 -9
  177. ccxt/ndax.py +6 -1
  178. ccxt/novadax.py +5 -0
  179. ccxt/oceanex.py +6 -2
  180. ccxt/okcoin.py +4 -0
  181. ccxt/okx.py +17 -5
  182. ccxt/onetrading.py +4 -0
  183. ccxt/oxfun.py +3 -0
  184. ccxt/p2b.py +3 -0
  185. ccxt/paradex.py +8 -2
  186. ccxt/phemex.py +10 -4
  187. ccxt/poloniex.py +6 -3
  188. ccxt/poloniexfutures.py +5 -1
  189. ccxt/pro/__init__.py +1 -1
  190. ccxt/pro/binance.py +2 -2
  191. ccxt/pro/bitcoincom.py +1 -4
  192. ccxt/pro/bitget.py +3 -3
  193. ccxt/pro/bitopro.py +1 -1
  194. ccxt/pro/bybit.py +7 -2
  195. ccxt/pro/cex.py +1 -1
  196. ccxt/pro/coincatch.py +3 -3
  197. ccxt/pro/mexc.py +3 -3
  198. ccxt/pro/okx.py +1 -1
  199. ccxt/probit.py +4 -0
  200. ccxt/test/tests_async.py +57 -30
  201. ccxt/test/tests_sync.py +57 -30
  202. ccxt/timex.py +4 -0
  203. ccxt/tokocrypto.py +5 -0
  204. ccxt/tradeogre.py +2 -0
  205. ccxt/upbit.py +5 -2
  206. ccxt/vertex.py +6 -2
  207. ccxt/wavesexchange.py +20 -3
  208. ccxt/wazirx.py +2 -0
  209. ccxt/whitebit.py +5 -4
  210. ccxt/woo.py +15 -5
  211. ccxt/woofipro.py +23 -9
  212. ccxt/xt.py +5 -0
  213. ccxt/yobit.py +5 -2
  214. ccxt/zaif.py +2 -0
  215. ccxt/zonda.py +2 -0
  216. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/METADATA +225 -143
  217. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/RECORD +220 -223
  218. ccxt/abstract/lykke.py +0 -29
  219. ccxt/async_support/lykke.py +0 -1370
  220. ccxt/lykke.py +0 -1370
  221. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/LICENSE.txt +0 -0
  222. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/WHEEL +0 -0
  223. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/top_level.txt +0 -0
ccxt/kucoin.py CHANGED
@@ -1039,17 +1039,20 @@ class kucoin(Exchange, ImplicitAPI):
1039
1039
  'limit': None,
1040
1040
  'daysBack': None,
1041
1041
  'untilDays': 7, # per implementation comments
1042
+ 'symbolRequired': True,
1042
1043
  },
1043
1044
  'fetchOrder': {
1044
1045
  'marginMode': False,
1045
1046
  'trigger': True,
1046
1047
  'trailing': False,
1048
+ 'symbolRequired': True,
1047
1049
  },
1048
1050
  'fetchOpenOrders': {
1049
1051
  'marginMode': True,
1050
1052
  'limit': 500,
1051
1053
  'trigger': True,
1052
1054
  'trailing': False,
1055
+ 'symbolRequired': True,
1053
1056
  },
1054
1057
  'fetchOrders': None,
1055
1058
  'fetchClosedOrders': {
@@ -1060,6 +1063,7 @@ class kucoin(Exchange, ImplicitAPI):
1060
1063
  'untilDays': 7,
1061
1064
  'trigger': True,
1062
1065
  'trailing': False,
1066
+ 'symbolRequired': True,
1063
1067
  },
1064
1068
  'fetchOHLCV': {
1065
1069
  'limit': 1500,
@@ -1325,10 +1329,12 @@ class kucoin(Exchange, ImplicitAPI):
1325
1329
 
1326
1330
  https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
1327
1331
 
1332
+ :returns any: ignore
1328
1333
  """
1329
1334
  if not ('hf' in self.options) or (self.options['hf'] is None) or force:
1330
1335
  result: dict = self.privateGetHfAccountsOpened()
1331
1336
  self.options['hf'] = self.safe_bool(result, 'data')
1337
+ return True
1332
1338
 
1333
1339
  def handle_hf_and_params(self, params={}):
1334
1340
  migrated: Bool = self.safe_bool(self.options, 'hf', False)
@@ -2265,10 +2271,8 @@ class kucoin(Exchange, ImplicitAPI):
2265
2271
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2266
2272
  """
2267
2273
  self.load_markets()
2268
- req = {
2269
- 'cost': cost,
2270
- }
2271
- return self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
2274
+ params['cost'] = cost
2275
+ return self.create_order(symbol, 'market', side, cost, None, params)
2272
2276
 
2273
2277
  def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
2274
2278
  """
@@ -3877,7 +3881,9 @@ class kucoin(Exchange, ImplicitAPI):
3877
3881
  account['free'] = self.safe_string(balance, 'available')
3878
3882
  account['used'] = self.safe_string(balance, 'holds')
3879
3883
  result[codeInner2] = account
3880
- returnType = result if isolated else self.safe_balance(result)
3884
+ returnType = result
3885
+ if not isolated:
3886
+ returnType = self.safe_balance(result)
3881
3887
  return returnType
3882
3888
 
3883
3889
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -4590,7 +4596,8 @@ class kucoin(Exchange, ImplicitAPI):
4590
4596
  if not (code in borrowRateHistories):
4591
4597
  borrowRateHistories[code] = []
4592
4598
  borrowRateStructure = self.parse_borrow_rate(item)
4593
- borrowRateHistories[code].append(borrowRateStructure)
4599
+ borrowRateHistoriesCode = borrowRateHistories[code]
4600
+ borrowRateHistoriesCode.append(borrowRateStructure)
4594
4601
  keys = list(borrowRateHistories.keys())
4595
4602
  for i in range(0, len(keys)):
4596
4603
  code = keys[i]
ccxt/kucoinfutures.py CHANGED
@@ -411,17 +411,20 @@ class kucoinfutures(kucoin, ImplicitAPI):
411
411
  'limit': 1000,
412
412
  'daysBack': None,
413
413
  'untilDays': 7,
414
+ 'symbolRequired': False,
414
415
  },
415
416
  'fetchOrder': {
416
417
  'marginMode': False,
417
418
  'trigger': False,
418
419
  'trailing': False,
420
+ 'symbolRequired': False,
419
421
  },
420
422
  'fetchOpenOrders': {
421
423
  'marginMode': False,
422
424
  'limit': 1000,
423
425
  'trigger': True,
424
426
  'trailing': False,
427
+ 'symbolRequired': False,
425
428
  },
426
429
  'fetchOrders': None,
427
430
  'fetchClosedOrders': {
@@ -432,6 +435,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
432
435
  'untilDays': None,
433
436
  'trigger': True,
434
437
  'trailing': False,
438
+ 'symbolRequired': False,
435
439
  },
436
440
  'fetchOHLCV': {
437
441
  'limit': 500,
@@ -2097,7 +2101,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
2097
2101
  return self.fetch_paginated_call_dynamic('fetchOpenOrders', symbol, since, limit, params)
2098
2102
  return self.fetch_orders_by_status('open', symbol, since, limit, params)
2099
2103
 
2100
- def fetch_order(self, id: Str = None, symbol: Str = None, params={}):
2104
+ def fetch_order(self, id: Str, symbol: Str = None, params={}):
2101
2105
  """
2102
2106
  fetches information on an order made by the user
2103
2107
 
ccxt/kuna.py CHANGED
@@ -394,12 +394,14 @@ class kuna(Exchange, ImplicitAPI):
394
394
  'marginMode': False,
395
395
  'trigger': False,
396
396
  'trailing': False,
397
+ 'symbolRequired': False,
397
398
  },
398
399
  'fetchOpenOrders': {
399
400
  'marginMode': False,
400
401
  'limit': 100,
401
402
  'trigger': False,
402
403
  'trailing': False,
404
+ 'symbolRequired': False,
403
405
  },
404
406
  'fetchOrders': None,
405
407
  'fetchClosedOrders': {
@@ -410,6 +412,7 @@ class kuna(Exchange, ImplicitAPI):
410
412
  'untilDays': 14,
411
413
  'trigger': False,
412
414
  'trailing': False,
415
+ 'symbolRequired': False,
413
416
  },
414
417
  'fetchOHLCV': None,
415
418
  },
ccxt/latoken.py CHANGED
@@ -279,17 +279,20 @@ class latoken(Exchange, ImplicitAPI):
279
279
  'limit': 1000,
280
280
  'daysBack': 100000, # todo
281
281
  'untilDays': None,
282
+ 'symbolRequired': False,
282
283
  },
283
284
  'fetchOrder': {
284
285
  'marginMode': False,
285
286
  'trigger': True,
286
287
  'trailing': False,
288
+ 'symbolRequired': False,
287
289
  },
288
290
  'fetchOpenOrders': {
289
291
  'marginMode': False,
290
292
  'limit': None,
291
293
  'trigger': False,
292
294
  'trailing': False,
295
+ 'symbolRequired': True,
293
296
  },
294
297
  'fetchOrders': None,
295
298
  'fetchClosedOrders': {
@@ -300,6 +303,7 @@ class latoken(Exchange, ImplicitAPI):
300
303
  'untilDays': None,
301
304
  'trigger': True,
302
305
  'trailing': False,
306
+ 'symbolRequired': False,
303
307
  },
304
308
  'fetchOHLCV': None,
305
309
  },
ccxt/lbank.py CHANGED
@@ -339,17 +339,20 @@ class lbank(Exchange, ImplicitAPI):
339
339
  'limit': 100,
340
340
  'daysBack': 100000, # todo
341
341
  'untilDays': 2,
342
+ 'symbolRequired': True,
342
343
  },
343
344
  'fetchOrder': {
344
345
  'marginMode': False,
345
346
  'trigger': False,
346
347
  'trailing': False,
348
+ 'symbolRequired': True,
347
349
  },
348
350
  'fetchOpenOrders': {
349
351
  'marginMode': False,
350
352
  'limit': 200,
351
353
  'trigger': False,
352
354
  'trailing': False,
355
+ 'symbolRequired': True,
353
356
  },
354
357
  'fetchOrders': {
355
358
  'marginMode': False,
@@ -358,6 +361,7 @@ class lbank(Exchange, ImplicitAPI):
358
361
  'untilDays': None,
359
362
  'trigger': False,
360
363
  'trailing': False,
364
+ 'symbolRequired': True,
361
365
  },
362
366
  'fetchClosedOrders': None, # todo: through fetchOrders "status" -1: Cancelled 0: Unfilled 1: Partially filled 2: Completely filled 3: Partially filled has been cancelled 4: Cancellation is being processed
363
367
  'fetchOHLCV': {
@@ -2669,7 +2673,8 @@ class lbank(Exchange, ImplicitAPI):
2669
2673
  if resultValue is None:
2670
2674
  result[code] = self.deposit_withdraw_fee([fee])
2671
2675
  else:
2672
- result[code]['info'].append(fee)
2676
+ resultCodeInfo = result[code]['info']
2677
+ resultCodeInfo.append(fee)
2673
2678
  chain = self.safe_string(fee, 'chain')
2674
2679
  networkCode = self.safe_string(self.options['inverse-networks'], chain, chain)
2675
2680
  if networkCode is not None:
ccxt/luno.py CHANGED
@@ -214,17 +214,20 @@ class luno(Exchange, ImplicitAPI):
214
214
  'limit': 1000,
215
215
  'daysBack': 100000, # todo
216
216
  'untilDays': 100000, # todo
217
+ 'symbolRequired': True,
217
218
  },
218
219
  'fetchOrder': {
219
220
  'marginMode': False,
220
221
  'trigger': False,
221
222
  'trailing': False,
223
+ 'symbolRequired': False,
222
224
  },
223
225
  'fetchOpenOrders': {
224
226
  'marginMode': False,
225
227
  'limit': 1000,
226
228
  'trigger': False,
227
229
  'trailing': False,
230
+ 'symbolRequired': False,
228
231
  },
229
232
  'fetchOrders': {
230
233
  'marginMode': False,
@@ -233,6 +236,7 @@ class luno(Exchange, ImplicitAPI):
233
236
  'untilDays': None,
234
237
  'trigger': False,
235
238
  'trailing': False,
239
+ 'symbolRequired': False,
236
240
  },
237
241
  'fetchClosedOrders': {
238
242
  'marginMode': False,
@@ -242,6 +246,7 @@ class luno(Exchange, ImplicitAPI):
242
246
  'untilDays': None,
243
247
  'trigger': False,
244
248
  'trailing': False,
249
+ 'symbolRequired': False,
245
250
  },
246
251
  'fetchOHLCV': {
247
252
  'limit': None,
@@ -543,7 +548,7 @@ class luno(Exchange, ImplicitAPI):
543
548
  response = self.privateGetOrdersId(self.extend(request, params))
544
549
  return self.parse_order(response)
545
550
 
546
- def fetch_orders_by_state(self, state=None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
551
+ def fetch_orders_by_state(self, state: Str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
547
552
  self.load_markets()
548
553
  request: dict = {}
549
554
  market = None
ccxt/mercado.py CHANGED
@@ -193,17 +193,20 @@ class mercado(Exchange, ImplicitAPI):
193
193
  'limit': None, # todo
194
194
  'daysBack': 100000, # todo
195
195
  'untilDays': 100000, # todo
196
+ 'symbolRequired': True,
196
197
  },
197
198
  'fetchOrder': {
198
199
  'marginMode': False,
199
200
  'trigger': False,
200
201
  'trailing': False,
202
+ 'symbolRequired': True,
201
203
  },
202
204
  'fetchOpenOrders': {
203
205
  'marginMode': False,
204
206
  'limit': None,
205
207
  'trigger': False,
206
208
  'trailing': False,
209
+ 'symbolRequired': True,
207
210
  },
208
211
  'fetchOrders': {
209
212
  'marginMode': False,
@@ -212,6 +215,7 @@ class mercado(Exchange, ImplicitAPI):
212
215
  'untilDays': 100000,
213
216
  'trigger': False,
214
217
  'trailing': False,
218
+ 'symbolRequired': True,
215
219
  },
216
220
  'fetchClosedOrders': None,
217
221
  'fetchOHLCV': {
ccxt/mexc.py CHANGED
@@ -726,17 +726,20 @@ class mexc(Exchange, ImplicitAPI):
726
726
  'limit': 100,
727
727
  'daysBack': 30,
728
728
  'untilDays': None,
729
+ 'symbolRequired': True,
729
730
  },
730
731
  'fetchOrder': {
731
732
  'marginMode': False,
732
733
  'trigger': False,
733
734
  'trailing': False,
735
+ 'symbolRequired': True,
734
736
  },
735
737
  'fetchOpenOrders': {
736
738
  'marginMode': True,
737
739
  'limit': None,
738
740
  'trigger': False,
739
741
  'trailing': False,
742
+ 'symbolRequired': True,
740
743
  },
741
744
  'fetchOrders': {
742
745
  'marginMode': True,
@@ -745,6 +748,7 @@ class mexc(Exchange, ImplicitAPI):
745
748
  'untilDays': 7,
746
749
  'trigger': False,
747
750
  'trailing': False,
751
+ 'symbolRequired': True,
748
752
  },
749
753
  'fetchClosedOrders': {
750
754
  'marginMode': True,
@@ -754,6 +758,7 @@ class mexc(Exchange, ImplicitAPI):
754
758
  'untilDays': 7,
755
759
  'trigger': False,
756
760
  'trailing': False,
761
+ 'symbolRequired': True,
757
762
  },
758
763
  'fetchOHLCV': {
759
764
  'limit': 1000,
@@ -2190,10 +2195,8 @@ class mexc(Exchange, ImplicitAPI):
2190
2195
  market = self.market(symbol)
2191
2196
  if not market['spot']:
2192
2197
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2193
- req = {
2194
- 'cost': cost,
2195
- }
2196
- return self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
2198
+ params['cost'] = cost
2199
+ return self.create_order(symbol, 'market', 'buy', 0, None, params)
2197
2200
 
2198
2201
  def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
2199
2202
  """
@@ -2210,10 +2213,8 @@ class mexc(Exchange, ImplicitAPI):
2210
2213
  market = self.market(symbol)
2211
2214
  if not market['spot']:
2212
2215
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2213
- req = {
2214
- 'cost': cost,
2215
- }
2216
- return self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
2216
+ params['cost'] = cost
2217
+ return self.create_order(symbol, 'market', 'sell', 0, None, params)
2217
2218
 
2218
2219
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
2219
2220
  """
@@ -4631,7 +4632,7 @@ class mexc(Exchange, ImplicitAPI):
4631
4632
  rawNetwork = self.safe_string(params, 'network')
4632
4633
  if rawNetwork is not None:
4633
4634
  params = self.omit(params, 'network')
4634
- request['coin'] += '-' + rawNetwork
4635
+ request['coin'] = request['coin'] + '-' + rawNetwork
4635
4636
  if since is not None:
4636
4637
  request['startTime'] = since
4637
4638
  if limit is not None:
ccxt/ndax.py CHANGED
@@ -301,17 +301,20 @@ class ndax(Exchange, ImplicitAPI):
301
301
  'limit': 100, # todo
302
302
  'daysBack': 100000, # todo
303
303
  'untilDays': 100000, # todo
304
+ 'symbolRequired': False,
304
305
  },
305
306
  'fetchOrder': {
306
307
  'marginMode': False,
307
308
  'trigger': False,
308
309
  'trailing': False,
310
+ 'symbolRequired': False,
309
311
  },
310
312
  'fetchOpenOrders': {
311
313
  'marginMode': False,
312
314
  'limit': None,
313
315
  'trigger': False,
314
316
  'trailing': False,
317
+ 'symbolRequired': False,
315
318
  },
316
319
  'fetchOrders': {
317
320
  'marginMode': False,
@@ -320,6 +323,7 @@ class ndax(Exchange, ImplicitAPI):
320
323
  'untilDays': None,
321
324
  'trigger': False,
322
325
  'trailing': False,
326
+ 'symbolRequired': False,
323
327
  },
324
328
  'fetchClosedOrders': None,
325
329
  'fetchOHLCV': {
@@ -650,7 +654,8 @@ class ndax(Exchange, ImplicitAPI):
650
654
  bidask = self.parse_bid_ask(level, priceKey, amountKey)
651
655
  levelSide = self.safe_integer(level, 9)
652
656
  side = asksKey if levelSide else bidsKey
653
- result[side].append(bidask)
657
+ resultSide = result[side]
658
+ resultSide.append(bidask)
654
659
  result['bids'] = self.sort_by(result['bids'], 0, True)
655
660
  result['asks'] = self.sort_by(result['asks'], 0)
656
661
  result['timestamp'] = timestamp
ccxt/novadax.py CHANGED
@@ -255,17 +255,20 @@ class novadax(Exchange, ImplicitAPI):
255
255
  'limit': 100,
256
256
  'daysBack': 100000, # todo
257
257
  'untilDays': 100000, # todo
258
+ 'symbolRequired': False,
258
259
  },
259
260
  'fetchOrder': {
260
261
  'marginMode': False,
261
262
  'trigger': False,
262
263
  'trailing': False,
264
+ 'symbolRequired': False,
263
265
  },
264
266
  'fetchOpenOrders': {
265
267
  'marginMode': False,
266
268
  'limit': None,
267
269
  'trigger': False,
268
270
  'trailing': False,
271
+ 'symbolRequired': False,
269
272
  },
270
273
  'fetchOrders': {
271
274
  'marginMode': False,
@@ -274,6 +277,7 @@ class novadax(Exchange, ImplicitAPI):
274
277
  'untilDays': 100000, # todo
275
278
  'trigger': False,
276
279
  'trailing': False,
280
+ 'symbolRequired': False,
277
281
  },
278
282
  'fetchClosedOrders': {
279
283
  'marginMode': False,
@@ -283,6 +287,7 @@ class novadax(Exchange, ImplicitAPI):
283
287
  'untilDays': 100000, # todo
284
288
  'trigger': False,
285
289
  'trailing': False,
290
+ 'symbolRequired': False,
286
291
  },
287
292
  'fetchOHLCV': {
288
293
  'limit': None, # todo max 3000
ccxt/oceanex.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.oceanex import ImplicitAPI
8
- from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
8
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, OrderBooks, Trade, TradingFees
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -170,12 +170,14 @@ class oceanex(Exchange, ImplicitAPI):
170
170
  'marginMode': False,
171
171
  'trigger': False,
172
172
  'trailing': False,
173
+ 'symbolRequired': False,
173
174
  },
174
175
  'fetchOpenOrders': {
175
176
  'marginMode': False,
176
177
  'limit': 100, # todo: max unknown
177
178
  'trigger': False,
178
179
  'trailing': False,
180
+ 'symbolRequired': False,
179
181
  },
180
182
  'fetchOrders': {
181
183
  'marginMode': False,
@@ -184,6 +186,7 @@ class oceanex(Exchange, ImplicitAPI):
184
186
  'untilDays': 100000, # todo
185
187
  'trigger': False,
186
188
  'trailing': False,
189
+ 'symbolRequired': False,
187
190
  },
188
191
  'fetchClosedOrders': {
189
192
  'marginMode': False,
@@ -193,6 +196,7 @@ class oceanex(Exchange, ImplicitAPI):
193
196
  'untilDays': 100000, # todo
194
197
  'trigger': False,
195
198
  'trailing': False,
199
+ 'symbolRequired': False,
196
200
  },
197
201
  'fetchOHLCV': {
198
202
  'limit': 100,
@@ -480,7 +484,7 @@ class oceanex(Exchange, ImplicitAPI):
480
484
  timestamp = self.safe_timestamp(orderbook, 'timestamp')
481
485
  return self.parse_order_book(orderbook, symbol, timestamp)
482
486
 
483
- def fetch_order_books(self, symbols: Strings = None, limit: Int = None, params={}):
487
+ def fetch_order_books(self, symbols: Strings = None, limit: Int = None, params={}) -> OrderBooks:
484
488
  """
485
489
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data for multiple markets
486
490
 
ccxt/okcoin.py CHANGED
@@ -264,17 +264,20 @@ class okcoin(Exchange, ImplicitAPI):
264
264
  'limit': 100,
265
265
  'daysBack': 90,
266
266
  'untilDays': 90, # todo
267
+ 'symbolRequired': False,
267
268
  },
268
269
  'fetchOrder': {
269
270
  'marginMode': False,
270
271
  'trigger': True,
271
272
  'trailing': True, # todo
273
+ 'symbolRequired': True,
272
274
  },
273
275
  'fetchOpenOrders': {
274
276
  'marginMode': False,
275
277
  'limit': 100,
276
278
  'trigger': True,
277
279
  'trailing': True,
280
+ 'symbolRequired': False,
278
281
  },
279
282
  'fetchOrders': None,
280
283
  'fetchClosedOrders': {
@@ -285,6 +288,7 @@ class okcoin(Exchange, ImplicitAPI):
285
288
  'untilDays': 90, # todo
286
289
  'trigger': True,
287
290
  'trailing': True,
291
+ 'symbolRequired': False,
288
292
  },
289
293
  'fetchOHLCV': {
290
294
  'limit': 100, # 300 is only possible for 'recent' 1440 candles, which does not make much sense
ccxt/okx.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.okx import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, BorrowInterest, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LongShortRatio, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, BorrowInterest, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LongShortRatio, MarginModification, Market, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface, TransferEntry
10
10
  from typing import List
11
11
  from typing import Any
12
12
  from ccxt.base.errors import ExchangeError
@@ -1251,17 +1251,20 @@ class okx(Exchange, ImplicitAPI):
1251
1251
  'daysBack': 90,
1252
1252
  'limit': 100,
1253
1253
  'untilDays': 10000,
1254
+ 'symbolRequired': False,
1254
1255
  },
1255
1256
  'fetchOrder': {
1256
1257
  'marginMode': False,
1257
1258
  'trigger': True,
1258
1259
  'trailing': True,
1260
+ 'symbolRequired': True,
1259
1261
  },
1260
1262
  'fetchOpenOrders': {
1261
1263
  'marginMode': False,
1262
1264
  'limit': 100,
1263
1265
  'trigger': True,
1264
1266
  'trailing': True,
1267
+ 'symbolRequired': False,
1265
1268
  },
1266
1269
  'fetchOrders': None, # not supported
1267
1270
  'fetchClosedOrders': {
@@ -1272,6 +1275,7 @@ class okx(Exchange, ImplicitAPI):
1272
1275
  'untilDays': None,
1273
1276
  'trigger': True,
1274
1277
  'trailing': True,
1278
+ 'symbolRequired': False,
1275
1279
  },
1276
1280
  'fetchOHLCV': {
1277
1281
  'limit': 300,
@@ -1815,7 +1819,8 @@ class okx(Exchange, ImplicitAPI):
1815
1819
  currencyActive = active if (active) else currencyActive
1816
1820
  networkId = self.safe_string(chain, 'chain')
1817
1821
  if (networkId is not None) and (networkId.find('-') >= 0):
1818
- parts = networkId.split('-')[1:]
1822
+ idParts = networkId.split('-')
1823
+ parts = self.array_slice(idParts, 1)
1819
1824
  chainPart = '-'.join(parts)
1820
1825
  networkCode = self.network_id_to_code(chainPart, currency['code'])
1821
1826
  precision = self.parse_precision(self.safe_string(chain, 'wdTickSz'))
@@ -2989,11 +2994,17 @@ class okx(Exchange, ImplicitAPI):
2989
2994
  request['ordType'] = 'oco'
2990
2995
  if takeProfitPrice is not None:
2991
2996
  request['tpTriggerPx'] = self.price_to_precision(symbol, takeProfitPrice)
2992
- request['tpOrdPx'] = '-1' if (tpOrdPx is None) else self.price_to_precision(symbol, tpOrdPx)
2997
+ tpOrdPxReq = '-1'
2998
+ if tpOrdPx is not None:
2999
+ tpOrdPxReq = self.price_to_precision(symbol, tpOrdPx)
3000
+ request['tpOrdPx'] = tpOrdPxReq
2993
3001
  request['tpTriggerPxType'] = tpTriggerPxType
2994
3002
  if stopLossPrice is not None:
2995
3003
  request['slTriggerPx'] = self.price_to_precision(symbol, stopLossPrice)
2996
- request['slOrdPx'] = '-1' if (slOrdPx is None) else self.price_to_precision(symbol, slOrdPx)
3004
+ slOrdPxReq = '-1'
3005
+ if slOrdPx is not None:
3006
+ slOrdPxReq = self.price_to_precision(symbol, slOrdPx)
3007
+ request['slOrdPx'] = slOrdPxReq
2997
3008
  request['slTriggerPxType'] = slTriggerPxType
2998
3009
  if clientOrderId is None:
2999
3010
  brokerId = self.safe_string(self.options, 'brokerId')
@@ -6448,7 +6459,8 @@ class okx(Exchange, ImplicitAPI):
6448
6459
  if not (code in borrowRateHistories):
6449
6460
  borrowRateHistories[code] = []
6450
6461
  borrowRateStructure = self.parse_borrow_rate(item)
6451
- borrowRateHistories[code].append(borrowRateStructure)
6462
+ borrrowRateCode = borrowRateHistories[code]
6463
+ borrrowRateCode.append(borrowRateStructure)
6452
6464
  keys = list(borrowRateHistories.keys())
6453
6465
  for i in range(0, len(keys)):
6454
6466
  code = keys[i]
ccxt/onetrading.py CHANGED
@@ -333,17 +333,20 @@ class onetrading(Exchange, ImplicitAPI):
333
333
  'limit': 100,
334
334
  'daysBack': 100000, # todo
335
335
  'untilDays': 100000, # todo
336
+ 'symbolRequired': False,
336
337
  },
337
338
  'fetchOrder': {
338
339
  'marginMode': False,
339
340
  'trigger': False,
340
341
  'trailing': False,
342
+ 'symbolRequired': False,
341
343
  },
342
344
  'fetchOpenOrders': {
343
345
  'marginMode': False,
344
346
  'limit': 100,
345
347
  'trigger': False,
346
348
  'trailing': False,
349
+ 'symbolRequired': False,
347
350
  },
348
351
  'fetchOrders': None, # todo
349
352
  'fetchClosedOrders': {
@@ -354,6 +357,7 @@ class onetrading(Exchange, ImplicitAPI):
354
357
  'untilDays': 100000, # todo
355
358
  'trigger': False,
356
359
  'trailing': False,
360
+ 'symbolRequired': False,
357
361
  },
358
362
  'fetchOHLCV': {
359
363
  'limit': 5000,
ccxt/oxfun.py CHANGED
@@ -292,17 +292,20 @@ class oxfun(Exchange, ImplicitAPI):
292
292
  'limit': 500,
293
293
  'daysBack': 100000, # todo
294
294
  'untilDays': 7,
295
+ 'symbolRequired': False,
295
296
  },
296
297
  'fetchOrder': {
297
298
  'marginMode': False,
298
299
  'trigger': False,
299
300
  'trailing': False,
301
+ 'symbolRequired': False,
300
302
  },
301
303
  'fetchOpenOrders': {
302
304
  'marginMode': False,
303
305
  'limit': None,
304
306
  'trigger': False,
305
307
  'trailing': False,
308
+ 'symbolRequired': False,
306
309
  },
307
310
  'fetchOrders': None,
308
311
  'fetchClosedOrders': None, # todo?