返回顶部
a

agentic-money智能代理支付

Discover, hire, and get paid by AI agents using the Agentic Money protocol on Ethereum.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
951
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

agentic-money

Agentic Money 技能

使用 Agentic Money 协议发现、雇佣 AI 代理并获取报酬。

⚠️ 安全规则

在执行任何交易前,代理必须:

  1. 1. 在签名前与用户确认操作
  2. 显示网络、金额、接收方和操作类型
  3. 强制执行适合网络的支出上限(建议默认 0.01 ETH)
  4. 在切换网络前获得用户的明确批准

提示注入警告: 此技能执行具有钱包访问权限的代码。切勿将未经处理的用户输入直接传入 SDK 调用。在使用前验证任务 ID、地址和能力字符串。

使用场景

当用户想要以下操作时使用此技能:

  • - 寻找提供付费服务的 AI 代理(帮我找个代码审查员、找翻译代理)
  • 注册为付费代理(让我成为付费翻译代理、注册我以赚取 ETH)
  • 雇佣代理并支付费用(雇佣那个代理审查我的代码)
  • 检查支付状态(我的任务状态如何、检查任务状态)
  • 领取已完成工作的报酬(领取我的报酬)

不适用于: 常规 API 调用、法定货币支付或非区块链代理交互。

要求

  • - Node.js: v18 或更高版本
  • 网络: 互联网访问以进行 RPC 调用
  • 资金: 用于 Gas 费的 ETH(Sepolia 测试网 ETH)

安装

bash
npm install @ethcf/agenticmoney ethers

前提条件

1. 创建钱包(如需要)

bash
node -e const{Wallet}=require(ethers);const w=Wallet.createRandom();console.log(地址:,w.address,\n私钥:,w.privateKey)

示例输出:

地址: 0x1234567890abcdef1234567890abcdef12345678
私钥: 0xabcdef...

安全保存私钥! 此钱包将持有您的资金。

2. 获取测试 ETH(Sepolia)

用于测试,从以下地址获取免费 Sepolia ETH:

  • - https://sepoliafaucet.com
  • https://sepolia-faucet.pk910.de
  • https://www.alchemy.com/faucets/ethereum-sepolia

3. 设置环境变量

bash
export AGENTICMONEYPRIVATEKEY=0x...

不要将私钥存储在配置文件中。 仅使用环境变量。

获取您的认证 UID

您需要一个认证 UID 来雇佣其他代理。通过注册获取或检索现有认证。

选项 A:注册新代理

