bitget 0.0.67__py3-none-any.whl → 0.0.69__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.90'
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
@@ -3187,7 +3196,7 @@ class Exchange(object):
3187
3196
 
3188
3197
  def set_markets(self, markets, currencies=None):
3189
3198
  values = []
3190
- self.markets_by_id = {}
3199
+ self.markets_by_id = self.create_safe_dictionary()
3191
3200
  # handle marketId conflicts
3192
3201
  # we insert spot markets first
3193
3202
  marketValues = self.sort_by(self.to_array(markets), 'spot', True, True)
@@ -3262,7 +3271,7 @@ class Exchange(object):
3262
3271
  resultingCurrencies.append(highestPrecisionCurrency)
3263
3272
  sortedCurrencies = self.sort_by(resultingCurrencies, 'code')
3264
3273
  self.currencies = self.deep_extend(self.currencies, self.index_by(sortedCurrencies, 'code'))
3265
- self.currencies_by_id = self.index_by(self.currencies, 'id')
3274
+ self.currencies_by_id = self.index_by_safe(self.currencies, 'id')
3266
3275
  currenciesSortedByCode = self.keysort(self.currencies)
3267
3276
  self.codes = list(currenciesSortedByCode.keys())
3268
3277
  return self.markets