1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2026-04-08 10:41:08 +00:00

Fixed Shared GetOrderBookOptions and GetRecentTradesOptions request validation not calling base validation

This commit is contained in:
JKorf 2026-04-07 19:42:42 +02:00
parent 0d3ccf25a7
commit 25a392ee38
2 changed files with 6 additions and 2 deletions

View File

@ -45,7 +45,7 @@ namespace CryptoExchange.Net.SharedApis
public override Error? ValidateRequest(string exchange, GetOrderBookRequest request, TradingMode? tradingMode, TradingMode[] supportedApiTypes)
{
if (request.Limit == null)
return null;
return base.ValidateRequest(exchange, request, tradingMode, supportedApiTypes);
if (MaxLimit.HasValue && request.Limit.Value > MaxLimit)
return ArgumentError.Invalid(nameof(GetOrderBookRequest.Limit), $"Max limit is {MaxLimit}");

View File

@ -22,8 +22,12 @@ namespace CryptoExchange.Net.SharedApis
}
/// <inheritdoc />
public Error? Validate(GetRecentTradesRequest request)
public override Error? ValidateRequest(string exchange, GetRecentTradesRequest request, TradingMode? tradingMode, TradingMode[] supportedApiTypes)
{
var baseError = base.ValidateRequest(exchange, request, tradingMode, supportedApiTypes);
if (baseError != null)
return baseError;
if (request.Limit > MaxLimit)
return ArgumentError.Invalid(nameof(GetRecentTradesRequest.Limit), $"Only the most recent {MaxLimit} trades are available");