class DebugTraceTransaction implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    final Hash hash = requestContext.getRequiredParameter(0, Hash.class);
    final Optional<TransactionWithMetadata> transactionWithMetadata =
        blockchain.transactionByHash(hash);
    if (transactionWithMetadata.isPresent()) {
      final TraceOptions traceOptions =
          requestContext
              .getOptionalParameter(1, TransactionTraceParams.class)
              .map(TransactionTraceParams::traceOptions)
              .orElse(TraceOptions.DEFAULT);
      final DebugTraceTransactionResult debugTraceTransactionResult =
          debugTraceTransactionResult(hash, transactionWithMetadata.get(), traceOptions);

      return new JsonRpcSuccessResponse(
          requestContext.getRequest().getId(), debugTraceTransactionResult);
    } else {
      return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), null);
    }
  }

  public  DebugTraceTransaction(
      final BlockchainQueries blockchain, final TransactionTracer transactionTracer);

}