bitget 0.0.70__py3-none-any.whl → 0.0.72__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.
bitget/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.91'
29
+ __version__ = '4.4.93'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.91'
11
+ __version__ = '4.4.93'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.91'
5
+ __version__ = '4.4.93'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -1573,6 +1573,9 @@ class Exchange(BaseExchange):
1573
1573
  async def fetch_greeks(self, symbol: str, params={}):
1574
1574
  raise NotSupported(self.id + ' fetchGreeks() is not supported yet')
1575
1575
 
1576
+ async def fetch_all_greeks(self, symbols: Strings = None, params={}):
1577
+ raise NotSupported(self.id + ' fetchAllGreeks() is not supported yet')
1578
+
1576
1579
  async def fetch_option_chain(self, code: str, params={}):
1577
1580
  raise NotSupported(self.id + ' fetchOptionChain() is not supported yet')
1578
1581
 
@@ -134,9 +134,12 @@ class Client(object):
134
134
  error = NetworkError(str(exception))
135
135
  if self.verbose:
136
136
  self.log(iso8601(milliseconds()), 'receive_loop', 'Exception', error)
137
- self.reset(error)
137
+ self.reject(error)
138
138
 
139
139
  task.add_done_callback(after_interrupt)
140
+ else:
141
+ # connection got terminated after the connection was made and before the receive loop ran
142
+ self.on_close(1006)
140
143
 
141
144
  async def open(self, session, backoff_delay=0):
142
145
  # exponential backoff for consequent connections if necessary
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.91'
7
+ __version__ = '4.4.93'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1515,6 +1515,12 @@ class Exchange(object):
1515
1515
  parts = re.sub(r'0+$', '', str).split('.')
1516
1516
  return len(parts[1]) if len(parts) > 1 else 0
1517
1517
 
1518
+ def map_to_safe_map(self, dictionary):
1519
+ return dictionary # wrapper for go
1520
+
1521
+ def safe_map_to_map(self, dictionary):
1522
+ return dictionary # wrapper for go
1523
+
1518
1524
  def load_markets(self, reload=False, params={}):
