ccxt 4.4.52__py2.py3-none-any.whl → 4.4.53__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 (224) hide show
  1. ccxt/__init__.py +1 -1
  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 -1
  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 +20 -3
  14. ccxt/async_support/bigone.py +5 -0
  15. ccxt/async_support/binance.py +55 -69
  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 +8 -4
  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 +10 -4
  39. ccxt/async_support/cex.py +2 -0
  40. ccxt/async_support/coinbase.py +19 -12
  41. ccxt/async_support/coinbaseexchange.py +5 -0
  42. ccxt/async_support/coinbaseinternational.py +21 -2
  43. ccxt/async_support/coincatch.py +3 -0
  44. ccxt/async_support/coincheck.py +2 -0
  45. ccxt/async_support/coinex.py +5 -1
  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 +7 -3
  57. ccxt/async_support/digifinex.py +10 -5
  58. ccxt/async_support/ellipx.py +9 -5
  59. ccxt/async_support/exmo.py +6 -3
  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 +6 -1
  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 +6 -4
  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/lykke.py +4 -0
  80. ccxt/async_support/mercado.py +4 -0
  81. ccxt/async_support/mexc.py +10 -9
  82. ccxt/async_support/ndax.py +6 -1
  83. ccxt/async_support/novadax.py +5 -0
  84. ccxt/async_support/oceanex.py +6 -2
  85. ccxt/async_support/okcoin.py +4 -0
  86. ccxt/async_support/okx.py +17 -5
  87. ccxt/async_support/onetrading.py +4 -0
  88. ccxt/async_support/oxfun.py +3 -0
  89. ccxt/async_support/p2b.py +3 -0
  90. ccxt/async_support/paradex.py +8 -2
  91. ccxt/async_support/phemex.py +10 -4
  92. ccxt/async_support/poloniex.py +6 -3
  93. ccxt/async_support/poloniexfutures.py +5 -1
  94. ccxt/async_support/probit.py +4 -0
  95. ccxt/async_support/timex.py +4 -0
  96. ccxt/async_support/tokocrypto.py +5 -0
  97. ccxt/async_support/tradeogre.py +2 -0
  98. ccxt/async_support/upbit.py +5 -2
  99. ccxt/async_support/vertex.py +6 -2
  100. ccxt/async_support/wavesexchange.py +20 -3
  101. ccxt/async_support/wazirx.py +2 -0
  102. ccxt/async_support/whitebit.py +5 -4
  103. ccxt/async_support/woo.py +15 -5
  104. ccxt/async_support/woofipro.py +21 -7
  105. ccxt/async_support/xt.py +5 -0
  106. ccxt/async_support/yobit.py +5 -2
  107. ccxt/async_support/zaif.py +2 -0
  108. ccxt/async_support/zonda.py +2 -0
  109. ccxt/base/exchange.py +92 -50
  110. ccxt/base/types.py +1 -1
  111. ccxt/bigone.py +5 -0
  112. ccxt/binance.py +55 -69
  113. ccxt/bingx.py +25 -29
  114. ccxt/bit2c.py +3 -0
  115. ccxt/bitbank.py +3 -0
  116. ccxt/bitbns.py +3 -0
  117. ccxt/bitfinex.py +6 -1
  118. ccxt/bitflyer.py +6 -1
  119. ccxt/bitget.py +8 -4
  120. ccxt/bithumb.py +3 -1
  121. ccxt/bitmart.py +22 -12
  122. ccxt/bitmex.py +99 -93
  123. ccxt/bitopro.py +7 -2
  124. ccxt/bitrue.py +4 -0
  125. ccxt/bitso.py +5 -2
  126. ccxt/bitstamp.py +3 -0
  127. ccxt/bitteam.py +5 -0
  128. ccxt/bitvavo.py +4 -0
  129. ccxt/blockchaincom.py +4 -0
  130. ccxt/blofin.py +3 -0
  131. ccxt/btcalpha.py +5 -0
  132. ccxt/btcbox.py +3 -2
  133. ccxt/btcmarkets.py +5 -0
  134. ccxt/btcturk.py +3 -0
  135. ccxt/bybit.py +10 -4
  136. ccxt/cex.py +2 -0
  137. ccxt/coinbase.py +19 -12
  138. ccxt/coinbaseexchange.py +5 -0
  139. ccxt/coinbaseinternational.py +21 -2
  140. ccxt/coincatch.py +3 -0
  141. ccxt/coincheck.py +2 -0
  142. ccxt/coinex.py +5 -1
  143. ccxt/coinlist.py +5 -0
  144. ccxt/coinmate.py +4 -0
  145. ccxt/coinmetro.py +9 -5
  146. ccxt/coinone.py +3 -0
  147. ccxt/coinsph.py +4 -0
  148. ccxt/coinspot.py +1 -0
  149. ccxt/cryptocom.py +5 -0
  150. ccxt/currencycom.py +3 -0
  151. ccxt/defx.py +5 -0
  152. ccxt/delta.py +4 -1
  153. ccxt/deribit.py +7 -3
  154. ccxt/digifinex.py +10 -5
  155. ccxt/ellipx.py +9 -5
  156. ccxt/exmo.py +6 -3
  157. ccxt/gate.py +5 -1
  158. ccxt/gemini.py +3 -0
  159. ccxt/hashkey.py +5 -4
  160. ccxt/hitbtc.py +6 -2
  161. ccxt/hollaex.py +7 -2
  162. ccxt/htx.py +8 -1
  163. ccxt/huobijp.py +5 -0
  164. ccxt/hyperliquid.py +6 -1
  165. ccxt/idex.py +5 -1
  166. ccxt/independentreserve.py +4 -0
  167. ccxt/indodax.py +3 -0
  168. ccxt/kraken.py +6 -4
  169. ccxt/krakenfutures.py +5 -2
  170. ccxt/kucoin.py +13 -6
  171. ccxt/kucoinfutures.py +5 -1
  172. ccxt/kuna.py +3 -0
  173. ccxt/latoken.py +4 -0
  174. ccxt/lbank.py +6 -1
  175. ccxt/luno.py +6 -1
  176. ccxt/lykke.py +4 -0
  177. ccxt/mercado.py +4 -0
  178. ccxt/mexc.py +10 -9
  179. ccxt/ndax.py +6 -1
  180. ccxt/novadax.py +5 -0
  181. ccxt/oceanex.py +6 -2
  182. ccxt/okcoin.py +4 -0
  183. ccxt/okx.py +17 -5
  184. ccxt/onetrading.py +4 -0
  185. ccxt/oxfun.py +3 -0
  186. ccxt/p2b.py +3 -0
  187. ccxt/paradex.py +8 -2
  188. ccxt/phemex.py +10 -4
  189. ccxt/poloniex.py +6 -3
  190. ccxt/poloniexfutures.py +5 -1
  191. ccxt/pro/__init__.py +1 -1
  192. ccxt/pro/bitcoincom.py +1 -4
  193. ccxt/pro/bitopro.py +1 -1
  194. ccxt/probit.py +4 -0
  195. ccxt/test/tests_async.py +57 -30
  196. ccxt/test/tests_sync.py +57 -30
  197. ccxt/timex.py +4 -0
  198. ccxt/tokocrypto.py +5 -0
  199. ccxt/tradeogre.py +2 -0
  200. ccxt/upbit.py +5 -2
  201. ccxt/vertex.py +6 -2
  202. ccxt/wavesexchange.py +20 -3
  203. ccxt/wazirx.py +2 -0
  204. ccxt/whitebit.py +5 -4
  205. ccxt/woo.py +15 -5
  206. ccxt/woofipro.py +21 -7
  207. ccxt/xt.py +5 -0
  208. ccxt/yobit.py +5 -2
  209. ccxt/zaif.py +2 -0
  210. ccxt/zonda.py +2 -0
  211. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/METADATA +225 -140
  212. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/RECORD +215 -224
  213. ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
  214. ccxt/static_dependencies/ethereum/account/py.typed +0 -0
  215. ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
  216. ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
  217. ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
  218. ccxt/static_dependencies/lark/py.typed +0 -0
  219. ccxt/static_dependencies/marshmallow/py.typed +0 -0
  220. ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
  221. ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
  222. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/LICENSE.txt +0 -0
  223. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/WHEEL +0 -0
  224. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/top_level.txt +0 -0
