Metadata-Version: 2.4
Name: agentsync-sdk
Version: 1.0.0
Summary: Python SDK for the AgentSync x402 micropayment gateway on Radix
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: PyNaCl>=1.5.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: pytest-httpx>=0.30.0; extra == "dev"

# AgentSync Python SDK

Python SDK for the AgentSync x402 micropayment gateway on Radix.

## Install

```bash
pip install agentsync-sdk
```

> Note: the distribution name is `agentsync-sdk`; the import package remains
> `agentsync` (`from agentsync import ...`). For local development use
> `pip install -e .` in the repo.

## Development

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

## Platform Attestation Verification

Verify a platform-signed attestation envelope against the trusted platform
Ed25519 public key:

```python
from agentsync import SignatureEnvelope, verify_platform_attestation

trusted_public_key = "9afcc1cf66b256d7d9567a906fba4317305d92c3e7fd7f27386dffe182332576"
envelope = SignatureEnvelope(
    payload="account_tdx_2_...:5.500000:0",
    signature="<128-char hex>",
    public_key=trusted_public_key,
    algorithm="ed25519+sha256",
)

valid = verify_platform_attestation(envelope, trusted_public_key)  # bool
```

`verify_platform_attestation()` is pure and synchronous: the trusted key is
injected by the caller and never fetched from the network. It asserts that the
envelope's `public_key` matches the trusted key before verifying the
`Ed25519(SHA-256(payload))` signature.

The TypeScript counterpart lives at [`../sdk-typescript`](../sdk-typescript).
