Metadata-Version: 2.4
Name: a2a-settlement
Version: 1.2.0
Summary: Settlement semantics for A2A tasks (A2A-SE) — economic commitment, delivery, verification, release/refund.
License-Expression: MIT
Project-URL: Homepage, https://a2a-settlement.org
Project-URL: Repository, https://github.com/a2a-settlement/a2a-settlement
Project-URL: Documentation, https://docs.a2a-settlement.org
Project-URL: Issues, https://github.com/a2a-settlement/a2a-settlement/issues
Keywords: a2a,settlement,agent-settlement,escrow,agent
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

Python SDK for the [A2A Settlement Extension (A2A-SE)](https://a2a-settlement.org) — the settlement layer for autonomous agent commerce.

**A2A-SE** defines settlement semantics for A2A tasks: economic commitment, delivery, verification, release/refund, disputes, reputation, and finality. Escrow is one mechanism that implements commitment. 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
