verifySignature static method
Future<bool>
verifySignature(
- String address,
- String reconstructedMessage,
- CacaoSignature cacaoSignature,
- String chainId,
- String projectId,
Implementation
static Future<bool> verifySignature(
String address,
String reconstructedMessage,
CacaoSignature cacaoSignature,
String chainId,
String projectId,
) async {
if (cacaoSignature.t == 'eip191') {
return isValidEip191Signature(
address,
reconstructedMessage,
cacaoSignature.s,
);
} else if (cacaoSignature.t == 'eip1271') {
return await isValidEip1271Signature(
address,
reconstructedMessage,
cacaoSignature.s,
chainId,
projectId,
);
} else {
throw Exception(
'verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${cacaoSignature.t}',
);
}
}