mm-strk 0.4.2__py3-none-any.whl → 0.4.3__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_strk/account.py CHANGED
@@ -39,5 +39,5 @@ def is_address(address: str) -> bool:
39
39
  return True
40
40
 
41
41
  # Minimal form (no leading zeros)
42
- canonical = hex(value)[2:]
42
+ canonical = f"{value:x}"
43
43
  return hex_part.lower() == canonical
@@ -8,12 +8,16 @@ from starknet_py.net.full_node_client import FullNodeClient
8
8
 
9
9
 
10
10
  class NodeStatus(BaseModel):
11
+ """Starknet node status response."""
12
+
13
+ spec_version: str
11
14
  block_number: int | str
12
15
  chain_id: int | str
13
16
  syncing_status: bool | SyncStatus | str
14
17
 
15
18
 
16
19
  def run(urls: list[str], proxy: str | None) -> None:
20
+ """Check status of Starknet nodes."""
17
21
  if proxy:
18
22
  typer.echo("proxy is not supported yet")
19
23
  raise typer.Exit(code=1)
@@ -29,8 +33,14 @@ async def _run(urls: list[str]) -> None:
29
33
 
30
34
 
31
35
  async def _node_status(url: str) -> NodeStatus:
36
+ """Fetch status from a single node."""
32
37
  client = FullNodeClient(node_url=url)
33
38
 
39
+ try:
40
+ spec_version: str = await client.spec_version()
41
+ except Exception as e:
42
+ spec_version = str(e)
43
+
34
44
  try:
35
45
  block_number: int | str = await client.get_block_number()
36
46
  except Exception as e:
@@ -46,4 +56,4 @@ async def _node_status(url: str) -> NodeStatus:
46
56
  except Exception as e:
47
57
  syncing_status = str(e)
48
58
 
49
- return NodeStatus(block_number=block_number, chain_id=chain_id, syncing_status=syncing_status)
59
+ return NodeStatus(spec_version=spec_version, block_number=block_number, chain_id=chain_id, syncing_status=syncing_status)
mm_strk/domain.py CHANGED
@@ -14,7 +14,7 @@ async def address_to_domain(address: str, timeout: float = 5.0, proxy: str | Non
14
14
  return res.to_result_ok(None)
15
15
  if res.is_err():
16
16
  return res.to_result_err()
17
- domain = res.parse_json_body("domain")
17
+ domain = res.parse_json("domain")
18
18
  if domain:
19
19
  return res.to_result_ok(domain)
20
20
  return res.to_result_err("unknown_response")
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: mm-strk
3
+ Version: 0.4.3
4
+ Requires-Python: >=3.13
5
+ Requires-Dist: mm-web3~=0.5.7
6
+ Requires-Dist: starknet-py~=0.29.0
7
+ Requires-Dist: typer~=0.21.1
@@ -1,14 +1,14 @@
1
1
  mm_strk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mm_strk/account.py,sha256=kalmNZgM-X2aEGWIk4s4XJUpS3TM2LL188Vjd-hMVds,1099
2
+ mm_strk/account.py,sha256=BKxedMz_GvoohNp8TlB_05GVtSWQroy0jF0EiYhi-_w,1097
3
3
  mm_strk/balance.py,sha256=jOCV1rm4lqXwwGU8CO49znOaUJWQxPukAbJiMkmti7k,1679
4
- mm_strk/domain.py,sha256=cE_f7RZaifjuJaUa7G5bJRvQ8-jr1nszMtLZPI4oQYw,760
4
+ mm_strk/domain.py,sha256=ElDQPwnb1ZKHJowv9khGQZXnGnn3DmRGvPwqSWvfynE,755
5
5
  mm_strk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  mm_strk/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  mm_strk/cli/cli.py,sha256=nQfgYlgaXPD9MEiTkUTwgHeWPqwavv1VtfYp-rWL2hY,762
8
8
  mm_strk/cli/cli_utils.py,sha256=4_QLJ_rEotHK90PRQqsvCuFydDOXPrXrnMndBffMPIg,103
9
9
  mm_strk/cli/commands/__init__.py,sha256=ipr1wm0YQIJoEZLupmrGaom6uJUENhxFuSCOVvCJuW8,39
10
- mm_strk/cli/commands/node.py,sha256=Lt7t8z5inY4G12gHI-4uSEIAYuuNyHwaJ55apOBkNEk,1271
11
- mm_strk-0.4.2.dist-info/METADATA,sha256=X7fkV7pBHHR5J_NQLTSbkfgUdAhvoNMBF0wP0Eru_g0,169
12
- mm_strk-0.4.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
- mm_strk-0.4.2.dist-info/entry_points.txt,sha256=X6zWJaYaUkTgJrY4LAVpcov8O43PmUU4cQ1ue8prYqQ,48
14
- mm_strk-0.4.2.dist-info/RECORD,,
10
+ mm_strk/cli/commands/node.py,sha256=fmykK08gIgSTv-xuPZ2sQhUboYmUbhlBdEFdPzQ9exc,1570
11
+ mm_strk-0.4.3.dist-info/METADATA,sha256=M8Vkkrz2iOYkWejyxYaZEzJOVMksK0O_QLrGzTSVSUo,169
12
+ mm_strk-0.4.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
13
+ mm_strk-0.4.3.dist-info/entry_points.txt,sha256=X6zWJaYaUkTgJrY4LAVpcov8O43PmUU4cQ1ue8prYqQ,48
14
+ mm_strk-0.4.3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mm-strk
3
- Version: 0.4.2
4
- Requires-Python: >=3.13
5
- Requires-Dist: mm-web3~=0.5.1
6
- Requires-Dist: starknet-py~=0.27.0
7
- Requires-Dist: typer>=0.16.0