Skip to content

Commit

Permalink
Fixed shared spot order interface quantity parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Oct 10, 2024
1 parent b05e06e commit 7fb534f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CoinEx.Net/Clients/SpotApiV2/CoinExRestClientSpotApiShared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ async Task<ExchangeWebResult<SharedSpotOrder>> ISpotOrderRestClient.GetSpotOrder
{
ClientOrderId = orders.Data.ClientOrderId,
OrderPrice = orders.Data.Price,
Quantity = orders.Data.QuantityAsset == null || orders.Data.QuantityAsset == request.Symbol.BaseAsset ? orders.Data.Quantity : null,
Quantity = orders.Data.QuantityAsset == null || !orders.Data.Symbol.EndsWith(orders.Data.QuantityAsset) ? orders.Data.Quantity : null,
QuantityFilled = orders.Data.QuantityFilled,
UpdateTime = orders.Data.UpdateTime,
QuoteQuantity = orders.Data.QuantityAsset == request.Symbol.QuoteAsset ? orders.Data.Quantity : null,
QuoteQuantity = orders.Data.Symbol.EndsWith(orders.Data.QuantityAsset) ? orders.Data.Quantity : null,
QuoteQuantityFilled = orders.Data.ValueFilled,
Fee = orders.Data.FeeBaseAsset > 0 ? orders.Data.FeeBaseAsset : orders.Data.FeeQuoteAsset,
FeeAsset = orders.Data.FeeBaseAsset > 0 ? request.Symbol.BaseAsset : orders.Data.FeeQuoteAsset > 0 ? request.Symbol.QuoteAsset : null,
Expand Down Expand Up @@ -276,10 +276,10 @@ async Task<ExchangeWebResult<IEnumerable<SharedSpotOrder>>> ISpotOrderRestClient
{
ClientOrderId = x.ClientOrderId,
OrderPrice = x.Price,
Quantity = x.QuantityAsset == null || x.QuantityAsset == request.Symbol?.BaseAsset ? x.Quantity : null,
Quantity = x.QuantityAsset == null || !x.Symbol.EndsWith(x.QuantityAsset) ? x.Quantity : null,
QuantityFilled = x.QuantityFilled,
UpdateTime = x.UpdateTime,
QuoteQuantity = x.QuantityAsset == request.Symbol?.QuoteAsset ? x.Quantity : null,
QuoteQuantity = x.Symbol.EndsWith(x.QuantityAsset) ? x.Quantity : null,
QuoteQuantityFilled = x.ValueFilled,
Fee = x.FeeBaseAsset > 0 ? x.FeeBaseAsset : x.FeeQuoteAsset,
FeeAsset = x.FeeBaseAsset > 0 ? request.Symbol?.BaseAsset : x.FeeQuoteAsset > 0 ? request.Symbol?.QuoteAsset : null,
Expand Down Expand Up @@ -328,13 +328,13 @@ async Task<ExchangeWebResult<IEnumerable<SharedSpotOrder>>> ISpotOrderRestClient
{
ClientOrderId = x.ClientOrderId,
OrderPrice = x.Price,
Quantity = x.QuantityAsset == null || x.QuantityAsset == request.Symbol.BaseAsset ? x.Quantity : null,
Quantity = x.QuantityAsset == null || !x.Symbol.EndsWith(x.QuantityAsset) ? x.Quantity : null,
QuantityFilled = x.QuantityFilled,
UpdateTime = x.UpdateTime,
QuoteQuantity = x.QuantityAsset == request.Symbol.QuoteAsset ? x.Quantity : null,
QuoteQuantity = x.Symbol.EndsWith(x.QuantityAsset) ? x.Quantity : null,
QuoteQuantityFilled = x.ValueFilled,
Fee = x.FeeBaseAsset > 0 ? x.FeeBaseAsset : x.FeeQuoteAsset,
FeeAsset = x.FeeBaseAsset > 0 ? request.Symbol.BaseAsset : x.FeeQuoteAsset > 0 ? request.Symbol.QuoteAsset : null,
FeeAsset = x.FeeBaseAsset > 0 ? request.Symbol?.BaseAsset : x.FeeQuoteAsset > 0 ? request.Symbol?.QuoteAsset : null,
TimeInForce = ParseTimeInForce(x.OrderType)
}).ToArray(), nextToken);
}
Expand Down

0 comments on commit 7fb534f

Please sign in to comment.