@@ -12,6 +12,10 @@ import {
1212 resumeStream as sorobanResumeStream ,
1313} from '../services/sorobanService.js' ;
1414import type { AuthenticatedRequest } from '../types/auth.types.js' ;
15+ import { DEFAULT_EVENTS_PAGE_SIZE , MAX_EVENTS_PAGE_SIZE } from '../routes/v1/events.routes.js' ;
16+
17+ const DEFAULT_STREAM_PAGE_SIZE = 20 ;
18+ const MAX_STREAM_PAGE_SIZE = 100 ;
1519
1620interface UserStreamSummary {
1721 address : string ;
@@ -170,8 +174,8 @@ export const listStreams = async (req: Request, res: Response) => {
170174
171175 // Validate and parse pagination parameters
172176 const parsedLimit = Math . min (
173- typeof limit === 'string' ? ( Number . parseInt ( limit , 10 ) || 20 ) : 20 ,
174- 100
177+ typeof limit === 'string' ? ( Number . parseInt ( limit , 10 ) || DEFAULT_STREAM_PAGE_SIZE ) : DEFAULT_STREAM_PAGE_SIZE ,
178+ MAX_STREAM_PAGE_SIZE
175179 ) ;
176180 const parsedOffset = typeof offset === 'string' ? ( Number . parseInt ( offset , 10 ) || 0 ) : 0 ;
177181
@@ -285,8 +289,8 @@ export const getStreamEvents = async (req: Request, res: Response) => {
285289 const eventType = typeof req . query [ 'eventType' ] === 'string' ? req . query [ 'eventType' ] : undefined ;
286290
287291 const limit = Math . min (
288- rawLimit && typeof rawLimit === 'string' ? ( Number . parseInt ( rawLimit , 10 ) || 50 ) : 50 ,
289- 500 ,
292+ rawLimit && typeof rawLimit === 'string' ? ( Number . parseInt ( rawLimit , 10 ) || DEFAULT_EVENTS_PAGE_SIZE ) : DEFAULT_EVENTS_PAGE_SIZE ,
293+ MAX_EVENTS_PAGE_SIZE ,
290294 ) ;
291295
292296 let offset = 0 ;
0 commit comments