diff --git a/.gitignore b/.gitignore index 2ce82117..4a826d73 100644 --- a/.gitignore +++ b/.gitignore @@ -382,3 +382,6 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ + +# Jetbrains IDE Files +.idea/ diff --git a/IEXSharp/Helper/ExecutorREST.cs b/IEXSharp/Helper/ExecutorREST.cs index bfef311b..44e60841 100644 --- a/IEXSharp/Helper/ExecutorREST.cs +++ b/IEXSharp/Helper/ExecutorREST.cs @@ -72,8 +72,11 @@ public async Task> ExecuteAsync( { // "Forbidden" or "Not found" return new IEXResponse() { ErrorMessage = content }; } - else return new IEXResponse() { Data = - JsonConvert.DeserializeObject(content, jsonSerializerSettings) }; + else { + return new IEXResponse() { + Data = JsonConvert.DeserializeObject(content, jsonSerializerSettings) + }; + } } catch (JsonException ex) { diff --git a/IEXSharp/Model/ReferenceData/Response/SectorResponse.cs b/IEXSharp/Model/ReferenceData/Response/SectorResponse.cs new file mode 100644 index 00000000..344596c3 --- /dev/null +++ b/IEXSharp/Model/ReferenceData/Response/SectorResponse.cs @@ -0,0 +1,7 @@ +namespace VSLee.IEXSharp.Model.ReferenceData.Response +{ + public class SectorResponse + { + public string name { get; set; } + } +} \ No newline at end of file diff --git a/IEXSharp/Model/ReferenceData/Response/SymbolCryptoResponse.cs b/IEXSharp/Model/ReferenceData/Response/SymbolCryptoResponse.cs new file mode 100644 index 00000000..2a843285 --- /dev/null +++ b/IEXSharp/Model/ReferenceData/Response/SymbolCryptoResponse.cs @@ -0,0 +1,17 @@ +using System; + +namespace VSLee.IEXSharp.Model.ReferenceData.Response +{ + public class SymbolCryptoResponse + { + public string symbol { get; set; } + public string name { get; set; } + public string exchange { get; set; } + public DateTime date { get; set; } + public string type { get; set; } + public string iexId { get; set; } + public string region { get; set; } + public string currency { get; set; } + public bool isEnabled { get; set; } + } +} \ No newline at end of file diff --git a/IEXSharp/Model/ReferenceData/Response/TagResponse.cs b/IEXSharp/Model/ReferenceData/Response/TagResponse.cs new file mode 100644 index 00000000..0a51de5f --- /dev/null +++ b/IEXSharp/Model/ReferenceData/Response/TagResponse.cs @@ -0,0 +1,7 @@ +namespace VSLee.IEXSharp.Model.ReferenceData.Response +{ + public class TagResponse + { + public string name { get; set; } + } +} \ No newline at end of file diff --git a/IEXSharp/Service/V2/ReferenceData/IReferenceDataService.cs b/IEXSharp/Service/V2/ReferenceData/IReferenceDataService.cs index cab1d660..4d6b918d 100644 --- a/IEXSharp/Service/V2/ReferenceData/IReferenceDataService.cs +++ b/IEXSharp/Service/V2/ReferenceData/IReferenceDataService.cs @@ -22,6 +22,12 @@ public interface IReferenceDataService /// Task> SymbolFXAsync(); + /// + /// + /// + /// + Task>> SymbolCryptoAsync(); + /// /// /// @@ -60,12 +66,24 @@ public interface IReferenceDataService /// Task>> SymbolsOTCAsync(); + /// + /// + /// + /// + Task>> SectorsAsync(); + /// /// /// /// Task>> SymbolsAsync(); + /// + /// + /// + /// + Task>> TagsAsync(); + /// /// /// diff --git a/IEXSharp/Service/V2/ReferenceData/ReferenceDataService.cs b/IEXSharp/Service/V2/ReferenceData/ReferenceDataService.cs index c2851558..220362e0 100644 --- a/IEXSharp/Service/V2/ReferenceData/ReferenceDataService.cs +++ b/IEXSharp/Service/V2/ReferenceData/ReferenceDataService.cs @@ -34,6 +34,9 @@ public async Task>> SearchAsync(string f public async Task> SymbolFXAsync() => await _executor.NoParamExecute("ref-data/fx/symbols"); + public async Task>> SymbolCryptoAsync() => + await _executor.NoParamExecute>("ref-data/crypto/symbols"); + public async Task>> SymbolsIEXAsync() => await _executor.NoParamExecute>("ref-data/iex/symbols"); @@ -72,11 +75,17 @@ public async Task>> SymbolsMut await _executor.NoParamExecute>("ref-data/mutual-funds/symbols"); public async Task>> SymbolsOTCAsync() => - await _executor.NoParamExecute < IEnumerable>("ref-data/otc/symbols"); + await _executor.NoParamExecute>("ref-data/otc/symbols"); + + public async Task>> SectorsAsync() => + await _executor.NoParamExecute>("ref-data/sectors"); public async Task>> SymbolsAsync() => await _executor.NoParamExecute>("ref-data/symbols"); + public async Task>> TagsAsync() => + await _executor.NoParamExecute>("ref-data/tags"); + public async Task>> ExchangeUSAsync() => await _executor.NoParamExecute>("ref-data/market/us/exchanges"); diff --git a/IEXSharp/Service/V2/Stock/IStockService.cs b/IEXSharp/Service/V2/Stock/IStockService.cs index 25ef304d..3c9dad07 100644 --- a/IEXSharp/Service/V2/Stock/IStockService.cs +++ b/IEXSharp/Service/V2/Stock/IStockService.cs @@ -404,6 +404,6 @@ public interface IStockService /// /// /// - Task> VolumeByVenueAsync(string symbol); + Task>> VolumeByVenueAsync(string symbol); } } \ No newline at end of file diff --git a/IEXSharp/Service/V2/Stock/StockService.cs b/IEXSharp/Service/V2/Stock/StockService.cs index 8006458a..f0bd84a7 100644 --- a/IEXSharp/Service/V2/Stock/StockService.cs +++ b/IEXSharp/Service/V2/Stock/StockService.cs @@ -451,7 +451,7 @@ public async Task> UpcomingEventMarketA return await executor.ExecuteAsync(urlPattern, pathNvc, qsb); } - public async Task> VolumeByVenueAsync(string symbol) => - await executor.SymbolExecuteAsync("stock/[symbol]/delayed-quote", symbol); + public async Task>> VolumeByVenueAsync(string symbol) => + await executor.SymbolExecuteAsync>("stock/[symbol]/volume-by-venue", symbol); } } \ No newline at end of file diff --git a/IEXSharpTest/Cloud(V2)/ReferenceDataTest.cs b/IEXSharpTest/Cloud(V2)/ReferenceDataTest.cs index 8a3c769b..6e70d6e2 100644 --- a/IEXSharpTest/Cloud(V2)/ReferenceDataTest.cs +++ b/IEXSharpTest/Cloud(V2)/ReferenceDataTest.cs @@ -50,6 +50,20 @@ public async Task SymbolsFXAsyncTest() Assert.IsNotNull(response.Data); } + [Test] + public async Task SymbolCryptoAsyncTest() + { + var response = await sandBoxClient.ReferenceData.SymbolCryptoAsync(); + + Assert.IsNull(response.ErrorMessage); + Assert.IsNotNull(response.Data); + Assert.GreaterOrEqual(response.Data.Count(), 1); + + Assert.IsNotNull(response.Data.First().symbol); + Assert.IsNotNull(response.Data.First().name); + Assert.IsNotNull(response.Data.First().isEnabled); + } + [Test] public async Task SymbolsIEXAsyncTest() { @@ -103,7 +117,7 @@ public async Task SymbolsMutualFundAsyncTest() } [Test] - public async Task SymbolsOTCAsync() + public async Task SymbolsOTCAsyncTest() { var response = await sandBoxClient.ReferenceData.SymbolsOTCAsync(); @@ -112,6 +126,16 @@ public async Task SymbolsOTCAsync() Assert.GreaterOrEqual(response.Data.Count(), 1); } + [Test] + public async Task SectorsAsyncTest() + { + var response = await sandBoxClient.ReferenceData.SectorsAsync(); + + Assert.IsNull(response.ErrorMessage); + Assert.IsNotNull(response.Data); + Assert.GreaterOrEqual(response.Data.Count(), 1); + } + [Test] public async Task SymbolsAsyncTest() { @@ -122,6 +146,16 @@ public async Task SymbolsAsyncTest() Assert.GreaterOrEqual(response.Data.Count(), 1); } + [Test] + public async Task TagsAsyncTest() + { + var response = await sandBoxClient.ReferenceData.TagsAsync(); + + Assert.IsNull(response.ErrorMessage); + Assert.IsNotNull(response.Data); + Assert.GreaterOrEqual(response.Data.Count(), 1); + } + [Test] public async Task ExchangeUSAsyncTest() { diff --git a/IEXSharpTest/Cloud(V2)/StockTest.cs b/IEXSharpTest/Cloud(V2)/StockTest.cs index 1be6a077..378ede76 100644 --- a/IEXSharpTest/Cloud(V2)/StockTest.cs +++ b/IEXSharpTest/Cloud(V2)/StockTest.cs @@ -696,6 +696,11 @@ public async Task VolumeByVenueAsyncTest(string symbol) Assert.IsNull(response.ErrorMessage); Assert.IsNotNull(response.Data); + + Assert.GreaterOrEqual(response.Data.Count(), 1); + + Assert.IsNotNull(response.Data.First().venue); + Assert.IsNotNull(response.Data.First().volume); } } } \ No newline at end of file