getTransaction method

Future getTransaction(
  1. String transactionHash
)

Get transaction by hash

Implementation

Future<dynamic> getTransaction(String transactionHash) async {
  try {
    var response = await sendMessage(formatRequest(
        method: 'getTransaction',
        params: [transactionHash])).then((Map<String, dynamic> data) {
      if (data.containsKey('result')) {
        return Transaction.fromJson(data['result']);
      } else if (data.containsKey('error')) {
        throw NodeException.fromJson(data['error']);
      }
    });
    return response;
  } on NodeException catch (e) {
    throw NodeException(
        code: e.code, message: '{"getTransaction": "${e.message}"}');
  }
}