Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v2.0.6
* Issue 8: Fixed JSON deseralization error with `client.Fills.GetFillsByProductIdAsync` where `usd_volume` could be null.

## v2.0.5
* Issue 7: Fixed JSON deserialization error with `client.MarketData.GetProductsAsync` when using sandbox.

Expand Down
2 changes: 1 addition & 1 deletion Source/Coinbase.Pro/Models/Objects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public partial class Fill : Json
public bool Settled { get; set; }

[JsonProperty("usd_volume")]
public decimal UsdVolume { get; set; }
public decimal? UsdVolume { get; set; }
}

/// <summary>
Expand Down
56 changes: 56 additions & 0 deletions Source/Coinbase.Tests/GitHubIssues/Issue8.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System.Threading.Tasks;
using Coinbase.Pro;
using Coinbase.Tests.EndpointTests;
using FluentAssertions;
using NUnit.Framework;

namespace Coinbase.Tests.GitHubIssues
{
public class Issue8 : Test
{
public const string Json = @"[
{
""created_at"":""2017-09-27T22:57:14.483Z"",
""trade_id"":1111,
""product_id"":""ETH-BTC"",
""order_id"":""2F4F7C76-644E-4DCF-A7E1-5BEB57502E76"",
""user_id"":""CE3FABAC-CA62-45C2-8AAF-DB59FE353C90"",
""profile_id"":""C1B3739F-2301-4821-86B4-15463C7C353B"",
""liquidity"":""M"",
""price"":""0.08000"",
""size"":""0.9"",
""fee"":""0.0000000000000000"",
""side"":""sell"",
""settled"":true,
""usd_volume"":null
},
{
""created_at"":""2017-09-27T22:54:22.405Z"",
""trade_id"":2222,
""product_id"":""ETH-BTC"",
""order_id"":""58F5D697-66C4-428D-82A0-CEDFB881F8DA"",
""user_id"":""4476C87B-E489-44EC-9822-B8E2522FD17E"",
""profile_id"":""FEBC6314-2721-4C40-9EE6-CF5FAE135F9E"",
""liquidity"":""T"",
""price"":""0.80"",
""size"":""0.09"",
""fee"":""0.02"",
""side"":""sell"",
""settled"":true,
""usd_volume"":null
}
]";

[Test]
public async Task can_deser_null_usdvolume()
{
var client = new CoinbaseProClient();

server.RespondWithPagedResult(Json, 11, 33);

var f = await client.Fills.GetFillsByProductIdAsync("ETH-BTC");

f.Data.Count.Should().Be(2);
}
}
}