mexc-exchange-api 0.0.20__py3-none-any.whl → 0.0.21__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 mexc-exchange-api might be problematic. Click here for more details.

mexc/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.69'
29
+ __version__ = '4.4.72'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -87,9 +87,10 @@ from ccxt.base.errors import CancelPending # noqa: F4
87
87
  from ccxt.base.errors import UnsubscribeError # noqa: F401
88
88
  from ccxt.base.errors import error_hierarchy # noqa: F401
89
89
 
90
+ from ccxt.bitfinex1 import bitfinex1 # noqa: F401
90
91
  from ccxt.mexc import mexc # noqa: F401
91
92
 
92
- exchanges = [ 'mexc',]
93
+ exchanges = [ 'bitfinex1', 'mexc',]
93
94
 
94
95
  base = [
95
96
  'Exchange',
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.69'
11
+ __version__ = '4.4.72'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -67,9 +67,10 @@ from ccxt.base.errors import UnsubscribeError # noqa: F4
67
67
  from ccxt.base.errors import error_hierarchy # noqa: F401
68
68
 
69
69
 
70
+ from ccxt.async_support.bitfinex1 import bitfinex1 # noqa: F401
70
71
  from ccxt.async_support.mexc import mexc # noqa: F401
71
72
 
72
- exchanges = [ 'mexc',]
73
+ exchanges = [ 'bitfinex1', 'mexc',]
73
74
 
74
75
  base = [
75
76
  'Exchange',
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.69'
5
+ __version__ = '4.4.72'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -25,7 +25,7 @@ from ccxt.async_support.base.throttler import Throttler
25
25
  # -----------------------------------------------------------------------------
26
26
 
27
27
  from ccxt.base.errors import BaseError, BadSymbol, BadRequest, BadResponse, ExchangeError, ExchangeNotAvailable, RequestTimeout, NotSupported, NullResponse, InvalidAddress, RateLimitExceeded, OperationFailed
28
- from ccxt.base.types import OrderType, OrderSide, OrderRequest, CancellationRequest
28
+ from ccxt.base.types import ConstructorArgs, OrderType, OrderSide, OrderRequest, CancellationRequest
29
29
 
30
30
  # -----------------------------------------------------------------------------
31
31
 
@@ -67,7 +67,7 @@ class Exchange(BaseExchange):
67
67
  clients = {}
68
68
  timeout_on_exit = 250 # needed for: https://github.com/ccxt/ccxt/pull/23470
69
69
 
70
- def __init__(self, config={}):
70
+ def __init__(self, config: ConstructorArgs = {}):
71
71
  if 'asyncio_loop' in config:
72
72
  self.asyncio_loop = config['asyncio_loop']
73
73
  self.aiohttp_trust_env = config.get('aiohttp_trust_env', self.aiohttp_trust_env)
@@ -2196,8 +2196,10 @@ class mexc(Exchange, ImplicitAPI):
2196
2196
  market = self.market(symbol)
2197
2197
  if not market['spot']:
2198
2198
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2199
- params['cost'] = cost
2200
- return await self.create_order(symbol, 'market', 'buy', 0, None, params)
2199
+ req = {
2200
+ 'cost': cost,
2201
+ }
2202
+ return await self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
2201
2203
 
2202
2204
  async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
2203
2205
  """
@@ -2214,8 +2216,10 @@ class mexc(Exchange, ImplicitAPI):
2214
2216
  market = self.market(symbol)
2215
2217
  if not market['spot']:
2216
2218
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2217
- params['cost'] = cost
2218
- return await self.create_order(symbol, 'market', 'sell', 0, None, params)
2219
+ req = {
2220
+ 'cost': cost,
2221
+ }
2222
+ return await self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
2219
2223
 
2220
2224
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
2221
2225
  """
@@ -4534,7 +4538,7 @@ class mexc(Exchange, ImplicitAPI):
4534
4538
  addressStructures = self.parse_deposit_addresses(response, None, False)
4535
4539
  return self.index_by(addressStructures, 'network')
4536
4540
 
4537
- async def create_deposit_address(self, code: str, params={}):
4541
+ async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
4538
4542
  """
4539
4543
  create a currency deposit address
4540
4544
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.69'
7
+ __version__ = '4.4.72'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -33,7 +33,7 @@ from ccxt.base.decimal_to_precision import decimal_to_precision
33
33
  from ccxt.base.decimal_to_precision import DECIMAL_PLACES, TICK_SIZE, NO_PADDING, TRUNCATE, ROUND, ROUND_UP, ROUND_DOWN, SIGNIFICANT_DIGITS
34
34
  from ccxt.base.decimal_to_precision import number_to_string
35
35
  from ccxt.base.precise import Precise
36
- from ccxt.base.types import BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings, CancellationRequest, Bool
36
+ from ccxt.base.types import ConstructorArgs, BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings, CancellationRequest, Bool
37
37
 
38
38
  # -----------------------------------------------------------------------------
39
39
 
@@ -369,7 +369,7 @@ class Exchange(object):
369
369
  }
370
370
  synchronous = True
371
371
 
372
- def __init__(self, config={}):
372
+ def __init__(self, config: ConstructorArgs = {}):
373
373
  self.aiohttp_trust_env = self.aiohttp_trust_env or self.trust_env
374
374
  self.requests_trust_env = self.requests_trust_env or self.trust_env
375
375
 
@@ -410,6 +410,9 @@ class Exchange(object):
410
410
 
411
411
  self.after_construct()
412
412
 
413
+ if self.safe_bool(config, 'sandbox') or self.safe_bool(config, 'testnet'):
414
+ self.set_sandbox_mode(True)
415
+
413
416
  # convert all properties from underscore notation foo_bar to camelcase notation fooBar
414
417
  cls = type(self)
415
418
  for name in dir(self):
@@ -2918,7 +2921,8 @@ class Exchange(object):
2918
2921
  length = len(keys)
2919
2922
  if length != 0:
2920
2923
  for i in range(0, length):
2921
- network = networks[keys[i]]
2924
+ key = keys[i]
2925
+ network = networks[key]
2922
2926
  deposit = self.safe_bool(network, 'deposit')
2923
2927
  if currencyDeposit is None or deposit:
2924
2928
  currency['deposit'] = deposit
@@ -2928,6 +2932,12 @@ class Exchange(object):
2928
2932
  active = self.safe_bool(network, 'active')
2929
2933
  if currencyActive is None or active:
2930
2934
  currency['active'] = active
2935
+ # set network 'active' to False if D or W is disabled
2936
+ if self.safe_bool(network, 'active') is None:
2937
+ if deposit and withdraw:
2938
+ currency['networks'][key]['active'] = True
2939
+ elif deposit is not None and withdraw is not None:
2940
+ currency['networks'][key]['active'] = False
2931
2941
  # find lowest fee(which is more desired)
2932
2942
  fee = self.safe_string(network, 'fee')
2933
2943
  feeMain = self.safe_string(currency, 'fee')
@@ -4286,6 +4296,23 @@ class Exchange(object):
4286
4296
  params = self.omit(params, [paramName1, paramName2])
4287
4297
  return [value, params]
4288
4298
 
4299
+ def handle_request_network(self, params: dict, request: dict, exchangeSpecificKey: str, currencyCode: Str = None, isRequired: bool = False):
4300
+ """
4301
+ :param dict params: - extra parameters
4302
+ :param dict request: - existing dictionary of request
4303
+ :param str exchangeSpecificKey: - the key for chain id to be set in request
4304
+ :param dict currencyCode: - (optional) existing dictionary of request
4305
+ :param boolean isRequired: - (optional) whether that param is required to be present
4306
+ :returns dict[]: - returns [request, params] where request is the modified request object and params is the modified params object
4307
+ """
4308
+ networkCode = None
4309
+ networkCode, params = self.handle_network_code_and_params(params)
4310
+ if networkCode is not None:
4311
+ request[exchangeSpecificKey] = self.network_code_to_id(networkCode, currencyCode)
4312
+ elif isRequired:
4313
+ raise ArgumentsRequired(self.id + ' - "network" param is required for self request')
4314
+ return [request, params]
4315
+
4289
4316
  def resolve_path(self, path, params):
4290
4317
  return [
4291
4318
  self.implode_params(path, params),
mexc/ccxt/base/types.py CHANGED
@@ -575,3 +575,31 @@ LeverageTiers = Dict[Str, List[LeverageTier]]
575
575
 
576
576
  Market = Optional[MarketInterface]
577
577
  Currency = Optional[CurrencyInterface]
578
+
579
+ class ConstructorArgs(TypedDict, total=False):
580
+ apiKey: str
581
+ secret: str
582
+ passphrase: str
583
+ password: str
584
+ privateKey: str
585
+ walletAddress: str
586
+ uid: str
587
+ verbose: bool
588
+ testnet: bool
589
+ sandbox: bool # redudant but kept for backwards compatibility
590
+ options: Dict[str, Any]
591
+ enableRateLimit: bool
592
+ httpsProxy: str
593
+ socksProxy: str
594
+ wssProxy: str
595
+ proxy: str
596
+ rateLimit: Num
597
+ commonCurrencies: Dict[str, Any]
598
+ userAgent: str
599
+ userAgents: Dict[str, Any]
600
+ timeout: Num
601
+ markets: Dict[str, Any]
602
+ currencies: Dict[str, Any]
603
+ hostname: str
604
+ urls: Dict[str, Any]
605
+ headers: Dict[str, Any]
mexc/ccxt/mexc.py CHANGED
@@ -2195,8 +2195,10 @@ class mexc(Exchange, ImplicitAPI):
2195
2195
  market = self.market(symbol)
2196
2196
  if not market['spot']:
2197
2197
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2198
- params['cost'] = cost
2199
- return self.create_order(symbol, 'market', 'buy', 0, None, params)
2198
+ req = {
2199
+ 'cost': cost,
2200
+ }
2201
+ return self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
2200
2202
 
2201
2203
  def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
2202
2204
  """
@@ -2213,8 +2215,10 @@ class mexc(Exchange, ImplicitAPI):
2213
2215
  market = self.market(symbol)
2214
2216
  if not market['spot']:
2215
2217
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2216
- params['cost'] = cost
2217
- return self.create_order(symbol, 'market', 'sell', 0, None, params)
2218
+ req = {
2219
+ 'cost': cost,
2220
+ }
2221
+ return self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
2218
2222
 
2219
2223
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
2220
2224
  """
@@ -4533,7 +4537,7 @@ class mexc(Exchange, ImplicitAPI):
4533
4537
  addressStructures = self.parse_deposit_addresses(response, None, False)
4534
4538
  return self.index_by(addressStructures, 'network')
4535
4539
 
4536
- def create_deposit_address(self, code: str, params={}):
4540
+ def create_deposit_address(self, code: str, params={}) -> DepositAddress:
4537
4541
  """
4538
4542
  create a currency deposit address
4539
4543
 
mexc/ccxt/pro/__init__.py CHANGED
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.69'
11
+ __version__ = '4.4.72'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -16,6 +16,7 @@ from ccxt.async_support.base.exchange import Exchange # noqa: F401
16
16
 
17
17
  # CCXT Pro exchanges (now this is mainly used for importing exchanges in WS tests)
18
18
 
19
+ from ccxt.pro.bitfinex1 import bitfinex1 # noqa: F401
19
20
  from ccxt.pro.mexc import mexc # noqa: F401
20
21
 
21
- exchanges = [ 'mexc',]
22
+ exchanges = [ 'bitfinex1', 'mexc',]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mexc-exchange-api
3
- Version: 0.0.20
3
+ Version: 0.0.21
4
4
  Summary: mexc 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
  mexc/__init__.py,sha256=bFV_Nfz_k-lfB_ImsHGpFnJuVMUXLBRbttugnPV7c4A,222
2
- mexc/ccxt/__init__.py,sha256=ceoT4T_CLIj9W3TeGaUxk-g0LlfuTFzOFCpKxSuIxKg,6044
3
- mexc/ccxt/mexc.py,sha256=nWE-bWb7I_J10S6Wykz0XfH_aLebvqCQ-c9DFm2xM_A,259402
2
+ mexc/ccxt/__init__.py,sha256=kdJ8_KVPV_ydDhBpxrxagk0-i6uUI3mPsUo-eV-GYQU,6143
3
+ mexc/ccxt/mexc.py,sha256=UZwxafIn_sl9tESUo_-PzPqFAfRXpB6wW8YZN_SrSa8,259500
4
4
  mexc/ccxt/abstract/mexc.py,sha256=oyg0sZFYs1d77F-_9QAatqMSQJ8h-1u1wWb-d1DX2zQ,26434
5
- mexc/ccxt/async_support/__init__.py,sha256=nhzHWOCUJIHBOxomtGHXegasArCzOzy-Jdi46Nk6Zg4,4777
6
- mexc/ccxt/async_support/mexc.py,sha256=GWRHR0SUuT8HYWwe5R84d26XIpKR6LS28AlD5kRO4FU,260666
5
+ mexc/ccxt/async_support/__init__.py,sha256=bJ3ETw0Z4j5jUsjwipkDGOna2JV6jVwjnhciY20RtLo,4886
6
+ mexc/ccxt/async_support/mexc.py,sha256=J61la7F67tS5-FUe7qHOtIcPkkClYM4UkIHkOVdUHP0,260764
7
7
  mexc/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- mexc/ccxt/async_support/base/exchange.py,sha256=kaTkt4ymyRymoDhvLkrjCrEpcs89pipkw6uTn6duP6c,117187
8
+ mexc/ccxt/async_support/base/exchange.py,sha256=KAsKEfcM2w4vjLa0zmUEMXiBsNduSWfo1A6h15pOLGA,117223
9
9
  mexc/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  mexc/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  mexc/ccxt/async_support/base/ws/aiohttp_client.py,sha256=Y5HxAVXyyYduj6b6SbbUZETlq3GrVMzrkW1r-TMgpb8,6329
@@ -19,10 +19,10 @@ mexc/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9prod
19
19
  mexc/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
20
20
  mexc/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
21
21
  mexc/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
22
- mexc/ccxt/base/exchange.py,sha256=rlbOp4euVpeXPiEEAS0eWLHA2nXGRhLHmiEnbBoIqcI,320329
22
+ mexc/ccxt/base/exchange.py,sha256=Fr_Du0LL1ud6tVY0ldQ0Vl3PZVDAo_lkqkEIuQi-8hI,321957
23
23
  mexc/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
24
- mexc/ccxt/base/types.py,sha256=asavKC4Fpuz9MGv1tJBld0j8CeojiP7nBj04Abusst4,10766
25
- mexc/ccxt/pro/__init__.py,sha256=C6axkk4AhSYeuxgNNk-2PLpiDTMj8X1Crt_eROXdtE0,615
24
+ mexc/ccxt/base/types.py,sha256=SfxIKDSsxP7MPHWiOVI965Nr5NSEPpAno5fuveTRi3w,11423
25
+ mexc/ccxt/pro/__init__.py,sha256=kEbttJiZaaqRnaqgZZYEdaPmE3kRY9D-gIJ-Pt0Yeek,718
26
26
  mexc/ccxt/pro/mexc.py,sha256=SRaTTx4D4OcZi5Im9wBm6Rh54vZCxeeAcC5rK6NB3wk,56535
27
27
  mexc/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
28
28
  mexc/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
@@ -283,6 +283,6 @@ mexc/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX2u
283
283
  mexc/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
284
284
  mexc/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
285
285
  mexc/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
286
- mexc_exchange_api-0.0.20.dist-info/METADATA,sha256=M3pOLueesrTFO2b-xdsxu84E0Om5cWr-mTKFF6g187Q,17569
287
- mexc_exchange_api-0.0.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
288
- mexc_exchange_api-0.0.20.dist-info/RECORD,,
286
+ mexc_exchange_api-0.0.21.dist-info/METADATA,sha256=sd1cMEkkjvxOGmgzrkTB5f6ekCIBGeDWN8nuT2GJYig,17569
287
+ mexc_exchange_api-0.0.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
288
+ mexc_exchange_api-0.0.21.dist-info/RECORD,,