getNFTList method

Implementation

Future<GetNFTListResponse> getNFTList(GetNFTListRequest params) async {
  final jsonRequestQuery = params.toJson();
  final url = Uri.parse('${_wepinBaseUrl}nft').replace(
      queryParameters: jsonRequestQuery
  );
  final response = await http.get(
    url,
    headers: headers,
  );

  if (response.statusCode >= 200 && response.statusCode < 300) {
    final responseBody = jsonDecode(response.body);
    return GetNFTListResponse.fromJson(responseBody);
  } else {
    throw WepinError(WepinErrorCode.apiRequestError, 'code: ${response.statusCode} , body: ${response.body}');
  }
}