Metadata-Version: 2.4
Name: sarcire-defi
Version: 0.1.1
Summary: DeFi client for Sarcire — synchronous revert diagnosis without blocking the on-chain loop
Project-URL: Homepage, https://sarcire.dev
Project-URL: Repository, https://github.com/jeffobri/sarcire
License: MIT
Requires-Python: >=3.10
Requires-Dist: httpx>=0.26.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# sarcire-defi

DeFi client for [Sarcire](https://sarcire.dev) — synchronous revert diagnosis without blocking the on-chain loop.

## Install

```bash
pip install sarcire-defi
```

## Usage

```python
from sarcire_defi import diagnose_revert, request_generation_async

result = diagnose_revert(
    error_trace,
    min_confidence=0.80,
    chain_id=8453,
    protocol="aave_v3_pool",
)

if result["action"] == "apply":
    # Safe to use — cached fix with sufficient confidence
    for step in result["fix_steps"]:
        print(step)
else:
    # No safe immediate fix — stop the on-chain loop
    # Trigger background generation for next time:
    request_generation_async(error_trace, chain_id=8453, protocol="aave_v3_pool")
    raise RuntimeError("No safe remediation available")
```

**Critical:** `diagnose_revert` always returns immediately. It never blocks waiting for LLM generation.

## License

MIT
