Skip to content
clusters: prooflayer · edgemarket · edgefinance · synthforge · mediakit · wordmint · webprobe · locale · comppoint · rollforge · bestiary · statline · matchpoint · retail · agentops · browserworkflow · modelrouter · compose
$ man erc20-balance

/erc20-balance

agentutility / edge-market / erc20-balance
PRICE / CALL
$0.005
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarket
CATEGORY
uncategorized
STATUS
live
NAME
erc20-balance reads an erc-20 token balance on-chain across any supported evm chain, including base, ethereum, arbitrum, optimism, and polygon
SYNOPSIS
POST https://x402.agentutility.ai/erc20-balance
     Content-Type: application/json
     X-PAYMENT:    <signed-transferWithAuthorization>

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

Reads an ERC-20 token balance on-chain across any supported EVM chain, including Base, Ethereum, Arbitrum, Optimism, and Polygon. 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. Use it as a balanceOf reader, wallet balance lookup, or multi-chain ERC20 balance API.

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.agentutility.ai/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 the MCP package for this endpoint's cluster
npx -y @agentutility/mcp-<cluster>

# Required: EVM private key with USDC on Base
export X402_PRIVATE_KEY=0x...

# Then call the erc20-balance tool from your MCP-aware agent.
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.005 USDC per call
ADJACENTother endpoints in edgemarket
endpointdescriptionprice
agent-card-resolveResolves an ERC-8004 agentId to its on-chain owner, agentURI, and agent card JSON.$0.005
arbitrage-spreadFinds the cross-exchange arbitrage spread for any CoinGecko-listed coin.$0.005
basename-resolveResolves Coinbase Basenames (.base.eth) to Ethereum addresses and back, reading the Base mainnet L2 Resolver on-chain (no gas, no wallet).$0.005
cid-fetchFetches the content behind an IPFS CID and optional path through public gateways, returning text, JSON, or base64 with a 5 MB cap.$0.005
current-balanceReads a wallet's current ERC-20 token balance with a read-only balanceOf call on Base, Ethereum, Arbitrum, Optimism, Polygon, BSC, or Ava…$0.005
defi-yield-poolsFilters and ranks thousands of DeFi yield-bearing pools by APY across every chain DeFiLlama tracks.$0.005
erc20-metadataReads ERC-20 token metadata: name(), symbol(), decimals(), and totalSupply() in parallel via public RPC on Base, Ethereum, Arbitrum, Opti…$0.005
flagged-tokensFeed of flagged risky Solana tokens: thin liquidity, extreme moves, sell pressure, very new pairs, and missing profile context.$0.005
SEE ALSO
agentutility · edgemarket · x402 · mcp · llms.txt · registry.json · bazaar.x402.org