polybrainz_etherscan 1.0.0
polybrainz_etherscan: ^1.0.0 copied to clipboard
A production-ready Dart wrapper for the Etherscan API V2, supporting 60+ EVM chains with a single API key. Features include rate limiting, caching, circuit breaker pattern, and type-safe models.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-01-22 #
Added #
-
Multi-chain support: 60+ EVM chains supported with a single API key
- Mainnets: Ethereum, Polygon, Arbitrum, Optimism, Base, BSC, Avalanche, and more
- Testnets: Sepolia, Holesky, Goerli, and various L2 testnets
-
Account Module
getBalance- Get native token balance for an addressgetBalanceMulti- Get balances for multiple addresses (up to 20)getTransactions- Get normal transactions for an addressgetInternalTransactions- Get internal transactions for an addressgetTokenTransfers- Get ERC-20 token transfersgetNftTransfers- Get ERC-721 NFT transfers
-
Contract Module
getAbi- Get contract ABI for verified contractsgetSourceCode- Get contract source code and metadata
-
Gas Module
getGasOracle- Get current gas prices (safe, propose, fast)estimateConfirmationTime- Estimate transaction confirmation time
-
Stats Module
getEthPrice- Get current ETH/USD and ETH/BTC pricesgetEthSupply- Get total ETH supply
-
Transaction Module
getStatus- Check transaction execution statusgetReceiptStatus- Check transaction receipt status
-
Logs Module
getLogs- Get event logs with topic filtering
-
Resilience Features
- Token bucket rate limiter
- Circuit breaker pattern with configurable thresholds
- Exponential backoff retry with jitter
- In-memory LRU cache with TTL support
-
Type Safety
- Extension types for
EthereumAddress,TransactionHash,Wei,BlockNumber - Sealed class exception hierarchy for exhaustive error handling
Result<T>type for explicit success/failure handling- Freezed models with JSON serialization
- Extension types for
-
Configuration
- Configurable timeouts, rate limits, and cache settings
- Easy chain switching with
forChain()method