signAndSendTransaction static method

Future<String> signAndSendTransaction(
  1. String transaction
)

Sign and send transaction

transaction transaction you want to sign and send, requires base58 string.

Implementation

static Future<String> signAndSendTransaction(String transaction) async {
  final result = await _channel.invokeMethod(
      'solanaSignAndSendTransaction', 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);
  }
}