Metadata-Version: 2.4
Name: ape-xaps
Version: 0.1.0
Summary: XAPS pre-execution audit helpers for eth-ape scripts and agents
Author-email: APMC1 <support@xaps.network>
License-Expression: MIT
Project-URL: Homepage, https://xaps.network
Project-URL: Repository, https://github.com/APMC1/xaps-sdk
Project-URL: Documentation, https://github.com/APMC1/xaps-sdk#readme
Keywords: ape,xaps,web3,agents,security,eth-ape
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: eth-ape<1,>=0.8
Requires-Dist: xaps-sdk>=0.1.2
Requires-Dist: click>=8.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"

# ape-xaps

XAPS pre-execution audit helpers for [Ape](https://github.com/ApeWorX/ape) scripts and agent workflows.

Recommended by ApeWorX maintainers as an **SDK integration** (not core) — see [ApeWorX/ape#2796](https://github.com/ApeWorX/ape/issues/2796).

## Install

```bash
pip install ape-xaps xaps-sdk
export XAPS_AGENT_KEY=xaps_...
export XAPS_API_URL=https://api.xaps.network   # optional
```

## Quick use (2-line guard)

```python
from ape_xaps import audit_before_send, XapsApeRejectedError

# Right before account.send_transaction(txn) or provider.send_transaction(txn)
receipt = audit_before_send(txn, action="transfer")
if receipt["audit"]["status"] != "APPROVED":
    raise XapsApeRejectedError(receipt["audit"].get("beta_attack", "REJECTED"), receipt=receipt)

account.send_transaction(txn)
```

## CLI (optional, via ape.cli pattern)

```bash
ape-xaps health
ape-xaps audit --action transfer --contract 0xabc... --amount 0.01
```

## Links

- XAPS SDK: https://github.com/APMC1/xaps-sdk
- Ape plugin/SDK guidance: https://github.com/ApeWorX/ape/issues/2796