@@ -166,6 +166,7 @@ class zaif(Exchange, ImplicitAPI):
166
166
  'limit': None,
167
167
  'trigger': False,
168
168
  'trailing': False,
169
+ 'symbolRequired': False,
169
170
  },
170
171
  'fetchOrders': None, # todo
171
172
  'fetchClosedOrders': {
@@ -176,6 +177,7 @@ class zaif(Exchange, ImplicitAPI):
176
177
  'untilDays': 100000, # todo
177
178
  'trigger': False,
178
179
  'trailing': False,
180
+ 'symbolRequired': False,
179
181
  },
180
182
  'fetchOHLCV': None,
181
183
  },
@@ -334,6 +334,7 @@ class zonda(Exchange, ImplicitAPI):
334
334
  'limit': None,
335
335
  'daysBack': 100000, # todo
336
336
  'untilDays': 100000, # todo
337
+ 'symbolRequired': False,
337
338
  },
338
339
  'fetchOrder': None,
339
340
  'fetchOpenOrders': {
@@ -341,6 +342,7 @@ class zonda(Exchange, ImplicitAPI):
341
342
  'limit': 100,
342
343
  'trigger': False,
343
344
  'trailing': False,
345
+ 'symbolRequired': False,
344
346
  },
345
347
  'fetchOrders': None,
