Skip to content

robutrader/chainview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 Chainview

PyPI version License: MIT Python 3.9+

Multi-chain wallet analyzer CLI - Instantly view your crypto portfolio across 10+ EVM chains.

$ chainview balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

┌─────────────────────────────────────────────────────────────┐
│                      Wallet Analysis                         │
│    0xd8da6bf26964af9d7eed9e03e53415d37aa96045               │
└─────────────────────────────────────────────────────────────┘

           Native Token Balances
┏━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Chain         ┃ Token  ┃     Balance ┃   USD Value ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ Ethereum      │ ETH    │    12.3456  │  $43,209.60 │
│ Arbitrum One  │ ETH    │     5.1234  │  $17,932.22 │
│ Base          │ ETH    │     0.5000  │   $1,750.00 │
│ Polygon       │ MATIC  │ 1,234.5678  │     $987.65 │
└───────────────┴────────┴─────────────┴─────────────┘

Total Portfolio Value: $63,879.47

✨ Features

  • 🌐 Multi-chain support - Ethereum, Arbitrum, Optimism, Base, Polygon, BSC, Avalanche, Fantom, zkSync, Linea
  • 💰 Real-time prices - Automatic USD conversion via CoinGecko
  • ⚡ Fast & concurrent - Queries all chains in parallel
  • 🎨 Beautiful output - Rich terminal formatting
  • 📊 JSON export - For scripts and integrations
  • 🔌 No API keys required - Uses public RPC endpoints

📦 Installation

pip install chainview

Or install from source:

git clone https://github.com/robutrader/chainview
cd chainview
pip install -e .

🚀 Quick Start

Check wallet balance

# Check all chains
chainview balance 0xYourAddress

# Check specific chains only
chainview balance 0xYourAddress --chains ethereum,arbitrum,base

# Output as JSON
chainview balance 0xYourAddress --json

# Skip price fetching (faster)
chainview balance 0xYourAddress --no-prices

# Show zero balances
chainview balance 0xYourAddress --show-zero

List supported chains

chainview chains

Open in block explorer

chainview explorer 0xYourAddress --chain ethereum

📖 Python API

Use chainview as a library in your own projects:

from chainview import WalletAnalyzer

# Create analyzer
analyzer = WalletAnalyzer(
    chains=["ethereum", "arbitrum", "base"],  # Optional: defaults to all
    fetch_prices=True,  # Optional: fetch USD prices
)

# Analyze wallet (async)
import asyncio

async def main():
    summary = await analyzer.analyze("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
    
    print(f"Total USD: ${summary.total_usd:,.2f}")
    
    for balance in summary.non_zero_balances:
        print(f"{balance.chain.name}: {balance.balance} {balance.symbol}")

asyncio.run(main())

# Or use sync wrapper
summary = analyzer.analyze_sync("0xYourAddress")

Data structures

from chainview import WalletAnalyzer

summary = WalletAnalyzer().analyze_sync("0x...")

# WalletSummary
summary.address          # str: Wallet address
summary.balances         # list[Balance]: All balances
summary.non_zero_balances  # list[Balance]: Non-zero only
summary.total_usd        # float: Total USD value
summary.errors           # dict[str, str]: Chain errors

# Balance
balance = summary.balances[0]
balance.chain            # Chain: Chain info
balance.symbol           # str: Token symbol (ETH, MATIC, etc.)
balance.balance          # Decimal: Human-readable balance
balance.balance_raw      # int: Raw balance in wei
balance.usd_price        # float | None: Token price
balance.usd_value        # float | None: Balance * price

⚙️ Configuration

Environment variables

# Custom RPC endpoints (comma-separated)
export CHAINVIEW_RPC_ETHEREUM="https://your-rpc.com"
export CHAINVIEW_RPC_ARBITRUM="https://your-arbitrum-rpc.com"

# Timeout in seconds
export CHAINVIEW_TIMEOUT=15

Custom chains (coming soon)

from chainview.chains import Chain, CHAINS

# Add custom chain
CHAINS["my-chain"] = Chain(
    id="my-chain",
    name="My Custom Chain",
    chain_id=12345,
    native_symbol="TOKEN",
    public_rpcs=("https://rpc.mychain.com",),
)

🔧 Supported Chains

Chain Native Token Explorer
Ethereum ETH etherscan.io
Arbitrum One ETH arbiscan.io
Optimism ETH optimistic.etherscan.io
Base ETH basescan.org
Polygon MATIC polygonscan.com
BNB Smart Chain BNB bscscan.com
Avalanche AVAX snowtrace.io
Fantom FTM ftmscan.com
zkSync Era ETH explorer.zksync.io
Linea ETH lineascan.build

🛣️ Roadmap

  • ERC-20 token support
  • NFT detection
  • Transaction history
  • Portfolio tracking over time
  • Wallet labels/tags
  • CSV export
  • More chains (Scroll, Mantle, Blast, etc.)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

# Setup development environment
git clone https://github.com/robutrader/chainview
cd chainview
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black chainview
ruff check chainview --fix

# Type check
mypy chainview

📄 License

MIT License - see LICENSE for details.

💖 Support

If you find this tool useful, consider:

  • ⭐ Starring the repo
  • 🐛 Reporting bugs
  • 💡 Suggesting features
  • 🤝 Contributing code

Tip Jar 🫙

Building open source tools takes time! If chainview saves you time, consider supporting development:

Method Link
☕ Buy Me a Coffee buymeacoffee.com/robutrader
🍵 Ko-fi ko-fi.com/robutrader
💎 ETH/EVM 0xbeF558a83a1c7850f2A9Da21eDce77ba04d55C67

Made with ❤️ for the crypto community

About

Multi-chain wallet analyzer CLI - View balances across EVM chains

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages