Skip to content

Commit

Permalink
New API compatibility
Browse files Browse the repository at this point in the history
Compatibility with NiceHash API 1.0.10
  • Loading branch information
nicehashdev committed Feb 15, 2015
1 parent a27c8c2 commit 4a428ca
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/NiceHashBot/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.2")]
[assembly: AssemblyFileVersion("1.0.1.2")]
[assembly: AssemblyVersion("1.0.1.3")]
[assembly: AssemblyFileVersion("1.0.1.3")]
2 changes: 1 addition & 1 deletion src/NiceHashBotLib/APIWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class APIWrapper
/// <summary>
/// API Version compatible with.
/// </summary>
public readonly static string API_VERSION_COMPATIBLE = "1.0.9";
public readonly static string API_VERSION_COMPATIBLE = "1.0.10";

/// <summary>
/// URLs for NiceHash services.
Expand Down
6 changes: 6 additions & 0 deletions src/NiceHashBotLib/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public class Order
[JsonProperty(PropertyName = "end")]
public ulong EndTime;

/// <summary>
/// Type of the order (0 = standard, 1 = fixed)
/// </summary>
[JsonProperty(PropertyName = "type")]
public int OrderType;

/// <summary>
/// Service location (0 for NiceHash, 1 for WestHash).
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/NiceHashBotLib/OrderInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,11 @@ private double GetMinimalNeededPrice(Order[] AllOrders, double TotalSpeed)
private bool IncreasePrice(Order MyOrder, Order[] AllOrders, double MinimalPrice)
{
// Do not make price higher if we are already on top of the list (first alive).
// Consider fixed orders.
foreach (Order O in AllOrders)
{
if (!O.Alive) continue;
if (O.OrderType == 1) continue;

This comment has been minimized.

Copy link
@bitbandi

bitbandi Feb 16, 2015

My hint: it would be good, if this OrderType compare to a enum value.

if (O.OrderType == OrderType.Fixed) continue;
if (O == MyOrder) return false;
else break;
}
Expand Down

0 comments on commit 4a428ca

Please sign in to comment.