public CoinsEMarket(CoinsEMarketId id, string baseCurrencyCode,
     string quoteCurrencyCode, string label,
     MarketStatistics statistics, string status, decimal tradeFee)
     : base(id, baseCurrencyCode, quoteCurrencyCode, label, statistics)
 {
     this.Status = status;
     this.TradeFee = tradeFee;
 }
Esempio n. 2
0
 public Market(MarketId setMarketId, string baseCurrencyCode, string quoteCurrencyCode, string label,
     MarketStatistics statistics)
 {
     this.MarketId = setMarketId;
     this.BaseCurrencyCode = baseCurrencyCode;
     this.QuoteCurrencyCode = quoteCurrencyCode;
     this.Label = label;
     this.Statistics = statistics;
 }
Esempio n. 3
0
 public Market(MarketId setMarketId, string baseCurrencyCode, string quoteCurrencyCode, string label,
               MarketStatistics statistics)
 {
     this.MarketId          = setMarketId;
     this.BaseCurrencyCode  = baseCurrencyCode;
     this.QuoteCurrencyCode = quoteCurrencyCode;
     this.Label             = label;
     this.Statistics        = statistics;
 }
        /// <summary>
        /// Parse market information from the market data API (as in https://vircurex.com/api/get_info_for_currency.json).
        /// </summary>
        /// <param name="currencyShortCodeToLabel">A mapping from coin short codes to human readable labels</param>
        /// <param name="marketObj">The JSON object representing a market</param>
        /// <returns></returns>
        public static KrakenMarket Parse(string baseCurrencyCode, JProperty marketProperty)
        {
            JObject marketJson = (JObject)marketProperty.Value;
            MarketStatistics marketStats = new MarketStatistics()
            {
                LastTrade = marketJson.Value<decimal>("ltp"),
                Volume24HBase = marketJson.Value<decimal>("volume")
            };
            string quoteCurrencyCode = marketProperty.Name;
            KrakenMarketId marketId = new KrakenMarketId(baseCurrencyCode, quoteCurrencyCode);

            return new KrakenMarket(marketId, baseCurrencyCode, quoteCurrencyCode, marketStats);
        }
        public static List<Market> ParseMarkets(JObject marketsJson)
        {
            List<Market> markets = new List<Market>();

            foreach (JProperty marketProperty in marketsJson.Properties())
            {
                BterMarketId marketId = new BterMarketId(marketProperty.Name);
                JObject marketJson = (JObject)marketProperty.Value;

                MarketStatistics marketStats = new MarketStatistics()
                {
                    HighTrade = marketJson.Value<decimal>("high"),
                    LastTrade = marketJson.Value<decimal>("last"),
                    LowTrade = marketJson.Value<decimal>("low"),
                    Volume24HBase = marketJson.Value<decimal>("vol_" + marketId.BaseCurrencyCode.ToLower())
                };

                markets.Add(new BterMarket(marketId, marketStats));
            }

            return markets;
        }
 public KrakenMarket(KrakenMarketId id, string baseCurrencyCode, string quoteCurrencyCode,
     MarketStatistics statistics)
     : base(id, baseCurrencyCode, quoteCurrencyCode, id.ToString(), statistics)
 {
 }
 public VircurexMarket(VircurexMarketId id, string baseCurrencyCode, string quoteCurrencyCode,
     MarketStatistics statistics)
     : base(id, baseCurrencyCode, quoteCurrencyCode, id.ToString(), statistics)
 {
 }
 public PreludeMarket(PreludeMarketId id, MarketStatistics statistics)
     : base(id, id.BaseCurrencyCode, Enum.GetName(typeof(PreludeQuoteCurrency), id.QuoteCurrencyCode),
         id.ToString(), statistics)
 {
 }
 public BterMarket(BterMarketId id, MarketStatistics statistics)
     : base(id, id.BaseCurrencyCode, id.QuoteCurrencyCode,
         id.ToString(), statistics)
 {
 }