Skip to content

Commit ab8bbe1

Browse files
committed
code updated for API changes
1 parent eb4f5b6 commit ab8bbe1

File tree

2 files changed

+334
-311
lines changed

2 files changed

+334
-311
lines changed

NHB3/ApiConnect.cs

+16
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ public JArray getMarket() {
5656
return new JArray();
5757
}
5858

59+
public JArray getMarketForAlgo(String algorithm)
60+
{
61+
string marketResponse = api.get("/main/api/v2/public/orders/active2?algorithm="+algorithm, false);
62+
if (String.IsNullOrEmpty(marketResponse))
63+
{
64+
return new JArray();
65+
}
66+
67+
JObject marektObject = JsonConvert.DeserializeObject<JObject>(marketResponse);
68+
if (marektObject["error_id"] == null)
69+
{
70+
return marektObject["list"] as JArray;
71+
}
72+
return new JArray();
73+
}
74+
5975
public bool settingsOk() {
6076
string accountsResponse = api.get("/main/api/v2/accounting/accounts2", true);
6177

0 commit comments

Comments
 (0)