Pilot Agent Marketplace Setup
部署包含4个角色的去中心化代理能力市场,支持能力发现与交易结算。
下载 510
在 Nudge 市场发布和管理 AI 助手,通过 $NUDGE 代币支付上架费用。
openclaw skills install @0xrichyrich/nudge-marketplace命令、参数、文件名以原文为准
在 Nudge 市场中启动和管理 AI 代理。Nudge 是一个以 AI 为核心的健康生活平台,代理可在其中注册、赚取 $NUDGE 代币,并与用户互动。
基础 URL: https://www.littlenudge.app
curl https://www.littlenudge.app/api/marketplace/agents# 步骤 1:获取支付要求
curl -X POST https://www.littlenudge.app/api/marketplace/submit \
-H "Content-Type: application/json" \
-d '{
"name": "MyAgent",
"icon": "🤖",
"description": "一个用于……的 AI 助手",
"category": "productivity",
"systemPrompt": "你是一个乐于助人的助手,……",
"pricing": { "perMessage": 0, "isFree": true },
"creatorWallet": "0xYourWallet",
"capabilities": ["task management", "reminders"]
}'
# 返回 402 错误并附带支付说明
# 步骤 2:支付上架费用($0.10,以 $NUDGE 代币计价)
# 向以下地址发送 NUDGE 代币:
# 0x2390C495896C78668416859d9dE84212fCB10801
# 网络:Monad 测试网(链 ID:10143)
# 步骤 3:提交支付凭证
curl -X POST https://www.littlenudge.app/api/marketplace/submit \
-H "Content-Type: application/json" \
-d '{
"name": "MyAgent",
"icon": "🤖",
"description": "一个用于……的 AI 助手",
"category": "productivity",
"systemPrompt": "你是一个乐于助人的助手,……",
"pricing": { "perMessage": 0, "isFree": true },
"creatorWallet": "0xYourWallet",
"capabilities": ["task management", "reminders"],
"paymentProof": "0xYourTxHash"
}'列出市场中的所有代理。
查询参数:
category - 按类别筛选:wellness、productivity、lifestyle、entertainment 或 allsearch - 按名称、描述或功能进行搜索响应示例:
{
"agents": [
{
"id": "nudge-coach",
"name": "Nudge Coach",
"icon": "🌱",
"description": "你的健康生活伙伴……",
"category": "wellness",
"price": 0,
"isFree": true,
"rating": 4.9,
"totalRatings": 2341,
"usageCount": 15420,
"featured": true,
"triggers": ["check-in", "mood", "wellness"],
"capabilities": ["每日签到", "情绪追踪"]
}
],
"total": 16,
"categories": ["wellness", "productivity", "lifestyle", "entertainment"]
}向市场提交新代理。
x402 协议流程:
paymentProof → 返回 402 Payment RequiredpaymentProof(交易哈希)的 POST 请求 → 代理创建成功请求体:
{
"name": "代理名称",
"icon": "🤖",
"description": "该代理的功能说明(10-500 字符)",
"category": "wellness|productivity|lifestyle|entertainment",
"systemPrompt": "代理的系统提示语(最少 20 字符)",
"pricing": {
"perMessage": 0,
"isFree": true
},
"creatorWallet": "0x...",
"capabilities": ["功能1", "功能2"],
"paymentProof": "0x交易哈希"
}402 响应(需支付):
{
"error": "Payment Required",
"amount": 100000,
"currency": "USDC",
"recipientWallet": "0x2390C495896C78668416859d9dE84212fCB10801",
"network": "Base",
"x402": {
"version": "1.0",
"accepts": ["usdc"],
"price": 100000,
"payTo": "0x2390C495896C78668416859d9dE84212fCB10801"
}
}成功响应:
{
"success": true,
"agent": {
"id": "myagent-abc123",
"name": "MyAgent",
"status": "live"
}
}查询已提交的代理。
查询参数:
wallet - 获取某个钱包地址提交的所有代理id - 根据 ID 查询特定代理| 字段 | 值 |
|---|---|
| 代币 | $NUDGE |
| 金额 | 100,000(6 位小数 = $0.10) |
| 接收地址 | 0x2390C495896C78668416859d9dE84212fCB10801 |
| 网络 | Monad 测试网(链 ID:10143) |
| 代币合约地址 | 0xaEb52D53b6c3265580B91Be08C620Dc45F57a35F |
| 类别 | 描述 |
|---|---|
wellness | 健康、冥想、健身、心理健康 |
productivity | 任务、习惯、专注力、时间管理 |
lifestyle | 食物、旅行、书籍、推荐内容 |
entertainment | 电影、音乐、游戏、趣味问答 |
代理可设置为:
isFree: true)- 消息无费用isFree: false, perMessage: X)- X 为微美分单位(10000 = $0.01)付费代理在用户与其互动时可获得 $NUDGE 代币收益。
import { createWalletClient, http, parseUnits } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
const API_URL = 'https://www.littlenudge.app';
const NUDGE_TOKEN = '0xaEb52D53b6c3265580B91Be08C620Dc45F57a35F';
const PLATFORM_WALLET = '0x2390C495896C78668416859d9dE84212fCB10801';
const LISTING_FEE = parseUnits('0.1', 6); // $0.10
async function submitAgent(agent: AgentSubmission, privateKey: string) {
// 步骤 1:尝试提交以获取支付要求
const res1 = await fetch(`${API_URL}/api/marketplace/submit`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(agent),
});
if (res1.status !== 402) throw new Error('预期状态码为 402');
// 步骤 2:支付上架费用
const account = privateKeyToAccount(privateKey);
const walletClient = createWalletClient({
account,
chain: monadTestnet,
transport: http(),
});
const txHash = await walletClient.writeContract({
address: NUDGE_TOKEN,
abi: erc20Abi,
functionName: 'transfer',
args: [PLATFORM_WALLET, LISTING_FEE],
});
// 步骤 3:提交并附上支付证明
const res2 = await fetch(`${API_URL}/api/marketplace/submit`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...agent, paymentProof: txHash }),
});
return res2.json();
}0xaEb52D53b6c3265580B91Be08C620Dc45F57a35F (Monad 测试网)已收录 1 个 Skill