kucoin-api 0.0.26__py3-none-any.whl → 0.0.28__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.
kucoin/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.72'
29
+ __version__ = '4.4.75'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -87,10 +87,9 @@ 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
91
90
  from ccxt.kucoin import kucoin # noqa: F401
92
91
 
93
- exchanges = [ 'bitfinex1', 'kucoin',]
92
+ exchanges = [ 'kucoin',]
94
93
 
95
94
  base = [
96
95
  'Exchange',
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.72'
11
+ __version__ = '4.4.75'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -67,10 +67,9 @@ 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
71
70
  from ccxt.async_support.kucoin import kucoin # noqa: F401
72
71
 
73
- exchanges = [ 'bitfinex1', 'kucoin',]
72
+ exchanges = [ 'kucoin',]
74
73
 
75
74
  base = [
76
75
  'Exchange',
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.72'
5
+ __version__ = '4.4.75'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.72'
7
+ __version__ = '4.4.75'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2913,9 +2913,6 @@ class Exchange(object):
2913
2913
 
2914
2914
  def safe_currency_structure(self, currency: object):
2915
2915
  # derive data from networks: deposit, withdraw, active, fee, limits, precision
2916
- currencyDeposit = self.safe_bool(currency, 'deposit')
2917
- currencyWithdraw = self.safe_bool(currency, 'withdraw')
2918
- currencyActive = self.safe_bool(currency, 'active')
2919
2916
  networks = self.safe_dict(currency, 'networks', {})
2920
2917
  keys = list(networks.keys())
2921
2918
  length = len(keys)
@@ -2924,20 +2921,24 @@ class Exchange(object):
2924
2921
  key = keys[i]
2925
2922
  network = networks[key]
2926
2923
  deposit = self.safe_bool(network, 'deposit')
2924
+ currencyDeposit = self.safe_bool(currency, 'deposit')
2927
2925
  if currencyDeposit is None or deposit:
2928
2926
  currency['deposit'] = deposit
2929
2927
  withdraw = self.safe_bool(network, 'withdraw')
2928
+ currencyWithdraw = self.safe_bool(currency, 'withdraw')
2930
2929
  if currencyWithdraw is None or withdraw:
2931
2930
  currency['withdraw'] = withdraw
2932
- active = self.safe_bool(network, 'active')
2933
- if currencyActive is None or active:
2934
- currency['active'] = active
2935
2931
  # set network 'active' to False if D or W is disabled
2936
- if self.safe_bool(network, 'active') is None:
2932
+ active = self.safe_bool(network, 'active')
2933
+ if active is None:
2937
2934
  if deposit and withdraw:
2938
2935
  currency['networks'][key]['active'] = True
2939
2936
  elif deposit is not None and withdraw is not None:
2940
2937
  currency['networks'][key]['active'] = False
2938
+ active = self.safe_bool(network, 'active')
2939
+ currencyActive = self.safe_bool(currency, 'active')
2940
+ if currencyActive is None or active:
2941
+ currency['active'] = active
2941
2942
  # find lowest fee(which is more desired)
2942
2943
  fee = self.safe_string(network, 'fee')
2943
2944
  feeMain = self.safe_string(currency, 'fee')
@@ -6471,24 +6472,36 @@ class Exchange(object):
6471
6472
  return self.sort_by(result, 'id', True)
6472
6473
  return result
6473
6474
 
6474
- def remove_repeated_elements_from_array(self, input):
6475
+ def remove_repeated_elements_from_array(self, input, fallbackToTimestamp: bool = True):
6476
+ uniqueDic = {}
6477
+ uniqueResult = []
6478
+ for i in range(0, len(input)):
6479
+ entry = input[i]
6480
+ uniqValue = self.safe_string_n(entry, ['id', 'timestamp', 0]) if fallbackToTimestamp else self.safe_string(entry, 'id')
6481
+ if uniqValue is not None and not (uniqValue in uniqueDic):
6482
+ uniqueDic[uniqValue] = 1
6483
+ uniqueResult.append(entry)
6484
+ valuesLength = len(uniqueResult)
6485
+ if valuesLength > 0:
6486
+ return uniqueResult
6487
+ return input
6488
+
6489
+ def remove_repeated_trades_from_array(self, input):
6475
6490
  uniqueResult = {}
6476
6491
  for i in range(0, len(input)):
6477
6492
  entry = input[i]
6478
6493
  id = self.safe_string(entry, 'id')
6479
- if id is not None:
6480
- if self.safe_string(uniqueResult, id) is None:
6481
- uniqueResult[id] = entry
6482
- else:
6483
- timestamp = self.safe_integer_2(entry, 'timestamp', 0)
6484
- if timestamp is not None:
6485
- if self.safe_string(uniqueResult, timestamp) is None:
6486
- uniqueResult[timestamp] = entry
6494
+ if id is None:
6495
+ price = self.safe_string(entry, 'price')
6496
+ amount = self.safe_string(entry, 'amount')
6497
+ timestamp = self.safe_string(entry, 'timestamp')
6498
+ side = self.safe_string(entry, 'side')
6499
+ # unique trade identifier
6500
+ id = 't_' + str(timestamp) + '_' + side + '_' + price + '_' + amount
6501
+ if id is not None and not (id in uniqueResult):
6502
+ uniqueResult[id] = entry
6487
6503
  values = list(uniqueResult.values())
6488
- valuesLength = len(values)
6489
- if valuesLength > 0:
6490
- return values
6491
- return input
6504
+ return values
6492
6505
 
6493
6506
  def handle_until_option(self, key: str, request, params, multiplier=1):
6494
6507
  until = self.safe_integer_2(params, 'until', 'till')
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.72'
11
+ __version__ = '4.4.75'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -16,7 +16,6 @@ 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
20
19
  from ccxt.pro.kucoin import kucoin # noqa: F401
21
20
 
22
- exchanges = [ 'bitfinex1', 'kucoin',]
21
+ exchanges = [ 'kucoin',]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kucoin-api
3
- Version: 0.0.26
3
+ Version: 0.0.28
4
4
  Summary: kucoin crypto exchange api client
5
5
  Project-URL: Homepage, https://github.com/ccxt/ccxt
6
6
  Project-URL: Issues, https://github.com/ccxt/ccxt
@@ -20,8 +20,10 @@ Description-Content-Type: text/markdown
20
20
  # kucoin-python
21
21
  Python SDK (sync and async) for Kucoin cryptocurrency exchange with Rest and WS capabilities.
22
22
 
23
- You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/kucoin)
24
- You can check Kucoin's docs here: [Docs](https://www.google.com/search?q=google+kucoin+cryptocurrency+exchange+api+docs)
23
+ - You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/kucoin)
24
+ - You can check Kucoin's docs here: [Docs](https://www.google.com/search?q=google+kucoin+cryptocurrency+exchange+api+docs)
25
+ - Github repo: https://github.com/ccxt/kucoin-python
26
+ - Pypi package: https://pypi.org/project/kucoin-api
25
27
 
26
28
 
27
29
  ## Installation
@@ -44,6 +46,8 @@ def main():
44
46
  #
45
47
  # balance = instance.fetch_balance()
46
48
  # order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)
49
+
50
+ main()
47
51
  ```
48
52
 
49
53
  ### Async
@@ -92,6 +96,8 @@ async def main():
92
96
 
93
97
  # once you are done with the exchange
94
98
  await instance.close()
99
+
100
+ asyncio.run(main())
95
101
  ```
96
102
 
97
103
 
@@ -1,11 +1,11 @@
1
1
  kucoin/__init__.py,sha256=J1NNMLktlkCZKV82j8CFTVES3O3TCVk3so0ROi4E52o,246
2
- kucoin/ccxt/__init__.py,sha256=nSbRZu2zP1fXiKttrnr8wLuq8l5l8XB07oSZxGyaXhw,6147
2
+ kucoin/ccxt/__init__.py,sha256=bvXndv72WMkn5JaepdS3JxYJQl84MsY1yNXpiQFB-r8,6048
3
3
  kucoin/ccxt/kucoin.py,sha256=OycntB0gK0mI4ZfDDMmHip8n2S-AxgKX2jG9XjFeJ5A,232381
4
4
  kucoin/ccxt/abstract/kucoin.py,sha256=kVrVEXiigc36arfbSS8lDUMnG7uFdKgUKHIhVb0Am_8,28626
