Metadata-Version: 2.1
Name: bankofai-x402
Version: 0.5.0
Summary: x402 Payment Protocol SDK for Python
Project-URL: Homepage, https://github.com/BofAI/x402
Project-URL: Documentation, https://github.com/BofAI/x402#readme
Project-URL: Repository, https://github.com/BofAI/x402
Author-email: x402 <dev@x402.io>
License: MIT
Keywords: blockchain,payment,tron,x402
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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.11
Requires-Dist: bankofai-agent-wallet>=2.3.0
Requires-Dist: base58>=2.1.1
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: all
Requires-Dist: eth-account>=0.8.0; extra == 'all'
Requires-Dist: fastapi>=0.100.0; extra == 'all'
Requires-Dist: flask>=2.0.0; extra == 'all'
Requires-Dist: tronpy>=0.4.0; extra == 'all'
Requires-Dist: web3>=6.0.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: evm
Requires-Dist: eth-account>=0.8.0; extra == 'evm'
Requires-Dist: web3>=6.0.0; extra == 'evm'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100.0; extra == 'fastapi'
Provides-Extra: flask
Requires-Dist: flask>=2.0.0; extra == 'flask'
Provides-Extra: tron
Requires-Dist: tronpy>=0.4.0; extra == 'tron'
Description-Content-Type: text/markdown

# x402

Python SDK for the x402 payment protocol — supports TRON and EVM (BSC) networks.

## Installation

```bash
pip install bankofai-x402
```

Optional extras:

```bash
pip install "bankofai-x402[tron]"
pip install "bankofai-x402[fastapi]"
pip install "bankofai-x402[flask]"
pip install "bankofai-x402[all]"
```

## Quick Start

```python
from bankofai.x402.clients import X402Client

client = X402Client()
```

If you want automatic handling of HTTP 402 responses, use `X402HttpClient`:

```python
import httpx

from bankofai.x402.clients import X402Client, X402HttpClient

x402_client = X402Client()
http_client = httpx.AsyncClient()
client = X402HttpClient(http_client=http_client, x402_client=x402_client)
```

## Supported Schemes

- **`exact_permit`**: Standard x402 payment scheme using TIP-712/EIP-712 permits.
- **`exact_gasfree`**: (TRON) Pay with USDT/USDD without TRX gas using the GasFree protocol.
- **`exact`**: (EVM) Native direct payment using ERC-3009.

## Links

- Repository: https://github.com/BofAI/x402
- Issues: https://github.com/BofAI/x402/issues
- Documentation: https://docs.bankofai.io/
- Contributing: [CONTRIBUTING.md](../../CONTRIBUTING.md)
