AgentSkillsCN

evm-balance-checker

通过 Crossmint API 为用户、代理及公司创建并管理区块链钱包。支持 EVM 链、Solana 以及 Stellar。

SKILL.md
--- frontmatter
name: evm-balance-checker
description: Check EVM wallet balances across multiple chains using reliable RPC endpoints. Supports native ETH and ERC20 token balance checks. Use when you need to: (1) Check wallet balance on Ethereum, Base, Polygon, or Arbitrum, (2) Query balances on testnets (Sepolia), (3) Verify funds before transactions, (4) Check balances across multiple chains at once. Includes built-in reliable RPC endpoints to avoid common issues with flaky public nodes.

EVM Balance Checker

Check wallet balances across Ethereum Virtual Machine (EVM) chains using reliable RPC endpoints.

Quick Start

Check a wallet balance on Ethereum Sepolia testnet:

bash
bun scripts/check-balance.ts --address 0x1234...

Check on a specific chain:

bash
bun scripts/check-balance.ts --address 0x1234... --chain base-sepolia

Check balance with tokens:

bash
bun scripts/check-balance.ts --address 0x1234... --tokens

Check all supported chains:

bash
bun scripts/check-balance.ts --address 0x1234... --all

Supported Chains

ChainIDNative Token
ethereum-sepoliaEthereum SepoliaETH
base-sepoliaBase SepoliaETH
ethereumEthereum MainnetETH
baseBase MainnetETH
polygonPolygon MainnetMATIC
arbitrumArbitrum OneETH

Common Options

  • --address <addr> - Wallet address to check (required)
  • --chain <chain> - Chain to check (default: ethereum-sepolia)
  • --tokens - Check ERC20 token balances (USDC, etc.)
  • --all - Check all supported chains
  • --json - Output as JSON for programmatic use

Examples

Check balance on Ethereum Sepolia:

bash
bun scripts/check-balance.ts --address 0xc54f836CBb4299B828b696Ef56f42edd898b3486

Check on Base Sepolia with tokens:

bash
bun scripts/check-balance.ts --address 0x1234... --chain base-sepolia --tokens

Check across all chains:

bash
bun scripts/check-balance.ts --address 0x1234... --all

JSON output for scripts:

bash
bun scripts/check-balance.ts --address 0x1234... --json

Why This Skill?

Public RPC endpoints can be unreliable - some return wrong data, time out, or have rate limits. This skill uses tested, reliable RPC endpoints to ensure accurate balance checks.

The script automatically:

  • Handles wei-to-ETH conversion
  • Checks ERC20 token balances (USDC on testnets)
  • Tries multiple endpoints if one fails
  • Provides clear error messages

Advanced Usage

See references/rpc-endpoints.md for:

  • Full list of RPC endpoints
  • ERC20 token addresses
  • Manual RPC method examples
  • Alternative RPC providers

Common Issues

Incorrect balance: Ensure you're checking the right chain. Testnet addresses work on testnets, not mainnet.

Timeout: Some public RPCs can be slow. The script uses fast, reliable endpoints by default.

Zero balance: New wallets or unused addresses show 0. Ensure you have the correct address.