Esempio n. 1
0
        public static async Task <List <AlgoCoin> > GetAllWtmSelectableCoins(bool activeCoinsOnly = false, CancellationToken token = default(CancellationToken))
        {
            var dict = await GetAllCoinsJson(token);

            if (dict == null)
            {
                return(null);
            }
            var coinList = new List <AlgoCoin>();

            foreach (var coin in dict)
            {
                var value  = (Dictionary <string, object>)coin.Value;
                var status = (string)value["status"];
                if (activeCoinsOnly && !string.Equals(status, "Active", StringComparison.InvariantCultureIgnoreCase))
                {
                    continue;
                }
                var tag       = (string)value["tag"];
                var algorithm = (string)value["algorithm"];
                var listEntry = new AlgoCoin {
                    Name = coin.Key, Symbol = tag, Algorithm = algorithm, Status = status
                };
                coinList.Add(listEntry);
            }
            return(coinList);
        }
Esempio n. 2
0
        public AlgoCoin Clone()
        {
            AlgoCoin _new = new AlgoCoin();

            _new.Name      = this.Name;
            _new.Symbol    = this.Symbol;
            _new.Algorithm = this.Algorithm;
            _new.Status    = this.Status;
            return(_new);
        }