diff --git a/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs b/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs index 15369fb0..c97edecd 100644 --- a/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs @@ -777,6 +777,8 @@ protected override async Task OnWithdrawAsync(Exchan resp.Id = result[0]["withdrawal_id"].ToStringInvariant(); resp.Message = result[0]["message"].ToStringInvariant(); + resp.Fee = result[0].Value("WITHDRAWAL_FEE"); + return resp; } diff --git a/src/ExchangeSharp/API/Exchanges/Bittrex/ExchangeBittrexAPI.cs b/src/ExchangeSharp/API/Exchanges/Bittrex/ExchangeBittrexAPI.cs index 30620206..7e588999 100644 --- a/src/ExchangeSharp/API/Exchanges/Bittrex/ExchangeBittrexAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Bittrex/ExchangeBittrexAPI.cs @@ -546,7 +546,8 @@ protected override async Task OnWithdrawAsync(Exchan ExchangeWithdrawalResponse withdrawalResponse = new ExchangeWithdrawalResponse { Id = result["id"].ToStringInvariant(), - Message = result["status"].ToStringInvariant() + Message = result["status"].ToStringInvariant(), + Fee = result.Value("txCost") }; return withdrawalResponse; diff --git a/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs b/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs index ef9c6c0c..8f255eb5 100644 --- a/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs @@ -670,10 +670,12 @@ protected override async Task OnWithdrawAsync(Exchan } var result = await MakeJsonRequestAsync("/withdrawals/crypto", null, payload, "POST"); + var feeParsed = decimal.TryParse(result.Fee, out var fee); return new ExchangeWithdrawalResponse { - Id = result.Id + Id = result.Id, + Fee = feeParsed ? fee : (decimal?)null }; } diff --git a/src/ExchangeSharp/API/Exchanges/FTX/ExchangeFTXAPI.cs b/src/ExchangeSharp/API/Exchanges/FTX/ExchangeFTXAPI.cs index bb7708e6..cca51d07 100644 --- a/src/ExchangeSharp/API/Exchanges/FTX/ExchangeFTXAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/FTX/ExchangeFTXAPI.cs @@ -348,7 +348,8 @@ protected override async Task OnWithdrawAsync(Exchan return new ExchangeWithdrawalResponse { - Id = result["id"].ToString() + Id = result["id"].ToString(), + Fee = result.Value("fee") }; } diff --git a/src/ExchangeSharp/API/Exchanges/Kraken/ExchangeKrakenAPI.cs b/src/ExchangeSharp/API/Exchanges/Kraken/ExchangeKrakenAPI.cs index cb5e7aea..b8d8c30e 100644 --- a/src/ExchangeSharp/API/Exchanges/Kraken/ExchangeKrakenAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Kraken/ExchangeKrakenAPI.cs @@ -456,7 +456,8 @@ protected override async Task OnWithdrawAsync(Exchan return new ExchangeWithdrawalResponse { - Id = result["refid"].ToString() + Id = result["refid"].ToString(), + Fee = result.Value("fee") }; } diff --git a/src/ExchangeSharp/Model/ExchangeWithdrawalResponse.cs b/src/ExchangeSharp/Model/ExchangeWithdrawalResponse.cs index 7ac45b2b..867203c4 100644 --- a/src/ExchangeSharp/Model/ExchangeWithdrawalResponse.cs +++ b/src/ExchangeSharp/Model/ExchangeWithdrawalResponse.cs @@ -1,4 +1,4 @@ -/* +/* MIT LICENSE Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com @@ -26,11 +26,14 @@ public sealed class ExchangeWithdrawalResponse /// Whether the withdrawal was successful public bool Success { get; set; } = true; - /// Returns a that represents this instance. - /// A that represents this instance. - public override string ToString() + /// Fee for the withdrawal + public decimal? Fee { get; set; } + + /// Returns a that represents this instance. + /// A that represents this instance. + public override string ToString() { return $"Success: {Success} Id: {Id ?? "null"} Message: {Message ?? "null"}"; } } -} \ No newline at end of file +}