bitget 0.0.67__py3-none-any.whl → 0.0.70__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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.88'
7
+ __version__ = '4.4.91'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -906,6 +906,10 @@ class Exchange(object):
906
906
  def keysort(dictionary):
907
907
  return collections.OrderedDict(sorted(dictionary.items(), key=lambda t: t[0]))
908
908
 
909
+ @staticmethod
910
+ def sort(array):
911
+ return sorted(array)
912
+
909
913
  @staticmethod
910
914
  def extend(*args):
911
915
  if args is not None:
@@ -956,6 +960,11 @@ class Exchange(object):
956
960
  def groupBy(array, key):
957
961
  return Exchange.group_by(array, key)
958
962
 
963
+
964
+ @staticmethod
965
+ def index_by_safe(array, key):
966
+ return Exchange.index_by(array, key) # wrapper for go
967
+
959
968
  @staticmethod
960
969
  def index_by(array, key):
961
970
  result = {}
@@ -1037,7 +1046,7 @@ class Exchange(object):
1037
1046
  return _urlencode.urlencode(result, quote_via=_urlencode.quote)
1038
1047
 
1039
1048
  @staticmethod
1040
- def rawencode(params={}):
1049
+ def rawencode(params={}, sort=False):
1041
1050
  return _urlencode.unquote(Exchange.urlencode(params))
1042
1051
 
1043
1052
  @staticmethod
@@ -2571,6 +2580,9 @@ class Exchange(object):
2571
2580
  def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}):
2572
2581
  raise NotSupported(self.id + ' watchTrades() is not supported yet')
2573
2582
 
2583
+ def un_watch_orders(self, symbol: Str = None, params={}):
2584
+ raise NotSupported(self.id + ' unWatchOrders() is not supported yet')
2585
+
2574
2586
  def un_watch_trades(self, symbol: str, params={}):
2575
2587
  raise NotSupported(self.id + ' unWatchTrades() is not supported yet')
2576
2588
 
@@ -3187,7 +3199,7 @@ class Exchange(object):
3187
3199
 
3188
3200
  def set_markets(self, markets, currencies=None):
3189
3201
  values = []
3190
- self.markets_by_id = {}
3202
+ self.markets_by_id = self.create_safe_dictionary()
3191
3203
  # handle marketId conflicts
3192
3204
  # we insert spot markets first
3193
3205
  marketValues = self.sort_by(self.to_array(markets), 'spot', True, True)
@@ -3262,7 +3274,7 @@ class Exchange(object):
3262
3274
  resultingCurrencies.append(highestPrecisionCurrency)
3263
3275
  sortedCurrencies = self.sort_by(resultingCurrencies, 'code')
3264
3276
  self.currencies = self.deep_extend(self.currencies, self.index_by(sortedCurrencies, 'code'))
3265
- self.currencies_by_id = self.index_by(self.currencies, 'id')
3277
+ self.currencies_by_id = self.index_by_safe(self.currencies, 'id')
3266
3278
  currenciesSortedByCode = self.keysort(self.currencies)
3267
3279
  self.codes = list(currenciesSortedByCode.keys())
3268
3280
  return self.markets
@@ -6885,7 +6897,7 @@ class Exchange(object):
6885
6897
  symbolAndTimeFrame = symbolsAndTimeFrames[i]
6886
6898
  symbol = self.safe_string(symbolAndTimeFrame, 0)
6887
6899
  timeframe = self.safe_string(symbolAndTimeFrame, 1)
6888
- if symbol in self.ohlcvs:
6900
+ if (self.ohlcvs is not None) and (symbol in self.ohlcvs):
6889
6901
  if timeframe in self.ohlcvs[symbol]:
6890
6902
  del self.ohlcvs[symbol][timeframe]
6891
6903
  elif symbolsLength > 0:
@@ -6901,7 +6913,7 @@ class Exchange(object):
6901
6913
  if symbol in self.tickers:
6902
6914
  del self.tickers[symbol]
6903
6915
  else:
6904
- if topic == 'myTrades':
6916
+ if topic == 'myTrades' and (self.myTrades is not None):
6905
6917
  # don't reset self.myTrades directly here
6906
6918
  # because in c# we need to use a different object(thread-safe dict)
6907
6919
  keys = list(self.myTrades.keys())
@@ -6909,13 +6921,13 @@ class Exchange(object):
6909
6921
  key = keys[i]
6910
6922
  if key in self.myTrades:
6911
6923
  del self.myTrades[key]
6912
- elif topic == 'orders':
6924
+ elif topic == 'orders' and (self.orders is not None):
6913
6925
  orderSymbols = list(self.orders.keys())
6914
6926
  for i in range(0, len(orderSymbols)):
6915
6927
  orderSymbol = orderSymbols[i]
6916
6928
  if orderSymbol in self.orders:
6917
6929
  del self.orders[orderSymbol]
6918
- elif topic == 'ticker':
6930
+ elif topic == 'ticker' and (self.tickers is not None):
6919
6931
  tickerSymbols = list(self.tickers.keys())
6920
6932
  for i in range(0, len(tickerSymbols)):
6921
6933
  tickerSymbol = tickerSymbols[i]