coinex-api 0.0.71__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.
coinex/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.92'
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.92'
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.92'
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
 
@@ -137,6 +137,9 @@ class Client(object):
137
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
@@ -19,6 +19,7 @@ from ccxt.base.errors import InsufficientFunds
19
19
  from ccxt.base.errors import InvalidOrder
20
20
  from ccxt.base.errors import OrderNotFound
21
21
  from ccxt.base.errors import NotSupported
22
+ from ccxt.base.errors import OperationFailed
22
23
  from ccxt.base.errors import RateLimitExceeded
23
24
  from ccxt.base.errors import ExchangeNotAvailable
24
25
  from ccxt.base.errors import RequestTimeout
@@ -671,6 +672,7 @@ class coinex(Exchange, ImplicitAPI):
671
672
  'broad': {
672
673
  'ip not allow visit': PermissionDenied,
673
674
  'service too busy': ExchangeNotAvailable,
675
+ 'Service is not available during funding fee settlement': OperationFailed,
674
676
  },
675
677
  },
676
678
  })
@@ -795,7 +797,7 @@ class coinex(Exchange, ImplicitAPI):
795
797
  'max': None,
796
798
  },
797
799
  },
798
- 'networks': {},
800
+ 'networks': networks,
799
801
  'type': 'crypto',
800
802
  'info': coin,
801
803
  })
@@ -827,17 +829,19 @@ class coinex(Exchange, ImplicitAPI):
827
829
  # "code": 0,
828
830
  # "data": [
829
831
  # {
830
- # "base_ccy": "SORA",
832
+ # "market": "BTCUSDT",
833
+ # "taker_fee_rate": "0.002",
834
+ # "maker_fee_rate": "0.002",
835
+ # "min_amount": "0.0005",
836
+ # "base_ccy": "BTC",
837
+ # "quote_ccy": "USDT",
831
838
  # "base_ccy_precision": 8,
839
+ # "quote_ccy_precision": 2,
832
840
  # "is_amm_available": True,
833
- # "is_margin_available": False,
834
- # "maker_fee_rate": "0.003",
835
- # "market": "SORAUSDT",
836
- # "min_amount": "500",
837
- # "quote_ccy": "USDT",
838
- # "quote_ccy_precision": 6,
839
- # "taker_fee_rate": "0.003"
840
- # },
841
+ # "is_margin_available": True,
842
+ # "is_pre_trading_available": True,
843
+ # "is_api_trading_available": True
844
+ # }
841
845
  # ],
842
846
  # "message": "OK"
843
847
  # }
@@ -863,11 +867,11 @@ class coinex(Exchange, ImplicitAPI):
863
867
  'settleId': None,
864
868
  'type': 'spot',
865
869
  'spot': True,
866
- 'margin': None,
870
+ 'margin': self.safe_bool(market, 'is_margin_available'),
867
871
  'swap': False,
868
872
  'future': False,
869
873
  'option': False,
870
- 'active': None,
874
+ 'active': self.safe_bool(market, 'is_api_trading_available'),
871
875
  'contract': False,
872
876
  'linear': None,
873
877
  'inverse': None,
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.92'
7
+ __version__ = '4.4.93'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -4229,7 +4229,7 @@ class Exchange(object):
4229
4229
  return self.filter_by_since_limit(sorted, since, limit, 0, tail)
4230
4230
 
4231
4231
  def parse_leverage_tiers(self, response: Any, symbols: List[str] = None, marketIdKey=None):
4232
- # marketIdKey should only be None when response is a dictionary
4232
+ # marketIdKey should only be None when response is a dictionary.
4233
4233
  symbols = self.market_symbols(symbols)
4234
4234
  tiers = {}
4235
4235
  symbolsLength = 0
@@ -5450,6 +5450,9 @@ class Exchange(object):
5450
5450
  def fetch_greeks(self, symbol: str, params={}):
5451
5451
  raise NotSupported(self.id + ' fetchGreeks() is not supported yet')
5452
5452
 
5453
+ def fetch_all_greeks(self, symbols: Strings = None, params={}):
5454
+ raise NotSupported(self.id + ' fetchAllGreeks() is not supported yet')
5455
+
5453
5456
  def fetch_option_chain(self, code: str, params={}):
5454
5457
  raise NotSupported(self.id + ' fetchOptionChain() is not supported yet')
5455
5458
 
@@ -5703,10 +5706,16 @@ class Exchange(object):
5703
5706
  precisionNumber = int(precision)
5704
5707
  if precisionNumber == 0:
5705
5708
  return '1'
5706
- parsedPrecision = '0.'
5707
- for i in range(0, precisionNumber - 1):
5708
- parsedPrecision = parsedPrecision + '0'
5709
- 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'
5710
5719
 
5711
5720
  def integer_precision_to_amount(self, precision: Str):
