示例#1
0
        public static IEnumerable <Gem> AddedTokens(
            IEnumerable <Token> oldList,
            IEnumerable <Token> newList,
            TokenActionType tokenActionType,
            DexType dexType)
        {
            var recentlyAdded = new List <Gem>();

            var addedToDex = newList
                             .Where(p => oldList
                                    .All(p2 => p2.Id != p.Id))
                             .ToList();

            if (addedToDex.Count() > 0)
            {
                foreach (var item in addedToDex)
                {
                    var gem = new Gem
                    {
                        Id          = item.Id,
                        Name        = item.Name,
                        Symbol      = item.Symbol,
                        Recently    = tokenActionType,
                        Date        = DateTime.UtcNow.ToString("yyyyMMddHHmmss"),
                        IsPublished = false,
                        DexType     = dexType
                    };
                    recentlyAdded.Add(gem);
                }
            }
            return(recentlyAdded);
        }
示例#2
0
 public static string Added(DexType dexType, string storagePath)
 => Storage(storagePath, $"{dexType.GetDescription()}-all-added");