346
348
  'fetchClosedOrders': None, # todo
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.52'
7
+ __version__ = '4.4.53'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2361,9 +2361,17 @@ class Exchange(object):
2361
2361
  if fromStart:
2362
2362
  if limit > arrayLength:
2363
2363
  limit = arrayLength
2364
- array = self.array_slice(array, 0, limit) if ascending else self.array_slice(array, -limit)
2364
+ # array = self.array_slice(array, 0, limit) if ascending else self.array_slice(array, -limit)
2365
+ if ascending:
2366
+ array = self.array_slice(array, 0, limit)
2367
+ else:
2368
+ array = self.array_slice(array, -limit)
2365
2369
  else:
2366
- array = self.array_slice(array, -limit) if ascending else self.array_slice(array, 0, limit)
2370
+ # array = self.array_slice(array, -limit) if ascending else self.array_slice(array, 0, limit)
2371
+ if ascending:
2372
+ array = self.array_slice(array, -limit)
2373
+ else:
2374
+ array = self.array_slice(array, 0, limit)
2367
2375
  return array
2368
2376
 
2369
2377
  def filter_by_since_limit(self, array: List[object], since: Int = None, limit: Int = None, key: IndexType = 'timestamp', tail=False):
@@ -2741,36 +2749,17 @@ class Exchange(object):
2741
2749
 
2742
2750
  def features_generator(self):
2743
2751
  #
2744
- # the exchange-specific features can be something like self, where we support 'string' aliases too:
2752
+ # in the exchange-specific features can be something like self, where we support 'string' aliases too:
2745
2753
  #
2746
2754
  # {
2747
- # 'myItem' : {
2755
+ # 'my' : {
2748
2756
  # 'createOrder' : {...},
2749
- # 'fetchOrders' : {...},
2750
2757
  # },
2751
2758
  # 'swap': {
2752
- # 'linear': 'myItem',
2753
- # 'inverse': 'myItem',
2754
- # },
2755
- # 'future': {
2756
- # 'linear': 'myItem',
2757
- # 'inverse': 'myItem',
2758
- # }
2759
- # }
2760
- #
2761
- #
2762
- #
2763
- # self method would regenerate the blank features tree, eg:
2764
- #
2765
- # {
2766
- # "spot": {
2767
- # "createOrder": None,
2768
- # "fetchBalance": None,
2769
- # ...
2759
+ # 'linear': {
2760
+ # 'extends': my',
2761
+ # },
2770
2762
  # },
2771
- # "swap": {
2772
- # ...
2773
- # }
2774
2763
  # }
2775
2764
  #
2776
2765
  if self.features is None:
@@ -2806,13 +2795,13 @@ class Exchange(object):
2806
2795
  extendObj = self.features_mapper(initialFeatures, extendsStr)
2807
2796
  featuresObj = self.deep_extend(extendObj, featuresObj)
2808
2797
  #
2809
- # corrections
2798
+ # ### corrections ###
2810
2799
  #
2800
+ # createOrder
2811
2801
  if 'createOrder' in featuresObj:
2812
2802
  value = self.safe_dict(featuresObj['createOrder'], 'attachedStopLossTakeProfit')
2813
- if value is not None:
2814
- featuresObj['createOrder']['stopLoss'] = value
2815
- featuresObj['createOrder']['takeProfit'] = value
2803
+ featuresObj['createOrder']['stopLoss'] = value
2804
+ featuresObj['createOrder']['takeProfit'] = value
2816
2805
  if marketType == 'spot':
2817
2806
  # default 'hedged': False
2818
2807
  featuresObj['createOrder']['hedged'] = False
