coinex-api 0.0.79__py3-none-any.whl → 0.0.81__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 +1 -1
- coinex/ccxt/async_support/__init__.py +1 -1
- coinex/ccxt/async_support/base/exchange.py +44 -9
- coinex/ccxt/async_support/base/ws/client.py +3 -1
- coinex/ccxt/async_support/coinex.py +67 -6
- coinex/ccxt/base/errors.py +0 -6
- coinex/ccxt/base/exchange.py +11 -9
- coinex/ccxt/base/types.py +1 -0
- coinex/ccxt/coinex.py +67 -6
- coinex/ccxt/pro/__init__.py +1 -1
- coinex/ccxt/pro/coinex.py +1 -1
- {coinex_api-0.0.79.dist-info → coinex_api-0.0.81.dist-info}/METADATA +4 -3
- {coinex_api-0.0.79.dist-info → coinex_api-0.0.81.dist-info}/RECORD +14 -14
- {coinex_api-0.0.79.dist-info → coinex_api-0.0.81.dist-info}/WHEEL +0 -0
coinex/ccxt/__init__.py
CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
|
|
26
26
|
|
27
27
|
# ----------------------------------------------------------------------------
|
28
28
|
|
29
|
-
__version__ = '4.4.
|
29
|
+
__version__ = '4.4.100'
|
30
30
|
|
31
31
|
# ----------------------------------------------------------------------------
|
32
32
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.4.
|
5
|
+
__version__ = '4.4.100'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -54,6 +54,15 @@ __all__ = [
|
|
54
54
|
]
|
55
55
|
|
56
56
|
# -----------------------------------------------------------------------------
|
57
|
+
# --- PROTO BUF IMPORTS
|
58
|
+
try:
|
59
|
+
from ccxt.protobuf.mexc import PushDataV3ApiWrapper_pb2
|
60
|
+
from google.protobuf.json_format import MessageToDict
|
61
|
+
except ImportError:
|
62
|
+
PushDataV3ApiWrapper_pb2 = None
|
63
|
+
MessageToDict = None
|
64
|
+
|
65
|
+
# -----------------------------------------------------------------------------
|
57
66
|
|
58
67
|
|
59
68
|
class Exchange(BaseExchange):
|
@@ -418,6 +427,7 @@ class Exchange(BaseExchange):
|
|
418
427
|
'verbose': self.verbose,
|
419
428
|
'throttle': Throttler(self.tokenBucket, self.asyncio_loop),
|
420
429
|
'asyncio_loop': self.asyncio_loop,
|
430
|
+
'decompressBinary': self.safe_bool(self.options, 'decompressBinary', True),
|
421
431
|
}, ws_options)
|
422
432
|
# we use aiohttp instead of fastClient now because of this
|
423
433
|
# https://github.com/ccxt/ccxt/pull/25995
|
@@ -573,6 +583,31 @@ class Exchange(BaseExchange):
|
|
573
583
|
return '0e-00'
|
574
584
|
return format(n, 'g')
|
575
585
|
|
586
|
+
def decode_proto_msg(self, data):
|
587
|
+
if not MessageToDict:
|
588
|
+
raise NotSupported(self.id + ' requires protobuf to decode messages, please install it with `pip install "protobuf==5.29.3"`')
|
589
|
+
message = PushDataV3ApiWrapper_pb2.PushDataV3ApiWrapper()
|
590
|
+
message.ParseFromString(data)
|
591
|
+
dict_msg = MessageToDict(message)
|
592
|
+
# {
|
593
|
+
# "channel":"spot@public.kline.v3.api.pb@BTCUSDT@Min1",
|
594
|
+
# "symbol":"BTCUSDT",
|
595
|
+
# "symbolId":"2fb942154ef44a4ab2ef98c8afb6a4a7",
|
596
|
+
# "createTime":"1754735110559",
|
597
|
+
# "publicSpotKline":{
|
598
|
+
# "interval":"Min1",
|
599
|
+
# "windowStart":"1754735100",
|
600
|
+
# "openingPrice":"117792.45",
|
601
|
+
# "closingPrice":"117805.32",
|
602
|
+
# "highestPrice":"117814.63",
|
603
|
+
# "lowestPrice":"117792.45",
|
604
|
+
# "volume":"0.13425465",
|
605
|
+
# "amount":"15815.77",
|
606
|
+
# "windowEnd":"1754735160"
|
607
|
+
# }
|
608
|
+
# }
|
609
|
+
return dict_msg
|
610
|
+
|
576
611
|
# ########################################################################
|
577
612
|
# ########################################################################
|
578
613
|
# ########################################################################
|
@@ -742,13 +777,13 @@ class Exchange(BaseExchange):
|
|
742
777
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}):
|
743
778
|
raise NotSupported(self.id + ' transfer() is not supported yet')
|
744
779
|
|
745
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
780
|
+
async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}):
|
746
781
|
raise NotSupported(self.id + ' withdraw() is not supported yet')
|
747
782
|
|
748
783
|
async def create_deposit_address(self, code: str, params={}):
|
749
784
|
raise NotSupported(self.id + ' createDepositAddress() is not supported yet')
|
750
785
|
|
751
|
-
async def set_leverage(self, leverage:
|
786
|
+
async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
752
787
|
raise NotSupported(self.id + ' setLeverage() is not supported yet')
|
753
788
|
|
754
789
|
async def fetch_leverage(self, symbol: str, params={}):
|
@@ -797,7 +832,7 @@ class Exchange(BaseExchange):
|
|
797
832
|
async def fetch_deposit_addresses_by_network(self, code: str, params={}):
|
798
833
|
raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
|
799
834
|
|
800
|
-
async def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
|
835
|
+
async def fetch_open_interest_history(self, symbol: str, timeframe: str = '1h', since: Int = None, limit: Int = None, params={}):
|
801
836
|
raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
|
802
837
|
|
803
838
|
async def fetch_open_interest(self, symbol: str, params={}):
|
@@ -1182,7 +1217,7 @@ class Exchange(BaseExchange):
|
|
1182
1217
|
async def fetch_position_mode(self, symbol: Str = None, params={}):
|
1183
1218
|
raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
|
1184
1219
|
|
1185
|
-
async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
1220
|
+
async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1186
1221
|
"""
|
1187
1222
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
1188
1223
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1204,7 +1239,7 @@ class Exchange(BaseExchange):
|
|
1204
1239
|
return await self.create_order(symbol, type, side, amount, price, params)
|
1205
1240
|
raise NotSupported(self.id + ' createTrailingAmountOrder() is not supported yet')
|
1206
1241
|
|
1207
|
-
async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
1242
|
+
async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1208
1243
|
"""
|
1209
1244
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
1210
1245
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1226,7 +1261,7 @@ class Exchange(BaseExchange):
|
|
1226
1261
|
return await self.create_order_ws(symbol, type, side, amount, price, params)
|
1227
1262
|
raise NotSupported(self.id + ' createTrailingAmountOrderWs() is not supported yet')
|
1228
1263
|
|
1229
|
-
async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
1264
|
+
async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1230
1265
|
"""
|
1231
1266
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
1232
1267
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1248,7 +1283,7 @@ class Exchange(BaseExchange):
|
|
1248
1283
|
return await self.create_order(symbol, type, side, amount, price, params)
|
1249
1284
|
raise NotSupported(self.id + ' createTrailingPercentOrder() is not supported yet')
|
1250
1285
|
|
1251
|
-
async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
1286
|
+
async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1252
1287
|
"""
|
1253
1288
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
1254
1289
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1815,7 +1850,7 @@ class Exchange(BaseExchange):
|
|
1815
1850
|
else:
|
1816
1851
|
raise NotSupported(self.id + ' fetchFundingInterval() is not supported yet')
|
1817
1852
|
|
1818
|
-
async def fetch_mark_ohlcv(self, symbol, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
1853
|
+
async def fetch_mark_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
1819
1854
|
"""
|
1820
1855
|
fetches historical mark price candlestick data containing the open, high, low, and close price of a market
|
1821
1856
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
@@ -50,6 +50,7 @@ class Client(object):
|
|
50
50
|
connecting = False
|
51
51
|
asyncio_loop: BaseEventLoop = None
|
52
52
|
ping_looper = None
|
53
|
+
decompressBinary = True # decompress binary messages by default
|
53
54
|
|
54
55
|
def __init__(self, url, on_message_callback, on_error_callback, on_close_callback, on_connected_callback, config={}):
|
55
56
|
defaults = {
|
@@ -218,7 +219,8 @@ class Client(object):
|
|
218
219
|
if self.verbose:
|
219
220
|
self.log(iso8601(milliseconds()), 'message', data)
|
220
221
|
if isinstance(data, bytes):
|
221
|
-
|
222
|
+
if self.decompressBinary:
|
223
|
+
data = data.decode()
|
222
224
|
# decoded = json.loads(data) if is_json_encoded_object(data) else data
|
223
225
|
decode = None
|
224
226
|
if is_json_encoded_object(data):
|
@@ -87,7 +87,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
87
87
|
'fetchDepositAddressesByNetwork': False,
|
88
88
|
'fetchDeposits': True,
|
89
89
|
'fetchDepositWithdrawFee': True,
|
90
|
-
'fetchDepositWithdrawFees':
|
90
|
+
'fetchDepositWithdrawFees': True,
|
91
91
|
'fetchFundingHistory': True,
|
92
92
|
'fetchFundingInterval': True,
|
93
93
|
'fetchFundingIntervals': False,
|
@@ -740,6 +740,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
740
740
|
for j in range(0, len(chains)):
|
741
741
|
chain = chains[j]
|
742
742
|
networkId = self.safe_string(chain, 'chain')
|
743
|
+
networkCode = self.network_id_to_code(networkId, code)
|
743
744
|
if networkId is None:
|
744
745
|
continue
|
745
746
|
precisionString = self.parse_precision(self.safe_string(chain, 'withdrawal_precision'))
|
@@ -750,7 +751,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
750
751
|
canWithdrawChain = self.safe_bool(chain, 'withdraw_enabled')
|
751
752
|
network: dict = {
|
752
753
|
'id': networkId,
|
753
|
-
'network':
|
754
|
+
'network': networkCode,
|
754
755
|
'name': None,
|
755
756
|
'active': canDepositChain and canWithdrawChain,
|
756
757
|
'deposit': canDepositChain,
|
@@ -773,7 +774,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
773
774
|
},
|
774
775
|
'info': chain,
|
775
776
|
}
|
776
|
-
networks[
|
777
|
+
networks[networkCode] = network
|
777
778
|
result[code] = self.safe_currency_structure({
|
778
779
|
'id': currencyId,
|
779
780
|
'code': code,
|
@@ -4125,7 +4126,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4125
4126
|
# }
|
4126
4127
|
#
|
4127
4128
|
|
4128
|
-
async def set_leverage(self, leverage:
|
4129
|
+
async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
4129
4130
|
"""
|
4130
4131
|
|
4131
4132
|
https://docs.coinex.com/api/v2/futures/position/http/adjust-position-leverage
|
@@ -4601,7 +4602,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4601
4602
|
data = self.safe_list(response, 'data', [])
|
4602
4603
|
return self.parse_funding_rates(data, symbols)
|
4603
4604
|
|
4604
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
4605
|
+
async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
4605
4606
|
"""
|
4606
4607
|
make a withdrawal
|
4607
4608
|
|
@@ -4610,7 +4611,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4610
4611
|
:param str code: unified currency code
|
4611
4612
|
:param float amount: the amount to withdraw
|
4612
4613
|
:param str address: the address to withdraw to
|
4613
|
-
:param str tag:
|
4614
|
+
:param str [tag]: memo
|
4614
4615
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4615
4616
|
:param str [params.network]: unified network code
|
4616
4617
|
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
@@ -5393,6 +5394,66 @@ class coinex(Exchange, ImplicitAPI):
|
|
5393
5394
|
data = self.safe_dict(response, 'data', {})
|
5394
5395
|
return self.parse_deposit_withdraw_fee(data, currency)
|
5395
5396
|
|
5397
|
+
async def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
5398
|
+
"""
|
5399
|
+
fetch the fees for deposits and withdrawals
|
5400
|
+
|
5401
|
+
https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
|
5402
|
+
|
5403
|
+
@param codes
|
5404
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5405
|
+
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
5406
|
+
"""
|
5407
|
+
await self.load_markets()
|
5408
|
+
response = await self.v2PublicGetAssetsAllDepositWithdrawConfig(params)
|
5409
|
+
#
|
5410
|
+
# {
|
5411
|
+
# "code": 0,
|
5412
|
+
# "data": [
|
5413
|
+
# {
|
5414
|
+
# "asset": {
|
5415
|
+
# "ccy": "CET",
|
5416
|
+
# "deposit_enabled": True,
|
5417
|
+
# "withdraw_enabled": True,
|
5418
|
+
# "inter_transfer_enabled": True,
|
5419
|
+
# "is_st": False
|
5420
|
+
# },
|
5421
|
+
# "chains": [
|
5422
|
+
# {
|
5423
|
+
# "chain": "CSC",
|
5424
|
+
# "min_deposit_amount": "0.8",
|
5425
|
+
# "min_withdraw_amount": "8",
|
5426
|
+
# "deposit_enabled": True,
|
5427
|
+
# "withdraw_enabled": True,
|
5428
|
+
# "deposit_delay_minutes": 0,
|
5429
|
+
# "safe_confirmations": 10,
|
5430
|
+
# "irreversible_confirmations": 20,
|
5431
|
+
# "deflation_rate": "0",
|
5432
|
+
# "withdrawal_fee": "0.026",
|
5433
|
+
# "withdrawal_precision": 8,
|
5434
|
+
# "memo": "",
|
5435
|
+
# "is_memo_required_for_deposit": False,
|
5436
|
+
# "explorer_asset_url": ""
|
5437
|
+
# },
|
5438
|
+
# ]
|
5439
|
+
# }
|
5440
|
+
# ],
|
5441
|
+
# "message": "OK"
|
5442
|
+
# }
|
5443
|
+
#
|
5444
|
+
data = self.safe_list(response, 'data', [])
|
5445
|
+
result: dict = {}
|
5446
|
+
for i in range(0, len(data)):
|
5447
|
+
item = data[i]
|
5448
|
+
asset = self.safe_dict(item, 'asset', {})
|
5449
|
+
currencyId = self.safe_string(asset, 'ccy')
|
5450
|
+
if currencyId is None:
|
5451
|
+
continue
|
5452
|
+
code = self.safe_currency_code(currencyId)
|
5453
|
+
if codes is None or self.in_array(code, codes):
|
5454
|
+
result[code] = self.parse_deposit_withdraw_fee(item)
|
5455
|
+
return result
|
5456
|
+
|
5396
5457
|
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
5397
5458
|
#
|
5398
5459
|
# {
|
coinex/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': {
|
coinex/ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.100'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -1862,6 +1862,8 @@ class Exchange(object):
|
|
1862
1862
|
signature = auth_data.signature
|
1863
1863
|
return signature
|
1864
1864
|
|
1865
|
+
def is_binary_message(self, message):
|
1866
|
+
return isinstance(message, bytes) or isinstance(message, bytearray)
|
1865
1867
|
|
1866
1868
|
# ########################################################################
|
1867
1869
|
# ########################################################################
|
@@ -2774,13 +2776,13 @@ class Exchange(object):
|
|
2774
2776
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}):
|
2775
2777
|
raise NotSupported(self.id + ' transfer() is not supported yet')
|
2776
2778
|
|
2777
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
2779
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}):
|
2778
2780
|
raise NotSupported(self.id + ' withdraw() is not supported yet')
|
2779
2781
|
|
2780
2782
|
def create_deposit_address(self, code: str, params={}):
|
2781
2783
|
raise NotSupported(self.id + ' createDepositAddress() is not supported yet')
|
2782
2784
|
|
2783
|
-
def set_leverage(self, leverage:
|
2785
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
2784
2786
|
raise NotSupported(self.id + ' setLeverage() is not supported yet')
|
2785
2787
|
|
2786
2788
|
def fetch_leverage(self, symbol: str, params={}):
|
@@ -2829,7 +2831,7 @@ class Exchange(object):
|
|
2829
2831
|
def fetch_deposit_addresses_by_network(self, code: str, params={}):
|
2830
2832
|
raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
|
2831
2833
|
|
2832
|
-
def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
|
2834
|
+
def fetch_open_interest_history(self, symbol: str, timeframe: str = '1h', since: Int = None, limit: Int = None, params={}):
|
2833
2835
|
raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
|
2834
2836
|
|
2835
2837
|
def fetch_open_interest(self, symbol: str, params={}):
|
@@ -5073,7 +5075,7 @@ class Exchange(object):
|
|
5073
5075
|
def fetch_position_mode(self, symbol: Str = None, params={}):
|
5074
5076
|
raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
|
5075
5077
|
|
5076
|
-
def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
5078
|
+
def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
5077
5079
|
"""
|
5078
5080
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
5079
5081
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5095,7 +5097,7 @@ class Exchange(object):
|
|
5095
5097
|
return self.create_order(symbol, type, side, amount, price, params)
|
5096
5098
|
raise NotSupported(self.id + ' createTrailingAmountOrder() is not supported yet')
|
5097
5099
|
|
5098
|
-
def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
5100
|
+
def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
5099
5101
|
"""
|
5100
5102
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
5101
5103
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5117,7 +5119,7 @@ class Exchange(object):
|
|
5117
5119
|
return self.create_order_ws(symbol, type, side, amount, price, params)
|
5118
5120
|
raise NotSupported(self.id + ' createTrailingAmountOrderWs() is not supported yet')
|
5119
5121
|
|
5120
|
-
def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
5122
|
+
def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
5121
5123
|
"""
|
5122
5124
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
5123
5125
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5139,7 +5141,7 @@ class Exchange(object):
|
|
5139
5141
|
return self.create_order(symbol, type, side, amount, price, params)
|
5140
5142
|
raise NotSupported(self.id + ' createTrailingPercentOrder() is not supported yet')
|
5141
5143
|
|
5142
|
-
def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
5144
|
+
def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
5143
5145
|
"""
|
5144
5146
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
5145
5147
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -6193,7 +6195,7 @@ class Exchange(object):
|
|
6193
6195
|
else:
|
6194
6196
|
raise NotSupported(self.id + ' fetchFundingInterval() is not supported yet')
|
6195
6197
|
|
6196
|
-
def fetch_mark_ohlcv(self, symbol, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
6198
|
+
def fetch_mark_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
6197
6199
|
"""
|
6198
6200
|
fetches historical mark price candlestick data containing the open, high, low, and close price of a market
|
6199
6201
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
coinex/ccxt/base/types.py
CHANGED
coinex/ccxt/coinex.py
CHANGED
@@ -86,7 +86,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
86
86
|
'fetchDepositAddressesByNetwork': False,
|
87
87
|
'fetchDeposits': True,
|
88
88
|
'fetchDepositWithdrawFee': True,
|
89
|
-
'fetchDepositWithdrawFees':
|
89
|
+
'fetchDepositWithdrawFees': True,
|
90
90
|
'fetchFundingHistory': True,
|
91
91
|
'fetchFundingInterval': True,
|
92
92
|
'fetchFundingIntervals': False,
|
@@ -739,6 +739,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
739
739
|
for j in range(0, len(chains)):
|
740
740
|
chain = chains[j]
|
741
741
|
networkId = self.safe_string(chain, 'chain')
|
742
|
+
networkCode = self.network_id_to_code(networkId, code)
|
742
743
|
if networkId is None:
|
743
744
|
continue
|
744
745
|
precisionString = self.parse_precision(self.safe_string(chain, 'withdrawal_precision'))
|
@@ -749,7 +750,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
749
750
|
canWithdrawChain = self.safe_bool(chain, 'withdraw_enabled')
|
750
751
|
network: dict = {
|
751
752
|
'id': networkId,
|
752
|
-
'network':
|
753
|
+
'network': networkCode,
|
753
754
|
'name': None,
|
754
755
|
'active': canDepositChain and canWithdrawChain,
|
755
756
|
'deposit': canDepositChain,
|
@@ -772,7 +773,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
772
773
|
},
|
773
774
|
'info': chain,
|
774
775
|
}
|
775
|
-
networks[
|
776
|
+
networks[networkCode] = network
|
776
777
|
result[code] = self.safe_currency_structure({
|
777
778
|
'id': currencyId,
|
778
779
|
'code': code,
|
@@ -4124,7 +4125,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4124
4125
|
# }
|
4125
4126
|
#
|
4126
4127
|
|
4127
|
-
def set_leverage(self, leverage:
|
4128
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
4128
4129
|
"""
|
4129
4130
|
|
4130
4131
|
https://docs.coinex.com/api/v2/futures/position/http/adjust-position-leverage
|
@@ -4600,7 +4601,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4600
4601
|
data = self.safe_list(response, 'data', [])
|
4601
4602
|
return self.parse_funding_rates(data, symbols)
|
4602
4603
|
|
4603
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
4604
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
4604
4605
|
"""
|
4605
4606
|
make a withdrawal
|
4606
4607
|
|
@@ -4609,7 +4610,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4609
4610
|
:param str code: unified currency code
|
4610
4611
|
:param float amount: the amount to withdraw
|
4611
4612
|
:param str address: the address to withdraw to
|
4612
|
-
:param str tag:
|
4613
|
+
:param str [tag]: memo
|
4613
4614
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4614
4615
|
:param str [params.network]: unified network code
|
4615
4616
|
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
@@ -5392,6 +5393,66 @@ class coinex(Exchange, ImplicitAPI):
|
|
5392
5393
|
data = self.safe_dict(response, 'data', {})
|
5393
5394
|
return self.parse_deposit_withdraw_fee(data, currency)
|
5394
5395
|
|
5396
|
+
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
5397
|
+
"""
|
5398
|
+
fetch the fees for deposits and withdrawals
|
5399
|
+
|
5400
|
+
https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
|
5401
|
+
|
5402
|
+
@param codes
|
5403
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5404
|
+
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
5405
|
+
"""
|
5406
|
+
self.load_markets()
|
5407
|
+
response = self.v2PublicGetAssetsAllDepositWithdrawConfig(params)
|
5408
|
+
#
|
5409
|
+
# {
|
5410
|
+
# "code": 0,
|
5411
|
+
# "data": [
|
5412
|
+
# {
|
5413
|
+
# "asset": {
|
5414
|
+
# "ccy": "CET",
|
5415
|
+
# "deposit_enabled": True,
|
5416
|
+
# "withdraw_enabled": True,
|
5417
|
+
# "inter_transfer_enabled": True,
|
5418
|
+
# "is_st": False
|
5419
|
+
# },
|
5420
|
+
# "chains": [
|
5421
|
+
# {
|
5422
|
+
# "chain": "CSC",
|
5423
|
+
# "min_deposit_amount": "0.8",
|
5424
|
+
# "min_withdraw_amount": "8",
|
5425
|
+
# "deposit_enabled": True,
|
5426
|
+
# "withdraw_enabled": True,
|
5427
|
+
# "deposit_delay_minutes": 0,
|
5428
|
+
# "safe_confirmations": 10,
|
5429
|
+
# "irreversible_confirmations": 20,
|
5430
|
+
# "deflation_rate": "0",
|
5431
|
+
# "withdrawal_fee": "0.026",
|
5432
|
+
# "withdrawal_precision": 8,
|
5433
|
+
# "memo": "",
|
5434
|
+
# "is_memo_required_for_deposit": False,
|
5435
|
+
# "explorer_asset_url": ""
|
5436
|
+
# },
|
5437
|
+
# ]
|
5438
|
+
# }
|
5439
|
+
# ],
|
5440
|
+
# "message": "OK"
|
5441
|
+
# }
|
5442
|
+
#
|
5443
|
+
data = self.safe_list(response, 'data', [])
|
5444
|
+
result: dict = {}
|
5445
|
+
for i in range(0, len(data)):
|
5446
|
+
item = data[i]
|
5447
|
+
asset = self.safe_dict(item, 'asset', {})
|
5448
|
+
currencyId = self.safe_string(asset, 'ccy')
|
5449
|
+
if currencyId is None:
|
5450
|
+
continue
|
5451
|
+
code = self.safe_currency_code(currencyId)
|
5452
|
+
if codes is None or self.in_array(code, codes):
|
5453
|
+
result[code] = self.parse_deposit_withdraw_fee(item)
|
5454
|
+
return result
|
5455
|
+
|
5395
5456
|
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
5396
5457
|
#
|
5397
5458
|
# {
|
coinex/ccxt/pro/__init__.py
CHANGED
coinex/ccxt/pro/coinex.py
CHANGED
@@ -1260,7 +1260,7 @@ class coinex(coinexAsync):
|
|
1260
1260
|
method = self.safe_string(message, 'method')
|
1261
1261
|
error = self.safe_string(message, 'message')
|
1262
1262
|
if error is not None:
|
1263
|
-
self.handle_errors(
|
1263
|
+
self.handle_errors(1, '', client.url, method, {}, self.json(error), message, {}, {})
|
1264
1264
|
handlers: dict = {
|
1265
1265
|
'state.update': self.handle_ticker,
|
1266
1266
|
'balance.update': self.handle_balance,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: coinex-api
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.81
|
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
|
@@ -138,6 +138,7 @@ You can also construct custom requests to available "implicit" endpoints
|
|
138
138
|
- `fetch_currencies(self, params={})`
|
139
139
|
- `fetch_deposit_address(self, code: str, params={})`
|
140
140
|
- `fetch_deposit_withdraw_fee(self, code: str, params={})`
|
141
|
+
- `fetch_deposit_withdraw_fees(self, codes: Strings = None, params={})`
|
141
142
|
- `fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={})`
|
142
143
|
- `fetch_financial_balance(self, params={})`
|
143
144
|
- `fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})`
|
@@ -183,10 +184,10 @@ You can also construct custom requests to available "implicit" endpoints
|
|
183
184
|
- `nonce(self)`
|
184
185
|
- `reduce_margin(self, symbol: str, amount: float, params={})`
|
185
186
|
- `repay_isolated_margin(self, symbol: str, code: str, amount, params={})`
|
186
|
-
- `set_leverage(self, leverage:
|
187
|
+
- `set_leverage(self, leverage: int, symbol: Str = None, params={})`
|
187
188
|
- `set_margin_mode(self, marginMode: str, symbol: Str = None, params={})`
|
188
189
|
- `transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={})`
|
189
|
-
- `withdraw(self, code: str, amount: float, address: str, tag=None, params={})`
|
190
|
+
- `withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={})`
|
190
191
|
|
191
192
|
### REST Raw
|
192
193
|
|
@@ -1,27 +1,27 @@
|
|
1
1
|
coinex/__init__.py,sha256=d633U2PpNFHvpDWLb3lItS0ObcBN0E2XgS5QkOEejI8,246
|
2
|
-
coinex/ccxt/__init__.py,sha256=
|
3
|
-
coinex/ccxt/coinex.py,sha256=
|
2
|
+
coinex/ccxt/__init__.py,sha256=mVFJl4lSSAY8vBSG3Cqm94Uht3UUfGrC_l9cYNVpQ44,6132
|
3
|
+
coinex/ccxt/coinex.py,sha256=GNqLhiIrwvRjtVGgwHI_no_RxjPK4E0vg90F-kGHQWA,270314
|
4
4
|
coinex/ccxt/abstract/coinex.py,sha256=4TRXtWgONqkm3eSL55Y5T7Q4QxJrnOTuhP0ugsKHAWo,34856
|
5
|
-
coinex/ccxt/async_support/__init__.py,sha256=
|
6
|
-
coinex/ccxt/async_support/coinex.py,sha256=
|
5
|
+
coinex/ccxt/async_support/__init__.py,sha256=wBjgSN3PXaVo3G0fuLItK7w4XPgPgTIxUC50aZD-m_Y,4865
|
6
|
+
coinex/ccxt/async_support/coinex.py,sha256=IfL7Z4SeWlAdrNs7T-fpRLlUN_DRe_QrUhkDJBt_24U,271620
|
7
7
|
coinex/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
|
8
|
-
coinex/ccxt/async_support/base/exchange.py,sha256=
|
8
|
+
coinex/ccxt/async_support/base/exchange.py,sha256=WdBdPIULdRg1xxi4Vj7sMuECybSEysxFe2GZMjn1VnE,121270
|
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=
|
12
|
+
coinex/ccxt/async_support/base/ws/client.py,sha256=GZmtA-oYJUtBA063mEF_zxDPtAm-7WsISJTffFalJyo,13735
|
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=hjdQ42zkfju5nar0GpTLJ4zXQBtgBU8DzYM5uPFcjsE,1450
|
15
15
|
coinex/ccxt/async_support/base/ws/order_book.py,sha256=uBUaIHhzMRykpmo4BCsdJ-t_HozS6VxhEs8x-Kbj-NI,2894
|
16
16
|
coinex/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9produGjmBJLCI5FHIRdMz1O-g,6551
|
17
17
|
coinex/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
|
18
18
|
coinex/ccxt/base/decimal_to_precision.py,sha256=3XI30u9YudHbTA438397u5rkdlXa3atxwZEfUus3C4k,6803
|
19
|
-
coinex/ccxt/base/errors.py,sha256=
|
20
|
-
coinex/ccxt/base/exchange.py,sha256=
|
19
|
+
coinex/ccxt/base/errors.py,sha256=LdTTHPmxpeFHJze93mGl7I3maqTgN0y_1mJ6coWkXmA,4734
|
20
|
+
coinex/ccxt/base/exchange.py,sha256=FCbVCDcddJTuVcvOg6-fFNxY1hA4WfHERonT0N36bT0,334126
|
21
21
|
coinex/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
|
22
|
-
coinex/ccxt/base/types.py,sha256=
|
23
|
-
coinex/ccxt/pro/__init__.py,sha256=
|
24
|
-
coinex/ccxt/pro/coinex.py,sha256=
|
22
|
+
coinex/ccxt/base/types.py,sha256=Gvbogh9i7pPH7Z18xesYeDPribqqwq8uKpOv-YODFBs,11505
|
23
|
+
coinex/ccxt/pro/__init__.py,sha256=GJY4Xi793G1XS7rEZbV6Wa4v7ZlGphdeIXDwAtoZ8F0,4179
|
24
|
+
coinex/ccxt/pro/coinex.py,sha256=2JKAiwCjGDIxw5KiQu0Py76I1srKDfcWGjisPJT04aA,56605
|
25
25
|
coinex/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
|
26
26
|
coinex/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
|
27
27
|
coinex/ccxt/static_dependencies/ecdsa/__init__.py,sha256=Xaj0G79BLtBt2YZcOOMV8qOlQZ7fIJznNiHhiEEZfQA,594
|
@@ -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.
|
285
|
-
coinex_api-0.0.
|
286
|
-
coinex_api-0.0.
|
284
|
+
coinex_api-0.0.81.dist-info/METADATA,sha256=gxWgn1WQNwmVJ6cMa0skTv8o7b-1MC7o4VG2j8DDYYE,20048
|
285
|
+
coinex_api-0.0.81.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
286
|
+
coinex_api-0.0.81.dist-info/RECORD,,
|
File without changes
|