Skip to content

Commit

Permalink
fix: Removed deprecated methods and data types
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor-pelykh committed Sep 18, 2022
1 parent 105e5d0 commit 69a221b
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 635 deletions.
19 changes: 0 additions & 19 deletions lib/coingecko_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ import 'package:coingecko_api/sections/coins_section.dart';
import 'package:coingecko_api/sections/companies_section.dart';
import 'package:coingecko_api/sections/contract_section.dart';
import 'package:coingecko_api/sections/derivatives_section.dart';
import 'package:coingecko_api/sections/events_section.dart';
import 'package:coingecko_api/sections/exchange_rates_section.dart';
import 'package:coingecko_api/sections/exchanges_section.dart';
import 'package:coingecko_api/sections/finance_section.dart';
import 'package:coingecko_api/sections/global_section.dart';
import 'package:coingecko_api/sections/indexes_section.dart';
import 'package:coingecko_api/sections/ping_section.dart';
import 'package:coingecko_api/sections/simple_section.dart';
import 'package:coingecko_api/sections/status_updates_section.dart';
import 'package:coingecko_api/sections/trending_section.dart';
import 'package:dio/dio.dart';

Expand All @@ -34,11 +31,8 @@ class CoinGeckoApi {
late AssetPlatformsSection _assetPlatforms;
late CategoriesSection _categories;
late ExchangesSection _exchanges;
late FinanceSection _finance;
late IndexesSection _indexes;
late DerivativesSection _derivatives;
late StatusUpdatesSection _statusUpdates;
late EventsSection _events;
late ExchangeRatesSection _exchangeRates;
late TrendingSection _trending;
late GlobalSection _global;
Expand Down Expand Up @@ -67,22 +61,12 @@ class CoinGeckoApi {
/// The section that brings together the requests that are related to exchanges
ExchangesSection get exchanges => _exchanges;

/// The section that brings together the requests
/// that are related to finance platforms and products
FinanceSection get finance => _finance;

/// The section that brings together the requests that are related to indexes
IndexesSection get indexes => _indexes;

/// The section that brings together the requests that are related to derivatives
DerivativesSection get derivatives => _derivatives;

/// The section that brings together the requests that are related to status updates
StatusUpdatesSection get statusUpdates => _statusUpdates;

/// The section that brings together the requests that are related to events
EventsSection get events => _events;

/// The section that brings together the requests that are related to exchange rates
ExchangeRatesSection get exchangeRates => _exchangeRates;

Expand Down Expand Up @@ -168,11 +152,8 @@ class CoinGeckoApi {
_assetPlatforms = AssetPlatformsSection(_dio);
_categories = CategoriesSection(_dio);
_exchanges = ExchangesSection(_dio);
_finance = FinanceSection(_dio);
_indexes = IndexesSection(_dio);
_derivatives = DerivativesSection(_dio);
_statusUpdates = StatusUpdatesSection(_dio);
_events = EventsSection(_dio);
_exchangeRates = ExchangeRatesSection(_dio);
_trending = TrendingSection(_dio);
_global = GlobalSection(_dio);
Expand Down
20 changes: 0 additions & 20 deletions lib/data/country.dart

This file was deleted.

66 changes: 0 additions & 66 deletions lib/data/event.dart

This file was deleted.

33 changes: 0 additions & 33 deletions lib/data/finance_platform.dart

This file was deleted.

59 changes: 0 additions & 59 deletions lib/data/finance_product.dart

This file was deleted.

42 changes: 0 additions & 42 deletions lib/sections/coins_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:coingecko_api/data/ticker.dart';
import 'package:coingecko_api/data/market.dart';
import 'package:coingecko_api/data/market_chart_data.dart';
import 'package:coingecko_api/data/ohlc_info.dart';
import 'package:coingecko_api/data/status_update.dart';
import 'package:coingecko_api/helpers/convert.dart';
import 'package:coingecko_api/helpers/helpers.dart';
import 'package:dio/dio.dart';
Expand Down Expand Up @@ -363,47 +362,6 @@ class CoinsSection {
}
}

///
/// Get status updates for a given coin.
///
/// **[id]** sets coin id.
///
/// **[itemsPerPage]** sets total results per page.
///
/// **[page]** sets page through results.
///
/// Query: **/coins/{id}/status\_updates**
///
Future<CoinGeckoResult<List<StatusUpdate>>> listCoinStatusUpdates({
required String id,
int? itemsPerPage,
int? page,
}) async {
final Map<String, dynamic> queryParameters = {};
if (itemsPerPage is int) {
queryParameters['per_page'] = itemsPerPage;
}
if (page is int) {
queryParameters['page'] = page;
}
final response = await _dio.get(
'/coins/$id/status_updates',
queryParameters: queryParameters,
);
if (response.statusCode == 200) {
final data = Convert.toList(response.data['status_updates']) ?? [];
final list = data.map((e) => StatusUpdate.fromJson(e)).toList();
return CoinGeckoResult(list);
} else {
return CoinGeckoResult(
[],
errorCode: response.statusCode ?? null,
errorMessage: '${response.statusMessage} - ${response.data.toString()}',
isError: true,
);
}
}

///
/// Get coin's OHLC.
///
Expand Down
Loading

0 comments on commit 69a221b

Please sign in to comment.