返回顶部
W

WalletPilot-7715钱包飞行员

Execute on-chain transactions with user-granted permissions. Built on MetaMask ERC-7715. No private keys, full guardrails.

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

WalletPilot-7715

WalletPilot-7715

通过MetaMask ERC-7715权限为AI代理赋予加密超能力。

概述

WalletPilot使AI代理能够使用MetaMask的ERC-7715权限标准执行链上交易。用户一次性授予限定范围的权限(支出限额、链限制),代理即可在这些限制内自由执行操作。

主要特性:

  • - 无需共享私钥——用户保留自己的MetaMask
  • 可配置防护栏(支出限额、链白名单)
  • 多链支持(以太坊、Polygon、Arbitrum、Optimism、Base)
  • 基于MetaMask官方智能账户工具包构建

设置

  1. 1. 在 walletpilot.xyz 获取API密钥
  2. 安装SDK:npm install @walletpilot/sdk

可用操作

connect

向用户请求钱包权限。

typescript
import { WalletPilot, PermissionBuilder } from @walletpilot/sdk;

const pilot = new WalletPilot({ apiKey: wp_... });

const permission = new PermissionBuilder()
.spend(USDC, 100, day) // 每天最多100 USDC
.spend(ETH, 0.1, day) // 每天最多0.1 ETH
.chains([1, 137, 42161]) // 以太坊、Polygon、Arbitrum
.expiry(30d) // 有效期30天
.build();

const { deepLink } = await pilot.requestPermission(permission);
console.log(用户应打开:, deepLink);

execute

使用已授予的权限执行交易。

typescript
const result = await pilot.execute({
to: 0x1234..., // 目标合约
data: 0xabcd..., // 调用数据(例如:兑换)
value: 0, // ETH金额(可选)
chainId: 1, // 链ID
});

console.log(交易哈希:, result.hash);

balance

检查代币余额(使用标准RPC,无需权限)。

typescript
import { createPublicClient, http } from viem;
import { mainnet } from viem/chains;

const client = createPublicClient({
chain: mainnet,
transport: http(),
});

const balance = await client.getBalance({ address: 0x... });

swap

通过DEX聚合器执行代币兑换。

typescript
// 从1inch、0x等获取兑换报价
const quote = await fetch(https://api.1inch.io/v5.0/1/swap?...);
const { tx } = await quote.json();

// 通过WalletPilot执行
await pilot.execute({
to: tx.to,
data: tx.data,
value: tx.value,
chainId: 1,
});

send

向地址发送代币。

typescript
import { encodeFunctionData, erc20Abi } from viem;

// 编码ERC20转账
const data = encodeFunctionData({
abi: erc20Abi,
functionName: transfer,
args: [0xRecipient..., 1000000n], // 1 USDC(6位小数)
});

await pilot.execute({
to: 0xUSDC_ADDRESS...,
data,
chainId: 1,
});

history

获取交易历史。

typescript
const state = pilot.getState();
console.log(活跃权限:, state.permissions);

// 或通过API
const response = await fetch(https://api.walletpilot.xyz/v1/tx/history/PERMISSION_ID, {
headers: { Authorization: Bearer wp_... },
});
const { data } = await response.json();
console.log(最近交易:, data);

权限类型

权限示例描述
spend{ token: USDC, limit: 100, period: day }每周期最大代币支出
chains
[1, 137, 42161] | 允许的链ID | | contracts | [0x...] | 允许的合约地址 | | expiry | 30d | 权限过期时间 |

支持的链

ID名称
以太坊1mainnet
Polygon
137 | polygon | | Arbitrum | 42161 | arbitrum | | Optimism | 10 | optimism | | Base | 8453 | base |

安全性

  • - 无私钥:用户通过MetaMask保持完全托管
  • 限定权限:代理只能在授予的限制内操作
  • 限时有效:权限自动过期
  • 可撤销:用户可随时撤销权限
  • 可审计:所有交易均记录并可查看

API参考

基础URL: https://api.walletpilot.xyz

端点方法描述
/v1/permissions/requestPOST请求新权限
/v1/permissions/:id
GET | 获取权限详情 |
| /v1/tx/execute | POST | 执行交易 |
| /v1/tx/:hash | GET | 获取交易状态 |

示例:DeFi代理

typescript
import { WalletPilot, PermissionBuilder } from @walletpilot/sdk;

async function defiAgent() {
const pilot = new WalletPilot({ apiKey: process.env.WALLETPILOT_KEY });

// 检查是否有活跃权限
const state = pilot.getState();

if (!state.connected) {
// 请求权限
const permission = new PermissionBuilder()
.spend(USDC, 500, day)
.chains([1, 42161])
.expiry(7d)
.description(DeFi交易代理)
.build();

const { deepLink } = await pilot.requestPermission(permission);
console.log(在MetaMask中批准:, deepLink);
return;
}

// 执行交易
const swapData = await getSwapQuote(USDC, ETH, 100);

await pilot.execute({
to: swapData.to,
data: swapData.data,
chainId: 1,
});

console.log(兑换已执行!);
}

链接

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 walletpilot-7715-1776365605 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 walletpilot-7715-1776365605 技能

通过命令行安装

skillhub install walletpilot-7715-1776365605

下载

⬇ 下载 WalletPilot-7715 v0.1.0(免费)

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

v0.1.0 最新 2026-4-17 15:09
Initial release of WalletPilot-7715.

- Enables permissioned on-chain transactions for agents using MetaMask ERC-7715, without sharing private keys.
- Users can grant granular spend limits, chain allowlists, and contract permissions.
- Supports actions: connect, execute transactions, query balance, swap tokens, send tokens, and fetch transaction history.
- Works across Ethereum, Polygon, Arbitrum, Optimism, and Base.
- Transactions are time-limited, revocable, and fully auditable.
- Includes SDK setup instructions and API reference.

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

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

p2p_official_large
返回顶部