Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into nogeo
Browse files Browse the repository at this point in the history
  • Loading branch information
cipig committed Apr 6, 2024
2 parents e180c61 + fa1821f commit 65ed2b1
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 142 deletions.
112 changes: 0 additions & 112 deletions .gitlab-ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import AtomicDEX.MarketMode 1.0
Item
{
id: _control

property bool coinEnable: API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled
property bool _isCoinEnabled: API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled
property bool isAsk

AnimatedRectangle
Expand Down Expand Up @@ -46,7 +45,7 @@ Item
height: 24
anchors.verticalCenter: parent.verticalCenter
source: General.coinIcon(coin)
opacity: !_control.coinEnable? .1 : 1
opacity: !_control._isCoinEnabled? .1 : 1
}

Dex.Text
Expand Down Expand Up @@ -137,7 +136,7 @@ Item
{
if (API.app.enable_coins([coin]) === true)
{
_control.coinEnable = true;
_control._isCoinEnabled = true;
_tooltip.close();
}
else {
Expand Down
32 changes: 16 additions & 16 deletions src/core/atomicdex/config/coins.cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,21 @@ namespace atomic_dex
{
case CoinType::QRC20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "tQTUM" : "QTUM";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "tQTUM" : "QTUM";
break;
case CoinType::ERC20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "ETHR" : "ETH";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "ETHR" : "ETH";
cfg.is_erc_family = true;
break;
case CoinType::BEP20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "BNBT" : "BNB";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "BNBT" : "BNB";
cfg.is_erc_family = true;
break;
case CoinType::PLG20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "MATICTEST" : "MATIC";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "MATICTEST" : "MATIC";
cfg.is_erc_family = true;
break;
case CoinType::Optimism:
Expand All @@ -320,62 +320,62 @@ namespace atomic_dex
break;
case CoinType::AVX20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "AVAXT" : "AVAX";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "AVAXT" : "AVAX";
cfg.is_erc_family = true;
break;
case CoinType::FTM20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "FTMT" : "FTM";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "FTMT" : "FTM";
cfg.is_erc_family = true;
break;
case CoinType::HRC20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "ONET" : "ONE";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "ONET" : "ONE";
cfg.is_erc_family = true;
break;
case CoinType::Ubiq:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "UBQT" : "UBQ";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "UBQT" : "UBQ";
cfg.is_erc_family = true;
break;
case CoinType::KRC20:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "KCST" : "KCS";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "KCST" : "KCS";
cfg.is_erc_family = true;
break;
case CoinType::Moonriver:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "MOVRT" : "MOVR";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "MOVRT" : "MOVR";
cfg.is_erc_family = true;
break;
case CoinType::Moonbeam:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "GLMRT" : "GLMR";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "GLMRT" : "GLMR";
cfg.is_erc_family = true;
break;
case CoinType::HecoChain:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "HTT" : "HT";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "HTT" : "HT";
cfg.is_erc_family = true;
break;
case CoinType::SmartBCH:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "SBCHT" : "SBCH";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "SBCHT" : "SBCH";
cfg.is_erc_family = true;
break;
case CoinType::EthereumClassic:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "ETCT" : "ETC";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "ETCT" : "ETC";
cfg.is_erc_family = true;
break;
case CoinType::RSK:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "RBTCT" : "RBTC";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "RBTCT" : "RBTC";
cfg.is_erc_family = true;
break;
case CoinType::SLP:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "tBCH" : "BCH";
cfg.fees_ticker = cfg.is_testnet.value_or(false) ? "tBCH" : "BCH";
break;
case CoinType::TENDERMINT:
cfg.has_parent_fees_ticker = true;
Expand Down
25 changes: 18 additions & 7 deletions src/core/atomicdex/models/qt.orderbook.proxy.model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,34 @@ namespace atomic_dex
case orderbook_model::kind::bids:
break;
case orderbook_model::kind::best_orders:
t_float_50 rates = safe_float(this->sourceModel()->data(idx, orderbook_model::CEXRatesRole).toString().toStdString());
t_float_50 fiat_price = safe_float(this->sourceModel()->data(idx, orderbook_model::PriceFiatRole).toString().toStdString());
std::string ticker = this->sourceModel()->data(idx, orderbook_model::CoinRole).toString().toStdString();
const auto& provider = this->m_system_mgr.get_system<komodo_prices_provider>();
const auto coin_info = this->m_system_mgr.get_system<portfolio_page>().get_global_cfg()->get_coin_info(ticker);
t_float_50 limit("0");
t_float_50 rates = safe_float(this->sourceModel()->data(idx, orderbook_model::CEXRatesRole).toString().toStdString());
t_float_50 fiat_price = safe_float(this->sourceModel()->data(idx, orderbook_model::PriceFiatRole).toString().toStdString());
bool is_cex_id_available = this->sourceModel()->data(idx, orderbook_model::HaveCEXIDRole).toBool();
const auto volume = provider.get_total_volume(utils::retrieve_main_ticker(ticker));
const auto& provider = this->m_system_mgr.get_system<komodo_prices_provider>();
std::string ticker = this->sourceModel()->data(idx, orderbook_model::CoinRole).toString().toStdString();
const auto coin_info = this->m_system_mgr.get_system<portfolio_page>().get_global_cfg()->get_coin_info(ticker);
const auto volume = provider.get_total_volume(utils::retrieve_main_ticker(ticker));
std::string left_ticker = this->m_system_mgr.get_system<trading_page>().get_market_pairs_mdl()->get_left_selected_coin().toStdString();
const auto left_coin_info = this->m_system_mgr.get_system<portfolio_page>().get_global_cfg()->get_coin_info(left_ticker);

if (coin_info.ticker.empty() || coin_info.wallet_only) //< this means it's not present in our cfg - skipping
{
return false;
}
if (left_coin_info.is_testnet.value_or(false))
{
if (coin_info.is_testnet.value_or(false))
{
return true;
}
return false;
}
if (is_cex_id_available && (rates > 100 || fiat_price <= 0 || ((safe_float(volume) < limit) && coin_info.coin_type != CoinType::SmartChain)))
{
return false;
}
break;
return true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/atomicdex/services/mm2/mm2.service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3019,7 +3019,7 @@ namespace atomic_dex
const coin_config_t cfg = this->get_coin_info(ticker);
if (cfg.coin_type == CoinType::QRC20)
{
if (cfg.is_testnet.value())
if (cfg.is_testnet.value_or(false))
{
SPDLOG_INFO("{} is from testnet picking tQTUM electrum", ticker);
servers = std::move(get_coin_info("tQTUM").electrum_urls.value());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace atomic_dex
{
// SPDLOG_DEBUG("error: bad answer json for process_best_orders: {}", rpc.error->error);
this->m_bestorders_busy = false;
// SPDLOG_ERROR("Triggering [process_orderbook_finished]: true");
// SPDLOG_DEBUG("Triggering [process_orderbook_finished]: true");
this->dispatcher_.trigger<process_orderbook_finished>(true);
}
else
Expand All @@ -75,7 +75,7 @@ namespace atomic_dex
this->m_best_orders_infos = rpc.result.value();
}
this->m_bestorders_busy = false;
// SPDLOG_ERROR("Triggering [process_orderbook_finished]: false");
// SPDLOG_DEBUG("Triggering [process_orderbook_finished]: false");
this->dispatcher_.trigger<process_orderbook_finished>(false);
emit trading_pg.get_orderbook_wrapper()->bestOrdersBusyChanged();
}
Expand Down

0 comments on commit 65ed2b1

Please sign in to comment.