← 返回
开发者工具 中文

pocket-money

Give your AI agent crypto wallets on Base. Create purpose-specific wallets, ask your human to fund each one, check balances, and manage budgets. No accounts,...
在Base链上为AI代理创建加密钱包。创建专用钱包,要求用户充值,检查余额并管理预算。无需账户。
operator-auteng-ai
开发者工具 clawhub v2.0.0 1 版本 99892.7 Key: 无需
★ 0
Stars
📥 931
下载
💾 3
安装
1
版本
#latest

概述

Pocket Money — Fund Your Agent's Wallets

You have a tool that lets you create and manage crypto wallets (USDC on Base). Each wallet is a separate keypair with its own balance — create one per purpose or budget.

Package: @auteng/pocket-money — published by AutEng (source on GitHub).

Setup (first time only)

Install the pocket-money library:

npm install @auteng/pocket-money

Creating a Wallet

Create a named wallet for each purpose or budget:

import { wallet } from '@auteng/pocket-money';

const w = await wallet.create({ name: "feb-2026" });
console.log(w.address); // 0xABC123...

If a wallet with that name already exists on disk, it loads it. Each wallet is stored at .auteng/wallets/.json.

You can also create a quick default wallet:

const w = await wallet.create();

Network

// Base mainnet (default)
const w = await wallet.create({ name: "prod" });

// Base Sepolia testnet
const w = await wallet.create({ name: "test", network: "base-sepolia" });

Requesting Funding

When you need money, ask your human to fund a specific wallet:

I need $12 in USDC for today's tasks.

Please send USDC on **Base** to this address:
`0xABC123...` (wallet: "feb-2026")

You can send from Coinbase, an exchange, or any wallet that supports Base.

Be specific about:

  • How much you need and why (e.g., "$5 for API calls", "$20 for a batch processing job")
  • Which wallet (by name) so both you and your human can track budgets
  • The network: always Base (not Ethereum mainnet, not Arbitrum)
  • The token: USDC (not ETH, not other tokens)

Waiting for Funding

After asking, wait for the USDC to arrive:

await w.waitForFunding(12_000000n);
// Polls Base every 10s until >= 12 USDC is available

With a timeout:

await w.waitForFunding(12_000000n, { timeout: 120_000 });
// Throws after 2 minutes if balance < $12

Tell your human you're waiting — they may need a minute to complete the transfer.

Human Approval Before Spending

IMPORTANT: Before making any payment, you MUST:

  1. Tell your human exactly what you're about to spend and why
  2. Show the estimated cost
  3. Wait for explicit human approval before proceeding

Example:

I'd like to call an x402 API endpoint.

  Service: api.example.com/generate
  Cost:    ~$0.05 per request
  Wallet:  "feb-2026" ($0.98 remaining)

OK to proceed?

Never batch multiple paid operations without listing them first. If running a loop of paid calls, present the total estimated cost upfront and get approval for the batch.

Managing Wallets

// Retrieve an existing wallet by name
const w = wallet.get("feb-2026");

// List all wallets
const all = wallet.list();
for (const w of all) {
  const bal = await w.checkBalance();
  console.log(`${w.name}: ${w.address} — ${bal} USDC`);
}

// Check balance
const balance = await w.checkBalance();
// Returns USDC in minor units (6 decimals)
// e.g., 12_000000n = $12.00

If running low, ask your human for more funding before expensive operations.

Security & Storage

Private keys: Wallet private keys are stored as unencrypted JSON at .auteng/wallets/.json with restricted file permissions (0600). These keys can sign USDC payment authorizations. If the file is leaked or the machine is compromised, funds in that wallet can be stolen. Treat wallet files like passwords.

Network access: This skill makes outbound HTTPS requests to:

  • Base RPC (mainnet.base.org) — to check USDC balances

Mitigations:

  • Always get human approval before any operation that spends funds
  • Only fund wallets with small amounts appropriate for the task — treat them as petty cash, not savings
  • Create separate wallets for separate budgets so you and your human can track spending
  • Your wallets only need USDC on Base — no ETH needed for gas

版本历史

共 1 个版本

  • v2.0.0 当前
    2026-03-29 13:02 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,172
ai-intelligence

Markdown Publish & Share

operator-auteng-ai
使用 curl 发布 Markdown 并返回分享链接。支持包含 Mermaid 图表(如组件图、流程图和序列图)、KaTex 和代码块。AutEng 将返回已发布渲染文档的分享链接。适用于软件架构图、文档、数理推导及系统文档编写。
★ 0 📥 1,717
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,189