Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ Async Python wrapper for blockchain explorer APIs (Etherscan, BSCScan, PolygonSc
## Supported Networks

### Primary Scanner Providers
- **Etherscan API**: Ethereum, BSC, Polygon, Arbitrum, Optimism, Base, Fantom, Gnosis, and more EVM chains
- **Etherscan API**: Ethereum, BSC, Polygon, Arbitrum, Optimism, Base, Fantom, Gnosis, and more EVM chains (Base supported via Etherscan V2)
- **BlockScout**: Public blockchain explorers (no API key required) - Ethereum, Sepolia, Gnosis, Polygon, Optimism, Arbitrum, Base, Scroll, Linea, and others
- **Moralis**: Multi-chain Web3 API - Ethereum, BSC, Polygon, Arbitrum, Base, Optimism, Avalanche, and more
- **BaseScan**: Base network explorer (Etherscan-compatible)
- **RoutScan**: Mode network explorer

### Key Features by Provider
Expand All @@ -51,7 +50,6 @@ aiochainscan/
β”‚ β”œβ”€β”€ etherscan_v2.py # Etherscan API v2
β”‚ β”œβ”€β”€ blockscout_v1.py # BlockScout implementation
β”‚ β”œβ”€β”€ moralis_v1.py # Moralis Web3 API
β”‚ β”œβ”€β”€ basescan_v1.py # BaseScan implementation
β”‚ └── routscan_v1.py # RoutScan implementation
β”œβ”€β”€ adapters/ # Hexagonal architecture adapters
β”‚ β”œβ”€β”€ aiohttp_client.py
Expand Down Expand Up @@ -112,6 +110,10 @@ logs = await client.call(Method.EVENT_LOGS, address='0x...', **params)
# Easy scanner switching - same interface for all!
client = ChainscanClient.from_config('etherscan', 'v2', 'eth', 'main')
balance = await client.call(Method.ACCOUNT_BALANCE, address='0x...')

# Use Base network through Etherscan V2 (chain_id 8453)
client = ChainscanClient.from_config('etherscan', 'v2', 'base', 'main')
balance = await client.call(Method.ACCOUNT_BALANCE, address='0x...')
```

### Legacy Facade API (Backward Compatibility)
Expand Down
Empty file removed FETCH_HEAD
Empty file.
239 changes: 0 additions & 239 deletions QUICK_START_RU.md

This file was deleted.

19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Provides a single, consistent API for accessing blockchain data across multiple

## Supported Networks

**Etherscan API**: Ethereum, BSC, Polygon, Arbitrum, Optimism, Base, Fantom, Gnosis, and more
**Etherscan API**: Ethereum, BSC, Polygon, Arbitrum, Optimism, Base, Fantom, Gnosis, and more EVM chains (Base supported via Etherscan V2)
**Blockscout**: Public blockchain explorers (no API key needed) - Sepolia, Gnosis, Polygon, and others
**Moralis**: Multi-chain Web3 API - Ethereum, BSC, Polygon, Arbitrum, Base, Optimism, Avalanche

Expand Down Expand Up @@ -64,13 +64,18 @@ async def main():
balance = await client.call(Method.ACCOUNT_BALANCE, address='0x742d35Cc6634C0532925a3b8D9fa7a3D91D1e9b3')
print(f"Balance: {balance} wei ({int(balance) / 10**18:.6f} ETH)")

# Switch to Etherscan easily (requires API key)
client = ChainscanClient.from_config('etherscan', 'v2', 'eth', 'main')
block = await client.call(Method.BLOCK_BY_NUMBER, block_number='latest')
print(f"Latest block: #{block['number']}")
# Switch to Etherscan easily (requires API key)
client = ChainscanClient.from_config('etherscan', 'v2', 'eth', 'main')
block = await client.call(Method.BLOCK_BY_NUMBER, block_number='latest')
print(f"Latest block: #{block['number']}")

# Use Base network through Etherscan V2 (requires ETHERSCAN_KEY)
client = ChainscanClient.from_config('etherscan', 'v2', 'base', 'main')
balance = await client.call(Method.ACCOUNT_BALANCE, address='0x...')
print(f"Base balance: {balance} wei")

# Same interface for any scanner!
await client.close()
# Same interface for any scanner!
await client.close()

asyncio.run(main())
```
Expand Down
15 changes: 8 additions & 7 deletions aiochainscan/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,6 @@ def _init_builtin_scanners(self) -> None:
requires_api_key=False,
special_config={'subdomain_pattern': 'flare-explorer'},
),
'base': ScannerConfig(
name='BaseScan',
base_domain='basescan.org',
currency='BASE',
supported_networks={'main', 'goerli', 'sepolia'},
requires_api_key=True,
),
'linea': ScannerConfig(
name='LineaScan',
base_domain='lineascan.build',
Expand All @@ -183,6 +176,14 @@ def _init_builtin_scanners(self) -> None:
supported_networks={'main', 'sepolia'},
requires_api_key=True,
),
'base': ScannerConfig(
name='Etherscan (Base)',
base_domain='etherscan.io',
currency='BASE',
supported_networks={'main', 'goerli', 'sepolia'},
requires_api_key=True,
special_config={'etherscan_v2': True}, # Use Etherscan V2 for Base
),
'blockscout_eth': ScannerConfig(
name='BlockScout Ethereum',
base_domain='eth.blockscout.com',
Expand Down
2 changes: 0 additions & 2 deletions aiochainscan/scanners/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def list_scanners() -> dict[tuple[str, str], type[Scanner]]:

# Import scanner implementations to trigger registration
# This must be done after register_scanner is defined to avoid circular imports
from .basescan_v1 import BaseScanV1 # noqa: E402
from .blockscout_v1 import BlockScoutV1 # noqa: E402
from .etherscan_v2 import EtherscanV2 # noqa: E402
from .moralis_v1 import MoralisV1 # noqa: E402
Expand All @@ -84,7 +83,6 @@ def list_scanners() -> dict[tuple[str, str], type[Scanner]]:
'list_scanners',
'EtherscanV2',
'RoutScanV1',
'BaseScanV1',
'BlockScoutV1',
'MoralisV1',
]
40 changes: 0 additions & 40 deletions aiochainscan/scanners/basescan_v1.py

This file was deleted.

Loading