ccxt 4.2.64__py2.py3-none-any.whl → 4.2.65__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (41) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/blofin.py +1 -0
  3. ccxt/abstract/kucoin.py +9 -0
  4. ccxt/abstract/kucoinfutures.py +9 -0
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/base/exchange.py +2 -2
  7. ccxt/async_support/binance.py +26 -4
  8. ccxt/async_support/bingx.py +11 -4
  9. ccxt/async_support/bitmex.py +2 -1
  10. ccxt/async_support/blofin.py +34 -1
  11. ccxt/async_support/btcmarkets.py +9 -0
  12. ccxt/async_support/coinbase.py +9 -2
  13. ccxt/async_support/delta.py +92 -2
  14. ccxt/async_support/gate.py +1 -1
  15. ccxt/async_support/kucoin.py +84 -61
  16. ccxt/async_support/okx.py +1 -1
  17. ccxt/async_support/woo.py +1 -1
  18. ccxt/base/exchange.py +14 -3
  19. ccxt/binance.py +26 -4
  20. ccxt/bingx.py +11 -4
  21. ccxt/bitmex.py +2 -1
  22. ccxt/blofin.py +34 -1
  23. ccxt/btcmarkets.py +9 -0
  24. ccxt/coinbase.py +9 -2
  25. ccxt/delta.py +92 -2
  26. ccxt/gate.py +1 -1
  27. ccxt/kucoin.py +84 -61
  28. ccxt/okx.py +1 -1
  29. ccxt/pro/__init__.py +1 -1
  30. ccxt/pro/currencycom.py +1 -1
  31. ccxt/static_dependencies/ethereum/utils/__init__.py +0 -6
  32. ccxt/static_dependencies/ethereum/utils/curried/__init__.py +0 -4
  33. ccxt/test/base/test_shared_methods.py +1 -1
  34. ccxt/woo.py +1 -1
  35. {ccxt-4.2.64.dist-info → ccxt-4.2.65.dist-info}/METADATA +4 -4
  36. {ccxt-4.2.64.dist-info → ccxt-4.2.65.dist-info}/RECORD +38 -41
  37. ccxt/static_dependencies/ethereum/utils/__json/eth_networks.json +0 -1
  38. ccxt/static_dependencies/ethereum/utils/network.py +0 -88
  39. ccxt-4.2.64.data/data/ccxt/eth_networks.json +0 -1
  40. {ccxt-4.2.64.dist-info → ccxt-4.2.65.dist-info}/WHEEL +0 -0
  41. {ccxt-4.2.64.dist-info → ccxt-4.2.65.dist-info}/top_level.txt +0 -0
@@ -1,88 +0,0 @@
1
- from dataclasses import (
2
- dataclass,
3
- )
4
- import json
5
- import os
6
- from typing import (
7
- List,
8
- )
9
- import warnings
10
-
11
- from ..typing import (
12
- ChainId,
13
- )
14
-
15
- from . import (
16
- ValidationError,
17
- )
18
-
19
-
20
- @dataclass
21
- class Network:
22
- chain_id: int
23
- name: str
24
- shortName: str
25
- symbol: ChainId
26
-
27
-
28
- def initialize_network_objects() -> List[Network]:
29
- networks_obj = []
30
-
31
- networks_json_path = os.path.abspath(
32
- os.path.join(os.path.dirname(__file__), "__json")
33
- )
34
- with open(
35
- os.path.join(networks_json_path, "eth_networks.json"),
36
- encoding="UTF-8",
37
- ) as open_file:
38
- network_data = json.load(open_file)
39
-
40
- for entry in network_data:
41
- try:
42
- network = Network(
43
- chain_id=entry["chainId"],
44
- name=entry["name"],
45
- shortName=entry["shortName"],
46
- symbol=ChainId(entry["chainId"]),
47
- )
48
- networks_obj.append(network)
49
- except ValueError:
50
- # Entry does not have a valid ChainId constant in eth-typing
51
- warnings.warn(
52
- f"Network {entry['chainId']} with name '{entry['name']}' does not have "
53
- f"a valid ChainId. eth-typing should be updated with the latest "
54
- f"networks.",
55
- stacklevel=2,
56
- )
57
-
58
- return networks_obj
59
-
60
-
61
- networks = initialize_network_objects()
62
-
63
- networks_by_id = {network.chain_id: network for network in networks}
64
- network_names_by_id = {network.chain_id: network.name for network in networks}
65
- network_short_names_by_id = {
66
- network.chain_id: network.shortName for network in networks
67
- }
68
-
69
-
70
- def network_from_chain_id(chain_id: int) -> Network:
71
- try:
72
- return networks_by_id[chain_id]
73
- except KeyError:
74
- raise ValidationError(f"chain_id is not recognized: {chain_id}")
75
-
76
-
77
- def name_from_chain_id(chain_id: int) -> str:
78
- try:
79
- return network_names_by_id[chain_id]
80
- except KeyError:
81
- raise ValidationError(f"chain_id is not recognized: {chain_id}")
82
-
83
-
84
- def short_name_from_chain_id(chain_id: int) -> str:
85
- try:
86
- return network_short_names_by_id[chain_id]
87
- except KeyError:
88
- raise ValidationError(f"chain_id is not recognized: {chain_id}")