设置代理钱包:安全配置 Uniswap 代理钱包 - Openclaw Skills

作者:互联网

2026-03-27

AI教程

什么是 设置代理钱包?

此技能简化了为在 Uniswap 上运行的自主代理设置加密钱包的复杂过程。它支持三个不同的安全级别:用于快速开发的 Privy、用于生产级 TEE 安全的 Turnkey,以及用于最高机构级保护的 Safe。通过自动化从创建到 Gas 充值的全生命周期,它确保您的 Openclaw Skills 驱动的代理在部署时已预置安全策略,包括支出限制和代币白名单。无论您是在沙箱中构建还是部署到生产环境,此技能都能处理密钥管理和网络初始化的繁重工作。

下载入口:https://github.com/openclaw/skills/tree/main/skills/wpank/setup-agent-wallet

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install setup-agent-wallet

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 setup-agent-wallet。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

设置代理钱包 应用场景

  • 为自主交易机器人初始化新的开发环境。
  • 将代理从开发沙箱过渡到生产环境。
  • 使用 Openclaw Skills 为单个代理身份配置多链钱包访问。
  • 对自主代理实施严格的安全策略,例如每日支出限制。
  • 跨多个区块链网络自动充值 Gas 代币。
设置代理钱包 工作原理
  1. 解析用户请求以识别所需的钱包提供商、目标链和安全参数。
  2. 将任务委托给具有指定参数的专业钱包配置代理。
  3. 通过选定的 API(Privy、Turnkey 或 Safe)配置钱包。
  4. 配置安全策略,包括单笔交易和每日支出限制。
  5. 在每个请求的区块链网络上为新钱包充值 Gas 代币。
  6. 通过验证余额和策略一致性来验证整个设置。
  7. 提供钱包配置和存储路径的详细摘要。

设置代理钱包 配置指南

确保在 Openclaw Skills 环境中配置了所选提供商(Privy、Turnkey 或 Safe)的环境变量。

# 通过 CLI 启动设置的示例
openclaw run setup-agent-wallet --provider turnkey --chains ethereum,base --spendingLimit "$500/day"

设置代理钱包 数据架构与分类体系

该技能在本地存储配置详细信息,并与提供商 API 交互以管理钱包生命周期。

属性 描述
地址 生成钱包的公开区块链地址
提供商 用于密钥管理的服务(Privy、Turnkey 或 Safe)
配置路径 保存的 JSON 配置文件路径:.uniswap/agent-wallet.json
策略 包含支出限制和代币白名单的结构化数据
name: setup-agent-wallet
description: Set up an agent wallet for Uniswap operations. Use when user needs to provision a wallet for an autonomous agent. Supports Privy (development), Turnkey (production), and Safe (maximum security). Configures spending limits, token allowlists, and funds the wallet for gas.
model: opus
allowed-tools: [Task(subagent_type:wallet-provisioner)]

Set Up Agent Wallet

Overview

Provision and configure a wallet for autonomous Uniswap agent operations. Supports three wallet providers at different security tiers. Handles the full lifecycle: provision wallet, configure safety policies, fund for gas, and validate the setup.

When to Use

Activate when the user says:

  • "Set up a wallet"
  • "Configure agent wallet"
  • "Provision wallet"
  • "Initialize wallet"
  • "Set up a wallet for my agent"
  • "Create a new agent wallet"

Parameters

Extract these from the user's request:

Parameter Required Default Description
provider No privy Wallet provider: privy (development), turnkey (production), or safe (maximum security)
chains No all Chains to configure — chain names or "all" for all supported chains
environment No development Either development or production
spendingLimit No $1000/day Daily spending limit (e.g., "$1000/day", "$500/day")

Provider Selection Guide

  • Privy: Best for development and testing. Fast setup, easy to manage. Not recommended for production with significant funds.
  • Turnkey: Production-grade key management with TEE (Trusted Execution Environment). Use for real trading with moderate funds.
  • Safe: Maximum security via multi-sig smart account. Use for high-value operations or institutional setups.

Workflow

  1. Parse user intent: Determine the wallet provider, target chains, environment, and spending limit from the user's request. Apply defaults for any unspecified parameters.

  2. Delegate to wallet-provisioner agent: Hand off the provisioning task with the extracted parameters. The agent handles the full setup pipeline:

    • Provision: Create the wallet via the selected provider's API
    • Configure policies: Set spending limits (per-tx and daily), token allowlists, and rate limits
    • Fund: Send gas tokens to the wallet on each requested chain
    • Validate: Confirm the wallet is operational by verifying balances and policy configuration
  3. Report results: Present the wallet setup summary to the user.

Agent Delegation

This skill delegates to the wallet-provisioner agent:

Task(subagent_type:wallet-provisioner)
  provider: 
  chains: 
  environment: 
  spendingLimit: 

The agent internally handles all provisioning steps and returns the final wallet configuration.

Output Format

Agent Wallet Configured

  Address:    0x1234...ABCD
  Provider:   Privy (development)
  Chains:     Ethereum, Base, Arbitrum
  Limits:     $1,000/day, $500/tx
  Allowlist:  USDC, WETH, UNI, ARB (4 tokens)
  Gas:        Funded on all 3 chains

  Config: .uniswap/agent-wallet.json

Error Handling

Error User-Facing Message Suggested Action
PROVIDER_AUTH_FAILED "Could not authenticate with [provider]. Check API keys." Verify provider credentials in environment variables
FUNDING_FAILED "Could not fund wallet on [chain]. Insufficient source balance." Fund the source wallet first
CHAIN_NOT_SUPPORTED "[chain] is not supported by [provider]." Choose a different chain or provider