1
1
import { 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' ;
3
8
import { parseDbNakamotoBlock } from './helpers' ;
4
9
import { InvalidRequestError , NotFoundError } from '../../../errors' ;
5
10
import { parseDbTx } from '../../../api/controllers/db-controller' ;
6
11
import { FastifyPluginAsync } from 'fastify' ;
7
12
import { Type , TypeBoxTypeProvider } from '@fastify/type-provider-typebox' ;
8
13
import { Server } from 'node:http' ;
9
14
import { CursorOffsetParam , LimitParam , OffsetParam } from '../../schemas/params' ;
10
- import { getPagingQueryLimit , pagingQueryLimits , ResourceType } from '../../pagination' ;
15
+ import { getPagingQueryLimit , ResourceType } from '../../pagination' ;
11
16
import { 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' ;
17
18
import { TransactionSchema } from '../../schemas/entities/transactions' ;
18
19
import {
19
20
BlockListV2ResponseSchema ,
@@ -37,7 +38,7 @@ export const BlockRoutesV2: FastifyPluginAsync<
37
38
querystring : Type . Object ( {
38
39
limit : LimitParam ( ResourceType . Block ) ,
39
40
offset : CursorOffsetParam ( { resource : ResourceType . Block } ) ,
40
- cursor : Type . Optional ( Type . String ( { description : 'Cursor for pagination' } ) ) ,
41
+ cursor : Type . Optional ( BlockCursorParamSchema ) ,
41
42
} ) ,
42
43
response : {
43
44
200 : BlockListV2ResponseSchema ,
0 commit comments