1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-17 00:20:55 +00:00
This commit is contained in:
JKorf
2026-09-05 20:28:11 +02:00
parent 431ef93611
commit f215b729ed
263 changed files with 1313 additions and 391 deletions
@@ -11,6 +11,12 @@ namespace CryptoExchange.Net.SharedApis
/// <inheritdoc />
public override string Description => "Retrieve recent public trades for a symbol";
private static readonly RequestParameterDescription[] _defaultParameterRules = new[]
{
RequestParameterRule<GetRecentTradesRequest>.Required(x => x.Symbol, "The symbol to retrieve recent trades for", new SharedSymbol(TradingMode.Spot, "ETH", "USDT")),
RequestParameterRule<GetRecentTradesRequest>.Optional(x => x.Limit, "Limit the result set to a maximum number of items", 100),
};
/// <summary>
/// The max number of trades that can be requested
/// </summary>
@@ -20,7 +26,7 @@ namespace CryptoExchange.Net.SharedApis
/// ctor
/// </summary>
public GetRecentTradesOptions(string exchange, int limit, bool authenticated)
: base(exchange, authenticated, nameof(IGetRecentTradesRest.GetRecentTradesAsync))
: base(exchange, authenticated, nameof(IGetRecentTradesRest.GetRecentTradesAsync), _defaultParameterRules)
{
MaxLimit = limit;
}
@@ -0,0 +1,24 @@
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Request to retrieve the most recent trades of a symbol
/// </summary>
public record GetRecentTradesRequest : SharedSymbolRequest
{
/// <summary>
/// Max number of results
/// </summary>
public int? Limit { get; set; }
/// <summary>
/// ctor
/// </summary>
/// <param name="symbol">Symbol to retrieve trades for</param>
/// <param name="limit">Max number of results</param>
/// <param name="exchangeParameters">Exchange specific parameters</param>
public GetRecentTradesRequest(SharedSymbol symbol, int? limit = null, ExchangeParameters? exchangeParameters = null) : base(symbol, exchangeParameters)
{
Limit = limit;
}
}
}
@@ -14,7 +14,7 @@ namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Recent trades request options.<br />
/// Use <see cref="CapabilityOptions.RequiredRequestParameters"/>, <see cref="CapabilityOptions.RequiredExchangeParameters"/> and <see cref="CapabilityOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="CapabilityOptions.RequestParameterRules"/> and <see cref="CapabilityOptions.ExchangeParameterRules"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetRecentTradesOptions GetRecentTradesOptions { get; }