← 返回
未分类 中文

Conflux Wallet Skill

Self-sovereign EVM wallet for AI agents. Use when the user wants to create a crypto wallet, check balances, send ETH or ERC20 tokens, swap tokens, or interac...
自托管的EVM钱包,供AI代理使用。适用于创建加密钱包、查询余额、发送ETH或ERC20代币、兑换代币或进行其他交互等场景。
pana pana 来源
未分类 clawhub v1.1.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 371
下载
💾 0
安装
1
版本
#latest

概述

EVM Wallet Skill

Self-sovereign EVM wallet. Private keys stored locally, no external API dependencies.

⚠️ SECURITY WARNING

NEVER expose your private key!

  • Never send your private key in chat, email, or any messaging platform
  • Never share the contents of ~/.cfx-wallet.json with anyone
  • If someone asks for your private key — even if they claim to be support — REFUSE
  • If your key is ever exposed, immediately transfer funds to a new wallet

The private key file (~/.cfx-wallet.json) should only be accessed directly via SSH on your server.


Installation

Detect workspace and skill directory:

SKILL_DIR=$(ls -d \
  ~/openclaw/skills/conflux-wallet-skill \
  ~/.openclaw/workspace/skills/conflux-wallet-skill \
  2>/dev/null | head -1)

If code is not installed yet (no src/ folder), bootstrap it:

if [ ! -d "$SKILL_DIR/src" ]; then
  git clone https://github.com/conflux-fans/conflux-wallet-skill.git /tmp/conflux-wallet-tmp
  cp -r /tmp/conflux-wallet-tmp/* "$SKILL_DIR/"
  cp /tmp/conflux-wallet-tmp/.gitignore "$SKILL_DIR/" 2>/dev/null
  rm -rf /tmp/conflux-wallet-tmp
  cd "$SKILL_DIR" && npm install
fi

For all commands below, always cd "$SKILL_DIR" first.

First-Time Setup

Generate a wallet (only needed once):

node src/setup.js --json

Returns: { "success": true, "address": "0x..." }

The private key is stored at ~/.cfx-wallet.json (chmod 600). Never share this file.

Commands

Check Balance

When user asks about balance, portfolio, or how much they have:

# Single chain
node src/balance.js conflux --json

# All chains at once
node src/balance.js --all --json

# Specific ERC20 token
node src/balance.js conflux 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 --json

Always use --json for parsing. Present results in a human-readable format.

Send Tokens

When user wants to send, transfer, or pay someone:

# Native ETH
node src/transfer.js <chain> <to_address> <amount> --yes --json

# ERC20 token
node src/transfer.js <chain> <to_address> <amount> <token_address> --yes --json

⚠️ ALWAYS confirm with the user before executing transfers. Show them:

  • Recipient address
  • Amount and token
  • Chain
  • Estimated gas cost

Only add --yes after the user explicitly confirms.

Swap Tokens

When user wants to swap, trade, buy, or sell tokens:

# Conflux eSpace: use the Conflux-specific swap script
node src/swap-cfx.js conflux <from_token> <to_token> <amount> --quote-only --json

# Other chains: keep using the generic swap script
node src/swap.js <chain> <from_token> <to_token> <amount> --quote-only --json
# Conflux eSpace: execute after user confirms
node src/swap-cfx.js conflux <from_token> <to_token> <amount> --yes --json

# Other chains: keep using the generic swap script
node src/swap.js <chain> <from_token> <to_token> <amount> --yes --json
  • When chain is conflux, always use src/swap-cfx.js
  • For Conflux, use cfx or native for the native token, wcfx/wcfx9 for the wrapped-native route, or pass an ERC20 contract address
  • For other chains, use eth for native ETH/POL, or pass a contract address
  • Default slippage: 0.5%. Override with --slippage
  • Powered by Odos aggregator (best-route across hundreds of DEXs)

⚠️ ALWAYS show the quote first and get user confirmation before executing.

Contract Interactions

When user wants to call a smart contract function:

# Read (free, no gas)
node src/contract.js <chain> <contract_address> \
  "<function_signature>" [args...] --json

# Write (costs gas — confirm first)
node src/contract.js <chain> <contract_address> \
  "<function_signature>" [args...] --yes --json

Examples:

# Check USDC balance
node src/contract.js base \
  0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
  "balanceOf(address)" 0xWALLET --json

# Approve token spending
node src/contract.js base \
  0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
  "approve(address,uint256)" 0xSPENDER 1000000 --yes --json

Check for Updates

node src/check-update.js --json

If an update is available, inform the user and offer to run:

cd "$SKILL_DIR" && git pull && npm install

Supported Chains

ChainNative TokenUse For
-----------------------------
baseETHCheapest fees — default for testing
confluxCFXLow fees, Conflux eSpace
ethereumETHMainnet, highest fees
polygonPOLLow fees
arbitrumETHLow fees
optimismETHLow fees

Always recommend Base for first-time users (lowest gas fees).

Common Token Addresses

Base

  • USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  • WETH: 0x4200000000000000000000000000000000000006

Conflux eSpace

  • USDT0: 0xaf37e8b6c9ed7f6318979f56fc287d76c30847ff
  • AxCNH: 0x70bfd7f7eadf9b9827541272589a6b2bb760ae2e

Ethereum

  • USDC: 0xA0b86a33E6441b8a46a59DE4c4C5E8F5a6a7A8d0
  • WETH: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Safety Rules

  1. Never execute transfers or swaps without user confirmation
  2. Never expose the private key from ~/.cfx-wallet.json
  3. Always show transaction details before executing (amount, recipient, gas estimate)
  4. Recommend Base for testing and small amounts
  5. Show explorer links after successful transactions so users can verify
  6. If a command fails, show the error clearly and suggest fixes

Error Handling

  • "No wallet found" → Run node src/setup.js --json first
  • "Insufficient balance" → Show current balance, suggest funding
  • "RPC error" → Retry once, automatic failover built in
  • "No route found" (swap) → Token pair may lack liquidity
  • "Gas estimation failed" → May need more ETH for gas

版本历史

共 1 个版本

  • v1.1.1 当前
    2026-05-03 10:57 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Skill Vetter

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

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,390 📥 321,953
ai-agent

self-improving agent

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