Skip to content

Commit

Permalink
Fixed BingXFuturesPlaceOrderRequest serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Dec 23, 2024
1 parent 65d7249 commit 0ab76ca
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions BingX.Net/Objects/Models/BingXFuturesPlaceOrderRequest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BingX.Net.Enums;
using CryptoExchange.Net.Converters.SystemTextJson;
using System.Text.Json.Serialization;

namespace BingX.Net.Objects.Models
Expand All @@ -16,17 +17,17 @@ public record BingXFuturesPlaceOrderRequest
/// <summary>
/// Order type
/// </summary>
[JsonPropertyName("type")]
[JsonPropertyName("type"), JsonConverter(typeof(EnumConverter))]
public FuturesOrderType OrderType { get; set; }
/// <summary>
/// Order side
/// </summary>
[JsonPropertyName("side")]
[JsonPropertyName("side"), JsonConverter(typeof(EnumConverter))]
public OrderSide Side { get; set; }
/// <summary>
/// Position side
/// </summary>
[JsonPropertyName("positionSide")]
[JsonPropertyName("positionSide"), JsonConverter(typeof(EnumConverter))]
public PositionSide PositionSide { get; set; }
/// <summary>
/// Reduce only
Expand Down Expand Up @@ -61,13 +62,13 @@ public record BingXFuturesPlaceOrderRequest
/// <summary>
/// Trigger type
/// </summary>
[JsonPropertyName("workingType"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("workingType"), JsonConverter(typeof(EnumConverter)), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TriggerType? TriggerType { get; set; }
/// <summary>
/// Time in force
/// </summary>
[JsonPropertyName("timeInForce"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TriggerType? TimeInForce { get; set; }
[JsonPropertyName("timeInForce"), JsonConverter(typeof(EnumConverter)), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TimeInForce? TimeInForce { get; set; }
/// <summary>
/// Close position
/// </summary>
Expand Down Expand Up @@ -115,7 +116,7 @@ public record BingXStopOrderRequest
/// <summary>
/// Order type
/// </summary>
[JsonPropertyName("type")]
[JsonPropertyName("type"), JsonConverter(typeof(EnumConverter))]
public TakeProfitStopLossMode Type { get; set; }
/// <summary>
/// Stop price
Expand All @@ -130,7 +131,7 @@ public record BingXStopOrderRequest
/// <summary>
/// Trigger type
/// </summary>
[JsonPropertyName("workingType"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("workingType"), JsonConverter(typeof(EnumConverter)), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public TriggerType? TriggerType { get; set; }
/// <summary>
/// Stop guarenteed
Expand Down

0 comments on commit 0ab76ca

Please sign in to comment.