Skip to content

Commit af650fd

Browse files
committed
add min/max vol to orders modal
1 parent 955a091 commit af650fd

File tree

6 files changed

+42
-2
lines changed

6 files changed

+42
-2
lines changed

atomic_defi_design/Dex/Exchange/ProView/TradingInfo/OrderModal.qml

+20
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,26 @@ MultipageModal
120120
label.font.pixelSize: 13
121121
}
122122

123+
// Min Vol
124+
TextEditWithTitle
125+
{
126+
Layout.fillWidth: true
127+
title: qsTr("Min Volume")
128+
text: details ? details.min_volume + " " + details.base_coin : ""
129+
label.font.pixelSize: 13
130+
visible: General.exists(details) && details.min_volume != ""
131+
}
132+
133+
// Max Vol
134+
TextEditWithTitle
135+
{
136+
Layout.fillWidth: true
137+
title: qsTr("Max Volume")
138+
text: details ? details.max_volume + " " + details.base_coin : ""
139+
label.font.pixelSize: 13
140+
visible: General.exists(details) && details.max_volume != ""
141+
}
142+
123143
// Refund state
124144
TextEditWithTitle
125145
{

src/core/atomicdex/api/mm2/mm2.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ namespace atomic_dex::mm2
293293
.is_swap = false,
294294
.is_cancellable = value.at("cancellable").get<bool>(),
295295
.is_recoverable = false,
296-
.min_volume = is_maker ? QString::fromStdString(value.at("min_base_vol").get<std::string>()) : std::optional<QString>(std::nullopt),
296+
.min_volume = is_maker ? QString::fromStdString(value.at("min_base_vol").get<std::string>()) : "",
297+
.max_volume = is_maker ? QString::fromStdString(value.at("max_base_vol").get<std::string>()) : "",
297298
.conf_settings = conf_settings};
298299
if (action.empty() && contents.order_type == "maker")
299300
{

src/core/atomicdex/data/dex/qt.orders.data.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ namespace atomic_dex::mm2
8585
bool is_swap_active{false};
8686

8787
//! Only available for maker order
88-
std::optional<QString> min_volume{std::nullopt};
88+
QString min_volume;
89+
QString max_volume;
8990
std::optional<nlohmann::json> conf_settings{std::nullopt};
9091
};
9192
} // namespace atomic_dex::mm2

src/core/atomicdex/models/qt.orders.model.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ namespace atomic_dex
8282
case RelCoinAmountCurrentCurrencyRole:
8383
item.rel_amount_fiat = value.toString();
8484
break;
85+
case MinVolumeRole:
86+
item.min_volume = value.toString();
87+
break;
88+
case MaxVolumeRole:
89+
item.max_volume = value.toString();
90+
break;
8591
case OrderTypeRole:
8692
item.order_type = value.toString();
8793
break;
@@ -166,6 +172,10 @@ namespace atomic_dex
166172
return item.rel_amount;
167173
case RelCoinAmountCurrentCurrencyRole:
168174
return item.rel_amount_fiat;
175+
case MinVolumeRole:
176+
return item.min_volume;
177+
case MaxVolumeRole:
178+
return item.max_volume;
169179
case OrderTypeRole:
170180
return item.order_type;
171181
case HumanDateRole:
@@ -233,6 +243,8 @@ namespace atomic_dex
233243
{BaseCoinAmountCurrentCurrencyRole, "base_amount_current_currency"},
234244
{RelCoinAmountRole, "rel_amount"},
235245
{RelCoinAmountCurrentCurrencyRole, "rel_amount_current_currency"},
246+
{MinVolumeRole, "min_volume"},
247+
{MaxVolumeRole, "max_volume"},
236248
{OrderTypeRole, "type"},
237249
{IsMakerRole, "is_maker"},
238250
{HumanDateRole, "date"},

src/core/atomicdex/models/qt.orders.model.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ namespace atomic_dex
6363
RelCoinAmountRole,
6464
RelCoinAmountCurrentCurrencyRole,
6565
OrderTypeRole,
66+
MinVolumeRole,
67+
MaxVolumeRole,
6668
IsMakerRole,
6769
HumanDateRole,
6870
UnixTimestampRole,

src/core/atomicdex/models/qt.orders.proxy.model.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ namespace atomic_dex
5555
break;
5656
case orders_model::RelCoinAmountCurrentCurrencyRole:
5757
break;
58+
case orders_model::MinVolumeRole:
59+
break;
60+
case orders_model::MaxVolumeRole:
61+
break;
5862
case orders_model::OrderTypeRole:
5963
break;
6064
case orders_model::IsMakerRole:

0 commit comments

Comments
 (0)