verifyMessage method

  1. @override
Future<bool> verifyMessage({
  1. required String message,
  2. required String signature,
  3. Cacao? cacao,
  4. String? clientId,
})
override

Implementation

@override
Future<bool> verifyMessage({
  required String message,
  required String signature,
  Cacao? cacao,
  String? clientId,
}) async {
  if (!enabled) throw Exception('siweConfig not enabled');
  //
  final verifyArgs = SIWEVerifyMessageArgs(
    message: message,
    signature: signature,
    cacao: cacao,
    clientId: clientId,
  );
  final isValid = await _siweConfig!.verifyMessage(verifyArgs);
  if (!isValid) {
    throw W3MServiceException('Error verifying SIWE signature');
  }
  return true;
}