Metadata-Version: 2.4
Name: x402-rwa
Version: 0.1.1
Summary: Agent-Native RWA Settlement SDK - Acquire tokenized assets in one function call
Author-email: Patrick Schell <ghost@x402.dev>
License: MIT
Project-URL: Homepage, https://github.com/Patrickschell609/402-clearinghouse
Project-URL: Documentation, https://github.com/Patrickschell609/402-clearinghouse#readme
Project-URL: Repository, https://github.com/Patrickschell609/402-clearinghouse
Project-URL: Issues, https://github.com/Patrickschell609/402-clearinghouse/issues
Keywords: x402,rwa,defi,web3,ai-agents,treasury-bills,blockchain
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: web3>=6.0.0
Requires-Dist: eth-account>=0.9.0
Requires-Dist: eth-abi>=4.0.0
Requires-Dist: requests>=2.28.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"

# x402-rwa

Agent-Native RWA Settlement SDK. Acquire tokenized Real World Assets in one function call.

## Installation

```bash
pip install x402-rwa
```

## Quick Start

```python
from x402_rwa import X402Agent

# Initialize with your RPC and wallet
agent = X402Agent(
    rpc_url="https://mainnet.base.org",
    private_key="0x..."
)

# One line to acquire 100 Treasury Bills
tx_hash = agent.acquire_asset(
    server_url="http://your-clearinghouse.com/api/v1/trade",
    asset_id="TBILL-26",
    amount=100
)

print(f"https://basescan.org/tx/{tx_hash}")
```

## How It Works

The SDK handles the complete x402 flow:

1. **Negotiation** - HTTP GET returns 402 with pricing headers
2. **Proof Generation** - ZK compliance proof via SP1
3. **Settlement** - Atomic on-chain swap (USDC → RWA)

## x402 Protocol

```
GET /api/v1/trade/buy/TBILL-26?amount=100

→ 402 Payment Required
  X-402-Price: 98000000
  X-402-Payment-Address: 0x...
  X-402-Compliance-Circuit: 0x...
```

## License

MIT
