Skip to content
clusters: prooflayer · edgemarket · edgefinance · synthforge · mediakit · wordmint · webprobe · locale · comppoint
$ man erc20-balance

/erc20-balance(1)

agentutility / edge-market / erc20-balance
PRICE / CALL
$0.002
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarket
CATEGORY
uncategorized
STATUS
live
NAME
erc20-balance erc-20 balance reader / balanceof / on-chain token balance / wallet balance lookup / multi-chain erc20 balance / read base / read ethereu…
SYNOPSIS
POST https://x402.org/v1/erc20-balance
     Content-Type: application/json
     X-PAYMENT:    <signed-transferWithAuthorization>

     { ... }
↳ first call → 402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.
DESCRIPTION

ERC-20 balance reader / balanceOf / on-chain token balance / wallet balance lookup / multi-chain ERC20 balance / read Base / read Ethereum / read Arbitrum / read Optimism / read Polygon. Reads balanceOf(wallet) on a token contract across any supported EVM chain via public RPC (no API key needed). Co-fetches decimals to return both raw bigint and decimal-formatted balance. Supports historical block parameter. Useful for agent wallet introspection, payment reconciliation, treasury monitoring.

INPUTrequest schema
propertytypedescriptionreq?
tokenstringERC-20 contract address (0x...).required
walletstringWallet address to query (0x...).required
chainanyChain id or slug. 8453|'base' (default), 1|'ethereum', 42161|'arbitrum', 10|'optimism', 137|'polygon', 56|'bsc', 43114|'avalanche'.optional
blockany'latest' default, or hex/decimal block number for historical reads.optional
OUTPUTresponse shape
fieldtypedescription
chainstringEchoed EVM chain name the balance was read from (e.g. base, ethereum, arbitrum, optimism, polygon).
chain_idstringNumeric EVM chain ID as a string, matching the resolved chain (e.g. 8453 for Base, 1 for Ethereum).
tokenstringERC-20 contract address whose balanceOf was called, echoed back in lowercase hex.
walletstringWallet address whose token balance was queried, echoed back in lowercase hex.
blockstringBlock tag or number at which balanceOf was evaluated (latest, or a specific block height as string).
balance_rawstringRaw balanceOf return value as a base-10 bigint string, before decimals scaling.
balance_hexstringRaw balanceOf return value as a 0x-prefixed hex string straight from the eth_call response.
decimalsstringToken decimals fetched from the contract's decimals() call, used to format the human-readable balance.
balancestringDecimal-formatted token balance as a string, scaled by decimals (e.g. 1234.5678 instead of raw units).
EXAMPLEStwo ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.org/v1/erc20-balance \
  -H 'Content-Type: application/json' \
  -d '{ }'
first response = 402 Payment Required with payment requirements; sign + retry with X-PAYMENT.
EXAMPLE 2 · mcp
# install once
claude mcp add x402 --command "npx x402-deployer-mcp"

# then ask Claude Code:
# "use the erc20-balance tool to ..."
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
tags
erc20balance-oftoken-balancewallet-balanceonchain-readevm-rpcmulti-chainerc20-balance
methods
POST
cluster
edgemarket
price
$0.002 USDC per call
ADJACENTother endpoints in edgemarket
endpointdescriptionprice
erc20-metadataERC-20 metadata reader / token info / token symbol lookup / token decimals / total supply / multi-chain ERC20 reader / Base / Ethereum /…$0.002
funding-ratesPerp funding rates / Binance USD-M futures funding / next-funding-time / 24h history / perp basis.$0.002
safe-tx-decodeGnosis Safe execTransaction decoder.$0.003
agent-card-resolveAgent card resolver / ERC-8004 Identity Registry lookup / Trustless Agents / agentId → owner + agentURI / A2A identity / agent.json fetch…$0.005
arbitrage-spreadCross-exchange arbitrage spread / max-min price / CEX price dispersion / spread % calculator.$0.005
basename-resolveBasename resolver / Coinbase Basenames / .base.eth lookup / Base name service / on-chain name resolution.$0.005
defi-yield-poolsDeFi yield pools / APY aggregator / yield-farming opportunities / DeFiLlama yields / cross-protocol APY ranking / stablecoin yields / LP…$0.005
ipfs-fetchIPFS fetch / IPFS gateway / Web3 storage retrieval / NFT metadata fetcher / Filecoin gateway / decentralized content / pinned-content reader.$0.005
SEE ALSO
agentutility(7) · edgemarket(7) · x402(7) · mcp(7) · llms.txt · registry.json · bazaar.x402.org