运行时依赖
安装命令
点击复制本土化适配说明
BaoziClaw 安装说明: 安装命令:["openclaw skills install baozi-claw","clawhub install baozi-claw\n\n---\n\n## 🔨 Agora recrie o index.ts com mais tools:\n\n```bash\ncat > index.ts << 'EOF'\nimport { exec } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(exec);\n\nasync function callBaoziMCP(toolName: string, args: any = {}) {\n const command = `npx -y @baozi.bet/mcp-server --tool ${toolName} --args '${JSON.stringify(args)}'`;\n try {\n const { stdout, stderr } = await execAsync(command);\n if (stderr) console.error('Stderr:', stderr);\n return JSON.parse(stdout);\n } catch (error) {\n console.error(`Error calling ${toolName}:`, error);\n throw error;\n }\n}\n\nexport const tools = [\n {\n name: 'list-markets',\n description: 'List active prediction markets on Baozi with optional filters (layer, status, query)',\n parameters: { type: 'object', properties: { layer: { type: 'string' }, status: { type: 'string' }, query: { type: 'string' } } },\n handler: async (args: any) => callBaoziMCP('list_markets', args)\n },\n {\n name: 'get-odds',\n description: 'Get odds, implied probabilities, and pool sizes for a specific market',\n parameters: { type: 'object', properties: { marketId: { type: 'string' } }, required: ['marketId'] },\n handler: async (args: any) => callBaoziMCP('get_quote', { market: args.marketId })\n },\n {\n name: 'place-bet',\n description: 'Place a bet on a market outcome using SOL',\n parameters: { type: 'object', properties: { marketId: { type: 'string' }, outcome: { type: 'boolean' }, amount: { type: 'number' } }, required: ['marketId', 'outcome', 'amount'] },\n handler: async (args: any) => callBaoziMCP('build_bet_transaction', args)\n },\n {\n name: 'get-portfolio',\n description: 'View all positions and bets for a wallet address',\n parameters: { type: 'object', properties: { wallet: { type: 'string' } }, required: ['wallet'] },\n handler: async (args: any) => callBaoziMCP('get_portfolio', { wallet: args.wallet })\n },\n {\n name: 'claim-winnings',\n description: 'Claim SOL winnings from resolved markets',\n parameters: { type: 'object', properties: { marketId: { type: 'string' } }, required: ['marketId'] },\n handler: async (args: any) => callBaoziMCP('build_claim_transaction', { market: args.marketId })\n }\n];\n\nconsole.log('✅ BaoziClaw:', tools.length, 'prediction market tools loaded');"]
技能文档
BaoziClaw 是一个全面的 OpenClaw 技能,提供对 Solana 上 Baozi 预测市场的完全访问。代理可以浏览市场、分析赔率、下注、管理投资组合、领取奖金 —— 所有这些都通过自然语言实现。
功能
市场发现:列出活动市场,带有筛选器(热门、新、趋势)
赔率分析:获取实时概率和池大小
投注:在布尔或赛事结果上下注 SOL
投资组合管理:检查任何钱包的仓位
奖金领取:自动领取已解决市场的奖金
市场创建:创建新的 Lab 市场(需要创建者配置文件)
工具
工具描述
list-markets 浏览活动预测市场
get-odds 获取赔率、池和隐含概率
place-bet 在任何市场结果上下注
get-portfolio 查看钱包的仓位
claim-winnings 从已解决的市场领取奖金
create-market 创建新的 Lab 市场
安装
clawhub install baozi-claw
##
重新创建 index.ts,添加更多工具:
``bash
cat > index.ts << 'EOF'
import { exec } from 'child_process';
import { promisify } from 'util';
const execAsync = promisify(exec);
async function callBaoziMCP(toolName: string, args: any = {}) {
const command = npx -y @baozi.bet/mcp-server --tool ${toolName} --args '${JSON.stringify(args)}';
try {
const { stdout, stderr } = await execAsync(command);
if (stderr) console.error('Stderr:', stderr);
return JSON.parse(stdout);
} catch (error) {
console.error(Error calling ${toolName}:`, error);
throw error;
}
}
export const tools = [
{
name: 'list-markets',
description: '列出 Baozi 上的活动预测市场,带有可选筛选器(层、状态、查询)',
parameters: {
type: 'object',
properties: {
layer: { type: 'string' },
status: { type: 'string' },
query: { type: 'string' }
}
},
handler: async (args: any) => callBaoziMCP('list_markets', args)
},
{
name: 'get-odds',
description: '获取特定市场的赔率、隐含概率和池大小',
parameters: {
type: 'object',
properties: {
marketId: { type: 'string' }
},
required: ['marketId']
},
handler: async (args: any) => callBaoziMCP('get_quote', { market: args.marketId })
},
{
name: 'place-bet',
description: '使用 SOL 在市场结果上下注',
parameters: {
type: 'object',
properties: {
marketId: { type: 'string' },
outcome: { type: 'boolean' },
amount: { type: 'number' }
},
required: ['marketId', 'outcome', 'amount']
},
handler: async (args: any) => callBaoziMCP('build_bet_transaction', args)
},
{
name: 'get-portfolio',
description: '查看钱包地址的所有仓位和投注',
parameters: {
type: 'object',
properties: {
wallet: { type: 'string' }
},
required: ['wallet']
},
handler: async (args: any) => callBaoziMCP('get_portfolio', { wallet: args.wallet })
},
{
name: 'claim-winnings',
description: '从已解决的市场领取 SOL 奖金',
parameters: {
type: 'object',
properties: {
marketId: { type: 'string' }
},
required: ['marketId']
},
handler: async (args: any) => callBaoziMCP('build_claim_transaction', { market: args.marketId })
}
];
console.log(' BaoziClaw:', tools.length, '预测市场工具已加载');