mm-btc 0.0.6__py3-none-any.whl → 0.1.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 +19 -0
- mm_btc-0.1.1.dist-info/METADATA +10 -0
- {mm_btc-0.0.6.dist-info → mm_btc-0.1.1.dist-info}/RECORD +5 -6
- {mm_btc-0.0.6.dist-info → mm_btc-0.1.1.dist-info}/WHEEL +1 -2
- mm_btc-0.0.6.dist-info/METADATA +0 -24
- mm_btc-0.0.6.dist-info/top_level.txt +0 -1
- {mm_btc-0.0.6.dist-info → mm_btc-0.1.1.dist-info}/entry_points.txt +0 -0
mm_btc/blockstream.py
CHANGED
|
@@ -14,6 +14,13 @@ ERROR_INVALID_NETWORK = "INVALID_NETWORK"
|
|
|
14
14
|
Proxy: TypeAlias = str | Sequence[str] | None
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
class Mempool(BaseModel):
|
|
18
|
+
count: int
|
|
19
|
+
vsize: int
|
|
20
|
+
total_fee: int
|
|
21
|
+
fee_histogram: list[tuple[float, int]]
|
|
22
|
+
|
|
23
|
+
|
|
17
24
|
class Address(BaseModel):
|
|
18
25
|
class ChainStats(BaseModel):
|
|
19
26
|
funded_txo_count: int
|
|
@@ -87,5 +94,17 @@ class BlockstreamClient:
|
|
|
87
94
|
result = Err(err, data=data)
|
|
88
95
|
return result
|
|
89
96
|
|
|
97
|
+
def get_mempool(self) -> Result[Mempool]:
|
|
98
|
+
result: Result[Mempool] = Err("not started yet")
|
|
99
|
+
data = None
|
|
100
|
+
for _ in range(self.attempts):
|
|
101
|
+
try:
|
|
102
|
+
res = self._request("/mempool")
|
|
103
|
+
data = res.to_dict()
|
|
104
|
+
return Ok(Mempool(**res.json), data=data)
|
|
105
|
+
except Exception as err:
|
|
106
|
+
result = Err(err, data=data)
|
|
107
|
+
return result
|
|
108
|
+
|
|
90
109
|
def _request(self, url: str) -> HResponse:
|
|
91
110
|
return hr(f"{self.base_url}{url}", timeout=self.timeout, proxy=random_str_choice(self.proxies))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: mm-btc
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Requires-Python: >=3.12
|
|
5
|
+
Requires-Dist: bitcoinlib~=0.6.15
|
|
6
|
+
Requires-Dist: bit~=0.8.0
|
|
7
|
+
Requires-Dist: hdwallet~=2.2.1
|
|
8
|
+
Requires-Dist: mm-std~=0.1.2
|
|
9
|
+
Provides-Extra: cli
|
|
10
|
+
Requires-Dist: typer~=0.12.5; extra == 'cli'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
mm_btc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
mm_btc/blockstream.py,sha256=
|
|
2
|
+
mm_btc/blockstream.py,sha256=U2_pc6RYAkFcCvH_WrxjIm13VNavyY3WgK8ePowV-Ic,3620
|
|
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=0ejOIl5gbm1oMO4WY3AsQRiF3PCrB4WC2LknaYPmMfY,1838
|
|
@@ -12,8 +12,7 @@ mm_btc/cli/cmd/create_tx_cmd.py,sha256=dIuQBTOqTSefC6aMbrBN6Pq0EwV2G2ESM1tLU4WyF
|
|
|
12
12
|
mm_btc/cli/cmd/decode_tx_cmd.py,sha256=0jGlUjnA1X2Q2aYwSBeAjqVNZIBsW5X2lEwIpSfWJsU,175
|
|
13
13
|
mm_btc/cli/cmd/mnemonic_cmd.py,sha256=zAAHr9j0SLJX5BXoiMTZj8pIzTPX26aJEOUi7IN40Ug,1192
|
|
14
14
|
mm_btc/cli/cmd/utxo_cmd.py,sha256=mp-lVLURpXFqO3IeBIEwnHusEvT5tFjUKxnRYC-rFqQ,294
|
|
15
|
-
mm_btc-0.
|
|
16
|
-
mm_btc-0.
|
|
17
|
-
mm_btc-0.
|
|
18
|
-
mm_btc-0.
|
|
19
|
-
mm_btc-0.0.6.dist-info/RECORD,,
|
|
15
|
+
mm_btc-0.1.1.dist-info/METADATA,sha256=4-yxE4_glin-GvC2jW93sBHKNGO1NVgUDBRRv56MIag,259
|
|
16
|
+
mm_btc-0.1.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
17
|
+
mm_btc-0.1.1.dist-info/entry_points.txt,sha256=KphzLNE9eb9H1DO-L0gvBQaQT5ImedyVCN4a6svfiRg,46
|
|
18
|
+
mm_btc-0.1.1.dist-info/RECORD,,
|
mm_btc-0.0.6.dist-info/METADATA
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: mm-btc
|
|
3
|
-
Version: 0.0.6
|
|
4
|
-
Requires-Python: >=3.12
|
|
5
|
-
Requires-Dist: mm-std ~=0.1.0
|
|
6
|
-
Requires-Dist: hdwallet ~=2.2.1
|
|
7
|
-
Requires-Dist: bit ~=0.8.0
|
|
8
|
-
Requires-Dist: bitcoinlib ~=0.6.15
|
|
9
|
-
Requires-Dist: typer ~=0.12.3
|
|
10
|
-
Provides-Extra: dev
|
|
11
|
-
Requires-Dist: build ~=1.2.1 ; extra == 'dev'
|
|
12
|
-
Requires-Dist: twine ~=5.1.0 ; extra == 'dev'
|
|
13
|
-
Requires-Dist: pytest ~=8.3.2 ; extra == 'dev'
|
|
14
|
-
Requires-Dist: pytest-xdist ~=3.6.1 ; extra == 'dev'
|
|
15
|
-
Requires-Dist: pytest-httpserver ~=1.0.8 ; extra == 'dev'
|
|
16
|
-
Requires-Dist: coverage ~=7.6.0 ; extra == 'dev'
|
|
17
|
-
Requires-Dist: ruff ~=0.5.2 ; extra == 'dev'
|
|
18
|
-
Requires-Dist: pip-audit ~=2.7.0 ; extra == 'dev'
|
|
19
|
-
Requires-Dist: bandit ~=1.7.7 ; extra == 'dev'
|
|
20
|
-
Requires-Dist: mypy ~=1.11.0 ; extra == 'dev'
|
|
21
|
-
Requires-Dist: types-python-dateutil ~=2.9.0 ; extra == 'dev'
|
|
22
|
-
Requires-Dist: types-requests ~=2.32.0.20240523 ; extra == 'dev'
|
|
23
|
-
Requires-Dist: types-PyYAML ~=6.0.12.12 ; extra == 'dev'
|
|
24
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
mm_btc
|
|
File without changes
|