Sending Tokens on OpenAnt
Use the npx @openant-ai/cli@latest CLI to transfer tokens on Solana or Base. Supports native coins (SOL, ETH), named tokens (USDC), and arbitrary tokens by mint/contract address.
Always append --json to every command for structured, parseable output.
Confirm Authentication and Balance
CODEBLOCK0
If not authenticated, refer to the authenticate-openant skill. If balance is insufficient, inform the user.
Command Syntax
CODEBLOCK1
Arguments
| Argument | Description |
|---|
| INLINECODE3 | Target chain: solana (or sol), base (or eth) |
| INLINECODE8 |
Token:
sol,
eth,
usdc, or a mint/contract address |
|
amount | Amount in display units (e.g.
10 = 10 USDC,
0.5 = 0.5 SOL) |
|
to | Destination address (Solana pubkey or EVM 0x address) |
Options
| Option | Description |
|---|
| INLINECODE16 | Machine-readable JSON output |
| INLINECODE17 |
Override the default RPC URL for the chain |
Supported Chains and Tokens
| Chain | Named tokens | Native coin |
|---|
| INLINECODE18 / INLINECODE19 | INLINECODE20 , or any SPL mint address | INLINECODE21 |
| INLINECODE22 / INLINECODE23 |
usdc, or any ERC20 contract address |
eth |
For arbitrary tokens, pass the mint address (Solana) or contract address (Base) directly as the token argument.
Examples
Send native SOL
CODEBLOCK2
Send USDC on Solana
CODEBLOCK3
Send ETH on Base
CODEBLOCK4
Send USDC on Base
CODEBLOCK5
Send arbitrary SPL token by mint address
CODEBLOCK6
Send arbitrary ERC20 on Base by contract address
CODEBLOCK7
Natural Language Mapping
When the user says something like:
- - "帮我 base 上转 10 usdc 给 0xAbc..." → INLINECODE27
- "帮我 solana 上转 1.5 sol 给 7xK..." → INLINECODE28
- "Send 50 USDC to 0xDef... on Base" → INLINECODE29
- "Transfer 0.1 ETH to 0x123..." → INLINECODE30
- "帮我 solana 上转 10 给 " → INLINECODE31
Extract: chain, token (name or address), amount, and destination address.
Autonomy
Token transfers are irreversible. Always confirm with the user before executing:
- 1. Verify the chain, token, amount, and destination address with the user
- Check wallet balance first to ensure sufficient funds
- Only execute after explicit user confirmation
Read-only commands (status, wallet balance, wallet addresses) can be executed immediately.
NEVER
- - NEVER send without the user explicitly confirming the destination address — blockchain transfers are irreversible. Show the full address and ask the user to verify it before executing.
- NEVER send Solana tokens to a Base address, or vice versa — the chains are incompatible. Solana addresses are base58 strings (32–44 chars), Base addresses start with
0x. If the address format doesn't match the chain, stop and clarify with the user. - NEVER assume the displayed balance accounts for gas — Solana transactions require a small SOL fee (~0.000005 SOL); Base transactions require ETH for gas. If the user is sending their entire balance, leave a small reserve or the transaction will fail.
- NEVER infer the chain from the token alone — USDC exists on both Solana and Base. Always confirm which chain the user intends before sending.
- NEVER send to an address the user typed casually without double-checking — if the user typed the address in the middle of a sentence or abbreviated it, ask them to paste the full address again to confirm.
Prerequisites
- - Must be authenticated (
npx @openant-ai/cli@latest status --json) - Wallet must have sufficient balance for the transfer plus gas/fees
- For SPL token transfers, the sender must hold the token
Error Handling
- - "No Turnkey credentials found" — Run
authenticate-openant skill first - "Insufficient balance" / "Attempt to debit" — Wallet lacks funds; check INLINECODE38
- "Unknown chain" — Supported:
sol, base, INLINECODE41 - "No Base wallet found" / "No Solana wallet found" — Re-login to provision wallets
- "Cannot read decimals for mint" — Invalid or non-existent token mint address
- Transaction simulation failed — Check balance and recipient address validity
在OpenAnt上发送代币
使用 npx @openant-ai/cli@latest CLI 在 Solana 或 Base 上转移代币。支持原生币(SOL、ETH)、命名代币(USDC)以及通过铸币/合约地址指定的任意代币。
始终在每条命令后附加 --json 以获得结构化、可解析的输出。
确认身份验证和余额
bash
npx @openant-ai/cli@latest status --json
npx @openant-ai/cli@latest wallet balance --json
如果未通过身份验证,请参考 authenticate-openant 技能。如果余额不足,请告知用户。
命令语法
bash
npx @openant-ai/cli@latest wallet send [--json] [--rpc ]
参数
| 参数 | 描述 |
|---|
| chain | 目标链:solana(或 sol)、base(或 eth) |
| token |
代币:sol、eth、usdc,或铸币/合约地址 |
| amount | 显示单位的数量(例如 10 = 10 USDC,0.5 = 0.5 SOL) |
| to | 目标地址(Solana 公钥或 EVM 0x 地址) |
选项
| 选项 | 描述 |
|---|
| --json | 机器可读的 JSON 输出 |
| --rpc <url> |
覆盖链的默认 RPC URL |
支持的链和代币
| 链 | 命名代币 | 原生币 |
|---|
| solana / sol | usdc,或任意 SPL 铸币地址 | sol |
| base / eth |
usdc,或任意 ERC20 合约地址 | eth |
对于任意代币,直接将铸币地址(Solana)或合约地址(Base)作为 token 参数传入。
示例
发送原生 SOL
bash
npx @openant-ai/cli@latest wallet send solana sol 1.5 7xKabc123... --json
-> { success: true, data: { chain: solana, txSignature: 5xYz... } }
在 Solana 上发送 USDC
bash
npx @openant-ai/cli@latest wallet send solana usdc 100 7xKabc123... --json
-> { success: true, data: { chain: solana, txSignature: 3aBc... } }
在 Base 上发送 ETH
bash
npx @openant-ai/cli@latest wallet send base eth 0.05 0xAbCdEf... --json
-> { success: true, data: { chain: base, txHash: 0x1a2b... } }
在 Base 上发送 USDC
bash
npx @openant-ai/cli@latest wallet send base usdc 50 0xAbCdEf... --json
-> { success: true, data: { chain: base, txHash: 0x9f8e... } }
通过铸币地址发送任意 SPL 代币
bash
npx @openant-ai/cli@latest wallet send solana 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU 25 7xKabc123... --json
在 Base 上通过合约地址发送任意 ERC20 代币
bash
npx @openant-ai/cli@latest wallet send base 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 10 0xAbCdEf... --json
自然语言映射
当用户说类似:
- - 帮我 base 上转 10 usdc 给 0xAbc... → wallet send base usdc 10 0xAbc... --json
- 帮我 solana 上转 1.5 sol 给 7xK... → wallet send solana sol 1.5 7xK... --json
- Send 50 USDC to 0xDef... on Base → wallet send base usdc 50 0xDef... --json
- Transfer 0.1 ETH to 0x123... → wallet send base eth 0.1 0x123... --json
- 帮我 solana 上转 10 address> 给 → wallet send solana address> 10 --json
提取:链、代币(名称或地址)、数量和目标地址。
自主性
代币转账不可逆。 在执行前始终与用户确认:
- 1. 与用户核实链、代币、数量和目标地址
- 首先检查钱包余额以确保资金充足
- 仅在用户明确确认后执行
只读命令(status、wallet balance、wallet addresses)可以立即执行。
绝对禁止
- - 绝对不要在用户未明确确认目标地址的情况下发送 — 区块链转账不可逆。显示完整地址并要求用户在执行前进行验证。
- 绝对不要将 Solana 代币发送到 Base 地址,反之亦然 — 链不兼容。Solana 地址是 base58 字符串(32-44 个字符),Base 地址以 0x 开头。如果地址格式与链不匹配,停止并向用户澄清。
- 绝对不要假设显示的余额已考虑燃料费 — Solana 交易需要少量 SOL 费用(约 0.000005 SOL);Base 交易需要 ETH 作为燃料费。如果用户要发送全部余额,请保留少量储备,否则交易将失败。
- 绝对不要仅从代币推断链 — USDC 同时存在于 Solana 和 Base 上。在发送前始终确认用户意图使用的链。
- 绝对不要向用户随意输入的地址发送而不再次核实 — 如果用户在句子中间输入了地址或进行了缩写,要求他们再次粘贴完整地址以确认。
前提条件
- - 必须通过身份验证(npx @openant-ai/cli@latest status --json)
- 钱包必须有足够的余额用于转账及燃料费/手续费
- 对于 SPL 代币转账,发送方必须持有该代币
错误处理
- - 未找到 Turnkey 凭证 — 首先运行 authenticate-openant 技能
- 余额不足 / 尝试扣款 — 钱包资金不足;检查 wallet balance
- 未知链 — 支持的链:sol、base、eth
- 未找到 Base 钱包 / 未找到 Solana 钱包 — 重新登录以配置钱包
- 无法读取铸币的小数位数 — 无效或不存在的代币铸币地址
- 交易模拟失败 — 检查余额和接收方地址的有效性