bitget 0.0.77__py3-none-any.whl → 0.0.79__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.96'
29
+ __version__ = '4.4.98'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -59,6 +59,7 @@ from ccxt.base.errors import NoChange # noqa: F4
59
59
  from ccxt.base.errors import MarginModeAlreadySet # noqa: F401
60
60
  from ccxt.base.errors import MarketClosed # noqa: F401
61
61
  from ccxt.base.errors import ManualInteractionNeeded # noqa: F401
62
+ from ccxt.base.errors import RestrictedLocation # noqa: F401
62
63
  from ccxt.base.errors import InsufficientFunds # noqa: F401
63
64
  from ccxt.base.errors import InvalidAddress # noqa: F401
64
65
  from ccxt.base.errors import AddressPending # noqa: F401
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.96'
11
+ __version__ = '4.4.98'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -38,6 +38,7 @@ from ccxt.base.errors import NoChange # noqa: F4
38
38
  from ccxt.base.errors import MarginModeAlreadySet # noqa: F401
39
39
  from ccxt.base.errors import MarketClosed # noqa: F401
40
40
  from ccxt.base.errors import ManualInteractionNeeded # noqa: F401
41
+ from ccxt.base.errors import RestrictedLocation # noqa: F401
41
42
  from ccxt.base.errors import InsufficientFunds # noqa: F401
42
43
  from ccxt.base.errors import InvalidAddress # noqa: F401
43
44
  from ccxt.base.errors import AddressPending # noqa: F401
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.96'
5
+ __version__ = '4.4.98'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -176,7 +176,7 @@ class Exchange(BaseExchange):
176
176
  if (socksProxy not in self.socks_proxy_sessions):
177
177
  # Create our SSL context object with our CA cert file
178
178
  self.open() # ensure `asyncio_loop` is set
179
- proxy_session = self.get_socks_proxy_session(socksProxy)
179
+ proxy_session = self.get_socks_proxy_session(socksProxy)
180
180
  # add aiohttp_proxy for python as exclusion
181
181
  elif self.aiohttp_proxy:
182
182
  final_proxy = self.aiohttp_proxy
@@ -3817,6 +3817,9 @@ class bitget(Exchange, ImplicitAPI):
3817
3817
  if historicalEndpointNeeded:
3818
3818
  response = await self.publicSpotGetV2SpotMarketHistoryCandles(self.extend(request, params))
3819
3819
  else:
3820
+ if not limitDefined:
3821
+ request['limit'] = 1000
3822
+ limit = 1000
3820
3823
  response = await self.publicSpotGetV2SpotMarketCandles(self.extend(request, params))
3821
3824
  else:
3822
3825
  priceType = None
@@ -3825,8 +3828,14 @@ class bitget(Exchange, ImplicitAPI):
3825
3828
  productType, params = self.handle_product_type_and_params(market, params)
3826
3829
  request['productType'] = productType
3827
3830
  extended = self.extend(request, params)
3828
- # todo: mark & index also have their "recent" endpoints, but not priority now.
3829
- if priceType == 'mark':
3831
+ if not historicalEndpointNeeded and (priceType == 'mark' or priceType == 'index'):
3832
+ if not limitDefined:
3833
+ extended['limit'] = 1000
3834
+ limit = 1000
3835
+ # Recent endpoint for mark/index prices
3836
+ # https://www.bitget.com/api-doc/contract/market/Get-Candle-Data
3837
+ response = await self.publicMixGetV2MixMarketCandles(self.extend({'kLineType': priceType}, extended))
3838
+ elif priceType == 'mark':
3830
3839
  response = await self.publicMixGetV2MixMarketHistoryMarkCandles(extended)
3831
3840
  elif priceType == 'index':
3832
3841
  response = await self.publicMixGetV2MixMarketHistoryIndexCandles(extended)
@@ -3834,6 +3843,9 @@ class bitget(Exchange, ImplicitAPI):
3834
3843
  if historicalEndpointNeeded:
