Sending Tokens
Use the fdx call transferTokens command to transfer tokens from the wallet to any address on any supported EVM chain or Solana.
Confirm wallet is authenticated
CODEBLOCK0
If the wallet is not authenticated, refer to the authenticate skill.
Check Balance Before Sending
Always verify the wallet has sufficient balance before initiating a transfer:
CODEBLOCK1
Sending Tokens
CODEBLOCK2
Parameters
| Parameter | Required | Description |
|---|
| INLINECODE2 | Yes | Target blockchain (e.g. ethereum, polygon, base, solana) |
| INLINECODE7 |
Yes | Destination wallet address |
|
--amount | Yes | Amount to send (human-readable, e.g.
10,
0.5) |
|
--fromAccountAddress | No | Source account address (if wallet has multiple accounts) |
|
--tokenAddress | No | Token contract address (omit for native token like ETH or SOL) |
|
--memo | No | Optional memo or note for the transaction |
|
--maxPriorityFeePerGas | No | EVM gas tip override |
|
--maxFeePerGas | No | EVM max gas fee override |
Examples
Send native tokens
CODEBLOCK3
Send ERC-20 tokens
CODEBLOCK4
Send with memo
CODEBLOCK5
Flow
- 1. Check authentication with INLINECODE16
- Check balance with INLINECODE17
- Confirm the transfer details with the human (amount, recipient, chain, token)
- Execute with INLINECODE18
- Report the transaction result to the human
Important: Always confirm the recipient address and amount with your human before executing, especially for large amounts. Blockchain transactions are irreversible.
Prerequisites
- - Must be authenticated (
fdx status to check, see authenticate skill) - Wallet must have sufficient balance on the target chain
- If sending insufficient funds, suggest using the
fund-wallet skill
Error Handling
- - "Not authenticated" — Run
fdx setup first, or see authenticate skill - "Insufficient balance" — Check balance with
getWalletOverview; see fund-wallet skill - "Invalid recipient" — Verify the address format matches the target chain
发送代币
使用 fdx call transferTokens 命令将代币从钱包发送至任何支持的EVM链或Solana上的任意地址。
确认钱包已认证
bash
fdx status
如果钱包未认证,请参考 authenticate 技能。
发送前检查余额
发起转账前,务必确认钱包有足够余额:
bash
fdx call getWalletOverview --chainKey <链>
发送代币
bash
fdx call transferTokens \
--chainKey <链> \
--recipientAddress <地址> \
--amount <数量>
参数
| 参数 | 必填 | 说明 |
|---|
| --chainKey | 是 | 目标区块链(例如 ethereum、polygon、base、solana) |
| --recipientAddress |
是 | 目标钱包地址 |
| --amount | 是 | 发送数量(人类可读格式,例如 10、0.5) |
| --fromAccountAddress | 否 | 源账户地址(如果钱包有多个账户) |
| --tokenAddress | 否 | 代币合约地址(发送ETH或SOL等原生代币时省略) |
| --memo | 否 | 交易的可选备注或说明 |
| --maxPriorityFeePerGas | 否 | EVM Gas 小费覆盖值 |
| --maxFeePerGas | 否 | EVM 最大 Gas 费用覆盖值 |
示例
发送原生代币
bash
在以太坊上发送 0.1 ETH
fdx call transferTokens \
--chainKey ethereum \
--recipientAddress 0x1234...abcd \
--amount 0.1
在 Solana 上发送 1 SOL
fdx call transferTokens \
--chainKey solana \
--recipientAddress AbCd...1234 \
--amount 1
发送 ERC-20 代币
bash
在以太坊上发送 100 USDC(指定代币合约)
fdx call transferTokens \
--chainKey ethereum \
--recipientAddress 0x1234...abcd \
--amount 100 \
--tokenAddress 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
在 Base 上发送 50 USDC
fdx call transferTokens \
--chainKey base \
--recipientAddress 0x1234...abcd \
--amount 50 \
--tokenAddress 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
带备注发送
bash
fdx call transferTokens \
--chainKey ethereum \
--recipientAddress 0x1234...abcd \
--amount 10 \
--tokenAddress 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
--memo 支付发票 #42
流程
- 1. 使用 fdx status 检查认证状态
- 使用 fdx call getWalletOverview --chainKey <链> 检查余额
- 与用户确认转账详情(数量、接收地址、链、代币)
- 使用 fdx call transferTokens 执行转账
- 向用户报告交易结果
重要提示: 执行前务必与用户确认接收地址和数量,尤其是大额转账。区块链交易不可逆。
前置条件
- - 必须已认证(使用 fdx status 检查,参见 authenticate 技能)
- 钱包在目标链上必须有足够余额
- 如果余额不足,建议使用 fund-wallet 技能
错误处理
- - 未认证 — 先运行 fdx setup,或参见 authenticate 技能
- 余额不足 — 使用 getWalletOverview 检查余额;参见 fund-wallet 技能
- 无效接收地址 — 验证地址格式是否与目标链匹配