getAllZainboxes method

Future<GetAllZainboxesResponse?> getAllZainboxes()

Executes network call to initiate transactions

Implementation

Future<GetAllZainboxesResponse?> getAllZainboxes() async {

  GetAllZainboxesResponse? getAllZainboxesResponse = GetAllZainboxesResponse();

  final url = "${Utils.getBaseUrl(isTest)}/${Utils.getAllZainboxesUrl}";

  final response = await http.get(Uri.parse(url),
      headers: {
        "Authorization" : "Bearer $publicKey",
        "Content-Type" : "application/json"
      }
  );

  final responseBody = jsonDecode(response.body);
  getAllZainboxesResponse = GetAllZainboxesResponse.fromJson(responseBody);

  return getAllZainboxesResponse;
}