Skip to content

Commit

Permalink
Merge pull request #8 from Grepsy/master
Browse files Browse the repository at this point in the history
Use new Order class instead of HistoricAccountOrder for /account/getorder call
  • Loading branch information
Coinio committed Oct 22, 2017
2 parents 7354674 + 03d7d8b commit c15f9e2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions BittrexClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public async Task<ApiResult<HistoricAccountOrder[]>> GetOrderHistory(String mark
/// </summary>
/// <param name="uuid"></param>
/// <returns></returns>
public async Task<ApiResult<HistoricAccountOrder>> GetOrder(Guid uuid)
public async Task<ApiResult<Order>> GetOrder(Guid uuid)
{
var nonceParam = BuildParameter("nonce", GenerateNonce());
var uuidParam = BuildParameter("uuid", uuid);
Expand All @@ -303,7 +303,7 @@ public async Task<ApiResult<HistoricAccountOrder>> GetOrder(Guid uuid)

var json = await GetPrivateAsync(url, _apiSecret);

return JsonConvert.DeserializeObject<ApiResult<HistoricAccountOrder>>(json);
return JsonConvert.DeserializeObject<ApiResult<Order>>(json);
}

/// <summary>
Expand Down
35 changes: 35 additions & 0 deletions Models/Order.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Bittrex.Api.Client.Models
{
/// <summary>
/// An order result from the /account/getorder end point
/// </summary>
public class Order
{
public Guid? AccountId { get; set; }
public Guid OrderUuid { get; set; }
public String Exchange { get; set; }
public String Type { get; set; }
public Decimal Quantity { get; set; }
public Decimal QuantityRemaining { get; set; }
public Decimal Limit { get; set; }
public Decimal Reserved { get; set; }
public Decimal ReservedRemaining { get; set; }
public Decimal CommissionReservedPaid { get; set; }
public Decimal CommissionReserveRemaining { get; set; }
public Decimal CommissionPaid { get; set; }
public Decimal Price { get; set; }
public Decimal? PricePerUnit { get; set; }
public DateTime Opened { get; set; }
public DateTime? Closed { get; set; }
public bool IsOpen { get; set; }
public bool CancelInitiated { get; set; }
public bool ImmediateOrCancel { get; set; }
public bool IsConditional { get; set; }
public String Condition { get; set; }
public String ConditionTarget { get; set; }
}
}

0 comments on commit c15f9e2

Please sign in to comment.