Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/activation-v2-boilerplate' int…
Browse files Browse the repository at this point in the history
…o nogeo
  • Loading branch information
cipig committed Dec 20, 2023
2 parents ca15488 + f74a836 commit 13c3d7f
Show file tree
Hide file tree
Showing 90 changed files with 2,150 additions and 1,481 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ endif ()
##! We fetch our dependencies
if (APPLE)
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/dev/mm2_466d4f2-mac-x86-64.zip)
URL https://sdk.devbuilds.komodo.earth/main/mm2_b0fd99e-mac-x86-64.zip)
elseif (UNIX AND NOT APPLE)
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/dev/mm2_466d4f2-linux-x86-64.zip)
URL https://sdk.devbuilds.komodo.earth/main/mm2_b0fd99e-linux-x86-64.zip)
else ()
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/dev/mm2_466d4f2-win-x86-64.zip)
URL https://sdk.devbuilds.komodo.earth/main/mm2_b0fd99e-win-x86-64.zip)
endif ()

#FetchContent_Declare(qmaterial URL https://github.com/KomodoPlatform/Qaterial/archive/last-clang-working-2.zip)
Expand Down
13 changes: 11 additions & 2 deletions atomic_defi_design/Dex/Constants/General.qml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ QtObject {
return coin_info.tx_uri
}

function getBlockUri(coin_info) {
if (coin_info.block_uri == "") return "block/"
return coin_info.block_uri
}

