mm-eth 0.5.4__py3-none-any.whl → 0.5.6__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.
- mm_eth/ens.py +17 -10
- mm_eth/utils.py +1 -1
- {mm_eth-0.5.4.dist-info → mm_eth-0.5.6.dist-info}/METADATA +3 -2
- {mm_eth-0.5.4.dist-info → mm_eth-0.5.6.dist-info}/RECORD +6 -6
- {mm_eth-0.5.4.dist-info → mm_eth-0.5.6.dist-info}/WHEEL +0 -0
- {mm_eth-0.5.4.dist-info → mm_eth-0.5.6.dist-info}/entry_points.txt +0 -0
mm_eth/ens.py
CHANGED
|
@@ -4,13 +4,20 @@ from mm_std import Err, Ok, Result
|
|
|
4
4
|
from mm_eth.utils import get_w3
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
def
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
def get_name_with_retries(
|
|
8
|
+
rpc_urls: Nodes, address: str, retries: int, timeout: float = 5, proxies: Proxies = None
|
|
9
|
+
) -> Result[str | None]:
|
|
10
|
+
res: Result[str | None] = Err("not started yet")
|
|
11
|
+
for _ in range(retries):
|
|
12
|
+
res = get_name(random_node(rpc_urls), address, timeout=timeout, proxy=random_proxy(proxies))
|
|
13
|
+
if res.is_ok():
|
|
14
|
+
return res
|
|
15
|
+
return res
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_name(rpc_url: str, address: str, timeout: float = 5, proxy: str | None = None) -> Result[str | None]:
|
|
19
|
+
try:
|
|
20
|
+
w3 = get_w3(rpc_url, timeout=timeout, proxy=proxy)
|
|
21
|
+
return Ok(w3.ens.name(w3.to_checksum_address(address))) # type: ignore[union-attr]
|
|
22
|
+
except Exception as e:
|
|
23
|
+
return Err(e)
|
mm_eth/utils.py
CHANGED
|
@@ -186,7 +186,7 @@ def log_topic_to_address(topic: HexBytes | str) -> str:
|
|
|
186
186
|
return result
|
|
187
187
|
|
|
188
188
|
|
|
189
|
-
def get_w3(rpc_url: str, timeout:
|
|
189
|
+
def get_w3(rpc_url: str, timeout: float | None = None, proxy: str | None = None) -> Web3:
|
|
190
190
|
request_kwargs: dict[str, object] = {"timeout": timeout}
|
|
191
191
|
if proxy:
|
|
192
192
|
request_kwargs["proxies"] = {"http": proxy, "https": proxy}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mm-eth
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6
|
|
4
4
|
Requires-Python: >=3.12
|
|
5
5
|
Requires-Dist: mm-crypto-utils>=0.2.6
|
|
6
|
-
Requires-Dist:
|
|
6
|
+
Requires-Dist: requests[socks]>=2.32.0
|
|
7
|
+
Requires-Dist: typer>=0.15.2
|
|
7
8
|
Requires-Dist: web3~=7.8.0
|
|
8
9
|
Requires-Dist: websocket-client~=1.8.0
|
|
@@ -4,7 +4,7 @@ mm_eth/account.py,sha256=k0MNMatBe0zo1iKZiB_Tq6zyEIo22IncD6ewNUJp3dY,2075
|
|
|
4
4
|
mm_eth/anvil.py,sha256=98RCfI7dEpxFBTV6UErYvubWVP3n0ctUFn1--4kZ84U,1603
|
|
5
5
|
mm_eth/constants.py,sha256=Cy_G-IleBH4gAZ4ok8AGHHlqmdW0ZM7ZldyVpzAfWLs,54
|
|
6
6
|
mm_eth/deploy.py,sha256=SB3ruY808_5UnG8kHR34uVP66P3zOWZu0ImKD7UUv2s,691
|
|
7
|
-
mm_eth/ens.py,sha256=
|
|
7
|
+
mm_eth/ens.py,sha256=4sEglXdgemKm9fYLCXEvsEeUpdUCqec1GXPklyp19eQ,851
|
|
8
8
|
mm_eth/erc20.py,sha256=V__yPDG4ABXWfkSdIqffE5qQDjjZl93287YunllN52A,6804
|
|
9
9
|
mm_eth/ethernodes.py,sha256=9y_poTmFUj6cnWaT9mtfc6S9lAfVXTwLGRqxMQ8hT0Y,3080
|
|
10
10
|
mm_eth/json_encoder.py,sha256=S4oD-qfTVztMb4sRpY1puhBQwOBofTyQXWszmdXk4og,433
|
|
@@ -12,7 +12,7 @@ mm_eth/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
12
12
|
mm_eth/rpc.py,sha256=k0eHxo_Dp6G0fHQ_rD-QbwOJz5ngC6kxBjl5NEHnyw8,13832
|
|
13
13
|
mm_eth/solc.py,sha256=dYRvT8PjZlLDZhNsc_-0790Eug_ZwU2G-iBfIdGj6wQ,1071
|
|
14
14
|
mm_eth/tx.py,sha256=efSoMCoWkenbGdHo1_LX66_Edz1HvED5-J_i3wrHwMw,4051
|
|
15
|
-
mm_eth/utils.py,sha256=
|
|
15
|
+
mm_eth/utils.py,sha256=gLWT5I7CxFvfHgTQrZSSHUk3YyaDzdmtHwLHFjwuV3I,7407
|
|
16
16
|
mm_eth/vault.py,sha256=h8NyiOQh5YFskh1lZA3KyvnJUnxl9769ME2ChplG0CM,1477
|
|
17
17
|
mm_eth/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
mm_eth/cli/calcs.py,sha256=cLFTYNAN-I53tUiSg-zFfVr2afjIZPftDDjHj16FBz0,1068
|
|
@@ -41,7 +41,7 @@ mm_eth/cli/cmd/wallet/private_key_cmd.py,sha256=Fv_2OLog1h32pIP7PJITwl_pHdy3BXva
|
|
|
41
41
|
mm_eth/cli/examples/balances.toml,sha256=i_ALpiEcf8-0TFiUg1cgJhxxfHYeBl9x0b3tnUWjswU,421
|
|
42
42
|
mm_eth/cli/examples/call_contract.toml,sha256=ZQWK-409V_vLIZ2bsRD5RCWPPzShPz2KJTTRQY4YaGw,248
|
|
43
43
|
mm_eth/cli/examples/transfer.toml,sha256=8mWuphDquoSDJw-hb9VJqtonjmv3kJ5Ip8jJ4t5YnfM,1810
|
|
44
|
-
mm_eth-0.5.
|
|
45
|
-
mm_eth-0.5.
|
|
46
|
-
mm_eth-0.5.
|
|
47
|
-
mm_eth-0.5.
|
|
44
|
+
mm_eth-0.5.6.dist-info/METADATA,sha256=R49ouAdttwFUlqby9en4HmcJsu1oxjWqp21vKKn9l_s,246
|
|
45
|
+
mm_eth-0.5.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
46
|
+
mm_eth-0.5.6.dist-info/entry_points.txt,sha256=aGhpsozl8NIrkuUcX5fSgURCcDhr3ShUdeTSIrJq4oc,46
|
|
47
|
+
mm_eth-0.5.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|