5712
5721
  """
@@ -6682,6 +6691,27 @@ class Exchange(object):
6682
6691
  def parse_greeks(self, greeks: dict, market: Market = None):
6683
6692
  raise NotSupported(self.id + ' parseGreeks() is not supported yet')
6684
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
+
6685
6715
  def parse_option(self, chain: dict, currency: Currency = None, market: Market = None):
6686
6716
  raise NotSupported(self.id + ' parseOption() is not supported yet')
6687
6717
 
@@ -6883,14 +6913,27 @@ class Exchange(object):
6883
6913
  """
6884
6914
  raise NotSupported(self.id + ' fetchTransfers() is not supported yet')
6885
6915
 
6886
- def clean_unsubscription(self, client, subHash: str, unsubHash: str):
6916
+ def clean_unsubscription(self, client, subHash: str, unsubHash: str, subHashIsPrefix=False):
6887
6917
  if unsubHash in client.subscriptions:
6888
6918
  del client.subscriptions[unsubHash]
6889
- if subHash in client.subscriptions:
6890
- del client.subscriptions[subHash]
6891
- if subHash in client.futures:
6892
- error = UnsubscribeError(self.id + ' ' + subHash)
6893
- 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)
6894
6937
  client.resolve(True, unsubHash)
6895
6938
 
6896
6939
  def clean_cache(self, subscription: dict):
coinex/ccxt/coinex.py CHANGED
@@ -18,6 +18,7 @@ from ccxt.base.errors import InsufficientFunds
18
18
  from ccxt.base.errors import InvalidOrder
19
19
  from ccxt.base.errors import OrderNotFound
20
20
  from ccxt.base.errors import NotSupported
21
+ from ccxt.base.errors import OperationFailed
21
22
  from ccxt.base.errors import RateLimitExceeded
22
23
  from ccxt.base.errors import ExchangeNotAvailable
23
24
  from ccxt.base.errors import RequestTimeout
@@ -670,6 +671,7 @@ class coinex(Exchange, ImplicitAPI):
670
671
  'broad': {
671
672
  'ip not allow visit': PermissionDenied,
672
673
  'service too busy': ExchangeNotAvailable,
674
+ 'Service is not available during funding fee settlement': OperationFailed,
673
675
  },
674
676
  },
675
677
  })
@@ -794,7 +796,7 @@ class coinex(Exchange, ImplicitAPI):
794
796
  'max': None,
795
797
  },
796
798
  },
797
- 'networks': {},
799
+ 'networks': networks,
798
800
  'type': 'crypto',
799
801
  'info': coin,
800
802
  })
@@ -826,17 +828,19 @@ class coinex(Exchange, ImplicitAPI):
826
828
  # "code": 0,
827
829
  # "data": [
828
830
  # {
829
- # "base_ccy": "SORA",
831
+ # "market": "BTCUSDT",
832
+ # "taker_fee_rate": "0.002",
833
+ # "maker_fee_rate": "0.002",
834
+ # "min_amount": "0.0005",
835
+ # "base_ccy": "BTC",
836
+ # "quote_ccy": "USDT",
830
837
  # "base_ccy_precision": 8,
838
+ # "quote_ccy_precision": 2,
831
839
  # "is_amm_available": True,
832
- # "is_margin_available": False,
833
- # "maker_fee_rate": "0.003",
834
- # "market": "SORAUSDT",
835
- # "min_amount": "500",
836
- # "quote_ccy": "USDT",
837
- # "quote_ccy_precision": 6,
838
- # "taker_fee_rate": "0.003"
839
- # },
840
+ # "is_margin_available": True,
841
+ # "is_pre_trading_available": True,
842
+ # "is_api_trading_available": True
843
+ # }
840
844
  # ],
841
845
  # "message": "OK"
842
846
  # }
@@ -862,11 +866,11 @@ class coinex(Exchange, ImplicitAPI):
862
866
  'settleId': None,
863
867
  'type': 'spot',
864
868
  'spot': True,
865
- 'margin': None,
869
+ 'margin': self.safe_bool(market, 'is_margin_available'),
866
870
  'swap': False,
867
871
  'future': False,
868
872
  'option': False,
869
- 'active': None,
873
+ 'active': self.safe_bool(market, 'is_api_trading_available'),
870
874
  'contract': False,
871
875
  'linear': None,
872
876
  'inverse': None,
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.92'
11
+ __version__ = '4.4.93'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coinex-api
3
- Version: 0.0.71
3
+ Version: 0.0.72
4
4
  Summary: coinex 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
  coinex/__init__.py,sha256=d633U2PpNFHvpDWLb3lItS0ObcBN0E2XgS5QkOEejI8,246
