Retrieve the eth balance for an accout at a given block. See https://eth.wiki/json-rpc/API#eth_getBalance # Examples ```ignore let account = web3.get_all_accounts().await.unwrap()[0]; let nonce = web3.get_transaction_count(account).await; assert!(nonce.is_ok()); ```
(&self, address: Account)
| 85 | /// assert!(nonce.is_ok()); |
| 86 | /// ``` |
| 87 | pub async fn get_transaction_count(&self, address: Account) -> Result<U256> { |
| 88 | let params = rpc_params![to_hex(address)]; |
| 89 | let response = self.send_rpc("eth_getTransactionCount", params).await?; |
| 90 | let balance: U256 = serde_json::from_value(response)?; |
| 91 | |
| 92 | Ok(balance) |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | #[cfg(test)] |
no test coverage detected