mm-btc 0.5.0__py3-none-any.whl → 0.5.1__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_btc/blockstream.py CHANGED
@@ -69,14 +69,14 @@ class BlockstreamClient:
69
69
  res = await self._request(f"/address/{address}")
70
70
  try:
71
71
  if res.status_code == 400:
72
- return res.to_err("400 Bad Request")
73
- return res.to_ok(Address(**res.parse_json_body()))
72
+ return res.to_result_err("400 Bad Request")
73
+ return res.to_result_ok(Address(**res.parse_json_body()))
74
74
  except Exception as e:
75
- result = res.to_err(e)
75
+ result = res.to_result_err(e)
76
76
  return result
77
77
 
78
78
  async def get_confirmed_balance(self, address: str) -> Result[int]:
79
- return (await self.get_address(address)).and_then(
79
+ return (await self.get_address(address)).chain(
80
80
  lambda a: Result.ok(a.chain_stats.funded_txo_sum - a.chain_stats.spent_txo_sum)
81
81
  )
82
82
 
@@ -85,9 +85,9 @@ class BlockstreamClient:
85
85
  for _ in range(self.attempts):
86
86
  res = await self._request(f"/address/{address}/utxo")
87
87
  try:
88
- return res.to_ok([Utxo(**out) for out in res.parse_json_body()])
88
+ return res.to_result_ok([Utxo(**out) for out in res.parse_json_body()])
89
89
  except Exception as e:
90
- result = res.to_err(e)
90
+ result = res.to_result_err(e)
91
91
  return result
92
92
 
93
93
  async def get_mempool(self) -> Result[Mempool]:
@@ -95,9 +95,9 @@ class BlockstreamClient:
95
95
  for _ in range(self.attempts):
96
96
  res = await self._request("/mempool")
97
97
  try:
98
- return res.to_ok(Mempool(**res.parse_json_body()))
98
+ return res.to_result_ok(Mempool(**res.parse_json_body()))
99
99
  except Exception as e:
100
- result = res.to_err(e)
100
+ result = res.to_result_err(e)
101
101
  return result
102
102
 
103
103
  async def _request(self, url: str) -> HttpResponse:
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-btc
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Requires-Python: >=3.13
5
5
  Requires-Dist: bitcoinlib~=0.7.4
6
6
  Requires-Dist: bit~=0.8.0
7
7
  Requires-Dist: hdwallet~=3.4.0
8
- Requires-Dist: mm-cryptocurrency~=0.4.1
9
- Requires-Dist: mm-print>=0.0.1
8
+ Requires-Dist: mm-cryptocurrency~=0.4.2
9
+ Requires-Dist: mm-print>=0.0.3
10
10
  Requires-Dist: mnemonic~=0.21
11
11
  Requires-Dist: typer~=0.16.0
@@ -1,5 +1,5 @@
1
1
  mm_btc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mm_btc/blockstream.py,sha256=OGhJAlBoI_oPEJUdzsLKENF29nFGhrVdWp0o4APaDXQ,3315
2
+ mm_btc/blockstream.py,sha256=-8-h07gld3GAOMXb7DcZaBJMzaxmKSWEdkdn55wIA5A,3361
3
3
  mm_btc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  mm_btc/tx.py,sha256=7KTMNuL1n8rRj_245BV1bH9M2_PctNvlvPsLEsRTYx4,245
5
5
  mm_btc/wallet.py,sha256=_pGTuAf6Y9KzaWTTSg_tn6WEoRsGqhxJuPof0_xyrmM,2333
@@ -11,7 +11,7 @@ mm_btc/cli/cmd/create_tx_cmd.py,sha256=4NvPa7uT7eJcoBo_oVOLLudCpKvNIB_ScK8ko57MO
11
11
  mm_btc/cli/cmd/decode_tx_cmd.py,sha256=OwSdxIA8GViABb1JbbZTLi5HIRIA5Tpp_dBkh9x3GQQ,170
12
12
  mm_btc/cli/cmd/mnemonic_cmd.py,sha256=-qWo8AXMdSSYUwyvx4jP54buRuidJM-1q3O8UwnJCF0,1266
13
13
  mm_btc/cli/cmd/utxo_cmd.py,sha256=531bTIsgeQYmwJ17Jyn5jYlDDChOGlrvkJ31EIFIdF4,305
14
- mm_btc-0.5.0.dist-info/METADATA,sha256=ciB5k1Ts4VNXpaeK9yKntdm55zllNatRiay-SVN_nGM,294
15
- mm_btc-0.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- mm_btc-0.5.0.dist-info/entry_points.txt,sha256=KphzLNE9eb9H1DO-L0gvBQaQT5ImedyVCN4a6svfiRg,46
17
- mm_btc-0.5.0.dist-info/RECORD,,
14
+ mm_btc-0.5.1.dist-info/METADATA,sha256=kaeK4CLZyUiBG-bwWTb0SBaxYO7-3hm7aMsbCb-h87w,294
15
+ mm_btc-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ mm_btc-0.5.1.dist-info/entry_points.txt,sha256=KphzLNE9eb9H1DO-L0gvBQaQT5ImedyVCN4a6svfiRg,46
17
+ mm_btc-0.5.1.dist-info/RECORD,,
File without changes