class AccountController {

    @Path("/blocks")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Operation(
        summary = "Get all blocks forged (generated) by an account.",
        description = "Return all blocks forged (generated) by an account in reverse block height order.",
        security = @SecurityRequirement(name = "admin_api_key"),
        tags = {"accounts"},
        responses = {
            @ApiResponse(responseCode = "200", description = "Successful execution",
                content = @Content(mediaType = "application/json",
                    schema = @Schema(implementation = BlocksResponse.class)))
        })
    @PermitAll
    public Response getAccountBlocks(
        @Parameter(description = "The account ID.", required = true, schema = @Schema(implementation = String.class))
        @QueryParam("account") @NotNull AccountIdParameter accountIdParameter,
        @Parameter(description = "The earliest block (in seconds since the genesis block) to retrieve (optional).")
        @QueryParam("timestamp") @PositiveOrZero int timestamp,
        @Parameter(description = "A zero-based index to the first block ID to retrieve (optional).")
        @QueryParam("firstIndex") @DefaultValue("0") @PositiveOrZero int firstIndex,
        @Parameter(description = "A zero-based index to the last block ID to retrieve (optional).")
        @QueryParam("lastIndex") @DefaultValue("-1") int lastIndex,
        @Parameter(description = "Include transactions detail info")
        @QueryParam("includeTransaction") @DefaultValue("false") boolean includeTransaction
    ) {
        ResponseBuilder response = ResponseBuilder.startTiming();
        long accountId = accountIdParameter.get();
        FirstLastIndexParser.FirstLastIndex flIndex = indexParser.adjustIndexes(firstIndex, lastIndex);

        List<Block> blocks = accountService.getAccountBlocks(accountId, timestamp, flIndex.getFirstIndex(), flIndex.getLastIndex());

        BlocksResponse dto = new BlocksResponse();
        dto.setBlocks(blockConverter.convert(blocks));

        return response.bind(dto).build();
    }

    @Inject public  AccountController(Blockchain blockchain,
                             Account2FAHelper account2FAHelper,
                             AccountService accountService,
                             AccountPublicKeyService accountPublicKeyService,
                             AccountAssetService accountAssetService,
                             AccountCurrencyService accountCurrencyService,
                             AccountAssetConverter accountAssetConverter,
                             AccountCurrencyConverter accountCurrencyConverter,
                             AccountConverter converter,
                             BlockConverter blockConverter,
                             WalletKeysConverter walletKeysConverter,
                             Account2FADetailsConverter faDetailsConverter,
                             Account2FAConverter faConverter,
                             @AskOrderService OrderService<AskOrder, ColoredCoinsAskOrderPlacement> orderService,
                             FirstLastIndexParser indexParser,
                             AccountStatisticsService accountStatisticsService);

}