diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 51cdf57ac8..b9a906e883 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,7 +26,7 @@ Please describe what you expected to happen. **Operating Environment(s):** - OS: [e.g. Windows/OSX/Linux. If Linux, include distro. ] - OS version: [e.g. 7/10/11, 10.13/10.15, 18.04/20.04 ] - - AtomicDEX Version: [e.g. 0.5.7.2] + - AtomicDEX Version: [e.g. 0.5.8] - Build branch: [e.g. master/dev] diff --git a/.github/workflows/atomicdex-desktop-cd.yml b/.github/workflows/atomicdex-desktop-cd.yml index f9f3dae234..8231d00f83 100644 --- a/.github/workflows/atomicdex-desktop-cd.yml +++ b/.github/workflows/atomicdex-desktop-cd.yml @@ -9,6 +9,7 @@ env: DEX_PROJECT_NAME: "atomicdex-desktop" DEX_DISPLAY_NAME: "AtomicDex Desktop" DEX_COMPANY: "KomodoPlatform" + DEX_VERSION: "0.5.8" DEX_WEBSITE: "https://atomicdex.io/" jobs: diff --git a/.github/workflows/atomicdex-desktop-ci.yml b/.github/workflows/atomicdex-desktop-ci.yml index d6df9925c2..6c473f73fa 100644 --- a/.github/workflows/atomicdex-desktop-ci.yml +++ b/.github/workflows/atomicdex-desktop-ci.yml @@ -16,6 +16,7 @@ env: DEX_PROJECT_NAME: "atomicdex-desktop" DEX_DISPLAY_NAME: "AtomicDex Desktop" DEX_COMPANY: "KomodoPlatform" + DEX_VERSION: "0.5.8" DEX_WEBSITE: "https://atomicdex.io/" VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/b/vcpkg_cache VCPKG_BINARY_SOURCES: clear;x-gha,readwrite diff --git a/.gitignore b/.gitignore index df4eea238a..93ff04824c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # This file is used to ignore files which are generated # ---------------------------------------------------------------------------- - +.vscode/ *~ *.autosave *.a diff --git a/CMakeLists.txt b/CMakeLists.txt index 60cba2e1fc..e390d48e2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ include(vcpkg_prerequisites) include(qt_prerequisites) include(cfg_hash) -project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.5.7.2) +project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.5.8) message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}") include(cmake_default_options) @@ -60,13 +60,13 @@ endif () ##! We fetch our dependencies if (APPLE) FetchContent_Declare(mm2 - URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.1.8741/mm2-6e4de5d21-Darwin-Release.zip) + URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/v1.0.5-beta/mm2-1d8bebd15-Darwin-Release.zip) elseif (UNIX AND NOT APPLE) FetchContent_Declare(mm2 - URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.1.8741/mm2-6e4de5d21-Linux-Release.zip) + URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/v1.0.5-beta/mm2-1d8bebd15-Linux-Release.zip) else () FetchContent_Declare(mm2 - URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.1.8741/mm2-6e4de5d21-Windows_NT-Release.zip) + URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/v1.0.5-beta/mm2-1d8bebd15-Win64.zip) endif () #FetchContent_Declare(qmaterial URL https://github.com/KomodoPlatform/Qaterial/archive/last-clang-working-2.zip) diff --git a/assets/config/cfg.json b/assets/config/cfg.json index 2cc5b79023..46d1b624b8 100644 --- a/assets/config/cfg.json +++ b/assets/config/cfg.json @@ -1,5 +1,6 @@ { "notification_enabled": true, + "spamfilter_enabled": false, "current_currency": "USD", "current_fiat": "USD", "current_currency_sign": "$", diff --git a/atomic_defi_design/Dex/App.qml b/atomic_defi_design/Dex/App.qml index b0137c1c15..47b9735d40 100644 --- a/atomic_defi_design/Dex/App.qml +++ b/atomic_defi_design/Dex/App.qml @@ -32,7 +32,6 @@ DexRectangle property var notification_modal: notifications_modal property var logout_confirm_modal: logout_modal property var notifications_list: _currentPage === App.ScreenType.Dashboard ? loader.item.notifications_list : [] - property bool segwit_on: false property var _currentPage: API.app.wallet_mgr.log_status() ? App.ScreenType.Dashboard : App.ScreenType.Startup property var _availablePages: [_startup, dashboard] diff --git a/atomic_defi_design/Dex/Components/CexInfoModal.qml b/atomic_defi_design/Dex/Components/CexInfoModal.qml index 64777e138f..cc7c3725a4 100644 --- a/atomic_defi_design/Dex/Components/CexInfoModal.qml +++ b/atomic_defi_design/Dex/Components/CexInfoModal.qml @@ -17,9 +17,7 @@ MultipageModal { Layout.preferredHeight: 200 Layout.fillWidth: true - text: qsTr('Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.

Data is sourced via Band Decentralized Oracle and CoinGecko.

Oracle Supported Pairs:
%1

Last reference (Band Oracle):
%2') - .arg(API.app.portfolio_pg.oracle_price_supported_pairs.join(', ')) - .arg(API.app.portfolio_pg.oracle_last_price_reference) + text: qsTr('Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.