@@ -2822,6 +2811,15 @@ class Exchange(object):
2822
2811
  # default 'GTC' to True
2823
2812
  if self.safe_bool(featuresObj['createOrder']['timeInForce'], 'GTC') is None:
2824
2813
  featuresObj['createOrder']['timeInForce']['GTC'] = True
2814
+ # other methods
2815
+ keys = list(featuresObj.keys())
2816
+ for i in range(0, len(keys)):
2817
+ key = keys[i]
2818
+ featureBlock = featuresObj[key]
2819
+ if not self.in_array(key, ['sandbox']) and featureBlock is not None:
2820
+ # default "symbolRequired" to False to all methods(except `createOrder`)
2821
+ if not ('symbolRequired' in featureBlock):
2822
+ featureBlock['symbolRequired'] = self.in_array(key, ['createOrder', 'createOrders', 'fetchOHLCV'])
2825
2823
  return featuresObj
2826
2824
 
2827
2825
  def orderbook_checksum_message(self, symbol: Str):
@@ -3058,7 +3056,9 @@ class Exchange(object):
3058
3056
  for i in range(0, len(marketValues)):
3059
3057
  value = marketValues[i]
3060
3058
  if value['id'] in self.markets_by_id:
3061
- (self.markets_by_id[value['id']]).append(value)
3059
+ marketsByIdArray = (self.markets_by_id[value['id']])
3060
+ marketsByIdArray.append(value)
3061
+ self.markets_by_id[value['id']] = marketsByIdArray
3062
3062
  else:
3063
3063
  self.markets_by_id[value['id']] = [value]
3064
3064
  market = self.deep_extend(self.safe_market_structure(), {
@@ -3413,13 +3413,16 @@ class Exchange(object):
3413
3413
  results = []
3414
3414
  if isinstance(orders, list):
3415
3415
  for i in range(0, len(orders)):
3416
- order = self.extend(self.parse_order(orders[i], market), params)
3416
+ parsed = self.parse_order(orders[i], market) # don't inline self call
3417
+ order = self.extend(parsed, params)
3417
3418
  results.append(order)
3418
3419
  else:
3419
3420
  ids = list(orders.keys())
3420
3421
  for i in range(0, len(ids)):
3421
3422
  id = ids[i]
3422
- order = self.extend(self.parse_order(self.extend({'id': id}, orders[id]), market), params)
3423
+ idExtended = self.extend({'id': id}, orders[id])
3424
+ parsedOrder = self.parse_order(idExtended, market) # don't inline these calls
3425
+ order = self.extend(parsedOrder, params)
3423
3426
  results.append(order)
3424
3427
  results = self.sort_by(results, 'timestamp')
3425
3428
  symbol = market['symbol'] if (market is not None) else None
@@ -3768,12 +3771,18 @@ class Exchange(object):
3768
3771
  result[volume] = []
3769
3772
  for i in range(0, len(ohlcvs)):
3770
3773
  ts = ohlcvs[i][0] if ms else self.parse_to_int(ohlcvs[i][0] / 1000)
3771
- result[timestamp].append(ts)
3772
- result[open].append(ohlcvs[i][1])
3773
- result[high].append(ohlcvs[i][2])
3774
- result[low].append(ohlcvs[i][3])
3775
- result[close].append(ohlcvs[i][4])
3776
- result[volume].append(ohlcvs[i][5])
3774
+ resultTimestamp = result[timestamp]
3775
+ resultTimestamp.append(ts)
3776
+ resultOpen = result[open]
3777
+ resultOpen.append(ohlcvs[i][1])
3778
+ resultHigh = result[high]
3779
+ resultHigh.append(ohlcvs[i][2])
3780
+ resultLow = result[low]
3781
+ resultLow.append(ohlcvs[i][3])
3782
+ resultClose = result[close]
3783
+ resultClose.append(ohlcvs[i][4])
3784
+ resultVolume = result[volume]
3785
+ resultVolume.append(ohlcvs[i][5])
3777
3786
  return result
3778
3787
 
3779
3788
  def fetch_web_endpoint(self, method, endpointMethod, returnAsJson, startRegex=None, endRegex=None):
@@ -3787,14 +3796,18 @@ class Exchange(object):
3787
3796
  maxRetries = self.safe_value(options, 'webApiRetries', 10)
3788
3797
  response = None
3789
3798
  retry = 0
3799
+ shouldBreak = False
3790
3800
  while(retry < maxRetries):
3791
3801
  try:
3792
3802
  response = getattr(self, endpointMethod)({})
3803
+ shouldBreak = True
3793
3804
  break
3794
3805
  except Exception as e:
3795
3806
  retry = retry + 1
3796
3807
  if retry == maxRetries:
3797
3808
  raise e
3809
+ if shouldBreak:
3810
+ break # self is needed because of GO
3798
3811
  content = response
3799
3812
  if startRegex is not None:
3800
3813
  splitted_by_start = content.split(startRegex)
@@ -4274,12 +4287,19 @@ class Exchange(object):
4274
4287
  objects = self.to_array(objects)
4275
4288
  # return all of them if no values were passed
4276
4289
  if values is None or not values:
4277
- return self.index_by(objects, key) if indexed else objects
4290
+ # return self.index_by(objects, key) if indexed else objects
4291
+ if indexed:
4292
+ return self.index_by(objects, key)
4293
+ else:
4294
+ return objects
4278
4295
  results = []
4279
4296
  for i in range(0, len(objects)):
4280
4297
  if self.in_array(objects[i][key], values):
4281
4298
  results.append(objects[i])
4282
- return self.index_by(results, key) if indexed else results
4299
+ # return self.index_by(results, key) if indexed else results
4300
+ if indexed:
4301
+ return self.index_by(results, key)
4302
+ return results
4283
4303
 
4284
4304
  def fetch2(self, path, api: Any = 'public', method='GET', params={}, headers: Any = None, body: Any = None, config={}):
4285
4305
  if self.enableRateLimit:
@@ -4304,8 +4324,9 @@ class Exchange(object):
4304
4324
  self.log('Request failed with the error: ' + str(e) + ', retrying ' + (i + str(1)) + ' of ' + str(retries) + '...')
4305
4325
  if (retryDelay is not None) and (retryDelay != 0):
4306
4326
  self.sleep(retryDelay)
4307
- continue
4308
- raise e
4327
+ # continue #check self
4328
+ if i >= retries:
4329
+ raise e
4309
4330
  return None # self line is never reached, but exists for c# value return requirement
4310
4331
 
4311
4332
  def request(self, path, api: Any = 'public', method='GET', params={}, headers: Any = None, body: Any = None, config={}):
@@ -4464,7 +4485,7 @@ class Exchange(object):
4464
4485
  'precision': None,
4465
4486
  })
