Fuego SKILL
Local Solana agent wallet with local infra for transfers (SOL, USDC, USDT), Jupiter swaps, and x402 purch.
Quick Start
1. Install fuego-cli
CODEBLOCK0
2. Create Wallet
CODEBLOCK1
3. Install Fuego Project
Prerequisites: Rust 1.85+ and Cargo are required to build the server.
CODEBLOCK2
4. Configure Jupiter API Key (Optional - for Swaps)
If you want to do token swaps via Jupiter, you need an API key:
- 1. Sign up at https://portal.jup.ag
- Create a new API key (free tier available)
- Add to your Fuego config at
~/.fuego/config.json:
CODEBLOCK3
Without this key, swaps will not work. Balance checks and transfers work without it.
5. Start Server
CODEBLOCK4
6. Show Address to Human
CODEBLOCK5
Share this address so humans can fund the wallet. They can send SOL from any Solana wallet (Phantom, Solflare, etc.).
7. Fund the Wallet
Option A: MoonPay (for fiat → crypto)
- - Visit: https://buy.moonpay.com/?currency=SOL&address=YOUR_ADDRESS
- Minimum: ~$30 USD
- Instant to wallet
Option B: Manual transfer
- - Human copies address from above
- Sends SOL from their wallet to your Fuego address
- SOL needed for transaction fees (0.001 SOL per tx)
Send Transactions
Use the CLI - this is the recommended approach:
CODEBLOCK6
This single command:
- - Builds transaction with fresh blockhash
- Signs locally (zero network key exposure)
- Submits to chain with proper error handling
- Returns signature + explorer link
- Supports address book contacts
- Works with SOL, USDC, USDT via
--token flag
Example:
fuego send GvCoHGGBR97Yphzc6SrRycZyS31oUYBM8m9hLRtJT7r5 0.25 --token USDC --yes
Token Swaps via Jupiter
Step 1: Get a Quote First
Always show the user the expected rate before executing:
CODEBLOCK8
Output shows:
- - Input amount (with token decimals handled automatically)
- Expected output amount
- Price impact
- Route details
Step 2: Execute the Swap
After user confirms the quote:
CODEBLOCK9
Parameters:
- -
--input - Input token symbol (SOL, USDC, BONK, etc.) or mint address - INLINECODE3 - Output token symbol or mint address
- INLINECODE4 - Amount in token units (e.g., 100000 for 100000 BONK)
- INLINECODE5 - Slippage tolerance in percent (default: 0.5%)
The swap script automatically:
- - Fetches correct token decimals from on-chain
- Uses BigInt for precision (no floating point errors)
- Throws error if decimals cannot be determined (prevents incorrect amounts)
Prerequisites:
- - Jupiter API key must be configured in INLINECODE6
- See Step 4 in Quick Start for setup instructions
Agent-Ready Architecture
CODEBLOCK10
Security Model:
- - Private keys never leave your machine (client-side signing for all transfers)
- File permissions provide real security (chmod 600)
- No network key exposure (localhost-only server)
- Standard Solana format (compatible with CLI tools)
One Exception - x402 Payments:
The /x402-purch endpoint handles the complete payment flow internally (including signing) because x402 requires server-side proof-of-payment generation. This is a deliberate security trade-off: the server temporarily accesses the private key only to sign the specific x402 payment transaction, then immediately clears it from memory. This enables seamless agent purchasing while maintaining the local-first architecture for all other operations.
API Reference
GET /wallet-address
Get the local wallet address dynamically.
CODEBLOCK11
Response:
CODEBLOCK12
POST /balance - Check SOL Balance
CODEBLOCK13
Response:
CODEBLOCK14
POST /tokens - Check All Token Balances
CODEBLOCK15
Returns SOL + all SPL token balances (USDC, USDT, BONK, etc.)
POST /build-transfer-sol - Build SOL Transfer
CODEBLOCK16
Response:
CODEBLOCK17
POST /build-transfer-usdc - Build USDC Transfer
CODEBLOCK18
POST /build-transfer-usdt - Build USDT Transfer
CODEBLOCK19
POST /submit-transaction - Broadcast Signed Transaction
CODEBLOCK20
Response:
{
"success": true,
"data": {
"signature": "5J7XzY...9KpQrS",
"explorer_link": "https://explorer.solana.com/tx/5J7XzY...9KpQrS?cluster=mainnet-beta"
}
}
Agent Integration Patterns
For Agents Writing Code (Node.js, etc.)
Just call the CLI via subprocess. That's it.
The CLI handles everything: building, signing, submitting, error handling. Don't wrap it in a class — just use it directly.
Node.js/TypeScript:
CODEBLOCK22
Alternative: Raw API Integration (Not Recommended)
If you absolutely must use raw API calls instead of the CLI, use the endpoints documented below. But the CLI is strongly preferred.
Complete API Reference
GET /
Root endpoint - returns server status.
CODEBLOCK23
Response:
CODEBLOCK24
GET /health
Health check endpoint.
CODEBLOCK25
Response:
CODEBLOCK26
GET /network
Get the default network configuration.
CODEBLOCK27
Response:
CODEBLOCK28
GET /wallet-address
Get the local wallet address dynamically.
CODEBLOCK29
Response:
CODEBLOCK30
POST /latest-hash
Get the latest blockhash for transaction building.
CODEBLOCK31
Response:
CODEBLOCK32
POST /sol-balance - Check SOL Balance
CODEBLOCK33
Response:
CODEBLOCK34
POST /usdc-balance - Check USDC Balance
CODEBLOCK35
Response:
CODEBLOCK36
POST /usdt-balance - Check USDT Balance
CODEBLOCK37
Response:
CODEBLOCK38
POST /tokens - Check All Token Balances
CODEBLOCK39
Returns SOL + all SPL token balances (USDC, USDT, BONK, etc.)
Response:
CODEBLOCK40
POST /all-transactions - Get Transaction History
CODEBLOCK41
Returns all wallet transactions. Fuego transactions (those with fuego| in the memo) are styled with rich details in the dashboard.
POST /build-transfer-sol - Build SOL Transfer
CODEBLOCK42
Response:
CODEBLOCK43
POST /build-transfer-usdc - Build USDC Transfer
CODEBLOCK44
POST /build-transfer-usdt - Build USDT Transfer
CODEBLOCK45
POST /submit-transaction - Broadcast Signed Transaction
CODEBLOCK46
Response:
CODEBLOCK47
POST /submit-versioned-transaction - Broadcast Versioned Transaction
CODEBLOCK48
POST /x402-purch - x402 Payment (Server-Side Signing)
Complete x402 payment flow including server-side signing. Used for Purch.xyz integrations.
CODEBLOCK49
Security Best Practices
What Makes Fuego Secure
- 1. File Permissions = Real Security
CODEBLOCK50
- 2. Client-Side Signing (with one exception)
- Private keys never sent over network (for transfers, swaps, etc.)
- Signing happens locally in CLI/scripts
- Server only sees signed transactions (public data)
- Exception: x402 payments require server-side signing for proof-of-payment generation. Key is loaded only for that specific transaction, then cleared from memory.
- 3. Localhost-Only Server
- Server binds to 127.0.0.1 (local only)
- No external network exposure
- No firewall configuration needed
- 4. Standard Format Compatibility
CODEBLOCK51
Agent Security Checklist
- - Keep
~/.fuego/wallet.json secure (it's your private key!) - Don't commit wallet files to version control
- Only run server on localhost (default behavior)
- Regularly backup INLINECODE10
- Verify transactions on Solana Explorer
- Monitor wallet balance regularly
- Use strong system-level user isolation
Troubleshooting
Common Issues
"Wallet not initialized" error
CODEBLOCK52
"Server not running" error
CODEBLOCK53
"Connection refused" error
CODEBLOCK54
"Fuego server not found" error
CODEBLOCK55
"Transaction simulation failed" error
CODEBLOCK56
"Invalid signature" error
CODEBLOCK57
Version mismatch / unexpected behavior
# Ensure all components are up to date
fuego update
# This updates both fuego-cli and the fuego project
# Restart server after updating: fuego serve
Supported Tokens & Networks
Transfer Tokens (fuego send)
These tokens are supported by
fuego send:
| Token | Mint Address | Decimals | Status |
|---|
| SOL | Native | 9 | Live |
| USDC |
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | 6 | Live |
|
USDT |
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenEqw | 6 | Live |
Swap Tokens (fuego swap / Jupiter)
fuego swap supports
any token tradable on Jupiter, including:
- - SOL, USDC, USDT (above)
- BONK, JUP, PYTH, RAY, ORCA
- Any SPL token with liquidity on Jupiter
See https://jup.ag for full token list.
Network Support
- - mainnet-beta - Production Solana network
- devnet - Development/testing network
- testnet - Solana testnet (limited use)
Ready to build autonomous Solana agents? Start with Fuego.
Fuego 技能
具备本地基础设施的 Solana 代理钱包,支持 SOL、USDC、USDT 转账、Jupiter 兑换和 x402 购买。
快速开始
1. 安装 fuego-cli
bash
npm install -g fuego-cli
2. 创建钱包
bash
fuego create
输出:
地址:DmFyLRiJtc4Bz75hjAqPaEJpDfRe4GEnRLPwc3EgeUZF
钱包配置:~/.fuego/wallet-config.json
备份:~/.config/solana/fuego-backup.json
3. 安装 Fuego 项目
前提条件: 需要 Rust 1.85+ 和 Cargo 来构建服务器。
bash
针对 OpenClaw 代理(自动检测 ~/.openclaw/workspace)
fuego install
手动安装(指定路径)
fuego install --path ~/projects/fuego
4. 配置 Jupiter API 密钥(可选 - 用于兑换)
如果希望通过 Jupiter 进行代币兑换,需要 API 密钥:
- 1. 在 https://portal.jup.ag 注册
- 创建新的 API 密钥(提供免费层级)
- 添加到 Fuego 配置 ~/.fuego/config.json:
json
{
rpcUrl: https://api.mainnet-beta.solana.com,
network: mainnet-beta,
jupiterKey: your-jupiter-api-key-here
}
没有此密钥,兑换功能将无法使用。余额查询和转账功能无需此密钥即可正常工作。
5. 启动服务器
bash
fuego serve
输出:
Fuego 服务器运行在 http://127.0.0.1:8080
6. 向用户显示地址
bash
fuego address
输出:
您的 Fuego 地址
名称:default
公钥:DmFy...eUZF
分享此地址以便用户向钱包充值。他们可以从任何 Solana 钱包(Phantom、Solflare 等)发送 SOL。
7. 为钱包充值
选项 A:MoonPay(法币 → 加密货币)
- - 访问:https://buy.moonpay.com/?currency=SOL&address=YOUR_ADDRESS
- 最低金额:约 30 美元
- 即时到账
选项 B:手动转账
- - 用户复制上述地址
- 从其钱包向您的 Fuego 地址发送 SOL
- 交易费用需要 SOL(每笔交易 0.001 SOL)
发送交易
使用 CLI - 这是推荐方式:
bash
fuego send <接收地址> <金额> --token USDC --yes
此单一命令:
- - 使用最新区块哈希构建交易
- 本地签名(零网络密钥暴露)
- 提交到链上并带有适当的错误处理
- 返回签名 + 浏览器链接
- 支持地址簿联系人
- 通过 --token 标志支持 SOL、USDC、USDT
示例:
bash
fuego send GvCoHGGBR97Yphzc6SrRycZyS31oUYBM8m9hLRtJT7r5 0.25 --token USDC --yes
通过 Jupiter 进行代币兑换
第 1 步:获取报价
在执行前始终向用户显示预期汇率:
bash
fuego quote --input BONK --output USDC --amount 100000
输出显示:
- - 输入金额(自动处理代币小数位)
- 预期输出金额
- 价格影响
- 路由详情
第 2 步:执行兑换
用户确认报价后:
bash
fuego swap --input BONK --output USDC --amount 100000 --slippage 1.0
参数:
- - --input - 输入代币符号(SOL、USDC、BONK 等)或铸币地址
- --output - 输出代币符号或铸币地址
- --amount - 代币单位金额(例如 100000 表示 100000 BONK)
- --slippage - 滑点容忍度百分比(默认:0.5%)
兑换脚本自动:
- - 从链上获取正确的代币小数位
- 使用 BigInt 确保精度(无浮点错误)
- 如果无法确定小数位则抛出错误(防止金额错误)
前提条件:
- - 必须在 ~/.fuego/config.json 中配置 Jupiter API 密钥
- 参见快速开始的第 4 步了解设置说明
代理就绪架构
代理/脚本
↓ POST /build-transfer-sol
Fuego 服务器 (localhost:8080)
• 使用最新区块哈希构建未签名交易
• 返回 base64 编码的交易 + 备注
↓ 未签名交易
代理/脚本
• 加载 ~/.fuego/wallet.json(简单 JSON,无需密码!)
• 本地签名交易
↓ 已签名交易
Fuego 服务器 (localhost:8080)
• POST /submit-transaction
• 广播到 Solana 主网
↓ 上链
Solana 网络
安全模型:
- - 私钥永不离开您的机器(所有转账的客户端签名)
- 文件权限提供真正的安全性(chmod 600)
- 无网络密钥暴露(仅本地主机服务器)
- 标准 Solana 格式(与 CLI 工具兼容)
一个例外 - x402 支付:
/x402-purch 端点内部处理完整的支付流程(包括签名),因为 x402 需要服务器端生成支付证明。这是一个有意的安全权衡:服务器仅临时访问私钥以签署特定的 x402 支付交易,然后立即从内存中清除。这使得在维护所有其他操作的本地优先架构的同时,实现无缝的代理购买。
API 参考
GET /wallet-address
动态获取本地钱包地址。
bash
curl http://127.0.0.1:8080/wallet-address
响应:
json
{
success: true,
data: {
address: DmFyLRiJtc4Bz75hjAqPaEJpDfRe4GEnRLPwc3EgeUZF,
network: mainnet-beta,
source: wallet
}
}
POST /balance - 检查 SOL 余额
bash
curl -X POST http://127.0.0.1:8080/balance \
-H Content-Type: application/json \
-d {network: mainnet-beta, address: YOUR_ADDRESS}
响应:
json
{
success: true,
data: {
sol: 1.234567890,
lamports: 1234567890,
network: mainnet-beta
}
}
POST /tokens - 检查所有代币余额
bash
curl -X POST http://127.0.0.1:8080/tokens \
-H Content-Type: application/json \
-d {network: mainnet-beta, address: YOUR_ADDRESS}
返回 SOL + 所有 SPL 代币余额(USDC、USDT、BONK 等)
POST /build-transfer-sol - 构建 SOL 转账
bash
curl -X POST http://127.0.0.1:8080/build-transfer-sol \
-H Content-Type: application/json \
-d {
network: mainnet-beta,
from
address: YOURADDRESS,
to
address: RECIPIENTADDRESS,
amount: 0.001,
yid: agent-transfer-123
}
响应:
json
{
success: true,
data: {
transaction: AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDAb...,
blockhash: J7rBdM33dHKtJwjp...AbCdEfGhIjKl,
memo: fuego|SOL|f:YOUR_ADDRESS|t:RECIPIENT|a:1000000|yid:agent-transfer-123|n:,
network: mainnet-beta
}
}
POST /build-transfer-usdc - 构建 USDC 转账
bash
curl -X POST http://127.0.0.1:8080/build-transfer-usdc \
-H Content-Type: application/json \
-d {
network: mainnet-beta,
from
address: YOURADDRESS,