using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CryptoExchange.Net.SharedApis
{
///
/// Client information
///
public class SharedClientInfo
{
///
/// Exchange name
///
public string Exchange { get; init; } = string.Empty;
///
/// The client type name
///
public string TypeName { get; init; } = string.Empty;
///
/// Environments supported by this client
///
public string[] SupportedEnvironments { get; set; } = [];
///
/// Supported trading modes
///
public TradingMode[] SupportedTradingModes { get; init; } = [];
///
/// Centralization type of the exchange
///
public CentralizationType CentralizationType { get; set; }
///
/// Endpoint/subscription info
///
public EndpointOptions[] Features { get; init; } = [];
///
/// Create a string representation for this client
///
///
public override string ToString()
{
var sb = new StringBuilder();
sb.AppendLine($"Exchange: {Exchange}");
sb.AppendLine($"Client: {TypeName}");
sb.AppendLine($"Supported environments: {string.Join(", ", SupportedEnvironments)}");
sb.AppendLine($"Supported trading modes: {string.Join(", ", SupportedTradingModes)}");
sb.AppendLine($"Centralization type: {CentralizationType}");
sb.AppendLine($"Features:");
foreach (var feature in Features.Where(x => x.Supported))
{
sb.AppendLine($" {feature.EndpointName}");
}
return sb.ToString();
}
}
}