evmchains 0.1.2__py3-none-any.whl → 0.1.4__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.
evmchains/__init__.py CHANGED
@@ -7,16 +7,19 @@ below utility functions.
7
7
  import os
8
8
  import random
9
9
  import re
10
- from typing import List
10
+ from typing import TYPE_CHECKING, List
11
11
 
12
- from evmchains.chains import PUBLIC_CHAIN_META
13
- from evmchains.types import Chain
12
+ if TYPE_CHECKING:
13
+ from evmchains.types import Chain
14
14
 
15
15
  ENV_VAR_REGEX = re.compile(r"\$\{([A-Za-z0-9_]+)\}")
16
16
 
17
17
 
18
- def get_chain_meta(ecosystem: str, network: str) -> Chain:
18
+ def get_chain_meta(ecosystem: str, network: str) -> "Chain":
19
19
  """Return a Chain instance with metadata for an EVM chain."""
20
+ from evmchains.chains import PUBLIC_CHAIN_META
21
+ from evmchains.types import Chain
22
+
20
23
  if (
21
24
  ecosystem not in PUBLIC_CHAIN_META
22
25
  or network not in PUBLIC_CHAIN_META[ecosystem]
@@ -53,4 +56,19 @@ def get_random_rpc(ecosystem: str, network: str) -> str:
53
56
  return random.choice(rpcs)
54
57
 
55
58
 
59
+ def __getattr__(name: str):
60
+ if name == "PUBLIC_CHAIN_META":
61
+ from evmchains.chains import PUBLIC_CHAIN_META
62
+
63
+ return PUBLIC_CHAIN_META
64
+
65
+ elif name == "Chain":
66
+ from evmchains.types import Chain
67
+
68
+ return Chain
69
+
70
+ else:
71
+ raise AttributeError(name)
72
+
73
+
56
74
  __all__ = ["PUBLIC_CHAIN_META", "Chain", "get_chain_meta", "get_random_rpc", "get_rpcs"]
evmchains/_meta.py CHANGED
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '0.1.2'
16
- __version_tuple__ = version_tuple = (0, 1, 2)
20
+ __version__ = version = '0.1.4'
21
+ __version_tuple__ = version_tuple = (0, 1, 4)