getStorageNoncePublicKey method

Future<String> getStorageNoncePublicKey()

Implementation

Future<String> getStorageNoncePublicKey() async {
  const body = 'query {sharedSecrets {storageNoncePublicKey}}';
  log('getStorageNoncePublicKey: requestHttp.body=$body');

  final result = await _client.query(
    QueryOptions(
      document: gql(body),
      parserFn: (object) => SharedSecrets.fromJson(object),
    ),
  );

  if (result.exception?.linkException != null) {
    throw ArchethicConnectionException(
      result.exception!.linkException.toString(),
    );
  }

  return result.parsedData?.storageNoncePublicKey ?? '';
}