mm-btc 0.4.0__tar.gz → 0.4.1__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.1}/PKG-INFO +2 -2
- {mm_btc-0.4.0 → mm_btc-0.4.1}/pyproject.toml +4 -3
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/blockstream.py +11 -11
- {mm_btc-0.4.0 → mm_btc-0.4.1}/uv.lock +32 -31
- {mm_btc-0.4.0 → mm_btc-0.4.1}/.env.example +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/.gitignore +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/README.txt +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/dict.dic +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/justfile +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/cli.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/cmd/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/cmd/address_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/cmd/create_tx_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/cmd/decode_tx_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/cmd/mnemonic_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/cli/cmd/utxo_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/py.typed +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/tx.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/src/mm_btc/wallet.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/tests/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/tests/cmd/__init__.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/tests/cmd/test_mnemonic_cmd.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/tests/conftest.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/tests/test_blockstream.py +0 -0
- {mm_btc-0.4.0 → mm_btc-0.4.1}/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.1
|
|
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.4
|
|
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.1"
|
|
4
4
|
description = ""
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
6
|
dependencies = [
|
|
7
|
-
"mm-crypto-utils>=0.3.
|
|
7
|
+
"mm-crypto-utils>=0.3.4",
|
|
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_result("400 Bad Request")
|
|
71
|
+
return res.to_ok_result(Address(**res.parse_json_body()))
|
|
72
72
|
except Exception as e:
|
|
73
|
-
result = res.
|
|
73
|
+
result = res.to_err_result(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_result([Utxo(**out) for out in res.parse_json_body()])
|
|
87
87
|
except Exception as e:
|
|
88
|
-
result = res.
|
|
88
|
+
result = res.to_err_result(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_result(Mempool(**res.parse_json_body()))
|
|
97
97
|
except Exception as e:
|
|
98
|
-
result = res.
|
|
98
|
+
result = res.to_err_result(e)
|
|
99
99
|
return result
|
|
100
100
|
|
|
101
101
|
async def _request(self, url: str) -> HttpResponse:
|
|
@@ -649,7 +649,7 @@ wheels = [
|
|
|
649
649
|
|
|
650
650
|
[[package]]
|
|
651
651
|
name = "mm-btc"
|
|
652
|
-
version = "0.4.
|
|
652
|
+
version = "0.4.1"
|
|
653
653
|
source = { editable = "." }
|
|
654
654
|
dependencies = [
|
|
655
655
|
{ name = "bit" },
|
|
@@ -677,7 +677,7 @@ requires-dist = [
|
|
|
677
677
|
{ name = "bit", specifier = "~=0.8.0" },
|
|
678
678
|
{ name = "bitcoinlib", specifier = "~=0.7.3" },
|
|
679
679
|
{ name = "hdwallet", specifier = "~=3.4.0" },
|
|
680
|
-
{ name = "mm-crypto-utils", specifier = ">=0.3.
|
|
680
|
+
{ name = "mm-crypto-utils", specifier = ">=0.3.4" },
|
|
681
681
|
{ name = "mnemonic", specifier = "~=0.21" },
|
|
682
682
|
{ name = "typer", specifier = "~=0.15.2" },
|
|
683
683
|
]
|
|
@@ -691,24 +691,24 @@ dev = [
|
|
|
691
691
|
{ name = "pytest-asyncio", specifier = ">=0.26.0" },
|
|
692
692
|
{ name = "pytest-httpserver", specifier = "~=1.1.3" },
|
|
693
693
|
{ name = "pytest-xdist", specifier = "~=3.6.1" },
|
|
694
|
-
{ name = "ruff", specifier = "~=0.11.
|
|
694
|
+
{ name = "ruff", specifier = "~=0.11.6" },
|
|
695
695
|
]
|
|
696
696
|
|
|
697
697
|
[[package]]
|
|
698
698
|
name = "mm-crypto-utils"
|
|
699
|
-
version = "0.3.
|
|
699
|
+
version = "0.3.4"
|
|
700
700
|
source = { registry = "https://pypi.org/simple" }
|
|
701
701
|
dependencies = [
|
|
702
702
|
{ name = "loguru" },
|
|
703
703
|
{ name = "mm-std" },
|
|
704
704
|
]
|
|
705
705
|
wheels = [
|
|
706
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
706
|
+
{ url = "https://files.pythonhosted.org/packages/e8/53/d89b21605698bfe087b8768d808c61ebac9d299694bf4a11bd84460691b3/mm_crypto_utils-0.3.4-py3-none-any.whl", hash = "sha256:964f81c53406ca58b0627dfd13c5743f1d919a94580b1683025bd40518983dd9", size = 10075 },
|
|
707
707
|
]
|
|
708
708
|
|
|
709
709
|
[[package]]
|
|
710
710
|
name = "mm-std"
|
|
711
|
-
version = "0.4.
|
|
711
|
+
version = "0.4.6"
|
|
712
712
|
source = { registry = "https://pypi.org/simple" }
|
|
713
713
|
dependencies = [
|
|
714
714
|
{ name = "aiohttp" },
|
|
@@ -724,7 +724,7 @@ dependencies = [
|
|
|
724
724
|
{ name = "tomlkit" },
|
|
725
725
|
]
|
|
726
726
|
wheels = [
|
|
727
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
727
|
+
{ url = "https://files.pythonhosted.org/packages/df/7c/bf7484f886905fd0c045b3ef617eac97cf4128e85191cc232df41c44b218/mm_std-0.4.6-py3-none-any.whl", hash = "sha256:f9f74ed75bda4569d8ed3fbb61b7f0add9668e800e93724cf84b61b599b77a68", size = 23821 },
|
|
728
728
|
]
|
|
729
729
|
|
|
730
730
|
[[package]]
|
|
@@ -1152,15 +1152,16 @@ wheels = [
|
|
|
1152
1152
|
|
|
1153
1153
|
[[package]]
|
|
1154
1154
|
name = "pydantic-settings"
|
|
1155
|
-
version = "2.
|
|
1155
|
+
version = "2.9.1"
|
|
1156
1156
|
source = { registry = "https://pypi.org/simple" }
|
|
1157
1157
|
dependencies = [
|
|
1158
1158
|
{ name = "pydantic" },
|
|
1159
1159
|
{ name = "python-dotenv" },
|
|
1160
|
+
{ name = "typing-inspection" },
|
|
1160
1161
|
]
|
|
1161
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1162
|
+
sdist = { url = "https://files.pythonhosted.org/packages/67/1d/42628a2c33e93f8e9acbde0d5d735fa0850f3e6a2f8cb1eb6c40b9a732ac/pydantic_settings-2.9.1.tar.gz", hash = "sha256:c509bf79d27563add44e8446233359004ed85066cd096d8b510f715e6ef5d268", size = 163234 }
|
|
1162
1163
|
wheels = [
|
|
1163
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1164
|
+
{ url = "https://files.pythonhosted.org/packages/b6/5f/d6d641b490fd3ec2c4c13b4244d68deea3a1b970a97be64f34fb5504ff72/pydantic_settings-2.9.1-py3-none-any.whl", hash = "sha256:59b4f431b1defb26fe620c71a7d3968a710d719f5f4cdbbdb7926edeb770f6ef", size = 44356 },
|
|
1164
1165
|
]
|
|
1165
1166
|
|
|
1166
1167
|
[[package]]
|
|
@@ -1353,27 +1354,27 @@ wheels = [
|
|
|
1353
1354
|
|
|
1354
1355
|
[[package]]
|
|
1355
1356
|
name = "ruff"
|
|
1356
|
-
version = "0.11.
|
|
1357
|
-
source = { registry = "https://pypi.org/simple" }
|
|
1358
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1359
|
-
wheels = [
|
|
1360
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1361
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1362
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1363
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1364
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1365
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1366
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1367
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1368
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1369
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1370
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1371
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1372
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1373
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1374
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1375
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1376
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1357
|
+
version = "0.11.6"
|
|
1358
|
+
source = { registry = "https://pypi.org/simple" }
|
|
1359
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d9/11/bcef6784c7e5d200b8a1f5c2ddf53e5da0efec37e6e5a44d163fb97e04ba/ruff-0.11.6.tar.gz", hash = "sha256:bec8bcc3ac228a45ccc811e45f7eb61b950dbf4cf31a67fa89352574b01c7d79", size = 4010053 }
|
|
1360
|
+
wheels = [
|
|
1361
|
+
{ url = "https://files.pythonhosted.org/packages/6e/1f/8848b625100ebcc8740c8bac5b5dd8ba97dd4ee210970e98832092c1635b/ruff-0.11.6-py3-none-linux_armv6l.whl", hash = "sha256:d84dcbe74cf9356d1bdb4a78cf74fd47c740bf7bdeb7529068f69b08272239a1", size = 10248105 },
|
|
1362
|
+
{ url = "https://files.pythonhosted.org/packages/e0/47/c44036e70c6cc11e6ee24399c2a1e1f1e99be5152bd7dff0190e4b325b76/ruff-0.11.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9bc583628e1096148011a5d51ff3c836f51899e61112e03e5f2b1573a9b726de", size = 11001494 },
|
|
1363
|
+
{ url = "https://files.pythonhosted.org/packages/ed/5b/170444061650202d84d316e8f112de02d092bff71fafe060d3542f5bc5df/ruff-0.11.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f2959049faeb5ba5e3b378709e9d1bf0cab06528b306b9dd6ebd2a312127964a", size = 10352151 },
|
|
1364
|
+
{ url = "https://files.pythonhosted.org/packages/ff/91/f02839fb3787c678e112c8865f2c3e87cfe1744dcc96ff9fc56cfb97dda2/ruff-0.11.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63c5d4e30d9d0de7fedbfb3e9e20d134b73a30c1e74b596f40f0629d5c28a193", size = 10541951 },
|
|
1365
|
+
{ url = "https://files.pythonhosted.org/packages/9e/f3/c09933306096ff7a08abede3cc2534d6fcf5529ccd26504c16bf363989b5/ruff-0.11.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26a4b9a4e1439f7d0a091c6763a100cef8fbdc10d68593df6f3cfa5abdd9246e", size = 10079195 },
|
|
1366
|
+
{ url = "https://files.pythonhosted.org/packages/e0/0d/a87f8933fccbc0d8c653cfbf44bedda69c9582ba09210a309c066794e2ee/ruff-0.11.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b5edf270223dd622218256569636dc3e708c2cb989242262fe378609eccf1308", size = 11698918 },
|
|
1367
|
+
{ url = "https://files.pythonhosted.org/packages/52/7d/8eac0bd083ea8a0b55b7e4628428203441ca68cd55e0b67c135a4bc6e309/ruff-0.11.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f55844e818206a9dd31ff27f91385afb538067e2dc0beb05f82c293ab84f7d55", size = 12319426 },
|
|
1368
|
+
{ url = "https://files.pythonhosted.org/packages/c2/dc/d0c17d875662d0c86fadcf4ca014ab2001f867621b793d5d7eef01b9dcce/ruff-0.11.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d8f782286c5ff562e4e00344f954b9320026d8e3fae2ba9e6948443fafd9ffc", size = 11791012 },
|
|
1369
|
+
{ url = "https://files.pythonhosted.org/packages/f9/f3/81a1aea17f1065449a72509fc7ccc3659cf93148b136ff2a8291c4bc3ef1/ruff-0.11.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:01c63ba219514271cee955cd0adc26a4083df1956d57847978383b0e50ffd7d2", size = 13949947 },
|
|
1370
|
+
{ url = "https://files.pythonhosted.org/packages/61/9f/a3e34de425a668284e7024ee6fd41f452f6fa9d817f1f3495b46e5e3a407/ruff-0.11.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15adac20ef2ca296dd3d8e2bedc6202ea6de81c091a74661c3666e5c4c223ff6", size = 11471753 },
|
|
1371
|
+
{ url = "https://files.pythonhosted.org/packages/df/c5/4a57a86d12542c0f6e2744f262257b2aa5a3783098ec14e40f3e4b3a354a/ruff-0.11.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4dd6b09e98144ad7aec026f5588e493c65057d1b387dd937d7787baa531d9bc2", size = 10417121 },
|
|
1372
|
+
{ url = "https://files.pythonhosted.org/packages/58/3f/a3b4346dff07ef5b862e2ba06d98fcbf71f66f04cf01d375e871382b5e4b/ruff-0.11.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:45b2e1d6c0eed89c248d024ea95074d0e09988d8e7b1dad8d3ab9a67017a5b03", size = 10073829 },
|
|
1373
|
+
{ url = "https://files.pythonhosted.org/packages/93/cc/7ed02e0b86a649216b845b3ac66ed55d8aa86f5898c5f1691797f408fcb9/ruff-0.11.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:bd40de4115b2ec4850302f1a1d8067f42e70b4990b68838ccb9ccd9f110c5e8b", size = 11076108 },
|
|
1374
|
+
{ url = "https://files.pythonhosted.org/packages/39/5e/5b09840fef0eff1a6fa1dea6296c07d09c17cb6fb94ed5593aa591b50460/ruff-0.11.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:77cda2dfbac1ab73aef5e514c4cbfc4ec1fbef4b84a44c736cc26f61b3814cd9", size = 11512366 },
|
|
1375
|
+
{ url = "https://files.pythonhosted.org/packages/6f/4c/1cd5a84a412d3626335ae69f5f9de2bb554eea0faf46deb1f0cb48534042/ruff-0.11.6-py3-none-win32.whl", hash = "sha256:5151a871554be3036cd6e51d0ec6eef56334d74dfe1702de717a995ee3d5b287", size = 10485900 },
|
|
1376
|
+
{ url = "https://files.pythonhosted.org/packages/42/46/8997872bc44d43df986491c18d4418f1caff03bc47b7f381261d62c23442/ruff-0.11.6-py3-none-win_amd64.whl", hash = "sha256:cce85721d09c51f3b782c331b0abd07e9d7d5f775840379c640606d3159cae0e", size = 11558592 },
|
|
1377
|
+
{ url = "https://files.pythonhosted.org/packages/d7/6a/65fecd51a9ca19e1477c3879a7fda24f8904174d1275b419422ac00f6eee/ruff-0.11.6-py3-none-win_arm64.whl", hash = "sha256:3567ba0d07fb170b1b48d944715e3294b77f5b7679e8ba258199a250383ccb79", size = 10682766 },
|
|
1377
1378
|
]
|
|
1378
1379
|
|
|
1379
1380
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|