mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-16 10:53:08 +00:00
Added SharedTickerType for defining time used for ticker calculations by the API
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using CryptoExchange.Net.Objects;
|
||||
using CryptoExchange.Net.SharedApis.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CryptoExchange.Net.SharedApis
|
||||
{
|
||||
/// <summary>
|
||||
/// Options for requesting ticker
|
||||
/// </summary>
|
||||
public class GetTickerOptions : EndpointOptions<GetTickerRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Type of ticker calculation
|
||||
/// </summary>
|
||||
public SharedTickerType TickerType { get; set; } = SharedTickerType.Day24H;
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetTickerOptions(SharedTickerType? tickerCalcType = null) : base(false)
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString(string exchange)
|
||||
{
|
||||
var sb = new StringBuilder(base.ToString(exchange));
|
||||
sb.AppendLine($"Ticker time calc type: {TickerType}");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using CryptoExchange.Net.Objects;
|
||||
using CryptoExchange.Net.SharedApis.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CryptoExchange.Net.SharedApis
|
||||
{
|
||||
/// <summary>
|
||||
/// Options for requesting tickers
|
||||
/// </summary>
|
||||
public class GetTickersOptions : EndpointOptions<GetTickersRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Type of ticker calculation
|
||||
/// </summary>
|
||||
public SharedTickerType TickerType { get; set; } = SharedTickerType.Day24H;
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetTickersOptions(SharedTickerType? tickerCalcType = null) : base(false)
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString(string exchange)
|
||||
{
|
||||
var sb = new StringBuilder(base.ToString(exchange));
|
||||
sb.AppendLine($"Ticker time calc type: {TickerType}");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user