Skip to content

Commit da0871c

Browse files
committed
Added a missing API feature; fixed anonymous client initialization
1 parent 051ac01 commit da0871c

File tree

6 files changed

+34
-8
lines changed

6 files changed

+34
-8
lines changed

Diff for: PoloniexApi.Net.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.30723.0
4+
VisualStudioVersion = 12.0.31101.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoloniexApi.Net.Demo", "PoloniexApi.Net.Demo\PoloniexApi.Net.Demo.csproj", "{10D79671-870B-4088-9100-69E3CAAF364C}"
77
EndProject

Diff for: PoloniexApi.Net/MarketTools/Markets.Interface.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ public interface IMarkets
1515
/// <param name="depth">The number of orders to fetch from each side.</param>
1616
Task<IOrderBook> GetOpenOrdersAsync(CurrencyPair currencyPair, uint depth = 50);
1717

18-
/// <summary>Fetches the last 200 trades for a given market.</summary>
18+
/// <summary>Fetches the last 200 trades of a given market.</summary>
1919
/// <param name="currencyPair">The currency pair, which consists of the currency being traded on the market, and the base's code.</param>
2020
Task<IList<ITrade>> GetTradesAsync(CurrencyPair currencyPair);
2121

22+
/// <summary>Fetches the trades of a given market in a given time period.</summary>
23+
/// <param name="currencyPair">The currency pair, which consists of the currency being traded on the market, and the base's code.</param>
24+
/// <param name="startTime">The time to start fetching data from.</param>
25+
/// <param name="endTime">The time to stop fetching data at.</param>
26+
Task<IList<ITrade>> GetTradesAsync(CurrencyPair currencyPair, DateTime startTime, DateTime endTime);
27+
2228
/// <summary>Fetches the chart data which Poloniex uses for their candlestick graphs for a market view of a given time period.</summary>
2329
/// <param name="currencyPair">The currency pair, which consists of the currency being traded on the market, and the base's code.</param>
2430
/// <param name="period">The sampling frequency of the chart.</param>

Diff for: PoloniexApi.Net/MarketTools/Markets.cs

+19-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private IDictionary<CurrencyPair, IMarketData> GetSummary()
2424
);
2525
}
2626

27-
public IOrderBook GetOpenOrders(CurrencyPair currencyPair, uint depth)
27+
private IOrderBook GetOpenOrders(CurrencyPair currencyPair, uint depth)
2828
{
2929
var data = GetData<OrderBook>(
3030
"returnOrderBook",
@@ -34,7 +34,7 @@ public IOrderBook GetOpenOrders(CurrencyPair currencyPair, uint depth)
3434
return data;
3535
}
3636

37-
public IList<ITrade> GetTrades(CurrencyPair currencyPair)
37+
private IList<ITrade> GetTrades(CurrencyPair currencyPair)
3838
{
3939
var data = GetData<IList<Trade>>(
4040
"returnTradeHistory",
@@ -43,7 +43,18 @@ public IList<ITrade> GetTrades(CurrencyPair currencyPair)
4343
return new List<ITrade>(data);
4444
}
4545

46-
public IList<IMarketChartData> GetChartData(CurrencyPair currencyPair, MarketPeriod period, DateTime startTime, DateTime endTime)
46+
private IList<ITrade> GetTrades(CurrencyPair currencyPair, DateTime startTime, DateTime endTime)
47+
{
48+
var data = GetData<IList<Trade>>(
49+
"returnTradeHistory",
50+
"currencyPair=" + currencyPair,
51+
"start=" + Helper.DateTimeToUnixTimeStamp(startTime),
52+
"end=" + Helper.DateTimeToUnixTimeStamp(endTime)
53+
);
54+
return new List<ITrade>(data);
55+
}
56+
57+
private IList<IMarketChartData> GetChartData(CurrencyPair currencyPair, MarketPeriod period, DateTime startTime, DateTime endTime)
4758
{
4859
var data = GetData<IList<MarketChartData>>(
4960
"returnChartData",
@@ -70,6 +81,11 @@ public Task<IList<ITrade>> GetTradesAsync(CurrencyPair currencyPair)
7081
return Task.Factory.StartNew(() => GetTrades(currencyPair));
7182
}
7283

84+
public Task<IList<ITrade>> GetTradesAsync(CurrencyPair currencyPair, DateTime startTime, DateTime endTime)
85+
{
86+
return Task.Factory.StartNew(() => GetTrades(currencyPair, startTime, endTime));
87+
}
88+
7389
public Task<IList<IMarketChartData>> GetChartDataAsync(CurrencyPair currencyPair, MarketPeriod period, DateTime startTime, DateTime endTime)
7490
{
7591
return Task.Factory.StartNew(() => GetChartData(currencyPair, period, startTime, endTime));

Diff for: PoloniexApi.Net/PoloniexClient.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public PoloniexClient(string publicApiKey, string privateApiKey)
3535
}
3636

3737
/// <summary>Creates a new, unauthorized instance of Poloniex API .NET's client service.</summary>
38-
public PoloniexClient() : this(null, null)
38+
public PoloniexClient() : this("", "")
3939
{
4040

4141
}

Diff for: PoloniexApi.Net/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
// You can specify all the values or you can default the Build and Revision Numbers
3030
// by using the '*' as shown below:
3131
// [assembly: AssemblyVersion("1.0.*")]
32-
[assembly: AssemblyVersion("1.1.4")]
33-
[assembly: AssemblyFileVersion("1.1.4")]
32+
[assembly: AssemblyVersion("1.2.0")]
33+
[assembly: AssemblyFileVersion("1.2.0")]
3434
[assembly: NeutralResourcesLanguageAttribute("en")]

Diff for: PoloniexApi.Net/TradingTools/Trading.Interface.cs

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ public interface ITrading
1313

1414
/// <summary>Fetches the trades made in your account, ordered by most recent first.</summary>
1515
/// <param name="currencyPair">The currency pair, which consists of the currency being traded on the market, and the base's code.</param>
16+
Task<IList<ITrade>> GetTradesAsync(CurrencyPair currencyPair);
17+
18+
/// <summary>Fetches the trades made in your account in a given time period, ordered by most recent first.</summary>
19+
/// <param name="currencyPair">The currency pair, which consists of the currency being traded on the market, and the base's code.</param>
1620
/// <param name="startTime">The time to start fetching data from.</param>
1721
/// <param name="endTime">The time to stop fetching data at.</param>
1822
Task<IList<ITrade>> GetTradesAsync(CurrencyPair currencyPair, DateTime startTime, DateTime endTime);

0 commit comments

Comments
 (0)