Repository navigation
docs(agents): add a page for giving an agent a wallet and test funds - #2396
Conversation
palango
left a comment
There was a problem hiding this comment.
This is the page #2263 asked for, and the facts I checked hold up. The faucet page says 1 CELO per unauthenticated request and points to faucet.circle.com for USDC, Circle's faucet lists Celo Sepolia, Circle's Celo Sepolia USDC returns decimals 6 on-chain, and forno returns chain ID 11142220.
I ran both scripts with viem 2.55.10 on Node 24. generate-key.mjs works, and first-transfer.mjs imports celoSepolia and prints the balance. With an unfunded key it fails at gas estimation, and the details contain "insufficient funds for gas * price + value", so the first troubleshooting row matches. I didn't do a funded run, so the Status: success path is still untested. Could you request faucet CELO and run it once before merge, per AGENTS.md section 5?
A few fixes inline: the Node 18 prerequisite doesn't work with --env-file, the opening claim about AGENT_PRIVATE_KEY doesn't match the pages that use it, the Celina bullet says the opposite of the Celina page, and the closing section should be Related.
This conflicts with #2395 in docs.json, since both add a line after use-docs-with-ai, so whichever lands second needs a one-line rebase. It merges cleanly with #2397 and #2398.
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node.js 18 or later |
There was a problem hiding this comment.
node --env-file (line 68) arrived in Node 20.6.0, so the run command fails on Node 18, which is also EOL. Could this say Node.js 20.6 or later?
| description: Create an account for an agent, fund it on Celo Sepolia and send a first transfer before you wire it into x402 or MPP | ||
| --- | ||
|
|
||
| This page is for agent developers who need an account their agent can sign with and some test funds. It ends with a transfer on Celo Sepolia, the testnet, so you know the account works before you add payments. Every example in the agents section that reads `AGENT_PRIVATE_KEY` assumes you have done this. |
There was a problem hiding this comment.
This isn't true for the pages that read AGENT_PRIVATE_KEY. Only two do: overview.mdx:89 runs on mainnet (chain: celo), so a Celo Sepolia key won't work there, and self-agent-id.mdx gets its key from self-agent register export. x402 and MPP use other variable names. I'd drop the sentence or say the account works wherever an agent page asks for a key on Celo Sepolia.
| - [x402](/build/agents/x402) - charge or pay per request with this account | ||
| - [MPP](/build/agents/mpp) - the same flow through the Celo facilitator | ||
| - [Fee abstraction for agents](/build/agents/overview#fee-abstraction-for-agents) - pay gas in a stablecoin so the account needs no CELO | ||
| - [Celina](/build/agents/mcp/celina) - give an LLM a wallet through a tool instead of a key you manage |
There was a problem hiding this comment.
Celina's signing MCP server holds a key too (celina.mdx:14: "holds a key and can sign writes"). Maybe "expose balances and transfers to an LLM as MCP tools".
| | `Balance: 0 CELO` after the faucet | The faucet sent funds to a different address, or to mainnet | Check the address and that you are on Celo Sepolia, not Celo mainnet | | ||
| | USDC transfer amount is off by a factor of 10^12 | USDC has 6 decimals and CELO has 18 | Use `parseUnits("1", 6)` for USDC and `parseEther` for CELO | | ||
|
|
||
| ## Next steps |
There was a problem hiding this comment.
AGENTS.md section 3 closes guides with ## Related. The bullets already have that format, so a rename is enough.
| | Symptom | Cause | Fix | | ||
| |---------|-------|-----| | ||
| | `insufficient funds for gas` | The account has no CELO on Celo Sepolia | Request CELO from the faucet, then check the balance | | ||
| | `Balance: 0 CELO` after the faucet | The faucet sent funds to a different address, or to mainnet | Check the address and that you are on Celo Sepolia, not Celo mainnet | |
There was a problem hiding this comment.
The Celo Sepolia faucet can't send to mainnet. The likely cause is the script or explorer pointing at mainnet, which the Fix column already covers. Suggest "The faucet sent funds to a different address, or you are reading the balance on Celo mainnet".
|
|
||
| This script reads the balance and sends a small amount of CELO to another address. Replace the recipient with an address you control. | ||
|
|
||
| ```ts |
There was a problem hiding this comment.
Nit: both blocks are plain JavaScript in .mjs files, so per AGENTS.md section 5 the tag should be js, not ts. Same at line 18.
…2263) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ecda59c to
32cd735
Compare
|
Rebased and fixed: Node.js 20.6 or later, |
palango
left a comment
There was a problem hiding this comment.
Thanks, all six inline points are fixed in 32cd735.
On the funded run: nobody could get past the faucet captcha from a script, so I ran both blocks against an anvil fork of Celo Sepolia instead. I changed only the transport URL and the recipient, and funded the generated account with 1 CELO. It printed Balance: 1 CELO and Status: success, and the earlier unfunded run on the live chain matched the first troubleshooting row. That's enough for me. Could you update the Verification section of the PR body? It still says the scripts were never run.
The docs.json conflict with #2395 is still there. Both PRs add a line after use-docs-with-ai, so whichever lands second needs a one-line rebase. #2397 and #2398 still merge cleanly.
|
Updated the Verification section of the PR body to describe the unfunded live run and the anvil-fork funded run from review, and to say a funded transfer on live Celo Sepolia was not run. Nothing else changed in the branch. |
|
Ran |
Part of #2263 (first of up to three PRs; the x402 clarifications and jargon pass follow separately).
The agent pages read
AGENT_PRIVATE_KEYfrom the environment, but no page said where the key comes from or how to fund it on testnet. This adds that page.Changes
build/agents/agent-wallet.mdx: generate an account with viem, get CELO from the Celo Sepolia faucet and USDC from the Circle faucet, send a first transfer, with a short troubleshooting table.use-docs-with-ai.build/agents/overviewand from the Celo Sepolia bullet on the x402 page.#2395 adds its nav entry on the same
docs.jsonline, so whichever of the two merges second needs a one-line rebase.Verification
npx mint broken-links: no broken links found.python3 scripts/check_redirects.py: no redirect problems found.generate-key.mjsworks andfirst-transfer.mjsprints the balance, then fails at gas estimation with "insufficient funds for gas * price + value", which matches the first troubleshooting row.Balance: 1 CELOandStatus: success.first-transfer.mjsrun as written on live Celo Sepolia with a funded account and only the recipient replaced: it printed the balance andStatus: success, tx0x1e4549f9…8ec2.🤖 Generated with Claude Code