From 0fe35d613c7a8b9b00af9a342f07166ed09bd0eb Mon Sep 17 00:00:00 2001 From: Jkorf Date: Mon, 25 Nov 2024 10:15:41 +0100 Subject: [PATCH] Removed restClient.SpotApi.Account.GetAutoConvertStableCoinConfigAsync, SetAutoConvertStableCoinConfigAsync and ConvertBusdAsync as theyre deprecated --- .../BinanceRestIntegrationTests.cs | 1 - Binance.Net.UnitTests/RestRequestTests.cs | 3 -- Binance.Net/Binance.Net.xml | 42 ---------------- .../BinanceRestClientSpotApiAccount.cs | 49 ------------------- .../IBinanceRestClientSpotApiAccount.cs | 33 ------------- 5 files changed, 128 deletions(-) diff --git a/Binance.Net.UnitTests/BinanceRestIntegrationTests.cs b/Binance.Net.UnitTests/BinanceRestIntegrationTests.cs index 075e9132..00bef64d 100644 --- a/Binance.Net.UnitTests/BinanceRestIntegrationTests.cs +++ b/Binance.Net.UnitTests/BinanceRestIntegrationTests.cs @@ -80,7 +80,6 @@ public async Task TestSpotAccount() await RunAndCheckResult(client => client.SpotApi.Account.GetRebateHistoryAsync(default, default, default, default, default), true); await RunAndCheckResult(client => client.SpotApi.Account.GetPortfolioMarginCollateralRateAsync(default, default), true); await RunAndCheckResult(client => client.SpotApi.Account.GetPortfolioMarginBankruptcyLoanAsync(default, default), true); - await RunAndCheckResult(client => client.SpotApi.Account.GetAutoConvertStableCoinConfigAsync(default, default), true); await RunAndCheckResult(client => client.SpotApi.Account.GetBusdConvertHistoryAsync(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow, default, default, default, default, default, default, default), true); await RunAndCheckResult(client => client.SpotApi.Account.GetCloudMiningHistoryAsync(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow, default, default, default, default, default, default, default), true); await RunAndCheckResult(client => client.SpotApi.Account.GetIsolatedMarginFeeDataAsync(default, default, default, default), true); diff --git a/Binance.Net.UnitTests/RestRequestTests.cs b/Binance.Net.UnitTests/RestRequestTests.cs index b8118731..f48cc9ff 100644 --- a/Binance.Net.UnitTests/RestRequestTests.cs +++ b/Binance.Net.UnitTests/RestRequestTests.cs @@ -84,9 +84,6 @@ public async Task ValidateSpotAccountCalls() await tester.ValidateAsync(client => client.SpotApi.Account.GetPortfolioMarginAccountInfoAsync(), "GetPortfolioMarginAccountInfo"); await tester.ValidateAsync(client => client.SpotApi.Account.GetPortfolioMarginBankruptcyLoanAsync(), "GetPortfolioMarginBankruptcyLoan"); await tester.ValidateAsync(client => client.SpotApi.Account.PortfolioMarginBankruptcyLoanRepayAsync(), "PortfolioMarginBankruptcyLoanRepay"); - await tester.ValidateAsync(client => client.SpotApi.Account.GetAutoConvertStableCoinConfigAsync(), "GetAutoConvertStableCoinConfig"); - await tester.ValidateAsync(client => client.SpotApi.Account.SetAutoConvertStableCoinConfigAsync("ETH", true), "SetAutoConvertStableCoinConfig"); - await tester.ValidateAsync(client => client.SpotApi.Account.ConvertBusdAsync("1", "ETH", 1, "USDT"), "ConvertBusd"); await tester.ValidateAsync(client => client.SpotApi.Account.GetBusdConvertHistoryAsync(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow), "GetBusdConvertHistory"); await tester.ValidateAsync(client => client.SpotApi.Account.GetCloudMiningHistoryAsync(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow), "GetCloudMiningHistory"); await tester.ValidateAsync(client => client.SpotApi.Account.GetIsolatedMarginFeeDataAsync(), "GetIsolatedMarginFeeData"); diff --git a/Binance.Net/Binance.Net.xml b/Binance.Net/Binance.Net.xml index 518a1a3b..00ede153 100644 --- a/Binance.Net/Binance.Net.xml +++ b/Binance.Net/Binance.Net.xml @@ -1403,15 +1403,6 @@ - - - - - - - - - @@ -9363,39 +9354,6 @@ Cancellation token - - - Get auto conversion settings - - - The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request - Cancellation token - - - - - Set auto conversion configuration - - - Asset to configure (USDC, USDP or TUSD) - Enable or not - The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request - Cancellation token - - - - - Convert transfer, convert between BUSD and stablecoins. - - - The unique user-defined transaction id, min length 20 - The current asset, for example `ETH` - Quantity - Target asset you want to convert - The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request - Cancellation token - - Get Busd convert history diff --git a/Binance.Net/Clients/SpotApi/BinanceRestClientSpotApiAccount.cs b/Binance.Net/Clients/SpotApi/BinanceRestClientSpotApiAccount.cs index bb4931c9..a9b386ef 100644 --- a/Binance.Net/Clients/SpotApi/BinanceRestClientSpotApiAccount.cs +++ b/Binance.Net/Clients/SpotApi/BinanceRestClientSpotApiAccount.cs @@ -1142,55 +1142,6 @@ public async Task> PortfolioMarginBankruptcyLo #endregion - #region Get Auto Conversion config - - /// - public async Task> GetAutoConvertStableCoinConfigAsync(long? receiveWindow = null, CancellationToken ct = default) - { - var parameters = new ParameterCollection(); - parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)); - var request = _definitions.GetOrCreate(HttpMethod.Get, "sapi/v1/capital/contract/convertible-coins", BinanceExchange.RateLimiter.SpotRestUid, 600, true); - return await _baseClient.SendAsync(request, parameters, ct).ConfigureAwait(false); - } - - #endregion - - #region Set Auto Conversion config - - /// - public async Task SetAutoConvertStableCoinConfigAsync(string asset, bool enable, long? receiveWindow = null, CancellationToken ct = default) - { - var parameters = new ParameterCollection() - { - { "coin", asset }, - { "enable", enable } - }; - parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)); - var request = _definitions.GetOrCreate(HttpMethod.Post, "sapi/v1/capital/contract/convertible-coins", BinanceExchange.RateLimiter.SpotRestUid, 600, true); - return await _baseClient.SendAsync(request, parameters, ct).ConfigureAwait(false); - } - - #endregion - - #region Convert BUSD - - /// - public async Task> ConvertBusdAsync(string clientTransferId, string asset, decimal quantity, string targetAsset, long? receiveWindow = null, CancellationToken ct = default) - { - var parameters = new ParameterCollection() - { - { "clientTranId", clientTransferId }, - { "asset", asset }, - { "amount", quantity }, - { "targetAsset", targetAsset } - }; - parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)); - var request = _definitions.GetOrCreate(HttpMethod.Post, "sapi/v1/asset/convert-transfer", BinanceExchange.RateLimiter.SpotRestUid, 5, true); - return await _baseClient.SendAsync(request, parameters, ct).ConfigureAwait(false); - } - - #endregion - #region Convert BUSD history /// diff --git a/Binance.Net/Interfaces/Clients/SpotApi/IBinanceRestClientSpotApiAccount.cs b/Binance.Net/Interfaces/Clients/SpotApi/IBinanceRestClientSpotApiAccount.cs index faee6e74..c2bf4f13 100644 --- a/Binance.Net/Interfaces/Clients/SpotApi/IBinanceRestClientSpotApiAccount.cs +++ b/Binance.Net/Interfaces/Clients/SpotApi/IBinanceRestClientSpotApiAccount.cs @@ -728,39 +728,6 @@ Task> DisableIsolatedMarginAcco /// Task> PortfolioMarginBankruptcyLoanRepayAsync(long? receiveWindow = null, CancellationToken ct = default); - /// - /// Get auto conversion settings - /// - /// - /// The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request - /// Cancellation token - /// - Task> GetAutoConvertStableCoinConfigAsync(long? receiveWindow = null, CancellationToken ct = default); - - /// - /// Set auto conversion configuration - /// - /// - /// Asset to configure (USDC, USDP or TUSD) - /// Enable or not - /// The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request - /// Cancellation token - /// - Task SetAutoConvertStableCoinConfigAsync(string asset, bool enable, long? receiveWindow = null, CancellationToken ct = default); - - /// - /// Convert transfer, convert between BUSD and stablecoins. - /// - /// - /// The unique user-defined transaction id, min length 20 - /// The current asset, for example `ETH` - /// Quantity - /// Target asset you want to convert - /// The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request - /// Cancellation token - /// - Task> ConvertBusdAsync(string clientTransferId, string asset, decimal quantity, string targetAsset, long? receiveWindow = null, CancellationToken ct = default); - /// /// Get Busd convert history ///