fund-agent-wallet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOverview
概述
For an overview of the Circle CLI's full capability set — bridging, smart contract execution, x402 payment, and more — see the master skill. This skill is the narrower funding flow.
use-circle-cliFunding an agent wallet means putting USDC where the CLI can spend it. There are two balance pools to be aware of:
- On-chain (vanilla x402) — USDC sitting at the wallet address on a specific chain. Each chain is separate. Used to pay endpoints whose does not include
accepts[]. Settles in one block.GatewayWalletBatched - Nanopayments (powered by Gateway) — USDC held off-chain in your Circle Gateway balance, batched and settled for you across supported chains. Per source chain — no cross-chain pooling at payment time. Used to pay endpoints whose includes
accepts[]. Settles in <500ms once the balance exists.GatewayWalletBatched
This skill covers funding both pools. Pick the path with the shortest time-to-result and hide chain complexity from the user.
如需了解Circle CLI的完整功能集——跨链桥接、智能合约执行、x402支付等,请查看主技能。本技能聚焦于更细分的充值流程。
use-circle-cli为Agent钱包充值指的是将USDC存入CLI可支配的位置。需要注意两个余额池:
- 链上(标准x402)——存放在特定链上钱包地址的USDC,每条链相互独立。用于支付不包含
accepts[]的端点,在一个区块内完成结算。GatewayWalletBatched - 小额支付(由Gateway支持)——存放在Circle Gateway链下余额中的USDC,会在支持的链上批量为用户完成结算。按源链区分——支付时不支持跨链池化。用于支付包含
accepts[]的端点,余额到位后结算时间<500ms。GatewayWalletBatched
本技能涵盖为两个余额池充值的操作。选择能最快得到结果的路径,为用户屏蔽链上复杂度。
Prerequisites
前提条件
bash
undefinedbash
undefinedConfirm session is good
确认会话状态正常
circle wallet status
circle wallet status
Get the wallet address
获取钱包地址
circle wallet list --chain BASE --type agent --output json
circle wallet list --chain BASE --type agent --output json
Check current on-chain balance (per chain)
查看当前链上余额(按链区分)
circle wallet balance --address <addr> --chain BASE --output json
circle wallet balance --address <addr> --chain BASE --output json
Check current Gateway balance (per chain)
查看当前Gateway余额(按链区分)
circle gateway balance --address <addr> --chain BASE --output json
If `circle wallet status` errors with "Not logged in" or "Terms acceptance is required", hand off to the `use-agent-wallet` skill — it covers install, terms, login, and wallet creation.circle gateway balance --address <addr> --chain BASE --output json
如果`circle wallet status`返回“未登录”或“需要接受条款”错误,转至`use-agent-wallet`技能——该技能涵盖安装、条款接受、登录和钱包创建流程。Step 1 — Pick a funding path
步骤1——选择充值路径
Ask the user: "How would you like to fund your wallet?"
- Fiat (USD or local currency) — Buy USDC with a card or bank transfer via the CLI's built-in fiat on-ramp. Best for users who don't have crypto yet.
- Existing USDC — Send USDC from a wallet they already have (MetaMask, Coinbase, Phantom, etc.). Faster and free of on-ramp fees.
- Gateway deposit (advanced) — Move existing on-chain USDC into the Gateway balance for low-latency batched payments. Only useful if the seller they're paying supports Gateway on a specific chain.
Default recommendation: existing USDC → BASE. Fastest, lowest friction, and BASE is the most commonly accepted chain across the marketplace.
询问用户:“您希望通过哪种方式为钱包充值?”
- 法币(美元或本地货币)——通过CLI内置的法币入金通道,使用银行卡或银行转账购买USDC。最适合尚未持有加密货币的用户。
- 现有USDC——从用户已有的钱包(MetaMask、Coinbase、Phantom等)转入USDC。速度更快且无需入金手续费。
- Gateway存款(进阶)——将现有链上USDC转入Gateway余额,用于低延迟批量支付。仅当用户要支付的服务在特定链上支持Gateway时才有用。
默认推荐:现有USDC → BASE链。速度最快、操作摩擦最低,且BASE是市场上接受度最广的链。
Step 2 — Required flags for non-interactive use
步骤2——非交互模式所需的必填参数
The CLI prompts for missing values when run interactively. Agents are non-interactive, so every invocation against mainnet MUST include:
circle wallet fund- — wallet address from
--address <addr>circle wallet list - — e.g.
--chain <chain>BASE - — without it:
--method <fiat|crypto>Error: --method is required in non-interactive mode. - — USDC amount; without it:
--amount <number>Error: --amount is required.
--token usdc以交互模式运行CLI时,会提示用户补充缺失的值。Agent为非交互模式,因此针对主网的每一次调用必须包含:
circle wallet fund- ——来自
--address <addr>的钱包地址circle wallet list - ——例如
--chain <chain>BASE - ——缺少该参数会返回:
--method <fiat|crypto>Error: --method is required in non-interactive mode. - ——USDC金额;缺少该参数会返回:
--amount <number>Error: --amount is required.
--token usdcPath A — Fiat on-ramp
路径A——法币入金
Opens a fiat on-ramp window in the user's default browser. Funds deposit directly to the wallet on the selected chain.
bash
circle wallet fund --address <addr> --chain BASE --amount 25 --token usdc --method fiat --openThe user completes purchase in the on-ramp window. USDC arrives in the wallet on the selected chain after on-ramp settlement (typically minutes for card, longer for bank transfer).
Verify after the user reports purchase complete:
bash
circle wallet balance --address <addr> --chain BASE --output json在用户默认浏览器中打开法币入金窗口。资金将直接存入所选链上的钱包。
bash
circle wallet fund --address <addr> --chain BASE --amount 25 --token usdc --method fiat --open用户在入金窗口完成购买。USDC会在入金结算后到达所选链上的钱包(信用卡支付通常需数分钟,银行转账耗时更长)。
用户报告购买完成后进行验证:
bash
circle wallet balance --address <addr> --chain BASE --output jsonPath B — Crypto transfer (existing USDC)
路径B——加密货币转账(现有USDC)
The user already holds USDC somewhere (another wallet, an exchange, etc.) and wants to send it to the agent wallet.
用户已在其他地方持有USDC(另一个钱包、交易所等),想要将其转入Agent钱包。
Recommended — browser-rendered QR (best UX)
推荐方式——浏览器生成二维码(最佳用户体验)
bash
circle wallet fund --address <addr> --chain BASE --amount 10 --token usdc --method crypto --open--openThe user scans the QR with any mobile wallet (MetaMask, Coinbase Wallet, Rainbow, Phantom) and confirms the transfer.
bash
circle wallet fund --address <addr> --chain BASE --amount 10 --token usdc --method crypto --open--open用户使用任意移动钱包(MetaMask、Coinbase Wallet、Rainbow、Phantom)扫描二维码并确认转账。
Alternative — save the QR as a PNG file
替代方式——将二维码保存为PNG文件
bash
circle wallet fund --address <addr> --chain BASE --amount 10 --token usdc --method crypto --export ~/Downloadsbash
circle wallet fund --address <addr> --chain BASE --amount 10 --token usdc --method crypto --export ~/DownloadsAlternative — manual transfer (no QR)
替代方式——手动转账(无二维码)
Provide the user the raw transfer details:
- Destination: the wallet address from
circle wallet list - Token: USDC
- Network: BASE (chain ID 8453)
- USDC contract on BASE:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
For other chains, look up the USDC contract address at https://developers.circle.com/stablecoins/usdc-contract-addresses.
向用户提供原始转账详情:
- 收款地址:来自的钱包地址
circle wallet list - 代币:USDC
- 网络:BASE(链ID 8453)
- BASE链上的USDC合约地址:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
如需其他链的USDC合约地址,请访问https://developers.circle.com/stablecoins/usdc-contract-addresses。
Verify after transfer
转账后验证
bash
circle wallet balance --address <addr> --chain BASE --output jsonbash
circle wallet balance --address <addr> --chain BASE --output jsonPath C — Gateway deposit (powered by Gateway, advanced)
路径C——Gateway存款(由Gateway支持,进阶)
Only suggest a Gateway deposit when:
- The user has on-chain USDC, AND
- They want to pay a service whose includes
accepts[]on a specific chain, ANDGatewayWalletBatched - That chain is one Gateway supports (Polygon, BASE, ETH, ARB, OP, AVAX, UNI).
仅在以下所有条件满足时推荐Gateway存款:
- 用户持有链上USDC,且
- 用户想要支付的服务在特定链上的包含
accepts[],且GatewayWalletBatched - 该链是Gateway支持的链(Polygon、BASE、ETH、ARB、OP、AVAX、UNI)。
Eco vs direct — pick eco unless one of four conditions holds
Eco模式vs Direct模式——除非满足以下四个条件之一,否则优先选择Eco模式
circle gateway deposit --method ecopay --chain MATICUse only when:
--method direct- The user explicitly asked for direct — e.g. "deposit on BASE without going to Polygon", "stay on BASE", "use direct deposit". Implicit preferences and your own inferences do not count.
- The source chain isn't supported by eco — eco only supports BASE as a source today; check for the current list. Trying an unsupported source returns "Unknown method" or chain-not-supported.
circle gateway deposit --help - The seller does NOT accept Gateway on Polygon — verify by reading the seller's raw 402 (not
accepts[]). Eco lands on Polygon, so if the seller can't pay there, the Gateway balance won't be reachable for this payment.circle services inspect - The user already has vanilla on a fast chain the seller accepts — is ~8s and skips the eco fee. (e.g., user has 5 USDC vanilla on Polygon →
direct --chain <fast-chain>.)direct --chain MATIC
If none of conditions 1–4 holds, the answer is eco. Picking direct anyway costs the user 13–19 minutes of finality wait + gas vs eco's ~30-50s + $0.03.
circle gateway deposit --method ecopay --chain MATIC仅在以下情况使用:
--method direct- 用户明确要求使用direct模式——例如“在BASE链存款,不转至Polygon”、“留在BASE链”、“使用direct存款”。隐含偏好和推断均不算数。
- 源链不被eco模式支持——目前eco模式仅支持BASE作为源链;请查看获取当前支持列表。尝试不支持的源链会返回“Unknown method”或链不支持的错误。
circle gateway deposit --help - 收款方不接受Polygon链上的Gateway支付——需通过读取收款方原始402协议的(而非
accepts[])进行验证。Eco模式会将资金转入Polygon链,因此如果收款方无法在该链接收支付,Gateway余额将无法用于此次付款。circle services inspect - 用户已在收款方接受的快速链上持有标准USDC——耗时约8秒,且无需支付eco模式手续费。(例如,用户在Polygon链上持有5 USDC标准代币 → 使用
direct --chain <fast-chain>。)direct --chain MATIC
如果以上1-4条件均不满足,优先选择eco模式。若强行选择direct模式,用户需等待13-19分钟的最终确认时间并支付Gas费,而eco模式仅需约30-50秒加0.03美元手续费。
Compare per-workflow, not per-call
Eco存款(BASE → Polygon)
The cold-start cost of eco (~30-50s deposit + $0.03 fee) is paid once. After that, every Gateway-supported call is <500ms. Vanilla x402 has no deposit, but every call costs ~2s plus facilitator overhead, forever, with no amortization. Agentic workflows are almost never single-call. For any multi-call task, treat the deposit as wallet onboarding, not as a per-call optimization. Pure time breakeven lands at roughly N=7-13 calls (vanilla vs eco across the realistic timing range), but the immediate wins land at call 1: Gateway-only seller access, wallet onboarding for every future call (each <500ms), and amortizing a single $0.03 fee.
30 + 2N30-50 + 0.5Nbash
undefinedEco deposit (BASE → Polygon)
存款(--amount、--address、--chain、--method均为必填参数)
bash
undefinedcircle gateway deposit --amount 10 --address <addr> --chain BASE --method eco
Deposit (--amount, --address, --chain, --method are all required)
验证(Gateway余额的分链详情会显示Polygon链)
circle gateway deposit --amount 10 --address <addr> --chain BASE --method eco
circle gateway balance --address <addr> --chain BASE --output json
Verify (Gateway balance shows Polygon in the per-chain breakdown)
如果钱包尚未在目标链上使用过,首次在该链进行支付/转账时会部署智能合约账户(SCA)。目前没有专门的“部署”命令——请查看circle wallet --help
获取当前可用选项。
circle wallet --helpcircle gateway balance --address <addr> --chain BASE --output json
存款验证完成后,转至`pay-via-agent-wallet`技能进行实际支付——该技能负责`circle services pay`流程(包括允许工具白名单和注意事项)。
**常见错误:**当Gateway余额已转入Polygon链时,在`pay`调用中使用`--chain BASE`。`pay`调用中的链参数必须与余额所在链一致。If the wallet hasn't been used on the destination chain yet, the first
Direct存款(同链,BASE/ETH/L2链速度较慢)
payment / transfer on that chain will deploy it. There is no dedicated
—
"deploy" command — consult circle wallet --help
for current options.
circle wallet --help—
Once the deposit verifies, hand off to the `pay-via-agent-wallet` skill for the actual payment — that skill owns the `circle services pay` flow (including its allowed-tools whitelist and gotchas).
**Common mistake:** using `--chain BASE` on the `pay` call when the Gateway balance landed on Polygon. The chain on `pay` must match where the balance lives.bash
circle gateway deposit --amount <amount> --address <addr> --chain MATIC --method directDirect模式支持的链:BASE、MATIC、ETH、ARB、AVAX、OP、UNI。在快速链(MATIC、AVAX)上使用direct模式耗时约8秒。在慢速链(BASE、ETH、ARB、OP、UNI)上使用则需13-19分钟——几乎永远不如eco模式划算。
Direct deposit (same chain, slower for BASE/ETH/L2s)
从Gateway提取资金
bash
circle gateway deposit --amount <amount> --address <addr> --chain MATIC --method directSupported chains for direct: BASE, MATIC, ETH, ARB, AVAX, OP, UNI. Direct on fast chains (MATIC, AVAX) is ~8s. Direct on slow chains (BASE, ETH, ARB, OP, UNI) is 13–19 minutes — almost always the wrong choice over eco.
v1版本的仅支持同链提取——不支持跨链提取。如需跨链转移USDC,请先同链提取,再使用(Circle CLI内置的跨链转移命令)进行跨链操作。
circle gateway withdrawcircle bridge transferbash
circle gateway withdraw --amount <amount> --address <addr> --chain <CHAIN>运行查看当前可用参数。
circle gateway withdraw --helpWithdrawing from Gateway
故障排查
circle gateway withdrawcircle bridge transferbash
circle gateway withdraw --amount <amount> --address <addr> --chain <CHAIN>Run for current flags.
circle gateway withdraw --help| 错误信息 | 含义 | 解决方法 |
|---|---|---|
| 缺少 | 添加 |
| 缺少 | 添加 |
| 终端二维码被截断或无法扫描 | Agent UI无法可靠渲染二维码 | 添加 |
| 首次在该链进行交易——智能合约账户(SCA)需要部署 | 通过在该链上使用钱包执行任意真实交易触发部署——通常是本技能中的存款/转账步骤,或通过 |
| 所选链上USDC余额不足 | 检查两个余额池—— |
Eco存款已结算,但 | Eco模式将资金转入Polygon链,而非BASE链 | 使用 |
| 尝试使用 | v1版本仅支持同链提取——先同链提取,再使用 |
Troubleshooting
规则
| Error | What it means | Fix |
|---|---|---|
| Forgot | Re-run with |
| Forgot | Re-run with |
| Terminal QR truncated or unscannable | Agent UIs can't render QR codes reliably | Re-run with |
| First tx on this chain — SCA needs deployment | Trigger deployment by performing any real transaction from this wallet on this chain — typically the deposit / transfer step in this skill, or a normal payment via |
| Not enough USDC on the picked chain | Check both pools — |
Eco deposit settled but | Eco lands on Polygon, not BASE | Re-run |
| Tried | v1 is same-chain only — withdraw same-chain, then |
- 绝不要提示用户将USDC发送到您生成的地址。始终使用用户通过获取的自有钱包地址。
circle wallet list - 绝不要存储、记录或显示私钥。
- 调用时必须传入
circle wallet fund——Agent为非交互模式,CLI不会提示用户补充参数。--method <fiat|crypto> - 调用时必须传入
circle wallet fund——请先与用户确认金额。--amount <number> - 优先使用,而非在终端渲染二维码——终端二维码在Claude Code、Codex等Agent UI中会被截断,导致无法扫描。
--method crypto --open - 法币入金:使用,让入金页面在浏览器中加载。
--method fiat --open - 绝不要推荐Gateway eco存款,除非您已通过发现API或收款方原始402协议的确认目标服务在Polygon链上支持Gateway。
accepts[] - 绝不要将用户的全部标准代币余额存入Gateway。钱包需要保留一定的标准代币余量,以应对后续可能遇到的仅支持标准代币的收款方。
- 金额计算公式:,其中N为工作流的预期调用次数。通常保留约50%的标准代币作为软余量下限。Gateway有服务器端最低存款额限制;若建议金额低于该限制会返回错误,因此请将建议金额向上取整至最低存款额。运行
amount = max(价格 × N + 手续费 + 余量, Gateway最低存款额)查看当前限制范围。circle gateway deposit --help - 当所需金额远大于工作流总成本(例如:低价端点案例:0.0024美元/次 ×5=0.012美元,但Gateway最低存款额设定了下限)或超过用户指定的上限时,请在存款前告知用户。不要静默存入约为任务成本100倍的金额。
--max-amount - 在新链上的首次真实交易会部署智能合约账户(SCA)——目前没有专门的“部署”命令。若出现错误,请查看
Wallet not deployed获取当前可用选项。circle wallet --help - 必须使用与余额所在链匹配的参数。Eco模式将资金转入Polygon链 → 使用
--chain。Direct模式将资金留在源链 → 使用pay --chain MATIC。pay --chain <same> - Gateway在支付时不支持跨链转移。源链至关重要。
- 除非用户明确要求技术细节,否则为用户屏蔽链上相关细节。用户的需求是为钱包充值,不需要了解EVM最终性的相关知识。
Rules
参考链接
- NEVER prompt users to send USDC to addresses you generated. ALWAYS use the user's own wallet from .
circle wallet list - NEVER store, log, or display private keys.
- ALWAYS pass to
--method <fiat|crypto>— agents are non-interactive and the CLI will not prompt.circle wallet fund - ALWAYS pass to
--amount <number>— confirm the amount with the user first.circle wallet fund - ALWAYS prefer over rendering QR codes in the terminal — terminal QR codes get truncated inside Claude Code, Codex, and similar agent UIs and become unscannable.
--method crypto --open - For fiat: use so the on-ramp loads in the browser.
--method fiat --open - NEVER suggest a Gateway eco deposit unless you have verified the target service supports Gateway on Polygon via the discovery API or the seller's raw 402 .
accepts[] - NEVER deposit 100% of the user's vanilla balance into Gateway. The wallet needs vanilla headroom for vanilla-only sellers the user may hit next.
- Sizing formula: , where N is the workflow's expected call count. Typically reserve ~50% of vanilla as a soft headroom floor. Gateway enforces a server-side minimum deposit; sizing below it returns an error, so floor your suggestion to that minimum. Run
amount = max(price × N + fee + slack, Gateway minimum)for current bounds.circle gateway deposit --help - Surface to the user before depositing when the required amount is materially larger than the workflow's total cost (cheap-endpoint case: $0.0024/call × 5 = $0.012, but the Gateway minimum sets the floor) or above the user's stated cap. Don't silently deposit ~100× the task cost.
--max-amount - The first real transaction on a new chain deploys the SCA — there is no dedicated "deploy" command today. Consult for the current options if a
circle wallet --helperror appears.Wallet not deployed - ALWAYS use matching where the balance lives. Eco lands on Polygon →
--chain. Direct lands on the source chain →pay --chain MATIC.pay --chain <same> - Gateway does NOT do cross-chain transfers at payment time. Source chain matters.
- Abstract chain details from the user unless they explicitly want technical specifics. The user asked to fund the wallet; they don't need a tour of EVM finality.
- 完整充值指南(主网vs测试网、eco模式vs direct模式深度解析):https://agents.circle.com/skills/wallet-fund.md
- 各链USDC合约地址:https://developers.circle.com/stablecoins/usdc-contract-addresses.md
- Circle Gateway支持的链和最终确认时间:https://developers.circle.com/gateway/references/supported-blockchains
- Circle开发者文档:https://developers.circle.com/llms.txt
Reference Links
替代技能
- Full funding walkthrough (mainnet vs testnet, eco-vs-direct deep dive): https://agents.circle.com/skills/wallet-fund.md
- USDC contract addresses by chain: https://developers.circle.com/stablecoins/usdc-contract-addresses.md
- Circle Gateway supported chains and finality times: https://developers.circle.com/gateway/references/supported-blockchains
- Circle Developer Docs: https://developers.circle.com/llms.txt
在以下情况触发技能:
use-agent-wallet- 用户尚未登录CLI或未接受条款。
- 返回“未登录”或“需要接受条款”错误。
circle wallet status - 用户询问钱包设置、登录或会话状态相关问题——而非充值。
在以下情况触发技能:
pay-via-agent-wallet- 用户想要调用或付费使用x402付费服务。
- 充值已完成,用户准备使用市场服务。
- 用户提到、
circle services pay或任何“支付”相关请求。circle services search
在以下情况触发技能:
agent-wallet-policy- 用户想要在充值前设置消费限额(罕见——大多数用户先充值,后设置限额)。
- 用户提到单笔/每日/每周/每月限额、消费策略或钱包规则。
对于跨链USDC转移,Agent应直接使用****——它是Circle CLI的一部分,在上述“从Gateway提取资金”部分已有提及。
circle bridge transfer免责声明:本技能按“原样”提供,不提供任何担保,受Circle开发者条款约束,生成的输出可能包含错误和/或费用配置选项(包括支付给Circle的费用);更多详情请查看仓库README。
Alternatives
—
Trigger the skill instead when:
use-agent-wallet- The user has not yet logged in to the CLI or accepted Terms.
- errors with "Not logged in" or "Terms acceptance is required".
circle wallet status - The user is asking about wallet setup, login, or session state — not funding.
Trigger the skill instead when:
pay-via-agent-wallet- The user wants to call or pay for a paid x402 service.
- Funding has completed and the user is ready to use the marketplace.
- The user mentions ,
circle services pay, or any "pay for" prompt.circle services search
Trigger the skill instead when:
agent-wallet-policy- The user wants to set spending limits before funding (rare — most users fund first, set limits later).
- The user mentions per-tx / daily / weekly / monthly caps, spending policy, or wallet rules.
For cross-chain USDC moves the agent should use directly — it is part of the Circle CLI and is referenced in the "Withdrawing from Gateway" section above.
circle bridge transferDISCLAIMER: This skill is provided "as is" without warranties, is subject to the Circle Developer Terms, and output generated may contain errors and/or include fee configuration options (including fees directed to Circle); additional details are in the repository README.
—