5
- kucoin/ccxt/async_support/__init__.py,sha256=ichKfbJ50b8wZvOG5CL6GuFsErZTfr4MN6vPgLgAOZA,4890
5
+ kucoin/ccxt/async_support/__init__.py,sha256=je3XCk-XTaLZPOZNH7no9jP7ofuoORp2KEycH11tu9Y,4781
6
6
  kucoin/ccxt/async_support/kucoin.py,sha256=kUz1hYpOU364piOa-psqtxTm11f6KlXS0HErk9_J-xk,233531
7
7
  kucoin/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- kucoin/ccxt/async_support/base/exchange.py,sha256=KAsKEfcM2w4vjLa0zmUEMXiBsNduSWfo1A6h15pOLGA,117223
8
+ kucoin/ccxt/async_support/base/exchange.py,sha256=X4BrbR9Oo-33uUotlodYrIW7ucESwmoHYnUmWAkS8ck,117223
9
9
  kucoin/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  kucoin/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  kucoin/ccxt/async_support/base/ws/aiohttp_client.py,sha256=Y5HxAVXyyYduj6b6SbbUZETlq3GrVMzrkW1r-TMgpb8,6329
@@ -19,10 +19,10 @@ kucoin/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9pr
19
19
  kucoin/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
20
20
  kucoin/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
21
21
  kucoin/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
22
- kucoin/ccxt/base/exchange.py,sha256=Fr_Du0LL1ud6tVY0ldQ0Vl3PZVDAo_lkqkEIuQi-8hI,321957
22
+ kucoin/ccxt/base/exchange.py,sha256=ZvK4GMhsYIvcZ7KloZD22dcBDOWtroMR88T5mu7zQ7E,322633
23
23
  kucoin/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
24
24
  kucoin/ccxt/base/types.py,sha256=SfxIKDSsxP7MPHWiOVI965Nr5NSEPpAno5fuveTRi3w,11423
25
- kucoin/ccxt/pro/__init__.py,sha256=7BQNLuGAmkpwGuIdGSlmY8r9qnLsmw_ubUaXws7H4e0,722
25
+ kucoin/ccxt/pro/__init__.py,sha256=IE6UXjr_T1YaS5YtpHosMQic7ZPX2THHcAn6qk8C1bE,619
26
26
  kucoin/ccxt/pro/kucoin.py,sha256=598XsFeIFOOAOlY2fuEenBT-pPFjoOKiqPP8lP7dzD4,60794
27
27
  kucoin/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
28
28
  kucoin/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
@@ -283,6 +283,6 @@ kucoin/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX
283
283
  kucoin/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
284
284
  kucoin/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
285
285
  kucoin/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
286
- kucoin_api-0.0.26.dist-info/METADATA,sha256=8eLd2ppv9Zu16mxckP3aWJbAkEgnWMeBpg16BWXdW7U,18433
287
- kucoin_api-0.0.26.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
288
- kucoin_api-0.0.26.dist-info/RECORD,,
286
+ kucoin_api-0.0.28.dist-info/METADATA,sha256=rYlqwxD_fEUMcLm1TUZoh2SzpkyJMFioJOyBh29L4zk,18571
287
+ kucoin_api-0.0.28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
288
+ kucoin_api-0.0.28.dist-info/RECORD,,