signTransaction static method
Sign transaction
transaction
transaction you want to sign, requires base58 string.
Implementation
static Future<String> signTransaction(String transaction) async {
final result =
await _channel.invokeMethod('solanaSignTransaction', transaction);
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);
}
}