mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-10-17 00:20:55 +00:00
wip
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user