Metadata-Version: 2.5
Name: rooms-x402-tools
Version: 0.1.0
Summary: Pay-per-call x402 tools for trading and crypto agents: token verdict ($0.015 USDC on Base), Fear & Greed, prompt-injection check, URL reads. Paid from your own wallet. By Rooms by Aurmada.
Project-URL: Homepage, https://rooms.aurmada.com/paid
Project-URL: Documentation, https://rooms.aurmada.com/paid
Author-email: Rooms by Aurmada <team@aurmada.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agentkit,ai-agent,base,crypto,langchain,langgraph,rug-check,token,token-risk,trading-bot,usdc,x402
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: eth-account>=0.13
Requires-Dist: httpx>=0.27
Requires-Dist: x402[evm,httpx]<3,>=2.20
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == 'langchain'
Description-Content-Type: text/markdown

# rooms-x402-tools (Python)

Pay-per-call tools for trading and crypto agents, paid from **your own wallet** in USDC on Base with [x402](https://x402.org). No API key, no account, no subscription.

| Method | What it returns | Price |
|---|---|---|
| `token_verdict` | Grade (BASED / MID / COOKED / RADIOACTIVE), 0-100 score, one-liner + roast, risk signals (owner powers, mint, pause, blacklist, upgradeable proxy, owner share of supply), on-chain DEX liquidity, shareable card | $0.015 |
| `fear_greed` | Crypto Fear & Greed Index by Alternative.me, up to 30 days of history | $0.001 |
| `prompt_injection_check` | Screen untrusted text before your agent acts on it | $0.004 |
| `read_urls` | 1-10 public pages as clean markdown | $0.0015 / URL |

Built for loops: every paid call takes a `request_key` (generated if omitted). Retrying with the same key and input returns the first answer and is **never charged twice**. A per-call spend cap (default $0.05) refuses any payment request above it before anything is signed. You are never charged for errors.

```bash
pip install rooms-x402-tools            # core (x402 client with httpx + EVM signing)
pip install "rooms-x402-tools[langchain]"
```

## Quick start

```python
import os
from rooms_x402_tools import RoomsX402Sync, format_verdict

rooms = RoomsX402Sync(private_key=os.environ["WALLET_PRIVATE_KEY"])
v = rooms.token_verdict("0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed")   # chain="ethereum" for mainnet tokens
print(v["grade"], v["score"], v["metrics"]["liquidity_usd_est"])
print(format_verdict(v))
print(v["_meta"]["payment"])   # settled USDC payment on Base (tx hash)
```

Async (recommended inside bots):

```python
from rooms_x402_tools import RoomsX402

async with RoomsX402(private_key=key, max_payment_usd=0.02) as rooms:
    for token in new_tokens:
        v = await rooms.token_verdict(token, request_key=f"scan-{token}-{today}")   # safe to retry
        if v["grade"] == "RADIOACTIVE":
            continue
    mood = await rooms.fear_greed(days=7)
```

## LangChain / LangGraph

```python
from rooms_x402_tools.langchain import create_rooms_tools
tools = create_rooms_tools(private_key=os.environ["WALLET_PRIVATE_KEY"])
# token_verdict, crypto_fear_greed, prompt_injection_check, read_urls (async tools)
```

## Notes

- Payments: x402 `exact` scheme, USDC on Base (eip155:8453), signed locally with your key (EIP-3009) by the official `x402` client. Your key never leaves your process.
- Token verdicts are built from on-chain facts only. Entertainment and information, not financial advice, not an audit.
- Pricing and full schemas: https://rooms.aurmada.com/paid
- A TypeScript version with Coinbase AgentKit, ElizaOS and LangChain.js plug-ins exists too; ask team@aurmada.com.

MIT, Rooms by Aurmada · team@aurmada.com
