getCoinInfo method

Future<CoinInfo> getCoinInfo({
  1. required String coinType,
})

Implementation

Future<CoinInfo> getCoinInfo({
  required String coinType,
}) async {
  final variables = {"coin": coinType};
  final data = await queryIndexer(
      document: GetCoinInfo, variables: variables);
  var infos = data['coin_infos'] as List;
  if(infos.isEmpty) {
    return const CoinInfo(name: '',symbol: '',decimals: 8);
  }
  return CoinInfo.fromJson(infos.first);
}