From 45d3caa6419f6cf74f6288684b90052613f1ded9 Mon Sep 17 00:00:00 2001 From: Vlad Dumitru Date: Thu, 3 Oct 2024 11:31:07 +0300 Subject: [PATCH] Add network for withdrawals --- .../API/Exchanges/BinanceGroup/BinanceGroupCommon.cs | 5 +++++ src/ExchangeSharp/Model/ExchangeWithdrawalRequest.cs | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs b/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs index 79b5f4d7..f88e11d7 100644 --- a/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs +++ b/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs @@ -1145,6 +1145,11 @@ ExchangeWithdrawalRequest withdrawalRequest payload["addressTag"] = withdrawalRequest.AddressTag; } + if (!string.IsNullOrWhiteSpace(withdrawalRequest.Network)) + { + payload["network"] = withdrawalRequest.Network; + } + JToken response = await MakeJsonRequestAsync( "/capital/withdraw/apply", BaseUrlSApi, diff --git a/src/ExchangeSharp/Model/ExchangeWithdrawalRequest.cs b/src/ExchangeSharp/Model/ExchangeWithdrawalRequest.cs index 3e6d9c13..4601fb7a 100644 --- a/src/ExchangeSharp/Model/ExchangeWithdrawalRequest.cs +++ b/src/ExchangeSharp/Model/ExchangeWithdrawalRequest.cs @@ -50,8 +50,13 @@ public sealed class ExchangeWithdrawalRequest /// public SecureString Code { get; set; } - /// Returns a that represents this instance. - /// A that represents this instance. + /// + /// Network to use for the withdrawal + /// + public string Network { get; set; } + + /// Returns a that represents this instance. + /// A that represents this instance. public override string ToString() { // 2.75 ETH to 0x1234asdf