fix: Add binance spot order newOrderResp type to json/query params

This commit is contained in:
John Colvin committed 2025-04-29 19:32:21 +00:00
1 parent 024480f32e
commit 46c8dcb18f
1 file changed
+8 -1
@@ -37,6 +37,9 @@ void to_json(nlohmann::json &j, const CreateOrderRequest &req) {
if (!req.newClientOrderId.empty()) {
j["newClientOrderId"] = req.newClientOrderId;
}
if (req.newOrderRespType != NewOrderResponseType::NONE) {
j["newOrderRespType"] = req.newOrderRespType;
}
if (!std::isnan(req.price)) {
std::string price_str;
price_to_string(req.price, price_str);
@@ -61,7 +64,11 @@ void from_json(const nlohmann::json &j, CreateOrderRequest &req) {
j.at("type").get_to(req.type);
j.at("timestamp").get_to(req.timestamp);
j.at("newClientOrderId").get_to(req.newClientOrderId);
auto it = j.find("price");
auto it = j.find("newOrderRespType");
if (it != j.end()) {
it->get_to(req.newOrderRespType);
}
it = j.find("price");
if (it != j.end()) {
it->get_to(req.price);
}