← 返回
未分类

Bounty Hunter Skill

Operate the Niuma Bounty task platform on XLayer testnet: query, post, join, submit, review tasks, bidding, balance check, and build unsigned transactions.
在XLayer测试网操作Niuma赏金任务平台:查询、发布、参与、提交、审核任务,竞价,余额查询,构建未签名交易。
futeyaoshi futeyaoshi 来源
未分类 clawhub v1.0.5 1 版本 100000 Key: 无需
★ 0
Stars
📥 396
下载
💾 1
安装
1
版本
#latest

概述

niuma-bounty

Niuma Bounty Platform skill — 操作 task.niuma.works 链上赏金任务平台(XLayer 测试网)。

支持:查询任务、发布任务、接单、提交工作、审核、招标竞价、余额查询、构建未签名交易。

环境要求

  • Node.js >= 18
  • 依赖:ethers@^6(已包含在 package.json)
  • 写操作需设置 NIUMA_WALLET_SECRET 环境变量

首次使用安装依赖:

cd SKILL_DIR && npm install

网络 & 合约地址

参数
----------
XLayer 测试网
Chain ID1952
RPChttps://xlayertestrpc.okx.com
浏览器https://www.oklink.com/xlayer-test
Core0x3E7765a23AEE412bfc36760Ec8Abb495fb5c6370
Bidding0xC917e6426608E1A7d0267b9346C9c70F97Cdb65B
QueryHelper0x45f390AC7459ab31a23f14513dEbE9a59Dc06826
NIUMA Token0x49ABB6BFFEce92EAd9E71BCA930Ac877ef71939D
Registry0x5d48C3c8F2D8854d444C9E94e09696c28748cfe8

完整地址见 references/contracts.json

Task 状态

状态含义
----------------
0Pending待审核
1Open开放接单
2InProgress进行中
3UnderReview待审核提交
4Completed已完成
5Disputed争议中
6Cancelled已取消
7Rejected已拒绝

Task 类型

类型说明
----------------
0Normal普通任务,先到先得
1Bidding招标任务,创建者选标

CLI 用法

SKILL_DIR = 本 SKILL.md 所在目录。

读操作(无需私钥)

# 查单个任务
node SKILL_DIR/scripts/niuma.js task <taskId>

# 活跃任务列表
node SKILL_DIR/scripts/niuma.js list [offset] [limit]

# 所有任务分页(含已结束)
node SKILL_DIR/scripts/niuma.js paginated [offset] [limit]

# 待审核任务
node SKILL_DIR/scripts/niuma.js pending [offset] [limit]

# 按状态查询 (status: 0-7)
node SKILL_DIR/scripts/niuma.js by-status <status> [offset] [limit]

# 按分类查询
node SKILL_DIR/scripts/niuma.js by-category <categoryId> [offset] [limit]

# 活跃任务数量
node SKILL_DIR/scripts/niuma.js count

# 用户任务
node SKILL_DIR/scripts/niuma.js user-tasks <walletAddress>

# 招标任务的所有竞价
node SKILL_DIR/scripts/niuma.js bids <taskId>

# 钱包余额
node SKILL_DIR/scripts/niuma.js balance <address>                     # OKB
node SKILL_DIR/scripts/niuma.js balance <address> <tokenAddress>      # ERC20

写操作(需要 NIUMA_WALLET_SECRET)

export NIUMA_WALLET_SECRET=0x你的私钥

发布任务

node SKILL_DIR/scripts/niuma.js create '<json>'

JSON 字段:

{
  "title": "任务标题",
  "description": "任务描述",
  "requirements": "完成要求",
  "taskType": 0,
  "bountyPerUser": "100",
  "maxParticipants": 5,
  "startTime": 1711900800,
  "endTime": 1712505600,
  "tokenAddress": "0x49ABB6BFFEce92EAd9E71BCA930Ac877ef71939D",
  "categoryId": 1
}
  • taskType: 0=普通,1=招标
  • tokenAddress: ERC20 地址;OKB 原生填 "0x0000000000000000000000000000000000000000" 或不填
  • 脚本自动检查 ERC20 allowance,不足时先 approve

接单(普通任务)

node SKILL_DIR/scripts/niuma.js join <taskId>
# 别名: participate

提交工作

node SKILL_DIR/scripts/niuma.js submit <taskId> <proofHash> [metadata]
# proofHash: 工作证明链接或 IPFS hash
# metadata: 附加说明(可选)

审核通过

node SKILL_DIR/scripts/niuma.js approve <taskId> <participantAddress>

批量审核通过

node SKILL_DIR/scripts/niuma.js batch-approve <taskId> '["0xaddr1","0xaddr2"]'

审核拒绝

node SKILL_DIR/scripts/niuma.js reject <taskId> <participantAddress> "拒绝原因"

取消任务

node SKILL_DIR/scripts/niuma.js cancel <taskId>

招标:提交竞价

node SKILL_DIR/scripts/niuma.js submit-bid <taskId> <bidAmount> "<proposal>" [contactInfo]
# bidAmount 单位 ether

招标:取消竞价

node SKILL_DIR/scripts/niuma.js cancel-bid <taskId>

招标:选择中标者

node SKILL_DIR/scripts/niuma.js select-bidder <taskId> <bidderAddress>

手动授权 ERC20

node SKILL_DIR/scripts/niuma.js approve-token <tokenAddress> <amount>

构建未签名交易(配合外部钱包 skill)

node SKILL_DIR/scripts/niuma.js build-tx <command> '<json args>'

支持命令:

  • createTask — 发布任务
  • participateTask — 接单
  • submitTask — 提交工作
  • approveSubmission — 审核通过
  • rejectSubmission — 审核拒绝
  • cancelTask — 取消任务
  • submitBid — 提交竞价
  • selectBidder — 选标
  • approveToken — ERC20 授权

示例:

# 构建接单交易(给外部钱包签名)
node SKILL_DIR/scripts/niuma.js build-tx participateTask '{"taskId": 3, "from": "0x你的地址"}'

# 构建提交工作交易
node SKILL_DIR/scripts/niuma.js build-tx submitTask '{"taskId": 3, "proofHash": "https://github.com/xxx/pr/1", "metadata": ""}'

返回:{unsignedTx: {to, data, chainId, gasPrice, nonce}}


与钱包 Skill 协作流程

  1. build-tx 构造 unsignedTx
  2. 传给钱包 skill 签名
  3. 钱包 skill 广播已签名交易
  4. 用浏览器确认:https://www.oklink.com/xlayer-test/tx/

常见错误

错误原因解决
------------------
NIUMA_WALLET_SECRET required未设私钥export NIUMA_WALLET_SECRET=0x...
insufficient allowanceERC20 未授权approve-token
Task does not existtaskId 不存在检查 id
Not task creator非创建者操作换正确钱包
Task not open状态不对task 查状态
API rate limit exceededRPC 限速稍等几秒重试,或设 NIUMA_RPC 换节点

版本历史

共 1 个版本

  • v1.0.5 当前
    2026-05-03 08:49 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,082 📥 811,905
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,228 📥 267,990
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,590