1
0
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:
Jkorf
2025-11-10 09:15:20 +01:00
parent 8043a48c49
commit 6cf9684f55
9 changed files with 157 additions and 6 deletions
@@ -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();
}
}
}