Skip to content

m8ty_client_cryptocoins

m8ty_client_cryptocoins solves this by providing coin listings, images, and K-Line market data through a typed client, enabling recognizable and informative crypto experiences.

Access list of available coins including of their icons. Stream of data is also exposed about their market values

Check the documentation of the m8ty_client_cryptocoins library to get an idea about the available models and their properties.

import 'package:dio/dio.dart';
import 'package:m8ty_client_cryptocoins/m8ty_client_cryptocoins.dart';
import 'package:m8ty_client_common/m8ty_client_common.dart';
import 'package:built_collection/built_collection.dart';

Here some examples how the dart client can be used

final client = M8tyClientCryptocoins();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCryptoCoinsApi();
try {
final response = await api.listAllCryptoCoins();
print('Coins: ${response.data}');
} on DioException catch (e) {
throw Exception(
'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}',
);
}
final client = M8tyClientCryptocoins();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCryptoCoinsApi();
final Response<Uint8List> response = await api.retrieveCryptoImage(
coinId: 'bitcoin',
);
final client = M8tyClientCryptocoins();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCryptoCoinsApi();
final response = await api.retrieveKlineDataForCrypto(
coinId: 'bitcoin',
);