getBalance method

Future<BigInt> getBalance(
  1. String address, {
  2. BlockNum? atBlock,
})

Implementation

Future<BigInt> getBalance(String address, {BlockNum? atBlock}) async {
  final function = abi.functions[5];
  assert(function.functionSelectorHex == "70a08231");

  final response = await readSafe(
    function: function.addValues(values: [address]),
    atBlock: atBlock,
  );
  return response.outputs.first.castValue<BigInt>();
}