ExchangeSharp/API/Exchanges/Binance/ExchangeBinanceAPI.cs
/// <summary>Process the trades that executed as part of your order and sum the fees.</summary>
/// <param name="feesToken">The trades executed for a specific currency pair.</param>
/// <param name="result">The result object to append to.</param>
Process the trades that executed as part of your order and sum the fees.
Process the trades that executed as part of your order and sum the fees .
private static void ParseFees(JToken feesToken, ExchangeOrderResult result)
        {
            var tradesInOrder = feesToken.Where(x => x["orderId"].ToStringInvariant() == result.OrderId);
            bool currencySet = false;
            foreach (var trade in tradesInOrder)
            {
                result.Fees += trade["commission"].ConvertInvariant<decimal>();
                if (!currencySet)
                {
                    result.FeesCurrency = trade["commissionAsset"].ToStringInvariant();
                    currencySet = true;
                }
            }
        }
private static void ParseFees ( JToken feesToken , ExchangeOrderResult result ) { var tradesInOrder = feesToken . Where ( x => x [ " " ] . ToStringInvariant ( ) == result . OrderId ) ; bool currencySet = false ; foreach ( var trade in tradesInOrder ) { result . Fees += trade [ " " ] . ConvertInvariant < decimal > ( ) ; if ( ! currencySet ) { result . FeesCurrency = trade [ " " ] . ToStringInvariant ( ) ; currencySet = true ; } } }
Process the trades that executed as part of your order and sum the fees.
Process the trades that executed as part of your order and sum the fees .
// TODO: Not sure how to handle commissions in different currencies, for example if you run out of BNB mid-trade
feesToken
JToken
The trades executed for a specific currency pair.
The trades executed for a specific currency pair .
result
ExchangeOrderResult
The result object to append to.
The result object to append to .