private static SettingsModel GetConstellationSettings(ConstellationEffect constellationInit) { var settingsModel = new SettingsModel { Auditors = constellationInit.Auditors.Select(a => a.Data).ToArray(), MinAccountBalance = constellationInit.MinAccountBalance, MinAllowedLotSize = constellationInit.MinAllowedLotSize, Vault = constellationInit.Vault.Data }; if (constellationInit.RequestRateLimits != null) { settingsModel.RequestRateLimits = new RequestRateLimitsModel { HourLimit = constellationInit.RequestRateLimits.HourLimit, MinuteLimit = constellationInit.RequestRateLimits.MinuteLimit } } ; return(settingsModel); }
/// <summary> /// Builds asset models for only new assets. /// </summary> private static List <AssetModel> GetAssets(ConstellationEffect constellationEffect, List <AssetModel> permanentAssets) { var newAssets = constellationEffect.Assets; if (permanentAssets != null && permanentAssets.Count > 0) { var permanentAssetsIds = permanentAssets.Select(a => a.Id); newAssets = constellationEffect.Assets.Where(a => !permanentAssetsIds.Contains(a.Id)).ToList(); } var assetsLength = newAssets.Count; var assets = new List <AssetModel>(); for (var i = 0; i < assetsLength; i++) { var currentAsset = newAssets[i]; var assetModel = new AssetModel { Id = currentAsset.Id, Code = currentAsset.Code, Issuer = currentAsset.Issuer.Data }; assets.Add(assetModel); } return(assets.ToList()); }