Data is sourced via CoinGecko.') } } } diff --git a/atomic_defi_design/Dex/Components/CoinTypeTag.qml b/atomic_defi_design/Dex/Components/CoinTypeTag.qml index 7f544b8183..d423956f0f 100644 --- a/atomic_defi_design/Dex/Components/CoinTypeTag.qml +++ b/atomic_defi_design/Dex/Components/CoinTypeTag.qml @@ -1,22 +1,22 @@ -import QtQuick 2.15 -import "../Constants" -import App 1.0 - -AnimatedRectangle { - property string type - radius: 20 - - height: type_tag.font.pixelSize * 1.5 - width: type_tag.width + 8 - - color: Style.getCoinTypeColor(type) - - DexLabel { - id: type_tag - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - text: type - color: Style.getCoinTypeTextColor(type) - font: DexTypo.overLine - } -} +import QtQuick 2.15 +import "../Constants" +import App 1.0 + +AnimatedRectangle { + property string type + radius: 20 + + height: type_tag.font.pixelSize * 1.5 + width: type_tag.width + 8 + + color: Style.getCoinTypeColor(type) + + DexLabel { + id: type_tag + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + text: type + color: Style.getCoinTypeTextColor(type) + font: DexTypo.overLine + } +} diff --git a/atomic_defi_design/Dex/Constants/DexTheme.qml b/atomic_defi_design/Dex/Constants/DexTheme.qml index 6aedf64898..7653d2e248 100644 --- a/atomic_defi_design/Dex/Constants/DexTheme.qml +++ b/atomic_defi_design/Dex/Constants/DexTheme.qml @@ -331,121 +331,4 @@ QtObject { return Style.colorWhite4 } - function getCoinColor(ticker) { - const c = colorCoin[ticker] - return c || Style.colorTheme2 - } - - readonly property var colorCoin: ({ - "ARPA": "#CCD9E2", - "BCH": "#8DC351", - "BTC": "#F7931A", - "CLC": "#0970DC", - "FTC": "#FFFFFF", - "GLEEC": "#8C41FF", - "GRS": "#377E96", - "DOGE": "#C3A634", - "ETH": "#627EEA", - "KMD": "#2B6680", - "MORTY": "#A4764D", - "RICK": "#A5CBDD", - "EMC2": "#00CCFF", - "DASH": "#008CE7", - "RVN": "#384182", - "DGB": "#006AD2", - "FIRO": "#BB2100", - "LTC": "#BFBBBB", - "ZEC": "#ECB244", - "ZER": "#FFFFFF", - "NAV": "#7D59B5", - "DP": "#E41D25", - "ECA": "#A915DC", - "QTUM": "#2E9AD0", - "CHIPS": "#598182", - "AXE": "#C63877", - "PANGEA": "#D88245", - "JUMBLR": "#2B4649", - "DEX": "#43B7B6", - "COQUI": "#79A541", - "CRYPTO": "#F58736", - "LABS": "#C1F6E1", - "MGW": "#854F2F", - "MONA": "#DEC799", - "NMC": "#186C9D", - "RFOX": "#D83331", - "BOTS": "#F69B57", - "MCL": "#EA0000", - "CCL": "#FFE400", - "BET": "#F69B57", - "SUPERNET": "#F69B57", - "OOT": "#25AAE1", - "REVS": "#F69B57", - "ILN": "#523170", - "VRSC": "#3164D3", - "THC": "#819F6F", - "1INCH": "#95A7C5", - "BAT": "#FF5000", - "BUSD": "#EDB70B", - "DAI": "#B68900", - "USDC": "#317BCB", - "PAX": "#EDE70A", - "SUSHI": "#E25DA8", - "TUSD": "#2E3181", - "AWC": "#31A5F6", - "VRA": "#D70A41", - "SPACE": "#E44C65", - "QC": "#00D7B3", - "PBC": "#64A3CB", - "AAVE": "#9C64A6", - "ANT": "#33DAE6", - "AGI": "#6815FF", - "BAND": "#526BFF", - "BLK": "#191919", - "BNT": "#000D2B", - "BTCZ": "#F5B036", - "CEL": "#4055A6", - "CENNZ": "#2E87F1", - "COMP": "#00DBA3", - "CRO": "#243565", - "CVC": "#3AB03E", - "CVT": "#4B0082", - "DODO": "#FFF706", - "ELF": "#2B5EBB", - "ENJ": "#6752C3", - "EURS": "#2F77ED", - "FUN": "#EF1C70", - "GNO": "#00B0CC", - "HOT": "#983EFF", - "IOTX": "#00CDCE", - "KNC": "#117980", - "LEO": "#F79B2C", - "LINK": "#356CE4", - "LRC": "#32C2F8", - "MANA": "#FF3C6C", - "MATIC": "#1E61ED", - "MED": "#00B5FF", - "MKR": "#1BAF9F", - "NPXS": "#F3CB00", - "POWR": "#05BCAA", - "QI": "#FFFFFF", - "QIAIR": "#FEFEFE", - "QKC": "#2175B4", - "QNT": "#46DDC8", - "REP": "#0E0E21", - "REV": "#78034D", - "RLC": "#FFE100", - "SFUSD": "#9881B8", - "SNT": "#596BED", - "SNX": "#00D1FF", - "SOULJA": "#8F734A", - "STORJ": "#2683FF", - "TSL": "#64B082", - "VRM": "#586A7A", - "WSB": "#FEBB84", - "WBTC": "#CCCCCC", - "YFI": "#006BE6", - "ZRX": "#302C2C", - "UNI": "#FF007A", - "RUNES": "#336699" - }) } diff --git a/atomic_defi_design/Dex/Constants/General.qml b/atomic_defi_design/Dex/Constants/General.qml index 1a43d617e6..cdee60c2bc 100644 --- a/atomic_defi_design/Dex/Constants/General.qml +++ b/atomic_defi_design/Dex/Constants/General.qml @@ -87,6 +87,16 @@ QtObject { return API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).is_wallet_only } + function isFaucetCoin(ticker) + { + return API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).is_faucet_coin + } + + function isCoinWithMemo(ticker) { + const coin_info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker) + return coin_info.has_memos + } + function getLanguage() { return API.app.settings_pg.lang @@ -111,17 +121,22 @@ QtObject { { let progress = 100 if (!activation_status.hasOwnProperty("result")) return progress + // console.log("["+coin+"] [zhtlcActivationProgress]: " + JSON.stringify(activation_status)) let status = activation_status.result.status let details = activation_status.result.details let block_offset = 0 - if (coin == 'ARRR') block_offset = 1900000 + if (coin == 'ARRR') block_offset = 2000000 // use range from checkpoint block to present - if (status == "Ready") + if (!status) + { + return -1 + } + else if (status == "Ok") { if (details.hasOwnProperty("error")) - console.log("[zhtlcActivationProgress] Error enabling: " + JSON.stringify(details.error)) + console.log("["+coin+"] [zhtlcActivationProgress] Error enabling: " + JSON.stringify(details.error)) } else if (status == "InProgress") { @@ -140,7 +155,7 @@ QtObject { else if (details.hasOwnProperty("RequestingBalance")) progress = 98 else progress = 5 } - else console.log("[zhtlcActivationProgress] Unexpected status: " + status) + else console.log("["+coin+"] [zhtlcActivationProgress] Unexpected status: " + status) return progress } diff --git a/atomic_defi_design/Dex/Constants/Style.qml b/atomic_defi_design/Dex/Constants/Style.qml index 642d778762..e53a2422bf 100644 --- a/atomic_defi_design/Dex/Constants/Style.qml +++ b/atomic_defi_design/Dex/Constants/Style.qml @@ -196,6 +196,7 @@ QtObject { case 'Ethereum Classic': return dark_theme ? colorCoinDark["ETC"] : colorCoin["ETC"] case 'Arbitrum': return dark_theme ? colorCoinDark["ETH"] : colorCoin["ETH"] case 'ERC-20': return dark_theme ? colorCoinDark["ETH"] : colorCoin["ETH"] + case 'EWT': return dark_theme ? colorCoinDark["EWT"] : colorCoin["EWT"] case 'FTM-20': return dark_theme ? colorCoinDark["FTM"] : colorCoin["FTM"] case 'Moonbeam': return dark_theme ? colorCoinDark["GLMR"] : colorCoin["GLMR"] case 'HecoChain': return dark_theme ? colorCoinDark["HECO"] : colorCoin["HECO"] @@ -237,6 +238,7 @@ QtObject { case 'Ethereum Classic': return dark_theme ? colorCoinDark["ETC"] : colorCoin["ETC"] case 'Arbitrum': return dark_theme ? colorCoinDark["ETH"] : colorCoin["ETH"] case 'ERC-20': return dark_theme ? colorCoinDark["ETH"] : colorCoin["ETH"] + case 'EWT': return dark_theme ? colorCoinDark["EWT"] : colorCoin["EWT"] case 'FTM-20': return dark_theme ? colorCoinDark["FTM"] : colorCoin["FTM"] case 'Moonbeam': return dark_theme ? colorCoinDark["GLMR"] : colorCoin["GLMR"] case 'HecoChain': return dark_theme ? colorCoinDark["HECO"] : colorCoin["HECO"] @@ -256,7 +258,7 @@ QtObject { function getCoinColor(ticker) { let info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker) - if (!info.type) { return dark_theme ? colorCoin["default"] : colorCoinDark["default"] } + if (!info.type) { return colorWhite3 } let color = getCoinGroupTextColor(info.type) let base_ticker = atomic_qt_utilities.retrieve_main_ticker(ticker) if (colorCoin.hasOwnProperty(base_ticker) && !dark_theme) @@ -278,6 +280,7 @@ QtObject { "BCH": "#8DC351", "ETC": "#328432", "ETH": "#687DE3", + "EWT": "#A466FF", "FTM": "#13B5EC", "HECO": "#00953F", "GLMR": "#F6007C", @@ -303,6 +306,7 @@ QtObject { "BCH": "#8DC351", "ETC": "#328432", "ETH": "#687DE3", + "EWT": "#A466FF", "FTM": "#13B5EC", "HECO": "#00953F", "GLMR": "#F6007C", diff --git a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml index 8753f8abc8..46bd8e7b57 100644 --- a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml +++ b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml @@ -234,28 +234,20 @@ DexPopup function onBalanceUpdateStatus(am_i_sender, amount, ticker, human_date, timestamp) { - - if (!app.segwit_on) + if (amount != 0) { - if (amount != 0) - { - newNotification( - balanceUpdateStatusNotification, - { - am_i_sender, - amount, - ticker, - human_date, - timestamp - }, - timestamp, + newNotification( + balanceUpdateStatusNotification, + { + am_i_sender, + amount, + ticker, human_date, - "open_wallet_page") - } - } - else - { - app.segwit_on = false + timestamp + }, + timestamp, + human_date, + "open_wallet_page") } } diff --git a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml index ffd4870ac6..c05efbebfa 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/ProView.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/ProView.qml @@ -54,7 +54,7 @@ RowLayout { setMarketMode(!is_asks ? MarketMode.Sell : MarketMode.Buy) - API.app.trading_pg.preffered_order = { + let selected_order = { "coin": coin, "price": price, "price_denom": price_denom, @@ -69,6 +69,8 @@ RowLayout "uuid": uuid } + API.app.trading_pg.preffered_order = selected_order + // Shows place order form in case it has been hidden in the settings. placeOrderForm.visible = true } diff --git a/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml b/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml index ed097bdd2a..e8f5950ecd 100644 --- a/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml +++ b/atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml @@ -269,6 +269,7 @@ ClipRRect // Trade Card opacity: .6 } + // Tooltip MouseArea { anchors.left: _fromBalanceIcon.left @@ -279,7 +280,11 @@ ClipRRect // Trade Card DefaultTooltip { visible: parent.containsMouse - text: qsTr("Tradable: ") + parent.parent.text + text: + { + let balance = Constants.API.app.portfolio_pg.portfolio_mdl.coin_balance(selectedTicker); + return qsTr("Balance: ") + Constants.API.app.portfolio_pg.portfolio_mdl.coin_balance(selectedTicker) + ' (' + parent.parent.text + ' tradable)' + } } } diff --git a/atomic_defi_design/Dex/Screens/Dashboard.qml b/atomic_defi_design/Dex/Screens/Dashboard.qml index a93bcf813c..a59d814663 100644 --- a/atomic_defi_design/Dex/Screens/Dashboard.qml +++ b/atomic_defi_design/Dex/Screens/Dashboard.qml @@ -279,6 +279,7 @@ Item enabled: loader.status === Loader.Ready onLineSelected: currentPage = lineType; + onAddCryptoClicked: enable_coin_modal.open() onSettingsClicked: setting_modal.open() onSupportClicked: support_modal.open() } diff --git a/atomic_defi_design/Dex/Settings/SettingModal.qml b/atomic_defi_design/Dex/Settings/SettingModal.qml index f10b31015b..aff1141241 100644 --- a/atomic_defi_design/Dex/Settings/SettingModal.qml +++ b/atomic_defi_design/Dex/Settings/SettingModal.qml @@ -205,6 +205,7 @@ Qaterial.Dialog topPadding: 10 spacing: 15 + // Notifications toggle RowLayout { width: parent.width - 30 @@ -229,6 +230,32 @@ Qaterial.Dialog } } + // Spam filter toggle + RowLayout + { + width: parent.width - 30 + anchors.horizontalCenter: parent.horizontalCenter + height: 50 + + DexLabel + { + Layout.alignment: Qt.AlignVCenter + Layout.fillWidth: true + font: DexTypo.subtitle1 + text: qsTr("Hide Poison Transactions in History") + } + + Item { Layout.fillWidth: true } + + DexSwitch + { + Layout.alignment: Qt.AlignVCenter + Component.onCompleted: checked = API.app.settings_pg.spamfilter_enabled + onCheckedChanged: API.app.settings_pg.spamfilter_enabled = checked + } + } + + // Max Coins Dropdown RowLayout { width: parent.width - 30 diff --git a/atomic_defi_design/Dex/Sidebar/Bottom.qml b/atomic_defi_design/Dex/Sidebar/Bottom.qml index 775caf2b55..70e911b958 100644 --- a/atomic_defi_design/Dex/Sidebar/Bottom.qml +++ b/atomic_defi_design/Dex/Sidebar/Bottom.qml @@ -11,6 +11,7 @@ MouseArea { id: root + signal addCryptoClicked() signal supportClicked() signal settingsClicked() @@ -27,6 +28,7 @@ MouseArea if (isExpanded) waitForSidebarExpansionAnimation.start(); else { + addCryptoLine.label.opacity = 0; settingsLine.label.opacity = 0; supportLine.label.opacity = 0; privacyLine.label.opacity = 0; @@ -37,7 +39,7 @@ MouseArea NumberAnimation { id: waitForSidebarExpansionAnimation - targets: [settingsLine.label, supportLine.label, privacyLine.label] + targets: [addCryptoLine.label, settingsLine.label, supportLine.label, privacyLine.label] properties: "opacity" duration: 200 from: 0 @@ -48,7 +50,7 @@ MouseArea NumberAnimation { id: labelsOpacityAnimation - targets: [settingsLine.label, supportLine.label, privacyLine.label] + targets: [addCryptoLine.label, settingsLine.label, supportLine.label, privacyLine.label] properties: "opacity" duration: 350 from: 0.0 @@ -59,6 +61,15 @@ MouseArea { anchors.fill: parent FigurativeLine + { + id: addCryptoLine + + Layout.fillWidth: true + label.text: isExpanded ? qsTr("Add Crypto") : "" + icon.source: General.image_path + "bank-plus.svg" + onClicked: addCryptoClicked() + } + FigurativeLine { id: settingsLine @@ -67,7 +78,6 @@ MouseArea icon.source: General.image_path + "menu-settings-white.svg" onClicked: settingsClicked() } - FigurativeLine { id: supportLine diff --git a/atomic_defi_design/Dex/Sidebar/Main.qml b/atomic_defi_design/Dex/Sidebar/Main.qml index 3a09d8fda5..212e949395 100644 --- a/atomic_defi_design/Dex/Sidebar/Main.qml +++ b/atomic_defi_design/Dex/Sidebar/Main.qml @@ -26,6 +26,7 @@ Item signal lineSelected(var lineType) signal settingsClicked() signal supportClicked() + signal addCryptoClicked() signal privacySwitched(var checked) signal expanded(var isExpanded) signal expandStarted(var isExpanding) @@ -121,6 +122,7 @@ Item anchors.bottom: parent.bottom anchors.bottomMargin: 62 + onAddCryptoClicked: root.addCryptoClicked() onSettingsClicked: root.settingsClicked() onSupportClicked: root.supportClicked() } diff --git a/atomic_defi_design/Dex/Support/SupportModal.qml b/atomic_defi_design/Dex/Support/SupportModal.qml index 3c197c9b4f..01d756dcbc 100644 --- a/atomic_defi_design/Dex/Support/SupportModal.qml +++ b/atomic_defi_design/Dex/Support/SupportModal.qml @@ -29,7 +29,7 @@ Qaterial.Dialog topPadding: 30 bottomPadding: 30 anchors.centerIn: parent - + dim: true modal: true title: "Support" @@ -142,6 +142,19 @@ For this reason, we recommend cancelling orders before closing %1, or reviewing Network fees can vary greatly depending on your selected trading pair.").arg(API.app_name) } + // TODO: Update link to the KP blog when relevent article available. + FAQLine + { + title: qsTr("I see a transaction in my wallet that was marked as 'poison'. What does this mean?") + text: qsTr('Address poisoning is a relatively new tye of phishing attack, where a malicious actor aims to trick you into sending funds to an address that you did not intend to send funds to. + +This is often done by sending a zero value transaction to your wallet from an address which looks very similar to your actual address, with the exact same letters at the start and end. This transaction will then appear in your transaction history, with the scammer hoping you will mistake the fake address for your own and send funds to it. + +To protect you from this, %1 will mark any transaction that it detects as potentially being a poison transaction with a "poison" label. You should always be careful to confirm any address you send funds to is correct. + +There is a toggle in settings where you can turn on/off the display of these transactions.').arg(API.app_name) + } + FAQLine { title: qsTr("Do you provide user support?") @@ -195,7 +208,7 @@ Network fees can vary greatly depending on your selected trading pair.").arg(API Layout.preferredHeight: column_layout.height hoverEnabled: true - onClicked: update_modal.open() + onClicked: Qt.openUrlExternally("https://github.com/KomodoPlatform/atomicDEX-Desktop/pull/2296") ColumnLayout { diff --git a/atomic_defi_design/Dex/Wallet/ClaimFaucetResultModal.qml b/atomic_defi_design/Dex/Wallet/ClaimFaucetResultModal.qml index 7e74f78fd2..203658f13b 100644 --- a/atomic_defi_design/Dex/Wallet/ClaimFaucetResultModal.qml +++ b/atomic_defi_design/Dex/Wallet/ClaimFaucetResultModal.qml @@ -24,5 +24,15 @@ MultipageModal { text_value: claiming_faucet_rpc_result && claiming_faucet_rpc_result.message ? claiming_faucet_rpc_result.message : "" } + + CancelButton + { + Layout.preferredWidth: 300 + text: qsTr("Close") + Layout.topMargin: 20 + Layout.alignment: Qt.AlignCenter + radius: 18 + onClicked: close() + } } } diff --git a/atomic_defi_design/Dex/Wallet/Main.qml b/atomic_defi_design/Dex/Wallet/Main.qml index 101c341420..7ecf682d91 100644 --- a/atomic_defi_design/Dex/Wallet/Main.qml +++ b/atomic_defi_design/Dex/Wallet/Main.qml @@ -42,6 +42,7 @@ Item Layout.fillHeight: true Layout.fillWidth: true + // TODO: Move this section for the coin summary bar at the top to its own component ColumnLayout { id: wallet_layout @@ -166,77 +167,6 @@ Item Item { Layout.fillWidth: true } - ColumnLayout - { - visible: false //current_ticker_infos.segwit_supported - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - spacing: 2 - - DefaultText - { - text_value: qsTr("Segwit") - Layout.alignment: Qt.AlignLeft - font.pixelSize: headerTitleFont - color: headerTitleColor - } - - DefaultSwitch - { - id: segwitSwitch - Layout.alignment: Qt.AlignVCenter - - onToggled: - { - if(parseFloat(current_ticker_infos.balance) > 0) { - Qaterial.DialogManager.showDialog({ - title: qsTr("Confirmation"), - text: qsTr("Do you want to send your %1 funds to %2 wallet first?").arg(current_ticker_infos.is_segwit_on ? "segwit" : "legacy").arg(!current_ticker_infos.is_segwit_on ? "segwit" : "legacy"), - standardButtons: Dialog.Yes | Dialog.No, - onAccepted: function() { - var address = API.app.wallet_pg.switch_address_mode(!current_ticker_infos.is_segwit_on); - if (address != current_ticker_infos.address && address != "") { - send_modal.open() - send_modal.item.address_field.text = address - send_modal.item.max_mount.checked = true - send_modal.item.segwit = true - send_modal.item.segwit_callback = function () { - if(send_modal.item.segwit_success) { - API.app.wallet_pg.post_switch_address_mode(!current_ticker_infos.is_segwit_on) - Qaterial.DialogManager.showDialog({ - title: qsTr("Success"), - text: qsTr("Your transaction is send, may take some time to arrive") - }) - } else { - segwitSwitch.checked = current_ticker_infos.is_segwit_on - } - } - } - }, - - onRejected: function () { - app.segwit_on = true - API.app.wallet_pg.post_switch_address_mode(!current_ticker_infos.is_segwit_on) - } - }) - - } else { - app.segwit_on = true - API.app.wallet_pg.post_switch_address_mode(!current_ticker_infos.is_segwit_on) - } - } - } - } - - Connections - { - target: API.app.wallet_pg - function onTickerInfosChanged() { - if (segwitSwitch.checked != current_ticker_infos.is_segwit_on) { - segwitSwitch.checked = current_ticker_infos.is_segwit_on - } - } - } - // Price ColumnLayout { @@ -665,7 +595,7 @@ Item { Layout.preferredWidth: 180 Layout.preferredHeight: 48 - visible: current_ticker_infos.is_smartchain_test_coin + visible: current_ticker_infos.is_faucet_coin DefaultButton { @@ -970,13 +900,15 @@ Item GradientStop { position: 1; color: Dex.CurrentTheme.backgroundColor } } } - + + // Transactions history table Transactions { width: parent.width height: parent.height } + // Placeholder if no tx history available, or being fetched. ColumnLayout { visible: current_ticker_infos.tx_state !== "InProgress" && transactions_mdl.length === 0 @@ -1011,6 +943,7 @@ Item visible: api_wallet_page.tx_fetching_busy } + // When no tx history available, or being fetched, show a button to open the explorer. DefaultText { id: explorerLink diff --git a/atomic_defi_design/Dex/Wallet/SendModal.qml b/atomic_defi_design/Dex/Wallet/SendModal.qml index 3ae2949107..e21a31f106 100644 --- a/atomic_defi_design/Dex/Wallet/SendModal.qml +++ b/atomic_defi_design/Dex/Wallet/SendModal.qml @@ -18,14 +18,13 @@ MultipageModal property bool needFix: false property bool errorView: false - property bool segwit: false - property bool segwit_success: false - property var segwit_callback property var address_data readonly property var default_send_result: ({ has_error: false, error_message: "", withdraw_answer: { - total_amount_fiat: "", tx_hex: "", date: "", "fee_details": { total_fee: "" } + total_amount_fiat: "", tx_hex: "", + memo: "", date: "", + "fee_details": { total_fee: "" } }, explorer_url: "", max: false }) property var send_result: default_send_result @@ -48,9 +47,8 @@ MultipageModal function getCryptoAmount() { return _preparePage.cryptoSendMode ? input_amount.text : equivalentAmount.value } - function prepareSendCoin(address, amount, with_fees, fees_amount, is_special_token, gas_limit, gas_price) { + function prepareSendCoin(address, amount, with_fees, fees_amount, is_special_token, gas_limit, gas_price, memo="") { let max = parseFloat(current_ticker_infos.balance) === parseFloat(amount) - // Save for later check async_param_max = max @@ -62,7 +60,7 @@ MultipageModal gas_price, gas_limit: gas_limit === "" ? 0 : parseInt(gas_limit) } - api_wallet_page.send(address, amount, max, with_fees, fees_info) + api_wallet_page.send(address, amount, max, with_fees, fees_info, memo) } function sendCoin() { @@ -82,6 +80,7 @@ MultipageModal send_result = default_send_result input_address.text = "" input_amount.text = "" + input_memo.text = "" input_custom_fees.text = "" input_custom_fees_gas.text = "" input_custom_fees_gas_price.text = "" @@ -154,11 +153,6 @@ MultipageModal onClosed: { - if (segwit) - { - segwit_callback() - } - segwit = false reset() } @@ -260,7 +254,7 @@ MultipageModal DefaultRectangle { - enabled: !root.segwit && !root.is_send_busy + enabled: !root.is_send_busy Layout.preferredWidth: 500 Layout.preferredHeight: 44 @@ -560,6 +554,31 @@ MultipageModal } } + // Memo + DefaultRectangle + { + visible: General.isCoinWithMemo(api_wallet_page.ticker) + enabled: !root.is_send_busy + + Layout.preferredWidth: 500 + Layout.preferredHeight: 44 + Layout.alignment: Qt.AlignHCenter + + color: input_memo.background.color + radius: input_memo.background.radius + + DefaultTextField + { + id: input_memo + + width: 470 + height: 44 + placeholderText: qsTr("Enter memo") + forceFocus: true + font: General.isZhtlc(api_wallet_page.ticker) ? DexTypo.body3 : DexTypo.body2 + } + } + ColumnLayout { visible: General.getCustomFeeType(current_ticker_infos) @@ -758,8 +777,16 @@ MultipageModal text: qsTr("Prepare") - onClicked: prepareSendCoin(input_address.text, getCryptoAmount(), custom_fees_switch.checked, input_custom_fees.text, - General.isSpecialToken(current_ticker_infos), input_custom_fees_gas.text, input_custom_fees_gas_price.text) + onClicked: prepareSendCoin( + input_address.text, + getCryptoAmount(), + custom_fees_switch.checked, + input_custom_fees.text, + General.isSpecialToken(current_ticker_infos), + input_custom_fees_gas.text, + input_custom_fees_gas_price.text, + input_memo.text + ) } } @@ -830,6 +857,14 @@ MultipageModal } } + // Memo + TextEditWithTitle + { + title: qsTr("Memo") + visible: input_memo.text != "" + text: input_memo.text + } + // Fees TextEditWithTitle { @@ -906,7 +941,6 @@ MultipageModal function onClose() { - if (root.segwit) root.segwit_success = true root.close() } } diff --git a/atomic_defi_design/Dex/Wallet/SendResult.qml b/atomic_defi_design/Dex/Wallet/SendResult.qml index deb97babdc..8ac93c37a5 100644 --- a/atomic_defi_design/Dex/Wallet/SendResult.qml +++ b/atomic_defi_design/Dex/Wallet/SendResult.qml @@ -76,6 +76,18 @@ MultipageModalContent } } + // Memo + TextEditWithTitle + { + title: qsTr("Memo") + visible: result.withdraw_answer.memo + + text: + { + result.withdraw_answer.memo + } + } + // Fees TextEditWithTitle { diff --git a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml index c05e7463ef..ab69b7cba4 100644 --- a/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml +++ b/atomic_defi_design/Dex/Wallet/TransactionDetailsModal.qml @@ -18,6 +18,7 @@ MultipageModal function reset() { } property var details + property bool is_spam: !details ? false : details.amount == 0 onClosed: { @@ -29,6 +30,30 @@ MultipageModal { titleText: qsTr("Transaction Details") + // Warning for spam/poison transactions + DefaultText + { + id: warning_text + visible: is_spam + Layout.alignment: Qt.AlignVCenter + Layout.fillWidth: true + wrapMode: Label.Wrap + color: Style.colorOrange + text_value: qsTr("This transaction has been identified as a potential address poisoning attack.") + } + + // Warning for spam/poison transactions + DefaultText + { + id: warning_text2 + visible: is_spam + Layout.alignment: Qt.AlignVCenter + Layout.fillWidth: true + wrapMode: Label.Wrap + color: Style.colorOrange + text_value: qsTr("Please see the Support FAQ for more information.") + } + // Transaction Hash TitleText { @@ -46,7 +71,7 @@ MultipageModal text_box_width: 600 text_value: !details ? "" : details.tx_hash linkURL: !details ? "" :General.getTxExplorerURL(api_wallet_page.ticker, details.tx_hash, false) - onCopyNotificationTitle: qsTr("%1 txid", "TICKER").arg(api_wallet_page.ticker) + onCopyNotificationTitle: qsTr("%1 txid", "TICKER").arg(api_wallet_page.ticker) onCopyNotificationMsg: qsTr("copied to clipboard.") privacy: true } @@ -78,7 +103,7 @@ MultipageModal model: !details ? [] : details.from linkURL: !details ? "" :General.getAddressExplorerURL(api_wallet_page.ticker, details.from) - onCopyNotificationTitle: qsTr("From address") + onCopyNotificationTitle: is_spam ? "" : qsTr("From address") } AddressList @@ -92,7 +117,7 @@ MultipageModal : details.to.length > 1 ? General.getAddressExplorerURL(api_wallet_page.ticker, General.arrayExclude(details.to, details.from[0])) : General.getAddressExplorerURL(api_wallet_page.ticker, details.to) - onCopyNotificationTitle: qsTr("To address") + onCopyNotificationTitle: is_spam ? "" : qsTr("To address") } // Date diff --git a/atomic_defi_design/Dex/Wallet/Transactions.qml b/atomic_defi_design/Dex/Wallet/Transactions.qml index 67608f5bdb..c86c58ef11 100644 --- a/atomic_defi_design/Dex/Wallet/Transactions.qml +++ b/atomic_defi_design/Dex/Wallet/Transactions.qml @@ -22,10 +22,11 @@ Dex.ListView model: transactions_mdl.proxy_mdl - // Row + // Transaction Row delegate: Dex.Rectangle { id: rectangle + property bool is_spam: amount == 0 width: list.width height: row_height radius: 0 @@ -64,13 +65,13 @@ Dex.ListView visible: transaction_note !== "" } - + // When a spam / poison tx, we show a warning icon Qaterial.Icon { id: received_icon size: 16 - icon: am_i_sender ? Qaterial.Icons.arrowTopRight : Qaterial.Icons.arrowBottomRight - color: am_i_sender ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor + icon: is_spam ? Qaterial.Icons.radioactive : am_i_sender ? Qaterial.Icons.arrowTopRight : Qaterial.Icons.arrowBottomRight + color: is_spam ? Style.colorOrange : am_i_sender ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor } // Description @@ -78,8 +79,9 @@ Dex.ListView { id: description horizontalAlignment: Qt.AlignLeft - text_value: am_i_sender ? qsTr("Sent") : qsTr("Received") + text_value: is_spam ? qsTr("Poison") : am_i_sender ? qsTr("Sent") : qsTr("Received") font.pixelSize: Style.textSizeSmall3 + color: is_spam ? Style.colorOrange : am_i_sender ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor } } @@ -97,7 +99,7 @@ Dex.ListView } font.pixelSize: description.font.pixelSize - color: am_i_sender ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor + color: is_spam ? Style.colorWhite7 : am_i_sender ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor privacy: true } @@ -108,8 +110,9 @@ Dex.ListView horizontalAlignment: Text.AlignRight text_value: General.formatFiat(!am_i_sender, amount_fiat, API.app.settings_pg.current_currency) font.pixelSize: description.font.pixelSize - color: crypto_amount.color + color: is_spam ? Style.colorWhite7 : crypto_amount.color privacy: true + } // Fee @@ -121,6 +124,7 @@ Dex.ListView current_ticker_infos.fee_ticker + " " + qsTr("fees")) font.pixelSize: description.font.pixelSize privacy: true + color: is_spam ? Style.colorWhite7 : crypto_amount.color } // Date @@ -131,6 +135,7 @@ Dex.ListView font.pixelSize: description.font.pixelSize text_value: !date || unconfirmed ? qsTr("Unconfirmed") : date privacy: true + color: is_spam ? Style.colorWhite7 : crypto_amount.color } } } diff --git a/atomic_defi_design/assets/images/bank-plus.svg b/atomic_defi_design/assets/images/bank-plus.svg new file mode 100644 index 0000000000..a7f8e8dbbf --- /dev/null +++ b/atomic_defi_design/assets/images/bank-plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/atomic_defi_design/assets/languages/atomic_defi_de.ts b/atomic_defi_design/assets/languages/atomic_defi_de.ts index 9c2a9587b7..a4493b0f88 100644 --- a/atomic_defi_design/assets/languages/atomic_defi_de.ts +++ b/atomic_defi_design/assets/languages/atomic_defi_de.ts @@ -233,7 +233,7 @@ App - + Recover Funds Result Ergebnis der Rückerstattung der Geldmittel @@ -315,68 +315,73 @@ Bottom - + + Add Crypto + + + + Settings Einstellungen - + Support Support - + Privacy Datenschutz - + Disable Privacy? Datenschutz deaktivieren? - + Enter wallet password to confirm Geben Sie zur Bestätigung das Kennwort der Brieftasche ein - + Type password Kennwort eingeben - + Confirm Bestätigen - + Cancel Abbrechen - + Privacy status Status Datenschutz - + Privacy mode disabled successfully Der Datenschutzmodus wurde erfolgreich deaktiviert - - + + Ok Ok - + Wrong password! Falsches Kennwort! - + wallet password is incorrect Kennwort der Brieftasche ist falsch @@ -495,8 +500,8 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 - Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> - Mit dem Symbol ⓘ gekennzeichnete Marktdaten (Kurse, Charts etc.) stammen aus Drittquellen.<br><br>Die Daten stammen von <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> und <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle unterstützte Paare:</b><br>%1<br><br><b>Letzte Referenz (Band Oracle):</b><br><a href="%2">%2</a> + Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. + Mit dem Symbol ⓘ gekennzeichnete Marktdaten (Kurse, Charts etc.) stammen aus Drittquellen.<br><br>Die Daten stammen von <a href="https://coingecko.com">CoinGecko</a>. @@ -517,6 +522,14 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 + + ClaimFaucetResultModal + + + Close + Schließen + + ClaimRewardsModal @@ -835,177 +848,177 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456Die aktuelle Anzahl aktivierter Coins stimmt nicht mit Ihrer Konfigurationsvorgabe überein. Die Konfiguration der Assets wird zurückgesetzt. - + Matching Zusammenführung - + Order Matching Order wird zusammengeführt - + Matched Zusammengeführt - + Order Matched Order wurde zusammengeführt - + Ongoing Laufend - + Swap Ongoing Austausch läuft - + Successful Erfolgreich - + Swap Successful Tausch erfolgreich - + Refunding Rückzahlung - + Failed Fehlgeschlagen - + Swap Failed Tausch fehlgeschlagen - + Unknown Unbekannt - + Unknown State Unbekannter Status - + Started Gestartet - + Negotiated Ausgehandelt - + Taker fee sent Taker-Gebühr gesendet - + Maker payment received Maker-Zahlung erhalten - + Maker payment wait confirm started Warten auf die Zahlungsbestätigung des Makers gestartet - + Maker payment validated and confirmed Maker-Zahlung validiert und bestätigt - + Taker payment sent Taker-Zahlung gesendet - + Taker payment spent Taker-Zahlung ausgegeben - + Maker payment spent Maker-Zahlung ausgegeben - + Finished Fertig - + Start failed Start fehlgeschlagen - + Negotiate failed Verhandeln fehlgeschlagen - + Taker fee validate failed Validierung der Abnehmergebühr fehlgeschlagen - + Maker payment transaction failed Maker-Zahlungstransaktion fehlgeschlagen - + Maker payment Data send failed Fehler beim Senden der Maker-Zahlungsdaten - + Maker payment wait confirm failed Warten auf die Zahlungsbestätigung des Makers fehlgeschlagen - + Taker payment validate failed Validierung der Taker-Zahlung fehlgeschlagen - + Taker payment wait confirm failed Warten auf die Zahlungsbestätigung des Takers fehlgeschlagen - + Taker payment spend failed Zahlungsausgabe des Takers fehlgeschlagen - + Maker payment wait refund started Countdown für die Rückerstattung der Maker-Zahlung hat begonnen - + Maker payment refunded Maker-Zahlung zurückerstattet - + Maker payment refund failed Rückerstattung der Maker-Zahlung fehlgeschlagen @@ -1390,7 +1403,7 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 General - + %n day(s) %n Tag @@ -1398,7 +1411,7 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 - + %nd day @@ -1407,7 +1420,7 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 - + %nh hours @@ -1416,7 +1429,7 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 - + %nm minutes @@ -1425,7 +1438,7 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 - + %ns seconds @@ -1434,7 +1447,7 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 - + %nms milliseconds @@ -1443,117 +1456,117 @@ Beispiel: Kennwort = 1234 Suffix=56 Eingabe beim Login=123456 - + - - - + <b>Taker tx fee:</b> <b>Taker tx Gebühren:</b> - + <b>Dex tx fee:</b> <b>Dex tx Gebühren:</b> - + <b>Dex fee:</b> <b>Dex Gebühren:</b> - + <b>Maker tx fee:</b> <b>Maker tx Gebühren:</b> - + %1 balance is zero - + Activating %1 (%2%) - + Loading wallet... - + Min: %1 Minimum: %1 - + Enter an amount Betrag eingeben - + Trading Fee Handelsgebühr - + Minimum Trading Amount Mindesthandelsbetrag - + Wallet %1 already exists WALLETNAME Brieftasche %1 existiert bereits - + %1 balance is lower than the fees amount: %2 %3 Das %1 Guthaben ist niedriger als der Gebührenbetrag: %2 %3 - + Tradable (after fees) %1 balance is lower than minimum trade amount Handelbares %1 Guthaben (nach Gebühren) ist niedriger als der Mindesthandelsbetrag - + Please fill the price field Bitte füllen Sie das Preisfeld aus - + Please fill the volume field - - + + Please wait for %1 to fully activate - - + + %1 volume is lower than minimum trade amount %1 Volumen ist niedriger als der minimale Handelsbetrag - - + + %1 needs to be enabled in order to use %2 %1 muss aktiviert werden, um %2 verwenden zu können - - + + %1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions Das %1 Guthaben muss finanziert werden, ein Guthaben größer Null ist erforderlich, um das Benzin von %2 Transaktionen zu bezahlen - + Unknown Error Unbekannter Fehler @@ -1852,140 +1865,115 @@ They will be removed from the orderbook until you log in again. Main - - Segwit - Segwit - - - - Confirmation - Bestätigung - - - - Do you want to send your %1 funds to %2 wallet first? - Möchten Sie Ihr %1-Guthaben zuerst an die %2-Brieftasche senden? - - - - Success - Erfolg - - - - Your transaction is send, may take some time to arrive - Ihre Transaktion wird gesendet, es kann einige Zeit dauern, bis sie ankommt - - - + Price Preis - + Change 24hr 24h Veränderung - + Contract Address Vertragsadresse - + Send Senden - + Enable %1 ? %1 aktivieren? - + Yes Ja - + No Nein - + Receive Empfangen - + Swap Tausch - + Portfolio Portfolio - + is wallet only nur Brieftasche (kein DEX möglich) - + Rewards Belohnungen - + Faucet Faucet - - - + + + Public Key Öffentlicher Schlüssel - + Copied to Clipboard In die Zwischenablage kopiert - + Loading market data Laden von Marktdaten - + There is no chart data for this ticker yet Für diesen Ticker liegen noch keine Chartdaten vor - + Fetching transactions... Transaktionen werden abgerufen... - + Please wait, %1 is %2 - + % activated... - + No transactions available Keine Transaktionen verfügbar - + Click to view your address on %1 (%2) block explorer Klicken Sie hier, um Ihre Adresse im %1 (%2) Block-Explorer anzuzeigen @@ -2442,6 +2430,11 @@ They will be removed from the orderbook until you log in again. Your wallet balance changed Ihr Guthaben hat sich geändert + + + Close + Schließen + %1 Enable status @@ -2461,49 +2454,49 @@ They will be removed from the orderbook until you log in again. - + Failed to disable %1 TICKER - + Endpoint not reachable Endpunkt nicht erreichbar - + Could not reach to endpoint Endpunkt konnte nicht erreicht werden - + Show Zeigen - + Restart Neustart - + Quit Beenden - + Notifications Benachrichtigungen - + There aren't any notifications Es gibt keine Benachrichtigungen - + Mark all as read Alle als gelesen makieren @@ -2954,12 +2947,12 @@ Bitte wählen Sie eine neue Order aus. ProView - + Failed to place the order Die Order konnte nicht platziert werden - + Placed the order Order platziert @@ -3144,162 +3137,172 @@ Bitte wählen Sie eine neue Order aus. SendModal - + Failed to send Fehler beim Senden - + Prepare to send Versandvorbereitung von - + Address of the recipient Adresse des Empfängers - + Amount to send Zu sendender Betrag - + Gas price Gas Preis - + Cancel Abbrechen - + Recipient's address Empfängeradresse - + The address has to be mixed case. Die Adresse muss Groß-/Kleinschreibung sein. - + Failed to Broadcast - + Fix Korrigieren - + MAX MAX - + Fiat amount: Unavailable Fiat-Betrag: Nicht verfügbar - + Fiat amount: %1 Fiat-Betrag: %1 - + %1 amount: %2 %1 Betrag: %2 - + Specify in Fiat In Fiat angeben - + Specify in Crypto In Krypto angeben - + + Enter memo + + + + Enable Custom Fees Benutzerdefinierte Gebühren - + Enter the custom fee Geben Sie die benutzerdefinierte Gebühr ein - + Gas Limit Gas Limit - + Custom Fee can't be higher than the amount Die benutzerdefinierten Gebühren dürfen nicht höher sein als der Betrag - + Not enough funds. Nicht genug Geldmittel. - - + + You have %1 AMT TICKER Sie haben %1 - - + + Only use custom fees if you know what you are doing! - + Prepare Vorbereiten - - + + Send Senden - + %1 address TICKER - + copied to clipboard. In die Zwischenablage kopiert - + Amount Menge - + + Memo + + + + Fees Gebühren - + Date Datum - + Back Zurück @@ -3385,11 +3388,16 @@ Bitte wählen Sie eine neue Order aus. + Memo + + + + Fees Gebühren - + Date Datum @@ -3399,12 +3407,12 @@ Bitte wählen Sie eine neue Order aus. Transaktions-Hash - + Close Schließen - + View on Explorer Ansicht im Explorer @@ -3412,8 +3420,8 @@ Bitte wählen Sie eine neue Order aus. SettingModal - - + + Cancel Abbrechen @@ -3443,98 +3451,103 @@ Bitte wählen Sie eine neue Order aus. Sicherheit - + Enable Desktop Notifications Desktop-Benachrichtigungen aktivieren - + + Hide Poison Transactions in History + + + + Maximum number of enabled coins Maximale Anzahl aktivierter Coins - + Logs Protokolle - + Open Folder Ordner öffnen - + Reset Zurücksetzen - + Current Font Aktuelle Schriftart - + Current font changed to %1. Aktuelle Schriftart in %1 geändert. - + Theme Thema - + Changing theme to %1 Design zu %1 geändert - + Disable 2FA? 2FA deaktivieren? - + Enter your wallet password to confirm Geben Sie zur Bestätigung das Kennwort ihrer Brieftasche ein - + Type password Kennwort eingeben - + 2FA status 2FA Status - + 2FA disabled successfully 2FA erfolgreich deaktiviert - - + + Ok Ok - + Wrong password! Falsches Kennwort! - + Wallet password is incorrect Kennwort der Brieftasche ist falsch - + Application Version Anwendungsversion - + copied to clipboard In die Zwischenablage kopiert @@ -3544,95 +3557,95 @@ Bitte wählen Sie eine neue Order aus. Über & Version - - + + Reset wallet configuration Konfiguration der Brieftasche zurücksetzen - + This will restart your wallet with default settings Dadurch wird Ihre Brieftasche mit den Standardeinstellungen neu gestartet - - + + Confirm Bestätigen - + Ask system's password before sending coins ? (2FA) Vor dem Senden von Coins nach dem Kennwort des Systems fragen? (2FA) - + View seed and private keys Seed- und privaten Schlüsseln anzeigen - - + + Show Zeigen - + Setup Camouflage Password Tarnkennwort einrichten - + Open Öffnen - + Disclaimer and ToS Haftungsausschluss und Nutzungsbedingungen - + Application version Anwendungsversion - + MM2 version MM2 Version - + MM2 Version MM2 Version - + MM2 Version copied to clipboard. MM2 Version in die Zwischenablage kopiert. - + Qt version Qt Version - + Qt Version Qt Version - + Qt Version copied to clipboard. Qt Version in die Zwischenablage kopiert. - + Search Update Update suchen - + Logout Abmelden @@ -3928,62 +3941,78 @@ Network fees can vary greatly depending on your selected trading pair. Die Netzwerkgebühren können je nach ausgewähltem Handelspaar stark variieren. - + + I see a transaction in my wallet that was marked as 'poison'. What does this mean? + + + + + Address poisoning is a relatively new tye of phishing attack, where a malicious actor aims to trick you into sending funds to an address that you did not intend to send funds to. + +This is often done by sending a zero value transaction to your wallet from an address which looks very similar to your actual address, with the exact same letters at the start and end. This transaction will then appear in your transaction history, with the scammer hoping you will mistake the fake address for your own and send funds to it. + +To protect you from this, %1 will mark any transaction that it detects as potentially being a poison transaction with a "poison" label. You should always be careful to confirm any address you send funds to is correct. + +There is a toggle in settings where you can turn on/off the display of these transactions. + + + + Do you provide user support? Bieten Sie Benutzerunterstützung an? - + Yes! %1 offers support through the <a href="%2">%1 Discord server</a>. The team and the community are always happy to help! Ja! %1 bietet Support über den <a href="%2">%1 Discord server</a>. Das Team und die Community helfen Euch gerne weiter! - + Who is behind %1? Wer steckt hinter %1? - + %1 is developed by the Komodo team. Komodo is one of the most established blockchain projects working on innovative solutions like atomic swaps, Delayed Proof of Work, and an interoperable multi-chain architecture. %1 wird vom Komodo-Team entwickelt. Komodo ist eines der etabliertesten Blockchain-Projekte, das an innovativen Lösungen wie Atomic Swaps, Delayed Proof of Work und einer interoperablen Multi-Chain-Architektur arbeitet. - + Is it possible to develop my own white-label exchange on %1? Ist es möglich, meine eigene White-Label-Börse auf %1 zu entwickeln? - + Absolutely! You can read our developer documentation for more details or contact us with your partnership inquiries. Have a specific technical question? The %1 developer community is always ready to help! Auf jeden Fall! Sie können unsere Entwicklerdokumentation für weitere Details lesen oder uns mit Ihren Partnerschaftsanfragen kontaktieren. Haben Sie eine spezielle technische Frage? Die %1-Entwicklercommunity ist immer bereit zu helfen! - + Which devices can I use %1 on? Auf welchen Geräten kann ich %1 verwenden? - + %1 is available for mobile on both <a href="%2">Android and iPhone, and for desktop on Windows, Mac, and Linux</a> operating systems. %1 ist auf Mobilgeräte für <a href="%2">Android und iPhone sowie auf dem Desktop für Windows, Mac und Linux</a> Betriebssystemen erhältlich. - + Compliance Info Compliance-Informationen - + Due to regulatory and legal circumstances the citizens of certain jurisdictions including, but not limited to, the United States of America, Canada, Hong Kong, Israel, Singapore, Sudan, Austria, Iran and any other state, country or other jurisdiction that is embargoed by the United States of America or the European Union are not allowed to use this application. Aufgrund regulatorischer und rechtlicher Umstände sind die Bürger bestimmter Gerichtsbarkeiten, einschließlich, aber nicht beschränkt auf, der Vereinigten Staaten von Amerika, Kanada, Hongkong, Israel, Singapur, Sudan, Österreich, Iran und alle anderen Staaten, Länder oder anderen Gerichtsbarkeiten, die mit einem Embargo von den Vereinigten Staaten von Amerika oder der Europäischen Union belegt sind, dürfen diese Anwendung nicht verwenden. - + Changelog Änderungsprotokoll - + Open Logs Folder Protokollordner öffnen @@ -4094,32 +4123,32 @@ Die Netzwerkgebühren können je nach ausgewähltem Handelspaar stark variieren. Von - + Entered amount must be higher than 0. - + Select an order. - + MAX MAX - + To Nach - + Pick an order Order auswählen - + Price Preis @@ -4139,52 +4168,52 @@ Die Netzwerkgebühren können je nach ausgewähltem Handelspaar stark variieren. %1 - - Tradable: - Handelbar: + + Balance: + - + Pick a coin Wählen Sie einen Coin - + SWAP NOW JETZT TAUSCHEN - + Failed to place the order Die Order konnte nicht platziert werden - + Placed the order Order platziert - + No buy orders found for %1. Keine Kauforder für %1 gefunden. - + You can check later or try to sell a different coin. Sie können später nachsehen oder versuchen, einen anderen Coin zu verkaufen. - + Calculating fee estimate... Geschätzten Gebühren werden berechnet... - + Total %1 fees: %1 Gesamtgebühren: - + %2 (%3) %2 (%3) @@ -4243,88 +4272,98 @@ Die Netzwerkgebühren können je nach ausgewähltem Handelspaar stark variieren. TransactionDetailsModal - + Transaction Details Transaktionsdetails - + Amount Menge - + Fees Gebühren - + Date Datum - + Unconfirmed Unbestätigt - + Transaction Hash Transaktions-Hash - + Confirmations Bestätigungen - + Block Height Blockhöhe - + From Von - + + This transaction has been identified as a potential address poisoning attack. + + + + + Please see the Support FAQ for more information. + + + + %1 txid TICKER - + copied to clipboard. In die Zwischenablage kopiert - + From address Von Adresse - + To Nach - + To address Nach Adresse - + Notes Anmerkungen - + Close Schließen - + View on Explorer Ansicht im Explorer @@ -4332,22 +4371,27 @@ Die Netzwerkgebühren können je nach ausgewähltem Handelspaar stark variieren. Transactions - + Sent Gesendet - + Received Erhalten - + + Poison + + + + fees Gebühren - + Unconfirmed Unbestätigt @@ -4481,7 +4525,7 @@ This might take a few minutes... atomic_dex::settings_page - + An error has occurred. @@ -4504,47 +4548,47 @@ This might take a few minutes... Sie benötigen %1, um das Benzin für %2 Transaktionen zu bezahlen. - + Checksum verification failed for %1. Überprüfung der Prüfsumme für %1 fehlgeschlagen. - + Invalid checksum for %1. Click the button to convert to mixed case address. Ungültige Prüfsumme für %1. Klicken Sie auf die Schaltfläche, um die Adresse in Groß-/Kleinschreibung umzuwandeln. - + Legacy address used for %1. Click the button to convert to a Cashaddress. Legacy-Adresse für %1 verwendet. Klicken Sie auf die Schaltfläche, um sie in eine Cashadresse umzuwandeln. - + %1 address must be prefixed with 0x %1 Adresse muss 0x vorangestellt werden - + %1 address length is invalid, please use a valid address. Länge der %1 Adresse ist ungültig, bitte verwenden Sie eine gültige Adresse. - + %1 address is invalid. %1 Adresse ist ungültig. - + Invalid checksum. Ungültige Prüfsumme. - + %1 address has invalid prefixes. %1 Adresse hat ungültige Vorsilben. - + Backend error: %1 Backend Fehler: %1 diff --git a/atomic_defi_design/assets/languages/atomic_defi_en.ts b/atomic_defi_design/assets/languages/atomic_defi_en.ts index 2db436f1bd..6899dad1c9 100644 --- a/atomic_defi_design/assets/languages/atomic_defi_en.ts +++ b/atomic_defi_design/assets/languages/atomic_defi_en.ts @@ -233,7 +233,7 @@ App - + Recover Funds Result @@ -315,68 +315,73 @@ Bottom - + + Add Crypto + + + + Settings - + Support - + Privacy - + Disable Privacy? - + Enter wallet password to confirm - + Type password - + Confirm - + Cancel Cancel - + Privacy status - + Privacy mode disabled successfully - - + + Ok - + Wrong password! - + wallet password is incorrect @@ -494,7 +499,7 @@ - Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> + Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. @@ -516,6 +521,14 @@ + + ClaimFaucetResultModal + + + Close + + + ClaimRewardsModal @@ -834,177 +847,177 @@ - + Matching - + Order Matching - + Matched - + Order Matched - + Ongoing - + Swap Ongoing - + Successful - + Swap Successful - + Refunding - + Failed - + Swap Failed - + Unknown - + Unknown State - + Started - + Negotiated - + Taker fee sent - + Maker payment received - + Maker payment wait confirm started - + Maker payment validated and confirmed - + Taker payment sent - + Taker payment spent - + Maker payment spent - + Finished - + Start failed - + Negotiate failed - + Taker fee validate failed - + Maker payment transaction failed - + Maker payment Data send failed - + Maker payment wait confirm failed - + Taker payment validate failed - + Taker payment wait confirm failed - + Taker payment spend failed - + Maker payment wait refund started - + Maker payment refunded - + Maker payment refund failed @@ -1389,7 +1402,7 @@ General - + %n day(s) @@ -1397,7 +1410,7 @@ - + %nd day @@ -1406,7 +1419,7 @@ - + %nh hours @@ -1415,7 +1428,7 @@ - + %nm minutes @@ -1424,7 +1437,7 @@ - + %ns seconds @@ -1433,7 +1446,7 @@ - + %nms milliseconds @@ -1442,117 +1455,117 @@ - + - - + <b>Taker tx fee:</b> - + <b>Dex tx fee:</b> - + <b>Dex fee:</b> - + <b>Maker tx fee:</b> - + %1 balance is zero - + Activating %1 (%2%) - + Loading wallet... - + Min: %1 - + Enter an amount - + Trading Fee - + Minimum Trading Amount - + Wallet %1 already exists WALLETNAME - + %1 balance is lower than the fees amount: %2 %3 - + Tradable (after fees) %1 balance is lower than minimum trade amount - + Please fill the price field - + Please fill the volume field - - + + Please wait for %1 to fully activate - - + + %1 volume is lower than minimum trade amount - - + + %1 needs to be enabled in order to use %2 - - + + %1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions - + Unknown Error @@ -1851,140 +1864,115 @@ They will be removed from the orderbook until you log in again. Main - - Segwit - - - - - Confirmation - - - - - Do you want to send your %1 funds to %2 wallet first? - - - - - Success - - - - - Your transaction is send, may take some time to arrive - - - - + Price - + Change 24hr - + Contract Address - + Send - + Enable %1 ? - + Yes Yes - + No - + Receive - + Swap - + Portfolio - + is wallet only - + Rewards - + Faucet - - - + + + Public Key - + Copied to Clipboard - + Loading market data - + There is no chart data for this ticker yet - + Fetching transactions... - + Please wait, %1 is %2 - + % activated... - + No transactions available - + Click to view your address on %1 (%2) block explorer @@ -2441,6 +2429,11 @@ They will be removed from the orderbook until you log in again. Your wallet balance changed + + + Close + + %1 Enable status @@ -2460,49 +2453,49 @@ They will be removed from the orderbook until you log in again. - + Failed to disable %1 TICKER - + Endpoint not reachable - + Could not reach to endpoint - + Show - + Restart - + Quit - + Notifications - + There aren't any notifications - + Mark all as read @@ -2952,12 +2945,12 @@ Please select a new order. ProView - + Failed to place the order - + Placed the order @@ -3142,162 +3135,172 @@ Please select a new order. SendModal - + Failed to send - + Prepare to send - + Address of the recipient - + Amount to send - + Gas price - + Cancel Cancel - + Recipient's address - + The address has to be mixed case. - + Failed to Broadcast - + Fix - + MAX - + Fiat amount: Unavailable - + Fiat amount: %1 - + %1 amount: %2 - + Specify in Fiat - + Specify in Crypto - + + Enter memo + + + + Enable Custom Fees - + Enter the custom fee - + Gas Limit - + Custom Fee can't be higher than the amount - + Not enough funds. - - + + You have %1 AMT TICKER - - + + Only use custom fees if you know what you are doing! - + Prepare - - + + Send - + %1 address TICKER - + copied to clipboard. - + Amount - + + Memo + + + + Fees - + Date - + Back @@ -3383,11 +3386,16 @@ Please select a new order. + Memo + + + + Fees - + Date @@ -3397,12 +3405,12 @@ Please select a new order. - + Close - + View on Explorer @@ -3410,8 +3418,8 @@ Please select a new order. SettingModal - - + + Cancel Cancel @@ -3441,57 +3449,57 @@ Please select a new order. - + Enable Desktop Notifications - + Maximum number of enabled coins - + Logs - + Open Folder - + Reset - + Current Font - + Current font changed to %1. - + Theme - + Changing theme to %1 - + Application Version - + copied to clipboard @@ -3501,136 +3509,141 @@ Please select a new order. - - + + Hide Poison Transactions in History + + + + + Reset wallet configuration - + This will restart your wallet with default settings - - + + Confirm - + Ask system's password before sending coins ? (2FA) - + Disable 2FA? - + Enter your wallet password to confirm - + Type password - + 2FA status - + 2FA disabled successfully - - + + Ok - + Wrong password! - + Wallet password is incorrect - + View seed and private keys - - + + Show - + Setup Camouflage Password - + Open - + Disclaimer and ToS - + Application version - + MM2 version - + MM2 Version - + MM2 Version copied to clipboard. - + Qt version - + Qt Version - + Qt Version copied to clipboard. - + Search Update - + Logout @@ -3910,62 +3923,78 @@ Network fees can vary greatly depending on your selected trading pair. - + + I see a transaction in my wallet that was marked as 'poison'. What does this mean? + + + + + Address poisoning is a relatively new tye of phishing attack, where a malicious actor aims to trick you into sending funds to an address that you did not intend to send funds to. + +This is often done by sending a zero value transaction to your wallet from an address which looks very similar to your actual address, with the exact same letters at the start and end. This transaction will then appear in your transaction history, with the scammer hoping you will mistake the fake address for your own and send funds to it. + +To protect you from this, %1 will mark any transaction that it detects as potentially being a poison transaction with a "poison" label. You should always be careful to confirm any address you send funds to is correct. + +There is a toggle in settings where you can turn on/off the display of these transactions. + + + + Do you provide user support? - + Yes! %1 offers support through the <a href="%2">%1 Discord server</a>. The team and the community are always happy to help! - + Who is behind %1? - + %1 is developed by the Komodo team. Komodo is one of the most established blockchain projects working on innovative solutions like atomic swaps, Delayed Proof of Work, and an interoperable multi-chain architecture. - + Is it possible to develop my own white-label exchange on %1? - + Absolutely! You can read our developer documentation for more details or contact us with your partnership inquiries. Have a specific technical question? The %1 developer community is always ready to help! - + Which devices can I use %1 on? - + %1 is available for mobile on both <a href="%2">Android and iPhone, and for desktop on Windows, Mac, and Linux</a> operating systems. - + Compliance Info - + Due to regulatory and legal circumstances the citizens of certain jurisdictions including, but not limited to, the United States of America, Canada, Hong Kong, Israel, Singapore, Sudan, Austria, Iran and any other state, country or other jurisdiction that is embargoed by the United States of America or the European Union are not allowed to use this application. - + Changelog - + Open Logs Folder @@ -4076,32 +4105,32 @@ Network fees can vary greatly depending on your selected trading pair. - + Entered amount must be higher than 0. - + Select an order. - + MAX - + To - + Pick an order - + Price @@ -4121,52 +4150,52 @@ Network fees can vary greatly depending on your selected trading pair. - - Tradable: + + Balance: - + Pick a coin - + SWAP NOW - + Failed to place the order - + Placed the order - + No buy orders found for %1. - + You can check later or try to sell a different coin. - + Calculating fee estimate... - + Total %1 fees: - + %2 (%3) @@ -4225,88 +4254,98 @@ Network fees can vary greatly depending on your selected trading pair. TransactionDetailsModal - + Transaction Details - + + This transaction has been identified as a potential address poisoning attack. + + + + + Please see the Support FAQ for more information. + + + + %1 txid TICKER - + copied to clipboard. - + Amount - + Fees - + From address - + To address - + Date - + Unconfirmed - + Transaction Hash - + Confirmations - + Block Height - + From - + To - + Notes - + Close - + View on Explorer @@ -4314,22 +4353,27 @@ Network fees can vary greatly depending on your selected trading pair. Transactions - + Sent - + Received - + + Poison + + + + fees - + Unconfirmed @@ -4463,7 +4507,7 @@ This might take a few minutes... atomic_dex::settings_page - + An error has occurred. @@ -4486,47 +4530,47 @@ This might take a few minutes... - + Checksum verification failed for %1. - + Invalid checksum for %1. Click the button to convert to mixed case address. - + Legacy address used for %1. Click the button to convert to a Cashaddress. - + %1 address must be prefixed with 0x - + %1 address length is invalid, please use a valid address. - + %1 address is invalid. - + Invalid checksum. - + %1 address has invalid prefixes. - + Backend error: %1 diff --git a/atomic_defi_design/assets/languages/atomic_defi_es.ts b/atomic_defi_design/assets/languages/atomic_defi_es.ts index 45a6fb7d48..08582df328 100644 --- a/atomic_defi_design/assets/languages/atomic_defi_es.ts +++ b/atomic_defi_design/assets/languages/atomic_defi_es.ts @@ -233,7 +233,7 @@ App - + Recover Funds Result Resultados de Recuperar Fondos @@ -315,68 +315,73 @@ Bottom - + + Add Crypto + + + + Settings Configuración - + Support Soporte - + Privacy Privacidad - + Disable Privacy? ¿Deshabilitar privacidad? - + Enter wallet password to confirm Ingrese la contraseña de la billetera para confirmar - + Type password Escriba la contraseña - + Confirm Confirmar - + Cancel Cancelar - + Privacy status Estado de privacidad - + Privacy mode disabled successfully Modo de privacidad deshabilitado correctamente - - + + Ok Ok - + Wrong password! ¡Contraseña incorrecta! - + wallet password is incorrect la contraseña de la billetera es incorrecta @@ -494,8 +499,8 @@ - Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> - Datos de mercado (precios, estadisticas, etc.) marcados con ⓘ se obtienen a través de fuentes terceras.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> + Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. + Datos de mercado (precios, estadisticas, etc.) marcados con ⓘ se obtienen a través de fuentes terceras.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. @@ -516,6 +521,14 @@ + + ClaimFaucetResultModal + + + Close + Cerrar + + ClaimRewardsModal @@ -834,177 +847,177 @@ El número actual de monedas habilitadas no coincide con su especificación de configuración. Se restablecerá la configuración de sus activos. - + Matching Emparejando - + Order Matching Emparejando Orden - + Matched Emparejado - + Order Matched Orden Emparejada - + Ongoing En Curso - + Swap Ongoing Intercambio En Curso - + Successful Exitoso - + Swap Successful Intercambio exitoso - + Refunding Reembolso - + Failed Fallo - + Swap Failed Intercambio fallido - + Unknown Desconocido - + Unknown State Estado Desconocido - + Started Iniciado - + Negotiated Negociado - + Taker fee sent Tarifa taker enviada - + Maker payment received Pago de maker recibido - + Maker payment wait confirm started Inicio de espera de confirmacion de pago de maker - + Maker payment validated and confirmed Validacion y confirmacion de pago de maker - + Taker payment sent Pago de taker enviado - + Taker payment spent Pago del taker gastado - + Maker payment spent Pago del maker gastado - + Finished Terminado - + Start failed Inicio fallido - + Negotiate failed Negociacion fallida - + Taker fee validate failed Validación de tarifa del taker fallida - + Maker payment transaction failed Transacción de pago de maker fallo - + Maker payment Data send failed Envio de data de pago de maker fallo - + Maker payment wait confirm failed Espera de confirmacion de pago de maker fallo - + Taker payment validate failed Validacion de pago de taker fallo - + Taker payment wait confirm failed Espera de confirmacion de pago de taker fallo - + Taker payment spend failed Gasto de pago de taker fallo - + Maker payment wait refund started Reembolso de espera de pago de maker iniciado - + Maker payment refunded Pago de maker reembolsado - + Maker payment refund failed Reembolso del pago de maker fallo @@ -1389,7 +1402,7 @@ General - + %n day(s) %n día @@ -1397,7 +1410,7 @@ - + %nd day @@ -1406,7 +1419,7 @@ - + %nh hours @@ -1415,7 +1428,7 @@ - + %nm minutes @@ -1424,7 +1437,7 @@ - + %ns seconds @@ -1433,7 +1446,7 @@ - + %nms milliseconds @@ -1442,117 +1455,117 @@ - + - - - + <b>Taker tx fee:</b> <b>Cuota de tx del taker:</b> - + <b>Dex tx fee:</b> <b>Cuota de tx del Dex:</b> - + <b>Dex fee:</b> <b>Cuota Dex:</b> - + <b>Maker tx fee:</b> <b>Cuota tx del maker:</b> - + %1 balance is zero - + Activating %1 (%2%) - + Loading wallet... - + Min: %1 Mín.: %1 - + Enter an amount Ingrese una cantidad - + Trading Fee Tarifa de Intercambio - + Minimum Trading Amount Cantidad Mínima de Intercambio - + Wallet %1 already exists WALLETNAME Monedero %1 ya existe - + %1 balance is lower than the fees amount: %2 %3 El saldo de %1 es inferior al monto de las tarifas: %2 %3 - + Tradable (after fees) %1 balance is lower than minimum trade amount El saldo de %1 (después de las tarifas) es inferior al monto mínimo de intercambio - + Please fill the price field Por favor complete el campo de precio - + Please fill the volume field Complete el campo de volumen - - + + Please wait for %1 to fully activate Espere a que %1 se active por completo - - + + %1 volume is lower than minimum trade amount El volumen de %1 es inferior al monto mínimo de intercambio - - + + %1 needs to be enabled in order to use %2 %1 debe habilitarse para usar %2 - - + + %1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions se debe rellenar el saldo de %1, se requiere un saldo distinto de cero para pagar el gas de %2 transacciones - + Unknown Error Error Desconocido @@ -1854,140 +1867,115 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión. Main - - Segwit - Segwit - - - - Confirmation - Confirmación - - - - Do you want to send your %1 funds to %2 wallet first? - ¿Desea enviar sus fondos de %1 a la billetera %2 primero? - - - - Success - Éxito - - - - Your transaction is send, may take some time to arrive - Su transacción se envió, puede demorar algún tiempo en llegar - - - + Price Precio - + Change 24hr Cambio - + Contract Address Dirección del Contrato - + Send Enviar - + Enable %1 ? ¿Habilitar %1? - + Yes - + No No - + Receive Recibir - + Swap Intercambiar - + Portfolio Cartera - + is wallet only es solo billetera - + Rewards Recompensas - + Faucet Grifo - - - + + + Public Key Clave Pública - + Copied to Clipboard Copiada en el Portapapeles - + Loading market data Cargando datos de mercado - + There is no chart data for this ticker yet No hay datos de gráficos para este ticker aún - + Fetching transactions... Obteniendo transacciones... - + Please wait, %1 is %2 Por favor espera %1 es %2 - + % activated... % activado... - + No transactions available No hay transacciones disponibles - + Click to view your address on %1 (%2) block explorer Haga clic para ver su dirección en %1 (%2) explorador de bloques @@ -2444,6 +2432,11 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión.Your wallet balance changed El saldo de tu billetera cambió + + + Close + Cerrar + %1 Enable status @@ -2463,49 +2456,49 @@ Se eliminarán del libro de pedidos hasta que vuelva a iniciar sesión. - + Failed to disable %1 TICKER Error al deshabilitar %1 - + Endpoint not reachable Punto final no accesible - + Could not reach to endpoint No se pudo llegar al punto final - + Show Mostrar - + Restart Reiniciar - + Quit Salir - + Notifications Notificaciones - + There aren't any notifications No hay ' notificaciones - + Mark all as read Marcar todo como leído @@ -2956,12 +2949,12 @@ Seleccione un nuevo pedido. ProView - + Failed to place the order Error al realizar el pedido - + Placed the order Realizó el pedido El @@ -3146,162 +3139,172 @@ Seleccione un nuevo pedido. SendModal - + Failed to send Error al enviar - + Prepare to send Preparar para enviar - + Address of the recipient Dirección del destinatario - + Amount to send Cantidad a enviar - + Gas price Precio del gas - + Cancel Cancelar - + Recipient's address Dirección del destinatario - + The address has to be mixed case. La dirección debe estar en mayúsculas y minúsculas. - + Failed to Broadcast Error al transmitir - + Fix Arreglar - + MAX MAX - + Fiat amount: Unavailable Cantidad en Fiat: No disponible - + Fiat amount: %1 Cantidad de Fiat: %1 - + %1 amount: %2 Cantidad de %1: %2 - + Specify in Fiat Especificar en Fiat - + Specify in Crypto Especificar en Crypto - + + Enter memo + + + + Enable Custom Fees Habilitar Tarifas Personalizadas - + Enter the custom fee Ingrese la tarifa personalizada - + Gas Limit Límite de gas - + Custom Fee can't be higher than the amount Tarifa personalizada no puede ser mayor que la cantidad - + Not enough funds. No hay suficientes fondos. - - + + You have %1 AMT TICKER Tiene %1 - - + + Only use custom fees if you know what you are doing! ¡Solo use tarifas personalizadas si sabe lo que está haciendo! - + Prepare Preparar - - + + Send Enviar - + %1 address TICKER %1 dirección - + copied to clipboard. copiado al portapapeles. - + Amount Cantidad - + + Memo + + + + Fees Tarifas - + Date Fecha - + Back Atrás @@ -3387,11 +3390,16 @@ Seleccione un nuevo pedido. + Memo + + + + Fees Tarifas - + Date Fecha @@ -3401,12 +3409,12 @@ Seleccione un nuevo pedido. Hash de Transaccion - + Close Cerrar - + View on Explorer Ver en Explorer @@ -3414,8 +3422,8 @@ Seleccione un nuevo pedido. SettingModal - - + + Cancel Cancelar @@ -3445,57 +3453,57 @@ Seleccione un nuevo pedido. Seguridad - + Enable Desktop Notifications Habilitar notificaciones de escritorio - + Maximum number of enabled coins Número máximo de monedas habilitadas - + Logs Registros - + Open Folder Carpeta Abierta - + Reset Restablecer - + Current Font Fuente Actual - + Current font changed to %1. La fuente actual cambió a %1. - + Theme Tema - + Changing theme to %1 Cambiando el tema a %1 - + Application Version La versión de la aplicación - + copied to clipboard copiado al portapapeles @@ -3505,136 +3513,141 @@ Seleccione un nuevo pedido. Acerca de & Versión - - + + Hide Poison Transactions in History + + + + + Reset wallet configuration Restablecer configuración de billetera - + This will restart your wallet with default settings Esto reiniciará su billetera con la configuración predeterminada - - + + Confirm Confirmar - + Ask system's password before sending coins ? (2FA) ¿Preguntar la contraseña del sistema antes de enviar monedas? (2FA) - + Disable 2FA? ¿Deshabilitar 2FA? - + Enter your wallet password to confirm Ingrese la contraseña de su billetera para confirmar - + Type password Escriba la contraseña - + 2FA status Estado 2FA - + 2FA disabled successfully 2FA deshabilitado correctamente - - + + Ok Ok - + Wrong password! ¡Contraseña incorrecta! - + Wallet password is incorrect Contraseña de la billetera es incorrecta - + View seed and private keys Ver semilla y claves privadas - - + + Show Mostrar - + Setup Camouflage Password Configuración de Contraseña Camuflaje - + Open Abrir - + Disclaimer and ToS Descargo de Responsabilidad y Terminos de Servicio - + Application version Versión de Aplicación - + MM2 version Versión MM2 - + MM2 Version Versión MM2 - + MM2 Version copied to clipboard. Versión MM2 copiada al portapapeles. - + Qt version Versión Qt - + Qt Version Versión Qt - + Qt Version copied to clipboard. Versión de Qt copiada al portapapeles. - + Search Update Buscar Actualizacion - + Logout Cerrar sesión @@ -3930,62 +3943,78 @@ Network fees can vary greatly depending on your selected trading pair. Las tarifas de la red pueden variar mucho según el par comercial seleccionado. - + + I see a transaction in my wallet that was marked as 'poison'. What does this mean? + + + + + Address poisoning is a relatively new tye of phishing attack, where a malicious actor aims to trick you into sending funds to an address that you did not intend to send funds to. + +This is often done by sending a zero value transaction to your wallet from an address which looks very similar to your actual address, with the exact same letters at the start and end. This transaction will then appear in your transaction history, with the scammer hoping you will mistake the fake address for your own and send funds to it. + +To protect you from this, %1 will mark any transaction that it detects as potentially being a poison transaction with a "poison" label. You should always be careful to confirm any address you send funds to is correct. + +There is a toggle in settings where you can turn on/off the display of these transactions. + + + + Do you provide user support? ¿Ofrecen soporte al usuario? - + Yes! %1 offers support through the <a href="%2">%1 Discord server</a>. The team and the community are always happy to help! ¡Sí! %1 ofrece soporte a través del <a href="%2">%1 servidor Discord</a>. ¡El equipo y la comunidad siempre están dispuestos a ayudar! - + Who is behind %1? ¿Quién está detrás de %1? - + %1 is developed by the Komodo team. Komodo is one of the most established blockchain projects working on innovative solutions like atomic swaps, Delayed Proof of Work, and an interoperable multi-chain architecture. %1 está desarrollado por el equipo de Komodo. Komodo es uno de los proyectos de cadena de bloques más establecidos que trabaja en soluciones innovadoras como intercambios atómicos, prueba de trabajo retrasada y una arquitectura multicadena interoperable. - + Is it possible to develop my own white-label exchange on %1? ¿Es posible desarrollar mi propio intercambio de marca blanca en %1? - + Absolutely! You can read our developer documentation for more details or contact us with your partnership inquiries. Have a specific technical question? The %1 developer community is always ready to help! ¡Absolutamente! Puede leer nuestra documentación para desarrolladores para obtener más detalles o ponerse en contacto con nosotros con sus consultas de asociación. ¿Tiene una pregunta técnica específica? ¡La comunidad de desarrolladores de %1 siempre está lista para ayudar! - + Which devices can I use %1 on? ¿En qué dispositivos puedo usar %1? - + %1 is available for mobile on both <a href="%2">Android and iPhone, and for desktop on Windows, Mac, and Linux</a> operating systems. %1 está disponible para dispositivos móviles en <a href="%2">Android y iPhone, y para escritorio en Windows, Mac y Linux</a> sistemas operativos. - + Compliance Info Información de cumplimiento - + Due to regulatory and legal circumstances the citizens of certain jurisdictions including, but not limited to, the United States of America, Canada, Hong Kong, Israel, Singapore, Sudan, Austria, Iran and any other state, country or other jurisdiction that is embargoed by the United States of America or the European Union are not allowed to use this application. Debido a circunstancias reglamentarias y legales, los ciudadanos de ciertas jurisdicciones, incluidos, entre otros, los Estados Unidos de América, Canadá, Hong Kong, Israel, Singapur, Sudán, Austria, Irán y cualquier otro estado, país u otra jurisdicción que está embargado por los Estados Unidos de América o la Unión Europea no se les permite utilizar esta aplicación. - + Changelog Cambios - + Open Logs Folder Abrir Carpeta de Registros @@ -4096,32 +4125,32 @@ Las tarifas de la red pueden variar mucho según el par comercial seleccionado.< Desde - + Entered amount must be higher than 0. - + Select an order. - + MAX MAX - + To A - + Pick an order Elegir una orden - + Price Precio @@ -4141,52 +4170,52 @@ Las tarifas de la red pueden variar mucho según el par comercial seleccionado.< %1 - - Tradable: - Negociable: + + Balance: + - + Pick a coin Elija una moneda - + SWAP NOW CAMBIE AHORA - + Failed to place the order Error al realizar el pedido - + Placed the order Realizó el pedido El - + No buy orders found for %1. No se encontraron órdenes de compra para %1. - + You can check later or try to sell a different coin. Puede verificar más tarde o intentar vender una moneda diferente. - + Calculating fee estimate... Calculando tarifa estimada... - + Total %1 fees: Total de %1 tarifas: - + %2 (%3) %2 (%3) @@ -4245,88 +4274,98 @@ Las tarifas de la red pueden variar mucho según el par comercial seleccionado.< TransactionDetailsModal - + Transaction Details Detalles de Transacción - + + This transaction has been identified as a potential address poisoning attack. + + + + + Please see the Support FAQ for more information. + + + + %1 txid TICKER %1 txid - + copied to clipboard. copiado al portapapeles. - + Amount Cantidad - + Fees Tarifas - + From address Desde dirección - + To address Para dirección - + Date Fecha - + Unconfirmed Sin confirmar - + Transaction Hash Hash de Transaccion - + Confirmations Confirmaciones - + Block Height Altura del Bloque - + From Desde - + To A - + Notes Notas - + Close Cerrar - + View on Explorer Ver en Explorer @@ -4334,22 +4373,27 @@ Las tarifas de la red pueden variar mucho según el par comercial seleccionado.< Transactions - + Sent Enviado - + Received Recibido - + + Poison + + + + fees tarifas - + Unconfirmed Sin confirmar @@ -4484,7 +4528,7 @@ Esto puede tardar unos minutos... atomic_dex::settings_page - + An error has occurred. Se ha producido un error. @@ -4507,47 +4551,47 @@ Esto puede tardar unos minutos... Necesita tener %1 para pagar la gasolina de %2 transacciones. - + Checksum verification failed for %1. La verificación de la suma de comprobación falló para %1. - + Invalid checksum for %1. Click the button to convert to mixed case address. Suma de comprobación no válida para %1. Haga clic en el botón para convertir a dirección de mayúsculas y minúsculas. - + Legacy address used for %1. Click the button to convert to a Cashaddress. Dirección heredada utilizada para %1. Haga clic en el botón para convertir a una dirección de efectivo. - + %1 address must be prefixed with 0x La dirección %1 debe tener el prefijo 0x - + %1 address length is invalid, please use a valid address. La longitud de la dirección %1 no es válida, utilice una dirección válida. - + %1 address is invalid. La dirección %1 no es válida. - + Invalid checksum. Suma de comprobación no válida. - + %1 address has invalid prefixes. La dirección %1 tiene prefijos no válidos. - + Backend error: %1 Error de backend: %1 diff --git a/atomic_defi_design/assets/languages/atomic_defi_fr.ts b/atomic_defi_design/assets/languages/atomic_defi_fr.ts index b4ad8162ff..0281cd7df4 100644 --- a/atomic_defi_design/assets/languages/atomic_defi_fr.ts +++ b/atomic_defi_design/assets/languages/atomic_defi_fr.ts @@ -233,7 +233,7 @@ App - + Recover Funds Result Le résultat de la récupération des fonds @@ -315,68 +315,73 @@ Bottom - + + Add Crypto + + + + Settings Réglages - + Support Support - + Privacy Intimité - + Disable Privacy? - + Enter wallet password to confirm - + Type password Tapez votre mot de passe - + Confirm Confirmer - + Cancel Annuler - + Privacy status - + Privacy mode disabled successfully - - + + Ok Ok - + Wrong password! - + wallet password is incorrect le mot de passe du portefeuille est incorrect @@ -494,8 +499,8 @@ - Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> - Les données de marché (prix, graphiques, etc.) marquées de l'icône ⓘ proviennent de sources tierces.<br><br>Les données proviennent de <a href="https://bandprotocol.com/"> Band Decentralized Oracle</a> et <a href="https://www.coingecko.com/fr">Coingecko </a>.<br><br><b>Paires prises en charge par Oracle:</b><br>%1<br><br><b>Dernière référence (Band Oracle) :</b><br><a href="%2">%2</a> + Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. + Les données de marché (prix, graphiques, etc.) marquées de l'icône ⓘ proviennent de sources tierces.<br><br>Les données proviennent de <a href="https://www.coingecko.com/fr">Coingecko </a>. @@ -516,6 +521,14 @@ + + ClaimFaucetResultModal + + + Close + Fermer + + ClaimRewardsModal @@ -834,177 +847,177 @@ Le nombre actuel d'actifs activées ne correspond pas à vos spécifications de configuration. La configuration de vos actifs sera réinitialisée. - + Matching Recherche en cours - + Order Matching Recherche d'un ordre - + Matched Trouvé - + Order Matched Ordre trouvé - + Ongoing En cours - + Swap Ongoing Échange en cours - + Successful Réussi - + Swap Successful Échange terminé - + Refunding En cours de remboursement - + Failed Échoué - + Swap Failed Erreur lors de l'échange - + Unknown Inconnue - + Unknown State État inconnu - + Started Commencé - + Negotiated Négocié - + Taker fee sent Frais de preneur envoyés - + Maker payment received Paiement de l'envoyeur reçu - + Maker payment wait confirm started La confirmation d'attente de paiement de l'envoyeur a commencé - + Maker payment validated and confirmed Paiement de l'envoyeur validé et confirmé - + Taker payment sent Paiement du preneur envoyé - + Taker payment spent Paiement du preneur dépensé - + Maker payment spent Paiement de l'envoyeur dépensé - + Finished Fini - + Start failed Le démarrage a échoué - + Negotiate failed La négociation a échoué - + Taker fee validate failed Échec de la validation des frais du preneur - + Maker payment transaction failed La transaction de paiement du créateur a échoué - + Maker payment Data send failed Échec de l'envoi des données de paiement du créateur - + Maker payment wait confirm failed La confirmation de l'attente de paiement du créateur a échoué - + Taker payment validate failed La validation du paiement du preneur a échoué - + Taker payment wait confirm failed La confirmation de l'attente de paiement du preneur a échoué - + Taker payment spend failed Échec des dépenses de paiement du preneur - + Maker payment wait refund started attente de paiement du créateur, remboursement commencé - + Maker payment refunded Paiement du créateur remboursé - + Maker payment refund failed échec du remboursement du paiement du créateur @@ -1389,7 +1402,7 @@ General - + %n day(s) %n jour(s) @@ -1397,7 +1410,7 @@ - + %nd day @@ -1406,7 +1419,7 @@ - + %nh hours @@ -1415,7 +1428,7 @@ - + %nm minutes @@ -1424,7 +1437,7 @@ - + %ns seconds @@ -1433,7 +1446,7 @@ - + %nms milliseconds @@ -1442,117 +1455,117 @@ - + - - - + <b>Taker tx fee:</b> Taxes de transaction du preneur: - + <b>Dex tx fee:</b> Taxes de transaction de DEX: - + <b>Dex fee:</b> Taxes de DEX: - + <b>Maker tx fee:</b> Taxes de transaction du créateur - + %1 balance is zero - + Activating %1 (%2%) - + Loading wallet... - + Min: %1 - + Enter an amount Entrez un montant - + Trading Fee Frais d'échanges - + Minimum Trading Amount Frais d'échange minimum - + Wallet %1 already exists WALLETNAME Le portefeuille %1 existe déjà - + %1 balance is lower than the fees amount: %2 %3 La %1 balance est inférieur aux frais: %2 %3 - + Tradable (after fees) %1 balance is lower than minimum trade amount Le solde négociable (après frais) %1 est inférieur au montant minimum de la transaction - + Please fill the price field Veuillez remplir le champ de prix - + Please fill the volume field - - + + Please wait for %1 to fully activate - - + + %1 volume is lower than minimum trade amount Le volume de %1 est inférieur au montant minimum de la transaction - - + + %1 needs to be enabled in order to use %2 %1 doit être activé pour utiliser %2 - - + + %1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions Le solde %1 doit être financé, un solde différent de zéro est requis pour payer les frais de transactions de %2 - + Unknown Error Erreur inconnue @@ -1851,140 +1864,115 @@ They will be removed from the orderbook until you log in again. Main - - Segwit - Segwit - - - - Confirmation - Confirmation - - - - Do you want to send your %1 funds to %2 wallet first? - Voulez-vous d'abord envoyer vos fonds %1 vers le portefeuille %2 ? - - - - Success - Succès - - - - Your transaction is send, may take some time to arrive - Votre transaction est envoyée, peut prendre un certain temps pour arriver - - - + Price Prix - + Change 24hr - + Contract Address - + Send Envoyez - + Enable %1 ? Activer %1 ? - + Yes Oui - + No Non - + Receive Recevoir - + Swap Échange - + Portfolio Portfolio - + is wallet only - + Rewards Récompenses - + Faucet Robinet - - - + + + Public Key - + Copied to Clipboard Copier dans le presse-papier - + Loading market data Chargement des données de marché - + There is no chart data for this ticker yet Il n'y a pas encore de données graphiques pour ce ticker - + Fetching transactions... - + Please wait, %1 is %2 - + % activated... - + No transactions available - + Click to view your address on %1 (%2) block explorer @@ -2441,6 +2429,11 @@ They will be removed from the orderbook until you log in again. Your wallet balance changed Le solde de votre portefeuille a changé + + + Close + Fermer + %1 Enable status @@ -2460,49 +2453,49 @@ They will be removed from the orderbook until you log in again. - + Failed to disable %1 TICKER - + Endpoint not reachable Point final non accessible - + Could not reach to endpoint Impossible d'atteindre le point de terminaison - + Show Montrer - + Restart Redémarrer - + Quit Quitter - + Notifications - + There aren't any notifications - + Mark all as read Tout marquer comme lu @@ -2952,12 +2945,12 @@ Please select a new order. ProView - + Failed to place the order Échec lors du placement de l'ordre - + Placed the order L'ordre a été placé avec succès @@ -3142,162 +3135,172 @@ Please select a new order. SendModal - + Failed to send Échec de l'envoi - + Prepare to send Préparez à envoyer du - + Address of the recipient Adresse du destinataire - + Amount to send Montant à envoyer - + Gas price Prix ​​du gaz - + Cancel Annuler - + Recipient's address Adresse du destinataire - + The address has to be mixed case. L'adresse doit être mixte (case). - + Failed to Broadcast - + Fix Réparer - + MAX MAX - + Fiat amount: Unavailable - + Fiat amount: %1 - + %1 amount: %2 - + Specify in Fiat - + Specify in Crypto - + + Enter memo + + + + Enable Custom Fees Activer les frais personnalisés - + Enter the custom fee Entrez les frais personnalisées - + Gas Limit Limite de gaz - + Custom Fee can't be higher than the amount Les frais personnalisées ne peuvent pas être supérieurs au montant - + Not enough funds. Pas assez de fonds. - - + + You have %1 AMT TICKER Vous avez %1 - - + + Only use custom fees if you know what you are doing! - + Prepare Préparer - - + + Send Envoyez - + %1 address TICKER - + copied to clipboard. - + Amount Montant - + + Memo + + + + Fees Frais - + Date Date - + Back Retour @@ -3383,11 +3386,16 @@ Please select a new order. + Memo + + + + Fees Frais - + Date Date @@ -3397,12 +3405,12 @@ Please select a new order. Hachage de la transaction - + Close Fermer - + View on Explorer Voir dans l'explorateur @@ -3410,8 +3418,8 @@ Please select a new order. SettingModal - - + + Cancel Annuler @@ -3446,191 +3454,196 @@ Please select a new order. À propos & version - + Enable Desktop Notifications Activer les notifications - + + Hide Poison Transactions in History + + + + Maximum number of enabled coins Nombre maximum d'actifs activés - + Logs Journaux - + Open Folder Ouvrir le dossier - - + + Reset wallet configuration Réinitialiser la configuration du portefeuille - + This will restart your wallet with default settings Cela redémarrera votre portefeuille avec les paramètres par défaut - - + + Confirm Confirmer - + Changing theme to %1 Changer le thème en %1 - + Disable 2FA? - + Enter your wallet password to confirm - + Type password Tapez votre mot de passe - + 2FA status - + 2FA disabled successfully - - + + Ok Ok - + Wrong password! - + Wallet password is incorrect - + Application Version - + copied to clipboard copié dans le presse-papier - + Reset Réinitialiser - + Current Font Police actuelle - + Current font changed to %1. La police actuelle est passée à %1. - + Theme Thème - + Ask system's password before sending coins ? (2FA) Demander le mot de passe du système avant d'envoyer des actifs ? (2FA) - + Application version Version de l'application - + MM2 version Version de MM2 - + MM2 Version MM2 Version - + MM2 Version copied to clipboard. MM2 Version copiée dans le presse-papiers. - + Qt version Version de Qt - + Qt Version Qt Version - + Qt Version copied to clipboard. Version Qt copiée dans le presse-papiers. - + Search Update Rechercher une mise à jour - + Logout Se déconnecter - + View seed and private keys Afficher la phrase de récupération et les clefs privées - - + + Show Montrer - + Setup Camouflage Password Configurer le mot de passe de camouflage - + Open Ouvrir - + Disclaimer and ToS Clause de non-responsabilité et conditions d'utilisation @@ -3912,62 +3925,78 @@ Network fees can vary greatly depending on your selected trading pair. - + + I see a transaction in my wallet that was marked as 'poison'. What does this mean? + + + + + Address poisoning is a relatively new tye of phishing attack, where a malicious actor aims to trick you into sending funds to an address that you did not intend to send funds to. + +This is often done by sending a zero value transaction to your wallet from an address which looks very similar to your actual address, with the exact same letters at the start and end. This transaction will then appear in your transaction history, with the scammer hoping you will mistake the fake address for your own and send funds to it. + +To protect you from this, %1 will mark any transaction that it detects as potentially being a poison transaction with a "poison" label. You should always be careful to confirm any address you send funds to is correct. + +There is a toggle in settings where you can turn on/off the display of these transactions. + + + + Do you provide user support? Fournissez-vous un support utilisateur ? - + Yes! %1 offers support through the <a href="%2">%1 Discord server</a>. The team and the community are always happy to help! Oui! %1 offre une assistance via le <a href="%2">%1 serveur Discord</a>. L'équipe et la communauté sont toujours ravies de vous aider ! - + Who is behind %1? Qui est derrière %1 ? - + %1 is developed by the Komodo team. Komodo is one of the most established blockchain projects working on innovative solutions like atomic swaps, Delayed Proof of Work, and an interoperable multi-chain architecture. %1 est développé par l'équipe de Komodo. Komodo est l'un des projets de blockchain les plus établis travaillant sur des solutions innovantes telles que les échanges atomiques, la preuve de travail différée et une architecture multichaîne interopérable. - + Is it possible to develop my own white-label exchange on %1? Est-il possible de développer mon propre échange en white label sur %1 ? - + Absolutely! You can read our developer documentation for more details or contact us with your partnership inquiries. Have a specific technical question? The %1 developer community is always ready to help! Absolument! Vous pouvez lire notre documentation développeur pour plus de détails ou nous contacter avec vos demandes de partenariat. Vous avez une question technique spécifique? La communauté de développeurs %1 est toujours prête à vous aider ! - + Which devices can I use %1 on? Sur quels appareils puis-je utiliser %1 ? - + %1 is available for mobile on both <a href="%2">Android and iPhone, and for desktop on Windows, Mac, and Linux</a> operating systems. %1 est disponible pour mobile sur <a href="%2">Android et iPhone, et pour ordinateur de bureau sur les systèmes d'exploitation Windows, Mac et Linux</a>. - + Compliance Info Informations de conformité - + Due to regulatory and legal circumstances the citizens of certain jurisdictions including, but not limited to, the United States of America, Canada, Hong Kong, Israel, Singapore, Sudan, Austria, Iran and any other state, country or other jurisdiction that is embargoed by the United States of America or the European Union are not allowed to use this application. En raison de circonstances réglementaires et juridiques, les citoyens de certaines juridictions, y compris, mais sans s'y limiter, les États-Unis d'Amérique, le Canada, Hong Kong, Israël, Singapour, le Soudan, l'Autriche, l'Iran et tout autre État, pays ou autre juridiction sous embargo par les États-Unis d'Amérique ou l'Union européenne ne sont pas autorisés à utiliser cette application. - + Changelog Changelog - + Open Logs Folder Ouvrir le répertoire de logs @@ -4078,32 +4107,32 @@ Network fees can vary greatly depending on your selected trading pair. De - + Entered amount must be higher than 0. - + Select an order. - + MAX MAX - + To Vers - + Pick an order Choisir une commande - + Price Prix @@ -4123,52 +4152,52 @@ Network fees can vary greatly depending on your selected trading pair. - - Tradable: - Disponible: + + Balance: + - + Pick a coin Choisissez un actif - + SWAP NOW ÉCHANGER MAINTENANT - + Failed to place the order Échec lors du placement de l'ordre - + Placed the order L'ordre a été placé - + No buy orders found for %1. Aucun ordre d'achat trouvé pour %1. - + You can check later or try to sell a different coin. Vous pouvez vérifier plus tard ou essayer de vendre un actif différent. - + Calculating fee estimate... - + Total %1 fees: Frais totaux %1 : - + %2 (%3) @@ -4227,88 +4256,98 @@ Network fees can vary greatly depending on your selected trading pair. TransactionDetailsModal - + Transaction Details Détails de la transaction - + + This transaction has been identified as a potential address poisoning attack. + + + + + Please see the Support FAQ for more information. + + + + %1 txid TICKER - + copied to clipboard. - + Amount Montant - + Fees Frais - + From address - + To address - + Date Date - + Unconfirmed Non confirmé - + Transaction Hash Hachage de la transaction - + Confirmations Confirmations - + Block Height Hauteur de bloc - + From De - + To Vers - + Notes Remarques - + Close Fermer - + View on Explorer Voir dans l'explorateur @@ -4316,22 +4355,27 @@ Network fees can vary greatly depending on your selected trading pair. Transactions - + Received Reçue - + Sent Envoyé - + + Poison + + + + fees frais - + Unconfirmed Non confirmé @@ -4465,7 +4509,7 @@ This might take a few minutes... atomic_dex::settings_page - + An error has occurred. @@ -4488,47 +4532,47 @@ This might take a few minutes... Vous devez avoir %1 activée pour payer les frais de transactions de %2. - + Checksum verification failed for %1. Échec de la vérification du checksum de contrôle pour %1. - + Invalid checksum for %1. Click the button to convert to mixed case address. - + Legacy address used for %1. Click the button to convert to a Cashaddress. - + %1 address must be prefixed with 0x L'adresse %1 doit être précédée de 0x - + %1 address length is invalid, please use a valid address. La longueur de l'adresse %1 n'est pas valide, veuillez utiliser une adresse valide. - + %1 address is invalid. L'adresse %1 n'est pas valide. - + Invalid checksum. Somme de contrôle invalide. - + %1 address has invalid prefixes. L'adresse %1 a des préfixes non valides. - + Backend error: %1 Erreur de backend : %1 diff --git a/atomic_defi_design/assets/languages/atomic_defi_lang_template.ts b/atomic_defi_design/assets/languages/atomic_defi_lang_template.ts index 5836a5dfc1..fa46445515 100644 --- a/atomic_defi_design/assets/languages/atomic_defi_lang_template.ts +++ b/atomic_defi_design/assets/languages/atomic_defi_lang_template.ts @@ -405,7 +405,7 @@ - Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> + Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. diff --git a/atomic_defi_design/assets/languages/atomic_defi_ru.ts b/atomic_defi_design/assets/languages/atomic_defi_ru.ts index 969309617b..b76edaa350 100644 --- a/atomic_defi_design/assets/languages/atomic_defi_ru.ts +++ b/atomic_defi_design/assets/languages/atomic_defi_ru.ts @@ -233,7 +233,7 @@ App - + Recover Funds Result Результат восстановления средств @@ -315,68 +315,73 @@ Bottom - + + Add Crypto + + + + Settings Настройки - + Support Поддержка - + Privacy Скрыть баланс - + Disable Privacy? - + Enter wallet password to confirm - + Type password Введите пароль - + Confirm - + Cancel - + Privacy status - + Privacy mode disabled successfully - - + + Ok Ок - + Wrong password! - + wallet password is incorrect введен неправильный пароль @@ -494,8 +499,8 @@ - Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> - Рыночные данные (цены, графики, и тд.) отмеченные ⓘ иконкой получены от <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> и <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> + Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. + Рыночные данные (цены, графики, и тд.) отмеченные ⓘ иконкой получены от <a href="https://coingecko.com">CoinGecko</a>. @@ -516,6 +521,14 @@ + + ClaimFaucetResultModal + + + Close + Закрыть + + ClaimRewardsModal @@ -834,177 +847,177 @@ Текущее количество включенных монет не совпадает с конфигурацией. Ваша конфигурация активов будет сброшена. - + Matching Матчинг - + Order Matching Матчинг ордеров - + Matched Сматчен - + Order Matched Ордер сматчен - + Ongoing В процессе - + Swap Ongoing Своп продолжается - + Successful Успешно - + Swap Successful Своп успешно завершен - + Refunding Проводится возврат - + Failed Не завершено - + Swap Failed Своп не был завершен - + Unknown Неизвестно - + Unknown State Статус неизвестен - + Started Начат - + Negotiated Согласован - + Taker fee sent Комиссия тейкера отправлена - + Maker payment received Платеж мейкера получен - + Maker payment wait confirm started Ожидание платежа мейкера - + Maker payment validated and confirmed Платеж мейкера валидирован и подтвержден - + Taker payment sent Платеж тейкера отправлен - + Taker payment spent Платеж тейкера потрачен - + Maker payment spent Платеж мейкера потрачен - + Finished Завершено - + Start failed Не удалось начать - + Negotiate failed Согласование не прошло - + Taker fee validate failed Валидация комиссии тейкера не прошла - + Maker payment transaction failed Платежная транзакция мейкера не прошла - + Maker payment Data send failed Отправка платежных данных мейкера не прошла - + Maker payment wait confirm failed Платежная транзакция мейкера не была подтверждена - + Taker payment validate failed Не прошла валидация платежа тейкера - + Taker payment wait confirm failed Платежная транзакция тейкера не была подтверждена - + Taker payment spend failed Spend платежа тейкера не прошел - + Maker payment wait refund started Ожидание возврата платежа мейкера - + Maker payment refunded Платеж мейкера возвращен - + Maker payment refund failed Возврат платежа мейкера не выполнен @@ -1389,7 +1402,7 @@ General - + %n day(s) %n день @@ -1398,7 +1411,7 @@ - + %nd day @@ -1408,7 +1421,7 @@ - + %nh hours @@ -1418,7 +1431,7 @@ - + %nm minutes @@ -1428,7 +1441,7 @@ - + %ns seconds @@ -1438,7 +1451,7 @@ - + %nms milliseconds @@ -1448,117 +1461,117 @@ - + - - - + <b>Taker tx fee:</b> - + <b>Dex tx fee:</b> - + <b>Dex fee:</b> - + <b>Maker tx fee:</b> - + %1 balance is zero - + Activating %1 (%2%) - + Loading wallet... - + Min: %1 Мин: %1 - + Enter an amount Введите количество - + Trading Fee Торговая комиссия - + Minimum Trading Amount Минимальный объем сделки - + Wallet %1 already exists WALLETNAME Кошелек %1 уже существует - + %1 balance is lower than the fees amount: %2 %3 %1 баланс менее чем размер комиссий: %2 %3 - + Tradable (after fees) %1 balance is lower than minimum trade amount Торгуемый (после комиссий) баланс %1 - меньше минимальной суммы сделки - + Please fill the price field Пожалуйста, укажите цену - + Please fill the volume field - - + + Please wait for %1 to fully activate - - + + %1 volume is lower than minimum trade amount Сумма %1 меньше минимальной суммы сделки - - + + %1 needs to be enabled in order to use %2 %1 должен быть активным для использования %2 - - + + %1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions нужно пополнить баланс %1 для оплаты газа %2 транзакций - + Unknown Error Неизвестная ошибка @@ -1857,140 +1870,115 @@ They will be removed from the orderbook until you log in again. Main - - Segwit - Segwit - - - - Confirmation - Подтверждение - - - - Do you want to send your %1 funds to %2 wallet first? - Хотели бы вы сначала отправить ваши %1 средства на кошелек %2? - - - - Success - Успех - - - - Your transaction is send, may take some time to arrive - Ваша транзакция была отправлена, получение может занять какое-то время - - - + Price Цена - + Change 24hr - + Contract Address - + Send Отправить - + Enable %1 ? Активировать %1 ? - + Yes Да - + No Нет - + Receive Получить - + Swap Обменять - + Portfolio Портфолио - + is wallet only - + Rewards Награды - + Faucet Фаусет - - - + + + Public Key - + Copied to Clipboard Скопировано в буфер обмена - + Loading market data Загрузка рыночных данных - + There is no chart data for this ticker yet Для данного актива пока еще нет графиков данных - + Fetching transactions... - + Please wait, %1 is %2 - + % activated... - + No transactions available - + Click to view your address on %1 (%2) block explorer @@ -2447,6 +2435,11 @@ They will be removed from the orderbook until you log in again. Your wallet balance changed Баланс вашего кошелька изменился + + + Close + Закрыть + %1 Enable status @@ -2466,49 +2459,49 @@ They will be removed from the orderbook until you log in again. - + Failed to disable %1 TICKER - + Endpoint not reachable Эндпоинт не доступен - + Could not reach to endpoint Не удалось подключиться - + Show Показать - + Restart Перезапустить - + Quit Выйти - + Notifications - + There aren't any notifications - + Mark all as read Отметить все как прочитанные @@ -2958,12 +2951,12 @@ Please select a new order. ProView - + Failed to place the order Не удалось разместить ордер - + Placed the order Ордер размещен @@ -3148,162 +3141,172 @@ Please select a new order. SendModal - + Failed to send Ошибка отправки - + Prepare to send Подготовить к отправке - + Address of the recipient Адрес получателя - + Amount to send Сумма для отправки - + Gas price Цена газа - + Cancel - + Recipient's address Адрес получателя - + The address has to be mixed case. Адрес должен быть написан в смешанном регистре. - + Failed to Broadcast - + Fix Фикс - + MAX МАКС - + Fiat amount: Unavailable - + Fiat amount: %1 - + %1 amount: %2 - + Specify in Fiat - + Specify in Crypto - + + Enter memo + + + + Enable Custom Fees Включить настройку комиссий - + Enter the custom fee Введите комиссию сети - + Gas Limit Gas лимит - + Custom Fee can't be higher than the amount Комиссия не может больше общей суммы транзакции - + Not enough funds. Недостаточно средств. - - + + You have %1 AMT TICKER У вас %1 - - + + Only use custom fees if you know what you are doing! - + Prepare Подготовка - - + + Send Отправить - + %1 address TICKER - + copied to clipboard. - + Amount Сумма - + + Memo + + + + Fees Комиссия - + Date Дата - + Back Назад @@ -3389,11 +3392,16 @@ Please select a new order. + Memo + + + + Fees Комиссия сети - + Date Дата @@ -3403,12 +3411,12 @@ Please select a new order. Хэш транзакции - + Close Закрыть - + View on Explorer Смотреть в эксплорере @@ -3416,8 +3424,8 @@ Please select a new order. SettingModal - - + + Cancel Отмена @@ -3452,191 +3460,196 @@ Please select a new order. О программе - + Enable Desktop Notifications Включить уведомления для рабочего стола - + + Hide Poison Transactions in History + + + + Maximum number of enabled coins Макс. количество активированных монет - + Logs Логи - + Open Folder Открыть папку с логами - - + + Reset wallet configuration Сбросить конфигурацию кошелька - + This will restart your wallet with default settings Эта опция перезапустит ваш кошелек с настройками по умолчанию - - + + Confirm Подтвердить - + Changing theme to %1 Изменить тему на %1 - + Disable 2FA? - + Enter your wallet password to confirm - + Type password Введите пароль - + 2FA status - + 2FA disabled successfully - - + + Ok Ок - + Wrong password! - + Wallet password is incorrect - + Application Version - + copied to clipboard скопировано в буфер - + Reset Сбросить - + Current Font Текущий шрифт - + Current font changed to %1. Текущий шрифт изменен на %1. - + Theme Тема - + Ask system's password before sending coins ? (2FA) Спрашивать системный пароль перед отправкой монет? (2FA) - + Application version Версия приложения - + MM2 version Версия MM2 - + MM2 Version Версия MM2 - + MM2 Version copied to clipboard. Версия MM2 скопирована в буфер обмена. - + Qt version Версия Qt - + Qt Version Версия Qt - + Qt Version copied to clipboard. Версия Qt скопирована в буфер обмена. - + Search Update Проверить на обновления - + Logout Выход - + View seed and private keys Показать seed-фразу и приватные ключи - - + + Show Показать - + Setup Camouflage Password Установить камуфляжный пароль - + Open Установить - + Disclaimer and ToS Дисклеймер и Условия Использования @@ -3916,62 +3929,78 @@ Network fees can vary greatly depending on your selected trading pair. - + + I see a transaction in my wallet that was marked as 'poison'. What does this mean? + + + + + Address poisoning is a relatively new tye of phishing attack, where a malicious actor aims to trick you into sending funds to an address that you did not intend to send funds to. + +This is often done by sending a zero value transaction to your wallet from an address which looks very similar to your actual address, with the exact same letters at the start and end. This transaction will then appear in your transaction history, with the scammer hoping you will mistake the fake address for your own and send funds to it. + +To protect you from this, %1 will mark any transaction that it detects as potentially being a poison transaction with a "poison" label. You should always be careful to confirm any address you send funds to is correct. + +There is a toggle in settings where you can turn on/off the display of these transactions. + + + + Do you provide user support? Предоставляете ли вы поддержку пользователей? - + Yes! %1 offers support through the <a href="%2">%1 Discord server</a>. The team and the community are always happy to help! Да! %1 предоставляет саппорт через <a href="%2">%1 Discord сервер</a>. Команда и сообщество проекта всегда рады помочь! - + Who is behind %1? Кто создал %1? - + %1 is developed by the Komodo team. Komodo is one of the most established blockchain projects working on innovative solutions like atomic swaps, Delayed Proof of Work, and an interoperable multi-chain architecture. %1 разрабатывается командой Komodo. Komodo один из наиболее известных блокчейн проектов который работает над такими инновационными решениями как Атомарные Свопы, "Отложенный" PoW, а также над совместимой мульти-чейн архитектурой. - + Is it possible to develop my own white-label exchange on %1? Возможно ли разработать децентрализованную биржу с моим брендом на %1? - + Absolutely! You can read our developer documentation for more details or contact us with your partnership inquiries. Have a specific technical question? The %1 developer community is always ready to help! Обязательно! Вы можете прочитать нашу документацию для разработчиков для более детального ревью или же связаться с нашей командой по поводу партнерства. Есть очень специфичный технический вопрос? %1 наше комьюнити разработчиков всегда готово помочь! - + Which devices can I use %1 on? На каких устройствах я могу использовать %1 ? - + %1 is available for mobile on both <a href="%2">Android and iPhone, and for desktop on Windows, Mac, and Linux</a> operating systems. %1 доступен для Android и iOS мобильных устройв <a href="%2">, и для операционных систем Windows, Mac и Linux</a> на PC. - + Compliance Info Комплаенс информация - + Due to regulatory and legal circumstances the citizens of certain jurisdictions including, but not limited to, the United States of America, Canada, Hong Kong, Israel, Singapore, Sudan, Austria, Iran and any other state, country or other jurisdiction that is embargoed by the United States of America or the European Union are not allowed to use this application. В связи с нормативными и правовыми обстоятельствами граждане определенных юрисдикций, включая, помимо прочего, Соединенные Штаты Америки, Канаду, Гонконг, Израиль, Сингапур, Судан, Австрию, Иран и любые другие государства, страны или другие юрисдикции, на которые введено эмбарго. Соединенных Штатов Америки или Европейского Союза не могут использовать это приложение. - + Changelog Журнал изменений - + Open Logs Folder Открыть папку с логами @@ -4082,32 +4111,32 @@ Network fees can vary greatly depending on your selected trading pair. От - + Entered amount must be higher than 0. - + Select an order. - + MAX МАКС - + To Получатель - + Pick an order Выберите ордер - + Price Цена @@ -4127,52 +4156,52 @@ Network fees can vary greatly depending on your selected trading pair. %1 - - Tradable: - Доступно: + + Balance: + - + Pick a coin Выберите монету - + SWAP NOW - + Failed to place the order Не удалось разместить ордер - + Placed the order Ордер размещен - + No buy orders found for %1. Не найдено ордеров на покупку дл] %1. - + You can check later or try to sell a different coin. Вы можете попробовать позже или попробовать продать другой актив. - + Calculating fee estimate... - + Total %1 fees: Всего %1 комиссий: - + %2 (%3) %2 (%3) @@ -4231,88 +4260,98 @@ Network fees can vary greatly depending on your selected trading pair. TransactionDetailsModal - + Transaction Details Детали транзакции - + + This transaction has been identified as a potential address poisoning attack. + + + + + Please see the Support FAQ for more information. + + + + %1 txid TICKER - + copied to clipboard. - + Amount Сумма - + Fees Комиссия сети - + From address - + To address - + Date Дата - + Unconfirmed Не подтверждена - + Transaction Hash Хэш транзакции - + Confirmations Подтверждения - + Block Height Блок - + From От - + To Получатель - + Notes Заметки - + Close Закрыть - + View on Explorer Смотреть в эксплорере @@ -4320,22 +4359,27 @@ Network fees can vary greatly depending on your selected trading pair. Transactions - + Received Получено - + Sent Отправлено - + + Poison + + + + fees комиссии - + Unconfirmed Не подтверждена @@ -4469,7 +4513,7 @@ This might take a few minutes... atomic_dex::settings_page - + An error has occurred. @@ -4492,47 +4536,47 @@ This might take a few minutes... Вам нужен %1 для оплаты газа за %2 транзакции. - + Checksum verification failed for %1. Checksum верфикация неуспешна для %1. - + Invalid checksum for %1. Click the button to convert to mixed case address. - + Legacy address used for %1. Click the button to convert to a Cashaddress. - + %1 address must be prefixed with 0x %1 адрес должен начинаться с 0x - + %1 address length is invalid, please use a valid address. %1 длина адреса не валидна, пожалуйста используйте валидный адрес. - + %1 address is invalid. некорректный адрес %1. - + Invalid checksum. Неверная чек-сумма. - + %1 address has invalid prefixes. у адреса %1 неверный префикс. - + Backend error: %1 Ошибка бэкенда: %1 diff --git a/atomic_defi_design/assets/languages/atomic_defi_tr.ts b/atomic_defi_design/assets/languages/atomic_defi_tr.ts index 708b7d982d..cd9be8da99 100644 --- a/atomic_defi_design/assets/languages/atomic_defi_tr.ts +++ b/atomic_defi_design/assets/languages/atomic_defi_tr.ts @@ -233,7 +233,7 @@ App - + Recover Funds Result Fon Kurtarma Sonucu @@ -315,68 +315,73 @@ Bottom - + + Add Crypto + + + + Settings Ayarlar - + Support Destek - + Privacy Gizlilik - + Disable Privacy? - + Enter wallet password to confirm - + Type password - + Confirm Onayla - + Cancel İptal - + Privacy status - + Privacy mode disabled successfully - - + + Ok Tamam - + Wrong password! - + wallet password is incorrect @@ -494,8 +499,8 @@ - Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a> - ⓘ simgesiyle işaretlenen piyasa verileri (fiyatlar, grafikler vb.) üçüncü taraf kaynaklardan alınmıştır. .<br><br>Veriler kaynakları: <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> ve <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Son referans (Band Oracle):</b><br><a href="%2">%2</a> + Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>. + ⓘ simgesiyle işaretlenen piyasa verileri (fiyatlar, grafikler vb.) üçüncü taraf kaynaklardan alınmıştır. .<br><br>Veriler kaynakları: <a href="https://coingecko.com">CoinGecko</a>. @@ -516,6 +521,14 @@ + + ClaimFaucetResultModal + + + Close + Kapat + + ClaimRewardsModal @@ -834,177 +847,177 @@ Etkinleştirilmiş koinlerin mevcut sayısı yapılandırma ayarlarınızla eşleşmiyor. Varlık yapılandırmanız sıfırlanacak. - + Matching Eşleşiyor - + Order Matching Emir Eşleşiyor - + Matched Eşleşti - + Order Matched Emir Eşleşti - + Ongoing Devam ediyor - + Swap Ongoing Takas Devam Ediyor - + Successful Başarılı - + Swap Successful Takas Başarılı - + Refunding Geri ödeniyor - + Failed Başarısız - + Swap Failed Takas Başarısız - + Unknown Bilinmiyor - + Unknown State Bilinmeyen durum - + Started Başlatıldı - + Negotiated Pazarlık yapıldı - + Taker fee sent Alıcı ücreti gönderildi - + Maker payment received Yapıcı ödemesi alındı - + Maker payment wait confirm started Yapıcı ödemesi bekleme onayı başladı - + Maker payment validated and confirmed Yapıcı ödemesi doğrulandı ve onaylandı - + Taker payment sent Alıcı ödemesi gönderildi - + Taker payment spent Alıcı ödemesi harcandı - + Maker payment spent Yapıcı ödemesi harcandı - + Finished Tamamlandı - + Start failed Başlatılamadı - + Negotiate failed Pazarlık başarısız - + Taker fee validate failed Alıcı ücreti doğrulanamadı - + Maker payment transaction failed Yapıcı ödeme işlemi başarısız - + Maker payment Data send failed Yapıcı ödeme verileri gönderilemedi - + Maker payment wait confirm failed Yapıcı ödemesi bekleme onayı başarısız - + Taker payment validate failed Alıcı ödemesi doğrulanamadı - + Taker payment wait confirm failed Alıcı ödemesi bekleme onayı başarısız oldu - + Taker payment spend failed Alıcı ödeme harcaması başarısız oldu - + Maker payment wait refund started Yapıcı ödemesi bekleme iadesi başladı - + Maker payment refunded Yapıcı ödemesi iade edildi - + Maker payment refund failed Yapıcı ödeme iadesi başarısız @@ -1389,14 +1402,14 @@ General - + %n day(s) %n gün - + %nd day @@ -1404,7 +1417,7 @@ - + %nh hours @@ -1412,7 +1425,7 @@ - + %nm minutes @@ -1420,7 +1433,7 @@ - + %ns seconds @@ -1428,7 +1441,7 @@ - + %nms milliseconds @@ -1436,117 +1449,117 @@ - + - - - + <b>Taker tx fee:</b> - + <b>Dex tx fee:</b> - + <b>Dex fee:</b> - + <b>Maker tx fee:</b> - + %1 balance is zero - + Activating %1 (%2%) - + Loading wallet... - + Min: %1 - + Enter an amount Bir miktar gir - + Trading Fee Takas Ücreti - + Minimum Trading Amount Minimum Takas Hacmi - + Wallet %1 already exists WALLETNAME %1 cüzdanı zaten mevcut - + %1 balance is lower than the fees amount: %2 %3 %1 bakiye ücret tutarının altında: %2 %3 - + Tradable (after fees) %1 balance is lower than minimum trade amount Takas edilebilir (ücretlerden sonra)%1 bakiyesi minimum işlem ücretinden düşük - + Please fill the price field Lütfen fiyat alanını doldurun - + Please fill the volume field - - + + Please wait for %1 to fully activate - - + + %1 volume is lower than minimum trade amount %1 hacmi, minimum işlem ücretinden düşük - - + + %1 needs to be enabled in order to use %2 - - + + %1 balance needs to be funded, a non-zero balance is required to pay the gas of %2 transactions - + Unknown Error Bilinmeyen Hata @@ -1845,140 +1858,115 @@ They will be removed from the orderbook until you log in again. Main - - Segwit - - - - - Confirmation - - - - - Do you want to send your %1 funds to %2 wallet first? - - - - - Success - - - - - Your transaction is send, may take some time to arrive - - - - + Price Fiyat - + Change 24hr - + Contract Address - + Send Gönder - + Enable %1 ? %1 Etkinleştirilsin mi ? - + Yes Evet - + No Hayır - + Receive Al - + Swap Takasla - + Portfolio - + is wallet only - + Rewards - + Faucet Musluk - - - + + + Public Key - + Copied to Clipboard Panoya Kopyalandı - + Loading market data Piyasa bilgisi yükleniyor - + There is no chart data for this ticker yet Henüz bu hisse senedi için grafik verisi yok - + Fetching transactions... - + Please wait, %1 is %2 - + % activated... - + No transactions available - + Click to view your address on %1 (%2) block explorer @@ -2435,6 +2423,11 @@ They will be removed from the orderbook until you log in again. Your wallet balance changed Cüzdan bakiyeniz değişti + + + Close + Kapat + %1 Enable status @@ -2454,49 +2447,49 @@ They will be removed from the orderbook until you log in again. - + Failed to disable %1 TICKER - + Endpoint not reachable Uç nokta ulaşılabilir değil - + Could not reach to endpoint Uç noktaya ulaşılamadı - + Show Göster - + Restart Yeniden Başlat - + Quit Çık - + Notifications - + There aren't any notifications - + Mark all as read @@ -2946,12 +2939,12 @@ Please select a new order. ProView - + Failed to place the order Emir başarısız oldu - + Placed the order Emir başarılı @@ -3136,162 +3129,172 @@ Please select a new order. SendModal - + Failed to send Gönderilemedi - + Prepare to send Göndermeye hazırlanıyor - + Address of the recipient - + Amount to send - + Gas price - + Cancel İptal - + Recipient's address Alıcı adresi - + The address has to be mixed case. Adres, büyük-küçük harf karışık olmalıdır. - + Failed to Broadcast - + Fix Düzelt - + MAX MAKS - + Fiat amount: Unavailable - + Fiat amount: %1 - + %1 amount: %2 - + Specify in Fiat - + Specify in Crypto - + + Enter memo + + + + Enable Custom Fees Özel İşlem Ücretlerini Etkinleştir - + Enter the custom fee Özel ücreti giriniz - + Gas Limit Gas Limiti - + Custom Fee can't be higher than the amount Özel İşlem Ücreti takas miktarından daha yüksek olamaz - + Not enough funds. Yetersiz bakiye. - - + + You have %1 AMT TICKER %1'niz var - - + + Only use custom fees if you know what you are doing! - + Prepare Hazırla - - + + Send Gönder - + %1 address TICKER - + copied to clipboard. - + Amount Miktar - + + Memo + + + + Fees İşlem Ücreti - + Date Tarih - + Back Geri @@ -3377,11 +3380,16 @@ Please select a new order. + Memo + + + + Fees İşlem Ücreti - + Date Tarih @@ -3391,12 +3399,12 @@ Please select a new order. İşlem Hash'i - + Close Kapat - + View on Explorer Explorer'da göster @@ -3404,8 +3412,8 @@ Please select a new order. SettingModal - - + + Cancel İptal @@ -3440,191 +3448,196 @@ Please select a new order. - + Enable Desktop Notifications Masaüstü Bildirimlerini Aktif Et - + + Hide Poison Transactions in History + + + + Maximum number of enabled coins Maksimum etkin koin sayısı - + Logs Günlük Kaydı - + Open Folder Klasörü Aç - - + + Reset wallet configuration - + This will restart your wallet with default settings - - + + Confirm Onayla - + Changing theme to %1 - + Disable 2FA? - + Enter your wallet password to confirm - + Type password - + 2FA status - + 2FA disabled successfully - - + + Ok Tamam - + Wrong password! - + Wallet password is incorrect - + Application Version - + copied to clipboard - + Reset Sıfırla - + Current Font Geçerli Yazı Tipi - + Current font changed to %1. - + Theme Tema - + Ask system's password before sending coins ? (2FA) Para göndermeden önce sistem parolası sorulsun mu ? (2FA) - + Application version Uygulama sürümü - + MM2 version MM2 sürümü - + MM2 Version - + MM2 Version copied to clipboard. - + Qt version Qt sürümü - + Qt Version - + Qt Version copied to clipboard. - + Search Update Güncelleme Ara - + Logout Çıkış - + View seed and private keys Seed ve özel anahtarları görüntüle - - + + Show Göster - + Setup Camouflage Password Kamuflaj Parolasını Ayarla - + Open - + Disclaimer and ToS Sorumluluk Reddi ve K.Ş. @@ -3904,62 +3917,78 @@ Network fees can vary greatly depending on your selected trading pair. - + + I see a transaction in my wallet that was marked as 'poison'. What does this mean? + + + + + Address poisoning is a relatively new tye of phishing attack, where a malicious actor aims to trick you into sending funds to an address that you did not intend to send funds to. + +This is often done by sending a zero value transaction to your wallet from an address which looks very similar to your actual address, with the exact same letters at the start and end. This transaction will then appear in your transaction history, with the scammer hoping you will mistake the fake address for your own and send funds to it. + +To protect you from this, %1 will mark any transaction that it detects as potentially being a poison transaction with a "poison" label. You should always be careful to confirm any address you send funds to is correct. + +There is a toggle in settings where you can turn on/off the display of these transactions. + + + + Do you provide user support? Kullanıcı desteği sağlıyor musunuz? - + Yes! %1 offers support through the <a href="%2">%1 Discord server</a>. The team and the community are always happy to help! - + Who is behind %1? %1 arkasında kim var? - + %1 is developed by the Komodo team. Komodo is one of the most established blockchain projects working on innovative solutions like atomic swaps, Delayed Proof of Work, and an interoperable multi-chain architecture. %1, Komodo ekibi tarafından geliştirilmiştir. Komodo, atomik takaslar, Gecikmeli Çalışma Kanıtı ve birlikte çalışabilir bir çok zincirli mimari gibi yenilikçi çözümler üzerinde çalışan en köklü blok zinciri projelerinden biridir. - + Is it possible to develop my own white-label exchange on %1? %1 üzerinde kendi markamla borsamı geliştirmem mümkün mü? - + Absolutely! You can read our developer documentation for more details or contact us with your partnership inquiries. Have a specific technical question? The %1 developer community is always ready to help! Kesinlikle! Daha fazla ayrıntı için geliştirici belgelerimizi okuyabilir veya ortaklık sorularınız için bizimle iletişime geçebilirsiniz. Belirli bir teknik sorunuz mu var? %1 geliştirici topluluğu her zaman yardıma hazır! - + Which devices can I use %1 on? %1 'i hangi cihazlarda kullanabilirim? - + %1 is available for mobile on both <a href="%2">Android and iPhone, and for desktop on Windows, Mac, and Linux</a> operating systems. - + Compliance Info Uyumluluk Bilgisi - + Due to regulatory and legal circumstances the citizens of certain jurisdictions including, but not limited to, the United States of America, Canada, Hong Kong, Israel, Singapore, Sudan, Austria, Iran and any other state, country or other jurisdiction that is embargoed by the United States of America or the European Union are not allowed to use this application. Düzenleyici ve yasal koşullar nedeniyle, Amerika Birleşik Devletleri, Kanada, Hong Kong, İsrail, Singapur, Sudan, Avusturya, İran ve Amerika Birleşik Devletleri veya Avrupa Birliği tarafından ambargo uygulanan diğer herhangi bir eyalet, ülke veya diğer bölge vatandaşlarının bu uygulamayı kullanmasına izin verilmez. - + Changelog Değişim günlüğü - + Open Logs Folder Günlük Kaydı Klasörünü Aç @@ -4070,32 +4099,32 @@ Network fees can vary greatly depending on your selected trading pair. Gönderen - + Entered amount must be higher than 0. - + Select an order. - + MAX MAKS - + To Alan - + Pick an order Emri seç - + Price Fiyat @@ -4115,52 +4144,52 @@ Network fees can vary greatly depending on your selected trading pair. %1 - - Tradable: - Al sat yapılabilir: + + Balance: + - + Pick a coin - + SWAP NOW - + Failed to place the order Emir başarısız oldu - + Placed the order Emir başarılı - + No buy orders found for %1. - + You can check later or try to sell a different coin. - + Calculating fee estimate... - + Total %1 fees: Toplam %1 işlem giderleri: - + %2 (%3) %2 (%3) @@ -4219,88 +4248,98 @@ Network fees can vary greatly depending on your selected trading pair. TransactionDetailsModal - + Transaction Details İşlem Detayları - + + This transaction has been identified as a potential address poisoning attack. + + + + + Please see the Support FAQ for more information. + + + + %1 txid TICKER - + copied to clipboard. - + Amount Miktar - + Fees İşlem Ücreti - + From address - + To address - + Date Tarih - + Unconfirmed Onaylanmamış - + Transaction Hash İşlem Hash'i - + Confirmations Onay Sayısı - + Block Height Blok Uzunluğu - + From Gönderen - + To Alan - + Notes Notlar - + Close Kapat - + View on Explorer Explorer'da göster @@ -4308,22 +4347,27 @@ Network fees can vary greatly depending on your selected trading pair. Transactions - + Received Alınan - + Sent Gönderilen - + + Poison + + + + fees işlem ücretleri - + Unconfirmed Onaylanmamış @@ -4457,7 +4501,7 @@ This might take a few minutes... atomic_dex::settings_page - + An error has occurred. @@ -4480,47 +4524,47 @@ This might take a few minutes... %2 işlemi için gaz ödemek üzere %1'e sahip olmanız gerekir. - + Checksum verification failed for %1. %1 için sağlama toplamı doğrulaması başarısız oldu. - + Invalid checksum for %1. Click the button to convert to mixed case address. - + Legacy address used for %1. Click the button to convert to a Cashaddress. - + %1 address must be prefixed with 0x %1 adresinin önüne 0x konulmalı - + %1 address length is invalid, please use a valid address. %1 adres uzunluğu geçersiz, lütfen geçerli bir adres kullanın. - + %1 address is invalid. - + Invalid checksum. - + %1 address has invalid prefixes. - + Backend error: %1 diff --git a/atomic_defi_design/assets/languages/translations_matrix.csv b/atomic_defi_design/assets/languages/translations_matrix.csv index 37a934e80a..0960cf64dc 100644 --- a/atomic_defi_design/assets/languages/translations_matrix.csv +++ b/atomic_defi_design/assets/languages/translations_matrix.csv @@ -90,7 +90,7 @@ 474,Dex/Sidebar/Center.qml,,475,Address Book,476,Adressbuch,Libreta de direcciones,, 479,Dex/Sidebar/Center.qml,,480,Fiat,481,Fiat,Fiat,, 487,Dex/Components/CexInfoModal.qml,,488,Market Data,489,Marktdaten,Data de Mercado,, -492,Dex/Components/CexInfoModal.qml,,493,"Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a>",494,"Mit dem Symbol ⓘ gekennzeichnete Marktdaten (Kurse, Charts etc.) stammen aus Drittquellen.<br><br>Die Daten stammen von <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> und <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle unterstützte Paare:</b><br>%1<br><br><b>Letzte Referenz (Band Oracle):</b><br><a href="%2">%2</a>","Datos de mercado (precios, estadisticas, etc.) marcados con ⓘ se obtienen a través de fuentes terceras.<br><br>Data is sourced via <a href="https://bandprotocol.com/">Band Decentralized Oracle</a> and <a href="https://coingecko.com">CoinGecko</a>.<br><br><b>Oracle Supported Pairs:</b><br>%1<br><br><b>Last reference (Band Oracle):</b><br><a href="%2">%2</a>",, +492,Dex/Components/CexInfoModal.qml,,493,"Market data (prices, charts, etc.) marked with the ⓘ icon originates from third-party sources.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>.",494,"Mit dem Symbol ⓘ gekennzeichnete Marktdaten (Kurse, Charts etc.) stammen aus Drittquellen.<br><br>Die Daten stammen von <a href="https://coingecko.com">CoinGecko</a>.","Datos de mercado (precios, estadisticas, etc.) marcados con ⓘ se obtienen a través de fuentes terceras.<br><br>Data is sourced via <a href="https://coingecko.com">CoinGecko</a>.",, 500,Dex/Exchange/ProView/Chart.qml,,501,Loading market data,502,Laden von Marktdaten,Cargando datos de mercado,, 505,Dex/Exchange/ProView/Chart.qml,,506,There is no chart data for this pair yet,507,Für dieses Paar liegen noch keine Chartdaten vor,Todavía no hay datos de gráficos para este par,, 513,Dex/Wallet/ClaimRewardsModal.qml,,514,Failed to prepare to claim rewards,515,Vorbereitung zum Einfordern von Belohnungen fehlgeschlagen,No se pudo preparar para reclamar recompensas,, diff --git a/ci_tools_atomic_dex/ci_scripts/windows_script.ps1 b/ci_tools_atomic_dex/ci_scripts/windows_script.ps1 index 643323683c..e22db59635 100644 --- a/ci_tools_atomic_dex/ci_scripts/windows_script.ps1 +++ b/ci_tools_atomic_dex/ci_scripts/windows_script.ps1 @@ -6,7 +6,7 @@ iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/insta #Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') -RunAsAdmin scoop install llvm --global scoop install ninja --global -scoop install cmake@3.22.0 --global +scoop install cmake@3.26.3 --global scoop install git --global scoop install 7zip --global scoop cache rm 7zip diff --git a/ci_tools_atomic_dex/installer/osx/config/config.xml.in b/ci_tools_atomic_dex/installer/osx/config/config.xml.in index 838e6f170d..3662ef3bc5 100644 --- a/ci_tools_atomic_dex/installer/osx/config/config.xml.in +++ b/ci_tools_atomic_dex/installer/osx/config/config.xml.in @@ -1,7 +1,7 @@ ${DEX_DISPLAY_NAME} - 0.5.7.2 + @DEX_VERSION@ ${DEX_DISPLAY_NAME} Installer ${DEX_WEBSITE} ${DEX_COMPANY} diff --git a/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in b/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in index 57bb3278f8..a9487a11ad 100644 --- a/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in +++ b/ci_tools_atomic_dex/installer/osx/packages/com.komodoplatform.atomicdex/meta/package.xml.in @@ -2,8 +2,8 @@ ${DEX_DISPLAY_NAME} Install ${DEX_DISPLAY_NAME}. - 0.5.7.2 - 2023-03-04 + ${DEX_VERSION} + 2023-11-06 diff --git a/ci_tools_atomic_dex/installer/windows/config/config.xml.in b/ci_tools_atomic_dex/installer/windows/config/config.xml.in index 886bb6f594..bf4f0848fa 100644 --- a/ci_tools_atomic_dex/installer/windows/config/config.xml.in +++ b/ci_tools_atomic_dex/installer/windows/config/config.xml.in @@ -1,7 +1,7 @@ @DEX_DISPLAY_NAME@ - 0.5.7.2 + @DEX_VERSION@ @DEX_DISPLAY_NAME@ Installer @DEX_WEBSITE@ @DEX_COMPANY@ diff --git a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/installscript.qs.in b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/installscript.qs.in index 204713cb6d..106dd0af5e 100644 --- a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/installscript.qs.in +++ b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/installscript.qs.in @@ -1,12 +1,12 @@ function Component() { - -} + // installer.gainAdminRights(); + component.loaded.connect(this, this.installerLoaded); +} Component.prototype.createOperations = function() { component.createOperations(); - if (installer.value("os") === "win") { // Start Menu Shortcut component.addOperation("CreateShortcut", @@ -32,4 +32,48 @@ Component.prototype.createOperations = function() "iconPath=@DEX_ICON_DIR@", "iconId=0", "description=Start @DEX_MAINTENANCE_TOOL_NAME@"); } +} + +Component.prototype.installerLoaded = function() +{ + installer.setDefaultPageVisible(QInstaller.TargetDirectory, false); + installer.addWizardPage(component, "TargetWidget", QInstaller.TargetDirectory); + + targetDirectoryPage = gui.pageWidgetByObjectName("DynamicTargetWidget"); + targetDirectoryPage.windowTitle = "Choose Installation Directory"; + targetDirectoryPage.description.setText("Please select where the app will be installed:"); + targetDirectoryPage.targetDirectory.textChanged.connect(this, this.targetDirectoryChanged); + targetDirectoryPage.targetDirectory.setText(installer.value("TargetDir")); + targetDirectoryPage.targetChooser.released.connect(this, this.targetChooserClicked); + + gui.pageById(QInstaller.ComponentSelection).entered.connect(this, this.componentSelectionPageEntered); +} + +Component.prototype.targetChooserClicked = function() +{ + var dir = QFileDialog.getExistingDirectory("", targetDirectoryPage.targetDirectory.text); + targetDirectoryPage.targetDirectory.setText(dir); +} + +Component.prototype.targetDirectoryChanged = function() +{ + var dir = targetDirectoryPage.targetDirectory.text; + if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) { + targetDirectoryPage.warning.setText("

