signMessage static method
Sign message
message
message you want to sign, requires human readable message.
Implementation
static Future<String> signMessage(String message) async {
final result = await _channel.invokeMethod('solanaSignMessage', message);
if (jsonDecode(result)["status"] == true ||
jsonDecode(result)["status"] == 1) {
final signature = jsonDecode(result)["data"] as String;
return signature;
} else {
final error = RpcError.fromJson(jsonDecode(result)["data"]);
return Future.error(error);
}
}