1519
1525
  """
1520
1526
  Loads and prepares the markets for trading.
@@ -3222,14 +3228,14 @@ class Exchange(object):
3222
3228
  else:
3223
3229
  market['subType'] = None
3224
3230
  values.append(market)
3225
- self.markets = self.index_by(values, 'symbol')
3231
+ self.markets = self.map_to_safe_map(self.index_by(values, 'symbol'))
3226
3232
  marketsSortedBySymbol = self.keysort(self.markets)
3227
3233
  marketsSortedById = self.keysort(self.markets_by_id)
3228
3234
  self.symbols = list(marketsSortedBySymbol.keys())
3229
3235
  self.ids = list(marketsSortedById.keys())
3230
3236
  if currencies is not None:
3231
3237
  # currencies is always None when called in constructor but not when called from loadMarkets
3232
- self.currencies = self.deep_extend(self.currencies, currencies)
3238
+ self.currencies = self.map_to_safe_map(self.deep_extend(self.currencies, currencies))
3233
3239
  else:
3234
3240
  baseCurrencies = []
3235
3241
  quoteCurrencies = []
@@ -3255,8 +3261,8 @@ class Exchange(object):
3255
3261
  quoteCurrencies.append(currency)
3256
3262
  baseCurrencies = self.sort_by(baseCurrencies, 'code', False, '')
3257
3263
  quoteCurrencies = self.sort_by(quoteCurrencies, 'code', False, '')
3258
- self.baseCurrencies = self.index_by(baseCurrencies, 'code')
3259
- self.quoteCurrencies = self.index_by(quoteCurrencies, 'code')
3264
+ self.baseCurrencies = self.map_to_safe_map(self.index_by(baseCurrencies, 'code'))
3265
+ self.quoteCurrencies = self.map_to_safe_map(self.index_by(quoteCurrencies, 'code'))
3260
3266
  allCurrencies = self.array_concat(baseCurrencies, quoteCurrencies)
3261
3267
  groupedCurrencies = self.group_by(allCurrencies, 'code')
3262
3268
  codes = list(groupedCurrencies.keys())
@@ -3273,7 +3279,7 @@ class Exchange(object):
3273
3279
  highestPrecisionCurrency = currentCurrency if (currentCurrency['precision'] > highestPrecisionCurrency['precision']) else highestPrecisionCurrency
3274
3280
  resultingCurrencies.append(highestPrecisionCurrency)
3275
3281
  sortedCurrencies = self.sort_by(resultingCurrencies, 'code')
3276
- self.currencies = self.deep_extend(self.currencies, self.index_by(sortedCurrencies, 'code'))
3282
+ self.currencies = self.map_to_safe_map(self.deep_extend(self.currencies, self.index_by(sortedCurrencies, 'code')))
3277
3283
  self.currencies_by_id = self.index_by_safe(self.currencies, 'id')
3278
3284
  currenciesSortedByCode = self.keysort(self.currencies)
3279
3285
  self.codes = list(currenciesSortedByCode.keys())
@@ -4223,7 +4229,7 @@ class Exchange(object):
4223
4229
  return self.filter_by_since_limit(sorted, since, limit, 0, tail)
4224
4230
 
4225
4231
  def parse_leverage_tiers(self, response: Any, symbols: List[str] = None, marketIdKey=None):
4226
- # marketIdKey should only be None when response is a dictionary
4232
+ # marketIdKey should only be None when response is a dictionary.
4227
4233
  symbols = self.market_symbols(symbols)
4228
4234
  tiers = {}
4229
4235
  symbolsLength = 0
@@ -5444,6 +5450,9 @@ class Exchange(object):
5444
5450
  def fetch_greeks(self, symbol: str, params={}):
5445
5451
  raise NotSupported(self.id + ' fetchGreeks() is not supported yet')
5446
5452
 
5453
+ def fetch_all_greeks(self, symbols: Strings = None, params={}):
5454
+ raise NotSupported(self.id + ' fetchAllGreeks() is not supported yet')
5455
+
5447
5456
  def fetch_option_chain(self, code: str, params={}):
5448
5457
  raise NotSupported(self.id + ' fetchOptionChain() is not supported yet')
5449
5458
 
@@ -5697,10 +5706,16 @@ class Exchange(object):
5697
5706
  precisionNumber = int(precision)
5698
5707
  if precisionNumber == 0:
5699
5708
  return '1'
5700
- parsedPrecision = '0.'
5701
- for i in range(0, precisionNumber - 1):
5702
- parsedPrecision = parsedPrecision + '0'
5703
- return parsedPrecision + '1'
5709
+ if precisionNumber > 0:
5710
+ parsedPrecision = '0.'
5711
+ for i in range(0, precisionNumber - 1):
5712
+ parsedPrecision = parsedPrecision + '0'
5713
+ return parsedPrecision + '1'
5714
+ else:
5715
+ parsedPrecision = '1'
5716
+ for i in range(0, precisionNumber * -1 - 1):
5717
+ parsedPrecision = parsedPrecision + '0'
5718
+ return parsedPrecision + '0'
5704
5719
 
5705
5720
  def integer_precision_to_amount(self, precision: Str):
5706
5721
  """
@@ -6676,6 +6691,27 @@ class Exchange(object):
6676
6691
  def parse_greeks(self, greeks: dict, market: Market = None):
6677
6692
  raise NotSupported(self.id + ' parseGreeks() is not supported yet')
6678
6693
 
6694
+ def parse_all_greeks(self, greeks, symbols: Strings = None, params={}):
6695
+ #
6696
+ # the value of greeks is either a dict or a list
6697
+ #
6698
+ results = []
6699
+ if isinstance(greeks, list):
6700
+ for i in range(0, len(greeks)):
6701
+ parsedTicker = self.parse_greeks(greeks[i])
6702
+ greek = self.extend(parsedTicker, params)
6703
+ results.append(greek)
6704
+ else:
6705
+ marketIds = list(greeks.keys())
6706
+ for i in range(0, len(marketIds)):
6707
+ marketId = marketIds[i]
6708
+ market = self.safe_market(marketId)
6709
+ parsed = self.parse_greeks(greeks[marketId], market)
6710
+ greek = self.extend(parsed, params)
6711
+ results.append(greek)
6712
+ symbols = self.market_symbols(symbols)
6713
+ return self.filter_by_array(results, 'symbol', symbols)
6714
+
6679
6715
  def parse_option(self, chain: dict, currency: Currency = None, market: Market = None):
6680
6716
  raise NotSupported(self.id + ' parseOption() is not supported yet')
6681
6717
 
@@ -6792,7 +6828,7 @@ class Exchange(object):
6792
6828
  return reconstructedDate
6793
6829
 
6794
6830
  def convert_market_id_expire_date(self, date: str):
