class EthGetTransactionByBlockHashAndIndex implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    final Hash hash = requestContext.getRequiredParameter(0, Hash.class);
    final int index = requestContext.getRequiredParameter(1, UnsignedIntParameter.class).getValue();
    final Optional<TransactionWithMetadata> transactionWithMetadata =
        blockchain.transactionByBlockHashAndIndex(hash, index);
    final TransactionResult result =
        transactionWithMetadata.map(TransactionCompleteResult::new).orElse(null);
    return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), result);
  }

  public  EthGetTransactionByBlockHashAndIndex(final BlockchainQueries blockchain);

}