示例#1
0
        public void Update(string assetPairId, string exchangeName, ExchangeExtPriceSettings settings, string reason)
        {
            if (TryGetExchange(assetPairId, exchangeName) == null)
            {
                throw new Exception($"Exchange {exchangeName} not exist for asset pair {assetPairId}");
            }

            Update(assetPairId, old => AssetPairExtPriceSettings.Change(old,
                                                                        old.Exchanges.SetItem(exchangeName, settings)), reason);
        }
示例#2
0
        private ExchangeExtPriceSettingsModel Convert(string assetPairId, string exchangeName, [CanBeNull] ExchangeExtPriceSettings settings)
        {
            if (settings == null)
            {
                return(null);
            }

            var model = _convertService.Convert <ExchangeExtPriceSettings, ExchangeExtPriceSettingsModel>(settings, o => o.ConfigureMap(MemberList.Source));

            model.ExchangeName = exchangeName;
            model.AssetPairId  = assetPairId;
            return(model);
        }
示例#3
0
 public ExchangeValidator(string assetPairId, string exchangeName, ExchangeExtPriceSettings exchangeSettings)
 {
     _assetPairId      = assetPairId;
     _exchangeName     = exchangeName;
     _exchangeSettings = exchangeSettings;
 }