gate-io-api 0.0.72__py3-none-any.whl → 0.0.74__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.

Potentially problematic release.


This version of gate-io-api might be problematic. Click here for more details.

gate/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.93'
29
+ __version__ = '4.4.95'
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.93'
11
+ __version__ = '4.4.95'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.93'
5
+ __version__ = '4.4.95'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -36,6 +36,8 @@ class Future(asyncio.Future):
36
36
  elif cancelled:
37
37
  future.cancel()
38
38
  else:
39
+ if future.cancelled():
40
+ return
39
41
  first_result = list(complete)[0].result()
40
42
  future.set_result(first_result)
41
43
  task.add_done_callback(callback)
@@ -3755,7 +3755,7 @@ class gate(Exchange, ImplicitAPI):
3755
3755
  start = self.parse_to_int(since / 1000)
3756
3756
  request['from'] = start
3757
3757
  request['to'] = self.sum(start, 30 * 24 * 60 * 60)
3758
- request, params = self.handle_until_option('to', request, params)
3758
+ request, params = self.handle_until_option('to', request, params, 0.001)
3759
3759
  response = await self.privateWalletGetDeposits(self.extend(request, params))
3760
3760
  return self.parse_transactions(response, currency)
3761
3761
 
gate/ccxt/base/errors.py CHANGED
@@ -1,9 +1,3 @@
1
- # ----------------------------------------------------------------------------
2
-
3
- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
- # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
- # EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
-
7
1
  error_hierarchy = {
8
2
  'BaseError': {
9
3
  'ExchangeError': {
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.93'
7
+ __version__ = '4.4.95'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2839,7 +2839,7 @@ class Exchange(object):
2839
2839
  # keep self in mind:
2840
2840
  # in JS: 1 == 1.0 is True; 1 == 1.0 is True
2841
2841
  # in Python: 1 == 1.0 is True
2842
- # in PHP 1 == 1.0 is True, but 1 == 1.0 is False
2842
+ # in PHP 1 == 1.0 is True, but 1 == 1.0 is False.
2843
2843
  if stringVersion.find('.') >= 0:
2844
2844
  return float(stringVersion)
2845
2845
  return int(stringVersion)
@@ -3780,7 +3780,7 @@ class Exchange(object):
3780
3780
  for i in range(0, len(fees)):
3781
3781
  fee = fees[i]
3782
3782
  code = self.safe_string(fee, 'currency')
3783
- feeCurrencyCode = code is not code if None else str(i)
3783
+ feeCurrencyCode = code if (code is not None) else str(i)
3784
3784
  if feeCurrencyCode is not None:
3785
3785
  rate = self.safe_string(fee, 'rate')
3786
3786
  cost = self.safe_string(fee, 'cost')
@@ -3808,8 +3808,7 @@ class Exchange(object):
3808
3808
 
3809
3809
  def safe_ticker(self, ticker: dict, market: Market = None):
3810
3810
  open = self.omit_zero(self.safe_string(ticker, 'open'))
3811
- close = self.omit_zero(self.safe_string(ticker, 'close'))
3812
- last = self.omit_zero(self.safe_string(ticker, 'last'))
3811
+ close = self.omit_zero(self.safe_string_2(ticker, 'close', 'last'))
3813
3812
  change = self.omit_zero(self.safe_string(ticker, 'change'))
3814
3813
  percentage = self.omit_zero(self.safe_string(ticker, 'percentage'))
3815
3814
  average = self.omit_zero(self.safe_string(ticker, 'average'))
@@ -3818,29 +3817,52 @@ class Exchange(object):
3818
3817
  quoteVolume = self.safe_string(ticker, 'quoteVolume')
3819
3818
  if vwap is None:
3820
3819
  vwap = Precise.string_div(self.omit_zero(quoteVolume), baseVolume)
3821
- if (last is not None) and (close is None):
3822
- close = last
3823
- elif (last is None) and (close is not None):
3824
- last = close
3825
- if (last is not None) and (open is not None):
3826
- if change is None:
3827
- change = Precise.string_sub(last, open)
3828
- if average is None:
3820
+ # calculate open
3821
+ if change is not None:
3822
+ if close is None and average is not None:
3823
+ close = Precise.string_add(average, Precise.string_div(change, '2'))
3824
+ if open is None and close is not None:
3825
+ open = Precise.string_sub(close, change)
3826
+ elif percentage is not None:
3827
+ if close is None and average is not None:
3828
+ openAddClose = Precise.string_mul(average, '2')
3829
+ # openAddClose = open * (1 + (100 + percentage)/100)
3830
+ denominator = Precise.string_add('2', Precise.string_div(percentage, '100'))
3831
+ calcOpen = open if (open is not None) else Precise.string_div(openAddClose, denominator)
3832
+ close = Precise.string_mul(calcOpen, Precise.string_add('1', Precise.string_div(percentage, '100')))
3833
+ if open is None and close is not None:
3834
+ open = Precise.string_div(close, Precise.string_add('1', Precise.string_div(percentage, '100')))
3835
+ # change
3836
+ if change is None:
3837
+ if close is not None and open is not None:
3838
+ change = Precise.string_sub(close, open)
3839
+ elif close is not None and percentage is not None:
3840
+ change = Precise.string_mul(Precise.string_div(percentage, '100'), Precise.string_div(close, '100'))
3841
+ elif open is not None and percentage is not None:
3842
+ change = Precise.string_mul(open, Precise.string_div(percentage, '100'))
3843
+ # calculate things according to "open"(similar can be done with "close")
3844
+ if open is not None:
3845
+ # percentage(using change)
3846
+ if percentage is None and change is not None:
3847
+ percentage = Precise.string_mul(Precise.string_div(change, open), '100')
3848
+ # close(using change)
3849
+ if close is None and change is not None:
3850
+ close = Precise.string_add(open, change)
3851
+ # close(using average)
3852
+ if close is None and average is not None:
3853
+ close = Precise.string_mul(average, '2')
3854
+ # average
3855
+ if average is None and close is not None:
3829
3856
  precision = 18
3830
3857
  if market is not None and self.is_tick_precision():
3831
3858
  marketPrecision = self.safe_dict(market, 'precision')
3832
3859
  precisionPrice = self.safe_string(marketPrecision, 'price')
3833
3860
  if precisionPrice is not None:
3834
3861
  precision = self.precision_from_string(precisionPrice)
3835
- average = Precise.string_div(Precise.string_add(last, open), '2', precision)
3836
- if (percentage is None) and (change is not None) and (open is not None) and Precise.string_gt(open, '0'):
3837
- percentage = Precise.string_mul(Precise.string_div(change, open), '100')
3838
- if (change is None) and (percentage is not None) and (open is not None):
3839
- change = Precise.string_div(Precise.string_mul(percentage, open), '100')
3840
- if (open is None) and (last is not None) and (change is not None):
3841
- open = Precise.string_sub(last, change)
3862
+ average = Precise.string_div(Precise.string_add(open, close), '2', precision)
3842
3863
  # timestamp and symbol operations don't belong in safeTicker
3843
3864
  # they should be done in the derived classes
3865
+ closeParsed = self.parse_number(self.omit_zero(close))
3844
3866
  return self.extend(ticker, {
3845
3867
  'bid': self.parse_number(self.omit_zero(self.safe_string(ticker, 'bid'))),
3846
3868
  'bidVolume': self.safe_number(ticker, 'bidVolume'),
@@ -3849,8 +3871,8 @@ class Exchange(object):
3849
3871
  'high': self.parse_number(self.omit_zero(self.safe_string(ticker, 'high'))),
3850
3872
  'low': self.parse_number(self.omit_zero(self.safe_string(ticker, 'low'))),
3851
3873
  'open': self.parse_number(self.omit_zero(open)),
3852
- 'close': self.parse_number(self.omit_zero(close)),
3853
- 'last': self.parse_number(self.omit_zero(last)),
3874
+ 'close': closeParsed,
3875
+ 'last': closeParsed,
3854
3876
  'change': self.parse_number(change),
3855
3877
  'percentage': self.parse_number(percentage),
3856
3878
  'average': self.parse_number(average),
gate/ccxt/gate.py CHANGED
@@ -3754,7 +3754,7 @@ class gate(Exchange, ImplicitAPI):
3754
3754
  start = self.parse_to_int(since / 1000)
3755
3755
  request['from'] = start
3756
3756
  request['to'] = self.sum(start, 30 * 24 * 60 * 60)
3757
- request, params = self.handle_until_option('to', request, params)
3757
+ request, params = self.handle_until_option('to', request, params, 0.001)
3758
3758
  response = self.privateWalletGetDeposits(self.extend(request, params))
3759
3759
  return self.parse_transactions(response, currency)
3760
3760
 
gate/ccxt/pro/__init__.py CHANGED
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.93'
11
+ __version__ = '4.4.95'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gate-io-api
3
- Version: 0.0.72
3
+ Version: 0.0.74
4
4
  Summary: gate 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,26 +1,26 @@
1
1
  gate/__init__.py,sha256=rmRavmagjlyk7Z5zGWWJiY8tfYIPsk04hRzC4SYJOzA,222
2
- gate/ccxt/__init__.py,sha256=tD0bD0s4gasVw2wkT9ceHpiQHMwNagaZ5q_rGkktpO8,6044
3
- gate/ccxt/gate.py,sha256=wufQi_WBp5ZP62wZCJgueeA1iOcwLPNh8oX4iqHpo40,352213
2
+ gate/ccxt/__init__.py,sha256=Kv_-mjm7-JrnCWHh0u9X8_e8jejh4WH6TG74E6l8fOo,6044
3
+ gate/ccxt/gate.py,sha256=71MQPtGh3iRrlNRYWnzzbASyYdu3t0R7LeBeSntxX6w,352220
4
4
  gate/ccxt/abstract/gate.py,sha256=MrRMycFEpZKJ6yC7qi0p_qcwZtU9WJi5bBbVllskGoA,45044
5
- gate/ccxt/async_support/__init__.py,sha256=WqhxWg5L-Pa4Uqt-mJWxSWu9HFmYEaJVlxjy0NG-_mI,4777
6
- gate/ccxt/async_support/gate.py,sha256=1Rem4zV8I-QVx4J-w36kiXnA4pQUpvWW220Z8hp9RJY,354172
5
+ gate/ccxt/async_support/__init__.py,sha256=B0oLRp9dRKCup0IepU2zNc2JARsUn9o41mvdxEmY8HI,4777
6
+ gate/ccxt/async_support/gate.py,sha256=T-SB0ZzqyVeBxx2LWJ1Ji6M1FZbzV7nrzJY9fsa5eJ8,354179
7
7
  gate/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- gate/ccxt/async_support/base/exchange.py,sha256=WRCIHpPMqJ4UpcL4x534QQWA1Bo4RFS1xJitRjKFViw,119440
8
+ gate/ccxt/async_support/base/exchange.py,sha256=rlXug7vYV2ke2rjNRzkakqbw4H7gzN3oUoeSldxBheY,119440
9
9
  gate/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  gate/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  gate/ccxt/async_support/base/ws/cache.py,sha256=xf2VOtfUwloxSlIQ39M1RGZHWQzyS9IGhB5NX6cDcAc,8370
12
12
  gate/ccxt/async_support/base/ws/client.py,sha256=ekIN5HNgeQgMG3tLZMsE889Aoxs960DLwQnwkTGhdi8,13624
13
13
  gate/ccxt/async_support/base/ws/functions.py,sha256=qwvEnjtINWL5ZU-dbbeIunjyBxzFqbGWHfVhxqAcKug,1499
14
- gate/ccxt/async_support/base/ws/future.py,sha256=9yFyxqT7cl-7ZFM6LM4b6UPXyO2FGIbAhs5uoJ3-Smo,1271
14
+ gate/ccxt/async_support/base/ws/future.py,sha256=2zrEB7Xinq14N05jaewNtbR_2ZiE5GQZNQV4CBW7qTA,1337
15
15
  gate/ccxt/async_support/base/ws/order_book.py,sha256=uBUaIHhzMRykpmo4BCsdJ-t_HozS6VxhEs8x-Kbj-NI,2894
16
16
  gate/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9produGjmBJLCI5FHIRdMz1O-g,6551
17
17
  gate/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
18
18
  gate/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
19
- gate/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
20
- gate/ccxt/base/exchange.py,sha256=64LNTmAxXu8gUG6n4pwCNjTmVZmV0otj7ceWXRB3G6o,330373
19
+ gate/ccxt/base/errors.py,sha256=Pad-6ugvGUwhoYuKUliX-N7FTrcnKCQGFjsaq2tMn0I,4610
20
+ gate/ccxt/base/exchange.py,sha256=1Hb7swmJX38Qzt6t7TayO0U-jw0cQ5AbACLZoYoM-9I,331665
21
21
  gate/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
22
22
  gate/ccxt/base/types.py,sha256=vMQfFDVntED4YHrRJt0Q98YaM7OtGhK-DkbkqXFTYHc,11485
23
- gate/ccxt/pro/__init__.py,sha256=8LehkmeQLNV6QJhIUvHeX-g--jhM83LLGplYKJ9pgb8,4091
23
+ gate/ccxt/pro/__init__.py,sha256=LbjyXphQ3U_sGgpuSXT8JkoNTTkkaDqM_B-dTWj4aXI,4091
24
24
  gate/ccxt/pro/gate.py,sha256=TImMphR9V8h9xqDJ541s3zb4NOppfLDc-XoBkntT1nA,89399
25
25
  gate/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
26
26
  gate/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
@@ -281,6 +281,6 @@ gate/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX2u
281
281
  gate/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
282
282
  gate/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
283
283
  gate/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
284
- gate_io_api-0.0.72.dist-info/METADATA,sha256=myGWTy3OJAhHQjcEGj75fhADPAwxVG0bzAK1ZJDjKg4,26789
285
- gate_io_api-0.0.72.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
- gate_io_api-0.0.72.dist-info/RECORD,,
284
+ gate_io_api-0.0.74.dist-info/METADATA,sha256=6y-SEwQ6swFcK7uZHUMVgqT6MQUzZNJBvw1j7Ax1pPM,26789
285
+ gate_io_api-0.0.74.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
+ gate_io_api-0.0.74.dist-info/RECORD,,