2
- coinex/ccxt/__init__.py,sha256=Z5MBqPV9r4dWHDR8TnltrO50aau60Gv0jP-E6dZCL7Y,6048
3
- coinex/ccxt/coinex.py,sha256=CoCBNE0SWXgXBurhdqcsMuMsj3TnYALKFUz-_gLz2XA,267281
2
+ coinex/ccxt/__init__.py,sha256=voF6eMIFwfbzL4CcM1pq9oKVjSQwv9x98yPXIM_vTNw,6048
3
+ coinex/ccxt/coinex.py,sha256=2IWog856J1MkEwbFWGUBAtiLVycQJEDzk2ddXhEh964,267633
4
4
  coinex/ccxt/abstract/coinex.py,sha256=4TRXtWgONqkm3eSL55Y5T7Q4QxJrnOTuhP0ugsKHAWo,34856
5
- coinex/ccxt/async_support/__init__.py,sha256=SFfnECL2xW7ohOv7vumUqqp4we_qeEmbSw-_bjkFklg,4781
6
- coinex/ccxt/async_support/coinex.py,sha256=lj_2qf1gnqmXbVf_pXBZddBFsHeVmh_N2JIxBHhmPwM,268569
5
+ coinex/ccxt/async_support/__init__.py,sha256=e59U3Qh1xgnZ6WF5tzP6CBem2D6UgTeCQP8k7paf38k,4781
6
+ coinex/ccxt/async_support/coinex.py,sha256=rKjhOk0bRSh2r-RuEf-mneByxwJVl9qHvVILtAbJuZA,268921
7
7
  coinex/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- coinex/ccxt/async_support/base/exchange.py,sha256=FQynGv0nHLJXfqiWThG1GFXUYqFMvMBdRkMYAxVGrqY,119286
8
+ coinex/ccxt/async_support/base/exchange.py,sha256=WRCIHpPMqJ4UpcL4x534QQWA1Bo4RFS1xJitRjKFViw,119440
9
9
  coinex/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  coinex/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  coinex/ccxt/async_support/base/ws/cache.py,sha256=xf2VOtfUwloxSlIQ39M1RGZHWQzyS9IGhB5NX6cDcAc,8370
12
- coinex/ccxt/async_support/base/ws/client.py,sha256=1N_ji0ekjViecIHdcT7a8DVbq8aB-ZVgjK6ccJZntMU,13476
12
+ coinex/ccxt/async_support/base/ws/client.py,sha256=ekIN5HNgeQgMG3tLZMsE889Aoxs960DLwQnwkTGhdi8,13624
13
13
  coinex/ccxt/async_support/base/ws/functions.py,sha256=qwvEnjtINWL5ZU-dbbeIunjyBxzFqbGWHfVhxqAcKug,1499
14
14
  coinex/ccxt/async_support/base/ws/future.py,sha256=9yFyxqT7cl-7ZFM6LM4b6UPXyO2FGIbAhs5uoJ3-Smo,1271
15
15
  coinex/ccxt/async_support/base/ws/order_book.py,sha256=uBUaIHhzMRykpmo4BCsdJ-t_HozS6VxhEs8x-Kbj-NI,2894
@@ -17,10 +17,10 @@ coinex/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9pr
17
17
  coinex/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
18
18
  coinex/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
19
19
  coinex/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
20
- coinex/ccxt/base/exchange.py,sha256=_2FOqAIq1yfzBic5QI4JMQseWYPIesZpubuSde7jxYk,328428
20
+ coinex/ccxt/base/exchange.py,sha256=64LNTmAxXu8gUG6n4pwCNjTmVZmV0otj7ceWXRB3G6o,330373
21
21
  coinex/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
22
22
  coinex/ccxt/base/types.py,sha256=vMQfFDVntED4YHrRJt0Q98YaM7OtGhK-DkbkqXFTYHc,11485
23
- coinex/ccxt/pro/__init__.py,sha256=7yOuLi2W1BkGjmeOsatX28Dzj5yAhMnvsR-6VlGGXno,4095
23
+ coinex/ccxt/pro/__init__.py,sha256=vf34De-oc2LRNfSmSQDaCkTvcEfNwTOSidT1scDmNpQ,4095
24
24
  coinex/ccxt/pro/coinex.py,sha256=aQ6Xa4ML0PTCgGleDJuhjqntspAREz6XxQwX9IcD6OY,56616
25
25
  coinex/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
26
26
  coinex/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
@@ -281,6 +281,6 @@ coinex/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX
281
281
  coinex/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
282
282
  coinex/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
283
283
  coinex/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
284
- coinex_api-0.0.71.dist-info/METADATA,sha256=1gw2jEzOrCg-1jO_ltrF5BdeJbGlfsJpCzrXDcjhC3I,19969
285
- coinex_api-0.0.71.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
- coinex_api-0.0.71.dist-info/RECORD,,
284
+ coinex_api-0.0.72.dist-info/METADATA,sha256=54uOfWQ_FlxMStSZ_JDGUgZzaebr6y8PlyOkZtVpztI,19969
285
+ coinex_api-0.0.72.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
+ coinex_api-0.0.72.dist-info/RECORD,,