public IList <TradeDto> GetLastTrades(MarketType marketType) { return(_apiClient.MakeRequest <IList <TradeDto> >( HttpMethod.Get, marketType.ToString(), new UrlParams { (Name: "sort", Value: "DESC") }));;
public void ProcessQuote(MarketType market, string assetPair, QuotePriceType priceType, double price, DateTime timestamp) { var topic = $"quote.{market.ToString().ToLower()}.{assetPair.ToLower()}.{priceType.ToString().ToLower()}"; var subject = _realm.Services.GetSubject <QuoteClientMessage>(topic); subject.OnNext(new QuoteClientMessage { AssetPairId = assetPair, Market = market, PriceType = priceType, Timestamp = timestamp, Price = price }); }
private void ProcessCandleAsync(CandleUpdate candle, MarketType market) { var topic = $"candle.{market.ToString().ToLower()}.{candle.AssetPairId.ToLower()}.{candle.PriceType.ToString().ToLower()}.{candle.TimeInterval.ToString().ToLower()}"; var subject = _realm.Services.GetSubject <CandleClientMessage>(topic); subject.OnNext(new CandleClientMessage { AssetPairId = candle.AssetPairId, MarketType = market, PriceType = candle.PriceType, TimeInterval = candle.TimeInterval, Timestamp = candle.CandleTimestamp, Open = candle.Open, Close = candle.Close, High = candle.High, Low = candle.Low, TradingVolume = candle.TradingVolume, OppositeTradingVolume = candle.TradingOppositeVolume }); }
public async Task ProcessTrade(Trade tradeLogItem, MarketType market) { var redisKey = _settings.GetKeyForTradeAnonId(tradeLogItem.Id); if (await _cache.GetAsync(redisKey) == null) { var topic = $"trades.{market.ToString().ToLower()}.{tradeLogItem.AssetPairId.ToLower()}"; var subject = _realm.Services.GetSubject <Trade>(topic); subject.OnNext(tradeLogItem); await _cache.SetAsync( redisKey, _redisValue, new DistributedCacheEntryOptions { AbsoluteExpiration = DateTimeOffset.Now.AddDays(1) }); } }
public static string ToValue(this MarketType value) { return(value.ToString().ToLower()); }
public Securities(SecuritiesTypes secType, MarketType marketType, String code) { this.Type = secType; this.MarketType = marketType; this.Symbol = code + "." + marketType.ToString(); }
private void LocationGeted(string lc) { PacketsIdentity.SetData(target == MarketType.Custom? customTarget : target.ToString(), lc, apiKey); }
public IMarketApi GetApi(long companyId, MarketType market, string marketplaceId) { var query = _marketplaces.Where(m => m.Market == (int)market && m.CompanyId == companyId); if (!String.IsNullOrEmpty(marketplaceId)) { query = query.Where(m => m.MarketplaceId == marketplaceId); } var marketplace = query.FirstOrDefault(); if (marketplace == null) { return(null); } //throw new ObjectNotFoundException("Marketplace, for market=" + market + ", marketplaceId=" + marketplaceId); switch (market) { case MarketType.Amazon: case MarketType.AmazonEU: case MarketType.AmazonAU: case MarketType.AmazonIN: return(new AmazonApi(_time, _log, marketplace.Key3, marketplace.Key4, marketplace.Key5, marketplace.Key1, marketplace.Key2, marketplace.Token, marketplace.SellerId, marketplace.MarketplaceId, marketplace.EndPointUrl)); case MarketType.eBay: return(new eBayApi(_time, _log, marketplace.MarketplaceId, marketplace.Key1, marketplace.Key2, marketplace.Key3, marketplace.Token, marketplace.Key4, marketplace.Key5, marketplace.EndPointUrl, marketplace.TemplateFolder)); case MarketType.Magento: return(new Magento20MarketApi(_time, _log, marketplace.MarketplaceId, marketplace.Key1, marketplace.Key2, marketplace.EndPointUrl, marketplace.Token, () => GetFreshTokenInfo(MarketType.Magento), (t) => StoreNewTokenInfo(MarketType.Magento, t), new PAMagentoFeatures())); case MarketType.Walmart: return(new WalmartApi(_log, _time, marketplace.SellerId, marketplace.Key4, marketplace.Key5, marketplace.Token, () => GetFreshTokenInfo(MarketType.Walmart), (t) => StoreNewTokenInfo(MarketType.Walmart, t), marketplace.Key1, //channel type marketplace.EndPointUrl, StringHelper.TryGetInt(marketplace.Key2) ?? 1, marketplace.Key3, _javaPath)); case MarketType.WalmartCA: return(new WalmartCAApi(_log, _time, marketplace.SellerId, marketplace.Token, marketplace.Key1, marketplace.EndPointUrl, _javaPath)); case MarketType.Jet: return(new JetApi(_log, _time, marketplace.Key1, marketplace.Key2, marketplace.SellerId, marketplace.Key3, marketplace.Token, () => GetFreshTokenInfo(MarketType.Jet), (t) => StoreNewTokenInfo(MarketType.Jet, t))); case MarketType.Shopify: return(new ShopifyApi(_log, _time, marketplace.MarketplaceId, marketplace.Key1, marketplace.Key2, marketplace.Token, marketplace.EndPointUrl, marketplace.Key3, ShopifyApi.QuantityUpdateMode.Default, false)); case MarketType.WooCommerce: return(new WooCommerceApi(_log, _time, marketplace.MarketplaceId, marketplace.Key1, marketplace.Key2, marketplace.EndPointUrl, (marketplace.Key3 ?? "").Split(",;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))); case MarketType.Groupon: return(new GrouponApi(_log, _time, marketplace.MarketplaceId, marketplace.SellerId, marketplace.Token, marketplace.EndPointUrl)); case MarketType.DropShipper: return(new DropShipperApi(_log, _time, marketplace.MarketplaceId, marketplace.StoreUrl, marketplace.Token, StringHelper.TryGetInt(marketplace.Key2) ?? 0, marketplace.EndPointUrl)); case MarketType.OverStock: return(new SupplieroasisApi(_log, _time, marketplace.Token, marketplace.Key1, marketplace.EndPointUrl)); } throw new NotImplementedException("GetApi, market=" + market.ToString()); }