Retrieve the eth balance for an accout at the current block. See https://eth.wiki/json-rpc/API#eth_getBalance # Examples ```ignore let web3 = web3::Web3::new("http://127.0.0.1:8545").unwrap(); let account = web3.get_all_accounts().await.unwrap()[0].clone(); let balance = web3.get_balance(account).await; assert!(balance.is_ok()); ```
(&self, address: Account)
| 31 | /// assert!(balance.is_ok()); |
| 32 | /// ``` |
| 33 | pub async fn get_balance(&self, address: Account) -> Result<U256> { |
| 34 | let balance: U256 = self.get_balance_by_block(address, None).await?; |
| 35 | |
| 36 | Ok(balance) |
| 37 | } |
| 38 | |
| 39 | /// Retrieve the eth balance for an accout at a given block. |
| 40 | /// |
no test coverage detected