6795
- # parse 03JAN24 to 240103
6831
+ # parse 03JAN24 to 240103.
6796
6832
  monthMappping = {
6797
6833
  'JAN': '01',
6798
6834
  'FEB': '02',
@@ -6877,14 +6913,27 @@ class Exchange(object):
6877
6913
  """
6878
6914
  raise NotSupported(self.id + ' fetchTransfers() is not supported yet')
6879
6915
 
6880
- def clean_unsubscription(self, client, subHash: str, unsubHash: str):
6916
+ def clean_unsubscription(self, client, subHash: str, unsubHash: str, subHashIsPrefix=False):
6881
6917
  if unsubHash in client.subscriptions:
6882
6918
  del client.subscriptions[unsubHash]
6883
- if subHash in client.subscriptions:
6884
- del client.subscriptions[subHash]
6885
- if subHash in client.futures:
6886
- error = UnsubscribeError(self.id + ' ' + subHash)
6887
- client.reject(error, subHash)
6919
+ if not subHashIsPrefix:
6920
+ if subHash in client.subscriptions:
6921
+ del client.subscriptions[subHash]
6922
+ if subHash in client.futures:
6923
+ error = UnsubscribeError(self.id + ' ' + subHash)
6924
+ client.reject(error, subHash)
6925
+ else:
6926
+ clientSubscriptions = list(client.subscriptions.keys())
6927
+ for i in range(0, len(clientSubscriptions)):
6928
+ sub = clientSubscriptions[i]
6929
+ if sub.startswith(subHash):
6930
+ del client.subscriptions[sub]
6931
+ clientFutures = list(client.futures.keys())
6932
+ for i in range(0, len(clientFutures)):
6933
+ future = clientFutures[i]
6934
+ if future.startswith(subHash):
6935
+ error = UnsubscribeError(self.id + ' ' + future)
6936
+ client.reject(error, future)
6888
6937
  client.resolve(True, unsubHash)
6889
6938
 
6890
6939
  def clean_cache(self, subscription: dict):
@@ -6914,19 +6963,9 @@ class Exchange(object):
6914
6963
  del self.tickers[symbol]
6915
6964
  else:
6916
6965
  if topic == 'myTrades' and (self.myTrades is not None):
6917
- # don't reset self.myTrades directly here
6918
- # because in c# we need to use a different object(thread-safe dict)
6919
- keys = list(self.myTrades.keys())
6920
- for i in range(0, len(keys)):
6921
- key = keys[i]
6922
- if key in self.myTrades:
6923
- del self.myTrades[key]
6966
+ self.myTrades = None
6924
6967
  elif topic == 'orders' and (self.orders is not None):
6925
- orderSymbols = list(self.orders.keys())
6926
- for i in range(0, len(orderSymbols)):
6927
- orderSymbol = orderSymbols[i]
6928
- if orderSymbol in self.orders:
6929
- del self.orders[orderSymbol]
6968
+ self.orders = None
6930
6969
  elif topic == 'ticker' and (self.tickers is not None):
6931
6970
  tickerSymbols = list(self.tickers.keys())
6932
6971
  for i in range(0, len(tickerSymbols)):
bitget/ccxt/base/types.py CHANGED
@@ -606,3 +606,4 @@ class ConstructorArgs(TypedDict, total=False):
606
606
  hostname: str
607
607
  urls: Dict[str, Any]
608
608
  headers: Dict[str, Any]
609
+ session: Any
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.91'
11
+ __version__ = '4.4.93'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitget
3
- Version: 0.0.70
3
+ Version: 0.0.72
4
4
  Summary: bitget crypto exchange api client
5
5
  Project-URL: Homepage, https://github.com/ccxt/ccxt
6
6
  Project-URL: Issues, https://github.com/ccxt/ccxt
@@ -1,15 +1,15 @@
1
1
  bitget/__init__.py,sha256=D5tG1_AjwXjMim3CPnCuWSheOXtq4vlSwVCS5ZG1bMQ,246
2
- bitget/ccxt/__init__.py,sha256=gHtrCEQyU3T-l4mb0f_1rBrWsvS9YqHe-XJJMF3fZqY,6048
2
+ bitget/ccxt/__init__.py,sha256=Q450UeYjxmWaFB_HcTDAd5EcfRzBBJQhiKOPWAGKwY4,6048
3
3
  bitget/ccxt/bitget.py,sha256=e6ssz20PaoHGhU9bL0fDs4q54HGB-_BkssQGelOOW_0,453846
4
4
  bitget/ccxt/abstract/bitget.py,sha256=6q34nW4J1Vfvls4tExxZRJt0Ct28hCO0TQja_Mb_bmI,99978
5
- bitget/ccxt/async_support/__init__.py,sha256=7kJ1lJApC3lQB5ru5ogMxqpOojNzMuwp9PeHW1wzQUw,4781
5
+ bitget/ccxt/async_support/__init__.py,sha256=ClqxRSV7I9qn3TuVBeukP3s7qjn8GfyeeKnTZsuYIHw,4781
6
6
  bitget/ccxt/async_support/bitget.py,sha256=sPHtswNgPICInGQshCx2B1FxTmzf71mHVFQIxImZeew,455589
7
7
  bitget/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- bitget/ccxt/async_support/base/exchange.py,sha256=RBB3v5Eqi6U0twVnaocSBCk0MD87meBQdYIz_mGCRUs,119286
8
+ bitget/ccxt/async_support/base/exchange.py,sha256=WRCIHpPMqJ4UpcL4x534QQWA1Bo4RFS1xJitRjKFViw,119440
9
9
  bitget/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  bitget/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  bitget/ccxt/async_support/base/ws/cache.py,sha256=xf2VOtfUwloxSlIQ39M1RGZHWQzyS9IGhB5NX6cDcAc,8370
12
- bitget/ccxt/async_support/base/ws/client.py,sha256=3H6NnHk7GIC6wqJ49eshuvy5MnT3ma4cnAPSWKNy6S8,13475
12
+ bitget/ccxt/async_support/base/ws/client.py,sha256=ekIN5HNgeQgMG3tLZMsE889Aoxs960DLwQnwkTGhdi8,13624
13
13
  bitget/ccxt/async_support/base/ws/functions.py,sha256=qwvEnjtINWL5ZU-dbbeIunjyBxzFqbGWHfVhxqAcKug,1499
14
14
  bitget/ccxt/async_support/base/ws/future.py,sha256=9yFyxqT7cl-7ZFM6LM4b6UPXyO2FGIbAhs5uoJ3-Smo,1271
15
15
  bitget/ccxt/async_support/base/ws/order_book.py,sha256=uBUaIHhzMRykpmo4BCsdJ-t_HozS6VxhEs8x-Kbj-NI,2894
@@ -17,10 +17,10 @@ bitget/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9pr
17
17
  bitget/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
18
18
  bitget/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
19
19
  bitget/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
20
- bitget/ccxt/base/exchange.py,sha256=wjO_dKXa2T3CqHP7jZtL7grD_tifCcNn_wew8PNCotc,328697
20
+ bitget/ccxt/base/exchange.py,sha256=64LNTmAxXu8gUG6n4pwCNjTmVZmV0otj7ceWXRB3G6o,330373
21
21
  bitget/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
22
- bitget/ccxt/base/types.py,sha256=IbLO7Ni-plO36xlOdJQFqujSJBq0q9qll009ShZ0M_U,11468
23
- bitget/ccxt/pro/__init__.py,sha256=TCiEhsY7Khvua2nhaBzQoV6IvEL-Lhvy2cjUjFeY5rA,4095
22
+ bitget/ccxt/base/types.py,sha256=vMQfFDVntED4YHrRJt0Q98YaM7OtGhK-DkbkqXFTYHc,11485
23
+ bitget/ccxt/pro/__init__.py,sha256=NyLL43qjDL84uKp6zZs34l9T3RC0FxaBe1j7G3nzlhg,4095
24
24
  bitget/ccxt/pro/bitget.py,sha256=g8SkdhTze-idsChWiGIBi1twpiDfRlJyvnG2NL9VsR0,90372
25
25
  bitget/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
26
26
  bitget/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
@@ -281,6 +281,6 @@ bitget/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX
281
281
  bitget/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
282
282
  bitget/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
283
283
  bitget/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
284
- bitget-0.0.70.dist-info/METADATA,sha256=adJwtOcN-_EI7HJrB37WXCk3DasFdohI3Y3dXBuGmMw,44111
285
- bitget-0.0.70.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
- bitget-0.0.70.dist-info/RECORD,,
284
+ bitget-0.0.72.dist-info/METADATA,sha256=KLzm_k_CoY6uzv43Pq3HOs7SC9CsM78jBZpdsXstuRA,44111
285
+ bitget-0.0.72.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
+ bitget-0.0.72.dist-info/RECORD,,