根据账户地址获取其原生代币余额。
def get_balance(self, address: ChecksumAddress) -> Optional[Wei]
address
ChecksumAddress
账户地址
Optional[Wei]
账户原生代币余额(Wei)
# 获取账户余额 balance = chain.get_balance("0x...") if balance is not None: print(f"Balance: {Web3.from_wei(balance, 'ether')} ETH")
最后更新于1个月前