Metadata-Version: 2.4
Name: bouclier-sdk
Version: 0.1.0
Summary: Python SDK for the Bouclier AI Agent Trust Layer
License: MIT
Keywords: agents,ai,erc4337,ethereum,trust
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: eth-account>=0.13.0
Requires-Dist: eth-typing>=4.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: web3>=7.0.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# bouclier-sdk (Python)

Python client for the [Bouclier AI Agent Trust Layer](https://github.com/bouclier/bouclier).

## Install

```bash
pip install bouclier-sdk
# or
uv add bouclier-sdk
```

## Quick Start

```python
from bouclier_sdk import BouclierClient, Addresses, GrantScopeParams

# Read-only client (no private key)
client = BouclierClient(
    rpc_url   = "https://sepolia.base.org",
    addresses = Addresses(
        agent_registry      = "0x...",
        revocation_registry = "0x...",
        spend_tracker       = "0x...",
        audit_logger        = "0x...",
        permission_vault    = "0x...",
    ),
)

agent_id = client.get_agent_id("0xAgentWallet")
record   = client.resolve_agent(agent_id)
scope    = client.get_active_scope(agent_id)
spend    = client.get_rolling_spend(agent_id)  # 18-decimal USD
events   = client.get_audit_trail(agent_id, limit=20)

# Write operations (requires private key)
client_rw = BouclierClient(
    rpc_url     = "https://sepolia.base.org",
    addresses   = addresses,
    private_key = "0x...",
)

tx_hash = client_rw.grant_permission(GrantScopeParams(
    agent_id             = agent_id,
    daily_spend_cap_usd  = 1000 * 10**18,   # $1,000/day
    per_tx_spend_cap_usd = 100  * 10**18,   # $100/tx
    valid_for_days       = 30,
    allow_any_protocol   = True,
    allow_any_token      = True,
))
```

## Development

```bash
cd python-sdk
pip install -e ".[dev]"
pytest
```
