blockmetric 0.3.0__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.
- blockmetric/__init__.py +41 -0
- blockmetric/_config.py +6 -0
- blockmetric/_version.py +1 -0
- blockmetric/client.py +900 -0
- blockmetric/errors.py +58 -0
- blockmetric/helpers.py +67 -0
- blockmetric/py.typed +0 -0
- blockmetric/sse.py +56 -0
- blockmetric/types.py +1948 -0
- blockmetric/webhooks.py +79 -0
- blockmetric-0.3.0.dist-info/METADATA +262 -0
- blockmetric-0.3.0.dist-info/RECORD +17 -0
- blockmetric-0.3.0.dist-info/WHEEL +5 -0
- blockmetric-0.3.0.dist-info/licenses/LICENSE +202 -0
- blockmetric-0.3.0.dist-info/licenses/NOTICE +2 -0
- blockmetric-0.3.0.dist-info/licenses/TRADEMARKS.md +34 -0
- blockmetric-0.3.0.dist-info/top_level.txt +1 -0
blockmetric/__init__.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Official Python client of the Blockmetric API: real-time crypto market data
|
|
2
|
+
(Hyperliquid on-chain positions plus the exchanges the API may redistribute). Standard library only, Python 3.9+.
|
|
3
|
+
|
|
4
|
+
from blockmetric import Blockmetric
|
|
5
|
+
client = Blockmetric() # BLOCKMETRIC_API_KEY, BLOCKMETRIC_BASE_URL
|
|
6
|
+
res = client.liquidation_summary(hours=24)
|
|
7
|
+
print(res["data"]["totalUsd"], res.last_response.rate_limit.remaining)
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from . import types
|
|
11
|
+
from ._version import __version__
|
|
12
|
+
from .client import FOLLOWABLE, ApiResponse, Blockmetric, RateLimit, ResponseInfo, TextResponse, retry_after_seconds
|
|
13
|
+
from .errors import BlockmetricError
|
|
14
|
+
from .helpers import heatmap_clusters
|
|
15
|
+
from .sse import SseFrame, SseParser
|
|
16
|
+
from .types import API_VERSION, OPERATIONS
|
|
17
|
+
from .webhooks import DEFAULT_TOLERANCE_SEC, SIGNATURE_HEADER, construct_event, parse_signature_header, sign_webhook, verify_webhook
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"API_VERSION",
|
|
21
|
+
"ApiResponse",
|
|
22
|
+
"Blockmetric",
|
|
23
|
+
"BlockmetricError",
|
|
24
|
+
"DEFAULT_TOLERANCE_SEC",
|
|
25
|
+
"FOLLOWABLE",
|
|
26
|
+
"OPERATIONS",
|
|
27
|
+
"RateLimit",
|
|
28
|
+
"ResponseInfo",
|
|
29
|
+
"SIGNATURE_HEADER",
|
|
30
|
+
"SseFrame",
|
|
31
|
+
"SseParser",
|
|
32
|
+
"TextResponse",
|
|
33
|
+
"__version__",
|
|
34
|
+
"construct_event",
|
|
35
|
+
"heatmap_clusters",
|
|
36
|
+
"parse_signature_header",
|
|
37
|
+
"retry_after_seconds",
|
|
38
|
+
"sign_webhook",
|
|
39
|
+
"types",
|
|
40
|
+
"verify_webhook",
|
|
41
|
+
]
|
blockmetric/_config.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Generated from the Blockmetric OpenAPI document by scripts/devx-generate.ts. Do not edit by hand.
|
|
2
|
+
"""Default base URL (set at release time from SITE_URL; None until the production domain is configured)."""
|
|
3
|
+
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
DEFAULT_BASE_URL: Optional[str] = "https://api.blockmetric.io/v1"
|
blockmetric/_version.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.0"
|