内容
# SolSigs Python 客户端 · [](https://solsigs.com)
**通过 [x402](https://x402.org) 微支付为 AI 代理提供按调用付费的 Solana 数据 API。**
无需 API 密钥。无需订阅。代理按调用支付 USDC。
## Claude 桌面版 (原生 x402)
Claude 代理可以原生支付 SolSigs API 费用 — 30 秒设置。
```bash
pip install solsigs-py
```
然后将以下内容添加到 `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"solsigs": {
"command": "solsigs-mcp"
}
}
}
```
重启 Claude 桌面版。您的代理现在拥有 **15 个 Solana 研究工具**,并支持原生 x402 微支付。
**为什么使用本地命令?** Claude 桌面版仅支持 stdio 传输。`solsigs-mcp` 是一个本地代理,桥接 stdio ↔ 远程 SolSigs MCP 服务器,使用的 SSE 协议。完整示例:[`examples/claude_solsigs_agent.py`](examples/claude_solsigs_agent.py)
🔗 [Anthropic 官方 x402 文档](https://docs.anthropic.com/en/docs/build-with-claude/x402-payments)
## 安装
```bash
pip install solsigs-py # 基础客户端
pip install solsigs-py[langgraph] # + LangGraph 工具
```
## 快速入门
```python
from solsigs import SolSigsClient
client = SolSigsClient()
# 获取任意 Solana 代币的 DEX 价格
price = client.get_dex_price("DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263")
print(price) # → $0.002 USDC
# 多代币批量定价 + OHLCV
prices = client.batch_token_pricing(["SOL", "BONK", "WIF"], period="1h")
# 钱包风险评分
report = client.score_wallet("7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV")
# 套利扫描
arbs = client.scan_arbitrage(min_spread_pct=0.5)
```
### 支付流程
```
代理调用端点 → 402 付款要求 → 支付 USDC → 重试 → 获取数据
```
客户端处理 HTTP 层。集成您的代理的 Solana 钱包以实现自动化的 x402 支付。
## MCP 服务器
SolSigs 作为 **MCP 服务器**(模型上下文协议)提供 — Claude、Hermes、Cursor 和任何 MCP 兼容的代理都可以原生调用 SolSigs 工具。
**Claude 桌面版用户:** 使用上述 `solsigs-mcp` 命令(stdio 桥接)。
**Hermes、Cursor 和其他支持 SSE 的 MCP 客户端:**
```json
{
"mcpServers": {
"solsigs": {
"url": "https://solsigs.com/sse",
"transport": "sse"
}
}
}
```
**15 个 MCP 工具** — 所有 14 个 HTTP 端点 + Polymarket 预测市场:
### 数据与定价(5)
| 工具 | 描述 | 价格 |
|------|-------------|-------|
| `get_dex_price` | 单代币 DEX 价格馈送(Jupiter + Birdeye) | $0.002 |
| `batch_token_pricing` | 多代币定价 + OHLCV 烛台 + 元数据 | $0.003 |
| `get_market_summary` | AI 驱动的链上市场总结(Groq LLM) | $0.008 |
| `get_staking_rates` | 跨协议 APY 比较(Marinade, Jito, Blaze, Sanctum) | $0.002 |
| `get_dev_activity` | GitHub 提交活动 + Solana 协议审计状态 | $0.001 |
### 交易与套利(2)
| 工具 | 描述 | 价格 |
|------|-------------|-------|
| `scan_arbitrage` | 跨 DEX 套利扫描器 | $0.010 |
| `get_prediction_market` | Polymarket 预测市场(加密、政治、体育) | $0.003 |
### 情报与跟踪(5)
| 工具 | 描述 | 价格 |
|------|-------------|-------|
| `analyze_wallet` | 钱包风险评分 + 洗盘交易检测 | $0.005 |
| `detect_token_launches` | 新代币发布检测(pump.fun, Raydium) | $0.003 |
| `get_whale_activity` | 鲸鱼钱包跟踪 + 智能资金信号 | $0.006 |
| `get_nft_intel` | NFT 地板价格、稀有度、洗盘交易每个收藏 | $0.004 |
| `get_social_sentiment` | 链上社会情绪 + 影响者跟踪 | $0.004 |
### 基础设施(3)
| 工具 | 描述 | 价格 |
|------|-------------|-------|
| `rpc_relay` | 按调用付费的 Helius RPC 中继 | $0.001 |
| `create_alert` | Webhook 警报注册(价格、交易量、鲸鱼、发布) | $0.005 |
| `wallet_status` | 检查 MCP 钱包 USDC/SOL 余额 | 免费 |
## LangGraph 集成
```python
from solsigs.langgraph_tools import SOLSIGS_LANGGRAPH_TOOLS
# 添加到您的 LangGraph 代理
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(model, SOLSIGS_LANGGRAPH_TOOLS)
# 您的代理现在可以:
agent.invoke({"messages": ["BONK 当前价格是多少?"]})
agent.invoke({"messages": ["比较 Solana 协议的质押 APY"]})
```
参见 [`examples/langgraph_agent.py`](examples/langgraph_agent.py) 以获取完整的分步代理演示。
## 可用 HTTP 端点(14)
### 数据与定价(5)
| 端点 | 描述 | 价格 |
|----------|-------------|-------|
| `/dex` | 单代币 DEX 价格馈送(Jupiter + Birdeye) | $0.002 |
| `/price` | 批量多代币定价 + OHLCV 烛台 + 元数据 | $0.003 |
| `/summary` | AI 链上数据总结(Groq LLM) | $0.008 |
| `/staking` | 跨协议质押 APY 比较 | $0.002 |
| `/dev` | 协议开发者活动 + 审计状态 | $0.001 |
### 交易与套利(2)
| 端点 | 描述 | 价格 |
|----------|-------------|-------|
| `/arb` | 套利扫描器 | $0.010 |
| `/predict` | Polymarket 预测市场 | $0.003 |
### 情报与跟踪(5)
| 端点 | 描述 | 价格 |
|----------|-------------|-------|
| `/wallet` | 钱包风险评分 | $0.005 |
| `/launches` | 早期代币发布检测 | $0.003 |
| `/whale` | 鲸鱼钱包跟踪 + 智能资金信号 | $0.006 |
| `/nft` | NFT 地板价格、稀有度、洗盘交易 | $0.004 |
| `/social` | 链上社会情绪 + 影响者跟踪 | $0.004 |
### 基础设施(2)
| 端点 | 描述 | 价格 |
|----------|-------------|-------|
| `/rpc` | RPC 负载均衡器 | $0.001 |
| `/alerts` | Webhook 警报注册 | $0.005 |
## SolSigs ProofGuard
ProofGuard 是 Solana 上 x402 付费代理端点的签名收据和退款证据层。
它返回:
- 端点信任评分;
- 支付期望收据;
- 支付履行收据;
- 退款证据包。
实时端点:
```text
POST https://solsigs.com/proofguard/evaluate
价格:通过 Solana 主网上的 x402 支付 0.003 USDC
```
ProofGuard 明确将证据模式标记为 `solsigs_instrumented`、`proofguard_probed` 或 `self_attested`,以便代理区分真实观察到的证明和调用者提供的声明。
参见 [docs/proofguard.md](docs/proofguard.md)。
## 为什么选择 x402?
- **无需 API 密钥** — 支付是唯一的门槛
- **无需订阅** — 仅为使用付费
- **代理原生** — 为自主代理商务设计
- **Solana 速度** — 交易在 <1s 内完成,费用 <$0.001
- **Claude 原生** — Anthropic 官方 x402 支持,Claude 用户零设置
## 链接
- [SolSigs 主页](https://solsigs.com)
- [Claude + SolSigs 示例](examples/claude_solsigs_agent.py)
- [Anthropic x402 文档](https://docs.anthropic.com/en/docs/build-with-claude/x402-payments)
- [x402 协议](https://x402.org)
- [x402scan 浏览器](https://x402scan.com)
## 许可证
MIT