getTransactionByHash method

Future<MoacTransaction> getTransactionByHash (BigInt hash)

Get transaction by hash Returns the information about a transaction requested by transaction hash. Hash of a transaction Returns a transaction object, or null when no transaction was found:

Implementation

Future<MoacTransaction> getTransactionByHash(BigInt hash) async {
  if (hash == null) {
    throw ArgumentError.notNull("Moac::getTransactionByHash - hash");
  }
  final dynamic params = [MoacUtilities.bigIntegerToHex(hash)];
  final String method = MoacRpcMethods.getTransactionByHash;
  final res = await rpcClient.request(method, params);
  if (res != null && res.containsKey(moacResultKey)) {
    return MoacTransaction.fromMap(res[moacResultKey]);
  }
  _processError(method, res);
  return null;
}