getBalance method

Future<BigInt> getBalance(
  1. String address
)

Returns the balance of the account of given address in wei.

Implementation

Future<BigInt> getBalance(String address) async {
  final response = await _call<String>(
    'eth_getBalance',
    args: [address, 'latest'],
  );
  final balance = response.toBigIntOrNull;
  if (balance == null) throw Exception('Could not parse balance');
  return balance;
}