function getTxExplorerURL(ticker, txid, add_0x=true) {
if(txid !== '') {
const coin_info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker)
Expand Down Expand Up @@ -684,7 +689,7 @@ QtObject {
if (prevent_coin_disabling.running) return false
if (ticker === atomic_app_primary_coin || ticker === atomic_app_secondary_coin) return false
if (ticker === "ETH") return !General.isParentCoinNeeded("ETH", "ERC-20")
if (ticker === "MATIC") return !General.isParentCoinNeeded("MATIC", "Matic")
if (ticker === "MATIC") return !General.isParentCoinNeeded("MATIC", "PLG-20")
if (ticker === "FTM") return !General.isParentCoinNeeded("FTM", "FTM-20")
if (ticker === "AVAX") return !General.isParentCoinNeeded("AVAX", "AVX-20")
if (ticker === "BNB") return !General.isParentCoinNeeded("BNB", "BEP-20")
Expand Down Expand Up @@ -722,7 +727,11 @@ QtObject {
}

function isERC20(current_ticker_infos) {
return current_ticker_infos.type === "ERC-20" || current_ticker_infos.type === "BEP-20" || current_ticker_infos.type == "Matic"
return current_ticker_infos.type === "ERC-20"
|| current_ticker_infos.type === "BEP-20"
|| current_ticker_infos.type == "PLG-20"
|| current_ticker_infos.type == "FTM-20"
|| current_ticker_infos.type == "AVX-20"
}

function isParentCoin(ticker) {
Expand Down
4 changes: 2 additions & 2 deletions atomic_defi_design/Dex/Constants/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ QtObject {
case 'QRC-20': return dark_theme ? colorCoinDark["QTUM"] : colorCoin["QTUM"]
case 'KRC-20': return dark_theme ? colorCoinDark["KCS"] : colorCoin["KCS"]
case 'Smart Chain': return dark_theme ? colorCoinDark["KMD"] : colorCoin["KMD"]
case 'Matic': return dark_theme ? colorCoinDark["MATIC"] : colorCoin["MATIC"]
case 'PLG-20': return dark_theme ? colorCoinDark["MATIC"] : colorCoin["MATIC"]
case 'Moonriver': return dark_theme ? colorCoinDark["MOVR"] : colorCoin["MOVR"]
case 'HRC-20': return dark_theme ? colorCoinDark["ONE"] : colorCoin["ONE"]
case 'SmartBCH': return dark_theme ? colorCoinDark["SBCH"] : colorCoin["SBCH"]
Expand Down Expand Up @@ -245,7 +245,7 @@ QtObject {
case 'QRC-20': return dark_theme ? colorCoinDark["QTUM"] : colorCoin["QTUM"]
case 'KRC-20': return dark_theme ? colorCoinDark["KCS"] : colorCoin["KCS"]
case 'Smart Chain': return dark_theme ? colorCoinDark["KMD"] : colorCoin["KMD"]
case 'Matic': return dark_theme ? colorCoinDark["MATIC"] : colorCoin["MATIC"]
case 'PLG-20': return dark_theme ? colorCoinDark["MATIC"] : colorCoin["MATIC"]
case 'Moonriver': return dark_theme ? colorCoinDark["MOVR"] : colorCoin["MOVR"]
case 'HRC-20': return dark_theme ? colorCoinDark["ONE"] : colorCoin["ONE"]
case 'SmartBCH': return dark_theme ? colorCoinDark["SBCH"] : colorCoin["SBCH"]
Expand Down
4 changes: 2 additions & 2 deletions atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ ClipRRect // Trade Card

width: 60

text: _selectedTickerIcon.enabled ? atomic_qt_utilities.retrieve_main_ticker(selectedTicker) : qsTr("Pick a coin")
text: _selectedTickerIcon.enabled ? atomic_qt_utilities.retrieve_main_ticker(selectedTicker, false, true) : qsTr("Pick a coin")
font.pixelSize: Constants.Style.textSizeSmall2

wrapMode: Text.NoWrap
Expand Down Expand Up @@ -580,7 +580,7 @@ ClipRRect // Trade Card
anchors.leftMargin: 10
width: 60

text: enabled ? atomic_qt_utilities.retrieve_main_ticker(selectedOrder.coin) : ""
text: enabled ? atomic_qt_utilities.retrieve_main_ticker(selectedOrder.coin, false, true) : ""
font.pixelSize: Constants.Style.textSizeSmall2
wrapMode: Text.NoWrap

Expand Down
70 changes: 47 additions & 23 deletions atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ MultipageModal
id: root

width: 700
horizontalPadding: 20
verticalPadding: 20
closePolicy: Popup.NoAutoClose

onClosed:
{
Expand All @@ -22,7 +25,7 @@ MultipageModal
}

property var config_fields: ({})
property var typeList: ["ERC-20", "QRC-20","BEP-20"]
property var typeList: ["ERC-20", "BEP-20"] // QRC removed due to unresolved issues and lack of use
readonly property var custom_token_data: API.app.settings_pg.custom_token_data
readonly property string general_message: qsTr('Get the contract address from')
readonly property bool fetching_custom_token_data_busy: API.app.settings_pg.fetching_custom_token_data_busy
Expand Down Expand Up @@ -67,7 +70,7 @@ MultipageModal
addToConfig(input_name, "name", input_name.field.text)
addToConfig(input_contract_address, "contract_address", input_contract_address.text)
addToConfig(input_active, "active", input_active.checked)
addToConfig(input_coingecko_id, "coingecko_id", input_coingecko_id.field.text)
addToConfig(input_coingecko_id, "coingecko_id", input_coingecko_id.field.text)
fields['coinType'] = currentType.coinType

root.config_fields = General.clone(fields)
Expand All @@ -86,6 +89,24 @@ MultipageModal
{
id: type_model

// ListElement
// {
// text: "AVX-20"
// prefix: ""
// url: "https://snowtrace.io/tokens"
// name: 'SnowTrace'
// image: "avax"
// coinType: CoinType.AVX20
// }
ListElement
{
text: "BEP-20"
prefix: ""
url: "https://bscscan.com/tokens"
name: 'BscScan'
image: "bep"
coinType: CoinType.BEP20
}
ListElement
{
text: "ERC-20"
Expand All @@ -95,26 +116,26 @@ MultipageModal
name: 'Etherscan'
coinType: CoinType.ERC20
}
// ListElement
// {
// text: "PLG-20"
// prefix: ""
// image: "matic"
// url: "https://polygonscan.com/tokens"
// name: 'Polygonscan'
// coinType: CoinType.ERC20
// }

// ListElement
// {
// text: "QRC-20"
// prefix: "0x"
// image: "qrc"
// url: "https://explorer.qtum.org/tokens/search"
// name: 'QTUM Insight'
// coinType: CoinType.QRC20
// }

ListElement
{
text: "QRC-20"
prefix: "0x"
image: "qrc"
url: "https://explorer.qtum.org/tokens/search"
name: 'QTUM Insight'
coinType: CoinType.QRC20
}

ListElement
{
text: "BEP-20"
prefix: ""
url: "https://bscscan.com/tokens"
name: 'BscScan'
image: "bep"
coinType: CoinType.BEP20
}
}

readonly property bool has_contract_address: typeList.indexOf(input_type.currentText)!==-1
Expand All @@ -125,6 +146,9 @@ MultipageModal
{
titleText: qsTr("Choose the asset type")
height: 450
titleTopMargin: 0
topMarginAfterTitle: 10
flickMax: window.height - 480

DefaultComboBox
{
Expand Down Expand Up @@ -401,13 +425,13 @@ MultipageModal

// Preview
MultipageModalContent {
titleText: qsTr("Preview")
titleText: qsTr("Preview Token Configuration")

DefaultText {
id: warning_message
visible: coin_name.visible
Layout.fillWidth: true
text_value: qsTr("WARNING: Application will restart immidiately to apply the changes!")
text_value: qsTr("WARNING: Application will restart immediately to apply the changes!")
color: Style.colorRed
horizontalAlignment: Text.AlignHCenter
}
Expand Down
24 changes: 23 additions & 1 deletion atomic_defi_design/Dex/Settings/SettingModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Qaterial.Dialog
{
id: setting_modal
property alias selectedMenuIndex: menu_list.currentIndex
readonly property string mm2_version: API.app.settings_pg.get_mm2_version()
property var recommended_fiats: API.app.settings_pg.get_recommended_fiats()
property var fiats: API.app.settings_pg.get_available_fiats()
property var enableable_coins_count: enableable_coins_count_combo_box.currentValue
Expand Down Expand Up @@ -733,6 +732,29 @@ Qaterial.Dialog
onCopyNotificationMsg: qsTr("Qt Version copied to clipboard.")
}
}

RowLayout
{
width: parent.width - 30
anchors.horizontalCenter: parent.horizontalCenter
height: 60

DexLabel
{
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
text: qsTr("Peer ID")
}

DexCopyableLabel
{
Layout.alignment: Qt.AlignVCenter
text: API.app.settings_pg.get_peerid()
onCopyNotificationTitle: qsTr("Peer ID")
onCopyNotificationMsg: qsTr("Peer ID copied to clipboard.")
}
}

}
}
}
Expand Down
12 changes: 9 additions & 3 deletions atomic_defi_design/Dex/Support/SupportModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,22 @@ Qaterial.Dialog
%1 enables you to natively trade across two different blockchain networks without proxy tokens. You can also place multiple orders with the same funds. For example, you can sell 0.1 BTC for KMD, QTUM, or VRSC — the first order that fills automatically cancels all other orders.").arg(API.app_name)
}

FAQLine
{
title: qsTr("Where can I see the orderbook or market statistics online?")
text: qsTr('You can view an online orderbook and market statistics at <a href="https://markets.atomicdex.io/">https://markets.atomicdex.io/</a>, or use the Komodo Wallet in your browser at <a href="https://app.komodoplatform.com">https://app.komodoplatform.com</a>!')
}

FAQLine
{
title: qsTr("How long does each atomic swap take?")
text: qsTr('Several factors determine the processing time for each swap. The block time of the traded assets depends on each network (Bitcoin typically being the slowest) Additionally, the user can customize security preferences. For example, (you can ask %1 to consider a KMD transaction as final after just 3 confirmations which makes the swap time shorter compared to waiting for a <a href="https://komodoplatform.com/security-delayed-proof-of-work-dpow/">notarization</a>.').arg(API.app_name)
text: qsTr('Several factors determine the processing time for each swap. The block time of the traded assets depends on each network (Bitcoin typically being the slowest) Additionally, the user can customize security preferences. For example, (you can ask %1 to consider a KMD transaction as final after just 3 confirmations which makes the swap time shorter compared to waiting for a <a href="https://komodoplatform.com/security-delayed-proof-of-work-dpow/">notarization</a>.').arg(API.app_name)
}

FAQLine
{
title: qsTr("Do I need to be online for the duration of the swap?")
text: qsTr("Yes. You must remain connected to the internet and have your app running to successfully complete each atomic swap (very short breaks in connectivity are usually fine). Otherwise, there is risk of trade cancellation if you are a maker, and risk of loss of funds if you are a taker.
text: qsTr("Yes. You must remain connected to the internet and have your app running to successfully complete each atomic swap (very short breaks in connectivity are usually fine). Otherwise, there is risk of trade cancellation if you are a maker, and risk of loss of funds if you are a taker. To mitigate this, 'watchertower' nodes have been deployed to monitor the dex network for you and, where possible, complete the swaps for you if your app goes offline.
The atomic swap protocol requires both participants to stay online and monitor the involved blockchains for the process to stay atomic.
Expand Down Expand Up @@ -202,7 +208,7 @@ There is a toggle in settings where you can turn on/off the display of these tra
Layout.preferredHeight: column_layout.height
hoverEnabled: true

onClicked: Qt.openUrlExternally("https://github.com/KomodoPlatform/komodo-wallet-desktop/pull/2296")
onClicked: Qt.openUrlExternally("https://github.com/KomodoPlatform/komodo-wallet-desktop/pull/2388")

ColumnLayout
{
Expand Down
Loading

0 comments on commit 13c3d7f

Please sign in to comment.