diff --git a/webserver/server/app/controllers/ProjectedNftRangeController.ts b/webserver/server/app/controllers/ProjectedNftRangeController.ts index 9aca0270..8288ce7d 100644 --- a/webserver/server/app/controllers/ProjectedNftRangeController.ts +++ b/webserver/server/app/controllers/ProjectedNftRangeController.ts @@ -26,20 +26,32 @@ export class ProjectedNftRangeController extends Controller { > ): Promise { const slotRangeSize = requestBody.range.maxSlot - requestBody.range.minSlot; - if (slotRangeSize > PROJECTED_NFT_LIMIT.SLOT_RANGE) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-return - return errorResponse( - StatusCodes.BAD_REQUEST, - genErrorMessage(Errors.SlotRangeLimitExceeded, { - limit: PROJECTED_NFT_LIMIT.SLOT_RANGE, - found: slotRangeSize, - }) - ); - } if (requestBody.address !== undefined) { + if (slotRangeSize > PROJECTED_NFT_LIMIT.SINGLE_USER_SLOT_RANGE) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return errorResponse( + StatusCodes.BAD_REQUEST, + genErrorMessage(Errors.SlotRangeLimitExceeded, { + limit: PROJECTED_NFT_LIMIT.SINGLE_USER_SLOT_RANGE, + found: slotRangeSize, + }) + ); + } + return await this.handle_by_address_query(requestBody.address, requestBody); } else { + if (slotRangeSize > PROJECTED_NFT_LIMIT.SLOT_RANGE) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return errorResponse( + StatusCodes.BAD_REQUEST, + genErrorMessage(Errors.SlotRangeLimitExceeded, { + limit: PROJECTED_NFT_LIMIT.SLOT_RANGE, + found: slotRangeSize, + }) + ); + } + return await this.handle_general_query(requestBody); } } diff --git a/webserver/shared/constants.ts b/webserver/shared/constants.ts index 0b364a3c..1f3ce4df 100644 --- a/webserver/shared/constants.ts +++ b/webserver/shared/constants.ts @@ -34,4 +34,5 @@ export const POOL_DELEGATION_LIMIT = { export const PROJECTED_NFT_LIMIT = { SLOT_RANGE: 100000, + SINGLE_USER_SLOT_RANGE: 10000000000, };