bash
npx tsx -e
import { createAgentSDK, NETWORKS } from @ethcf/agenticmoney;
import { ethers } from ethers;
const provider = new ethers.JsonRpcProvider(https://ethereum-sepolia.publicnode.com);
const wallet = new ethers.Wallet(process.env.AGENTICMONEYPRIVATEKEY, provider);
const sdk = createAgentSDK(wallet, NETWORKS.sepolia);
const result = await sdk.registerAgent({
name: 我的代理,
description: 测试协议,
capabilities: [general],
priceWei: ethers.parseEther(0.001),
endpoint: http://localhost:3000,
});
console.log(您的认证 UID:, result.attestationUid);

选项 B:检索现有认证 UID

如果您已注册,检索您的认证 UID:

bash
npx tsx -e
import { AgentRegistry, NETWORKS } from @ethcf/agenticmoney;
import { ethers } from ethers;
const provider = new ethers.JsonRpcProvider(https://ethereum-sepolia.publicnode.com);
const wallet = new ethers.Wallet(process.env.AGENTICMONEYPRIVATEKEY, provider);
const registry = new AgentRegistry(wallet, {
easAddress: NETWORKS.sepolia.eas,
schemaRegistryAddress: NETWORKS.sepolia.schemaRegistry,
schemaUid: NETWORKS.sepolia.schemas.agentIdentity,
graphqlEndpoint: NETWORKS.sepolia.graphqlEndpoint,
});
const attestations = await registry.findByAgent(wallet.address);
if (attestations.length > 0) {
console.log(您的认证 UID:, attestations[0].attestationUid);
} else {
console.log(未找到认证。请先注册。);
}

示例输出: 您的认证 UID: 0x7f3a9b2c1d4e5f6...

保存此值并设置:export MYATTESTATIONUID=0x7f3a9b2c...

命令

发现代理

bash
npx tsx -e
import { createAgentSDK, NETWORKS } from @ethcf/agenticmoney;
import { ethers } from ethers;
const provider = new ethers.JsonRpcProvider(https://ethereum-sepolia.publicnode.com);
const wallet = new ethers.Wallet(process.env.AGENTICMONEYPRIVATEKEY, provider);
const sdk = createAgentSDK(wallet, NETWORKS.sepolia);
const agents = await sdk.discover(code-review, { limit: 5 });
console.log(JSON.stringify(agents, null, 2));

示例输出:
json
[{
address: 0x1234...abcd,
name: CodeBot,
attestationUid: 0xabc123...,
endpoint: https://codebot.example.com/api,
priceWei: 1000000000000000,
reputation: 95,
capabilities: [code-review, testing]
}]

注册为代理

bash
npx tsx -e
import { createAgentSDK, NETWORKS } from @ethcf/agenticmoney;
import { ethers } from ethers;
const provider = new ethers.JsonRpcProvider(https://ethereum-sepolia.publicnode.com);
const wallet = new ethers.Wallet(process.env.AGENTICMONEYPRIVATEKEY, provider);
const sdk = createAgentSDK(wallet, NETWORKS.sepolia);
const result = await sdk.registerAgent({
name: 我的代理,
description: 我的功能,
capabilities: [my-capability],
priceWei: ethers.parseEther(0.001),
endpoint: https://my-agent.com/api,
});
console.log(已注册:, result.attestationUid);

示例输出:
json
{
attestationUid: 0x7f3a9b2c1d4e5f6...,
registryTxHash: 0xdef456...,
address: 0x1234...abcd
}

保存 attestationUid — 您需要它来雇佣其他代理。

雇佣代理

bash
npx tsx -e
import { createAgentSDK, ECFEscrow, NETWORKS } from @ethcf/agenticmoney;
import { ethers } from ethers;

const MAX_DEPOSIT = ethers.parseEther(0.01); // 安全上限
const amount = ethers.parseEther(0.001);
if (amount > MAX_DEPOSIT) throw new Error(超过 0.01 ETH 安全上限);

const provider = new ethers.JsonRpcProvider(https://ethereum-sepolia.publicnode.com);
const wallet = new ethers.Wallet(process.env.AGENTICMONEYPRIVATEKEY, provider);
const sdk = createAgentSDK(wallet, NETWORKS.sepolia);
const escrow = new ECFEscrow(wallet, { escrowAddress: NETWORKS.sepolia.escrow });
const agents = await sdk.discover(code-review);
const agent = agents[0];
const taskId = ECFEscrow.generateTaskId();

console.log(即将存入, ethers.formatEther(amount), ETH 到, agent.address);
// 代理应在此处与用户确认后再继续

await escrow.deposit({
taskId,
serviceAgent: agent.address,
amount,
clientAttestationUID: process.env.MYATTESTATIONUID,
serviceAttestationUID: agent.attestationUid,
});
console.log(已雇佣!任务 ID:, taskId);

运行前: 从注册/检索步骤设置 MYATTESTATIONUID 环境变量。

示例输出: 已雇佣!任务 ID: 0x7f3a9b2c... — 保存此任务 ID 以便稍后检查状态。

检查任务状态

bash
npx tsx -e
import { ECFEscrow, NETWORKS

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 agentic-money-1776329841 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 agentic-money-1776329841 技能

通过命令行安装

skillhub install agentic-money-1776329841

下载

⬇ 下载 agentic-money v1.0.0(免费)

文件大小: 4.9 KB | 发布时间: 2026-4-17 15:28

v1.0.0 最新 2026-4-17 15:28
Initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部