From f026c15a8fa043bb7f4ce970f36a1cb71df297ef Mon Sep 17 00:00:00 2001 From: Stephane Janel Date: Sat, 21 Dec 2024 20:48:53 +0100 Subject: [PATCH] Fix Kucoin private api bug from glaze migration --- src/api/exchanges/src/kucoinprivateapi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/exchanges/src/kucoinprivateapi.cpp b/src/api/exchanges/src/kucoinprivateapi.cpp index 26ac0484..d09e5dc6 100644 --- a/src/api/exchanges/src/kucoinprivateapi.cpp +++ b/src/api/exchanges/src/kucoinprivateapi.cpp @@ -69,10 +69,12 @@ auto ComputeBaseStrToSign(HttpRequestType requestType, std::string_view method, } CurlOptions CreateCurlOptions(const APIKey& apiKey, HttpRequestType requestType, std::string_view method, - string strToSign, std::string_view nonceTimeStr, + string& strToSign, std::string_view nonceTimeStr, CurlPostData&& postData = CurlPostData()) { CurlOptions::PostDataFormat postDataFormat = CurlOptions::PostDataFormat::kString; - if (!postData.empty()) { + if (postData.empty()) { + ComputeBaseStrToSign(requestType, method, 0UL, nonceTimeStr, strToSign); + } else { if (requestType == HttpRequestType::kGet || requestType == HttpRequestType::kDelete) { std::string_view postDataStr = postData.str(); auto it = ComputeBaseStrToSign(requestType, method, postDataStr.size() + 1UL, nonceTimeStr, strToSign);