mm-btc 0.4.0__tar.gz → 0.4.2__tar.gz
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_btc-0.4.0 → mm_btc-0.4.2}/PKG-INFO +2 -2
- {mm_btc-0.4.0 → mm_btc-0.4.2}/pyproject.toml +4 -3
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/blockstream.py +11 -11
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/address_cmd.py +1 -1
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/utxo_cmd.py +1 -1
- {mm_btc-0.4.0 → mm_btc-0.4.2}/uv.lock +725 -725
- {mm_btc-0.4.0 → mm_btc-0.4.2}/.env.example +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/.gitignore +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/README.txt +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/dict.dic +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/justfile +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/cli.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/create_tx_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/decode_tx_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/mnemonic_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/py.typed +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/tx.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/src/mm_btc/wallet.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/tests/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/tests/cmd/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/tests/cmd/test_mnemonic_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/tests/conftest.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/tests/test_blockstream.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.2}/tests/test_wallet.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mm-btc
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Requires-Python: >=3.12
|
|
5
5
|
Requires-Dist: bitcoinlib~=0.7.3
|
|
6
6
|
Requires-Dist: bit~=0.8.0
|
|
7
7
|
Requires-Dist: hdwallet~=3.4.0
|
|
8
|
-
Requires-Dist: mm-crypto-utils>=0.3.
|
|
8
|
+
Requires-Dist: mm-crypto-utils>=0.3.6
|
|
9
9
|
Requires-Dist: mnemonic~=0.21
|
|
10
10
|
Requires-Dist: typer~=0.15.2
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mm-btc"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.2"
|
|
4
4
|
description = ""
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
6
|
dependencies = [
|
|
7
|
-
"mm-crypto-utils>=0.3.
|
|
7
|
+
"mm-crypto-utils>=0.3.6",
|
|
8
8
|
"hdwallet~=3.4.0",
|
|
9
9
|
"bit~=0.8.0",
|
|
10
10
|
"bitcoinlib~=0.7.3",
|
|
@@ -24,7 +24,7 @@ dev-dependencies = [
|
|
|
24
24
|
"pytest~=8.3.5",
|
|
25
25
|
"pytest-xdist~=3.6.1",
|
|
26
26
|
"pytest-httpserver~=1.1.3",
|
|
27
|
-
"ruff~=0.11.
|
|
27
|
+
"ruff~=0.11.6",
|
|
28
28
|
"pip-audit~=2.9.0",
|
|
29
29
|
"bandit~=1.8.3",
|
|
30
30
|
"mypy~=1.15.0",
|
|
@@ -83,4 +83,5 @@ exclude_dirs = ["tests"]
|
|
|
83
83
|
skips = ["B311"]
|
|
84
84
|
|
|
85
85
|
[tool.pytest.ini_options]
|
|
86
|
+
asyncio_mode = "auto"
|
|
86
87
|
asyncio_default_fixture_loop_scope = "function"
|
|
@@ -62,40 +62,40 @@ class BlockstreamClient:
|
|
|
62
62
|
self.base_url = TESTNET_BASE_URL if testnet else MAINNET_BASE_URL
|
|
63
63
|
|
|
64
64
|
async def get_address(self, address: str) -> Result[Address]:
|
|
65
|
-
result: Result[Address] = Result.
|
|
65
|
+
result: Result[Address] = Result.err("not started yet")
|
|
66
66
|
for _ in range(self.attempts):
|
|
67
67
|
res = await self._request(f"/address/{address}")
|
|
68
68
|
try:
|
|
69
69
|
if res.status_code == 400:
|
|
70
|
-
return res.
|
|
71
|
-
return res.
|
|
70
|
+
return res.to_err("400 Bad Request")
|
|
71
|
+
return res.to_ok(Address(**res.parse_json_body()))
|
|
72
72
|
except Exception as e:
|
|
73
|
-
result = res.
|
|
73
|
+
result = res.to_err(e)
|
|
74
74
|
return result
|
|
75
75
|
|
|
76
76
|
async def get_confirmed_balance(self, address: str) -> Result[int]:
|
|
77
77
|
return (await self.get_address(address)).and_then(
|
|
78
|
-
lambda a: Result.
|
|
78
|
+
lambda a: Result.ok(a.chain_stats.funded_txo_sum - a.chain_stats.spent_txo_sum)
|
|
79
79
|
)
|
|
80
80
|
|
|
81
81
|
async def get_utxo(self, address: str) -> Result[list[Utxo]]:
|
|
82
|
-
result: Result[list[Utxo]] = Result.
|
|
82
|
+
result: Result[list[Utxo]] = Result.err("not started yet")
|
|
83
83
|
for _ in range(self.attempts):
|
|
84
84
|
res = await self._request(f"/address/{address}/utxo")
|
|
85
85
|
try:
|
|
86
|
-
return res.
|
|
86
|
+
return res.to_ok([Utxo(**out) for out in res.parse_json_body()])
|
|
87
87
|
except Exception as e:
|
|
88
|
-
result = res.
|
|
88
|
+
result = res.to_err(e)
|
|
89
89
|
return result
|
|
90
90
|
|
|
91
91
|
async def get_mempool(self) -> Result[Mempool]:
|
|
92
|
-
result: Result[Mempool] = Result.
|
|
92
|
+
result: Result[Mempool] = Result.err("not started yet")
|
|
93
93
|
for _ in range(self.attempts):
|
|
94
94
|
res = await self._request("/mempool")
|
|
95
95
|
try:
|
|
96
|
-
return res.
|
|
96
|
+
return res.to_ok(Mempool(**res.parse_json_body()))
|
|
97
97
|
except Exception as e:
|
|
98
|
-
result = res.
|
|
98
|
+
result = res.to_err(e)
|
|
99
99
|
return result
|
|
100
100
|
|
|
101
101
|
async def _request(self, url: str) -> HttpResponse:
|