getCreateAccountAuthorization function

Future<CreateAccountAuthorization?> getCreateAccountAuthorization(
  1. String hezEthereumAddress
)

Implementation

Future<CreateAccountAuthorization?> getCreateAccountAuthorization(
    String hezEthereumAddress) async {
  try {
    final response = await get(
        baseApiUrl, ACCOUNT_CREATION_AUTH_URL + '/' + hezEthereumAddress,
        queryParameters: null);
    if (response.statusCode == 200) {
      final jsonResponse = await extractJSON(response);
      final authorizationResponse =
          CreateAccountAuthorization.fromJson(json.decode(jsonResponse));
      return authorizationResponse;
    } else {
      throw ('Error: $response.statusCode');
    }
  } catch (e) {
    return null;
  }
}