示例#1
0
        public AssetStatusResponse ListAssetStatus(int assetId)
        {
            AssetStatusResponse result = null;
            var asset         = GetById(assetId);
            var coinGeckoData = CoinGeckoBusiness.GetSimpleCoinData(asset.CoinGeckoId);

            if (coinGeckoData != null)
            {
                result = new AssetStatusResponse()
                {
                    AssetId                = asset.Id,
                    Name                   = asset.Name,
                    Code                   = asset.Code,
                    AllTimeHigh            = coinGeckoData.AllTimeHigh,
                    AllTimeHighDate        = coinGeckoData.AllTimeHighDate,
                    AllTimeHighPercentage  = coinGeckoData.AllTimeHighPercentage,
                    CirculatingSupply      = coinGeckoData.CirculatingSupply,
                    High24h                = coinGeckoData.High24h,
                    Low24h                 = coinGeckoData.Low24h,
                    MarketCap              = coinGeckoData.MarketCap,
                    MarketCapPercentage24h = coinGeckoData.MarketCapPercentage24h,
                    MarketCapVariation24h  = coinGeckoData.MarketCapVariation24h,
                    MarketCapRank          = coinGeckoData.MarketCapRank,
                    Price                  = coinGeckoData.Price,
                    TotalSupply            = coinGeckoData.TotalSupply,
                    TotalVolume            = coinGeckoData.TotalVolume,
                    Variation24h           = coinGeckoData.Variation24h,
                    VariationPercentage24h = coinGeckoData.VariationPercentage24h
                };
            }
            return(result);
        }
示例#2
0
        public List <AssetResponse.ValuesResponse> FilterValueResponse(int assetId, DateTime?dateTime)
        {
            dateTime = dateTime ?? Data.GetDateTimeNow().AddDays(-30);
            var asset = AssetBusiness.GetById(assetId);
            var days  = Math.Ceiling(Data.GetDateTimeNow().Subtract(dateTime.Value).TotalDays);

            return(CoinGeckoBusiness.GetAssetValues(asset.CoinGeckoId, (int)days));
        }
示例#3
0
 public async Task CreateCoingeckoNotIncludedAssetsAsync()
 {
     await CreateNotIncludedAssetsAsync(CoinGeckoBusiness.GetAllCoinsData());
 }
示例#4
0
 public void UpdateCoingeckoAssetsMarketcap()
 {
     UpdateAssetsMarketcap(CoinGeckoBusiness.GetAllCoinsData());
 }
示例#5
0
 public async Task UpdateCoingeckoAssetsIconsAsync()
 {
     await UpdateIconsAsync(CoinGeckoBusiness.GetAllCoinsData());
 }