A Python library for interacting with Ethereum blockchain
Overall
score
88%
Evaluation — 88%
↑ 1.01xAgent success when using this tile
Build a simple account balance checker that connects to an Ethereum node and retrieves balance information for Ethereum addresses.
Your implementation should:
@generates
class BalanceChecker:
"""
A class for checking Ethereum account balances.
"""
def __init__(self, provider_url: str):
"""
Initialize the balance checker with an Ethereum node URL.
Args:
provider_url: HTTP URL of the Ethereum node (e.g., 'http://localhost:8545')
"""
pass
def get_balance_wei(self, address: str) -> int:
"""
Get the balance of an address in wei.
Args:
address: Ethereum address or ENS name
Returns:
Balance in wei as an integer
"""
pass
def get_balance_ether(self, address: str) -> float:
"""
Get the balance of an address in ether.
Args:
address: Ethereum address or ENS name
Returns:
Balance in ether as a float
"""
pass
def is_connected(self) -> bool:
"""
Check if the connection to the Ethereum node is active.
Returns:
True if connected, False otherwise
"""
passProvides Ethereum blockchain interaction capabilities including connecting to nodes, querying balances, unit conversion, and ENS resolution.
Install with Tessl CLI
npx tessl i tessl/pypi-web3docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10