getCurrentUd method

Future<double> getCurrentUd()

Return the username from a given pubkey.

Implementation

Future<double> getCurrentUd() async {
  final QueryOptions options = QueryOptions(document: gql(currentUdQuery));
  final QueryResult result = await _client.query(options);

  if (result.hasException) {
    printIfDebug(result.exception.toString());
    throw Exception('Unexpected error happened in graphql request');
  } else {
    return result.data!['currentUd']['amount'] / 100;
  }
}