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
@@ -1040,17 +1040,20 @@ class kucoin(Exchange, ImplicitAPI):
1040
1040
  'limit': None,
1041
1041
  'daysBack': None,
1042
1042
  'untilDays': 7, # per implementation comments
1043
+ 'symbolRequired': True,
1043
1044
  },
1044
1045
  'fetchOrder': {
1045
1046
  'marginMode': False,
1046
1047
  'trigger': True,
1047
1048
  'trailing': False,
1049
+ 'symbolRequired': True,
1048
1050
  },
1049
1051
  'fetchOpenOrders': {
1050
1052
  'marginMode': True,
1051
1053
  'limit': 500,
1052
1054
  'trigger': True,
1053
1055
  'trailing': False,
1056
+ 'symbolRequired': True,
1054
1057
  },
1055
1058
  'fetchOrders': None,
1056
1059
  'fetchClosedOrders': {
@@ -1061,6 +1064,7 @@ class kucoin(Exchange, ImplicitAPI):
1061
1064
  'untilDays': 7,
1062
1065
  'trigger': True,
1063
1066
  'trailing': False,
1067
+ 'symbolRequired': True,
1064
1068
  },
1065
1069
  'fetchOHLCV': {
1066
1070
  'limit': 1500,
@@ -1326,10 +1330,12 @@ class kucoin(Exchange, ImplicitAPI):
1326
1330
 
1327
1331
  https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
1328
1332
 
1333
+ :returns any: ignore
1329
1334
  """
1330
1335
  if not ('hf' in self.options) or (self.options['hf'] is None) or force:
1331
1336
  result: dict = await self.privateGetHfAccountsOpened()
1332
1337
  self.options['hf'] = self.safe_bool(result, 'data')
1338
+ return True
1333
1339
 
1334
1340
  def handle_hf_and_params(self, params={}):
1335
1341
  migrated: Bool = self.safe_bool(self.options, 'hf', False)
@@ -2266,10 +2272,8 @@ class kucoin(Exchange, ImplicitAPI):
2266
2272
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2267
2273
  """
2268
2274
  await self.load_markets()
2269
- req = {
2270
- 'cost': cost,
2271
- }
2272
- return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
2275
+ params['cost'] = cost
2276
+ return await self.create_order(symbol, 'market', side, cost, None, params)
2273
2277
 
2274
2278
  async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
2275
2279
  """
@@ -3878,7 +3882,9 @@ class kucoin(Exchange, ImplicitAPI):
3878
3882
  account['free'] = self.safe_string(balance, 'available')
3879
3883
  account['used'] = self.safe_string(balance, 'holds')
3880
3884
  result[codeInner2] = account
3881
- returnType = result if isolated else self.safe_balance(result)
3885
+ returnType = result
3886
+ if not isolated:
3887
+ returnType = self.safe_balance(result)
3882
3888
  return returnType
3883
3889
 
3884
3890
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -4591,7 +4597,8 @@ class kucoin(Exchange, ImplicitAPI):
4591
4597
  if not (code in borrowRateHistories):
4592
4598
  borrowRateHistories[code] = []
4593
4599
  borrowRateStructure = self.parse_borrow_rate(item)
4594
- borrowRateHistories[code].append(borrowRateStructure)
4600
+ borrowRateHistoriesCode = borrowRateHistories[code]
4601
+ borrowRateHistoriesCode.append(borrowRateStructure)
4595
4602
  keys = list(borrowRateHistories.keys())
4596
4603
  for i in range(0, len(keys)):
4597
4604
  code = keys[i]
@@ -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 await self.fetch_paginated_call_dynamic('fetchOpenOrders', symbol, since, limit, params)
2098
2102
  return await self.fetch_orders_by_status('open', symbol, since, limit, params)
2099
2103
 
2100
- async def fetch_order(self, id: Str = None, symbol: Str = None, params={}):
2104
+ async 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
 
@@ -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
  },
@@ -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
  },
@@ -340,17 +340,20 @@ class lbank(Exchange, ImplicitAPI):
340
340
  'limit': 100,
341
341
  'daysBack': 100000, # todo
342
342
  'untilDays': 2,
343
+ 'symbolRequired': True,
343
344
  },
344
345
  'fetchOrder': {
345
346
  'marginMode': False,
346
347
  'trigger': False,
347
348
  'trailing': False,
349
+ 'symbolRequired': True,
348
350
  },
349
351
  'fetchOpenOrders': {
350
352
  'marginMode': False,
351
353
  'limit': 200,
352
354
  'trigger': False,
353
355
  'trailing': False,
356
+ 'symbolRequired': True,
354
357
  },
355
358
  'fetchOrders': {
356
359
  'marginMode': False,
@@ -359,6 +362,7 @@ class lbank(Exchange, ImplicitAPI):
359
362
  'untilDays': None,
360
363
  'trigger': False,
361
364
  'trailing': False,
365
+ 'symbolRequired': True,
362
366
  },
363
367
  '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
364
368
  'fetchOHLCV': {
@@ -2670,7 +2674,8 @@ class lbank(Exchange, ImplicitAPI):
2670
2674
  if resultValue is None:
2671
2675
  result[code] = self.deposit_withdraw_fee([fee])
2672
2676
  else:
2673
- result[code]['info'].append(fee)
2677
+ resultCodeInfo = result[code]['info']
2678
+ resultCodeInfo.append(fee)
2674
2679
  chain = self.safe_string(fee, 'chain')
2675
2680
  networkCode = self.safe_string(self.options['inverse-networks'], chain, chain)
2676
2681
  if networkCode is not None:
@@ -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 = await self.privateGetOrdersId(self.extend(request, params))
544
549
  return self.parse_order(response)
545
550
 
546
- async def fetch_orders_by_state(self, state=None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
551
+ async def fetch_orders_by_state(self, state: Str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
547
552
  await self.load_markets()
548
553
  request: dict = {}
549
554
  market = None
@@ -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': {
@@ -727,17 +727,20 @@ class mexc(Exchange, ImplicitAPI):
727
727
  'limit': 100,
728
728
  'daysBack': 30,
729
729
  'untilDays': None,
730
+ 'symbolRequired': True,
730
731
  },
731
732
  'fetchOrder': {
732
733
  'marginMode': False,
733
734
  'trigger': False,
734
735
  'trailing': False,
736
+ 'symbolRequired': True,
735
737
  },
736
738
  'fetchOpenOrders': {
737
739
  'marginMode': True,
738
740
  'limit': None,
739
741
  'trigger': False,
740
742
  'trailing': False,
743
+ 'symbolRequired': True,
741
744
  },
742
745
  'fetchOrders': {
743
746
  'marginMode': True,
@@ -746,6 +749,7 @@ class mexc(Exchange, ImplicitAPI):
746
749
  'untilDays': 7,
747
750
  'trigger': False,
748
751
  'trailing': False,
752
+ 'symbolRequired': True,
749
753
  },
750
754
  'fetchClosedOrders': {
751
755
  'marginMode': True,
@@ -755,6 +759,7 @@ class mexc(Exchange, ImplicitAPI):
755
759
  'untilDays': 7,
756
760
  'trigger': False,
757
761
  'trailing': False,
762
+ 'symbolRequired': True,
758
763
  },
759
764
  'fetchOHLCV': {
760
765
  'limit': 1000,
@@ -2191,10 +2196,8 @@ class mexc(Exchange, ImplicitAPI):
2191
2196
  market = self.market(symbol)
2192
2197
  if not market['spot']:
2193
2198
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2194
- req = {
2195
- 'cost': cost,
2196
- }
2197
- return await self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
2199
+ params['cost'] = cost
2200
+ return await self.create_order(symbol, 'market', 'buy', 0, None, params)
2198
2201
 
2199
2202
  async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
2200
2203
  """
@@ -2211,10 +2214,8 @@ class mexc(Exchange, ImplicitAPI):
2211
2214
  market = self.market(symbol)
2212
2215
  if not market['spot']:
2213
2216
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2214
- req = {
2215
- 'cost': cost,
2216
- }
2217
- return await self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
2217
+ params['cost'] = cost
2218
+ return await self.create_order(symbol, 'market', 'sell', 0, None, params)
2218
2219
 
2219
2220
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
2220
2221
  """
@@ -4632,7 +4633,7 @@ class mexc(Exchange, ImplicitAPI):
4632
4633
  rawNetwork = self.safe_string(params, 'network')
4633
4634
  if rawNetwork is not None:
4634
4635
  params = self.omit(params, 'network')
4635
- request['coin'] += '-' + rawNetwork
4636
+ request['coin'] = request['coin'] + '-' + rawNetwork
4636
4637
  if since is not None:
4637
4638
  request['startTime'] = since
4638
4639
  if limit is not None:
@@ -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
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.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
- async def fetch_order_books(self, symbols: Strings = None, limit: Int = None, params={}):
487
+ async 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
 
@@ -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/async_support/okx.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.okx import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- 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
10
+ 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
11
11
  from typing import List
12
12
  from typing import Any
13
13
  from ccxt.base.errors import ExchangeError
@@ -1252,17 +1252,20 @@ class okx(Exchange, ImplicitAPI):
1252
1252
  'daysBack': 90,
1253
1253
  'limit': 100,
1254
1254
  'untilDays': 10000,
1255
+ 'symbolRequired': False,
1255
1256
  },
1256
1257
  'fetchOrder': {
1257
1258
  'marginMode': False,
1258
1259
  'trigger': True,
1259
1260
  'trailing': True,
1261
+ 'symbolRequired': True,
1260
1262
  },
1261
1263
  'fetchOpenOrders': {
1262
1264
  'marginMode': False,
1263
1265
  'limit': 100,
1264
1266
  'trigger': True,
1265
1267
  'trailing': True,
1268
+ 'symbolRequired': False,
1266
1269
  },
1267
1270
  'fetchOrders': None, # not supported
1268
1271
  'fetchClosedOrders': {
@@ -1273,6 +1276,7 @@ class okx(Exchange, ImplicitAPI):
1273
1276
  'untilDays': None,
1274
1277
  'trigger': True,
1275
1278
  'trailing': True,
1279
+ 'symbolRequired': False,
1276
1280
  },
1277
1281
  'fetchOHLCV': {
1278
1282
  'limit': 300,
@@ -1816,7 +1820,8 @@ class okx(Exchange, ImplicitAPI):
1816
1820
  currencyActive = active if (active) else currencyActive
1817
1821
  networkId = self.safe_string(chain, 'chain')
1818
1822
  if (networkId is not None) and (networkId.find('-') >= 0):
1819
- parts = networkId.split('-')[1:]
1823
+ idParts = networkId.split('-')
1824
+ parts = self.array_slice(idParts, 1)
1820
1825
  chainPart = '-'.join(parts)
1821
1826
  networkCode = self.network_id_to_code(chainPart, currency['code'])
1822
1827
  precision = self.parse_precision(self.safe_string(chain, 'wdTickSz'))
@@ -2990,11 +2995,17 @@ class okx(Exchange, ImplicitAPI):
2990
2995
  request['ordType'] = 'oco'
2991
2996
  if takeProfitPrice is not None:
2992
2997
  request['tpTriggerPx'] = self.price_to_precision(symbol, takeProfitPrice)
2993
- request['tpOrdPx'] = '-1' if (tpOrdPx is None) else self.price_to_precision(symbol, tpOrdPx)
2998
+ tpOrdPxReq = '-1'
2999
+ if tpOrdPx is not None:
3000
+ tpOrdPxReq = self.price_to_precision(symbol, tpOrdPx)
3001
+ request['tpOrdPx'] = tpOrdPxReq
2994
3002
  request['tpTriggerPxType'] = tpTriggerPxType
2995
3003
  if stopLossPrice is not None:
2996
3004
  request['slTriggerPx'] = self.price_to_precision(symbol, stopLossPrice)
2997
- request['slOrdPx'] = '-1' if (slOrdPx is None) else self.price_to_precision(symbol, slOrdPx)
3005
+ slOrdPxReq = '-1'
3006
+ if slOrdPx is not None:
3007
+ slOrdPxReq = self.price_to_precision(symbol, slOrdPx)
3008
+ request['slOrdPx'] = slOrdPxReq
2998
3009
  request['slTriggerPxType'] = slTriggerPxType
2999
3010
  if clientOrderId is None:
3000
3011
  brokerId = self.safe_string(self.options, 'brokerId')
@@ -6449,7 +6460,8 @@ class okx(Exchange, ImplicitAPI):
6449
6460
  if not (code in borrowRateHistories):
6450
6461
  borrowRateHistories[code] = []
6451
6462
  borrowRateStructure = self.parse_borrow_rate(item)
6452
- borrowRateHistories[code].append(borrowRateStructure)
6463
+ borrrowRateCode = borrowRateHistories[code]
6464
+ borrrowRateCode.append(borrowRateStructure)
6453
6465
  keys = list(borrowRateHistories.keys())
6454
6466
  for i in range(0, len(keys)):
6455
6467
  code = keys[i]
@@ -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,
@@ -293,17 +293,20 @@ class oxfun(Exchange, ImplicitAPI):
293
293
  'limit': 500,
294
294
  'daysBack': 100000, # todo
295
295
  'untilDays': 7,
296
+ 'symbolRequired': False,
296
297
  },
297
298
  'fetchOrder': {
298
299
  'marginMode': False,
299
300
  'trigger': False,
300
301
  'trailing': False,
302
+ 'symbolRequired': False,
301
303
  },
302
304
  'fetchOpenOrders': {
303
305
  'marginMode': False,
304
306
  'limit': None,
305
307
  'trigger': False,
306
308
  'trailing': False,
309
+ 'symbolRequired': False,
307
310
  },
308
311
  'fetchOrders': None,
309
312
  'fetchClosedOrders': None, # todo?