3835
3844
  response = await self.publicMixGetV2MixMarketHistoryCandles(extended)
3836
3845
  else:
3846
+ if not limitDefined:
3847
+ extended['limit'] = 1000
3848
+ limit = 1000
3837
3849
  response = await self.publicMixGetV2MixMarketCandles(extended)
3838
3850
  if response == '':
3839
3851
  return [] # happens when a new token is listed
@@ -33,25 +33,23 @@ NO_PADDING = 5
33
33
  PAD_WITH_ZERO = 6
34
34
 
35
35
 
36
- def decimal_to_precision(n, rounding_mode=ROUND, numPrecisionDigits=None, counting_mode=DECIMAL_PLACES, padding_mode=NO_PADDING):
37
- assert numPrecisionDigits is not None, 'numPrecisionDigits should not be None'
36
+ def decimal_to_precision(n, rounding_mode=ROUND, precision=None, counting_mode=DECIMAL_PLACES, padding_mode=NO_PADDING):
37
+ assert precision is not None, 'precision should not be None'
38
38
 
39
- if isinstance(numPrecisionDigits, str):
40
- numPrecisionDigits = float(numPrecisionDigits)
41
- assert isinstance(numPrecisionDigits, float) or isinstance(numPrecisionDigits, decimal.Decimal) or isinstance(numPrecisionDigits, numbers.Integral), 'numPrecisionDigits has an invalid number'
39
+ if isinstance(precision, str):
40
+ precision = float(precision)
41
+ assert isinstance(precision, float) or isinstance(precision, decimal.Decimal) or isinstance(precision, numbers.Integral), 'precision has an invalid number'
42
42
 
43
43
  if counting_mode == TICK_SIZE:
44
- assert numPrecisionDigits > 0, 'negative or zero numPrecisionDigits can not be used with TICK_SIZE precisionMode'
44
+ assert precision > 0, 'negative or zero precision can not be used with TICK_SIZE precisionMode'
45
45
  else:
46
- assert isinstance(numPrecisionDigits, numbers.Integral)
46
+ assert isinstance(precision, numbers.Integral)
47
47
 
48
48
  assert rounding_mode in [TRUNCATE, ROUND]
49
49
  assert counting_mode in [DECIMAL_PLACES, SIGNIFICANT_DIGITS, TICK_SIZE]
50
50
  assert padding_mode in [NO_PADDING, PAD_WITH_ZERO]
51
51
  # end of checks
52
52
 
53
- precision = numPrecisionDigits # "precision" variable name was in signature, but to make function signature similar to php/js, I had to change the argument name to "numPrecisionDigits". however, the below codes use "precision" variable name, so we have to assign that name here (you can change the usage of 'precision' variable name below everywhere, but i've refrained to do that to avoid many changes)
54
-
55
53
  context = decimal.getcontext()
56
54
 
57
55
  if counting_mode != TICK_SIZE:
@@ -23,6 +23,7 @@ error_hierarchy = {
23
23
  },
24
24
  'MarketClosed': {},
25
25
  'ManualInteractionNeeded': {},
26
+ 'RestrictedLocation': {},
26
27
  },
27
28
  'InsufficientFunds': {},
