From 2c5bd4043b0c20498ced696b59581ba19247537f Mon Sep 17 00:00:00 2001 From: alokym86 <44226815+alokym86@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:27:07 +0300 Subject: [PATCH] fix BorrowAsync() timeInForce parameter (#231) * fix BorrowAsync() timeInForce parameter * fixed test according to BorrowAsync() signature changes --- Kucoin.Net.UnitTests/RestRequestTests.cs | 2 +- Kucoin.Net/Clients/SpotApi/KucoinRestClientSpotApiMargin.cs | 2 +- .../Clients/SpotApi/IKucoinRestClientSpotApiMargin.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Kucoin.Net.UnitTests/RestRequestTests.cs b/Kucoin.Net.UnitTests/RestRequestTests.cs index 84e3e1db..f2d1084f 100644 --- a/Kucoin.Net.UnitTests/RestRequestTests.cs +++ b/Kucoin.Net.UnitTests/RestRequestTests.cs @@ -103,7 +103,7 @@ public async Task ValidateSpotMarginCalls() opts.OutputOriginalData = true; }); var tester = new RestRequestValidator(client, "Endpoints/Spot/Margin", "https://api.kucoin.com", IsAuthenticated, "data", stjCompare: false); - await tester.ValidateAsync(client => client.SpotApi.Margin.BorrowAsync("ETH", Enums.TimeInForce.GoodTillCanceled, 1), "Borrow"); + await tester.ValidateAsync(client => client.SpotApi.Margin.BorrowAsync("ETH", Enums.BorrowOrderType.FOK, 1), "Borrow"); await tester.ValidateAsync(client => client.SpotApi.Margin.RepayAsync("ETH", 1), "Repay"); await tester.ValidateAsync(client => client.SpotApi.Margin.GetBorrowHistoryAsync("ETH"), "GetBorrowHistory"); await tester.ValidateAsync(client => client.SpotApi.Margin.GetRepayHistoryAsync("ETH"), "GetRepayHistory"); diff --git a/Kucoin.Net/Clients/SpotApi/KucoinRestClientSpotApiMargin.cs b/Kucoin.Net/Clients/SpotApi/KucoinRestClientSpotApiMargin.cs index 85bfac82..8f618d4c 100644 --- a/Kucoin.Net/Clients/SpotApi/KucoinRestClientSpotApiMargin.cs +++ b/Kucoin.Net/Clients/SpotApi/KucoinRestClientSpotApiMargin.cs @@ -77,7 +77,7 @@ public async Task>> Get /// public async Task> BorrowAsync( string asset, - TimeInForce timeInForce, + BorrowOrderType timeInForce, decimal quantity, bool? isIsolated = null, string? symbol = null, diff --git a/Kucoin.Net/Interfaces/Clients/SpotApi/IKucoinRestClientSpotApiMargin.cs b/Kucoin.Net/Interfaces/Clients/SpotApi/IKucoinRestClientSpotApiMargin.cs index 5ba4cbae..da692186 100644 --- a/Kucoin.Net/Interfaces/Clients/SpotApi/IKucoinRestClientSpotApiMargin.cs +++ b/Kucoin.Net/Interfaces/Clients/SpotApi/IKucoinRestClientSpotApiMargin.cs @@ -78,13 +78,13 @@ public interface IKucoinRestClientSpotApiMargin /// Cancellation token /// The id of the new order Task> BorrowAsync( - string asset, - TimeInForce timeInForce, + string asset, + BorrowOrderType timeInForce, decimal quantity, bool? isIsolated = null, string? symbol = null, bool? isHf = null, - CancellationToken ct = default); + CancellationToken ct = default); /// /// Repayment for previously borrowed asset