360 Secure SkillHub
360 安全技能中心

Send USDC

该 Skill 指导使用 npx agnic 命令发送 USDC:先用 status 检查钱包状态与认证,再以金额和收款方(0x 地址或 ENS 名称)调用 send,默认 Base 网络,支持 --chain 与 --json;文档含金额格式说明、基础输入校验与常见错误处理。

agnicpay-prog
agnicpay-prog
热度 16.02
最近更新 2026-04-08 06:21:46
分类:自动化依赖:代码执行 / 第三方 API应用场景:财务

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add agnicpay-send-usdc
Metadata
name
send-usdc
description
Send USDC to an Ethereum address or ENS name. Use when you or the user want to send money, pay someone, transfer USDC, tip, donate, or send funds to a wallet address or .eth name. Covers phrases like "send $5 to", "pay 0x...", "transfer to vitalik.eth", "tip someone", "send USDC".
user-invocable
true
disable-model-invocation
false
allowed-tools
["Bash(npx agnic@latest status*)","Bash(npx agnic@latest send *)","Bash(npx agnic@latest balance*)"]

Sending USDC

Use the npx agnic@latest send command to transfer USDC from the wallet to any Ethereum address or ENS name on Base.

Confirm wallet is initialized and authed

npx agnic@latest status

If the wallet is not authenticated, refer to the authenticate-wallet skill.

Command Syntax

npx agnic@latest send <amount> <recipient> [--chain <chain>] [--json]

Arguments

Argument Description
amount Amount to send: '$1.00', 1.00, or atomic units (1000000 = $1). Always single-quote amounts that use $ to prevent bash variable expansion. If the number looks like atomic units (no decimal or > 100), treat as atomic units.
recipient Ethereum address (0x...) or ENS name (vitalik.eth)

Options

Option Description
--chain <name> Blockchain network (default: base)
--json Output result as JSON

Input Validation

Before constructing the command, validate all user-provided values to prevent shell injection:

  • amount: Must match ^\$?[\d.]+$ (digits, optional decimal point, optional $ prefix). Reject if it contains spaces, semicolons, pipes, backticks, or other shell metacharacters.
  • recipient: Must be a valid 0x hex address (^0x[0-9a-fA-F]{40}$) or an ENS name (^[a-zA-Z0-9.-]+\.eth$). Reject any value containing spaces or shell metacharacters.

Do not pass unvalidated user input into the command.

USDC Amounts

Format Example Description
Dollar prefix '$1.00', '$0.50' USD notation (single-quote the $)
Decimal 1.0, 0.50 Human-readable with decimal point
Whole number 5, 100 Interpreted as whole USDC tokens
Atomic units 500000 Large integers treated as atomic units

IMPORTANT: Always single-quote amounts that use $ to prevent bash variable expansion (e.g. '$1.00' not $1.00).

ENS Resolution

ENS names are automatically resolved to addresses via Ethereum mainnet. The command will:

  1. Detect ENS names (any string containing .eth)
  2. Resolve the name to an address
  3. Display both the ENS name and resolved address in the output

Examples

# Send $1.00 USDC to an address
npx agnic@latest send 1 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7

# Send $0.50 USDC to an ENS name
npx agnic@latest send 0.50 vitalik.eth

# Send with dollar sign prefix (note the single quotes)
npx agnic@latest send '$5.00' 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7

# Get JSON output
npx agnic@latest send 1 vitalik.eth --json

Prerequisites

  • Must be authenticated (npx agnic@latest status to check)
  • Wallet must have sufficient USDC balance (npx agnic@latest balance to check)

Error Handling

Common errors:

  • "Not authenticated" — Run npx agnic@latest auth login first
  • "Insufficient balance" — Check balance with npx agnic@latest balance
  • "Could not resolve ENS name" — Verify the ENS name exists
  • "Invalid recipient" — Must be valid 0x address or ENS name