getAccountBalance method

Future<BigInt> getAccountBalance(
  1. dynamic accountAddress
)

Return the ICP account balance of the specified account. @param {string} accountAddress The account address to get the ICP balance of. @returns {Promise<BigNumber|TransactionError>} The ICP account balance of the specified account, or a TransactionError for error.

Implementation

Future<BigInt> getAccountBalance(accountAddress) async {
  try {
    final response = await accountBalanceByAddress(accountAddress);
    return BigInt.parse(response.balances[0].value);
  } catch (error) {
    rethrow;
  }
}