4466
4487
 
4467
- def safe_market(self, marketId: Str, market: Market = None, delimiter: Str = None, marketType: Str = None):
4488
+ def safe_market(self, marketId: Str = None, market: Market = None, delimiter: Str = None, marketType: Str = None):
4468
4489
  result = self.safe_market_structure({
4469
4490
  'symbol': marketId,
4470
4491
  'marketId': marketId,
@@ -4629,9 +4650,8 @@ class Exchange(object):
4629
4650
  return [value2, params]
4630
4651
 
4631
4652
  def handle_option(self, methodName: str, optionName: str, defaultValue=None):
4632
- # eslint-disable-next-line no-unused-vars
4633
- result, empty = self.handle_option_and_params({}, methodName, optionName, defaultValue)
4634
- return result
4653
+ res = self.handle_option_and_params({}, methodName, optionName, defaultValue)
4654
+ return self.safe_value(res, 0)
4635
4655
 
4636
4656
  def handle_market_type_and_params(self, methodName: str, market: Market = None, params={}, defaultValue=None):
4637
4657
  """
@@ -4801,6 +4821,18 @@ class Exchange(object):
4801
4821
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
4802
4822
  raise NotSupported(self.id + ' createOrder() is not supported yet')
4803
4823
 
4824
+ def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}):
4825
+ raise NotSupported(self.id + ' createConvertTrade() is not supported yet')
4826
+
4827
+ def fetch_convert_trade(self, id: str, code: Str = None, params={}):
4828
+ raise NotSupported(self.id + ' fetchConvertTrade() is not supported yet')
4829
+
4830
+ def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
4831
+ raise NotSupported(self.id + ' fetchConvertTradeHistory() is not supported yet')
4832
+
4833
+ def fetch_position_mode(self, symbol: Str = None, params={}):
4834
+ raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
4835
+
4804
4836
  def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
4805
4837
  """
4806
4838
  create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
@@ -5392,10 +5424,14 @@ class Exchange(object):
5392
5424
  return self.create_order_ws(symbol, 'market', 'sell', amount, None, params)
5393
5425
 
5394
5426
  def cost_to_precision(self, symbol: str, cost):
5427
+ if cost is None:
5428
+ return None
5395
5429
  market = self.market(symbol)
5396
5430
  return self.decimal_to_precision(cost, TRUNCATE, market['precision']['price'], self.precisionMode, self.paddingMode)
5397
5431
 
5398
5432
  def price_to_precision(self, symbol: str, price):
5433
+ if price is None:
5434
+ return None
5399
5435
  market = self.market(symbol)
5400
5436
  result = self.decimal_to_precision(price, ROUND, market['precision']['price'], self.precisionMode, self.paddingMode)
5401
5437
  if result == '0':
@@ -5403,6 +5439,8 @@ class Exchange(object):
5403
5439
  return result
5404
5440
 
5405
5441
  def amount_to_precision(self, symbol: str, amount):
5442
+ if amount is None:
5443
+ return None
5406
5444
  market = self.market(symbol)
5407
5445
  result = self.decimal_to_precision(amount, TRUNCATE, market['precision']['amount'], self.precisionMode, self.paddingMode)
5408
5446
  if result == '0':
@@ -5410,6 +5448,8 @@ class Exchange(object):
5410
5448
  return result
5411
5449
 
5412
5450
  def fee_to_precision(self, symbol: str, fee):
5451
+ if fee is None:
5452
+ return None
5413
5453
  market = self.market(symbol)
5414
5454
  return self.decimal_to_precision(fee, ROUND, market['precision']['price'], self.precisionMode, self.paddingMode)
5415
5455
 
@@ -5641,14 +5681,16 @@ class Exchange(object):
5641
5681
  results = []
5642
5682
  if isinstance(tickers, list):
5643
5683
  for i in range(0, len(tickers)):
5644
- ticker = self.extend(self.parse_ticker(tickers[i]), params)
5684
+ parsedTicker = self.parse_ticker(tickers[i])
5685
+ ticker = self.extend(parsedTicker, params)
5645
5686
  results.append(ticker)
5646
5687
  else:
5647
5688
  marketIds = list(tickers.keys())
5648
5689
  for i in range(0, len(marketIds)):
5649
5690
  marketId = marketIds[i]
5650
5691
  market = self.safe_market(marketId)
5651
- ticker = self.extend(self.parse_ticker(tickers[marketId], market), params)
5692
+ parsed = self.parse_ticker(tickers[marketId], market)
5693
+ ticker = self.extend(parsed, params)
5652
5694
  results.append(ticker)
5653
5695
  symbols = self.market_symbols(symbols)
5654
5696
  return self.filter_by_array(results, 'symbol', symbols)
ccxt/base/types.py CHANGED
@@ -278,7 +278,7 @@ class Ticker(TypedDict):
278
278
 
279
279
  Tickers = Dict[str, Ticker]
280
280
 
281
-
281
+ OrderBooks = Dict[str, OrderBook]
282
282
  class MarginMode(TypedDict):
283
283
  info: Dict[str, Any]
284
284
  symbol: Str
ccxt/bigone.py CHANGED
@@ -336,17 +336,20 @@ class bigone(Exchange, ImplicitAPI):
336
336
  'limit': 200,
337
337
  'daysBack': None,
338
338
  'untilDays': None,
339
+ 'symbolRequired': True,
339
340
  },
340
341
  'fetchOrder': {
341
342
  'marginMode': False,
342
343
  'trigger': False,
343
344
  'trailing': False,
345
+ 'symbolRequired': False,
344
346
  },
345
347
  'fetchOpenOrders': {
346
348
  'marginMode': False,
347
349
  'limit': 200,
348
350
  'trigger': False,
349
351
  'trailing': False,
352
+ 'symbolRequired': True,
350
353
  },
351
354
  'fetchOrders': {
352
355
  'marginMode': False,
@@ -355,6 +358,7 @@ class bigone(Exchange, ImplicitAPI):
355
358
  'untilDays': None,
356
359
  'trigger': False,
357
360
  'trailing': False,
361
+ 'symbolRequired': True,
358
362
  },
359
363
  'fetchClosedOrders': {
360
364
  'marginMode': False,
@@ -364,6 +368,7 @@ class bigone(Exchange, ImplicitAPI):
364
368
  'untilDays': None,
365
369
  'trigger': False,
366
370
  'trailing': False,
371
+ 'symbolRequired': True,
367
372
  },
368
373
  'fetchOHLCV': {
369
374
  'limit': 500,