using Newtonsoft.Json;
using System.Collections.Generic;

namespace Knoks.Core.Exchanges
{
    /*
        {"date":"1535960159",
        "tickers":
        [{"symbol":"btc_usdt","high":"7345.6789","vol":"23936.0000","last":"7239.8938","low":"7175.7272","buy":"7238.8240","sell":"7240.9989"}]
     */
    internal class OKExResponse
    {
        public IEnumerable<OKExMarket> Tickers { get; set; }
    }

    internal class OKExMarket
    {
        [JsonProperty(PropertyName = "symbol")]
        public string Symbol { get; set; }
        public string BaseCurrency {
            get {
                var s = this.Symbol.Split('_');
                if (s.Length == 2)
                {
                    return this.Symbol.Split('_')[0];
                }
                return string.Empty;
            }
            set { } }
        public string NoneBaseCurrency
        {
            get
            {
                var s = this.Symbol.Split('_');
                if (s.Length == 2)
                {
                    return this.Symbol.Split('_')[1];
                }
                return string.Empty;
            }
            set { }
        }
    }
}
