Metadata-Version: 2.4
Name: a2a-settlement
Version: 1.0.0
Summary: Escrow-based payment settlement for the A2A protocol
License-Expression: MIT
Project-URL: Homepage, https://github.com/a2a-settlement/a2a-settlement
Project-URL: Repository, https://github.com/a2a-settlement/a2a-settlement
Project-URL: Documentation, https://github.com/a2a-settlement/a2a-settlement/tree/main/docs
Project-URL: Issues, https://github.com/a2a-settlement/a2a-settlement/issues
Keywords: a2a,settlement,escrow,agent,payment
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Provides-Extra: examples
Requires-Dist: a2a-sdk[http-server]>=0.3; extra == "examples"
Provides-Extra: identity
Requires-Dist: PyNaCl>=1.5.0; extra == "identity"
Requires-Dist: base58>=2.1.0; extra == "identity"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"

# a2a-settlement

Escrow-based payment settlement for the [A2A protocol](https://github.com/google/A2A).

**A2A-SE** holds funds in escrow during task execution and releases them on completion — or refunds them on failure. Zero modifications to A2A core. Currency-agnostic.

```
RequesterAgent  <---- A2A ---->  ProviderAgent
     |                               |
     +--------- HTTPS (A2A-SE) ------+
                 Exchange
          escrow / release / refund
```

## Install

```bash
pip install a2a-settlement
```

With Ed25519 identity helpers:

```bash
pip install a2a-settlement[identity]
```

## Quick start

```python
from a2a_settlement import SettlementExchangeClient

client = SettlementExchangeClient("https://your-exchange.example.com")

# Create an escrow
escrow = await client.create_escrow(
    payer_id="agent-alice",
    payee_id="agent-bob",
    amount="10.00",
    currency="USD",
    task_id="task-123",
)

# Release funds on task completion
await client.release_escrow(escrow["escrow_id"])
```

## Features

- **Escrow lifecycle** — create, release, refund, and dispute escrows
- **AgentCard builder** — generate A2A-SE extension blocks for agent cards
- **Signed requests** — Ed25519 request signing for authenticated API calls
- **Task metadata** — helpers for A2A message/task `metadata["a2a-se"]`
- **Pricing models** — fixed, per-message, and time-based pricing

## Links

- [Full documentation](https://github.com/a2a-settlement/a2a-settlement/tree/main/docs)
- [Specification (SPEC.md)](https://github.com/a2a-settlement/a2a-settlement/blob/main/SPEC.md)
- [OpenAPI spec](https://github.com/a2a-settlement/a2a-settlement/blob/main/openapi.yaml)
- [TypeScript SDK](https://github.com/a2a-settlement/a2a-settlement/tree/main/sdk-ts)

## License

MIT
