diff --git a/IEXSharp/Service/Cloud/CoreData/Crypto/CryptoService.cs b/IEXSharp/Service/Cloud/CoreData/Crypto/CryptoService.cs index ffd3a9be..7d0cb48d 100644 --- a/IEXSharp/Service/Cloud/CoreData/Crypto/CryptoService.cs +++ b/IEXSharp/Service/Cloud/CoreData/Crypto/CryptoService.cs @@ -20,10 +20,10 @@ public CryptoService(ExecutorREST executor, ExecutorSSE executorSSE) public async Task> BookAsync(string symbol) => await executor.SymbolExecuteAsync("crypto/[symbol]/book", symbol); - public SSEClient SubscribeCryptoBook(IEnumerable symbols) => + public SSEClient BookStream(IEnumerable symbols) => executorSSE.SymbolsSubscribeSSE("cryptoBook", symbols); - public SSEClient SubscribeCryptoEvents(IEnumerable symbols) => + public SSEClient EventStream(IEnumerable symbols) => executorSSE.SymbolsSubscribeSSE("cryptoEvents", symbols); public async Task> PriceAsync(string symbol) => @@ -32,7 +32,7 @@ public async Task> PriceAsync(string symbol) => public async Task> QuoteAsync(string symbol) => await executor.SymbolExecuteAsync("crypto/[symbol]/quote", symbol); - public SSEClient SubscribeCryptoQuotes(IEnumerable symbols) => + public SSEClient QuoteStream(IEnumerable symbols) => executorSSE.SymbolsSubscribeSSE("cryptoQuotes", symbols); } } \ No newline at end of file diff --git a/IEXSharp/Service/Cloud/CoreData/Crypto/ICryptoService.cs b/IEXSharp/Service/Cloud/CoreData/Crypto/ICryptoService.cs index ca8db2e3..e8e68103 100644 --- a/IEXSharp/Service/Cloud/CoreData/Crypto/ICryptoService.cs +++ b/IEXSharp/Service/Cloud/CoreData/Crypto/ICryptoService.cs @@ -19,7 +19,7 @@ public interface ICryptoService /// /// /// - SSEClient SubscribeCryptoBook(IEnumerable symbols); + SSEClient BookStream(IEnumerable symbols); /// /// @@ -27,7 +27,7 @@ public interface ICryptoService /// /// /// - SSEClient SubscribeCryptoEvents(IEnumerable symbols); + SSEClient EventStream(IEnumerable symbols); /// /// @@ -48,6 +48,6 @@ public interface ICryptoService /// /// /// - SSEClient SubscribeCryptoQuotes(IEnumerable symbols); + SSEClient QuoteStream(IEnumerable symbols); } } \ No newline at end of file diff --git a/IEXSharp/Service/Cloud/CoreData/News/INewsService.cs b/IEXSharp/Service/Cloud/CoreData/News/INewsService.cs index 46104038..9a699a3b 100644 --- a/IEXSharp/Service/Cloud/CoreData/News/INewsService.cs +++ b/IEXSharp/Service/Cloud/CoreData/News/INewsService.cs @@ -29,7 +29,7 @@ public interface INewsService /// /// One or more stock symbols. /// - SSEClient SubscribeToNews(IEnumerable symbols); + SSEClient NewsStream(IEnumerable symbols); /// /// diff --git a/IEXSharp/Service/Cloud/CoreData/News/NewsService.cs b/IEXSharp/Service/Cloud/CoreData/News/NewsService.cs index 3840ac32..6b55681e 100644 --- a/IEXSharp/Service/Cloud/CoreData/News/NewsService.cs +++ b/IEXSharp/Service/Cloud/CoreData/News/NewsService.cs @@ -25,7 +25,7 @@ public async Task>> NewsAsync(string symbo public async Task>> NewsAsync(string symbol, int last) => await executor.SymbolLastExecuteAsync>("stock/[symbol]/news/last/[last]", symbol, last); - public SSEClient SubscribeToNews(IEnumerable symbols) => + public SSEClient NewsStream(IEnumerable symbols) => executorSSE.SymbolsSubscribeSSE("news-stream", symbols); public async Task>> HistoricalNewsAsync(TimeSeriesRange? range = null, int? limit = null) diff --git a/IEXSharp/Service/Cloud/CoreData/SocialSentiment/ISocialSentimentService.cs b/IEXSharp/Service/Cloud/CoreData/SocialSentiment/ISocialSentimentService.cs index 562ba77a..f2b510ba 100644 --- a/IEXSharp/Service/Cloud/CoreData/SocialSentiment/ISocialSentimentService.cs +++ b/IEXSharp/Service/Cloud/CoreData/SocialSentiment/ISocialSentimentService.cs @@ -13,7 +13,7 @@ public interface ISocialSentimentService /// /// One or more stock symbols. /// - SSEClient SubscribeToSentiment(IEnumerable symbols); + SSEClient SentimentStream(IEnumerable symbols); /// /// diff --git a/IEXSharp/Service/Cloud/CoreData/SocialSentiment/SocialSentimentService.cs b/IEXSharp/Service/Cloud/CoreData/SocialSentiment/SocialSentimentService.cs index a911174a..b38cc668 100644 --- a/IEXSharp/Service/Cloud/CoreData/SocialSentiment/SocialSentimentService.cs +++ b/IEXSharp/Service/Cloud/CoreData/SocialSentiment/SocialSentimentService.cs @@ -18,7 +18,7 @@ internal SocialSentimentService(ExecutorREST executor, ExecutorSSE executorSSE) this.executorSSE = executorSSE; } - public SSEClient SubscribeToSentiment(IEnumerable symbols) => + public SSEClient SentimentStream(IEnumerable symbols) => executorSSE.SymbolsSubscribeSSE("sentiment", symbols); public async Task>> SentimentByMinuteAsync(string symbol) => diff --git a/IEXSharp/Service/Cloud/CoreData/StockPrices/IStockPricesService.cs b/IEXSharp/Service/Cloud/CoreData/StockPrices/IStockPricesService.cs index d9ab9a99..9446f31e 100644 --- a/IEXSharp/Service/Cloud/CoreData/StockPrices/IStockPricesService.cs +++ b/IEXSharp/Service/Cloud/CoreData/StockPrices/IStockPricesService.cs @@ -103,12 +103,13 @@ public interface IStockPricesService /// /// + /// US Stock Quote SSE Stream /// /// /// /// /// - SSEClient SubscribeStockQuotesUS(IEnumerable symbols, bool UTP, StockQuoteSSEInterval interval); + SSEClient QuoteStream(IEnumerable symbols, bool UTP, StockQuoteSSEInterval interval); /// /// diff --git a/IEXSharp/Service/Cloud/CoreData/StockPrices/StockPricesService.cs b/IEXSharp/Service/Cloud/CoreData/StockPrices/StockPricesService.cs index b68e5e1d..e7c338b6 100644 --- a/IEXSharp/Service/Cloud/CoreData/StockPrices/StockPricesService.cs +++ b/IEXSharp/Service/Cloud/CoreData/StockPrices/StockPricesService.cs @@ -109,7 +109,7 @@ public async Task> QuoteFieldAsync(string symbol, string fie return await executor.ExecuteAsync(urlPattern, pathNvc, qsb); } - public SSEClient SubscribeStockQuotesUS( + public SSEClient QuoteStream( IEnumerable symbols, bool UTP, StockQuoteSSEInterval interval) => executorSSE.SymbolsSubscribeSSE( UTP ? $"stocksUS{interval.GetDescriptionFromEnum()}" : $"stocksUSNoUTP{interval.GetDescriptionFromEnum()}", symbols); diff --git a/IEXSharpTest/Cloud/CoreData/CryptoTest.cs b/IEXSharpTest/Cloud/CoreData/CryptoTest.cs index 89097498..b138f994 100644 --- a/IEXSharpTest/Cloud/CoreData/CryptoTest.cs +++ b/IEXSharpTest/Cloud/CoreData/CryptoTest.cs @@ -35,9 +35,9 @@ public async Task BookAsyncTest(string symbol) [Test] [TestCase(new object[] { "BTCUSD" })] [TestCase(new object[] { "BTCUSD", "ETHUSD" })] - public async Task SubscribeCryptoBookTest(object[] symbols) + public async Task BookStreamTest(object[] symbols) { - using var sseClient = sandBoxClient.Crypto.SubscribeCryptoBook(symbols.Cast()); + using var sseClient = sandBoxClient.Crypto.BookStream(symbols.Cast()); sseClient.Error += (s, e) => { sseClient.Close(); @@ -56,9 +56,9 @@ public async Task SubscribeCryptoBookTest(object[] symbols) [Test] [TestCase(new object[] { "btcusdt" })] [TestCase(new object[] { "btcusdt", "ethusdt" })] - public async Task CryptoEventSSETest(object[] symbols) + public async Task EventStreamTest(object[] symbols) { - using var sseClient = sandBoxClient.Crypto.SubscribeCryptoEvents(symbols.Cast()); + using var sseClient = sandBoxClient.Crypto.EventStream(symbols.Cast()); sseClient.Error += (s, e) => { sseClient.Close(); @@ -103,9 +103,9 @@ public async Task QuoteAsyncTest(string symbol) [Test] [TestCase(new object[] { "btcusdt" })] [TestCase(new object[] { "btcusdt", "ethusdt" })] - public async Task CryptoQuoteSSETest(object[] symbols) + public async Task QuoteStreamTest(object[] symbols) { - using var sseClient = sandBoxClient.Crypto.SubscribeCryptoQuotes( + using var sseClient = sandBoxClient.Crypto.QuoteStream( symbols.Cast()); sseClient.Error += (s, e) => { diff --git a/IEXSharpTest/Cloud/CoreData/NewsTests.cs b/IEXSharpTest/Cloud/CoreData/NewsTests.cs index 4821453e..f79a7368 100644 --- a/IEXSharpTest/Cloud/CoreData/NewsTests.cs +++ b/IEXSharpTest/Cloud/CoreData/NewsTests.cs @@ -43,9 +43,9 @@ public async Task NewsAsyncTest(string symbol, int last) [Test] [TestCase(new object[] { "AAPL" })] [TestCase(new object[] { "AAPL", "FB" })] - public async Task StreamingNewsTest(object[] symbols) + public async Task NewsStreamTest(object[] symbols) { - using var sseClient = sandBoxClient.News.SubscribeToNews(symbols.Cast()); + using var sseClient = sandBoxClient.News.NewsStream(symbols.Cast()); sseClient.Error += (s, e) => { sseClient.Close(); diff --git a/IEXSharpTest/Cloud/CoreData/SocialSentimentTest.cs b/IEXSharpTest/Cloud/CoreData/SocialSentimentTest.cs index 65a66498..a81a124a 100644 --- a/IEXSharpTest/Cloud/CoreData/SocialSentimentTest.cs +++ b/IEXSharpTest/Cloud/CoreData/SocialSentimentTest.cs @@ -18,9 +18,9 @@ public void Setup() [Test] [TestCase(new object[] { "AAPL" })] [TestCase(new object[] { "AAPL", "FB" })] - public async Task StreamingSentimentTest(object[] symbols) + public async Task SentimentStreamTest(object[] symbols) { - using var sseClient = sandBoxClient.SocialSentiment.SubscribeToSentiment(symbols.Cast()); + using var sseClient = sandBoxClient.SocialSentiment.SentimentStream(symbols.Cast()); sseClient.Error += (s, e) => { sseClient.Close(); diff --git a/IEXSharpTest/Cloud/CoreData/StockPricesTest.cs b/IEXSharpTest/Cloud/CoreData/StockPricesTest.cs index 389312d1..8cfed560 100644 --- a/IEXSharpTest/Cloud/CoreData/StockPricesTest.cs +++ b/IEXSharpTest/Cloud/CoreData/StockPricesTest.cs @@ -216,7 +216,7 @@ public async Task QuoteFieldAsyncTest(string symbol, string field) [TestCase(new object[] { "spy", "aapl" }, false, StockQuoteSSEInterval.OneSecond)] public async Task StockQuoteUSSSETest(object[] symbols, bool UTP, StockQuoteSSEInterval interval) { - using var sseClient = sandBoxClient.StockPrices.SubscribeStockQuotesUS( + using var sseClient = sandBoxClient.StockPrices.QuoteStream( symbols.Cast(), UTP: UTP, interval: interval); sseClient.Error += (s, e) => { diff --git a/README.md b/README.md index d0ef9f3f..997795ca 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,9 @@ using (var iexCloudClient = } ``` -To use SSE streaming (only included with paid IEX subscription plans). Extended [example in wiki](https://github.com/vslee/IEXSharp/wiki/SSE-Streaming-Example). +To use SSE streaming (only included with paid IEX subscription plans). Extended [example in the wiki](https://github.com/vslee/IEXSharp/wiki/SSE-Streaming-Example). ```c# -using (var sseClient = iexCloudClient.StockPrices.SubscribeStockQuotesUS(symbols: new string[] { "spy", "aapl" }, +using (var sseClient = iexCloudClient.StockPrices.QuoteStream(symbols: new string[] { "spy", "aapl" }, UTP: false, interval: StockQuoteSSEInterval.OneSecond)) { sseClient.Error += (s, e) =>