From c9abb1b02108d3a4c107036c13010db7bb7d0772 Mon Sep 17 00:00:00 2001 From: hoak Date: Sun, 19 Jun 2022 22:46:21 +0100 Subject: [PATCH] Fixes incorrect base url for historical candles and trades api (#106) (cherry picked from commit 2ed39a836a0a9d832f50dae89cc26d74bfdc38c3) --- README.md | 8 ++++---- SharedBuildProperties.props | 2 +- Solnet.Mango.Examples/HistoricalDataExample.cs | 3 +++ Solnet.Mango.Examples/Solnet.Mango.Examples.csproj | 12 ++++++------ .../MangoHistoricalDataServiceTest.cs | 4 ++-- .../MangoHistoricalDataService.cs | 2 +- Solnet.Mango.Test/Solnet.Mango.Test.csproj | 6 +++--- Solnet.Mango/Solnet.Mango.csproj | 8 ++++---- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a41afcc..fe39cc1 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,10 @@ separate repository so it is contained, as the goal for [Solnet](https://github. ## Dependencies - BlockMountain.TradingView v1.0.0 -- Solnet.Serum v5.0.5 -- Solnet.Wallet v5.0.5 -- Solnet.Rpc v5.0.5 -- Solnet.Programs v5.0.5 +- Solnet.Serum v5.0.6 +- Solnet.Wallet v5.0.6 +- Solnet.Rpc v5.0.6 +- Solnet.Programs v5.0.6 ## Examples diff --git a/SharedBuildProperties.props b/SharedBuildProperties.props index 04a5a35..4034ccb 100644 --- a/SharedBuildProperties.props +++ b/SharedBuildProperties.props @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> Solnet.Mango - 5.0.5 + 5.0.6 Copyright 2022 © blockmountain blockmountain blockmountain diff --git a/Solnet.Mango.Examples/HistoricalDataExample.cs b/Solnet.Mango.Examples/HistoricalDataExample.cs index 284df6d..95357c2 100644 --- a/Solnet.Mango.Examples/HistoricalDataExample.cs +++ b/Solnet.Mango.Examples/HistoricalDataExample.cs @@ -37,6 +37,9 @@ public HistoricalDataExample() public void Run() { + var now = DateTime.Now; + var ohlcv = _mangoHistoricalDataService.GetHistory(now.Subtract(TimeSpan.FromDays(30)), now, "SOL-PERP", "1D"); + //var spotStats = _mangoHistoricalDataService.GetMarginLendingStats(); //var perpStats = _mangoHistoricalDataService.GetPerpStats(); diff --git a/Solnet.Mango.Examples/Solnet.Mango.Examples.csproj b/Solnet.Mango.Examples/Solnet.Mango.Examples.csproj index fbc7b4c..51168a5 100644 --- a/Solnet.Mango.Examples/Solnet.Mango.Examples.csproj +++ b/Solnet.Mango.Examples/Solnet.Mango.Examples.csproj @@ -13,12 +13,12 @@ - - - - - - + + + + + + diff --git a/Solnet.Mango.Historical.Test/MangoHistoricalDataServiceTest.cs b/Solnet.Mango.Historical.Test/MangoHistoricalDataServiceTest.cs index 9969d03..11e3043 100644 --- a/Solnet.Mango.Historical.Test/MangoHistoricalDataServiceTest.cs +++ b/Solnet.Mango.Historical.Test/MangoHistoricalDataServiceTest.cs @@ -317,7 +317,7 @@ public void GetVolumeInfoUnsuccessful() public void GetRecentTrades() { string responseData = File.ReadAllText("Resources/RecentTrades.json"); - var url = EventHistoryApiCandlesBaseUrl + "trades/address/2TgaaVoHgnSeEtXvWTx13zQeTf4hYWAMEiMQdcG6EwHi"; + var url = EventHistoryApiCandlesBaseUrl + "tv/trades/address/2TgaaVoHgnSeEtXvWTx13zQeTf4hYWAMEiMQdcG6EwHi"; Mock messageHandlerMock = SetupHttpClientTest(responseData, url); HttpClient httpClient = new(messageHandlerMock.Object) @@ -341,7 +341,7 @@ public void GetRecentTrades() public void GetRecentTradesUnsuccessful() { Mock messageHandlerMock = SetupHttpClientUnsuccessfulTest(); - var url = EventHistoryApiCandlesBaseUrl + "trades/address/2TgaaVoHgnSeEtXvWTx13zQeTf4hYWAMEiMQdcG6EwHi"; + var url = EventHistoryApiCandlesBaseUrl + "tv/trades/address/2TgaaVoHgnSeEtXvWTx13zQeTf4hYWAMEiMQdcG6EwHi"; HttpClient httpClient = new(messageHandlerMock.Object) { diff --git a/Solnet.Mango.Historical/MangoHistoricalDataService.cs b/Solnet.Mango.Historical/MangoHistoricalDataService.cs index 69c8fb2..776bc96 100644 --- a/Solnet.Mango.Historical/MangoHistoricalDataService.cs +++ b/Solnet.Mango.Historical/MangoHistoricalDataService.cs @@ -35,7 +35,7 @@ public class MangoHistoricalDataService : IMangoHistoricalDataService /// /// The base url for the candlestick data endpoints. /// - private static readonly string EventHistoryApiCandlesBaseUrl = "https://event-history-api-candles.herokuapp.com/"; + private static readonly string EventHistoryApiCandlesBaseUrl = "https://event-history-api-candles.herokuapp.com/tv/"; /// /// The base url for the mango fills service. diff --git a/Solnet.Mango.Test/Solnet.Mango.Test.csproj b/Solnet.Mango.Test/Solnet.Mango.Test.csproj index 16a2a09..e60adae 100644 --- a/Solnet.Mango.Test/Solnet.Mango.Test.csproj +++ b/Solnet.Mango.Test/Solnet.Mango.Test.csproj @@ -15,9 +15,9 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + + + diff --git a/Solnet.Mango/Solnet.Mango.csproj b/Solnet.Mango/Solnet.Mango.csproj index 1ce939f..76655ae 100644 --- a/Solnet.Mango/Solnet.Mango.csproj +++ b/Solnet.Mango/Solnet.Mango.csproj @@ -19,10 +19,10 @@ - - - - + + + +