mm-btc 0.4.1__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.
Files changed (27) hide show
  1. {mm_btc-0.4.1 → mm_btc-0.4.2}/PKG-INFO +2 -2
  2. {mm_btc-0.4.1 → mm_btc-0.4.2}/pyproject.toml +2 -2
  3. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/blockstream.py +7 -7
  4. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/address_cmd.py +1 -1
  5. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/utxo_cmd.py +1 -1
  6. {mm_btc-0.4.1 → mm_btc-0.4.2}/uv.lock +719 -720
  7. {mm_btc-0.4.1 → mm_btc-0.4.2}/.env.example +0 -0
  8. {mm_btc-0.4.1 → mm_btc-0.4.2}/.gitignore +0 -0
  9. {mm_btc-0.4.1 → mm_btc-0.4.2}/README.txt +0 -0
  10. {mm_btc-0.4.1 → mm_btc-0.4.2}/dict.dic +0 -0
  11. {mm_btc-0.4.1 → mm_btc-0.4.2}/justfile +0 -0
  12. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/__init__.py +0 -0
  13. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/__init__.py +0 -0
  14. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/cli.py +0 -0
  15. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/__init__.py +0 -0
  16. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/create_tx_cmd.py +0 -0
  17. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/decode_tx_cmd.py +0 -0
  18. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/cli/cmd/mnemonic_cmd.py +0 -0
  19. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/py.typed +0 -0
  20. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/tx.py +0 -0
  21. {mm_btc-0.4.1 → mm_btc-0.4.2}/src/mm_btc/wallet.py +0 -0
  22. {mm_btc-0.4.1 → mm_btc-0.4.2}/tests/__init__.py +0 -0
  23. {mm_btc-0.4.1 → mm_btc-0.4.2}/tests/cmd/__init__.py +0 -0
  24. {mm_btc-0.4.1 → mm_btc-0.4.2}/tests/cmd/test_mnemonic_cmd.py +0 -0
  25. {mm_btc-0.4.1 → mm_btc-0.4.2}/tests/conftest.py +0 -0
  26. {mm_btc-0.4.1 → mm_btc-0.4.2}/tests/test_blockstream.py +0 -0
  27. {mm_btc-0.4.1 → 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.1
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.4
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.1"
3
+ version = "0.4.2"
4
4
  description = ""
5
5
  requires-python = ">=3.12"
6
6
  dependencies = [
7
- "mm-crypto-utils>=0.3.4",
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",
@@ -67,10 +67,10 @@ class BlockstreamClient:
67
67
  res = await self._request(f"/address/{address}")
68
68
  try:
69
69
  if res.status_code == 400:
70
- return res.to_err_result("400 Bad Request")
71
- return res.to_ok_result(Address(**res.parse_json_body()))
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.to_err_result(e)
73
+ result = res.to_err(e)
74
74
  return result
75
75
 
76
76
  async def get_confirmed_balance(self, address: str) -> Result[int]:
@@ -83,9 +83,9 @@ class BlockstreamClient:
83
83
  for _ in range(self.attempts):
84
84
  res = await self._request(f"/address/{address}/utxo")
85
85
  try:
86
- return res.to_ok_result([Utxo(**out) for out in res.parse_json_body()])
86
+ return res.to_ok([Utxo(**out) for out in res.parse_json_body()])
87
87
  except Exception as e:
88
- result = res.to_err_result(e)
88
+ result = res.to_err(e)
89
89
  return result
90
90
 
91
91
  async def get_mempool(self) -> Result[Mempool]:
@@ -93,9 +93,9 @@ class BlockstreamClient:
93
93
  for _ in range(self.attempts):
94
94
  res = await self._request("/mempool")
95
95
  try:
96
- return res.to_ok_result(Mempool(**res.parse_json_body()))
96
+ return res.to_ok(Mempool(**res.parse_json_body()))
97
97
  except Exception as e:
98
- result = res.to_err_result(e)
98
+ result = res.to_err(e)
99
99
  return result
100
100
 
101
101
  async def _request(self, url: str) -> HttpResponse:
@@ -7,4 +7,4 @@ from mm_btc.wallet import is_testnet_address
7
7
  async def run(address: str) -> None:
8
8
  client = BlockstreamClient(testnet=is_testnet_address(address))
9
9
  res = await client.get_address(address)
10
- print_json(res.ok_or_error())
10
+ print_json(res.value_or_error())
@@ -7,4 +7,4 @@ from mm_btc.wallet import is_testnet_address
7
7
  async def run(address: str) -> None:
8
8
  client = BlockstreamClient(testnet=is_testnet_address(address))
9
9
  res = await client.get_utxo(address)
10
- print_json(res.ok_or_error())
10
+ print_json(res.value_or_error())