blockintql-sdk 0.1.0__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.
- blockintql_sdk-0.1.0/PKG-INFO +41 -0
- blockintql_sdk-0.1.0/README.md +33 -0
- blockintql_sdk-0.1.0/blockintql_sdk/__init__.py +3 -0
- blockintql_sdk-0.1.0/blockintql_sdk/client.py +79 -0
- blockintql_sdk-0.1.0/blockintql_sdk.egg-info/PKG-INFO +41 -0
- blockintql_sdk-0.1.0/blockintql_sdk.egg-info/SOURCES.txt +10 -0
- blockintql_sdk-0.1.0/blockintql_sdk.egg-info/dependency_links.txt +1 -0
- blockintql_sdk-0.1.0/blockintql_sdk.egg-info/requires.txt +1 -0
- blockintql_sdk-0.1.0/blockintql_sdk.egg-info/top_level.txt +3 -0
- blockintql_sdk-0.1.0/examples/plan_and_workspace.py +29 -0
- blockintql_sdk-0.1.0/pyproject.toml +14 -0
- blockintql_sdk-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blockintql-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for BlockINTQL Ethereum and stablecoin intelligence
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: httpx>=0.27.0
|
|
8
|
+
|
|
9
|
+
# BlockINTQL Python SDK
|
|
10
|
+
|
|
11
|
+
Minimal Python client for:
|
|
12
|
+
|
|
13
|
+
- capability discovery
|
|
14
|
+
- investigation planning
|
|
15
|
+
- workspace lifecycle
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install -e .
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from blockintql_sdk import BlockINTQL
|
|
27
|
+
|
|
28
|
+
client = BlockINTQL()
|
|
29
|
+
|
|
30
|
+
capabilities = client.capabilities()
|
|
31
|
+
plan = client.plan(
|
|
32
|
+
goal="Investigate this wallet's stablecoin counterparties and bridge activity",
|
|
33
|
+
address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
34
|
+
budget_credits=12,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
workspace = client.create_workspace(
|
|
38
|
+
name="stablecoin-investigation",
|
|
39
|
+
modules=["verdict", "stablecoins", "bridge-activity", "chart"],
|
|
40
|
+
)
|
|
41
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# BlockINTQL Python SDK
|
|
2
|
+
|
|
3
|
+
Minimal Python client for:
|
|
4
|
+
|
|
5
|
+
- capability discovery
|
|
6
|
+
- investigation planning
|
|
7
|
+
- workspace lifecycle
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install -e .
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from blockintql_sdk import BlockINTQL
|
|
19
|
+
|
|
20
|
+
client = BlockINTQL()
|
|
21
|
+
|
|
22
|
+
capabilities = client.capabilities()
|
|
23
|
+
plan = client.plan(
|
|
24
|
+
goal="Investigate this wallet's stablecoin counterparties and bridge activity",
|
|
25
|
+
address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
26
|
+
budget_credits=12,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
workspace = client.create_workspace(
|
|
30
|
+
name="stablecoin-investigation",
|
|
31
|
+
modules=["verdict", "stablecoins", "bridge-activity", "chart"],
|
|
32
|
+
)
|
|
33
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Any, Dict, List, Optional
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BlockINTQL:
|
|
8
|
+
def __init__(self, api_key: Optional[str] = None, base_url: Optional[str] = None, timeout: float = 30.0):
|
|
9
|
+
self.api_key = api_key or os.environ.get("BLOCKINTQL_API_KEY")
|
|
10
|
+
self.base_url = (base_url or os.environ.get("BLOCKINTQL_API_URL") or "https://blockintql.com").rstrip("/")
|
|
11
|
+
self.timeout = timeout
|
|
12
|
+
|
|
13
|
+
def _headers(self, require_auth: bool = True) -> Dict[str, str]:
|
|
14
|
+
headers = {"Content-Type": "application/json"}
|
|
15
|
+
if require_auth:
|
|
16
|
+
if not self.api_key:
|
|
17
|
+
raise ValueError("API key required for this call")
|
|
18
|
+
headers["Authorization"] = f"Bearer {self.api_key}"
|
|
19
|
+
return headers
|
|
20
|
+
|
|
21
|
+
def _get(self, path: str, *, params: Optional[Dict[str, Any]] = None, require_auth: bool = True) -> Dict[str, Any]:
|
|
22
|
+
response = httpx.get(f"{self.base_url}{path}", headers=self._headers(require_auth=require_auth), params=params, timeout=self.timeout)
|
|
23
|
+
response.raise_for_status()
|
|
24
|
+
return response.json()
|
|
25
|
+
|
|
26
|
+
def _post(self, path: str, *, body: Dict[str, Any], require_auth: bool = True) -> Dict[str, Any]:
|
|
27
|
+
response = httpx.post(f"{self.base_url}{path}", headers=self._headers(require_auth=require_auth), json=body, timeout=max(self.timeout, 60.0))
|
|
28
|
+
response.raise_for_status()
|
|
29
|
+
return response.json()
|
|
30
|
+
|
|
31
|
+
def capabilities(self, surface: Optional[str] = None, category: Optional[str] = None) -> Dict[str, Any]:
|
|
32
|
+
params: Dict[str, Any] = {}
|
|
33
|
+
if surface:
|
|
34
|
+
params["surface"] = surface
|
|
35
|
+
if category:
|
|
36
|
+
params["category"] = category
|
|
37
|
+
return self._get("/v1/capabilities", params=params, require_auth=False)
|
|
38
|
+
|
|
39
|
+
def plan(
|
|
40
|
+
self,
|
|
41
|
+
*,
|
|
42
|
+
goal: str,
|
|
43
|
+
address: Optional[str] = None,
|
|
44
|
+
chain: str = "ethereum",
|
|
45
|
+
budget_credits: Optional[int] = None,
|
|
46
|
+
budget_usd: Optional[float] = None,
|
|
47
|
+
prefer_surface: str = "auto",
|
|
48
|
+
) -> Dict[str, Any]:
|
|
49
|
+
body: Dict[str, Any] = {"goal": goal, "chain": chain, "prefer_surface": prefer_surface}
|
|
50
|
+
if address:
|
|
51
|
+
body["address"] = address
|
|
52
|
+
if budget_credits is not None:
|
|
53
|
+
body["budget_credits"] = budget_credits
|
|
54
|
+
if budget_usd is not None:
|
|
55
|
+
body["budget_usd"] = budget_usd
|
|
56
|
+
return self._post("/v1/plan", body=body, require_auth=False)
|
|
57
|
+
|
|
58
|
+
def create_workspace(
|
|
59
|
+
self,
|
|
60
|
+
*,
|
|
61
|
+
name: str,
|
|
62
|
+
chain: str = "ethereum",
|
|
63
|
+
modules: Optional[List[str]] = None,
|
|
64
|
+
) -> Dict[str, Any]:
|
|
65
|
+
return self._post(
|
|
66
|
+
"/v1/workspaces/create",
|
|
67
|
+
body={
|
|
68
|
+
"name": name,
|
|
69
|
+
"chain": chain,
|
|
70
|
+
"modules": modules or ["verdict", "stablecoins", "bridge-activity", "chart"],
|
|
71
|
+
},
|
|
72
|
+
require_auth=True,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
def get_workspace(self, workspace_id: str) -> Dict[str, Any]:
|
|
76
|
+
return self._get(f"/v1/workspaces/{workspace_id}", require_auth=True)
|
|
77
|
+
|
|
78
|
+
def destroy_workspace(self, workspace_id: str) -> Dict[str, Any]:
|
|
79
|
+
return self._post(f"/v1/workspaces/{workspace_id}/destroy", body={}, require_auth=True)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blockintql-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for BlockINTQL Ethereum and stablecoin intelligence
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: httpx>=0.27.0
|
|
8
|
+
|
|
9
|
+
# BlockINTQL Python SDK
|
|
10
|
+
|
|
11
|
+
Minimal Python client for:
|
|
12
|
+
|
|
13
|
+
- capability discovery
|
|
14
|
+
- investigation planning
|
|
15
|
+
- workspace lifecycle
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install -e .
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from blockintql_sdk import BlockINTQL
|
|
27
|
+
|
|
28
|
+
client = BlockINTQL()
|
|
29
|
+
|
|
30
|
+
capabilities = client.capabilities()
|
|
31
|
+
plan = client.plan(
|
|
32
|
+
goal="Investigate this wallet's stablecoin counterparties and bridge activity",
|
|
33
|
+
address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
34
|
+
budget_credits=12,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
workspace = client.create_workspace(
|
|
38
|
+
name="stablecoin-investigation",
|
|
39
|
+
modules=["verdict", "stablecoins", "bridge-activity", "chart"],
|
|
40
|
+
)
|
|
41
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
blockintql_sdk/__init__.py
|
|
4
|
+
blockintql_sdk/client.py
|
|
5
|
+
blockintql_sdk.egg-info/PKG-INFO
|
|
6
|
+
blockintql_sdk.egg-info/SOURCES.txt
|
|
7
|
+
blockintql_sdk.egg-info/dependency_links.txt
|
|
8
|
+
blockintql_sdk.egg-info/requires.txt
|
|
9
|
+
blockintql_sdk.egg-info/top_level.txt
|
|
10
|
+
examples/plan_and_workspace.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
httpx>=0.27.0
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from blockintql_sdk import BlockINTQL
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main():
|
|
5
|
+
client = BlockINTQL()
|
|
6
|
+
|
|
7
|
+
capabilities = client.capabilities()
|
|
8
|
+
print("surfaces:", capabilities.get("surfaces"))
|
|
9
|
+
print("categories:", capabilities.get("categories"))
|
|
10
|
+
|
|
11
|
+
plan = client.plan(
|
|
12
|
+
goal="Investigate this wallet's stablecoin counterparties and bridge activity",
|
|
13
|
+
address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
14
|
+
budget_credits=12,
|
|
15
|
+
)
|
|
16
|
+
print("plan summary:", plan.get("summary"))
|
|
17
|
+
print("recommended surface:", plan.get("recommended_surface"))
|
|
18
|
+
print("steps:", [step.get("capability_id") for step in plan.get("steps", [])])
|
|
19
|
+
|
|
20
|
+
# Requires BLOCKINTQL_API_KEY
|
|
21
|
+
# workspace = client.create_workspace(
|
|
22
|
+
# name="stablecoin-investigation",
|
|
23
|
+
# modules=["verdict", "stablecoins", "bridge-activity", "chart"],
|
|
24
|
+
# )
|
|
25
|
+
# print(workspace)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "blockintql-sdk"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Python SDK for BlockINTQL Ethereum and stablecoin intelligence"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
dependencies = ["httpx>=0.27.0"]
|
|
12
|
+
|
|
13
|
+
[tool.setuptools.packages.find]
|
|
14
|
+
where = ["."]
|