getAccountData method

Future<AccountI?> getAccountData(
  1. String address
)

Reads the account endpoint and retrieves the details of the account having the given address from it. If no account with the specified address is found, returns null instead.

Implementation

Future<AccountI?> getAccountData(String address) async {
  final request = auth.QueryAccountRequest.create()..address = address;

  final response = await _client.account(request);
  if (!response.hasAccount()) {
    return null;
  }

  final account = Codec.deserializeAccount(response.account);
  return account.address == address ? account : null;
}