Existing installation detected and will be overwritten.

"); + } + else if (installer.fileExists(dir)) { + targetDirectoryPage.warning.setText("

Installing in existing directory. It will be wiped on uninstallation.

"); + } + else { + targetDirectoryPage.warning.setText(""); + } + installer.setValue("TargetDir", dir); +} + +Component.prototype.componentSelectionPageEntered = function() +{ + var dir = installer.value("TargetDir"); + if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) { + installer.execute(dir + "/maintenancetool.exe", ["purge", "-c"]); + } } \ No newline at end of file diff --git a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in index 57bb3278f8..090e2c430f 100644 --- a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in +++ b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/package.xml.in @@ -2,11 +2,14 @@ ${DEX_DISPLAY_NAME} Install ${DEX_DISPLAY_NAME}. - 0.5.7.2 - 2023-03-04 + ${DEX_VERSION} + 2023-11-06 true + + targetwidget.ui + diff --git a/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/targetwidget.ui b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/targetwidget.ui new file mode 100644 index 0000000000..6237332046 --- /dev/null +++ b/ci_tools_atomic_dex/installer/windows/packages/com.komodoplatform.atomicdex/meta/targetwidget.ui @@ -0,0 +1,113 @@ + + + TargetWidget + + + + 0 + 0 + 491 + 190 + + + + + 0 + 0 + + + + + 491 + 190 + + + + Form + + + + + + + + + + + + + + + true + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + ... + + + + + + + + + 0 + + + + + true + + + TextLabel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 122 + + + + + + + + + \ No newline at end of file diff --git a/cmake/install/macos/dex_install.cmake b/cmake/install/macos/dex_install.cmake index 7eb09e6edd..8b27af7e9b 100644 --- a/cmake/install/macos/dex_install.cmake +++ b/cmake/install/macos/dex_install.cmake @@ -1,11 +1,13 @@ if (APPLE) message(STATUS "ICON ->>>> ${ICON}") + message(STATUS "PROJECT_NAME ->>>> ${PROJECT_NAME}") + message(STATUS "DEX_VERSION ->>>> ${DEX_VERSION}") set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}" RESOURCE ${ICON} MACOSX_BUNDLE_ICON_FILE dex-logo - MACOSX_BUNDLE_SHORT_VERSION_STRING 0.5.7.2 - MACOSX_BUNDLE_LONG_VERSION_STRING 0.5.7.2 + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION} + MACOSX_BUNDLE_LONG_VERSION_STRING ${PROJECT_VERSION} MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND diff --git a/cmake/project.metadata.cmake b/cmake/project.metadata.cmake index ba3ba0ee1b..52fa2fe95c 100644 --- a/cmake/project.metadata.cmake +++ b/cmake/project.metadata.cmake @@ -7,6 +7,7 @@ set(DEX_DISPLAY_NAME "AtomicDEX Desktop") set(DEX_MAINTENANCE_TOOL_NAME "AtomicDEX Maintenance Tool") set(DEX_COMPANY "KomodoPlatform") set(DEX_WEBSITE "https://atomicdex.io/") +set(DEX_VERSION "0.5.8") set(DEX_SUPPORT_PAGE "https://support.komodoplatform.com/support/home") set(DEX_DISCORD "https://komodoplatform.com/discord") set(DEX_TWITTER "https://twitter.com/AtomicDEX") @@ -15,7 +16,7 @@ set(DEX_SECOND_PRIMARY_COIN "KMD") option(DISABLE_GEOBLOCKING "Enable to disable geoblocking (for dev purpose)" OFF) set(DEX_REPOSITORY_OWNER ${DEX_COMPANY}) set(DEX_REPOSITORY_NAME "atomicDEX-Desktop") -set(DEX_CHECKSUM_API_URL "https://komodo.live/static/checksum.json") +set(DEX_CHECKSUM_API_URL "https://komodo.earth/static/checksum.json") if (APPLE) set(DEX_APPDATA_FOLDER "AtomicDex Desktop") else () @@ -47,6 +48,9 @@ endif () if (DEFINED ENV{DEX_WEBSITE}) set(DEX_WEBSITE $ENV{DEX_WEBSITE}) endif () +if (DEFINED ENV{DEX_VERSION}) + set(DEX_VERSION $ENV{DEX_VERSION}) +endif () if (DEFINED ENV{PROJECT_ROOT}) set(PROJECT_ROOT $ENV{PROJECT_ROOT}) else () @@ -67,6 +71,7 @@ message(STATUS "CMAKE_BUILD_TYPE --> ${CMAKE_BUILD_TYPE}") message(STATUS "DEX_PROJECT_NAME --> ${DEX_PROJECT_NAME}") message(STATUS "DEX_DISPLAY_NAME --> ${DEX_DISPLAY_NAME}") message(STATUS "DEX_COMPANY --> ${DEX_COMPANY}") +message(STATUS "DEX_VERSION --> ${DEX_VERSION}") message(STATUS "DEX_WEBSITE --> ${DEX_WEBSITE}") message(STATUS "CMAKE_SOURCE_DIR --> ${CMAKE_SOURCE_DIR}") message(STATUS "PROJECT_ROOT --> ${PROJECT_ROOT}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 531c27e8d6..5d33a981a0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,7 +17,7 @@ DEX_NEW_LIB(core INTERFACE DEX_API="${DEX_API}" DEX_RPC="${DEX_RPC}" DEX_RPCPORT="${DEX_RPCPORT}" DEX_NAME="${DEX_DISPLAY_NAME}" DEX_WEBSITE_URL="${DEX_WEBSITE}" DEX_SUPPORT_URL="${DEX_SUPPORT_PAGE}" DEX_DISCORD_URL="${DEX_DISCORD}" DEX_TWITTER_URL="${DEX_TWITTER}" DEX_PRIMARY_COIN="${DEX_PRIMARY_COIN}" DEX_SECOND_PRIMARY_COIN="${DEX_SECOND_PRIMARY_COIN}" #DEX_COMMON_DATA_FOLDER="${DEX_COMMON_DATA_FOLDER}" - DEX_PROJECT_NAME="${DEX_PROJECT_NAME}" DEX_COMPANY_NAME="${DEX_COMPANY_NAME}" + DEX_PROJECT_NAME="${DEX_PROJECT_NAME}" DEX_COMPANY_NAME="${DEX_COMPANY_NAME}" DEX_VERSION="${DEX_VERSION}" DEX_REPOSITORY_OWNER="${DEX_REPOSITORY_OWNER}" DEX_REPOSITORY_NAME="${DEX_REPOSITORY_NAME}" DEX_CHECKSUM_API_URL="${DEX_CHECKSUM_API_URL}" DEX_APPDATA_FOLDER="${DEX_APPDATA_FOLDER}" INTERFACE_DEFS diff --git a/src/app/app.cpp b/src/app/app.cpp index 08b233e43b..d7cd93d9a7 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -44,7 +44,6 @@ #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/oracle/band.provider.hpp" #include "atomicdex/services/price/orderbook.scanner.service.hpp" namespace @@ -181,6 +180,8 @@ namespace atomic_dex bool application::has_coins_with_balance() { + // TODO: Does this ignore test coins? + // Simple view on fresh wallet with only test coins from faucet returns `no tradable assets` auto* portfolio_page = get_portfolio_page(); auto* portfolio_mdl = portfolio_page->get_portfolio(); auto portfolio_data = portfolio_mdl->get_underlying_data(); @@ -499,8 +500,7 @@ namespace atomic_dex system_manager_.create_system(system_manager_, this); system_manager_.create_system(system_manager_, settings_page_system.get_cfg()); system_manager_.create_system(system_manager_); - system_manager_.create_system(); - // 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(); diff --git a/src/core/atomicdex/api/faucet/faucet.cpp b/src/core/atomicdex/api/faucet/faucet.cpp index 2fb699ceb1..06e2e44cb3 100644 --- a/src/core/atomicdex/api/faucet/faucet.cpp +++ b/src/core/atomicdex/api/faucet/faucet.cpp @@ -23,7 +23,7 @@ namespace { - constexpr const char* g_faucet_api_endpoint = "https://faucet.komodo.live/faucet/"; + constexpr const char* g_faucet_api_endpoint = "https://faucet.komodo.earth/faucet/"; const auto g_faucet_api_client = std::make_unique(FROM_STD_STR(g_faucet_api_endpoint)); } // namespace diff --git a/src/core/atomicdex/api/komodo_prices/komodo.prices.cpp b/src/core/atomicdex/api/komodo_prices/komodo.prices.cpp index e596de60c7..02bd2b109a 100644 --- a/src/core/atomicdex/api/komodo_prices/komodo.prices.cpp +++ b/src/core/atomicdex/api/komodo_prices/komodo.prices.cpp @@ -10,7 +10,7 @@ namespace { - constexpr const char* g_komodo_prices_endpoint = "https://prices.komodo.live:1313"; + constexpr const char* g_komodo_prices_endpoint = "https://prices.komodo.earth:1313"; constexpr const char* g_komodo_prices_endpoint_fallback = "https://prices.cipig.net:1717"; web::http::client::http_client_config g_komodo_prices_cfg{[]() diff --git a/src/core/atomicdex/api/mm2/enable_slp_rpc.cpp b/src/core/atomicdex/api/mm2/enable_slp_rpc.cpp index 314005d743..82f1524d94 100644 --- a/src/core/atomicdex/api/mm2/enable_slp_rpc.cpp +++ b/src/core/atomicdex/api/mm2/enable_slp_rpc.cpp @@ -19,7 +19,6 @@ namespace atomic_dex::mm2 void from_json(const nlohmann::json& j, enable_slp_rpc_result& in) { - j.at("token_id").get_to(in.token_id); j.at("platform_coin").get_to(in.platform_coin); j.at("required_confirmations").get_to(in.required_confirmations); j.at("token_id").get_to(in.token_id); diff --git a/src/core/atomicdex/api/mm2/mm2.client.cpp b/src/core/atomicdex/api/mm2/mm2.client.cpp index 93d2bf52ad..d2190d63c4 100644 --- a/src/core/atomicdex/api/mm2/mm2.client.cpp +++ b/src/core/atomicdex/api/mm2/mm2.client.cpp @@ -28,6 +28,8 @@ #include "atomicdex/constants/dex.constants.hpp" #include "rpc.hpp" #include "rpc.tx.history.hpp" +#include "rpc2.enable_tendermint_token.hpp" +#include "rpc2.enable_tendermint_with_assets.hpp" namespace { @@ -160,6 +162,8 @@ namespace atomic_dex::mm2 template void mm2_client::process_rpc_async(const std::function&); template void mm2_client::process_rpc_async(const std::function&); template void mm2_client::process_rpc_async(const std::function&); + template void mm2_client::process_rpc_async(const std::function&); + template void mm2_client::process_rpc_async(const std::function&); template void mm2_client::process_rpc_async(const std::function&); template void mm2_client::process_rpc_async(const std::function&); @@ -192,11 +196,11 @@ namespace atomic_dex::mm2 template TAnswer - mm2_client::process_rpc(TRequest&& request, std::string rpc_command) + mm2_client::process_rpc(TRequest&& request, std::string rpc_command, bool is_v2) { SPDLOG_DEBUG("Processing rpc call: {}", rpc_command); - nlohmann::json json_data = mm2::template_request(rpc_command); + nlohmann::json json_data = mm2::template_request(rpc_command, is_v2); mm2::to_json(json_data, request); @@ -211,6 +215,12 @@ namespace atomic_dex::mm2 return rpc_process_answer(resp, rpc_command); } + t_enable_z_coin_cancel_answer + mm2_client::rpc_enable_z_coin_cancel(t_enable_z_coin_cancel_request&& request) + { + return process_rpc(std::forward(request), "task::enable_z_coin::cancel", true); + } + t_disable_coin_answer mm2_client::rpc_disable_coin(t_disable_coin_request&& request) { diff --git a/src/core/atomicdex/api/mm2/mm2.client.hpp b/src/core/atomicdex/api/mm2/mm2.client.hpp index 22f9a94c89..26a6b92672 100644 --- a/src/core/atomicdex/api/mm2/mm2.client.hpp +++ b/src/core/atomicdex/api/mm2/mm2.client.hpp @@ -11,6 +11,7 @@ #include "rpc.disable.hpp" #include "rpc.recover.funds.hpp" #include "rpc.hpp" +#include "rpc2.task.enable_z_coin.cancel.hpp" namespace atomic_dex::mm2 { @@ -35,12 +36,13 @@ namespace atomic_dex::mm2 //! Synced template - TAnswer process_rpc(TRequest&& request, std::string rpc_command); + TAnswer process_rpc(TRequest&& request, std::string rpc_command, bool is_v2 = false); template RpcReturnType rpc_process_answer(const web::http::http_response& resp, const std::string& rpc_command); - t_disable_coin_answer rpc_disable_coin(t_disable_coin_request&& request); - t_recover_funds_of_swap_answer rpc_recover_funds(t_recover_funds_of_swap_request&& request); + t_disable_coin_answer rpc_disable_coin(t_disable_coin_request&& request); + t_recover_funds_of_swap_answer rpc_recover_funds(t_recover_funds_of_swap_request&& request); + t_enable_z_coin_cancel_answer rpc_enable_z_coin_cancel(t_enable_z_coin_cancel_request&& request); }; } // namespace atomic_dex \ No newline at end of file diff --git a/src/core/atomicdex/api/mm2/mm2.cpp b/src/core/atomicdex/api/mm2/mm2.cpp index d889bd07d1..4f8baa3321 100644 --- a/src/core/atomicdex/api/mm2/mm2.cpp +++ b/src/core/atomicdex/api/mm2/mm2.cpp @@ -26,8 +26,8 @@ #include "atomicdex/api/mm2/rpc.recover.funds.hpp" #include "atomicdex/api/mm2/rpc.trade.preimage.hpp" #include "atomicdex/api/mm2/rpc.validate.address.hpp" -#include "atomicdex/api/mm2/rpc.withdraw.hpp" -#include "atomicdex/api/mm2/rpc2.withdraw_status.hpp" +#include "atomicdex/api/mm2/rpc2.withdraw.hpp" +#include "atomicdex/api/mm2/rpc2.task.withdraw.status.hpp" #include "atomicdex/api/mm2/rpc.recover.funds.hpp" #include "atomicdex/pages/qt.settings.page.hpp" #include "atomicdex/services/price/global.provider.hpp" diff --git a/src/core/atomicdex/api/mm2/mm2.hpp b/src/core/atomicdex/api/mm2/mm2.hpp index ae8c9f170d..4c55afafe8 100644 --- a/src/core/atomicdex/api/mm2/mm2.hpp +++ b/src/core/atomicdex/api/mm2/mm2.hpp @@ -34,7 +34,7 @@ namespace ag = antara::gaming; namespace atomic_dex::mm2 { - inline constexpr const char* g_etherscan_proxy_endpoint = "https://komodo.live:3334"; + inline constexpr const char* g_etherscan_proxy_endpoint = "https://komodo.earth:3334"; inline std::unique_ptr g_etherscan_proxy_http_client{ std::make_unique(FROM_STD_STR(g_etherscan_proxy_endpoint))}; inline std::unique_ptr g_qtum_proxy_http_client{ diff --git a/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp b/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp index 7c066603fd..0da85f01c7 100644 --- a/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp +++ b/src/core/atomicdex/api/mm2/orderbook.order.contents.cpp @@ -32,6 +32,15 @@ namespace atomic_dex::mm2 { j.at("coin").get_to(contents.coin); + if (contents.coin.find("-segwit") != std::string::npos) + { + std::string uuid = j["uuid"]; + contents.uuid = uuid + "-segwit"; + } + else + { + j.at("uuid").get_to(contents.uuid); + } if (j.at("address").contains("address_data")) { j.at("address").at("address_data").get_to(contents.address); @@ -40,9 +49,7 @@ namespace atomic_dex::mm2 { contents.address = "Shielded"; } - j.at("pubkey").get_to(contents.pubkey); - j.at("uuid").get_to(contents.uuid); j.at("is_mine").get_to(contents.is_mine); j.at("price").at("decimal").get_to(contents.price); diff --git a/src/core/atomicdex/api/mm2/rpc.electrum.cpp b/src/core/atomicdex/api/mm2/rpc.electrum.cpp index dfea39b95b..9ac193efba 100644 --- a/src/core/atomicdex/api/mm2/rpc.electrum.cpp +++ b/src/core/atomicdex/api/mm2/rpc.electrum.cpp @@ -37,8 +37,14 @@ namespace atomic_dex::mm2 if (cfg.coin_type == CoinType::QRC20) { - j["swap_contract_address"] = cfg.is_testnet ? cfg.testnet_qrc_swap_contract_address : cfg.mainnet_qrc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.testnet_fallback_qrc_swap_contract_address : cfg.mainnet_fallback_qrc_swap_contract_address; + if (cfg.swap_contract_address.has_value()) + { + j["swap_contract_address"] = cfg.swap_contract_address.value(); + } + if (cfg.fallback_swap_contract_address.has_value()) + { + j["fallback_swap_contract_address"] = cfg.fallback_swap_contract_address.value(); + } } if (cfg.bchd_urls.has_value()) { diff --git a/src/core/atomicdex/api/mm2/rpc.electrum.hpp b/src/core/atomicdex/api/mm2/rpc.electrum.hpp index 1960e56ec3..86dc73d6ac 100644 --- a/src/core/atomicdex/api/mm2/rpc.electrum.hpp +++ b/src/core/atomicdex/api/mm2/rpc.electrum.hpp @@ -32,14 +32,12 @@ namespace atomic_dex::mm2 CoinType coin_type; bool is_testnet{false}; bool with_tx_history{true}; - const std::string testnet_qrc_swap_contract_address{"0xba8b71f3544b93e2f681f996da519a98ace0107a"}; - const std::string testnet_fallback_qrc_swap_contract_address{testnet_qrc_swap_contract_address}; - const std::string mainnet_qrc_swap_contract_address{"0x2f754733acd6d753731c00fee32cb484551cc15d"}; - const std::string mainnet_fallback_qrc_swap_contract_address{mainnet_qrc_swap_contract_address}; + std::optional swap_contract_address{std::nullopt}; + std::optional fallback_swap_contract_address{std::nullopt}; std::optional address_format; std::optional merge_params; - std::optional> bchd_urls; - std::optional allow_slp_unsafe_conf; + std::optional> bchd_urls; + std::optional allow_slp_unsafe_conf; }; struct electrum_answer diff --git a/src/core/atomicdex/api/mm2/rpc.enable.cpp b/src/core/atomicdex/api/mm2/rpc.enable.cpp index 0722bb9c23..a553a8c85b 100644 --- a/src/core/atomicdex/api/mm2/rpc.enable.cpp +++ b/src/core/atomicdex/api/mm2/rpc.enable.cpp @@ -28,125 +28,40 @@ namespace atomic_dex::mm2 to_json(nlohmann::json& j, const enable_request& cfg) { j["coin"] = cfg.coin_name; - switch (cfg.coin_type) { case CoinType::ERC20: { j["gas_station_url"] = cfg.gas_station_url; - j["urls"] = cfg.urls; - j["swap_contract_address"] = cfg.is_testnet ? cfg.erc_testnet_swap_contract_address : cfg.erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.erc_testnet_fallback_swap_contract_address : cfg.erc_fallback_swap_contract_address; - break; } case CoinType::Matic: { - j["gas_station_url"] = cfg.is_testnet ? cfg.testnet_matic_gas_station_url : cfg.matic_gas_station_url; - j["gas_station_decimals"] = cfg.matic_gas_station_decimals; - j["urls"] = cfg.urls; - j["swap_contract_address"] = cfg.is_testnet ? cfg.matic_erc_testnet_swap_contract_address : cfg.matic_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.matic_erc_testnet_fallback_swap_contract_address : cfg.matic_erc_fallback_swap_contract_address; - break; - } - case CoinType::Optimism: - { - j["urls"] = cfg.urls; - j["swap_contract_address"] = cfg.optimism_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.optimism_erc_fallback_swap_contract_address; - break; - } - case CoinType::Arbitrum: - { - j["urls"] = cfg.urls; - j["swap_contract_address"] = cfg.arbitrum_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.arbitrum_erc_fallback_swap_contract_address; - break; - } - case CoinType::BEP20: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.bnb_testnet_swap_contract_address : cfg.bnb_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.bnb_testnet_fallback_swap_contract_address : cfg.bnb_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::AVX20: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.avax_erc_testnet_swap_contract_address : cfg.avax_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.avax_erc_testnet_fallback_swap_contract_address : cfg.avax_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::FTM20: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.ftm_erc_testnet_swap_contract_address : cfg.ftm_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.ftm_erc_testnet_fallback_swap_contract_address : cfg.ftm_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::HRC20: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.one_erc_testnet_swap_contract_address : cfg.one_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.one_erc_testnet_fallback_swap_contract_address : cfg.one_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::Ubiq: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.ubiq_erc_testnet_swap_contract_address : cfg.ubiq_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.ubiq_erc_testnet_fallback_swap_contract_address : cfg.ubiq_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::KRC20: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.krc_erc_testnet_swap_contract_address : cfg.krc_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.krc_erc_testnet_fallback_swap_contract_address : cfg.krc_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::Moonriver: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.movr_erc_testnet_swap_contract_address : cfg.movr_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.movr_erc_testnet_fallback_swap_contract_address : cfg.movr_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::Moonbeam: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.glmr_erc_testnet_swap_contract_address : cfg.glmr_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.glmr_erc_testnet_fallback_swap_contract_address : cfg.glmr_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::HecoChain: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.hco_erc_testnet_swap_contract_address : cfg.hco_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.hco_erc_testnet_fallback_swap_contract_address : cfg.hco_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::SmartBCH: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.sbch_erc_testnet_swap_contract_address : cfg.sbch_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.sbch_erc_testnet_fallback_swap_contract_address : cfg.sbch_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::EthereumClassic: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.etc_erc_testnet_swap_contract_address : cfg.etc_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.etc_erc_testnet_fallback_swap_contract_address : cfg.etc_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; - } - case CoinType::RSK: - { - j["swap_contract_address"] = cfg.is_testnet ? cfg.rsk_erc_testnet_swap_contract_address : cfg.rsk_erc_swap_contract_address; - j["fallback_swap_contract"] = cfg.is_testnet ? cfg.rsk_erc_testnet_fallback_swap_contract_address : cfg.rsk_erc_fallback_swap_contract_address; - j["urls"] = cfg.urls; - break; + if (cfg.is_testnet) + { + if (cfg.testnet_matic_gas_station_url.has_value()) + { + j["gas_station_url"] = cfg.testnet_matic_gas_station_url.value(); + } + } + else + { + if (cfg.matic_gas_station_url.has_value()) + { + j["gas_station_url"] = cfg.matic_gas_station_url.value(); + } + } + if (cfg.matic_gas_station_decimals.has_value()) + { + j["gas_station_decimals"] = cfg.matic_gas_station_decimals.value(); + } } default: + j["urls"] = cfg.urls; + j["swap_contract_address"] = cfg.swap_contract_address; + if (cfg.fallback_swap_contract_address.has_value()) + { + j["fallback_swap_contract"] = cfg.fallback_swap_contract_address.value(); + } break; } diff --git a/src/core/atomicdex/api/mm2/rpc.enable.hpp b/src/core/atomicdex/api/mm2/rpc.enable.hpp index 2b7d3274e3..9d5a14486d 100644 --- a/src/core/atomicdex/api/mm2/rpc.enable.hpp +++ b/src/core/atomicdex/api/mm2/rpc.enable.hpp @@ -17,6 +17,7 @@ #pragma once //! Deps +#include #include //! Project Headers @@ -27,76 +28,18 @@ namespace atomic_dex::mm2 //! Only for erc 20 struct enable_request { - std::string coin_name; - std::vector urls; - CoinType coin_type; - bool is_testnet{false}; - const std::string erc_swap_contract_address{"0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80"}; - const std::string erc_testnet_swap_contract_address{"0x6b5A52217006B965BB190864D62dc3d270F7AaFD"}; - const std::string erc_fallback_swap_contract_address{"0x8500AFc0bc5214728082163326C2FF0C73f4a871"}; - const std::string erc_testnet_fallback_swap_contract_address{"0x7Bc1bBDD6A0a722fC9bffC49c921B685ECB84b94"}; - const std::string etc_erc_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string etc_erc_testnet_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string etc_erc_fallback_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string etc_erc_testnet_fallback_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string ubiq_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string ubiq_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string ubiq_erc_testnet_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string ubiq_erc_testnet_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string krc_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string krc_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string krc_erc_testnet_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string krc_erc_testnet_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string movr_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string movr_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string movr_erc_testnet_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string movr_erc_testnet_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string glmr_erc_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string glmr_erc_fallback_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string glmr_erc_testnet_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string glmr_erc_testnet_fallback_swap_contract_address{"0x6d9ce4BD298DE38bAfEFD15f5C6f5c95313B1d94"}; - const std::string hco_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string hco_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string hco_erc_testnet_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string hco_erc_testnet_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string avax_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string avax_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string avax_erc_testnet_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string avax_erc_testnet_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string one_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string one_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string one_erc_testnet_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string one_erc_testnet_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string ftm_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string ftm_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string ftm_erc_testnet_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string ftm_erc_testnet_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string matic_erc_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string matic_erc_fallback_swap_contract_address{"0x9130b257D37A52E52F21054c4DA3450c72f595CE"}; - const std::string matic_erc_testnet_swap_contract_address{"0x73c1Dd989218c3A154C71Fc08Eb55A24Bd2B3A10"}; - const std::string matic_erc_testnet_fallback_swap_contract_address{"0x73c1Dd989218c3A154C71Fc08Eb55A24Bd2B3A10"}; - const std::string optimism_erc_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"}; - const std::string optimism_erc_fallback_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"}; - const std::string arbitrum_erc_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"}; - const std::string arbitrum_erc_fallback_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"}; - const std::string sbch_erc_swap_contract_address{"0x25bF2AAB8749AD2e4360b3e0B738f3Cd700C4D68"}; - const std::string sbch_erc_fallback_swap_contract_address{"0x25bF2AAB8749AD2e4360b3e0B738f3Cd700C4D68"}; - const std::string sbch_erc_testnet_swap_contract_address{"0x25bF2AAB8749AD2e4360b3e0B738f3Cd700C4D68"}; - const std::string sbch_erc_testnet_fallback_swap_contract_address{"0x25bF2AAB8749AD2e4360b3e0B738f3Cd700C4D68"}; - const std::string rsk_erc_swap_contract_address{"0x6D9CE4bD298de38Bafefd15F5C6F5c95313B1d94"}; - const std::string rsk_erc_fallback_swap_contract_address{"0x6D9CE4bD298de38Bafefd15F5C6F5c95313B1d94"}; - const std::string rsk_erc_testnet_swap_contract_address{"0x6D9CE4bD298de38Bafefd15F5C6F5c95313B1d94"}; - const std::string rsk_erc_testnet_fallback_swap_contract_address{"0x6D9CE4bD298de38Bafefd15F5C6F5c95313B1d94"}; - const std::string bnb_testnet_swap_contract_address{"0xcCD17C913aD7b772755Ad4F0BDFF7B34C6339150"}; - const std::string bnb_swap_contract_address{"0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31"}; - const std::string bnb_fallback_swap_contract_address{bnb_swap_contract_address}; - const std::string bnb_testnet_fallback_swap_contract_address{bnb_testnet_swap_contract_address}; - const std::size_t matic_gas_station_decimals{9}; - std::string gas_station_url{"https://ethgasstation.info/json/ethgasAPI.json"}; - std::string matic_gas_station_url{"https://gasstation-mainnet.matic.network/"}; - std::string testnet_matic_gas_station_url{"https://gasstation-mumbai.matic.today/"}; - std::string type; ///< QRC-20 ? - bool with_tx_history{true}; + std::string coin_name; + std::vector urls; + CoinType coin_type; + bool is_testnet{false}; + const std::string swap_contract_address; + std::optional fallback_swap_contract_address{std::nullopt}; + std::optional matic_gas_station_decimals{9}; + std::string gas_station_url{"https://ethgasstation.info/json/ethgasAPI.json"}; + std::optional matic_gas_station_url{std::nullopt}; + std::optional testnet_matic_gas_station_url{std::nullopt}; + std::optional type; ///< QRC-20 ? + bool with_tx_history{true}; }; void to_json(nlohmann::json& j, const enable_request& cfg); diff --git a/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_token.cpp b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_token.cpp new file mode 100644 index 0000000000..d20efa4132 --- /dev/null +++ b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_token.cpp @@ -0,0 +1,25 @@ +#include + +#include "rpc2.enable_tendermint_token.hpp" + +namespace atomic_dex::mm2 +{ + void to_json(nlohmann::json& j, const enable_tendermint_token_rpc_request& request) + { + j["ticker"] = request.ticker; + if (request.activation_params.required_confirmations) + { + j["activation_params"]["required_confirmations"] = *request.activation_params.required_confirmations; + } + else + { + j["activation_params"] = nlohmann::json::object(); + } + } + + void from_json(const nlohmann::json& j, enable_tendermint_token_rpc_result& in) + { + j.at("platform_coin").get_to(in.platform_coin); + j.at("balances").get_to>(in.balances); + } +} \ No newline at end of file diff --git a/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_token.hpp b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_token.hpp new file mode 100644 index 0000000000..1f8845ed1f --- /dev/null +++ b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_token.hpp @@ -0,0 +1,58 @@ +/****************************************************************************** + * Copyright © 2013-2022 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 + +#include + +#include //> nlohmann::json + +#include "rpc.hpp" +#include "balance_info.hpp" + +namespace atomic_dex::mm2 +{ + struct enable_tendermint_token_rpc + { + static constexpr auto endpoint = "enable_tendermint_token"; + static constexpr bool is_v2 = true; + + struct expected_request_type + { + std::string ticker; + struct { std::optional required_confirmations; } activation_params; + }; + + struct expected_result_type + { + std::string platform_coin; + std::unordered_map balances; + }; + + using expected_error_type = rpc_basic_error_type; + + expected_request_type request; + std::optional result; + std::optional error; + }; + + using enable_tendermint_token_rpc_request = enable_tendermint_token_rpc::expected_request_type; + using enable_tendermint_token_rpc_result = enable_tendermint_token_rpc::expected_result_type; + using enable_tendermint_token_rpc_error = enable_tendermint_token_rpc::expected_error_type; + + void to_json(nlohmann::json& j, const enable_tendermint_token_rpc_request& request); + void from_json(const nlohmann::json& j, enable_tendermint_token_rpc_result& in); +} \ No newline at end of file diff --git a/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_with_assets.cpp b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_with_assets.cpp new file mode 100644 index 0000000000..b924bbe656 --- /dev/null +++ b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_with_assets.cpp @@ -0,0 +1,39 @@ +#include + +#include "rpc2.enable_tendermint_with_assets.hpp" + +namespace atomic_dex::mm2 +{ + void to_json(nlohmann::json& j, const enable_tendermint_with_assets_request_rpc& in) + { + j["ticker"] = in.ticker; + j["rpc_urls"] = in.rpc_urls; + j["tx_history"] = in.tx_history; + j["tokens_params"] = in.tokens_params; + if (in.required_confirmations.has_value()) + j["required_confirmations"] = in.required_confirmations.value(); + if (in.requires_notarization.has_value()) + j["requires_notarization"] = in.requires_notarization.value(); + } + + void to_json(nlohmann::json& j, const enable_tendermint_with_assets_request_rpc::tendermint_token_request_t& in) + { + j["ticker"] = in.ticker; + if (in.required_confirmations) + j["required_confirmations"] = in.required_confirmations.value(); + } + + void from_json(const nlohmann::json& json, enable_tendermint_with_assets_result_rpc& out) + { + out.address = json["address"]; + out.current_block = json["current_block"]; + out.tendermint_balances_infos = json["balance"].get(); + out.tendermint_token_balances_infos = json["tokens_balances"].get(); + } + + void from_json(const nlohmann::json& json, enable_tendermint_with_assets_result_rpc::tendermint_balance_infos_t& out) + { + out.balances.spendable = json["spendable"]; + out.balances.unspendable = json["unspendable"]; + } +} \ No newline at end of file diff --git a/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_with_assets.hpp b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_with_assets.hpp new file mode 100644 index 0000000000..c65408658f --- /dev/null +++ b/src/core/atomicdex/api/mm2/rpc2.enable_tendermint_with_assets.hpp @@ -0,0 +1,60 @@ +#pragma once + +#include + +#include "rpc.hpp" +#include "balance_info.hpp" +#include "atomicdex/config/electrum.cfg.hpp" + +namespace atomic_dex::mm2 +{ + struct enable_tendermint_with_assets_rpc + { + static constexpr auto endpoint = "enable_tendermint_with_assets"; + static constexpr bool is_v2 = true; + + struct expected_request_type + { + struct tendermint_token_request_t + { + std::string ticker; + std::optional required_confirmations; + }; + + std::string ticker; + std::vector rpc_urls; + bool tx_history{true}; + std::vector tokens_params; + std::optional required_confirmations; + std::optional requires_notarization; + }; + + struct expected_result_type + { + struct tendermint_balance_infos_t + { + balance_info balances; + }; + + std::string address; + std::size_t current_block; + tendermint_balance_infos_t tendermint_balances_infos; + std::unordered_map tendermint_token_balances_infos; + }; + + using expected_error_type = rpc_basic_error_type; + + expected_request_type request; + std::optional result; + std::optional error; + }; + + using enable_tendermint_with_assets_request_rpc = enable_tendermint_with_assets_rpc::expected_request_type; + using enable_tendermint_with_assets_result_rpc = enable_tendermint_with_assets_rpc::expected_result_type; + using enable_tendermint_with_assets_error_rpc = enable_tendermint_with_assets_rpc::expected_error_type; + + void to_json(nlohmann::json& j, const enable_tendermint_with_assets_request_rpc& in); + void to_json(nlohmann::json& j, const enable_tendermint_with_assets_request_rpc::tendermint_token_request_t& in); + void from_json(const nlohmann::json& json, enable_tendermint_with_assets_result_rpc& out); + void from_json(const nlohmann::json& json, enable_tendermint_with_assets_result_rpc::tendermint_balance_infos_t& out); +} \ No newline at end of file diff --git a/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.cancel.cpp b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.cancel.cpp new file mode 100644 index 0000000000..1c2a90f384 --- /dev/null +++ b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.cancel.cpp @@ -0,0 +1,53 @@ +/****************************************************************************** + * Copyright © 2013-2022 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 + +//! Project Headers +#include "atomicdex/api/mm2/rpc2.task.enable_z_coin.cancel.hpp" + +//! Implementation 2.0 RPC [enable_z_coin_cancel] +namespace atomic_dex::mm2 +{ + //! Serialization + void to_json(nlohmann::json& j, const enable_z_coin_cancel_request& request) + { + j["params"]["task_id"] = request.task_id; + } + + //! Deserialization + void from_json(const nlohmann::json& j, enable_z_coin_cancel_answer_success& answer) + { + answer.result = j.at("result").get(); + } + + void + from_json(const nlohmann::json& j, enable_z_coin_cancel_answer& answer) + { + if (j.count("error") >= 1) + { + answer.error = j; + } + else + { + if (j.contains("result") && j.contains("mmrpc") && j.at("mmrpc").get() == "2.0") + { + answer.result = j.get(); + } + } + } +} // namespace atomic_dex::mm2 diff --git a/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.cancel.hpp b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.cancel.hpp new file mode 100644 index 0000000000..fa6976dfc3 --- /dev/null +++ b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.cancel.hpp @@ -0,0 +1,60 @@ +/****************************************************************************** + * Copyright © 2013-2022 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 Headers +#include + +// Deps Headers +#include + +//! Project Headers +#include "generic.error.hpp" + +namespace atomic_dex::mm2 +{ + struct enable_z_coin_cancel_request + { + int task_id; + }; + + void to_json(nlohmann::json& j, const enable_z_coin_cancel_request& request); + + struct enable_z_coin_cancel_answer_success + { + std::string result; + }; + + void from_json(const nlohmann::json& j, enable_z_coin_cancel_answer_success& answer); + + struct enable_z_coin_cancel_answer + { + std::optional result; + std::optional error; + std::string raw_result; ///< internal + int rpc_result_code; ///< internal + }; + + void from_json(const nlohmann::json& j, enable_z_coin_cancel_answer& answer); +} + +namespace atomic_dex +{ + using t_enable_z_coin_cancel_request = mm2::enable_z_coin_cancel_request; + using t_enable_z_coin_cancel_answer = mm2::enable_z_coin_cancel_answer; + using t_enable_z_coin_cancel_answer_success = mm2::enable_z_coin_cancel_answer_success; +} // namespace atomic_dex \ No newline at end of file diff --git a/src/core/atomicdex/api/mm2/rpc2.init_z_coin.cpp b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.init.cpp similarity index 88% rename from src/core/atomicdex/api/mm2/rpc2.init_z_coin.cpp rename to src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.init.cpp index 6c61b672eb..c349150d4a 100644 --- a/src/core/atomicdex/api/mm2/rpc2.init_z_coin.cpp +++ b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.init.cpp @@ -18,13 +18,13 @@ #include //! Project Headers -#include "atomicdex/api/mm2/rpc2.init_z_coin.hpp" +#include "atomicdex/api/mm2/rpc2.task.enable_z_coin.init.hpp" -//! Implementation 2.0 RPC [init_z_coin] +//! Implementation 2.0 RPC [enable_z_coin] namespace atomic_dex::mm2 { //! Serialization - void to_json(nlohmann::json& j, const init_z_coin_request& request) + void to_json(nlohmann::json& j, const enable_z_coin_request& request) { j["params"]["ticker"] = request.coin_name; j["params"]["activation_params"]["mode"]["rpc"] = "Light"; @@ -34,7 +34,7 @@ namespace atomic_dex::mm2 } //! Deserialization - void from_json(const nlohmann::json& j, init_z_coin_answer& answer) + void from_json(const nlohmann::json& j, enable_z_coin_answer& answer) { j.at("task_id").get_to(answer.task_id); } diff --git a/src/core/atomicdex/api/mm2/rpc2.init_z_coin.hpp b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.init.hpp similarity index 85% rename from src/core/atomicdex/api/mm2/rpc2.init_z_coin.hpp rename to src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.init.hpp index d7fe101369..a0e953fd8c 100644 --- a/src/core/atomicdex/api/mm2/rpc2.init_z_coin.hpp +++ b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.init.hpp @@ -28,7 +28,7 @@ namespace atomic_dex::mm2 { - struct init_z_coin_request + struct enable_z_coin_request { std::string coin_name; std::vector servers; @@ -38,17 +38,17 @@ namespace atomic_dex::mm2 bool with_tx_history{false}; // Not yet in API }; - struct init_z_coin_answer + struct enable_z_coin_answer { int task_id; }; - void to_json(nlohmann::json& j, const init_z_coin_request& request); - void from_json(const nlohmann::json& j, init_z_coin_answer& answer); + void to_json(nlohmann::json& j, const enable_z_coin_request& request); + void from_json(const nlohmann::json& j, enable_z_coin_answer& answer); } namespace atomic_dex { - using t_init_z_coin_request = mm2::init_z_coin_request; - using t_init_z_coin_answer = mm2::init_z_coin_answer; + using t_enable_z_coin_request = mm2::enable_z_coin_request; + using t_enable_z_coin_answer = mm2::enable_z_coin_answer; } // namespace atomic_dex diff --git a/src/core/atomicdex/api/mm2/rpc2.init_z_coin_status.cpp b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.status.cpp similarity index 75% rename from src/core/atomicdex/api/mm2/rpc2.init_z_coin_status.cpp rename to src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.status.cpp index ded987e419..eff12d0753 100644 --- a/src/core/atomicdex/api/mm2/rpc2.init_z_coin_status.cpp +++ b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.status.cpp @@ -18,19 +18,20 @@ #include //! Project Headers -#include "atomicdex/api/mm2/rpc2.init_z_coin_status.hpp" +#include "atomicdex/api/mm2/rpc2.task.enable_z_coin.status.hpp" -//! Implementation 2.0 RPC [init_z_coin_status] +//! Implementation 2.0 RPC [enable_z_coin_status] namespace atomic_dex::mm2 { //! Serialization - void to_json(nlohmann::json& j, const init_z_coin_status_request& request) + void to_json(nlohmann::json& j, const enable_z_coin_status_request& request) { j["params"]["task_id"] = request.task_id; + j["params"]["forget_if_finished"] = false; } //! Deserialization - void from_json(const nlohmann::json& j, init_z_coin_status_answer_success& answer) + void from_json(const nlohmann::json& j, enable_z_coin_status_answer_success& answer) { j.at("result").at("status").get_to(answer.status); // [InProgress, Ready] j.at("result").at("details").get_to(answer.details); @@ -48,21 +49,21 @@ namespace atomic_dex::mm2 if (j.at("result").at("details").contains("result")) { - answer.coin = j.at("result").at("details").at("result").at("ticker").get(); - answer.current_block = j.at("result").at("details").at("result").at("current_block").get(); + answer.coin = j.at("result").at("details").at("ticker").get(); + answer.current_block = j.at("result").at("details").at("current_block").get(); - if (j.at("result").at("details").at("result").contains("wallet_balance")) + if (j.at("result").at("details").contains("wallet_balance")) { - answer.wallet_type = j.at("result").at("details").at("result").at("wallet_balance").at("wallet_type").get(); - answer.address = j.at("result").at("details").at("result").at("wallet_balance").at("address").get(); - answer.spendable_balance = j.at("result").at("details").at("result").at("wallet_balance").at("balance").at("spendable").get(); - answer.unspendable_balance = j.at("result").at("details").at("result").at("wallet_balance").at("balance").at("unspendable").get(); + answer.wallet_type = j.at("result").at("details").at("wallet_balance").at("wallet_type").get(); + answer.address = j.at("result").at("details").at("wallet_balance").at("address").get(); + answer.spendable_balance = j.at("result").at("details").at("wallet_balance").at("balance").at("spendable").get(); + answer.unspendable_balance = j.at("result").at("details").at("wallet_balance").at("balance").at("unspendable").get(); } } } void - from_json(const nlohmann::json& j, init_z_coin_status_answer& answer) + from_json(const nlohmann::json& j, enable_z_coin_status_answer& answer) { if (j.count("error") >= 1) { @@ -72,7 +73,7 @@ namespace atomic_dex::mm2 { if (j.contains("result") && j.contains("mmrpc") && j.at("mmrpc").get() == "2.0") { - answer.result = j.at("result").get(); + answer.result = j.at("result").get(); } } } diff --git a/src/core/atomicdex/api/mm2/rpc2.init_z_coin_status.hpp b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.status.hpp similarity index 75% rename from src/core/atomicdex/api/mm2/rpc2.init_z_coin_status.hpp rename to src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.status.hpp index 845c5e6356..e55735448f 100644 --- a/src/core/atomicdex/api/mm2/rpc2.init_z_coin_status.hpp +++ b/src/core/atomicdex/api/mm2/rpc2.task.enable_z_coin.status.hpp @@ -27,14 +27,14 @@ namespace atomic_dex::mm2 { - struct init_z_coin_status_request + struct enable_z_coin_status_request { int task_id; }; - void to_json(nlohmann::json& j, const init_z_coin_status_request& request); + void to_json(nlohmann::json& j, const enable_z_coin_status_request& request); - struct init_z_coin_status_answer_success + struct enable_z_coin_status_answer_success { std::string status{"disabled"}; std::string details{"N/A"}; @@ -48,22 +48,22 @@ namespace atomic_dex::mm2 std::optional unspendable_balance; }; - void from_json(const nlohmann::json& j, init_z_coin_status_answer_success& answer); + void from_json(const nlohmann::json& j, enable_z_coin_status_answer_success& answer); - struct init_z_coin_status_answer + struct enable_z_coin_status_answer { - std::optional result; + std::optional result; std::optional error; std::string raw_result; ///< internal int rpc_result_code; ///< internal }; - void from_json(const nlohmann::json& j, init_z_coin_status_answer& answer); + void from_json(const nlohmann::json& j, enable_z_coin_status_answer& answer); } namespace atomic_dex { - using t_init_z_coin_status_request = mm2::init_z_coin_status_request; - using t_init_z_coin_status_answer = mm2::init_z_coin_status_answer; - using t_init_z_coin_status_answer_success = mm2::init_z_coin_status_answer_success; + using t_enable_z_coin_status_request = mm2::enable_z_coin_status_request; + using t_enable_z_coin_status_answer = mm2::enable_z_coin_status_answer; + using t_enable_z_coin_status_answer_success = mm2::enable_z_coin_status_answer_success; } // namespace atomic_dex diff --git a/src/core/atomicdex/api/mm2/rpc2.init_withdraw.cpp b/src/core/atomicdex/api/mm2/rpc2.task.withdraw.init.cpp similarity index 82% rename from src/core/atomicdex/api/mm2/rpc2.init_withdraw.cpp rename to src/core/atomicdex/api/mm2/rpc2.task.withdraw.init.cpp index b42ca76fb2..29d44086fe 100644 --- a/src/core/atomicdex/api/mm2/rpc2.init_withdraw.cpp +++ b/src/core/atomicdex/api/mm2/rpc2.task.withdraw.init.cpp @@ -18,20 +18,20 @@ #include //! Project Headers -#include "atomicdex/api/mm2/rpc2.init_withdraw.hpp" +#include "atomicdex/api/mm2/rpc2.task.withdraw.init.hpp" -//! Implementation 2.0 RPC [init_withdraw] +//! Implementation 2.0 RPC [withdraw_init] namespace atomic_dex::mm2 { void - to_json(nlohmann::json& j, const init_withdraw_fees& request) + to_json(nlohmann::json& j, const withdraw_init_fees& request) { j["type"] = request.type; j["amount"] = request.amount.value(); } //! Serialization - void to_json(nlohmann::json& j, const init_withdraw_request& request) + void to_json(nlohmann::json& j, const withdraw_init_request& request) { nlohmann::json obj = nlohmann::json::object(); @@ -40,6 +40,10 @@ namespace atomic_dex::mm2 obj["params"]["amount"] = request.amount; obj["params"]["max"] = request.max; + if (request.memo.has_value()) + { + obj["params"]["memo"] = request.memo.value(); + } if (request.fees.has_value()) { obj["params"]["fee"] = request.fees.value(); @@ -48,7 +52,7 @@ namespace atomic_dex::mm2 } //! Deserialization - void from_json(const nlohmann::json& j, init_withdraw_answer& answer) + void from_json(const nlohmann::json& j, withdraw_init_answer& answer) { j.at("task_id").get_to(answer.task_id); } diff --git a/src/core/atomicdex/api/mm2/rpc2.init_withdraw.hpp b/src/core/atomicdex/api/mm2/rpc2.task.withdraw.init.hpp similarity index 76% rename from src/core/atomicdex/api/mm2/rpc2.init_withdraw.hpp rename to src/core/atomicdex/api/mm2/rpc2.task.withdraw.init.hpp index 2f214f6de9..88558fd1cd 100644 --- a/src/core/atomicdex/api/mm2/rpc2.init_withdraw.hpp +++ b/src/core/atomicdex/api/mm2/rpc2.task.withdraw.init.hpp @@ -24,33 +24,34 @@ namespace atomic_dex::mm2 { - struct init_withdraw_fees + struct withdraw_init_fees { std::string type; ///< UtxoFixed, UtxoPerKbyte, EthGas, Qrc20Gas std::optional amount; ///< Utxo only }; - struct init_withdraw_request + struct withdraw_init_request { std::string coin; std::string to; std::string amount; - std::optional fees{std::nullopt}; ///< ignored if std::nullopt + std::optional fees{std::nullopt}; ///< ignored if std::nullopt + std::optional memo; ///< memo for zhtlc bool max{false}; }; - struct init_withdraw_answer + struct withdraw_init_answer { int task_id; }; - void to_json(nlohmann::json& j, const init_withdraw_request& request); - void from_json(const nlohmann::json& j, init_withdraw_answer& answer); + void to_json(nlohmann::json& j, const withdraw_init_request& request); + void from_json(const nlohmann::json& j, withdraw_init_answer& answer); } namespace atomic_dex { - using t_init_withdraw_request = mm2::init_withdraw_request; - using t_init_withdraw_fees = mm2::init_withdraw_fees; - using t_init_withdraw_answer = mm2::init_withdraw_answer; + using t_withdraw_init_request = mm2::withdraw_init_request; + using t_withdraw_init_fees = mm2::withdraw_init_fees; + using t_withdraw_init_answer = mm2::withdraw_init_answer; } // namespace atomic_dex diff --git a/src/core/atomicdex/api/mm2/rpc2.withdraw_status.cpp b/src/core/atomicdex/api/mm2/rpc2.task.withdraw.status.cpp similarity index 90% rename from src/core/atomicdex/api/mm2/rpc2.withdraw_status.cpp rename to src/core/atomicdex/api/mm2/rpc2.task.withdraw.status.cpp index c38d5cfbe0..9df0b7b0af 100644 --- a/src/core/atomicdex/api/mm2/rpc2.withdraw_status.cpp +++ b/src/core/atomicdex/api/mm2/rpc2.task.withdraw.status.cpp @@ -18,7 +18,7 @@ #include //! Project Headers -#include "atomicdex/api/mm2/rpc2.withdraw_status.hpp" +#include "atomicdex/api/mm2/rpc2.task.withdraw.status.hpp" //! Implementation 2.0 RPC [withdraw_status] namespace atomic_dex::mm2 @@ -27,6 +27,7 @@ namespace atomic_dex::mm2 void to_json(nlohmann::json& j, const withdraw_status_request& request) { j["params"]["task_id"] = request.task_id; + j["params"]["forget_if_finished"] = false; } //! Deserialization @@ -38,7 +39,7 @@ namespace atomic_dex::mm2 } else { - answer.result = j.at("result").at("details").at("result").get(); + answer.result = j.at("result").at("details").get(); } } } // namespace atomic_dex::mm2 diff --git a/src/core/atomicdex/api/mm2/rpc2.withdraw_status.hpp b/src/core/atomicdex/api/mm2/rpc2.task.withdraw.status.hpp similarity index 100% rename from src/core/atomicdex/api/mm2/rpc2.withdraw_status.hpp rename to src/core/atomicdex/api/mm2/rpc2.task.withdraw.status.hpp diff --git a/src/core/atomicdex/api/mm2/rpc.withdraw.cpp b/src/core/atomicdex/api/mm2/rpc2.withdraw.cpp similarity index 66% rename from src/core/atomicdex/api/mm2/rpc.withdraw.cpp rename to src/core/atomicdex/api/mm2/rpc2.withdraw.cpp index a37bd5c91d..cdf6ccf902 100644 --- a/src/core/atomicdex/api/mm2/rpc.withdraw.cpp +++ b/src/core/atomicdex/api/mm2/rpc2.withdraw.cpp @@ -6,7 +6,7 @@ #include //! Our Headers -#include "rpc.withdraw.hpp" +#include "rpc2.withdraw.hpp" namespace atomic_dex::mm2 { @@ -41,22 +41,19 @@ namespace atomic_dex::mm2 { nlohmann::json obj = nlohmann::json::object(); - obj["coin"] = cfg.coin; - obj["amount"] = cfg.amount; - obj["to"] = cfg.to; - obj["max"] = cfg.max; - if (cfg.fees.has_value()) - { - obj["fee"] = cfg.fees.value(); - } - if (j.contains("mmrpc") && j.at("mmrpc").get() == "2.0") + obj["params"]["coin"] = cfg.coin; + obj["params"]["amount"] = cfg.amount; + obj["params"]["to"] = cfg.to; + obj["params"]["max"] = cfg.max; + if (cfg.memo.has_value()) { - j["params"] = obj; + obj["params"]["memo"] = cfg.memo.value(); } - else + if (cfg.fees.has_value()) { - j.update(obj); + obj["params"]["fee"] = cfg.fees.value(); } + j.update(obj); } void @@ -68,14 +65,7 @@ namespace atomic_dex::mm2 } else { - if (j.contains("result") && j.contains("mmrpc") && j.at("mmrpc").get() == "2.0") - { - answer.result = j.at("result").get(); - } - else - { - answer.result = j.get(); - } + answer.result = j.at("result").get(); } } } // namespace atomic_dex::mm2 \ No newline at end of file diff --git a/src/core/atomicdex/api/mm2/rpc.withdraw.hpp b/src/core/atomicdex/api/mm2/rpc2.withdraw.hpp similarity index 95% rename from src/core/atomicdex/api/mm2/rpc.withdraw.hpp rename to src/core/atomicdex/api/mm2/rpc2.withdraw.hpp index d424c7c825..51b9a687d8 100644 --- a/src/core/atomicdex/api/mm2/rpc.withdraw.hpp +++ b/src/core/atomicdex/api/mm2/rpc2.withdraw.hpp @@ -28,6 +28,7 @@ namespace atomic_dex::mm2 std::string to; ///< coins will be withdraw to this address std::string amount; ///< ignored if max is true std::optional fees{std::nullopt}; ///< ignored if std::nullopt + std::optional memo; ///< memo for tendermint bool max{false}; }; diff --git a/src/core/atomicdex/api/mm2/transaction.data.cpp b/src/core/atomicdex/api/mm2/transaction.data.cpp index 54dbf4b2e8..fd140e4667 100644 --- a/src/core/atomicdex/api/mm2/transaction.data.cpp +++ b/src/core/atomicdex/api/mm2/transaction.data.cpp @@ -18,6 +18,14 @@ namespace atomic_dex::mm2 j.at("total_fee").get_to(cfg.total_fee); } + void from_json(const nlohmann::json& j, fee_tendermint_coin& cfg) + { + j.at("coin").get_to(cfg.coin); + j.at("type").get_to(cfg.type); + j.at("amount").get_to(cfg.amount); + j.at("gas_limit").get_to(cfg.gas_limit); + } + void from_json(const nlohmann::json& j, fee_qrc_coin& cfg) { j.at("coin").get_to(cfg.coin); @@ -78,6 +86,20 @@ namespace atomic_dex::mm2 cfg.confirmations = j.at("confirmations").get(); } + // API returns null if no memo + if (j.contains("memo")) + { + try + { + cfg.memo = j.at("memo").get(); + } + catch (const std::exception& ex) + { + cfg.memo = ""; + //SPDLOG_ERROR("Error parsing memo: {}", ex.what()); + } + } + if (cfg.from.empty()) { if (cfg.coin == "FIRO") @@ -90,6 +112,11 @@ namespace atomic_dex::mm2 } } + if (j.contains("transaction_type")) + { + cfg.transaction_type = j.at("transaction_type").get(); + } + // transaction_fee only in ZHTLC response if (j.contains("transaction_fee")) { diff --git a/src/core/atomicdex/api/mm2/transaction.data.hpp b/src/core/atomicdex/api/mm2/transaction.data.hpp index 9882c9a532..a39f64b9fd 100644 --- a/src/core/atomicdex/api/mm2/transaction.data.hpp +++ b/src/core/atomicdex/api/mm2/transaction.data.hpp @@ -25,6 +25,16 @@ namespace atomic_dex::mm2 void from_json(const nlohmann::json& j, fee_erc_coin& cfg); + struct fee_tendermint_coin + { + std::string type; + std::string coin; + std::string amount; + std::size_t gas_limit; + }; + + void from_json(const nlohmann::json& j, fee_erc_coin& cfg); + struct fee_qrc_coin { std::string coin; @@ -38,9 +48,10 @@ namespace atomic_dex::mm2 struct fees_data { - std::optional normal_fees; ///< btc, kmd based coins - std::optional erc_fees; ///< eth based coins - std::optional qrc_fees; // Qtum based coin + std::optional normal_fees; ///< btc, kmd based coins + std::optional erc_fees; ///< eth based coins + std::optional qrc_fees; // Qtum based coin + std::optional tendermint_fees; // Qtum based coin }; void from_json(const nlohmann::json& j, fees_data& cfg); @@ -48,21 +59,23 @@ namespace atomic_dex::mm2 struct transaction_data { std::size_t timestamp; + std::string tx_hex; + std::string tx_hash; std::vector from; std::vector to; - fees_data fee_details; - std::size_t block_height; - std::string coin; + std::string total_amount{"0"}; std::string spent_by_me; std::string received_by_me; std::string my_balance_change; - std::string total_amount{"0"}; - std::string tx_hash; - std::string tx_hex; - std::string timestamp_as_date; ///< human readeable timestamp + std::size_t block_height; + fees_data fee_details; + std::string coin; std::optional transaction_fee; std::optional internal_id; std::optional confirmations; + std::optional transaction_type; + std::optional memo; + std::string timestamp_as_date; ///< human readeable timestamp }; void from_json(const nlohmann::json& j, transaction_data& cfg); diff --git a/src/core/atomicdex/config/app.cfg.cpp b/src/core/atomicdex/config/app.cfg.cpp index c4b25502cb..d60580bb58 100644 --- a/src/core/atomicdex/config/app.cfg.cpp +++ b/src/core/atomicdex/config/app.cfg.cpp @@ -48,6 +48,7 @@ namespace config_json_data["current_fiat_sign"] = config.current_fiat_sign; config_json_data["available_signs"] = config.available_currency_signs; config_json_data["notification_enabled"] = config.notification_enabled; + config_json_data["spamfilter_enabled"] = config.spamfilter_enabled; file.close(); @@ -71,6 +72,15 @@ namespace atomic_dex j.at("available_signs").get_to(config.available_currency_signs); j.at("current_fiat_sign").get_to(config.current_fiat_sign); j.at("notification_enabled").get_to(config.notification_enabled); + + if (j.contains("spamfilter_enabled")) + { + j.at("spamfilter_enabled").get_to(config.spamfilter_enabled); + } + else + { + config.spamfilter_enabled = true; + } } void @@ -83,6 +93,16 @@ namespace atomic_dex } } + void + change_spamfilter_status(cfg& config, bool is_enabled) + { + if (config.spamfilter_enabled != is_enabled) + { + config.spamfilter_enabled = is_enabled; + upgrade_cfg(config); + } + } + cfg load_cfg() { diff --git a/src/core/atomicdex/config/app.cfg.hpp b/src/core/atomicdex/config/app.cfg.hpp index 3edd54cfa6..e5286d9095 100644 --- a/src/core/atomicdex/config/app.cfg.hpp +++ b/src/core/atomicdex/config/app.cfg.hpp @@ -31,12 +31,14 @@ namespace atomic_dex std::vector available_fiat; std::vector possible_currencies; bool notification_enabled; + bool spamfilter_enabled{false}; }; void from_json(const nlohmann::json& j, cfg& config); void change_currency(cfg& config, const std::string& new_currency); void change_fiat(cfg& config, const std::string& new_fiat); void change_notification_status(cfg& config, bool is_enabled); + void change_spamfilter_status(cfg& config, bool is_enabled); [[nodiscard]] bool is_this_currency_a_fiat(const cfg& config, const std::string& currency); cfg load_cfg(); std::string retrieve_sign_from_ticker(const cfg& config, const std::string& currency); diff --git a/src/core/atomicdex/config/coins.cfg.cpp b/src/core/atomicdex/config/coins.cfg.cpp index e688c3293d..6ec8039b6b 100644 --- a/src/core/atomicdex/config/coins.cfg.cpp +++ b/src/core/atomicdex/config/coins.cfg.cpp @@ -23,7 +23,8 @@ namespace { - CoinType get_coin_type_from_str(const std::string& coin_type) + CoinType + get_coin_type_from_str(const std::string& coin_type) { if (coin_type == "QRC-20") { @@ -33,6 +34,10 @@ namespace { return CoinType::ERC20; } + if (coin_type == "EWT") + { + return CoinType::EWT; + } if (coin_type == "UTXO") { return CoinType::UTXO; @@ -105,6 +110,14 @@ namespace { return CoinType::RSK; } + if (coin_type == "TENDERMINT") + { + return CoinType::TENDERMINT; + } + if (coin_type == "TENDERMINTTOKEN") + { + return CoinType::TENDERMINTTOKEN; + } if (coin_type == "ZHTLC") { return CoinType::ZHTLC; @@ -113,18 +126,25 @@ namespace return CoinType::Invalid; // throw std::invalid_argument{"Undefined given coin type."}; } -} +} // namespace namespace atomic_dex { - bool is_wallet_only(std::string ticker) + bool + is_wallet_only(std::string ticker) { return std::any_of(g_wallet_only_coins.begin(), g_wallet_only_coins.end(), [ticker](std::string x) { return ticker == x; }); } - bool is_default_coin(std::string ticker) + bool + is_default_coin(std::string ticker) { return std::any_of(g_default_coins.begin(), g_default_coins.end(), [ticker](std::string x) { return ticker == x; }); } + bool + is_faucet_coin(std::string ticker) + { + return std::any_of(g_faucet_coins.begin(), g_faucet_coins.end(), [ticker](std::string x) { return ticker == x; }); + } void from_json(const nlohmann::json& j, coin_config& cfg) @@ -135,28 +155,27 @@ namespace atomic_dex cfg.coin_type = get_coin_type_from_str(cfg.type); j.at("active").get_to(cfg.active); j.at("explorer_url").get_to(cfg.explorer_url); - + cfg.has_memos = false; cfg.gui_ticker = j.contains("gui_coin") ? j.at("gui_coin").get() : cfg.ticker; + cfg.parent_coin = j.contains("parent_coin") ? j.at("parent_coin").get() : cfg.ticker; cfg.minimal_claim_amount = cfg.is_claimable ? j.at("minimal_claim_amount").get() : "0"; cfg.coinpaprika_id = j.contains("coinpaprika_id") ? j.at("coinpaprika_id").get() : "test-coin"; cfg.coingecko_id = j.contains("coingecko_id") ? j.at("coingecko_id").get() : "test-coin"; - cfg.livecoinwatch_id = j.contains("livecoinwatch_id") ? j.at("livecoinwatch_id").get() : "test-coin"; + cfg.livecoinwatch_id = j.contains("livecoinwatch_id") ? j.at("livecoinwatch_id").get() : "test-coin"; cfg.is_claimable = j.count("is_claimable") > 0; cfg.is_custom_coin = j.contains("is_custom_coin") ? j.at("is_custom_coin").get() : false; cfg.is_testnet = j.contains("is_testnet") ? j.at("is_testnet").get() : false; cfg.wallet_only = is_wallet_only(cfg.ticker) ? is_wallet_only(cfg.ticker) : j.contains("wallet_only") ? j.at("wallet_only").get() : false; cfg.default_coin = is_default_coin(cfg.ticker); + cfg.is_faucet_coin = is_faucet_coin(cfg.ticker); if (j.contains("other_types")) { std::vector other_types; - + j.at("other_types").get_to(other_types); cfg.other_types = std::set(); - for (const auto& other_type : other_types) - { - cfg.other_types->emplace(get_coin_type_from_str(other_type)); - } + for (const auto& other_type: other_types) { cfg.other_types->emplace(get_coin_type_from_str(other_type)); } } if (j.contains("utxo_merge")) { @@ -182,12 +201,19 @@ namespace atomic_dex if (j.contains("nodes")) { // Todo: this is bad, we are using 2 times the required memory. Something can be improved here. - cfg.urls = j.at("nodes").get>(); + cfg.urls = j.at("nodes").get>(); cfg.eth_family_urls = std::vector(); cfg.eth_family_urls.value().reserve(cfg.urls.value().size()); - for (const auto& url : cfg.urls.value()) + for (const auto& url: cfg.urls.value()) { cfg.eth_family_urls->push_back(url.url); } + } + if (j.contains("rpc_urls")) + { + auto rpc_urls_obj = j.at("rpc_urls").get>(); + std::vector rpc_urls_list; + cfg.rpc_urls = rpc_urls_list; + for (const auto& url : rpc_urls_obj) { - cfg.eth_family_urls->push_back(url.url); + cfg.rpc_urls->push_back(url.url); } } if (j.contains("allow_slp_unsafe_conf")) @@ -198,17 +224,11 @@ namespace atomic_dex if (j.contains("light_wallet_d_servers")) { cfg.z_urls = j.at("light_wallet_d_servers").get>(); - } - if (j.contains("is_segwit_on")) - { - cfg.segwit = true; - j.at("is_segwit_on").get_to(cfg.is_segwit_on); - SPDLOG_INFO("coin: {} support segwit with current_segwit mode: {}", cfg.ticker, cfg.is_segwit_on); - } - if (j.contains("alias_ticker")) + } if (j.contains("alias_ticker")) { cfg.alias_ticker = j.at("alias_ticker").get(); } + // Explorer url suffixes if (j.contains("explorer_tx_url")) { j.at("explorer_tx_url").get_to(cfg.tx_uri); @@ -217,6 +237,33 @@ namespace atomic_dex { j.at("explorer_address_url").get_to(cfg.address_url); } + // Swap contract addresses + if (j.contains("swap_contract_address")) + { + cfg.swap_contract_address = j["swap_contract_address"]; + } + if (j.contains("fallback_swap_contract_address")) + { + cfg.fallback_swap_contract_address = j["fallback_swap_contract_address"]; + } + // Gas station urls + if (j.contains("gas_station_url")) + { + cfg.gas_station_url = j.at("gas_station_url").get(); + } + if (j.contains("matic_gas_station_url")) + { + cfg.matic_gas_station_url = j.at("matic_gas_station_url").get(); + } + if (j.contains("testnet_matic_gas_station_url")) + { + cfg.testnet_matic_gas_station_url = j.at("testnet_matic_gas_station_url").get(); + } + if (j.contains("matic_gas_station_decimals")) + { + cfg.matic_gas_station_decimals = j.at("matic_gas_station_decimals").get(); + } + switch (cfg.coin_type) { @@ -249,6 +296,11 @@ namespace atomic_dex cfg.fees_ticker = "ETH-ARB20"; cfg.is_erc_family = true; break; + case CoinType::EWT: + cfg.has_parent_fees_ticker = true; + cfg.fees_ticker = "EWT"; + cfg.is_erc_family = true; + break; case CoinType::AVX20: cfg.has_parent_fees_ticker = true; cfg.fees_ticker = cfg.is_testnet.value() ? "AVAXT" : "AVAX"; @@ -308,10 +360,21 @@ namespace atomic_dex cfg.has_parent_fees_ticker = true; cfg.fees_ticker = cfg.is_testnet.value() ? "tBCH" : "BCH"; break; + case CoinType::TENDERMINT: + cfg.has_parent_fees_ticker = true; + cfg.fees_ticker = cfg.parent_coin; + cfg.has_memos = true; + break; + case CoinType::TENDERMINTTOKEN: + cfg.has_parent_fees_ticker = true; + cfg.fees_ticker = cfg.parent_coin; + cfg.has_memos = true; + break; case CoinType::ZHTLC: cfg.has_parent_fees_ticker = false; cfg.is_zhtlc_family = true; cfg.fees_ticker = cfg.ticker; + cfg.has_memos = true; break; case CoinType::Invalid: cfg.has_parent_fees_ticker = false; @@ -324,13 +387,12 @@ namespace atomic_dex } } - void print_coins(std::vector coins) + void + print_coins(std::vector coins) { std::stringstream ss; ss << "["; - for (auto&& coin: coins) { - ss << coin.ticker << " "; - } + for (auto&& coin: coins) { ss << coin.ticker << " "; } ss << "]"; SPDLOG_INFO("{}", ss.str()); } diff --git a/src/core/atomicdex/config/coins.cfg.hpp b/src/core/atomicdex/config/coins.cfg.hpp index 4ec95f07dc..e1e2f7c348 100644 --- a/src/core/atomicdex/config/coins.cfg.hpp +++ b/src/core/atomicdex/config/coins.cfg.hpp @@ -33,49 +33,59 @@ namespace atomic_dex struct coin_config { static constexpr const char* erc_gas_stations = "https://ethgasstation.info/json/ethgasAPI.json"; - static constexpr const char* matic_gas_stations = "https://gasstation-mainnet.matic.network/"; + std::optional matic_gas_stations{std::nullopt}; using electrum_servers = std::vector; using nodes = std::vector; + using url_list = std::vector; using eth_family_url_list = std::vector; using bchd_url_list = std::vector; using light_wallet_d_servers = std::vector; ///< For ZHTLC - std::string ticker; - std::optional alias_ticker{std::nullopt}; - std::string gui_ticker; ///< Ticker displayed in the gui - std::string name; ///< nice name - std::optional utxo_merge{false}; - std::optional allow_slp_unsafe_conf; - std::optional urls; - std::optional eth_family_urls; - std::optional bchd_urls; - std::optional electrum_urls; - std::optional z_urls; - bool is_claimable{false}; - std::string minimal_claim_amount{"0"}; - bool currently_enabled{false}; - bool active{false}; - std::string coinpaprika_id{"test-coin"}; - std::string coingecko_id{"test-coin"}; - std::string livecoinwatch_id{"test-coin"}; - bool is_custom_coin{false}; - std::string type; - std::optional> other_types; - std::string explorer_url; ///< usefull for transaction, take this url and append transaction id - std::string tx_uri{"tx/"}; - std::string address_url{"address/"}; - std::optional custom_backup; - nlohmann::json activation_status; - std::optional is_testnet{false}; ///< True if testnet (tBTC, tQTUM, QRC-20 on testnet, tETH) - CoinType coin_type; - bool checked{false}; - bool wallet_only{false}; - bool has_parent_fees_ticker{false}; ///< True if parent fees is different from current ticker eg: ERC20 tokens - std::string fees_ticker; - bool segwit{false}; - bool is_segwit_on{false}; - bool is_erc_family{false}; - bool is_zhtlc_family{false}; - bool default_coin{false}; + std::string ticker; + std::string gui_ticker; ///< Ticker displayed in the gui + std::string name; ///< nice name + std::string parent_coin; + std::string fees_ticker; + std::string type; + std::string coinpaprika_id{"test-coin"}; + std::string coingecko_id{"test-coin"}; + std::string livecoinwatch_id{"test-coin"}; + std::string explorer_url; + std::string tx_uri{"tx/"}; + std::string address_url{"address/"}; + std::string minimal_claim_amount{"0"}; + CoinType coin_type; + nlohmann::json activation_status; + bool segwit{false}; + bool active{false}; + bool checked{false}; + bool wallet_only{false}; + bool is_claimable{false}; + bool has_memos{false}; + bool is_custom_coin{false}; + bool is_faucet_coin{false}; + bool currently_enabled{false}; + bool has_parent_fees_ticker{false}; ///< True if parent fees is different from current ticker eg: ERC20 tokens + bool is_erc_family{false}; + bool is_zhtlc_family{false}; + bool default_coin{false}; + std::optional alias_ticker{std::nullopt}; + std::optional allow_slp_unsafe_conf; + std::optional is_testnet{false}; ///< True if testnet (tBTC, tQTUM, QRC-20 on testnet, tETH) + std::optional utxo_merge{false}; + std::optional swap_contract_address{std::nullopt}; + std::optional fallback_swap_contract_address{std::nullopt}; + std::optional gas_station_url{std::nullopt}; + std::optional matic_gas_station_url{std::nullopt}; + std::optional testnet_matic_gas_station_url{std::nullopt}; + std::optional matic_gas_station_decimals{std::nullopt}; + std::optional custom_backup; + std::optional> other_types; + std::optional electrum_urls; + std::optional urls; + std::optional rpc_urls; + std::optional z_urls; + std::optional eth_family_urls; + std::optional bchd_urls; }; void from_json(const nlohmann::json& j, coin_config& cfg); @@ -83,4 +93,5 @@ namespace atomic_dex void print_coins(std::vector coins); bool is_wallet_only(std::string ticker); bool is_default_coin(std::string ticker); -} // namespace atomic_dex + bool is_faucet_coin(std::string ticker); +} // namespace atomic_dex \ No newline at end of file diff --git a/src/core/atomicdex/constants/dex.constants.hpp b/src/core/atomicdex/constants/dex.constants.hpp index 22944920db..e399e89a06 100644 --- a/src/core/atomicdex/constants/dex.constants.hpp +++ b/src/core/atomicdex/constants/dex.constants.hpp @@ -10,8 +10,16 @@ namespace atomic_dex inline const std::vector g_default_coins{ g_primary_dex_coin, g_second_primary_dex_coin, - "VOTE2023", - "BTC" + "BTC-segwit", + "LTC-segwit", + "DGB-segwit", + }; + inline const std::vector g_faucet_coins{ + "DOC", + "MARTY", + "RICK", + "MORTY", + "ZOMBIE", }; inline const std::vector g_wallet_only_coins{ "ARRR-BEP20", @@ -31,7 +39,6 @@ namespace atomic_dex "REVS", "SUPERNET", "XPM", - "BTC-segwit", "VOTE2023", "ATOM" }; diff --git a/src/core/atomicdex/constants/qt.coins.enums.hpp b/src/core/atomicdex/constants/qt.coins.enums.hpp index 83f70bcc5e..be0c32e824 100644 --- a/src/core/atomicdex/constants/qt.coins.enums.hpp +++ b/src/core/atomicdex/constants/qt.coins.enums.hpp @@ -52,10 +52,13 @@ namespace atomic_dex EthereumClassic = 18, RSK = 19, ZHTLC = 20, - Disabled = 21, - Invalid = 22, - All = 23, - Size = 24 + TENDERMINT = 21, + TENDERMINTTOKEN = 22, + EWT = 23, + Disabled = 24, + Invalid = 25, + All = 26, + Size = 27 }; Q_ENUM(CoinTypeEnum) @@ -65,4 +68,4 @@ namespace atomic_dex }; } // namespace atomic_dex -using CoinType = atomic_dex::CoinTypeGadget::CoinTypeEnum; \ No newline at end of file +using CoinType = atomic_dex::CoinTypeGadget::CoinTypeEnum; diff --git a/src/core/atomicdex/events/events.hpp b/src/core/atomicdex/events/events.hpp index d5e23753ce..c5f34d4e73 100644 --- a/src/core/atomicdex/events/events.hpp +++ b/src/core/atomicdex/events/events.hpp @@ -30,7 +30,6 @@ namespace atomic_dex using gui_leave_trading = entt::tag<"gui_leave_trading"_hs>; using mm2_initialized = entt::tag<"mm2_running_and_enabling"_hs>; using default_coins_enabled = entt::tag<"default_coins_enabled"_hs>; - using band_oracle_refreshed = entt::tag<"band_oracle_refreshed"_hs>; using current_currency_changed = entt::tag<"update_orders_and_swap_values"_hs>; using force_update_providers = entt::tag<"force_update_providers"_hs>; using download_started = entt::tag<"download_started"_hs>; @@ -132,4 +131,4 @@ namespace atomic_dex { std::string message; }; -} // namespace atomic_dex \ No newline at end of file +} // namespace atomic_dex diff --git a/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp b/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp index d8cf145bfe..07783df5f1 100644 --- a/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp +++ b/src/core/atomicdex/models/qt.global.coins.cfg.model.cpp @@ -47,6 +47,7 @@ namespace {"is_erc_family", coin.is_erc_family}, {"is_zhtlc_family", coin.is_zhtlc_family}, {"is_wallet_only", coin.wallet_only}, + {"has_memos", coin.has_memos}, {"fees_ticker", QString::fromStdString(coin.fees_ticker)}}; return j; } @@ -206,7 +207,7 @@ namespace atomic_dex m_enabled_coins[cur.ticker] = cur; } } - cfg.push_back(coin_config{.ticker = "All", .currently_enabled = true, .active = true}); + cfg.push_back(coin_config{.ticker = "All", .active = true, .currently_enabled = true}); SPDLOG_INFO("Initializing global coin cfg model with size {}", cfg.size()); set_checked_nb(0); beginResetModel(); @@ -308,6 +309,12 @@ namespace atomic_dex return m_proxies[CoinType::ERC20]; } + global_coins_cfg_proxy_model* + global_coins_cfg_model::get_all_ewt_proxy() const + { + return m_proxies[CoinType::EWT]; + } + global_coins_cfg_proxy_model* global_coins_cfg_model::get_all_bep20_proxy() const { @@ -398,4 +405,4 @@ namespace atomic_dex auto cfg = get_coin_info(ticker.toStdString()); return QString::fromStdString(cfg.fees_ticker); } -} // namespace atomic_dex \ No newline at end of file +} // namespace atomic_dex diff --git a/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp b/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp index f64b244322..17ceb76bbb 100644 --- a/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp +++ b/src/core/atomicdex/models/qt.global.coins.cfg.model.hpp @@ -83,6 +83,7 @@ namespace atomic_dex [[nodiscard]] global_coins_cfg_proxy_model* get_all_proxy() const; [[nodiscard]] global_coins_cfg_proxy_model* get_all_qrc20_proxy() const; [[nodiscard]] global_coins_cfg_proxy_model* get_all_erc20_proxy() const; + [[nodiscard]] global_coins_cfg_proxy_model* get_all_ewt_proxy() const; [[nodiscard]] global_coins_cfg_proxy_model* get_all_bep20_proxy() const; [[nodiscard]] global_coins_cfg_proxy_model* get_all_smartchains_proxy() const; [[nodiscard]] global_coins_cfg_proxy_model* get_all_utxo_proxy() const; @@ -104,6 +105,7 @@ namespace atomic_dex Q_PROPERTY(global_coins_cfg_proxy_model* all_proxy READ get_all_proxy NOTIFY all_proxyChanged) Q_PROPERTY(global_coins_cfg_proxy_model* all_qrc20_proxy READ get_all_qrc20_proxy NOTIFY all_qrc20_proxyChanged) Q_PROPERTY(global_coins_cfg_proxy_model* all_erc20_proxy READ get_all_erc20_proxy NOTIFY all_erc20_proxyChanged) + Q_PROPERTY(global_coins_cfg_proxy_model* all_ewt_proxy READ get_all_ewt_proxy NOTIFY all_ewt_proxyChanged) Q_PROPERTY(global_coins_cfg_proxy_model* all_bep20_proxy READ get_all_bep20_proxy NOTIFY all_bep20_proxyChanged) Q_PROPERTY(global_coins_cfg_proxy_model* all_smartchains_proxy READ get_all_smartchains_proxy NOTIFY all_smartchains_proxyChanged) Q_PROPERTY(global_coins_cfg_proxy_model* all_utxo_proxy READ get_all_utxo_proxy NOTIFY all_utxo_proxyChanged) @@ -119,6 +121,7 @@ namespace atomic_dex void all_proxyChanged(); void all_qrc20_proxyChanged(); void all_erc20_proxyChanged(); + void all_ewt_proxyChanged(); void all_bep20_proxyChanged(); void all_smartchains_proxyChanged(); void all_utxo_proxyChanged(); @@ -139,4 +142,4 @@ namespace atomic_dex entt::registry& m_entity_registry; }; -} // namespace atomic_dex \ No newline at end of file +} // namespace atomic_dex diff --git a/src/core/atomicdex/models/qt.orderbook.model.cpp b/src/core/atomicdex/models/qt.orderbook.model.cpp index d2e4321978..3abd2b6151 100644 --- a/src/core/atomicdex/models/qt.orderbook.model.cpp +++ b/src/core/atomicdex/models/qt.orderbook.model.cpp @@ -362,8 +362,9 @@ namespace atomic_dex } void - orderbook_model::reset_orderbook(const t_orders_contents& orderbook) + orderbook_model::reset_orderbook(const t_orders_contents& orderbook, bool is_bestorders) { + SPDLOG_DEBUG("[orderbook_model::reset_orderbook]"); if (!orderbook.empty()) { SPDLOG_INFO( @@ -374,10 +375,6 @@ namespace atomic_dex m_orders_id_registry.clear(); for (auto&& order: m_model_data) { - if (order.coin.find("-segwit") != std::string::npos) - { - order.uuid = order.uuid + "-segwit"; - } if (this->m_orders_id_registry.find(order.uuid) == m_orders_id_registry.end()) { this->m_orders_id_registry.emplace(order.uuid); @@ -385,6 +382,8 @@ namespace atomic_dex } this->endResetModel(); emit lengthChanged(); + // This assert was causing a crash due to duplicated UUIDs being filtered out for orders that exist for both segwit and non-segwit of a coin, + // because bestorders response will add duplicate entries (one for each address format) to the response. assert(m_model_data.size() == m_orders_id_registry.size()); } @@ -403,7 +402,6 @@ namespace atomic_dex SPDLOG_WARN("Order with uuid: {} already present...skipping.", order.uuid); return; } - assert(m_model_data.size() == m_orders_id_registry.size()); beginInsertRows(QModelIndex(), m_model_data.size(), m_model_data.size()); m_model_data.push_back(order); @@ -441,7 +439,6 @@ namespace atomic_dex { //! ID Found, update ! const QModelIndex& idx = res.at(0); - const auto uuid_to_be_updated = this->data(idx, OrderbookRoles::UUIDRole).toString().toStdString(); auto&& [_, new_price, is_price_changed] = update_value(OrderbookRoles::PriceRole, QString::fromStdString(order.price), idx, *this); update_value(OrderbookRoles::PriceNumerRole, QString::fromStdString(order.price_fraction_numer), idx, *this); update_value(OrderbookRoles::PriceDenomRole, QString::fromStdString(order.price_fraction_denom), idx, *this); @@ -522,19 +519,19 @@ namespace atomic_dex } void - orderbook_model::refresh_orderbook(const t_orders_contents& orderbook) + orderbook_model::refresh_orderbook(const t_orders_contents& orderbook, bool is_bestorders) { auto refresh_functor = [this](const std::vector& contents) { - for (auto&& current_order: contents) + for (auto&& order: contents) { - if (this->m_orders_id_registry.find(current_order.uuid) != this->m_orders_id_registry.end()) + if (this->m_orders_id_registry.find(order.uuid) != this->m_orders_id_registry.end()) { - this->update_order(current_order); + this->update_order(order); } else { - this->initialize_order(current_order); + this->initialize_order(order); } } @@ -543,7 +540,8 @@ namespace atomic_dex for (auto&& id: this->m_orders_id_registry) { bool res = std::none_of(begin(contents), end(contents), [id](auto&& contents) { return contents.uuid == id; }); - //! Need to remove the row + // Need to remove the row + // segwits are deleted here when they shouldnt be if (res) { auto res_list = this->match(index(0, 0), UUIDRole, QString::fromStdString(id)); @@ -621,6 +619,7 @@ namespace atomic_dex return m_current_orderbook_kind; } + // This is used when betterOrderDetected QVariantMap orderbook_model::get_order_from_uuid([[maybe_unused]] QString uuid) { diff --git a/src/core/atomicdex/models/qt.orderbook.model.hpp b/src/core/atomicdex/models/qt.orderbook.model.hpp index 6e320e68f9..0e74f3d645 100644 --- a/src/core/atomicdex/models/qt.orderbook.model.hpp +++ b/src/core/atomicdex/models/qt.orderbook.model.hpp @@ -88,8 +88,8 @@ namespace atomic_dex bool setData(const QModelIndex& index, const QVariant& value, int role) final; bool removeRows(int row, int count, const QModelIndex& parent) override; - void reset_orderbook(const t_orders_contents& orderbook); - void refresh_orderbook(const t_orders_contents& orderbook); + void reset_orderbook(const t_orders_contents& orderbook, bool is_bestorders=false); + void refresh_orderbook(const t_orders_contents& orderbook, bool is_bestorders=false); void clear_orderbook(); [[nodiscard]] int get_length() const; [[nodiscard]] orderbook_proxy_model* get_orderbook_proxy() const; diff --git a/src/core/atomicdex/models/qt.portfolio.model.cpp b/src/core/atomicdex/models/qt.portfolio.model.cpp index 24e70efad8..c0f8f892eb 100644 --- a/src/core/atomicdex/models/qt.portfolio.model.cpp +++ b/src/core/atomicdex/models/qt.portfolio.model.cpp @@ -399,6 +399,17 @@ namespace atomic_dex return true; } + QString + portfolio_model::coin_balance(QString coin) + { + auto res = this->match(this->index(0, 0), TickerRole, coin, 1, Qt::MatchFlag::MatchExactly); + // assert(not res.empty()); + if (not res.empty()) + { + return QString(this->data(res.at(0), BalanceRole).toString()); + } + } + void portfolio_model::disable_coins(const QStringList& coins) { @@ -522,7 +533,12 @@ namespace atomic_dex QString amount = QString::fromStdString(amount_f.str(8, std::ios_base::fixed)); qint64 timestamp = duration_cast(system_clock::now().time_since_epoch()).count(); QString human_date = QString::fromStdString(utils::to_human_date(timestamp, "%e %b %Y, %H:%M")); - this->m_dispatcher.trigger(am_i_sender, amount, ticker, human_date, timestamp); + // Logs showed `balance update notification: am_i_sender: false amount: 0.00000000 ticker: USDT-SLP` sometimes, just before a crash. + // This is a temporary fix to see if it prevents the crash. + if (amount_f > 0.0) + { + this->m_dispatcher.trigger(am_i_sender, amount, ticker, human_date, timestamp); + } emit portfolioItemDataChanged(); } diff --git a/src/core/atomicdex/models/qt.portfolio.model.hpp b/src/core/atomicdex/models/qt.portfolio.model.hpp index 9ed6e57ff1..fb0d99bcc7 100644 --- a/src/core/atomicdex/models/qt.portfolio.model.hpp +++ b/src/core/atomicdex/models/qt.portfolio.model.hpp @@ -96,18 +96,19 @@ namespace atomic_dex Q_INVOKABLE void clean_priv_keys(); //! Public api - void initialize_portfolio(const std::vector& tickers); - bool update_currency_values(); - bool update_balance_values(const std::vector& tickers); - void adjust_percent_current_currency(QString balance_all); - void disable_coins(const QStringList& coins); - void set_cfg(atomic_dex::cfg& cfg); - [[nodiscard]] t_portfolio_datas get_underlying_data() const; + void initialize_portfolio(const std::vector& tickers); + bool update_currency_values(); + bool update_balance_values(const std::vector& tickers); + void adjust_percent_current_currency(QString balance_all); + void disable_coins(const QStringList& coins); + void set_cfg(atomic_dex::cfg& cfg); + [[nodiscard]] t_portfolio_datas get_underlying_data() const; + [[nodiscard]] Q_INVOKABLE QString coin_balance(QString coin); //! Properties - [[nodiscard]] portfolio_proxy_model* get_portfolio_proxy_mdl() const; - [[nodiscard]] portfolio_proxy_model* get_pie_char_proxy_mdl() const; - [[nodiscard]] int get_length() const; + [[nodiscard]] portfolio_proxy_model* get_portfolio_proxy_mdl() const; + [[nodiscard]] portfolio_proxy_model* get_pie_char_proxy_mdl() const; + [[nodiscard]] int get_length() const; void reset(); diff --git a/src/core/atomicdex/pages/qt.portfolio.page.cpp b/src/core/atomicdex/pages/qt.portfolio.page.cpp index 51e1971b0c..3b0663bd07 100644 --- a/src/core/atomicdex/pages/qt.portfolio.page.cpp +++ b/src/core/atomicdex/pages/qt.portfolio.page.cpp @@ -23,7 +23,6 @@ #include "atomicdex/pages/qt.wallet.page.hpp" #include "atomicdex/services/price/coingecko/coingecko.wallet.charts.hpp" #include "atomicdex/services/price/global.provider.hpp" -#include "atomicdex/services/price/oracle/band.provider.hpp" namespace atomic_dex { @@ -33,7 +32,6 @@ namespace atomic_dex { emit portfolioChanged(); this->dispatcher_.sink().connect<&portfolio_page::on_update_portfolio_values_event>(*this); - this->dispatcher_.sink().connect<&portfolio_page::on_band_oracle_refreshed>(*this); this->dispatcher_.sink().connect<&portfolio_page::on_coin_cfg_parsed>(*this); SPDLOG_INFO("portfolio_page created"); } @@ -51,28 +49,6 @@ namespace atomic_dex portfolio_page::~portfolio_page() {} - QStringList - portfolio_page::get_oracle_price_supported_pairs() const - { - auto result = m_system_manager.get_system().supported_pair(); - QStringList out; - out.reserve(result.size()); - for (auto&& cur: result) { out.push_back(QString::fromStdString(cur)); } - return out; - } - - QString - portfolio_page::get_oracle_last_price_reference() const - { - return QString::fromStdString(m_system_manager.get_system().last_oracle_reference()); - } - - void - portfolio_page::on_band_oracle_refreshed(const band_oracle_refreshed&) - { - emit oraclePriceUpdated(); - } - void portfolio_page::set_current_balance_fiat_all(QString current_fiat_all_balance) { diff --git a/src/core/atomicdex/pages/qt.portfolio.page.hpp b/src/core/atomicdex/pages/qt.portfolio.page.hpp index 3f7b4a7d4d..7aa469e625 100644 --- a/src/core/atomicdex/pages/qt.portfolio.page.hpp +++ b/src/core/atomicdex/pages/qt.portfolio.page.hpp @@ -35,8 +35,6 @@ namespace atomic_dex //! Properties Q_PROPERTY(portfolio_model* portfolio_mdl READ get_portfolio NOTIFY portfolioChanged) - Q_PROPERTY(QString oracle_last_price_reference READ get_oracle_last_price_reference NOTIFY oraclePriceUpdated) - Q_PROPERTY(QStringList oracle_price_supported_pairs READ get_oracle_price_supported_pairs NOTIFY oraclePriceUpdated) Q_PROPERTY(QString balance_fiat_all READ get_balance_fiat_all WRITE set_current_balance_fiat_all NOTIFY onFiatBalanceAllChanged) Q_PROPERTY(QString main_balance_fiat_all READ get_main_balance_fiat_all NOTIFY onMainFiatBalanceAllChanged) Q_PROPERTY(global_coins_cfg_model* global_cfg_mdl READ get_global_cfg NOTIFY globalCfgMdlChanged) @@ -69,8 +67,6 @@ namespace atomic_dex [[nodiscard]] portfolio_model* get_portfolio() const; [[nodiscard]] global_coins_cfg_model* get_global_cfg() const; - [[nodiscard]] QString get_oracle_last_price_reference() const; - [[nodiscard]] QStringList get_oracle_price_supported_pairs() const; [[nodiscard]] Q_INVOKABLE QStringList get_all_enabled_coins() const; [[nodiscard]] Q_INVOKABLE QStringList get_all_coins_by_type(const QString& coin_type) const; [[nodiscard]] Q_INVOKABLE bool is_coin_enabled(const QString& coin_name) const; @@ -89,13 +85,11 @@ namespace atomic_dex [[nodiscard]] QString get_max_total_chart() const; //! Events - void on_band_oracle_refreshed([[maybe_unused]] const band_oracle_refreshed& evt); void on_update_portfolio_values_event(const update_portfolio_values&); void on_coin_cfg_parsed(const coin_cfg_parsed& evt); signals: void portfolioChanged(); - void oraclePriceUpdated(); void onFiatBalanceAllChanged(); void onMainFiatBalanceAllChanged(); void globalCfgMdlChanged(); diff --git a/src/core/atomicdex/pages/qt.settings.page.cpp b/src/core/atomicdex/pages/qt.settings.page.cpp index 1183ad18cb..269a204bd4 100644 --- a/src/core/atomicdex/pages/qt.settings.page.cpp +++ b/src/core/atomicdex/pages/qt.settings.page.cpp @@ -32,6 +32,7 @@ #include "atomicdex/models/qt.global.coins.cfg.model.hpp" #include "atomicdex/pages/qt.portfolio.page.hpp" #include "atomicdex/pages/qt.settings.page.hpp" +#include "atomicdex/pages/qt.wallet.page.hpp" #include "atomicdex/services/mm2/mm2.service.hpp" #include "atomicdex/services/price/coingecko/coingecko.wallet.charts.hpp" #include "atomicdex/services/price/global.provider.hpp" @@ -136,6 +137,25 @@ namespace atomic_dex emit onLangChanged(); } + bool atomic_dex::settings_page::is_spamfilter_enabled() const + { + return m_config.spamfilter_enabled; + } + + void settings_page::set_spamfilter_enabled(bool is_enabled) + { + if (m_config.spamfilter_enabled != is_enabled) + { + + auto& mm2 = m_system_manager.get_system(); + auto& wallet_pg = m_system_manager.get_system(); + QString ticker = QString::fromStdString(mm2.get_current_ticker()); + change_spamfilter_status(m_config, is_enabled); + emit onSpamFilterEnabledChanged(); + wallet_pg.set_current_ticker(ticker, true); + } + } + bool atomic_dex::settings_page::is_notification_enabled() const { return m_config.notification_enabled; diff --git a/src/core/atomicdex/pages/qt.settings.page.hpp b/src/core/atomicdex/pages/qt.settings.page.hpp index d1dd6712cb..874e76aaf9 100644 --- a/src/core/atomicdex/pages/qt.settings.page.hpp +++ b/src/core/atomicdex/pages/qt.settings.page.hpp @@ -45,6 +45,7 @@ namespace atomic_dex Q_PROPERTY(QString current_fiat_sign READ get_current_fiat_sign NOTIFY onFiatSignChanged) Q_PROPERTY(QString current_fiat READ get_current_fiat WRITE set_current_fiat NOTIFY onFiatChanged) Q_PROPERTY(bool notification_enabled READ is_notification_enabled WRITE set_notification_enabled NOTIFY onNotificationEnabledChanged) + Q_PROPERTY(bool spamfilter_enabled READ is_spamfilter_enabled WRITE set_spamfilter_enabled NOTIFY onSpamFilterEnabledChanged) Q_PROPERTY(QVariant custom_token_data READ get_custom_token_data WRITE set_custom_token_data NOTIFY customTokenDataChanged) Q_PROPERTY(bool fetching_custom_token_data_busy READ is_fetching_custom_token_data_busy WRITE set_fetching_custom_token_data_busy NOTIFY customTokenDataStatusChanged) Q_PROPERTY(bool fetching_priv_keys_busy READ is_fetching_priv_key_busy WRITE set_fetching_priv_key_busy NOTIFY privKeyStatusChanged) @@ -82,6 +83,8 @@ namespace atomic_dex [[nodiscard]] QString get_current_fiat() const; [[nodiscard]] bool is_notification_enabled() const; void set_notification_enabled(bool is_enabled); + [[nodiscard]] bool is_spamfilter_enabled() const; + void set_spamfilter_enabled(bool is_enabled); void set_current_currency(const QString& current_currency); void set_current_fiat(const QString& current_fiat); [[nodiscard]] bool is_fetching_custom_token_data_busy() const; @@ -124,6 +127,7 @@ namespace atomic_dex void onFiatSignChanged(); void onFiatChanged(); void onNotificationEnabledChanged(); + void onSpamFilterEnabledChanged(); void customTokenDataChanged(); void customTokenDataStatusChanged(); void privKeyStatusChanged(); diff --git a/src/core/atomicdex/pages/qt.trading.page.cpp b/src/core/atomicdex/pages/qt.trading.page.cpp index b273ba7e52..a58a581e0a 100644 --- a/src/core/atomicdex/pages/qt.trading.page.cpp +++ b/src/core/atomicdex/pages/qt.trading.page.cpp @@ -488,24 +488,31 @@ namespace atomic_dex if (!ec) { + // SPDLOG_DEBUG("[process_action::post_process_orderbook_finished]"); auto* wrapper = get_orderbook_wrapper(); m_models_actions[orderbook_need_a_reset] ? wrapper->reset_orderbook(result) : wrapper->refresh_orderbook(result); if (m_models_actions[orderbook_need_a_reset] && this->m_current_trading_mode == TradingModeGadget::Pro) { // This goes to a function which looks like it is for bot trading. We dont need to run it at this stage. - // this->set_preferred_settings(); + this->set_preferred_settings(); } else { const auto base_max_taker_vol = safe_float(wrapper->get_base_max_taker_vol().toJsonObject()["decimal"].toString().toStdString()); + // SPDLOG_DEBUG("[base_max_taker_vol]: {}", wrapper->get_base_max_taker_vol().toJsonObject()["decimal"].toString().toStdString()); auto rel_max_taker = wrapper->get_rel_max_taker_vol().toJsonObject()["decimal"].toString().toStdString(); + // SPDLOG_DEBUG("[rel_max_taker]: {}", wrapper->get_rel_max_taker_vol().toJsonObject()["decimal"].toString().toStdString()); + if (rel_max_taker.empty()) { rel_max_taker = "0"; } + const auto rel_max_taker_vol = safe_float(rel_max_taker); t_float_50 min_vol = safe_float(m_minimal_trading_amount.toStdString()); + // SPDLOG_DEBUG("[min_vol]: {}", m_minimal_trading_amount.toStdString()); + auto adjust_functor = [this, wrapper]() { if (m_post_clear_forms && this->m_current_trading_mode == TradingModeGadget::Pro) @@ -519,6 +526,7 @@ namespace atomic_dex if ((m_market_mode == MarketMode::Buy && rel_max_taker_vol > 0 && min_vol <= 0) || (m_market_mode == MarketMode::Sell && base_max_taker_vol > 0 && min_vol <= 0)) { + // SPDLOG_DEBUG("[adjust_functor()]: Adjusting...."); adjust_functor(); } } diff --git a/src/core/atomicdex/pages/qt.wallet.page.cpp b/src/core/atomicdex/pages/qt.wallet.page.cpp index ec0fd4e477..14f35759b5 100644 --- a/src/core/atomicdex/pages/qt.wallet.page.cpp +++ b/src/core/atomicdex/pages/qt.wallet.page.cpp @@ -14,9 +14,9 @@ #include "atomicdex/api/mm2/rpc.convertaddress.hpp" #include "atomicdex/api/mm2/rpc.electrum.hpp" #include "atomicdex/api/mm2/rpc.validate.address.hpp" -#include "atomicdex/api/mm2/rpc.withdraw.hpp" -#include "atomicdex/api/mm2/rpc2.init_withdraw.hpp" -#include "atomicdex/api/mm2/rpc2.withdraw_status.hpp" +#include "atomicdex/api/mm2/rpc2.withdraw.hpp" +#include "atomicdex/api/mm2/rpc2.task.withdraw.init.hpp" +#include "atomicdex/api/mm2/rpc2.task.withdraw.status.hpp" #include "atomicdex/services/mm2/mm2.service.hpp" #include "atomicdex/services/price/global.provider.hpp" #include "atomicdex/services/price/komodo_prices/komodo.prices.provider.hpp" @@ -107,11 +107,11 @@ namespace atomic_dex return QString::fromStdString(mm2_system.get_current_ticker()); } - void wallet_page::set_current_ticker(const QString& ticker) + void wallet_page::set_current_ticker(const QString& ticker, bool force) { auto& mm2_system = m_system_manager.get_system(); auto coin_info = mm2_system.get_coin_info(ticker.toStdString()); - if (mm2_system.set_current_ticker(ticker.toStdString())) + if (mm2_system.set_current_ticker(ticker.toStdString()) || force) { SPDLOG_INFO("new ticker: {}", ticker.toStdString()); m_transactions_mdl->reset(); @@ -267,10 +267,9 @@ namespace atomic_dex {"blocks_left", 1}, {"transactions_left", 0}, {"current_block", 1}, - {"is_smartchain_test_coin", false}, + {"is_faucet_coin", false}, {"qrcode_address", ""}, - {"segwit_supported", false}, - {"is_segwit_on", false}}; + {"segwit_supported", false}}; std::error_code ec; auto& mm2_system = m_system_manager.get_system(); if (mm2_system.is_mm2_running()) @@ -285,11 +284,9 @@ namespace atomic_dex obj["name"] = QString::fromStdString(coin_info.name); obj["type"] = QString::fromStdString(coin_info.type); obj["segwit_supported"] = coin_info.segwit; - obj["is_segwit_on"] = coin_info.is_segwit_on; obj["has_parent_fees_ticker"] = coin_info.has_parent_fees_ticker; obj["fees_ticker"] = QString::fromStdString(coin_info.fees_ticker); obj["is_claimable"] = coin_info.is_claimable; - obj["address"] = QString::fromStdString(mm2_system.address(ticker, ec)); obj["minimal_balance_for_asking_rewards"] = QString::fromStdString(coin_info.minimal_claim_amount); obj["explorer_url"] = QString::fromStdString(coin_info.explorer_url); obj["current_currency_ticker_price"] = QString::fromStdString(price_service.get_rate_conversion(config.current_currency, ticker, true)); @@ -299,15 +296,26 @@ namespace atomic_dex obj["fiat_amount"] = QString::fromStdString(price_service.get_price_in_fiat(config.current_currency, ticker, ec)); obj["activation_status"] = nlohmann_json_object_to_qt_json_object(coin_info.activation_status); obj["trend_7d"] = nlohmann_json_array_to_qt_json_array(provider.get_ticker_historical(ticker)); - obj["fee_ticker"] = QString::fromStdString(coin_info.fees_ticker); - obj["blocks_left"] = static_cast(tx_state.blocks_left); - obj["transactions_left"] = static_cast(tx_state.transactions_left); - obj["current_block"] = static_cast(tx_state.current_block); - obj["is_smartchain_test_coin"] = coin_info.ticker == "RICK" || coin_info.ticker == "MORTY" || coin_info.ticker == "ZOMBIE"; + obj["fee_ticker"] = QString::fromStdString(coin_info.fees_ticker); + obj["blocks_left"] = static_cast(tx_state.blocks_left); + obj["transactions_left"] = static_cast(tx_state.transactions_left); + obj["current_block"] = static_cast(tx_state.current_block); + obj["is_faucet_coin"] = coin_info.is_faucet_coin; + std::error_code ec; - qrcodegen::QrCode qr0 = qrcodegen::QrCode::encodeText(mm2_system.address(ticker, ec).c_str(), qrcodegen::QrCode::Ecc::MEDIUM); - std::string svg = qr0.toSvgString(2); - obj["qrcode_address"] = QString::fromStdString("data:image/svg+xml;base64,") + QString::fromStdString(svg).toLocal8Bit().toBase64(); + if (!mm2_system.is_zhtlc_coin_ready(coin_info.ticker)) + { + obj["address"] = "activating"; + obj["qrcode_address"] = ""; + + } + else + { + obj["address"] = QString::fromStdString(mm2_system.address(ticker, ec)); + qrcodegen::QrCode qr0 = qrcodegen::QrCode::encodeText(mm2_system.address(ticker, ec).c_str(), qrcodegen::QrCode::Ecc::MEDIUM); + std::string svg = qr0.toSvgString(2); + obj["qrcode_address"] = QString::fromStdString("data:image/svg+xml;base64,") + QString::fromStdString(svg).toLocal8Bit().toBase64(); + } } return obj; } @@ -496,7 +504,7 @@ namespace atomic_dex } void - wallet_page::send(const QString& address, const QString& amount, bool max, bool with_fees, QVariantMap fees_data) + wallet_page::send(const QString& address, const QString& amount, bool max, bool with_fees, QVariantMap fees_data, const QString& memo) { //! Preparation this->set_send_busy(true); @@ -507,20 +515,20 @@ namespace atomic_dex if (coin_info.is_zhtlc_family) { - t_init_withdraw_request init_withdraw_req{.coin = ticker, .to = address.toStdString(), .amount = max ? "0" : amount.toStdString(), .max = max}; + t_withdraw_init_request withdraw_init_req{.coin = ticker, .to = address.toStdString(), .amount = max ? "0" : amount.toStdString(), .memo = memo.toStdString(), .max = max}; if (with_fees) { qDebug() << fees_data; auto json_fees = nlohmann::json::parse(QString(QJsonDocument(QVariant(fees_data).toJsonObject()).toJson()).toStdString()); - init_withdraw_req.fees = t_init_withdraw_fees{ + withdraw_init_req.fees = t_withdraw_init_fees{ .type = "UtxoFixed", .amount = json_fees.at("fees_amount").get() }; } - nlohmann::json json_data = mm2::template_request("init_withdraw", true); + nlohmann::json json_data = mm2::template_request("task::withdraw::init", true); - mm2::to_json(json_data, init_withdraw_req); + mm2::to_json(json_data, withdraw_init_req); batch.push_back(json_data); std::string amount_std = amount.toStdString(); @@ -548,12 +556,13 @@ namespace atomic_dex using namespace std::chrono_literals; auto& mm2_system = m_system_manager.get_system(); static std::size_t z_nb_try = 1; + static std::size_t loop_limit = 600; nlohmann::json z_error = nlohmann::json::array(); nlohmann::json z_batch_array = nlohmann::json::array(); QString z_status; t_withdraw_status_request z_request{.task_id = task_id}; - nlohmann::json j = mm2::template_request("withdraw_status", true); + nlohmann::json j = mm2::template_request("task::withdraw::status", true); mm2::to_json(j, z_request); z_batch_array.push_back(j); @@ -564,19 +573,19 @@ namespace atomic_dex z_error = z_answers; z_status = QString::fromStdString(z_answers[0].at("result").at("status").get()); - SPDLOG_DEBUG("[{}/120] Waiting for {} withdraw status [{}]...", z_nb_try, ticker, z_status.toUtf8().constData()); - if (z_status == "Ready") + SPDLOG_DEBUG("[{}/{}] Waiting for {} withdraw status [{}]...", z_nb_try, loop_limit, ticker, z_status.toUtf8().constData()); + if (z_status == "Ok") { break; } else { - set_withdraw_status("Generating transaction... "); + set_withdraw_status("Generating transaction"); } std::this_thread::sleep_for(2s); z_nb_try += 1; - } while (z_nb_try < 120); + } while (z_nb_try < loop_limit); try { if (z_error[0].at("result").at("details").contains("error")) @@ -585,7 +594,7 @@ namespace atomic_dex z_status = QString::fromStdString(z_error[0].at("result").at("details").at("error").get()); set_withdraw_status(z_status); } - else if (z_nb_try == 120) + else if (z_nb_try == loop_limit) { // TODO: Handle this case. // There could be no error message if scanning takes too long. @@ -596,9 +605,9 @@ namespace atomic_dex } else { - auto withdraw_answer = mm2::rpc_process_answer_batch(z_error[0], "withdraw_status"); + auto withdraw_answer = mm2::rpc_process_answer_batch(z_error[0], "task::withdraw::status"); nlohmann::json j_out = nlohmann::json::object(); - j_out["withdraw_answer"] = z_error[0]["result"]["details"]["result"]; + j_out["withdraw_answer"] = z_error[0]["result"]["details"]; j_out.at("withdraw_answer")["date"] = withdraw_answer.result.value().timestamp_as_date; // Add total amount in fiat currency. @@ -632,7 +641,6 @@ namespace atomic_dex j_out["withdraw_answer"]["fee_details"]["amount_fiat"] = global_price_system.get_price_as_currency_from_amount(current_fiat, coin_info.fees_ticker, fee); } - SPDLOG_DEBUG("zhtlc set_rpc_send_data (else)"); this->set_rpc_send_data(nlohmann_json_object_to_qt_json_object(j_out)); set_withdraw_status("Complete"); } @@ -676,7 +684,13 @@ namespace atomic_dex } else { - t_withdraw_request withdraw_req{.coin = ticker, .to = address.toStdString(), .amount = max ? "0" : amount.toStdString(), .max = max}; + t_withdraw_request withdraw_req{ + .coin = ticker, + .to = address.toStdString(), + .amount = max ? "0" : amount.toStdString(), + .memo = memo.toStdString(), + .max = max + }; if (with_fees) { @@ -977,16 +991,32 @@ namespace atomic_dex if (!evt.with_error && QString::fromStdString(evt.ticker) == get_current_ticker()) { std::error_code ec; + const auto& settings = m_system_manager.get_system(); t_transactions transactions = m_system_manager.get_system().get_tx_history(ec); + t_transactions to_init; + if (settings.is_spamfilter_enabled()) + { + for (auto&& cur_tx: transactions) + { + if (safe_float(cur_tx.total_amount) != 0) + { + to_init.push_back(cur_tx); + } + } + } + else + { + to_init = transactions; + } if (m_transactions_mdl->rowCount() == 0) { //! insert all transactions - m_transactions_mdl->init_transactions(transactions); + m_transactions_mdl->init_transactions(to_init); } else { //! Update tx (only unconfirmed) or insert (new tx) - m_transactions_mdl->update_or_insert_transactions(transactions); + m_transactions_mdl->update_or_insert_transactions(to_init); } if (ec) { @@ -1141,107 +1171,4 @@ namespace atomic_dex m_converted_address = converted_address; emit convertedAddressChanged(); } - - QString - wallet_page::switch_address_mode(bool checked) - { - auto& mm2_system = m_system_manager.get_system(); - std::string address = ""; - if (mm2_system.is_mm2_running()) - { - const auto ticker = get_current_ticker().toStdString(); - const auto coin_cfg = mm2_system.get_coin_info(ticker); - if (coin_cfg.segwit) - { - nlohmann::json address_format = nlohmann::json::object(); - address_format = {{"format", "segwit"}}; - if (!checked) - { - //! We go from segwit to legacy - if (coin_cfg.ticker != "BCH") - { - address_format = {{"format", "standard"}}; - } - else - { - address_format = {{"format", "bch"}}; - } - } - - - std::error_code ec; - address = mm2_system.address(ticker, ec); - t_convert_address_request req{.coin = ticker, .from = address, .to_address_format = address_format}; - nlohmann::json batch = nlohmann::json::array(); - nlohmann::json json_data = mm2::template_request("convertaddress"); - mm2::to_json(json_data, req); - batch.push_back(json_data); - json_data["userpass"] = "******"; - SPDLOG_INFO("convertaddress request: {}", json_data.dump()); - web::http::http_response resp = mm2_system.get_mm2_client().async_rpc_batch_standalone(batch).get(); - std::string body = TO_STD_STR(resp.extract_string(true).get()); - SPDLOG_DEBUG("resp convertaddress: {}", body); - if (resp.status_code() == static_cast(antara::app::http_code::ok)) - { - auto answers = nlohmann::json::parse(body); - auto convert_answer = mm2::rpc_process_answer_batch(answers[0], "convertaddress"); - if (convert_answer.result.has_value()) - { - return QString::fromStdString(convert_answer.result.value().address); - } - } - } - } - return QString::fromStdString(address); - } - - void - wallet_page::post_switch_address_mode(bool is_segwit) - { - SPDLOG_INFO("switching to : {}", is_segwit ? "segwit" : "legacy"); - auto& mm2_system = m_system_manager.get_system(); - if (mm2_system.is_mm2_running()) - { - //! Need disable + enable + refresh balance + refresh current coin info (address) + change segwit in cfg - const auto ticker = get_current_ticker().toStdString(); - nlohmann::json batch = nlohmann::json::array(); - nlohmann::json json_data = mm2::template_request("disable_coin"); - t_disable_coin_request req{.coin = ticker}; - mm2::to_json(json_data, req); - batch.push_back(json_data); - //! Disable is in the batch - - //! electrum - auto coin_info = mm2_system.get_coin_info(ticker); - t_electrum_request electrum_req{ - .coin_name = coin_info.ticker, .servers = coin_info.electrum_urls.value(), .coin_type = coin_info.coin_type, .with_tx_history = true}; - if (is_segwit) - { - electrum_req.address_format = nlohmann::json::object(); - electrum_req.address_format.value()["format"] = "segwit"; - } - nlohmann::json electrum_data = mm2::template_request("electrum"); - mm2::to_json(electrum_data, electrum_req); - batch.push_back(electrum_data); - electrum_data["userpass"] = "*******"; - SPDLOG_INFO("electrum_req: {}", electrum_data.dump(-1)); - - //! Answer functor - auto answer_functor = [this, ticker, is_segwit](web::http::http_response resp) - { - std::string body = TO_STD_STR(resp.extract_string(true).get()); - SPDLOG_DEBUG("resp disable/enable: {}", body); - if (resp.status_code() == static_cast(antara::app::http_code::ok)) - { - auto& mm2_system = m_system_manager.get_system(); - mm2_system.change_segwit_status(ticker, is_segwit); - mm2_system.fetch_infos_thread(true, false); - SPDLOG_INFO("Switching address mode success"); - } - }; - - //! Rpc processing - mm2_system.get_mm2_client().async_rpc_batch_standalone(batch).then(answer_functor).then(&handle_exception_pplx_task); - } - } } // namespace atomic_dex \ No newline at end of file diff --git a/src/core/atomicdex/pages/qt.wallet.page.hpp b/src/core/atomicdex/pages/qt.wallet.page.hpp index 033699279b..8e52e47568 100644 --- a/src/core/atomicdex/pages/qt.wallet.page.hpp +++ b/src/core/atomicdex/pages/qt.wallet.page.hpp @@ -30,7 +30,7 @@ namespace atomic_dex // Getters/Setters [[nodiscard]] transactions_model* get_transactions_mdl() const; [[nodiscard]] QString get_current_ticker() const; - void set_current_ticker(const QString& ticker); + void set_current_ticker(const QString& ticker, bool force = false); [[nodiscard]] QVariant get_ticker_infos() const; [[nodiscard]] bool is_broadcast_busy() const; void set_broadcast_busy(bool status); @@ -88,9 +88,7 @@ namespace atomic_dex bool is_auth, const QString& tx_hex, bool is_claiming, bool is_max, const QString& amount); // Broadcast requires OS local user credentials verification. This is called by the Q_INVOKABLE broadcast() method after // entering credentials. - Q_INVOKABLE void send(const QString& address, const QString& amount, bool max, bool with_fees, QVariantMap fees_data); - Q_INVOKABLE QString switch_address_mode(bool checked); - Q_INVOKABLE void post_switch_address_mode(bool is_segwit); + Q_INVOKABLE void send(const QString& address, const QString& amount, bool max, bool with_fees, QVariantMap fees_data, const QString& memo); // QML API Properties Q_PROPERTY(transactions_model* transactions_mdl READ get_transactions_mdl NOTIFY transactionsMdlChanged) diff --git a/src/core/atomicdex/pages/widgets/dex/qt.orderbook.cpp b/src/core/atomicdex/pages/widgets/dex/qt.orderbook.cpp index 3f9eb34d2d..d8c68184ef 100644 --- a/src/core/atomicdex/pages/widgets/dex/qt.orderbook.cpp +++ b/src/core/atomicdex/pages/widgets/dex/qt.orderbook.cpp @@ -91,12 +91,12 @@ namespace atomic_dex else if (m_best_orders->rowCount() == 0) { // SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook] : reset_best_orders"); - m_best_orders->reset_orderbook(data); + m_best_orders->reset_orderbook(data, true); } else { // SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook] : refresh_best_orders"); - m_best_orders->refresh_orderbook(data); + m_best_orders->refresh_orderbook(data, true); } this->set_both_taker_vol(); } diff --git a/src/core/atomicdex/services/internet/internet.checker.service.cpp b/src/core/atomicdex/services/internet/internet.checker.service.cpp index 548cf80071..f848c3a6b9 100644 --- a/src/core/atomicdex/services/internet/internet.checker.service.cpp +++ b/src/core/atomicdex/services/internet/internet.checker.service.cpp @@ -170,7 +170,7 @@ namespace atomic_dex auto& mm2 = this->m_system_manager.get_system(); if (mm2.is_mm2_running()) { - SPDLOG_INFO("mm2 is alive, checking if ware able to fetch a simple orderbook"); + SPDLOG_INFO("mm2 is alive, checking if we are able to fetch a simple orderbook"); nlohmann::json batch = nlohmann::json::array(); nlohmann::json current_request = mm2::template_request("orderbook", true); t_orderbook_request req_orderbook{.base = g_primary_dex_coin, .rel = g_second_primary_dex_coin}; diff --git a/src/core/atomicdex/services/ip/ip.checker.service.cpp b/src/core/atomicdex/services/ip/ip.checker.service.cpp index ec9880d4df..26223954cd 100644 --- a/src/core/atomicdex/services/ip/ip.checker.service.cpp +++ b/src/core/atomicdex/services/ip/ip.checker.service.cpp @@ -33,7 +33,7 @@ namespace return cfg; }()}; - t_http_client_ptr g_ip_proxy_client{std::make_unique(FROM_STD_STR("https://komodo.live:3335"), g_ip_cfg)}; + t_http_client_ptr g_ip_proxy_client{std::make_unique(FROM_STD_STR("https://komodo.earth:3335"), g_ip_cfg)}; t_http_client_ptr g_ipify_client{std::make_unique(FROM_STD_STR("https://api.ipify.org"), g_ip_cfg)}; pplx::task diff --git a/src/core/atomicdex/services/mm2/mm2.service.cpp b/src/core/atomicdex/services/mm2/mm2.service.cpp index 3faf992992..1fb12cd84b 100644 --- a/src/core/atomicdex/services/mm2/mm2.service.cpp +++ b/src/core/atomicdex/services/mm2/mm2.service.cpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2013-2022 The Komodo Platform Developers. * + * Copyright © 2013-2023 The Komodo Platform Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -31,8 +31,8 @@ #include "atomicdex/api/mm2/rpc.min.volume.hpp" #include "atomicdex/api/mm2/rpc.tx.history.hpp" #include "atomicdex/api/mm2/rpc2.z_coin_tx_history.hpp" -#include "atomicdex/api/mm2/rpc2.init_z_coin.hpp" -#include "atomicdex/api/mm2/rpc2.init_z_coin_status.hpp" +#include "atomicdex/api/mm2/rpc2.task.enable_z_coin.init.hpp" +#include "atomicdex/api/mm2/rpc2.task.enable_z_coin.status.hpp" #include "atomicdex/config/mm2.cfg.hpp" #include "atomicdex/config/coins.cfg.hpp" #include "atomicdex/constants/dex.constants.hpp" @@ -164,10 +164,6 @@ namespace SPDLOG_DEBUG("ticker: {} status active: {}", ticker, status); registry[ticker].active = status; } - else if (field_name == "is_segwit_on") - { - registry[ticker].is_segwit_on = status; - } } } @@ -294,6 +290,7 @@ namespace atomic_dex std::vector tickers; for (auto&& coin: coins) { + SPDLOG_DEBUG("{}: Active [{}]", coin.ticker, coin.active); if (!coin.active) { tickers.push_back(coin.ticker); @@ -301,7 +298,7 @@ namespace atomic_dex } if (!tickers.empty()) { - SPDLOG_INFO("coin_status_update required, {}", m_nb_update_required); + SPDLOG_DEBUG("coin_status_update required, {}", m_nb_update_required); update_coin_status(this->m_current_wallet_name, tickers, true, m_coins_informations, m_coin_cfg_mutex); } m_nb_update_required -= 1; @@ -413,6 +410,13 @@ namespace atomic_dex return destination; } + void mm2_service::enable_z_coin_cancel(const std::int8_t task_id) + { + t_enable_z_coin_cancel_request request{.task_id = task_id}; + auto answer = m_mm2_client.rpc_enable_z_coin_cancel(std::move(request)); + SPDLOG_DEBUG("mm2_service::enable_z_coin_cancel: [task_id {}] result: {}", task_id, answer.raw_result); + } + bool mm2_service::disable_coin(const std::string& ticker, std::error_code& ec) { coin_config coin_info = get_coin_info(ticker); @@ -496,6 +500,9 @@ namespace atomic_dex t_coins slp_coins; t_coins slp_testnet_coins; t_coins zhtlc_coins; + t_coins osmosis_coins; + t_coins iris_coins; + t_coins cosmos_coins; for (const auto& coin_config : coins) { @@ -514,6 +521,25 @@ namespace atomic_dex slp_coins.push_back(coin_config); } } + else if (coin_config.coin_type == CoinType::TENDERMINT || coin_config.coin_type == CoinType::TENDERMINTTOKEN) + { + if (coin_config.parent_coin == "ATOM") + { + cosmos_coins.push_back(coin_config); + } + if (coin_config.parent_coin == "IRIS") + { + iris_coins.push_back(coin_config); + } + if (coin_config.parent_coin == "OSMO") + { + osmosis_coins.push_back(coin_config); + } + else + { + SPDLOG_WARN("Unexpected Tenddermint ticker: {}", coin_config.ticker); + } + } else if (coin_config.coin_type == CoinType::ZHTLC) { zhtlc_coins.push_back(coin_config); @@ -547,6 +573,18 @@ namespace atomic_dex { enable_zhtlc(zhtlc_coins); } + if (iris_coins.size() > 0) + { + enable_tendermint_coins(iris_coins, "IRIS"); + } + if (cosmos_coins.size() > 0) + { + enable_tendermint_coins(cosmos_coins, "ATOM"); + } + if (osmosis_coins.size() > 0) + { + enable_tendermint_coins(osmosis_coins, "OSMO"); + } } void mm2_service::enable_erc_family_coin(const coin_config& coin_config) @@ -626,14 +664,18 @@ namespace atomic_dex { t_enable_request request { - .coin_name = coin_config.ticker, - .urls = coin_config.eth_family_urls.value_or(std::vector{}), - .coin_type = coin_config.coin_type, - .is_testnet = coin_config.is_testnet.value_or(false), - .with_tx_history = false + .coin_name = coin_config.ticker, + .urls = coin_config.eth_family_urls.value_or(std::vector{}), + .coin_type = coin_config.coin_type, + .is_testnet = coin_config.is_testnet.value_or(false), + .swap_contract_address = coin_config.swap_contract_address.value_or(""), + .with_tx_history = false }; + if (coin_config.fallback_swap_contract_address.value_or("") != "") + { + request.fallback_swap_contract_address = coin_config.fallback_swap_contract_address; + } nlohmann::json j = mm2::template_request("enable"); - mm2::to_json(j, request); batch_array.push_back(j); } @@ -732,12 +774,6 @@ namespace atomic_dex .is_testnet = coin_config.is_testnet.value_or(false), .with_tx_history = true }; - - if (coin_config.segwit && coin_config.is_segwit_on) - { - request.address_format = nlohmann::json::object(); - request.address_format.value()["format"] = "segwit"; - } if (coin_config.utxo_merge.value_or(false)) { mm2::utxo_merge_params merge_params{.merge_at = 250, .check_every = 300, .max_merge_at_once = 125}; @@ -746,6 +782,14 @@ namespace atomic_dex mm2::to_json(json_merge_params, merge_params); request.merge_params = json_merge_params; } + if (coin_config.swap_contract_address.value_or("") != "") + { + request.swap_contract_address = coin_config.swap_contract_address; + } + if (coin_config.fallback_swap_contract_address.value_or("") != "") + { + request.fallback_swap_contract_address = coin_config.fallback_swap_contract_address; + } mm2::to_json(j, request); batch_array.push_back(j); } @@ -754,6 +798,151 @@ namespace atomic_dex .then([this, batch_array](pplx::task previous_task) { this->handle_exception_pplx_task(previous_task, "enable_qrc_family_coins", batch_array); }); } + + void mm2_service::enable_tendermint_coin(coin_config coin_config, std::string parent_ticker) + { + enable_tendermint_coins(t_coins{std::move(coin_config)}, parent_ticker); + } + + void mm2_service::enable_tendermint_coins(const t_coins& coins, const std::string parent_ticker) + { + SPDLOG_INFO("Parent ticker: {}", parent_ticker); + auto callback = [this](RpcRequest rpc) + { + if (rpc.error) + { + if (rpc.error->error_type.find("PlatformIsAlreadyActivated") != std::string::npos || rpc.error->error_type.find("TokenIsAlreadyActivated") != std::string::npos) + { + SPDLOG_ERROR("{} {}: ", rpc.request.ticker, rpc.error->error_type); + fetch_single_balance(get_coin_info(rpc.request.ticker)); + m_coins_informations[rpc.request.ticker].currently_enabled = true; + dispatcher_.trigger(coin_fully_initialized{.tickers = {rpc.request.ticker}}); + if constexpr (std::is_same_v) + { + for (const auto& tendermint_coin_info : rpc.request.tokens_params) + { + SPDLOG_ERROR("{} {}: ", tendermint_coin_info.ticker, rpc.error->error_type); + fetch_single_balance(get_coin_info(tendermint_coin_info.ticker)); + m_coins_informations[tendermint_coin_info.ticker].currently_enabled = true; + dispatcher_.trigger(coin_fully_initialized{.tickers = {tendermint_coin_info.ticker}}); + } + } + } + else + { + m_coins_informations[rpc.request.ticker].currently_enabled = false; + update_coin_active({rpc.request.ticker}, false); + this->dispatcher_.trigger(rpc.request.ticker, rpc.error->error); + } + } + else + { + dispatcher_.trigger(coin_fully_initialized{.tickers = {rpc.request.ticker}}); + fetch_single_balance(get_coin_info(rpc.request.ticker)); + m_coins_informations[rpc.request.ticker].currently_enabled = true; + if constexpr (std::is_same_v) + { + for (const auto& tendermint_token_addresses_info : rpc.result->tendermint_token_balances_infos) + { + dispatcher_.trigger(coin_fully_initialized{.tickers = {tendermint_token_addresses_info.first}}); + process_balance_answer(rpc); + m_coins_informations[tendermint_token_addresses_info.first].currently_enabled = true; + } + } + process_balance_answer(rpc); + } + }; + + if (!has_coin(parent_ticker)) + { + static constexpr auto error = "{} is not present in the config. Cannot enable TENDERMINT tokens."; + SPDLOG_ERROR(error); + this->dispatcher_.trigger(parent_ticker, fmt::format(error, parent_ticker)); + return; + } + + auto parent_ticker_info = get_coin_info(parent_ticker); + + if (parent_ticker_info.currently_enabled) + { + for (const auto& coin_config : coins) + { + mm2::enable_tendermint_token_rpc rpc{.request={.ticker = coin_config.ticker}}; + + if (coin_config.ticker == parent_ticker_info.ticker) + { + continue; + } + m_mm2_client.process_rpc_async(rpc.request, callback); + } + } + else + { + mm2::enable_tendermint_with_assets_rpc rpc; + + rpc.request.ticker = parent_ticker_info.ticker; + rpc.request.rpc_urls = parent_ticker_info.rpc_urls.value_or(std::vector{}); + for (const auto& coin_config : coins) + { + if (coin_config.ticker == parent_ticker_info.ticker) + { + continue; + } + rpc.request.tokens_params.push_back({.ticker = coin_config.ticker}); + } + m_mm2_client.process_rpc_async(rpc.request, callback); + } + this->m_nb_update_required += 1; + } + + void mm2_service::process_balance_answer(const mm2::enable_tendermint_token_rpc& rpc) + { + const auto& answer = rpc.result.value(); + mm2::balance_answer balance_answer; + + balance_answer.address = answer.balances.begin()->first; + balance_answer.balance = answer.balances.begin()->second.spendable; + balance_answer.coin = answer.platform_coin; + + { + std::unique_lock lock(m_balance_mutex); + m_balance_informations[balance_answer.coin] = std::move(balance_answer); + } + } + + void mm2_service::process_balance_answer(const mm2::enable_tendermint_with_assets_rpc& rpc) + { + const auto& answer = rpc.result.value(); + { + mm2::balance_answer balance_answer; + + balance_answer.coin = rpc.request.ticker; + balance_answer.balance = answer.tendermint_balances_infos.balances.spendable; + balance_answer.address = answer.address; + { + std::unique_lock lock(m_balance_mutex); + m_balance_informations[balance_answer.coin] = std::move(balance_answer); + } + } + if (answer.tendermint_token_balances_infos.empty()) + { + return; + } + for (auto [ticker, data] : answer.tendermint_token_balances_infos) + { + mm2::balance_answer balance_answer; + + balance_answer.coin = ticker; + balance_answer.address = answer.address; + balance_answer.balance = data.spendable; + + { + std::unique_lock lock(m_balance_mutex); + m_balance_informations[balance_answer.coin] = std::move(balance_answer); + } + } + } + void mm2_service::enable_slp_coin(coin_config coin_config) { enable_slp_coins(t_coins{std::move(coin_config)}); @@ -1103,30 +1292,56 @@ namespace atomic_dex } else { - std::string method = "my_tx_history"; std::size_t limit = 5000; bool requires_v2 = false; - if (coin_info.is_zhtlc_family) + std::string method = "my_tx_history"; + if (coin_info.coin_type == CoinTypeGadget::SLP || coin_info.ticker == "tBCH" || coin_info.ticker == "BCH") { requires_v2 = true; - limit = 50; - method = "z_coin_tx_history"; + t_tx_history_request request{.coin = ticker, .limit = limit}; + nlohmann::json j = mm2::template_request(method, requires_v2); + mm2::to_json(j, request); + batch_array.push_back(j); } - else if (coin_info.coin_type == CoinTypeGadget::SLP || coin_info.ticker == "tBCH" || coin_info.ticker == "BCH") + else if (coin_info.is_zhtlc_family) { - requires_v2 = true; + // Don't request balance / history if not completely activated. + if (coin_info.activation_status.at("result").at("status") == "Ok") + { + limit = 50; + requires_v2 = true; + method = "z_coin_tx_history"; + t_tx_history_request request{.coin = ticker, .limit = limit}; + nlohmann::json j = mm2::template_request(method, requires_v2); + mm2::to_json(j, request); + batch_array.push_back(j); + } + } + else + { + t_tx_history_request request{.coin = ticker, .limit = limit}; + nlohmann::json j = mm2::template_request(method, requires_v2); + mm2::to_json(j, request); + batch_array.push_back(j); } - t_tx_history_request request{.coin = ticker, .limit = limit}; - nlohmann::json j = mm2::template_request(method, requires_v2); - mm2::to_json(j, request); - batch_array.push_back(j); } if (not only_tx) { for (auto&& coin : enabled_coins) { + coin_info = get_coin_info(ticker); + + if (coin_info.is_zhtlc_family) + { + // Don't request balance / history if not completely activated. + if (coin_info.activation_status.at("result").at("status") != "Ok") + { + continue; + } + } + if (is_pin_cfg_enabled()) { std::shared_lock lock(m_balance_mutex); ///< shared_lock @@ -1184,7 +1399,7 @@ namespace atomic_dex { auto request_functor = [this](coin_config coin_info) -> std::pair> { - t_init_z_coin_request request{ + t_enable_z_coin_request request{ .coin_name = coin_info.ticker, .servers = coin_info.electrum_urls.value_or(get_electrum_server_from_token(coin_info.ticker)), .z_urls = coin_info.z_urls.value_or(std::vector{}), @@ -1192,7 +1407,7 @@ namespace atomic_dex .is_testnet = coin_info.is_testnet.value_or(false), .with_tx_history = false}; // Tx history not yet ready for ZHTLC - nlohmann::json j = mm2::template_request("init_z_coin", true); + nlohmann::json j = mm2::template_request("task::enable_z_coin::init", true); mm2::to_json(j, request); nlohmann::json batch = nlohmann::json::array(); batch.push_back(j); @@ -1250,11 +1465,11 @@ namespace atomic_dex static std::size_t z_nb_try = 0; nlohmann::json z_error = nlohmann::json::array(); nlohmann::json z_batch_array = nlohmann::json::array(); - t_init_z_coin_status_request z_request{.task_id = task_id}; + t_enable_z_coin_status_request z_request{.task_id = task_id}; - SPDLOG_DEBUG("{} init_z_coin Task ID: {}", tickers[idx], task_id); + SPDLOG_DEBUG("{} enable_z_coin Task ID: {}", tickers[idx], task_id); - nlohmann::json j = mm2::template_request("init_z_coin_status", true); + nlohmann::json j = mm2::template_request("task::enable_z_coin::status", true); mm2::to_json(j, z_request); z_batch_array.push_back(j); std::string last_event = "none"; @@ -1267,9 +1482,12 @@ namespace atomic_dex z_error = z_answers; std::string status = z_answers[0].at("result").at("status").get(); + SPDLOG_DEBUG("{} status : {}", tickers[idx], status); + SPDLOG_DEBUG("{} activation status response [{}]", tickers[idx], z_answers[0].dump()); - if (status == "Ready") + if (status == "Ok") { + SPDLOG_DEBUG("{} activation ready...", tickers[idx]); m_coins_informations[tickers[idx]].activation_status = z_answers[0]; if (z_answers[0].at("result").at("details").contains("error")) { @@ -1308,6 +1526,7 @@ namespace atomic_dex { event = z_answers[0].at("result").at("details").get(); } + SPDLOG_DEBUG("{} activation event [{}]", event, tickers[idx]); if (event != last_event) { @@ -1323,14 +1542,13 @@ namespace atomic_dex this->dispatcher_.trigger(tickers[idx], event); last_event = event; } - // todo(syl): refactor to a background task std::this_thread::sleep_for(2s); } m_coins_informations[tickers[idx]].activation_status = z_answers[0]; z_nb_try += 1; - } while (z_nb_try < 1000); + } while (z_nb_try < 2000); try { if (z_error[0].at("result").at("details").contains("error")) @@ -1352,9 +1570,8 @@ namespace atomic_dex // There could be no error message if scanning takes too long. // Either we force disable here, or schedule to check on it later // If this happens, address will be "Invalid" and balance will be zero. - // We could save this ticker in a list to try `init_z_coin_status` again on it periodically until complete. - - SPDLOG_DEBUG("Exited zhtlc enable loop after 1000 tries"); + // We could save this ticker in a list to try `enable_z_coin_status` again on it periodically until complete. + SPDLOG_DEBUG("Exited {} enable loop after 1000 tries ", tickers[idx]); SPDLOG_DEBUG( "Bad answer for zhtlc_error: [{}] -> idx: {}, tickers size: {}, answers size: {}", tickers[idx], idx, tickers.size(), answers.size() @@ -1365,6 +1582,7 @@ namespace atomic_dex } else { + SPDLOG_DEBUG("{} enable loop complete!", tickers[idx]); this->dispatcher_.trigger(tickers[idx], "Complete!"); } } @@ -1380,11 +1598,13 @@ namespace atomic_dex if (!to_remove.empty()) { + SPDLOG_DEBUG("Removing coins which failed activation..."); std::vector disable_coins; for (auto&& t: to_remove) { tickers.erase(std::remove(tickers.begin(), tickers.end(), t), tickers.end()); disable_coins.push_back(t); } + SPDLOG_DEBUG("Updating coins status..."); update_coin_status(this->m_current_wallet_name, disable_coins, false, m_coins_informations, m_coin_cfg_mutex); } @@ -1393,6 +1613,7 @@ namespace atomic_dex dispatcher_.trigger(tickers); if (tickers.size() == 1) { + SPDLOG_DEBUG("Init balance for {}...", tickers[0]); fetch_single_balance(get_coin_info(tickers[0])); } this->m_nb_update_required += 1; @@ -1440,10 +1661,10 @@ namespace atomic_dex { if (coin_info.activation_status.contains("result")) { - SPDLOG_DEBUG("coin_info.activation_status {} {} :", coin, coin_info.activation_status.dump(4)); + // SPDLOG_DEBUG("coin_info.activation_status {} {} :", coin, coin_info.activation_status.dump(4)); if (coin_info.activation_status.at("result").contains("status")) { - if (coin_info.activation_status.at("result").at("status") == "Ready") + if (coin_info.activation_status.at("result").at("status") == "Ok") { if (coin_info.activation_status.at("result").contains("details")) { @@ -1480,6 +1701,7 @@ namespace atomic_dex return m_coins_informations.contains(ticker); } + // [smk] Only called by trading_page::process_action() t_orderbook_answer mm2_service::get_orderbook(t_mm2_ec& ec) const { auto&& [base, rel] = this->m_synchronized_ticker_pair.get(); @@ -1500,7 +1722,7 @@ namespace atomic_dex nlohmann::json mm2_service::prepare_batch_orderbook(bool is_a_reset) { - // SPDLOG_INFO("is_a_reset: {}", is_a_reset); + SPDLOG_INFO("[prepare_batch_orderbook] is_a_reset: {}", is_a_reset); auto&& [base, rel] = m_synchronized_ticker_pair.get(); if (rel.empty()) return nlohmann::json::array(); @@ -2484,8 +2706,4 @@ namespace atomic_dex } } - void mm2_service::change_segwit_status(std::string ticker, bool status) - { - update_coin_status(this->m_current_wallet_name, {ticker}, status, m_coins_informations, m_coin_cfg_mutex, "is_segwit_on"); - } } // namespace atomic_dex diff --git a/src/core/atomicdex/services/mm2/mm2.service.hpp b/src/core/atomicdex/services/mm2/mm2.service.hpp index 9b998f044d..a10b20de19 100644 --- a/src/core/atomicdex/services/mm2/mm2.service.hpp +++ b/src/core/atomicdex/services/mm2/mm2.service.hpp @@ -1,5 +1,5 @@ /****************************************************************************** -* Copyright © 2013-2022 The Komodo Platform Developers. * +* Copyright © 2013-2023 The Komodo Platform Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -37,6 +37,8 @@ #include "atomicdex/api/mm2/rpc.orderbook.hpp" #include "atomicdex/api/mm2/enable_bch_with_tokens_rpc.hpp" #include "atomicdex/api/mm2/enable_slp_rpc.hpp" +#include "atomicdex/api/mm2/rpc2.enable_tendermint_with_assets.hpp" +#include "atomicdex/api/mm2/rpc2.enable_tendermint_token.hpp" #include "atomicdex/config/raw.mm2.coins.cfg.hpp" #include "atomicdex/constants/dex.constants.hpp" #include "atomicdex/data/dex/orders.and.swaps.data.hpp" @@ -175,11 +177,15 @@ namespace atomic_dex void enable_slp_coins(const t_coins& coins); void enable_slp_testnet_coin(coin_config coin_config); void enable_slp_testnet_coins(const t_coins& coins); + void enable_tendermint_coin(coin_config coin_config, std::string parent_ticker); + void enable_tendermint_coins(const t_coins& coins, const std::string parent_ticker); void enable_zhtlc(const t_coins& coins); - + // Balances processing functions void process_balance_answer(const mm2::enable_bch_with_tokens_rpc& rpc); // Called after enabling SLP coins along tBCH/BCH. void process_balance_answer(const mm2::enable_slp_rpc& rpc); // Called after enabling an SLP coin. + void process_balance_answer(const mm2::enable_tendermint_with_assets_rpc& rpc); + void process_balance_answer(const mm2::enable_tendermint_token_rpc& rpc); public: //! Add a new coin in the coin_info cfg add_new_coin(normal_cfg, mm2_cfg) @@ -191,6 +197,9 @@ namespace atomic_dex [[nodiscard]] nlohmann::json get_zhtlc_status(const std::string coin) const; + //! Cancel zhtlc activation + void enable_z_coin_cancel(const std::int8_t task_id); + //! Disable a single coin bool disable_coin(const std::string& ticker, std::error_code& ec); @@ -270,7 +279,6 @@ namespace atomic_dex //! Pagination void set_orders_and_swaps_pagination_infos(std::size_t current_page = 1, std::size_t limit = 50, t_filtering_infos infos = {}); - void change_segwit_status(std::string ticker, bool status); }; } // namespace atomic_dex diff --git a/src/core/atomicdex/services/price/global.provider.cpp b/src/core/atomicdex/services/price/global.provider.cpp index 966b67dd48..465d989bfe 100644 --- a/src/core/atomicdex/services/price/global.provider.cpp +++ b/src/core/atomicdex/services/price/global.provider.cpp @@ -19,7 +19,6 @@ #include "atomicdex/api/coinpaprika/coinpaprika.hpp" #include "atomicdex/pages/qt.settings.page.hpp" #include "atomicdex/services/price/komodo_prices/komodo.prices.provider.hpp" -#include "atomicdex/services/price/oracle/band.provider.hpp" namespace { @@ -30,7 +29,7 @@ namespace cfg.set_timeout(std::chrono::seconds(5)); return cfg; }()}; - t_http_client_ptr g_openrates_client = std::make_unique(FROM_STD_STR("https://rates.komodo.live"), g_openrates_cfg); + t_http_client_ptr g_openrates_client = std::make_unique(FROM_STD_STR("https://rates.komodo.earth"), g_openrates_cfg); pplx::cancellation_token_source g_token_source; pplx::task @@ -177,9 +176,9 @@ namespace atomic_dex const auto now = std::chrono::high_resolution_clock::now(); const auto s = std::chrono::duration_cast(now - m_update_clock); - if (s >= 2min) + if (s >= 5min) { - SPDLOG_INFO("2min spend - refreshing provider"); + SPDLOG_INFO("[global_price_service::update()] - 5min elapsed, updating providers"); this->on_force_update_providers({}); m_update_clock = std::chrono::high_resolution_clock::now(); } @@ -198,51 +197,27 @@ namespace atomic_dex //! FIXME: fix zatJum crash report, frontend QML try to retrieve price before program is even launched if (ticker.empty()) return "0"; - auto& provider = m_system_manager.get_system(); - auto& band_service = m_system_manager.get_system(); - std::string current_price = band_service.retrieve_if_this_ticker_supported(ticker); - const bool is_oracle_ready = band_service.is_oracle_ready(); + auto& provider = m_system_manager.get_system(); + std::string current_price = provider.get_rate_conversion(ticker); - if (current_price.empty()) + if (!is_this_currency_a_fiat(m_cfg, fiat)) { - current_price = provider.get_rate_conversion(ticker); - if (!is_this_currency_a_fiat(m_cfg, fiat)) + t_float_50 rate(1); { - t_float_50 rate(1); + if (m_coin_rate_providers.contains(fiat)) { - if (m_coin_rate_providers.contains(fiat)) - { - std::shared_lock lock(m_coin_rate_mutex); - rate = t_float_50(m_coin_rate_providers.at(fiat)); ///< Retrieve BTC or KMD rate let's say for USD - } - } - t_float_50 tmp_current_price = t_float_50(current_price) * rate; - current_price = tmp_current_price.str(); - } - else if (fiat != "USD") - { - if (m_other_fiats_rates->contains("rates")) - { - t_float_50 tmp_current_price = t_float_50(current_price) * m_other_fiats_rates->at("rates").at(fiat).get(); - current_price = tmp_current_price.str(); + std::shared_lock lock(m_coin_rate_mutex); + rate = t_float_50(m_coin_rate_providers.at(fiat)); ///< Retrieve BTC or KMD rate let's say for USD } } + t_float_50 tmp_current_price = t_float_50(current_price) * rate; + current_price = tmp_current_price.str(); } - else + else if (fiat != "USD") { - //! We use oracle - if (is_this_currency_a_fiat(m_cfg, fiat) && fiat != "USD") - { - if (m_other_fiats_rates->contains("rates")) - { - t_float_50 tmp_current_price = t_float_50(current_price) * m_other_fiats_rates->at("rates").at(fiat).get(); - current_price = tmp_current_price.str(); - } - } - - else if (!is_this_currency_a_fiat(m_cfg, fiat) && is_oracle_ready) + if (m_other_fiats_rates->contains("rates")) { - t_float_50 tmp_current_price = (t_float_50(current_price)) * band_service.retrieve_rates(fiat); + t_float_50 tmp_current_price = t_float_50(current_price) * m_other_fiats_rates->at("rates").at(fiat).get(); current_price = tmp_current_price.str(); } } diff --git a/src/core/atomicdex/services/price/oracle/band.provider.cpp b/src/core/atomicdex/services/price/oracle/band.provider.cpp deleted file mode 100644 index 94724b861c..0000000000 --- a/src/core/atomicdex/services/price/oracle/band.provider.cpp +++ /dev/null @@ -1,146 +0,0 @@ -//! Project Headers -#include "band.provider.hpp" - -namespace atomic_dex -{ - band_oracle_price_service::band_oracle_price_service(entt::registry& registry) : system(registry) - { - m_update_clock = std::chrono::high_resolution_clock::now(); - fetch_oracle(); - } - - void - from_json(const nlohmann::json& j, band_oracle_price_result& result) - { - for (auto&& obj: j.at("result")) - { - std::string symbol = obj.at("symbol").get(); - t_float_50 px = t_float_50(obj.at("px").get()); - t_float_50 multiplier = t_float_50(obj.at("multiplier").get()); - t_float_50 price = px / multiplier; - std::stringstream sstream(obj.at("resolve_time").get()); - std::size_t timestamp; - sstream >> timestamp; - result.band_oracle_data[symbol].timestamp = timestamp; - result.band_oracle_data[symbol].reference = "https://guanyu-poa.cosmoscan.io/request/" + obj.at("request_id").get(); - result.band_oracle_data[symbol].price = price; - t_float_50 rates = t_float_50("1") / price; - result.band_oracle_data[symbol].rate = rates; - } - } -} // namespace atomic_dex - -namespace atomic_dex -{ - pplx::task - band_oracle_price_service::async_fetch_oracle_result() - { - web::http::http_request req; - req.set_method(web::http::methods::POST); - nlohmann::json json_body; - json_body["min_count"] = 10; - json_body["ask_count"] = 16; - json_body["symbols"] = nlohmann::json::array(); - for (auto&& cur_symbol: this->m_supported_tickers) { json_body["symbols"].push_back(cur_symbol); } - req.headers().set_content_type(FROM_STD_STR("application/json")); - // SPDLOG_INFO("req: {}", json_body.dump(4)); - req.set_body(json_body.dump()); - return m_band_http_client->request(req); - } - - void - band_oracle_price_service::fetch_oracle() - { - SPDLOG_INFO("start fetching oracle"); - async_fetch_oracle_result() - .then([this](web::http::http_response resp) { - auto body = TO_STD_STR(resp.extract_string(true).get()); - if (resp.status_code() == 200) - { - nlohmann::json j = nlohmann::json::parse(body); - band_oracle_price_result result; - from_json(j, result); - this->m_oracle_price_result = result; - using namespace std::chrono_literals; - auto last_oracle_timestamp = result.band_oracle_data.at("BAND").timestamp; - const auto now = std::chrono::system_clock::now(); - const auto last_oracle_timestamp_std = std::chrono::system_clock::from_time_t(last_oracle_timestamp); - const auto s = std::chrono::duration_cast(now - last_oracle_timestamp_std); - this->m_oracle_ready = s > 20min ? false : true; - if (s > 20min) - { - SPDLOG_WARN( - "last oracle too much outdated: {}, fallback to coinpaprika", - utils::to_human_date(last_oracle_timestamp, "%e %b %Y, %H:%M")); - } - this->dispatcher_.trigger(); - } - else - { - SPDLOG_ERROR("Cannot fetch oracle price: {}", body); - } - }) - .then(&handle_exception_pplx_task); - } -} // namespace atomic_dex - -namespace atomic_dex -{ - void - band_oracle_price_service::update() - { - using namespace std::chrono_literals; - - const auto now = std::chrono::high_resolution_clock::now(); - const auto s = std::chrono::duration_cast(now - m_update_clock); - if (s >= 5min) - { - fetch_oracle(); - m_update_clock = std::chrono::high_resolution_clock::now(); - } - } - - bool - band_oracle_price_service::is_oracle_ready() const - { - return this->m_oracle_ready.load(); - } - - std::string - band_oracle_price_service::retrieve_if_this_ticker_supported(const std::string& ticker) const - { - std::string current_price = ""; - if (is_oracle_ready()) - { - const auto result = m_oracle_price_result.synchronize(); - const auto it = result->band_oracle_data.find(ticker); - if (it != result->band_oracle_data.end()) - { - current_price = it->second.price.str(); - } - } - return current_price; - } - - t_float_50 - band_oracle_price_service::retrieve_rates(const std::string& fiat) const - { - const auto synchronized = m_oracle_price_result.synchronize(); - return synchronized->band_oracle_data.at(fiat).rate; - } - - std::vector - band_oracle_price_service::supported_pair() const - { - std::vector out; - out.reserve(this->m_supported_tickers.size()); - for (auto&& cur_symbol: this->m_supported_tickers) { out.emplace_back(cur_symbol + "/USD"); } - return out; - } - - std::string - band_oracle_price_service::last_oracle_reference() const - { - return ""; - } -} // namespace atomic_dex diff --git a/src/core/atomicdex/services/price/oracle/band.provider.hpp b/src/core/atomicdex/services/price/oracle/band.provider.hpp deleted file mode 100644 index 6f694da823..0000000000 --- a/src/core/atomicdex/services/price/oracle/band.provider.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include "atomicdex/services/mm2/mm2.service.hpp" - -namespace atomic_dex -{ - struct band_data - { - std::size_t timestamp; - std::string human_date; - t_float_50 price; - t_float_50 rate; - std::string reference; - }; - - struct band_oracle_price_result - { - std::unordered_map band_oracle_data; - }; - - void from_json(const nlohmann::json& j, band_oracle_price_result& result); - - class band_oracle_price_service final : public ag::ecs::pre_update_system - { - using t_update_time_point = std::chrono::high_resolution_clock::time_point; - using t_oracle_price_synchronized = boost::synchronized_value; - - static constexpr const char* m_band_endpoint{"http://komodo-rpc.bandchain.org/oracle/request_prices"}; - t_http_client_ptr m_band_http_client{std::make_unique(FROM_STD_STR(m_band_endpoint))}; - t_update_time_point m_update_clock; - t_oracle_price_synchronized m_oracle_price_result; - std::atomic_bool m_oracle_ready{false}; - std::vector m_supported_tickers{"BAND"}; - - void fetch_oracle() ; - pplx::task async_fetch_oracle_result() ; - - public: - explicit band_oracle_price_service(entt::registry& registry); - ~band_oracle_price_service() final = default; - - void update() final; - - //! Public API - bool is_oracle_ready() const ; - std::string retrieve_if_this_ticker_supported(const std::string& ticker) const ; - t_float_50 retrieve_rates(const std::string& fiat) const ; - std::vector supported_pair() const ; - std::string last_oracle_reference() const ; - }; -} // namespace atomic_dex - -REFL_AUTO(type(atomic_dex::band_oracle_price_service)) diff --git a/src/core/atomicdex/services/update/update.checker.service.cpp b/src/core/atomicdex/services/update/update.checker.service.cpp index db89277ca7..e366ae316e 100644 --- a/src/core/atomicdex/services/update/update.checker.service.cpp +++ b/src/core/atomicdex/services/update/update.checker.service.cpp @@ -29,7 +29,7 @@ namespace { - constexpr const char* g_komodolive_endpoint = "https://komodo.live/adexproversion"; + constexpr const char* g_komodolive_endpoint = "https://komodo.earth/adexproversion"; t_http_client_ptr g_komodolive_client{std::make_unique(FROM_STD_STR(g_komodolive_endpoint))}; pplx::task async_check_retrieve() diff --git a/src/core/atomicdex/version/version.hpp b/src/core/atomicdex/version/version.hpp index 8fce7de2ff..816d3f013d 100644 --- a/src/core/atomicdex/version/version.hpp +++ b/src/core/atomicdex/version/version.hpp @@ -21,7 +21,7 @@ namespace atomic_dex constexpr const char* get_version() { - return "0.5.7.2-beta"; + return "0.5.8-beta"; } constexpr int @@ -33,12 +33,12 @@ namespace atomic_dex constexpr const char* get_raw_version() { - return "0.5.7.2"; + return "0.5.8"; } constexpr const char* get_precedent_raw_version() { - return "0.5.7.1"; + return "0.5.7.2"; } } // namespace atomic_dex diff --git a/vcpkg.json b/vcpkg.json index 933bbee3d5..a8e1b48608 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "atomicdex-desktop", - "version-string": "0.5.7.2", + "version-string": "0.5.8", "dependencies": [ "entt", "boost-multiprecision",