getCoinTransactions method

Future<Response> getCoinTransactions({
  1. String? searchText,
  2. String? date,
  3. String? type,
})

To get user coin transactions in whitelabel app user needs to use below API

Implementation

Future<http.Response> getCoinTransactions(
    {String? searchText, String? date, String? type}) async {
  Uri url = Uri.parse(
      "$_baseUrl/coin/transactions/list?${searchText != null ? "search=$searchText" : ""}${date != null ? "&created_at=$date" : ""}${type != null ? "&type=$type" : ""}");

  http.Response response =
      await http.Client().get(url, headers: kAuthenticatedGetRequestHeader);

  if (response.statusCode == 200) {
    printMessage(
        "GET COIN TRANSACTION LIST RESPONSE = ${response.statusCode}");
    return response;
  } else {
    printMessage(
        "GET COIN TRANSACTION LIST RESPONSE = ${response.statusCode}");
    printMessage("GET COIN TRANSACTION LIST RESPONSE = ${response.body}");
    return response;
  }
}