Claude-code-plugins-plus-skills exploring-blockchain-data
git clone https://github.com/jeremylongshore/claude-code-plugins-plus-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/jeremylongshore/claude-code-plugins-plus-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/crypto/blockchain-explorer-cli/skills/exploring-blockchain-data" ~/.claude/skills/jeremylongshore-claude-code-plugins-plus-skills-exploring-blockchain-data && rm -rf "$T"
plugins/crypto/blockchain-explorer-cli/skills/exploring-blockchain-data/SKILL.mdExploring Blockchain Data
Overview
Query and analyze blockchain data across multiple EVM-compatible networks including Ethereum, Polygon, Arbitrum, Optimism, and BSC. Supports transaction lookups, address balance checks, block inspection, token balance queries, transaction history retrieval, and whale wallet tracking via a unified CLI.
Prerequisites
- Python 3.8+ with
andrequests
libraries installed (web3
)pip install requests web3 - Etherscan API key (free tier provides 5 requests/second; set via
environment variable)ETHERSCAN_API_KEY - Optional: API keys for Polygonscan, Arbiscan, and other chain-specific explorers for higher rate limits
CLI script,blockchain_explorer.py
, andchain_client.py
modules available in the plugin directorytoken_resolver.py- RPC endpoint access (public endpoints work; dedicated providers like Alchemy, Infura, Chainstack, or QuickNode recommended for reliability)
Instructions
- Set the Etherscan API key as an environment variable:
to unlock higher rate limits beyond the default 5 requests/second.export ETHERSCAN_API_KEY=<key> - Run
to look up a transaction by hash, returning status, block number, from/to addresses, value transferred, and gas details.python blockchain_explorer.py tx <hash> - Append
to the transaction query to decode the function call, identify the interacting protocol, and display input parameters.--detailed - Specify
,--chain polygon
, or--chain arbitrum
to query transactions on alternative EVM chains when the hash is not found on Ethereum.--chain bsc - Run
to check the native token balance and total transaction count for a wallet.python blockchain_explorer.py address <address> - Add
to the address query to retrieve the most recent 50 transactions with timestamps, values, and counterparties.--history --limit 50 - Add
to the address query to list all ERC-20 token holdings with balances, symbols, and USD values via CoinGecko price resolution.--tokens - Run
to inspect the most recent block, orpython blockchain_explorer.py block latest
for a specific block.python blockchain_explorer.py block <number> - Run
to check the balance of a specific ERC-20 token at a wallet address, with automatic decimal and symbol resolution.python blockchain_explorer.py token <wallet> <contract> - Export any query result in JSON or CSV format using
or--format json
and redirect to a file for downstream processing.--format csv - Enable verbose mode with
to display API request URLs, response times, cache hit/miss status, and rate limit counters for debugging.--verbose
See
${CLAUDE_SKILL_DIR}/references/implementation.md for the full four-step implementation workflow.
Output
- Transaction detail tables showing hash, chain, status, block number, from/to addresses, value, gas price (Gwei), gas limit, gas used, and gas cost
- Decoded transaction data with function name, protocol identification, and parsed input parameters (when
is used)--detailed - Address summary with native balance, transaction count, and explorer link
- Transaction history tables with timestamp, hash, from/to, value, and direction (in/out)
- Token balance listings with contract address, token name, symbol, raw balance, human-readable balance, and USD value
- Block details with block number, timestamp, transaction count, gas used, and miner/validator
- JSON (
) or CSV (output.json
) export files for programmatic consumptiontransactions.csv
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Transaction pending in mempool, wrong chain selected, or invalid hash | Wait and retry for pending transactions; try , , ; verify hash is 66 characters starting with |
| Too many requests; no API key or quota exhausted | Wait 1-5 seconds and retry; set for higher limits; upgrade to paid tier for production use |
| RPC endpoint overloaded or complex query timed out | Retry with a different RPC endpoint; use a dedicated provider (Alchemy, Infura, QuickNode); simplify the query |
| Address has wrong length, invalid checksum, or non-hex characters | Verify 42 characters with prefix; use the checksummed version from a block explorer; convert to lowercase if checksum fails |
| Contract source not published on the explorer | Use known function signature databases for decoding; check if the contract is a proxy and look up the implementation address |
| Token too new, too obscure, or not tracked by CoinGecko | Check the token contract directly on the explorer; look up on a DEX (Uniswap, SushiSwap); manually specify decimals if known |
| Token not listed on CoinGecko, API rate limited, or very low liquidity | Check the DEX for on-chain price; use an alternative price feed; calculate from LP reserves |
| Missing Python dependencies | Run to install required packages |
Examples
Look Up a Transaction Across Chains
# Try Ethereum first, then Polygon if not found python blockchain_explorer.py tx 0x1234...abcdef --chain ethereum python blockchain_explorer.py tx 0x1234...abcdef --chain polygon
Returns a formatted table with transaction status, block number, value transferred, gas details, and a link to the block explorer. Adding
--detailed decodes the function call (e.g., swapExactTokensForTokens on Uniswap).
Full Wallet Analysis
python blockchain_explorer.py address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --history --tokens --limit 50
Produces a wallet summary (ETH balance, total transaction count), the 50 most recent transactions with timestamps and counterparties, and a complete ERC-20 token holdings list with USD values. Useful for whale watching or due diligence on a wallet.
Check USDC Balance and Export to JSON
python blockchain_explorer.py token 0xYourWallet 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 --format json > usdc_balance.json
Resolves the USDC contract, fetches the wallet balance with proper decimal handling (6 decimals for USDC), includes the current USD price, and writes the result to
usdc_balance.json for integration with dashboards or alerting pipelines.
Resources
- Etherscan API Documentation -- primary explorer API for Ethereum; free tier available with registration
- CoinGecko API -- token price resolution and metadata lookup
- web3.py Documentation -- Python library for direct RPC interaction with EVM chains
- Alchemy / Infura / QuickNode -- dedicated RPC providers for reliable node access
- 4byte.directory -- function signature database for decoding unverified contract interactions