ccxt 4.4.70__py2.py3-none-any.whl → 4.4.71__py2.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.
Files changed (51) hide show
  1. ccxt/__init__.py +1 -3
  2. ccxt/abstract/bingx.py +1 -0
  3. ccxt/abstract/bitmart.py +1 -0
  4. ccxt/abstract/poloniex.py +36 -0
  5. ccxt/async_support/__init__.py +1 -3
  6. ccxt/async_support/base/exchange.py +3 -3
  7. ccxt/async_support/binance.py +106 -101
  8. ccxt/async_support/bingx.py +64 -42
  9. ccxt/async_support/bitget.py +0 -3
  10. ccxt/async_support/bitmart.py +12 -1
  11. ccxt/async_support/bitopro.py +1 -0
  12. ccxt/async_support/bitrue.py +1 -0
  13. ccxt/async_support/cex.py +1 -0
  14. ccxt/async_support/coinbaseexchange.py +1 -0
  15. ccxt/async_support/deribit.py +1 -0
  16. ccxt/async_support/hashkey.py +4 -2
  17. ccxt/async_support/kraken.py +77 -5
  18. ccxt/async_support/kucoin.py +4 -2
  19. ccxt/async_support/mexc.py +8 -4
  20. ccxt/async_support/okx.py +58 -46
  21. ccxt/async_support/poloniex.py +1263 -85
  22. ccxt/async_support/whitebit.py +4 -2
  23. ccxt/base/exchange.py +23 -3
  24. ccxt/base/types.py +28 -0
  25. ccxt/binance.py +106 -101
  26. ccxt/bingx.py +64 -42
  27. ccxt/bitget.py +0 -3
  28. ccxt/bitmart.py +12 -1
  29. ccxt/bitopro.py +1 -0
  30. ccxt/bitrue.py +1 -0
  31. ccxt/cex.py +1 -0
  32. ccxt/coinbaseexchange.py +1 -0
  33. ccxt/deribit.py +1 -0
  34. ccxt/hashkey.py +4 -2
  35. ccxt/kraken.py +77 -5
  36. ccxt/kucoin.py +4 -2
  37. ccxt/mexc.py +8 -4
  38. ccxt/okx.py +58 -46
  39. ccxt/poloniex.py +1262 -85
  40. ccxt/pro/__init__.py +1 -3
  41. ccxt/pro/binance.py +102 -102
  42. ccxt/pro/bingx.py +62 -51
  43. ccxt/test/tests_async.py +1 -0
  44. ccxt/test/tests_sync.py +1 -0
  45. ccxt/whitebit.py +4 -2
  46. {ccxt-4.4.70.dist-info → ccxt-4.4.71.dist-info}/METADATA +6 -9
  47. {ccxt-4.4.70.dist-info → ccxt-4.4.71.dist-info}/RECORD +50 -51
  48. ccxt/abstract/poloniexfutures.py +0 -48
  49. {ccxt-4.4.70.dist-info → ccxt-4.4.71.dist-info}/LICENSE.txt +0 -0
  50. {ccxt-4.4.70.dist-info → ccxt-4.4.71.dist-info}/WHEEL +0 -0
  51. {ccxt-4.4.70.dist-info → ccxt-4.4.71.dist-info}/top_level.txt +0 -0
@@ -1342,9 +1342,11 @@ class whitebit(Exchange, ImplicitAPI):
1342
1342
  :param dict [params]: extra parameters specific to the exchange API endpoint
1343
1343
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1344
1344
  """
1345
- params['cost'] = cost
1345
+ req = {
1346
+ 'cost': cost,
1347
+ }
1346
1348
  # only buy side is supported
1347
- return await self.create_order(symbol, 'market', side, 0, None, params)
1349
+ return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
1348
1350
 
1349
1351
  async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
1350
1352
  """
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.70'
7
+ __version__ = '4.4.71'
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):
@@ -4286,6 +4289,23 @@ class Exchange(object):
4286
4289
  params = self.omit(params, [paramName1, paramName2])
4287
4290
  return [value, params]
4288
4291
 
4292
+ def handle_request_network(self, params: dict, request: dict, exchangeSpecificKey: str, currencyCode: Str = None, isRequired: bool = False):
4293
+ """
4294
+ :param dict params: - extra parameters
4295
+ :param dict request: - existing dictionary of request
4296
+ :param str exchangeSpecificKey: - the key for chain id to be set in request
4297
+ :param dict currencyCode: - (optional) existing dictionary of request
4298
+ :param boolean isRequired: - (optional) whether that param is required to be present
4299
+ :returns dict[]: - returns [request, params] where request is the modified request object and params is the modified params object
4300
+ """
4301
+ networkCode = None
4302
+ networkCode, params = self.handle_network_code_and_params(params)
4303
+ if networkCode is not None:
4304
+ request[exchangeSpecificKey] = self.network_code_to_id(networkCode, currencyCode)
4305
+ elif isRequired:
4306
+ raise ArgumentsRequired(self.id + ' - "network" param is required for self request')
4307
+ return [request, params]
4308
+
4289
4309
  def resolve_path(self, path, params):
4290
4310
  return [
4291
4311
  self.implode_params(path, params),
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]