28
29
  'InvalidAddress': {
@@ -118,6 +119,10 @@ class ManualInteractionNeeded(OperationRejected):
118
119
  pass
119
120
 
120
121
 
122
+ class RestrictedLocation(OperationRejected):
123
+ pass
124
+
125
+
121
126
  class InsufficientFunds(ExchangeError):
122
127
  pass
123
128
 
@@ -238,6 +243,7 @@ __all__ = [
238
243
  'MarginModeAlreadySet',
239
244
  'MarketClosed',
240
245
  'ManualInteractionNeeded',
246
+ 'RestrictedLocation',
241
247
  'InsufficientFunds',
242
248
  'InvalidAddress',
243
249
  'AddressPending',
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.96'
7
+ __version__ = '4.4.98'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
bitget/ccxt/bitget.py CHANGED
@@ -3816,6 +3816,9 @@ class bitget(Exchange, ImplicitAPI):
3816
3816
  if historicalEndpointNeeded:
3817
3817
  response = self.publicSpotGetV2SpotMarketHistoryCandles(self.extend(request, params))
3818
3818
  else:
3819
+ if not limitDefined:
3820
+ request['limit'] = 1000
3821
+ limit = 1000
3819
3822
  response = self.publicSpotGetV2SpotMarketCandles(self.extend(request, params))
3820
3823
  else:
3821
3824
  priceType = None
@@ -3824,8 +3827,14 @@ class bitget(Exchange, ImplicitAPI):
3824
3827
  productType, params = self.handle_product_type_and_params(market, params)
3825
3828
  request['productType'] = productType
3826
3829
  extended = self.extend(request, params)
3827
- # todo: mark & index also have their "recent" endpoints, but not priority now.
3828
- if priceType == 'mark':
3830
+ if not historicalEndpointNeeded and (priceType == 'mark' or priceType == 'index'):
3831
+ if not limitDefined:
3832
+ extended['limit'] = 1000
3833
+ limit = 1000
3834
+ # Recent endpoint for mark/index prices
3835
+ # https://www.bitget.com/api-doc/contract/market/Get-Candle-Data
3836
+ response = self.publicMixGetV2MixMarketCandles(self.extend({'kLineType': priceType}, extended))
3837
+ elif priceType == 'mark':
3829
3838
  response = self.publicMixGetV2MixMarketHistoryMarkCandles(extended)
3830
3839
  elif priceType == 'index':
3831
3840
  response = self.publicMixGetV2MixMarketHistoryIndexCandles(extended)
@@ -3833,6 +3842,9 @@ class bitget(Exchange, ImplicitAPI):
3833
3842
  if historicalEndpointNeeded:
3834
3843
  response = self.publicMixGetV2MixMarketHistoryCandles(extended)
3835
3844
  else:
3845
+ if not limitDefined:
3846
+ extended['limit'] = 1000
3847
+ limit = 1000
3836
3848
  response = self.publicMixGetV2MixMarketCandles(extended)
3837
3849
  if response == '':
3838
3850
  return [] # happens when a new token is listed
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.96'
11
+ __version__ = '4.4.98'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -31,6 +31,7 @@ from ccxt.base.errors import NoChange # noqa: F4
31
31
  from ccxt.base.errors import MarginModeAlreadySet # noqa: F401
32
32
  from ccxt.base.errors import MarketClosed # noqa: F401
33
33
  from ccxt.base.errors import ManualInteractionNeeded # noqa: F401
34
+ from ccxt.base.errors import RestrictedLocation # noqa: F401
34
35
  from ccxt.base.errors import InsufficientFunds # noqa: F401
35
36
  from ccxt.base.errors import InvalidAddress # noqa: F401
36
37
  from ccxt.base.errors import AddressPending # noqa: F401
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitget
3
- Version: 0.0.77
3
+ Version: 0.0.79
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,11 +1,11 @@
1
1
  bitget/__init__.py,sha256=D5tG1_AjwXjMim3CPnCuWSheOXtq4vlSwVCS5ZG1bMQ,246
2
- bitget/ccxt/__init__.py,sha256=ATBu0xXeUcJCjDjVN8p-SHX2Oi9tPd-pNYgI4O2D790,6048
3
- bitget/ccxt/bitget.py,sha256=7IHFajA2BNw1C349M04z6YybdEz4p7rjsUXssA9CuZU,450352
2
+ bitget/ccxt/__init__.py,sha256=q2_rtH1AShbUAiOtLa3qiOWFj0-BGL5gqnROVcIPvEU,6131
3
+ bitget/ccxt/bitget.py,sha256=2gHZy2lzbBnHjlD9R3a1uNaa-mHbxzYPz2rPTmSjvk4,450963
4
4
  bitget/ccxt/abstract/bitget.py,sha256=6q34nW4J1Vfvls4tExxZRJt0Ct28hCO0TQja_Mb_bmI,99978
5
- bitget/ccxt/async_support/__init__.py,sha256=gYqIM4mM0PYDcLMeIuNv8pJ3EkXfQ3KcXan_JpXJCx8,4781
6
- bitget/ccxt/async_support/bitget.py,sha256=bmm9xyMAZ9v9uJW5BR6Sg3QBAurwz7j004Ly-HGMqQM,452095
5
+ bitget/ccxt/async_support/__init__.py,sha256=YlxmFhcrTyKI7lOcebc93PMpJnRdW1nBnpMG8gcZnnQ,4864
6
+ bitget/ccxt/async_support/bitget.py,sha256=WjCyaNXQnV2F5r0pYedAFVN-ExcYN0TvC_eXO-olQ_E,452712
7
7
  bitget/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- bitget/ccxt/async_support/base/exchange.py,sha256=5YrTOaoiX9ws39WT_JWs_g3anZAMiPSc1eXiD56Sh0Q,119773
8
+ bitget/ccxt/async_support/base/exchange.py,sha256=h7rGS7bj1QxT69nooadJgVM1UToAauxTskymPAMf7wo,119769
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
@@ -15,12 +15,12 @@ bitget/ccxt/async_support/base/ws/future.py,sha256=hjdQ42zkfju5nar0GpTLJ4zXQBtgB
15
15
  bitget/ccxt/async_support/base/ws/order_book.py,sha256=uBUaIHhzMRykpmo4BCsdJ-t_HozS6VxhEs8x-Kbj-NI,2894
16
16
  bitget/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9produGjmBJLCI5FHIRdMz1O-g,6551
17
17
  bitget/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
18
- bitget/ccxt/base/decimal_to_precision.py,sha256=XQNziSPUz4UqhIvNx0aDx6-3wSSgZBTsMX57rM7WGPM,7330
19
- bitget/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
20
- bitget/ccxt/base/exchange.py,sha256=3LI4McirkCUEz1090jMfedqTtOae-Gqcl94_oeNf23c,333932
18
+ bitget/ccxt/base/decimal_to_precision.py,sha256=3XI30u9YudHbTA438397u5rkdlXa3atxwZEfUus3C4k,6803
19
+ bitget/ccxt/base/errors.py,sha256=OGhWNvNtRlJOzFx-n1x3ZjTnaPpfWH0Vc0xACS-MeDw,5012
20
+ bitget/ccxt/base/exchange.py,sha256=5KgAUmwjrHelR87gaxFRZzaju7B3csvnlUzkuw6mpJE,333932
21
21
  bitget/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
22
22
  bitget/ccxt/base/types.py,sha256=vMQfFDVntED4YHrRJt0Q98YaM7OtGhK-DkbkqXFTYHc,11485
23
- bitget/ccxt/pro/__init__.py,sha256=jn8mQixqcA5MpjDArx45_4HgnMHLIPhnZTHcNL7AC4M,4095
23
+ bitget/ccxt/pro/__init__.py,sha256=5eh-oF9snhsiIqOpupayoeENhgPWcCUbJsfsHrnQM-s,4178
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.77.dist-info/METADATA,sha256=Z9G7zxvbkbsgIT-uoBq6Wz4-I_a40vwIKerAErT9-Nk,44111
285
- bitget-0.0.77.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
- bitget-0.0.77.dist-info/RECORD,,
284
+ bitget-0.0.79.dist-info/METADATA,sha256=wdTI-pMPAizXt-qKyL5qVGShgqdnslYvOyljZcP9pIc,44111
285
+ bitget-0.0.79.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
+ bitget-0.0.79.dist-info/RECORD,,