diff --git a/.gitignore b/.gitignore index 773af63e77..b2edef99f5 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,4 @@ ci_tools_atomic_dex/installer/linux/packages/com.komodoplatform.atomicdexpro/dat cmake-build-debug cmake-build-release .idea +.gitconfig diff --git a/README.md b/README.md index 8adfbdd026..49d5efb473 100644 --- a/README.md +++ b/README.md @@ -24,109 +24,103 @@ For details please refer to our [license](https://github.com/KomodoPlatform/atom THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## Dependencies - -``` -boost-algorithm 1.71.0 Boost algorithm module -boost-any 1.71.0 Boost any module -boost-array 1.71.0 Boost array module -boost-assert 1.71.0 Boost assert module -boost-atomic 1.71.0 Boost atomic module -boost-bind 1.71.0 Boost bind module -boost-build 1.70.0-1 Boost.Build -boost-chrono 1.71.0 Boost chrono module -boost-circular-buffer 1.71.0 Boost circular_buffer module -boost-compatibility 1.71.0 Boost compatibility module -boost-concept-check 1.71.0 Boost concept_check module -boost-config 1.71.0 Boost config module -boost-container-hash 1.71.0 Boost container_hash module -boost-container 1.71.0 Boost container module -boost-context 1.71.0 Boost context module -boost-conversion 1.71.0 Boost conversion module -boost-core 1.71.0 Boost core module -boost-crc 1.71.0 Boost crc module -boost-date-time 1.71.0 Boost date_time module -boost-detail 1.71.0 Boost detail module -boost-endian 1.71.0 Boost endian module -boost-exception 1.71.0 Boost exception module -boost-filesystem 1.71.0 Boost filesystem module -boost-foreach 1.71.0 Boost foreach module -boost-function-types 1.71.0 Boost function_types module -boost-function 1.71.0 Boost function module -boost-functional 1.71.0 Boost functional module -boost-fusion 1.71.0 Boost fusion module -boost-integer 1.71.0 Boost integer module -boost-intrusive 1.71.0 Boost intrusive module -boost-io 1.71.0 Boost io module -boost-iostreams 1.71.0 Boost iostreams module -boost-iterator 1.71.0 Boost iterator module -boost-lambda 1.71.0 Boost lambda module -boost-lexical-cast 1.71.0 Boost lexical_cast module -boost-locale 1.71.0 Boost locale module -boost-math 1.71.0 Boost math module -boost-modular-build-helper 1.71.0-1 -boost-move 1.71.0 Boost move module -boost-mp11 1.71.0 Boost mp11 module -boost-mpl 1.71.0 Boost mpl module -boost-multi-index 1.71.0 Boost multi_index module -boost-multiprecision 1.71.0 Boost multiprecision module -boost-numeric-conversion 1.71.0 Boost numeric_conversion module -boost-optional 1.71.0 Boost optional module -boost-phoenix 1.71.0 Boost phoenix module -boost-pool 1.71.0 Boost pool module -boost-predef 1.71.0 Boost predef module -boost-preprocessor 1.71.0 Boost preprocessor module -boost-program-options 1.71.0 Boost program_options module -boost-proto 1.71.0 Boost proto module -boost-range 1.71.0 Boost range module -boost-ratio 1.71.0 Boost ratio module -boost-rational 1.71.0 Boost rational module -boost-regex 1.71.0 Boost regex module -boost-serialization 1.71.0 Boost serialization module -boost-smart-ptr 1.71.0 Boost smart_ptr module -boost-spirit 1.71.0 Boost spirit module -boost-static-assert 1.71.0 Boost static_assert module -boost-system 1.71.0 Boost system module -boost-thread 1.71.0 Boost thread module -boost-throw-exception 1.71.0 Boost throw_exception module -boost-tokenizer 1.71.0 Boost tokenizer module -boost-tti 1.71.0 Boost tti module -boost-tuple 1.71.0 Boost tuple module -boost-type-index 1.71.0 Boost type_index module -boost-type-traits 1.71.0 Boost type_traits module -boost-typeof 1.71.0 Boost typeof module -boost-unordered 1.71.0 Boost unordered module -boost-utility 1.71.0 Boost utility module -boost-variant 1.71.0 Boost variant module -boost-vcpkg-helpers 6 a set of vcpkg-internal scripts used to modulari... -boost-winapi 1.71.0 Boost winapi module -bzip2 1.0.6-4 High-quality data compressor. -date 2019-11-08 A date and time library based on the C++17 + + + AtomicDEX PRO, a desktop wallet application + + + + + + + + + + \ No newline at end of file diff --git a/qml.qrc b/qml.qrc index 3bcb4c2c20..2a0cafd2b5 100644 --- a/qml.qrc +++ b/qml.qrc @@ -33,7 +33,11 @@ atomic_qt_design/assets/images/coins/awc.png atomic_qt_design/assets/images/coins/btc.png atomic_qt_design/assets/images/coins/bch.png + atomic_qt_design/assets/images/coins/bet.png + atomic_qt_design/assets/images/coins/bots.png + atomic_qt_design/assets/images/coins/crypto.png atomic_qt_design/assets/images/coins/dash.png + atomic_qt_design/assets/images/coins/jumblr.png atomic_qt_design/assets/images/coins/ltc.png atomic_qt_design/assets/images/coins/eth.png atomic_qt_design/assets/images/coins/kmd.png @@ -41,8 +45,12 @@ atomic_qt_design/assets/images/coins/dex.png atomic_qt_design/assets/images/coins/labs.png atomic_qt_design/assets/images/coins/rick.png + atomic_qt_design/assets/images/coins/mgw.png atomic_qt_design/assets/images/coins/morty.png + atomic_qt_design/assets/images/coins/pangea.png + atomic_qt_design/assets/images/coins/revs.png atomic_qt_design/assets/images/coins/hush.png + atomic_qt_design/assets/images/coins/supernet.png atomic_qt_design/assets/images/coins/usdc.png atomic_qt_design/assets/images/coins/vrsc.png atomic_qt_design/assets/images/coins/vote2020.png diff --git a/src/atomic.dex.app.cpp b/src/atomic.dex.app.cpp index e45b20db32..72d682742d 100644 --- a/src/atomic.dex.app.cpp +++ b/src/atomic.dex.app.cpp @@ -302,8 +302,10 @@ namespace atomic_dex refresh_fiat_balance(mm2, paprika); refresh_address(mm2); const auto& info = get_mm2().get_coin_info(m_coin_info->get_ticker().toStdString()); + m_coin_info->set_name(QString::fromStdString(info.name)); m_coin_info->set_claimable(info.is_claimable); m_coin_info->set_type(QString::fromStdString(info.type)); + m_coin_info->set_paprika_id(QString::fromStdString(info.coinpaprika_id)); m_coin_info->set_minimal_balance_for_asking_rewards(QString::fromStdString(info.minimal_claim_amount)); m_coin_info->set_explorer_url(QString::fromStdString(info.explorer_url[0])); m_refresh_current_ticker_infos = false; @@ -513,10 +515,11 @@ namespace atomic_dex { atomic_dex::t_withdraw_request req{ .to = address.toStdString(), .coin = m_coin_info->get_ticker().toStdString(), .max = max, .amount = amount.toStdString()}; - req.fees = atomic_dex::t_withdraw_fees{.type = is_erc_20 ? "EthGas" : "UtxoFixed", - .amount = fees_amount.toStdString(), - .gas_price = gas_price.toStdString(), - .gas_limit = not gas.isEmpty() ? std::stoi(gas.toStdString()) : 0}; + req.fees = atomic_dex::t_withdraw_fees{ + .type = is_erc_20 ? "EthGas" : "UtxoFixed", + .amount = fees_amount.toStdString(), + .gas_price = gas_price.toStdString(), + .gas_limit = not gas.isEmpty() ? std::stoi(gas.toStdString()) : 0}; std::error_code ec; auto answer = mm2::withdraw(std::move(req), ec); auto coin = get_mm2().get_coin_info(m_coin_info->get_ticker().toStdString()); @@ -734,16 +737,17 @@ namespace atomic_dex for (auto& swap: swaps.swaps) { - nlohmann::json j2 = {{"maker_coin", swap.maker_coin}, - {"taker_coin", swap.taker_coin}, - {"is_recoverable", swap.funds_recoverable}, - {"maker_amount", swap.maker_amount}, - {"taker_amount", swap.taker_amount}, - {"error_events", swap.error_events}, - {"success_events", swap.success_events}, - {"type", swap.type}, - {"events", swap.events}, - {"my_info", swap.my_info}}; + nlohmann::json j2 = { + {"maker_coin", swap.maker_coin}, + {"taker_coin", swap.taker_coin}, + {"is_recoverable", swap.funds_recoverable}, + {"maker_amount", swap.maker_amount}, + {"taker_amount", swap.taker_amount}, + {"error_events", swap.error_events}, + {"success_events", swap.success_events}, + {"type", swap.type}, + {"events", swap.events}, + {"my_info", swap.my_info}}; auto out_swap = QJsonDocument::fromJson(QString::fromStdString(j2.dump()).toUtf8()); out.insert(QString::fromStdString(swap.uuid), out_swap.toVariant()); @@ -890,8 +894,8 @@ namespace atomic_dex { QVariantMap out; - auto trade_fee_f = get_mm2().get_trade_fee(ticker.toStdString(), amount.toStdString(), false); - auto answer = get_mm2().get_trade_fixed_fee(ticker.toStdString()); + auto trade_fee_f = get_mm2().get_trade_fee(ticker.toStdString(), amount.toStdString(), false); + auto answer = get_mm2().get_trade_fixed_fee(ticker.toStdString()); if (!answer.amount.empty()) { @@ -931,13 +935,14 @@ namespace atomic_dex for (auto&& coin: coins) { std::error_code ec; - nlohmann::json cur_obj{{"ticker", coin.ticker}, - {"name", coin.name}, - {"price", get_paprika().get_rate_conversion(m_current_fiat.toStdString(), coin.ticker, ec, true)}, - {"balance", get_mm2().my_balance(coin.ticker, ec)}, - {"balance_fiat", get_paprika().get_price_in_fiat(m_current_fiat.toStdString(), coin.ticker, ec)}, - {"rates", get_paprika().get_ticker_infos(coin.ticker).answer}, - {"historical", get_paprika().get_ticker_historical(coin.ticker).answer}}; + nlohmann::json cur_obj{ + {"ticker", coin.ticker}, + {"name", coin.name}, + {"price", get_paprika().get_rate_conversion(m_current_fiat.toStdString(), coin.ticker, ec, true)}, + {"balance", get_mm2().my_balance(coin.ticker, ec)}, + {"balance_fiat", get_paprika().get_price_in_fiat(m_current_fiat.toStdString(), coin.ticker, ec)}, + {"rates", get_paprika().get_ticker_infos(coin.ticker).answer}, + {"historical", get_paprika().get_ticker_historical(coin.ticker).answer}}; j.push_back(cur_obj); } QJsonDocument q_json = QJsonDocument::fromJson(QString::fromStdString(j.dump()).toUtf8()); @@ -1076,7 +1081,7 @@ namespace atomic_dex QImage application::get_qr_code(QString text_to_encode, QSize size) { - //QImage qrcode = QZXing::encodeData(text_to_encode, QZXing::EncoderFormat_QR_CODE, size); + // QImage qrcode = QZXing::encodeData(text_to_encode, QZXing::EncoderFormat_QR_CODE, size); return QImage(); } @@ -1087,10 +1092,11 @@ namespace atomic_dex std::vector mnemonic; // Split - std::string s = entropy.toStdString(); + std::string s = entropy.toStdString(); const std::string delimiter = " "; - size_t pos = 0; - while ((pos = s.find(delimiter)) != std::string::npos) { + size_t pos = 0; + while ((pos = s.find(delimiter)) != std::string::npos) + { mnemonic.emplace_back(s.substr(0, pos)); s.erase(0, pos + delimiter.length()); } @@ -1102,4 +1108,9 @@ namespace atomic_dex return bip39_mnemonic_validate(nullptr, entropy.toStdString().c_str()) == 0; #endif } + QString + application::get_paprika_id_from_ticker(QString ticker) const + { + return QString::fromStdString(get_mm2().get_coin_info(ticker.toStdString()).coinpaprika_id); + } } // namespace atomic_dex diff --git a/src/atomic.dex.app.hpp b/src/atomic.dex.app.hpp index 3177c478b8..d761d52aad 100644 --- a/src/atomic.dex.app.hpp +++ b/src/atomic.dex.app.hpp @@ -102,6 +102,7 @@ namespace atomic_dex void launch(); //! Bind to the QML Worlds + Q_INVOKABLE QString get_paprika_id_from_ticker(QString ticker) const; Q_INVOKABLE QString get_mm2_version() const; Q_INVOKABLE bool mnemonic_validate(QString entropy); Q_INVOKABLE QImage get_qr_code(QString text_to_encode, QSize size); diff --git a/src/atomic.dex.mm2.api.cpp b/src/atomic.dex.mm2.api.cpp index 8b2934fb45..d17bcfa6f9 100644 --- a/src/atomic.dex.mm2.api.cpp +++ b/src/atomic.dex.mm2.api.cpp @@ -163,7 +163,7 @@ namespace mm2::api using namespace date; using namespace std::chrono; date::sys_seconds tp{seconds{cfg.timestamp}}; - std::string s = date::format("%e. %b %Y %I:%M", tp); + std::string s = date::format("%e %b %Y, %I:%M", tp); cfg.timestamp_as_date = std::move(s); } diff --git a/src/atomic.dex.qt.current.coin.infos.cpp b/src/atomic.dex.qt.current.coin.infos.cpp index f4eecae48b..5329071967 100644 --- a/src/atomic.dex.qt.current.coin.infos.cpp +++ b/src/atomic.dex.qt.current.coin.infos.cpp @@ -24,6 +24,19 @@ namespace atomic_dex atomic_dex::current_coin_info::current_coin_info(entt::dispatcher& dispatcher, QObject* pParent) noexcept : QObject(pParent), m_dispatcher(dispatcher) {} //! Properties + void + atomic_dex::current_coin_info::set_name(QString name) noexcept + { + this->selected_coin_fname = std::move(name); + emit name_changed(); + } + + QString + atomic_dex::current_coin_info::get_name() const noexcept + { + return this->selected_coin_fname; + } + QString atomic_dex::current_coin_info::get_balance() const noexcept { @@ -167,4 +180,17 @@ namespace atomic_dex this->selected_coin_type = std::move(type); emit type_changed(); } + + QString + atomic_dex::current_coin_info::get_paprika_id() const noexcept + { + return this->selected_coin_paprika_id; + } + + void + atomic_dex::current_coin_info::set_paprika_id(QString paprika_id) noexcept + { + this->selected_coin_paprika_id = std::move(paprika_id); + emit coinpaprika_id_changed(); + } } // namespace atomic_dex \ No newline at end of file diff --git a/src/atomic.dex.qt.current.coin.infos.hpp b/src/atomic.dex.qt.current.coin.infos.hpp index 404222b26e..b32ad1b0f7 100644 --- a/src/atomic.dex.qt.current.coin.infos.hpp +++ b/src/atomic.dex.qt.current.coin.infos.hpp @@ -33,6 +33,8 @@ namespace atomic_dex Q_PROPERTY(QString minimal_balance_for_asking_rewards READ get_minimal_balance_for_asking_rewards WRITE set_minimal_balance_for_asking_rewards NOTIFY minimal_balance_for_asking_rewards_changed) Q_PROPERTY(QString ticker READ get_ticker WRITE set_ticker NOTIFY ticker_changed) + Q_PROPERTY(QString name READ get_name WRITE set_name NOTIFY name_changed) + Q_PROPERTY(QString paprika_id READ get_paprika_id WRITE set_paprika_id NOTIFY coinpaprika_id_changed) Q_PROPERTY(QString type READ get_type WRITE set_type NOTIFY type_changed) Q_PROPERTY(QString balance READ get_balance WRITE set_balance NOTIFY balance_changed) Q_PROPERTY(QString address READ get_address WRITE set_address NOTIFY address_changed) @@ -56,6 +58,10 @@ namespace atomic_dex void set_transactions(QObjectList transactions) noexcept; [[nodiscard]] QString get_ticker() const noexcept; void set_ticker(QString ticker) noexcept; + [[nodiscard]] QString get_name() const noexcept; + void set_name(QString ticker) noexcept; + [[nodiscard]] QString get_paprika_id() const noexcept; + void set_paprika_id(QString ticker) noexcept; [[nodiscard]] QString get_address() const noexcept; void set_address(QString address) noexcept; [[nodiscard]] QString get_balance() const noexcept; @@ -79,9 +85,13 @@ namespace atomic_dex void fiat_amount_changed(); void transactionsChanged(); void type_changed(); + void name_changed(); + void coinpaprika_id_changed(); public: QString selected_coin_name; + QString selected_coin_fname; + QString selected_coin_paprika_id; QString selected_coin_balance; QString selected_coin_type; QString selected_coin_address;