diff --git a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml
index 30fc49a4cd..69480206f4 100644
--- a/atomic_defi_design/Dex/Exchange/ProView/Chart.qml
+++ b/atomic_defi_design/Dex/Exchange/ProView/Chart.qml
@@ -70,6 +70,7 @@ Item
transform: scale(${Math.min(scale_x, scale_y)});
transform-origin: top left;
}
+ a { pointer-events: none; }
@@ -226,6 +227,16 @@ Item
}
}
+ MouseArea {
+ id: chart_mousearea
+ anchors.fill: webEngineViewPlaceHolder
+ onClicked: {
+ if (webEngineView.visible) {
+ Qt.openUrlExternally("https://www.livecoinwatch.com")
+ }
+ }
+ }
+
Connections
{
target: app
diff --git a/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml b/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml
index 5ce557fc6b..2e21b85061 100644
--- a/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml
+++ b/atomic_defi_design/Dex/Exchange/Trade/OrderBook/ListDelegate.qml
@@ -35,6 +35,7 @@ Item
color: Qaterial.Colors.amber
}
+ // Insufficient funds tooltip
DexLabel
{
id: tooltip_text
@@ -101,6 +102,7 @@ Item
anchors.fill: parent
hoverEnabled: true
+ // Populate form with selected order
onClicked:
{
if (is_mine) return
@@ -119,6 +121,7 @@ Item
}
}
+ // Highlight row on mouseover
AnimatedRectangle
{
visible: mouse_area.containsMouse
@@ -128,16 +131,6 @@ Item
opacity: 0.1
}
- Rectangle
- {
- anchors.verticalCenter: parent.verticalCenter
- width: 6
- height: 6
- radius: width / 2
- visible: is_mine
- color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
- }
-
// Progress bar
Rectangle
{
@@ -161,98 +154,111 @@ Item
}
}
- Row
+ // Price, Qty & Total text values
+ RowLayout
{
id: row
anchors.fill: parent
- anchors.horizontalCenter: parent.horizontalCenter
onWidthChanged: progress.width = ((depth * 100) * (width + 40)) / 100
- spacing: 0
+ spacing: 3
+
+ // Dot on the left side of the row to indicate own order
+ Rectangle
+ {
+ Layout.leftMargin: 6
+ Layout.alignment: Qt.AlignVCenter
+ opacity: is_mine ? 1 : 0
+ width: 6
+ height: 6
+ radius: 3
+ color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
+ }
+ // Price
Dex.ElidableText
{
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width * 0.31
+ Layout.fillHeight: true
+ Layout.minimumWidth: 90
+ Layout.alignment: Qt.AlignVCenter
text: { new BigNumber(price).toFixed(8) }
font.family: DexTypo.fontFamily
font.pixelSize: 12
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
}
- Item { width: parent.width * 0.01 }
-
// Quantity
Dex.ElidableText
{
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width * 0.37
+ Layout.fillHeight: true
+ Layout.minimumWidth: 90
+ Layout.alignment: Qt.AlignVCenter
text: { new BigNumber(base_max_volume).toFixed(6) }
font.family: DexTypo.fontFamily
font.pixelSize: 12
horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignVCenter
onTextChanged: depth_bar.width = ((depth * 100) * (mouse_area.width + 40)) / 100
wrapMode: Text.NoWrap
}
- Item { width: parent.width * 0.01 }
-
// Total
Dex.ElidableText
{
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width * 0.30
- rightPadding: (is_mine) && (mouse_area.containsMouse || cancel_button.containsMouse) ? 30 : 0
+ id: total_text
+ Layout.fillHeight: true
+ Layout.minimumWidth: 90
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter
font.family: DexTypo.fontFamily
font.pixelSize: 12
text: { new BigNumber(total).toFixed(6) }
horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
-
- Behavior on rightPadding { NumberAnimation { duration: 150 } }
}
- }
- }
-
- Qaterial.ColorIcon
- {
- id: cancel_button_text
- property bool requested_cancel: false
-
- visible: is_mine && !requested_cancel
- anchors.verticalCenter: parent.verticalCenter
- anchors.verticalCenterOffset: 1
- anchors.right: parent.right
- anchors.rightMargin: mouse_area.containsMouse || cancel_button.containsMouse ? 12 : 6
- Behavior on iconSize
- {
- NumberAnimation
+ // Cancel button
+ Item
{
- duration: 200
- }
- }
-
- iconSize: mouse_area.containsMouse || cancel_button.containsMouse? 16 : 0
+ id: cancel_flat_btn
+ Layout.fillHeight: true
+ width: 30
+ Layout.alignment: Qt.AlignVCenter
- color: cancel_button.containsMouse ?
- Qaterial.Colors.red : mouse_area.containsMouse ?
- DexTheme.foregroundColor: Qaterial.Colors.red
+ MouseArea
+ {
+ id: cancel_mouse_area
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ hoverEnabled: true
+ }
- DefaultMouseArea
- {
- id: cancel_button
- anchors.fill: parent
- hoverEnabled: true
+ Qaterial.FlatButton
+ {
+ id: cancel_button_orderbook
+ anchors.centerIn: parent
+ anchors.fill: parent
+ opacity: is_mine ? 1 : 0
- onClicked:
- {
- if (!is_mine) return
+ onClicked: {
+ if (uuid) cancelOrder(uuid);
+ }
- cancel_button_text.requested_cancel = true
- cancelOrder(uuid)
+ Qaterial.ColorIcon
+ {
+ anchors.centerIn: parent
+ iconSize: 16
+ color: Dex.CurrentTheme.warningColor
+ source: Qaterial.Icons.close
+ visible: is_mine
+ scale: is_mine && mouse_area.containsMouse ? 1 : 0
+ Behavior on scale { NumberAnimation { duration: 150 } }
+ }
+ }
}
}
}
diff --git a/atomic_defi_design/assets/languages/atomic_defi_de.ts b/atomic_defi_design/assets/languages/atomic_defi_de.ts
index 0348200972..20b4136a5b 100644
--- a/atomic_defi_design/assets/languages/atomic_defi_de.ts
+++ b/atomic_defi_design/assets/languages/atomic_defi_de.ts
@@ -516,17 +516,17 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456
Chart
-
-
- Laden von Marktdaten
+
+
+
-
+
-
+
@@ -1956,11 +1956,6 @@ They will be removed from the orderbook until you log in again.
-
-
-
- Laden von Marktdaten
-
@@ -1981,6 +1976,11 @@ They will be removed from the orderbook until you log in again.
+
+
+
+
+
@@ -1992,18 +1992,18 @@ They will be removed from the orderbook until you log in again.
Handelsinformationen
-
+
Chart
-
+
Order
-
+
Historie
@@ -2025,7 +2025,7 @@ They will be removed from the orderbook until you log in again.
-
+
Adressbuch
@@ -2050,22 +2050,27 @@ They will be removed from the orderbook until you log in again.
Schlagworte
-
+
+
+
+
+
+
Bearbeiten
-
+
Löschen
-
+
Adresse in die Zwischenablage kopiert
-
+
Dieser Kontakt hat keine registrierte Adresse.
@@ -3570,6 +3575,11 @@ Bitte wählen Sie eine neue Order aus.
In die Zwischenablage kopiert
+
+
+
+
+
@@ -3643,6 +3653,17 @@ Bitte wählen Sie eine neue Order aus.
MM2 Version in die Zwischenablage kopiert.
+
+
+
+
+
+
+
+
+
+
+
@@ -3655,27 +3676,22 @@ Bitte wählen Sie eine neue Order aus.
-
+
Qt Version
-
+
Qt Version
-
+
Qt Version in die Zwischenablage kopiert.
-
-
- Update suchen
-
-
-
+
Abmelden
@@ -4563,7 +4579,7 @@ This might take a few minutes...
atomic_dex::settings_page
-
+
diff --git a/atomic_defi_design/assets/languages/atomic_defi_en.ts b/atomic_defi_design/assets/languages/atomic_defi_en.ts
index 7b6367813e..8a413639f9 100644
--- a/atomic_defi_design/assets/languages/atomic_defi_en.ts
+++ b/atomic_defi_design/assets/languages/atomic_defi_en.ts
@@ -515,17 +515,17 @@
Chart
-
-
+
+
-
+
-
+
@@ -1955,11 +1955,6 @@ They will be removed from the orderbook until you log in again.
-
-
-
-
-
@@ -1980,6 +1975,11 @@ They will be removed from the orderbook until you log in again.
+
+
+
+
+
@@ -1991,18 +1991,18 @@ They will be removed from the orderbook until you log in again.
-
+
-
+
-
+
@@ -2024,7 +2024,7 @@ They will be removed from the orderbook until you log in again.
-
+
@@ -2049,22 +2049,27 @@ They will be removed from the orderbook until you log in again.
-
+
+
+
+
+
+
-
+
-
+
-
+
@@ -3641,6 +3646,17 @@ Please select a new order.
+
+
+
+
+
+
+
+
+
+
+
@@ -3653,27 +3669,27 @@ Please select a new order.
-
+
-
+
-
+
-
-
+
+
-
+
@@ -4553,7 +4569,7 @@ This might take a few minutes...
atomic_dex::settings_page
-
+
diff --git a/atomic_defi_design/assets/languages/atomic_defi_es.ts b/atomic_defi_design/assets/languages/atomic_defi_es.ts
index ece7e6033c..e17cc56aba 100644
--- a/atomic_defi_design/assets/languages/atomic_defi_es.ts
+++ b/atomic_defi_design/assets/languages/atomic_defi_es.ts
@@ -515,17 +515,17 @@
Chart
-
-
- Cargando datos de mercado
+
+
+
-
+
-
+
@@ -1958,11 +1958,6 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión.Explore
-
-
-
- Cargando datos de mercado
-
@@ -1983,6 +1978,11 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión.Please wait, %1 is %2
Por favor espera %1 es %2
+
+
+
+
+
@@ -1994,18 +1994,18 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión.Información de Intercambios
-
+
Gráfico
-
+
Pedidos
-
+
Historial
@@ -2027,7 +2027,7 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión.
-
+
Libreta de direcciones
@@ -2052,22 +2052,27 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión.Etiquetas
-
+
+
+
+
+
+
Editar
-
+
Eliminar
-
+
dirección copiada al portapapeles
-
+
Este contacto no tiene ninguna dirección registrada.
@@ -3645,6 +3650,17 @@ Seleccione un nuevo pedido.
Versión MM2 copiada al portapapeles.
+
+
+
+
+
+
+
+
+
+
+
@@ -3657,27 +3673,27 @@ Seleccione un nuevo pedido.
-
+
Versión Qt
-
+
Versión Qt
-
+
Versión de Qt copiada al portapapeles.
-
-
- Buscar Actualizacion
+
+
+
-
+
Cerrar sesión
@@ -4566,7 +4582,7 @@ Esto puede tardar unos minutos...
atomic_dex::settings_page
-
+
Se ha producido un error.
diff --git a/atomic_defi_design/assets/languages/atomic_defi_fr.ts b/atomic_defi_design/assets/languages/atomic_defi_fr.ts
index 2fd93a2b52..cfc2eac0d7 100644
--- a/atomic_defi_design/assets/languages/atomic_defi_fr.ts
+++ b/atomic_defi_design/assets/languages/atomic_defi_fr.ts
@@ -515,17 +515,17 @@
Chart
-
-
- Chargement des données de marché
+
+
+
-
+
-
+
@@ -1955,11 +1955,6 @@ They will be removed from the orderbook until you log in again.
-
-
-
- Chargement des données de marché
-
@@ -1980,6 +1975,11 @@ They will be removed from the orderbook until you log in again.
+
+
+
+
+
@@ -1991,18 +1991,18 @@ They will be removed from the orderbook until you log in again.
Informations de Trading
-
+
Chart
-
+
Ordres
-
+
Historique
@@ -2024,7 +2024,7 @@ They will be removed from the orderbook until you log in again.
-
+
Carnet d'adresses
@@ -2049,22 +2049,27 @@ They will be removed from the orderbook until you log in again.
Tags
-
+
+
+
+
+
+
Éditer
-
+
Supprimez
-
+
-
+
@@ -3570,6 +3575,11 @@ Please select a new order.
copié dans le presse-papier
+
+
+
+
+
@@ -3615,6 +3625,17 @@ Please select a new order.
MM2 Version copiée dans le presse-papiers.
+
+
+
+
+
+
+
+
+
+
+
@@ -3627,27 +3648,22 @@ Please select a new order.
-
+
Version de Qt
-
+
Qt Version
-
+
Version Qt copiée dans le presse-papiers.
-
-
- Rechercher une mise à jour
-
-
-
+
Se déconnecter
@@ -4553,7 +4569,7 @@ This might take a few minutes...
atomic_dex::settings_page
-
+
diff --git a/atomic_defi_design/assets/languages/atomic_defi_ru.ts b/atomic_defi_design/assets/languages/atomic_defi_ru.ts
index a8d02cf8e8..b4c0cb59a6 100644
--- a/atomic_defi_design/assets/languages/atomic_defi_ru.ts
+++ b/atomic_defi_design/assets/languages/atomic_defi_ru.ts
@@ -515,17 +515,17 @@
Chart
-
-
- Загрузка рыночных данных
+
+
+
-
+
-
+
@@ -1961,11 +1961,6 @@ They will be removed from the orderbook until you log in again.
-
-
-
- Загрузка рыночных данных
-
@@ -1986,6 +1981,11 @@ They will be removed from the orderbook until you log in again.
+
+
+
+
+
@@ -1997,18 +1997,18 @@ They will be removed from the orderbook until you log in again.
Торговая информация
-
+
График
-
+
Ордеры
-
+
История
@@ -2030,7 +2030,7 @@ They will be removed from the orderbook until you log in again.
-
+
Адресная книга
@@ -2055,22 +2055,27 @@ They will be removed from the orderbook until you log in again.
Теги
-
+
+
+
+
+
+
Редактировать
-
+
Удалить
-
+
-
+
@@ -3576,6 +3581,11 @@ Please select a new order.
скопировано в буфер
+
+
+
+
+
@@ -3621,6 +3631,17 @@ Please select a new order.
Версия MM2 скопирована в буфер обмена.
+
+
+
+
+
+
+
+
+
+
+
@@ -3633,27 +3654,22 @@ Please select a new order.
-
+
Версия Qt
-
+
Версия Qt
-
+
Версия Qt скопирована в буфер обмена.
-
-
- Проверить на обновления
-
-
-
+
Выход
@@ -4559,7 +4575,7 @@ This might take a few minutes...
atomic_dex::settings_page
-
+
diff --git a/atomic_defi_design/assets/languages/atomic_defi_tr.ts b/atomic_defi_design/assets/languages/atomic_defi_tr.ts
index 49f3e80d63..00238a3206 100644
--- a/atomic_defi_design/assets/languages/atomic_defi_tr.ts
+++ b/atomic_defi_design/assets/languages/atomic_defi_tr.ts
@@ -515,17 +515,17 @@
Chart
-
-
- Piyasa bilgisi yükleniyor
+
+
+
-
+
-
+
@@ -1949,11 +1949,6 @@ They will be removed from the orderbook until you log in again.
-
-
-
- Piyasa bilgisi yükleniyor
-
@@ -1974,6 +1969,11 @@ They will be removed from the orderbook until you log in again.
+
+
+
+
+
@@ -1985,18 +1985,18 @@ They will be removed from the orderbook until you log in again.
Al Sat Bilgisi
-
+
Grafik
-
+
Emirler
-
+
Tarihçe
@@ -2018,7 +2018,7 @@ They will be removed from the orderbook until you log in again.
-
+
Adres Defteri
@@ -2043,22 +2043,27 @@ They will be removed from the orderbook until you log in again.
Etiketler
-
+
+
+
+
+
+
Düzenle
-
+
Sil
-
+
-
+
@@ -3564,6 +3569,11 @@ Please select a new order.
+
+
+
+
+
@@ -3609,6 +3619,17 @@ Please select a new order.
+
+
+
+
+
+
+
+
+
+
+
@@ -3621,27 +3642,22 @@ Please select a new order.
-
+
Qt sürümü
-
+
-
+
-
-
- Güncelleme Ara
-
-
-
+
Çıkış
@@ -4547,7 +4563,7 @@ This might take a few minutes...
atomic_dex::settings_page
-
+
diff --git a/src/app/app.cpp b/src/app/app.cpp
index 54cfc55fb4..a3a8fdf0cd 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -43,7 +43,6 @@
#include "atomicdex/services/mm2/auto.update.maker.order.service.hpp"
#include "atomicdex/services/price/komodo_prices/komodo.prices.provider.hpp"
#include "atomicdex/services/price/coingecko/coingecko.wallet.charts.hpp"
-#include "atomicdex/services/price/coinpaprika/coinpaprika.provider.hpp"
#include "atomicdex/services/price/orderbook.scanner.service.hpp"
namespace
@@ -346,9 +345,6 @@ namespace atomic_dex
if (m_event_actions[events_action::need_a_full_refresh_of_mm2])
{
system_manager_.create_system(system_manager_);
-
- // system_manager_.create_system(system_manager_);
- // system_manager_.create_system(system_manager_);
connect_signals();
m_event_actions[events_action::need_a_full_refresh_of_mm2] = false;
}
@@ -500,8 +496,6 @@ namespace atomic_dex
system_manager_.create_system(system_manager_, settings_page_system.get_cfg());
system_manager_.create_system(system_manager_);
system_manager_.create_system(system_manager_);
- //system_manager_.create_system(system_manager_);
- //system_manager_.create_system(system_manager_);
system_manager_.create_system();
system_manager_.create_system();
system_manager_.create_system(system_manager_);
diff --git a/src/core/atomicdex/api/coinpaprika/coinpaprika.cpp b/src/core/atomicdex/api/coinpaprika/coinpaprika.cpp
deleted file mode 100644
index 0287e13302..0000000000
--- a/src/core/atomicdex/api/coinpaprika/coinpaprika.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/******************************************************************************
- * Copyright © 2013-2024 The Komodo Platform Developers. *
- * *
- * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
- * the top-level directory of this distribution for the individual copyright *
- * holder information and the developer policies on copyright and licensing. *
- * *
- * Unless otherwise agreed in a custom licensing agreement, no part of the *
- * Komodo Platform software, including this file may be copied, modified, *
- * propagated or distributed except according to the terms contained in the *
- * LICENSE file *
- * *
- * Removal or modification of this copyright notice is prohibited. *
- * *
- ******************************************************************************/
-
-//! Deps
-#include
-#include
-
-//! Project Headers
-#include "atomicdex/api/coinpaprika/coinpaprika.hpp"
-#include "atomicdex/utilities/global.utilities.hpp"
-
-//! Private
-#include "atomicdex/utilities/nlohmann.json.sax.private.cpp"
-
-namespace
-{
- //! Constants
- constexpr const char* g_coinpaprika_endpoint = "https://api.coinpaprika.com/v1/";
- web::http::client::http_client_config g_paprika_cfg{[]() {
- web::http::client::http_client_config cfg;
- cfg.set_validate_certificates(false);
- cfg.set_timeout(std::chrono::seconds(5));
- return cfg;
- }()};
- t_http_client_ptr g_coinpaprika_client = std::make_unique(FROM_STD_STR(g_coinpaprika_endpoint), g_paprika_cfg);
-} // namespace
-
-namespace atomic_dex
-{
- namespace coinpaprika::api
- {
- void
- to_json(nlohmann::json& j, const price_converter_request& evt)
- {
- j["base_currency_id"] = evt.base_currency_id;
- j["quote_currency_id"] = evt.quote_currency_id;
- j["amount"] = 1;
- }
-
- void
- from_json(const nlohmann::json& j, price_converter_answer& evt)
- {
- // utils::details::my_json_sax sx;
- // nlohmann::json::sax_parse(j.dump(), &sx);
-
- evt.base_currency_id = j.at("base_currency_id").get();
- evt.base_currency_name = j.at("base_currency_name").get();
- evt.base_price_last_updated = j.at("base_price_last_updated").get();
- evt.quote_currency_id = j.at("quote_currency_id").get();
- evt.quote_currency_name = j.at("quote_currency_name").get();
- evt.quote_price_last_updated = j.at("quote_price_last_updated").get();
- evt.amount = j.at("amount").get();
- evt.price = std::to_string(j.at("price").get());
-
- std::replace(evt.price.begin(), evt.price.end(), ',', '.');
- }
-
- void
- from_json(const nlohmann::json& j, ticker_info_answer& evt)
- {
- evt.answer = j.at("quotes");
- }
-
- void
- from_json(const nlohmann::json& j, ticker_historical_answer& evt)
- {
- evt.answer = j;
- }
-
- pplx::task
- async_price_converter(const price_converter_request& request)
- {
- using namespace std::string_literals;
- web::http::http_request req;
- req.set_method(web::http::methods::GET);
- auto&& [base_id, quote_id] = request;
- const auto url = "/price-converter?base_currency_id="s + base_id + ""e_currency_id="s + quote_id + "&amount=1"s;
- req.set_request_uri(FROM_STD_STR(url));
- return g_coinpaprika_client->request(req);
- }
-
- pplx::task
- async_ticker_info(const ticker_infos_request& request)
- {
- using ranges::views::ints;
- using ranges::views::zip;
- using namespace std::string_literals;
- web::http::http_request req;
- req.set_method(web::http::methods::GET);
- auto&& [ticker_id, quotes] = request;
- auto url = "/tickers/"s + ticker_id + "?quotes="s;
- for (auto&& [cur_quote, idx]: zip(quotes, ints(0u, ranges::unreachable)))
- {
- url.append(cur_quote);
-
- //! Append only if not last element, idx start at 0, if idx + 1 == quotes.size(), we are on the last elemnt, we don't append.
- if (idx < quotes.size() - 1)
- {
- url.append(",");
- }
- }
- SPDLOG_INFO("url: {}", TO_STD_STR(g_coinpaprika_client->base_uri().to_string()) + url);
- req.set_request_uri(FROM_STD_STR(url));
- return g_coinpaprika_client->request(req);
- }
-
- pplx::task
- async_ticker_historical(const ticker_historical_request& request)
- {
- using namespace std::string_literals;
- web::http::http_request req;
- req.set_method(web::http::methods::GET);
- auto&& [ticker_id, timestamp, interval] = request;
- const auto url = "/tickers/"s + ticker_id + "/historical?start="s + std::to_string(timestamp) + "&interval="s + interval;
- SPDLOG_INFO("url: {}", url);
- req.set_request_uri(FROM_STD_STR(url));
- return g_coinpaprika_client->request(req);
- }
- } // namespace coinpaprika::api
-} // namespace atomic_dex
diff --git a/src/core/atomicdex/api/coinpaprika/coinpaprika.hpp b/src/core/atomicdex/api/coinpaprika/coinpaprika.hpp
deleted file mode 100644
index 3650d3f733..0000000000
--- a/src/core/atomicdex/api/coinpaprika/coinpaprika.hpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/******************************************************************************
- * Copyright © 2013-2024 The Komodo Platform Developers. *
- * *
- * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
- * the top-level directory of this distribution for the individual copyright *
- * holder information and the developer policies on copyright and licensing. *
- * *
- * Unless otherwise agreed in a custom licensing agreement, no part of the *
- * Komodo Platform software, including this file may be copied, modified, *
- * propagated or distributed except according to the terms contained in the *
- * LICENSE file *
- * *
- * Removal or modification of this copyright notice is prohibited. *
- * *
- ******************************************************************************/
-
-#pragma once
-
-//! Deps
-#include
-#include
-#include
-
-//! Project Headers
-#include "atomicdex/utilities/cpprestsdk.utilities.hpp"
-
-namespace
-{
- constexpr const std::size_t g_nb_hours_in_a_week{168};
-}
-
-namespace atomic_dex
-{
- namespace coinpaprika::api
- {
- struct ticker_historical_request
- {
- std::string ticker_currency_id;
- std::size_t timestamp{static_cast(
- std::chrono::duration_cast((std::chrono::system_clock::now() - std::chrono::hours(g_nb_hours_in_a_week)).time_since_epoch()).count())};
- std::string interval{"1d"};
- };
-
- struct ticker_historical_answer
- {
- nlohmann::json answer{nlohmann::json::array()};
- int rpc_result_code;
- std::string raw_result;
- };
-
- struct ticker_infos_request
- {
- std::string ticker_currency_id;
- std::vector ticker_quotes;
- };
-
- struct ticker_info_answer
- {
- nlohmann::json answer;
- int rpc_result_code;
- std::string raw_result;
- };
-
- struct price_converter_request
- {
- std::string base_currency_id;
- std::string quote_currency_id;
- };
-
- struct price_converter_answer
- {
- std::string base_currency_id;
- std::string base_currency_name;
- std::string base_price_last_updated;
- std::string quote_currency_id;
- std::string quote_currency_name;
- std::string quote_price_last_updated;
- std::size_t amount;
- std::string price{"0.00"}; ///< we need trick here
- int rpc_result_code;
- std::string raw_result;
- };
-
- void to_json(nlohmann::json& j, const price_converter_request& evt);
-
- void from_json(const nlohmann::json& j, price_converter_answer& evt);
-
- void from_json(const nlohmann::json& j, ticker_info_answer& evt);
-
- void from_json(const nlohmann::json& j, ticker_historical_answer& evt);
-
- pplx::task async_price_converter(const price_converter_request& request);
- pplx::task async_ticker_info(const ticker_infos_request& request);
- pplx::task async_ticker_historical(const ticker_historical_request& request);
-
- template
- TAnswer static inline process_generic_resp(web::http::http_response resp)
- {
- TAnswer answer;
- std::string body = TO_STD_STR(resp.extract_string(true).get());
- if (resp.status_code() == static_cast(antara::app::http_code::bad_request))
- {
- SPDLOG_WARN("rpc answer code is 400 (Bad Parameters), body: {}", body);
- answer.rpc_result_code = resp.status_code();
- answer.raw_result = body;
- return answer;
- }
- if (resp.status_code() == static_cast(antara::app::http_code::too_many_requests))
- {
- SPDLOG_WARN("rpc answer code is 429 (Too Many requests), body: {}", body);
- answer.rpc_result_code = resp.status_code();
- answer.raw_result = body;
- return answer;
- }
- try
- {
- const auto json_answer = nlohmann::json::parse(body);
- from_json(json_answer, answer);
- answer.rpc_result_code = resp.status_code();
- answer.raw_result = body;
- }
- catch (const std::exception& error)
- {
- SPDLOG_ERROR("exception caught: error[{}], body: {}", error.what(), body);
- answer.rpc_result_code = -1;
- answer.raw_result = error.what();
- }
- return answer;
- }
- } // namespace coinpaprika::api
-
-
- using t_price_converter_answer = coinpaprika::api::price_converter_answer;
- using t_price_converter_request = coinpaprika::api::price_converter_request;
- using t_ticker_info_answer = coinpaprika::api::ticker_info_answer;
- using t_ticker_infos_request = coinpaprika::api::ticker_infos_request;
- using t_ticker_historical_answer = coinpaprika::api::ticker_historical_answer;
- using t_ticker_historical_request = coinpaprika::api::ticker_historical_request;
-} // namespace atomic_dex
diff --git a/src/core/atomicdex/config/app.cfg.cpp b/src/core/atomicdex/config/app.cfg.cpp
index 78ec9fda01..770b7be2e4 100644
--- a/src/core/atomicdex/config/app.cfg.cpp
+++ b/src/core/atomicdex/config/app.cfg.cpp
@@ -165,7 +165,7 @@ namespace atomic_dex
//! If it's fiat, i set the first element of the possible currencies to the new currency (the new fiat here) and i also set the current fiat
if (is_this_currency_a_fiat(config, new_currency))
{
- SPDLOG_INFO("{} is fiat, setting it as current fiat and possible currencies", new_currency);
+ // SPDLOG_INFO("{} is fiat, setting it as current fiat and possible currencies", new_currency);
config.current_fiat = new_currency;
config.current_fiat_sign = config.current_currency_sign;
config.possible_currencies[0] = new_currency;
@@ -173,11 +173,11 @@ namespace atomic_dex
if (std::count(config.recommended_fiat.begin(), config.recommended_fiat.end(), new_currency))
{
- SPDLOG_INFO("{} is already in recommended fiats", new_currency);
+ // SPDLOG_INFO("{} is already in recommended fiats", new_currency);
update_recommended_fiat = false;
}
if (update_recommended_fiat) {
- SPDLOG_INFO("Adding {} to recommended fiats", new_currency);
+ // SPDLOG_INFO("Adding {} to recommended fiats", new_currency);
config.recommended_fiat.pop_back();
config.recommended_fiat.insert(config.recommended_fiat.begin(), new_currency);
}
diff --git a/src/core/atomicdex/services/internet/internet.checker.service.cpp b/src/core/atomicdex/services/internet/internet.checker.service.cpp
index 9afafd488f..e194dbe2ce 100644
--- a/src/core/atomicdex/services/internet/internet.checker.service.cpp
+++ b/src/core/atomicdex/services/internet/internet.checker.service.cpp
@@ -32,7 +32,6 @@ namespace
return cfg;
}()};
- t_http_client_ptr g_paprika_proxy_http_client{std::make_unique(FROM_STD_STR("https://api.coinpaprika.com"), g_cfg)};
std::atomic_bool g_mm2_default_coins_ready{false};
pplx::task
@@ -164,7 +163,7 @@ namespace atomic_dex
void
internet_service_checker::fetch_internet_connection()
{
- //query_internet(g_paprika_proxy_http_client, "/v1/coins/btc-bitcoin", &internet_service_checker::is_paprika_provider_alive);
+ // TODO: This is only checking mm2 connection, not connection to the internet.
if (this->m_system_manager.has_system() && g_mm2_default_coins_ready)
{
auto& mm2 = this->m_system_manager.get_system();
diff --git a/src/core/atomicdex/services/price/coinpaprika/coinpaprika.provider.cpp b/src/core/atomicdex/services/price/coinpaprika/coinpaprika.provider.cpp
deleted file mode 100644
index 9719887871..0000000000
--- a/src/core/atomicdex/services/price/coinpaprika/coinpaprika.provider.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/******************************************************************************
- * Copyright © 2013-2024 The Komodo Platform Developers. *
- * *
- * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
- * the top-level directory of this distribution for the individual copyright *
- * holder information and the developer policies on copyright and licensing. *
- * *
- * Unless otherwise agreed in a custom licensing agreement, no part of the *
- * Komodo Platform software, including this file may be copied, modified, *
- * propagated or distributed except according to the terms contained in the *
- * LICENSE file *
- * *
- * Removal or modification of this copyright notice is prohibited. *
- * *
- ******************************************************************************/
-
-// Deps Headers
-#include
-
-// Project Headers
-#include "atomicdex/pages/qt.portfolio.page.hpp"
-#include "atomicdex/services/price/coinpaprika/coinpaprika.provider.hpp"
-
-namespace
-{
- //! Using namespace
- using namespace std::chrono_literals;
- using namespace atomic_dex::coinpaprika::api;
-
- //! Constants
- constexpr std::uint16_t g_pending_init_tasks_limit = 3;
-} // namespace
-
-//! Constructor/Destructor
-namespace atomic_dex
-{
- coinpaprika_provider::coinpaprika_provider(entt::registry& registry, ag::ecs::system_manager& system_manager) :
- system(registry), m_system_manager(system_manager)
- {
- SPDLOG_INFO("coinpaprika_provider created");
- disable();
- dispatcher_.sink().connect<&coinpaprika_provider::on_mm2_started>(*this);
- dispatcher_.sink().connect<&coinpaprika_provider::on_coin_enabled>(*this);
- dispatcher_.sink().connect<&coinpaprika_provider::on_coin_disabled>(*this);
- }
-
- coinpaprika_provider::~coinpaprika_provider()
- {
- SPDLOG_INFO("coinpaprika_provider destroyed");
- dispatcher_.sink().disconnect<&coinpaprika_provider::on_mm2_started>(*this);
- dispatcher_.sink().disconnect<&coinpaprika_provider::on_coin_enabled>(*this);
- dispatcher_.sink().disconnect<&coinpaprika_provider::on_coin_disabled>(*this);
- }
-} // namespace atomic_dex
-
-//! Private Generics
-namespace atomic_dex
-{
- template
- TAnswer
- coinpaprika_provider::get_infos(const std::string& ticker, const TRegistry& registry, TLockable& mutex) const
- {
- std::shared_lock lock(mutex);
- const auto it = registry.find(ticker);
- return it != registry.cend() ? it->second : TAnswer{};
- }
-} // namespace atomic_dex
-
-//! RPC Generics
-namespace atomic_dex
-{
- void
- coinpaprika_provider::verify_idx(t_ref_count_idx idx, uint16_t target_size, const std::vector& tickers)
- {
- if (idx != nullptr)
- {
- const auto cur = idx->fetch_add(1) + 1;
- // SPDLOG_DEBUG("cur: {}, target size: {}, remaining before adding in the model: {}", cur, target_size, target_size - cur);
- if (cur == target_size)
- {
- if (not tickers.empty())
- {
- dispatcher_.trigger(tickers);
- }
- else
- {
- this->dispatcher_.trigger("");
- }
- }
- }
- }
-
- template
- void
- coinpaprika_provider::generic_post_verification(std::shared_mutex& mtx, TContainer& container, std::string&& ticker, TAnswer&& answer, Args... args)
- {
- {
- std::unique_lock lock(mtx);
- container.insert_or_assign(std::move(ticker), std::forward(answer));
- }
- verify_idx(std::move(args)...);
- }
-
- template
- void
- coinpaprika_provider::generic_rpc_paprika_process(
- const TRequest& request, std::string ticker, std::shared_mutex& mtx, std::unordered_map& container, TExecutorFunctor&& functor,
- Args... args)
- {
- const auto answer_functor = [this, &mtx, &container, functor = std::forward(functor), request, ticker = std::move(ticker),
- ... args = std::move(args)](web::http::http_response resp) mutable {
- const auto answer = process_generic_resp(resp);
- if (answer.rpc_result_code == static_cast(antara::app::http_code::too_many_requests))
- {
- std::this_thread::sleep_for(1s);
- generic_rpc_paprika_process(request, std::move(ticker), mtx, container, std::forward(functor), std::move(args)...);
- }
- else
- {
- generic_post_verification(mtx, container, std::move(ticker), std::move(answer), std::move(args)...);
- }
- };
-
- functor(request).then(answer_functor).then(&handle_exception_pplx_task);
- }
-} // namespace atomic_dex
-
-//! RPC call
-namespace atomic_dex
-{
- template
- void
- coinpaprika_provider::process_provider(const coin_config_t& current_coin, Args... args)
- {
- const price_converter_request request{.base_currency_id = current_coin.coinpaprika_id, .quote_currency_id = "usd-us-dollars"};
- generic_rpc_paprika_process(
- request, current_coin.ticker, m_provider_mutex, m_usd_rate_providers,
- [](auto&& request) { return async_price_converter(std::forward(request)); }, std::move(args)...);
- }
-
- template
- void
- coinpaprika_provider::process_ticker_infos(const coin_config_t& current_coin, Args... args)
- {
- const ticker_infos_request request{.ticker_currency_id = current_coin.coinpaprika_id, .ticker_quotes = {"USD", "EUR", "BTC"}};
- generic_rpc_paprika_process(
- request, current_coin.ticker, m_ticker_infos_mutex, m_ticker_infos_registry,
- [](auto&& request) { return async_ticker_info(std::forward(request)); }, std::move(args)...);
- }
-
- template
- void
- coinpaprika_provider::process_ticker_historical(const coin_config_t& current_coin, Args... args)
- {
- const ticker_historical_request request{.ticker_currency_id = current_coin.coinpaprika_id, .interval = "2h"};
- generic_rpc_paprika_process(
- request, current_coin.ticker, m_ticker_historical_mutex, m_ticker_historical_registry,
- [](auto&& request) { return async_ticker_historical(std::forward(request)); }, std::move(args)...);
- }
-} // namespace atomic_dex
-
-//! System Override
-namespace atomic_dex
-{
- void
- coinpaprika_provider::update()
- {
- }
-} // namespace atomic_dex
-
-//! Events
-namespace atomic_dex
-{
- void
- coinpaprika_provider::on_mm2_started([[maybe_unused]] const mm2_started& evt)
- {
- update_ticker_and_provider();
- }
-
- void
- coinpaprika_provider::on_coin_enabled(const coin_enabled& evt)
- {
- SPDLOG_INFO("{} enabled, retrieve coinpaprika infos", fmt::format("{}", fmt::join(evt.tickers, ", ")));
- auto idx{std::make_shared(0)};
- const auto target_size = evt.tickers.size() * g_pending_init_tasks_limit;
- const auto* global_cfg_system = m_system_manager.get_system().get_global_cfg();
- for (auto&& ticker: evt.tickers)
- {
- const auto config = global_cfg_system->get_coin_info(ticker);
- if (config.coinpaprika_id != "test-coin")
- {
- process_provider(config, idx, target_size, evt.tickers);
- process_ticker_infos(config, idx, target_size, evt.tickers);
- process_ticker_historical(config, idx, target_size, evt.tickers);
- }
- else
- {
- const std::uint16_t cur = idx->fetch_add(g_pending_init_tasks_limit) + g_pending_init_tasks_limit; ///< Manually skip the above 3 operations
- if (cur == target_size)
- {
- this->dispatcher_.trigger(evt.tickers);
- }
- }
- }
- }
-
- void
- coinpaprika_provider::on_coin_disabled(const coin_disabled& evt)
- {
- SPDLOG_INFO("{} disabled, removing from paprika provider", evt.ticker);
- std::unique_lock lock(m_provider_mutex);
- m_usd_rate_providers.erase(evt.ticker);
- }
-} // namespace atomic_dex
-
-//! Public member functions
-namespace atomic_dex
-{
- void
- coinpaprika_provider::update_ticker_and_provider()
- {
- const auto coins = this->m_system_manager.get_system().get_global_cfg()->get_enabled_coins();
- auto idx{std::make_shared(0)};
- const auto target_size = coins.size();
- for (auto&& [_, current_coin]: coins)
- {
- if (current_coin.coinpaprika_id == "test-coin")
- {
- const std::uint16_t cur = idx->fetch_add(1) + 1;
- if (cur == target_size)
- {
- dispatcher_.trigger("");
- }
- continue;
- }
- process_ticker_infos(current_coin);
- process_ticker_historical(current_coin);
- process_provider(current_coin, idx, target_size, std::vector{});
- }
- }
-
- std::string
- coinpaprika_provider::get_rate_conversion(const std::string& ticker) const
- {
- return get_infos(ticker, m_usd_rate_providers, m_provider_mutex).price;
- }
-
- t_ticker_info_answer
- coinpaprika_provider::get_ticker_infos(const std::string& ticker) const
- {
- return get_infos(ticker, m_ticker_infos_registry, m_ticker_infos_mutex);
- }
-
- t_ticker_historical_answer
- coinpaprika_provider::get_ticker_historical(const std::string& ticker) const
- {
- return get_infos(ticker, m_ticker_historical_registry, m_ticker_historical_mutex);
- }
-} // namespace atomic_dex
\ No newline at end of file
diff --git a/src/core/atomicdex/services/price/coinpaprika/coinpaprika.provider.hpp b/src/core/atomicdex/services/price/coinpaprika/coinpaprika.provider.hpp
deleted file mode 100644
index 01352719e5..0000000000
--- a/src/core/atomicdex/services/price/coinpaprika/coinpaprika.provider.hpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/******************************************************************************
- * Copyright © 2013-2024 The Komodo Platform Developers. *
- * *
- * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
- * the top-level directory of this distribution for the individual copyright *
- * holder information and the developer policies on copyright and licensing. *
- * *
- * Unless otherwise agreed in a custom licensing agreement, no part of the *
- * Komodo Platform software, including this file may be copied, modified, *
- * propagated or distributed except according to the terms contained in the *
- * LICENSE file *
- * *
- * Removal or modification of this copyright notice is prohibited. *
- * *
- ******************************************************************************/
-
-#pragma once
-
-//! STD
-#include
-
-//! Deps
-#include
-
-//! Project Headers
-#include "atomicdex/api/coinpaprika/coinpaprika.hpp"
-#include "atomicdex/events/events.hpp"
-
-namespace atomic_dex
-{
- namespace ag = antara::gaming;
-
- class coinpaprika_provider final : public ag::ecs::pre_update_system
- {
- //! Typedefs
- using t_ref_count_idx = std::shared_ptr;
- using t_providers_registry = std::unordered_map;
- using t_ticker_infos_registry = std::unordered_map;
- using t_ticker_historical_registry = std::unordered_map;
-
- //! Private fields
-
- //! ag::system_manager
- ag::ecs::system_manager& m_system_manager;
-
- //! Containers
- t_providers_registry m_usd_rate_providers{}; ///< USD Rate Providers
- t_ticker_infos_registry m_ticker_infos_registry{}; ///< Ticker info registry, key is the ticker
- t_ticker_historical_registry m_ticker_historical_registry{}; ///< Ticker historical registry, key is the ticker
-
- //! Mutexes
- mutable std::shared_mutex m_ticker_historical_mutex;
- mutable std::shared_mutex m_ticker_infos_mutex;
- mutable std::shared_mutex m_provider_mutex;
-
- //! Private member functions
- void verify_idx(t_ref_count_idx idx = nullptr, uint16_t target_size = 0, const std::vector& tickers = {});
-
- //! Private templated member functions
- template
- TAnswer get_infos(const std::string& ticker, const TRegistry& registry, TLockable& mutex) const ;
-
- template
- void generic_post_verification(std::shared_mutex& mtx, TContainer& container, std::string&& ticker, TAnswer&& answer, Args... args);
-
- template
- void generic_rpc_paprika_process(
- const TRequest& request, std::string ticker, std::shared_mutex& mtx, std::unordered_map& container,
- TExecutorFunctor&& functor, Args... args);
-
- //! Private RPC Call
- template
- void process_provider(const coin_config_t& current_coin, Args... args);
- template
- void process_ticker_infos(const coin_config_t& current_coin, Args... args);
- template
- void process_ticker_historical(const coin_config_t& current_coin, Args... args);
-
- public:
- //! Deleted operation
- coinpaprika_provider(coinpaprika_provider& other) = delete;
- coinpaprika_provider(coinpaprika_provider&& other) = delete;
- coinpaprika_provider& operator=(coinpaprika_provider& other) = delete;
- coinpaprika_provider& operator=(coinpaprika_provider&& other) = delete;
-
- //! Constructor
- coinpaprika_provider(entt::registry& registry, ag::ecs::system_manager& system_manager) ;
-
- //! Destructor
- ~coinpaprika_provider() final;
-
- ///< Public API
-
- //! Update all the data of the provider in an async way
- void update_ticker_and_provider();
-
- //! Get the rate conversion for the given fiat.
- [[nodiscard]] std::string get_rate_conversion(const std::string& ticker) const ;
-
- //! Get the ticker informations.
- [[nodiscard]] t_ticker_info_answer get_ticker_infos(const std::string& ticker) const ;
-
- //! Get the ticker informations.
- [[nodiscard]] t_ticker_historical_answer get_ticker_historical(const std::string& ticker) const ;
-
- ///< Events
-
- //! Event that occur when the mm2 process is launched correctly.
- void on_mm2_started(const mm2_started& evt) ;
-
- //! Event that occur when a coin is correctly enabled.
- void on_coin_enabled(const coin_enabled& evt) ;
-
- //! Event that occur when a coin is correctly disabled.
- void on_coin_disabled(const coin_disabled& evt) ;
-
- //! Override ag::system functions
- void update() final;
- };
-} // namespace atomic_dex
-
-REFL_AUTO(type(atomic_dex::coinpaprika_provider))
\ No newline at end of file
diff --git a/src/core/atomicdex/services/price/defi.stats.cpp b/src/core/atomicdex/services/price/defi.stats.cpp
index b747a944b5..e14d40283c 100644
--- a/src/core/atomicdex/services/price/defi.stats.cpp
+++ b/src/core/atomicdex/services/price/defi.stats.cpp
@@ -17,7 +17,6 @@
//! Project Headers
#include "atomicdex/services/price/defi.stats.hpp"
#include "atomicdex/services/price/komodo_prices/komodo.prices.provider.hpp"
-#include "atomicdex/api/coinpaprika/coinpaprika.hpp"
#include "atomicdex/pages/qt.settings.page.hpp"
#include "atomicdex/services/price/global.provider.hpp"
diff --git a/src/core/atomicdex/services/price/global.provider.cpp b/src/core/atomicdex/services/price/global.provider.cpp
index 93e57b3a6c..d9d84a0852 100644
--- a/src/core/atomicdex/services/price/global.provider.cpp
+++ b/src/core/atomicdex/services/price/global.provider.cpp
@@ -16,7 +16,6 @@
//! Project Headers
#include "atomicdex/services/price/global.provider.hpp"
-#include "atomicdex/api/coinpaprika/coinpaprika.hpp"
#include "atomicdex/pages/qt.settings.page.hpp"
#include "atomicdex/services/price/komodo_prices/komodo.prices.provider.hpp"
@@ -100,63 +99,15 @@ namespace atomic_dex
global_price_service::refresh_other_coins_rates(
const std::string& quote_id, const std::string& ticker, bool with_update_providers, std::atomic_uint16_t nb_try)
{
- nb_try += 1;
+ // nb_try += 1;
+ // TODO: Paprika price conversion removed, needs to be replaced
+ nb_try = 10;
SPDLOG_INFO("refresh_other_coins_rates - try {}", nb_try.load());
if (nb_try == 10)
{
SPDLOG_WARN("refresh other coins rates max try reached, skipping");
return;
}
- using namespace std::chrono_literals;
- coinpaprika::api::price_converter_request request{.base_currency_id = "usd-us-dollars", .quote_currency_id = quote_id};
- auto error_functor = [this, quote_id, ticker, with_update_providers, nb_try_load = nb_try.load()](pplx::task previous_task)
- {
- try
- {
- previous_task.wait();
- }
- catch (const std::exception& e)
- {
- SPDLOG_ERROR("pplx task error from refresh_other_coins_rates: {} - nb_try {}", e.what(), nb_try_load);
- using namespace std::chrono_literals;
- std::this_thread::sleep_for(1s);
- this->refresh_other_coins_rates(quote_id, ticker, with_update_providers, nb_try_load);
- };
- };
- coinpaprika::api::async_price_converter(request)
- .then(
- [this, quote_id, ticker, with_update_providers, nb_try_cap = nb_try.load()](web::http::http_response resp)
- {
- auto answer = coinpaprika::api::process_generic_resp(resp);
- if (answer.rpc_result_code == static_cast(antara::app::http_code::too_many_requests))
- {
- std::this_thread::sleep_for(1s);
- SPDLOG_WARN("too many request - retrying");
- this->refresh_other_coins_rates(quote_id, ticker, with_update_providers, nb_try_cap);
- }
- else
- {
- SPDLOG_INFO("Successfully get the coinpaprika::api::async_price_converter answer after {} try", nb_try_cap);
- if (answer.raw_result.find("error") == std::string::npos)
- {
- if (not answer.price.empty())
- {
- std::unique_lock lock(m_coin_rate_mutex);
- this->m_coin_rate_providers[ticker] = answer.price;
- }
- }
- else
- {
- std::unique_lock lock(m_coin_rate_mutex);
- this->m_coin_rate_providers[ticker] = "0.00";
- }
- }
- if (with_update_providers)
- {
- //this->m_system_manager.get_system().update_ticker_and_provider();
- }
- })
- .then(error_functor);
}
global_price_service::global_price_service(entt::registry& registry, ag::ecs::system_manager& system_manager, atomic_dex::cfg& cfg) :
diff --git a/src/core/atomicdex/services/price/orderbook.scanner.service.cpp b/src/core/atomicdex/services/price/orderbook.scanner.service.cpp
index b49b3b7d89..ed6b2dcfcd 100644
--- a/src/core/atomicdex/services/price/orderbook.scanner.service.cpp
+++ b/src/core/atomicdex/services/price/orderbook.scanner.service.cpp
@@ -63,9 +63,9 @@ namespace atomic_dex
nlohmann::json batch = nlohmann::json::array();
if (rpc.error)
{
- SPDLOG_ERROR("error: bad answer json for process_best_orders: {}", rpc.error->error);
+ // 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(true);
}
else
@@ -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(false);
emit trading_pg.get_orderbook_wrapper()->bestOrdersBusyChanged();
}