11import { handleBlockCache , handleChainTipCache } from '../../../api/controllers/cache-controller' ;
2- import { BlockParamsSchema , cleanBlockHeightOrHashParam , parseBlockParam } from './schemas' ;
2+ import {
3+ BlockParamsSchema ,
4+ cleanBlockHeightOrHashParam ,
5+ BlockCursorParamSchema ,
6+ parseBlockParam ,
7+ } from './schemas' ;
38import { parseDbNakamotoBlock } from './helpers' ;
49import { InvalidRequestError , NotFoundError } from '../../../errors' ;
510import { parseDbTx } from '../../../api/controllers/db-controller' ;
611import { FastifyPluginAsync } from 'fastify' ;
712import { Type , TypeBoxTypeProvider } from '@fastify/type-provider-typebox' ;
813import { Server } from 'node:http' ;
914import { CursorOffsetParam , LimitParam , OffsetParam } from '../../schemas/params' ;
10- import { getPagingQueryLimit , pagingQueryLimits , ResourceType } from '../../pagination' ;
15+ import { getPagingQueryLimit , ResourceType } from '../../pagination' ;
1116import { PaginatedResponse } from '../../schemas/util' ;
12- import {
13- NakamotoBlock ,
14- NakamotoBlockSchema ,
15- SignerSignatureSchema ,
16- } from '../../schemas/entities/block' ;
17+ import { NakamotoBlock , NakamotoBlockSchema } from '../../schemas/entities/block' ;
1718import { TransactionSchema } from '../../schemas/entities/transactions' ;
1819import {
1920 BlockListV2ResponseSchema ,
@@ -37,7 +38,7 @@ export const BlockRoutesV2: FastifyPluginAsync<
3738 querystring : Type . Object ( {
3839 limit : LimitParam ( ResourceType . Block ) ,
3940 offset : CursorOffsetParam ( { resource : ResourceType . Block } ) ,
40- cursor : Type . Optional ( Type . String ( { description : 'Cursor for pagination' } ) ) ,
41+ cursor : Type . Optional ( BlockCursorParamSchema ) ,
4142 } ) ,
4243 response : {
4344 200 : BlockListV2ResponseSchema ,
0 commit comments