listMarketIndexesShort method
List market indexes id and name.
Query path: /indexes/list
Implementation
Future<CoinGeckoResult<List<MarketIndexShort>>>
listMarketIndexesShort() async {
final response = await _client.dio.get(
'/indexes/list',
);
if (response.statusCode == 200) {
final data = Convert.toList(response.data, []);
final list = data.map((e) => MarketIndexShort.fromJson(e)).toList();
return CoinGeckoResult(list);
} else {
return CoinGeckoResult(
[],
errorCode: response.statusCode ?? null,
errorMessage: '${response.statusMessage} - ${response.data.toString()}',
isError: true,
);
}
}