Skip to content

Commit

Permalink
Merge pull request #2388 from KomodoPlatform/v7-dev
Browse files Browse the repository at this point in the history
v0.7.0 Release Candidate
  • Loading branch information
smk762 authored Dec 21, 2023
2 parents ada01d6 + 42fea1a commit 791f450
Show file tree
Hide file tree
Showing 337 changed files with 5,321 additions and 3,913 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
- Komodo Wallet Version: [e.g. 0.6.1]
- Komodo Wallet Version: [e.g. 0.7.0]
- Build branch: [e.g. master/dev]


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/atomicdex-desktop-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
DEX_PROJECT_NAME: "komodo-wallet"
DEX_DISPLAY_NAME: "Komodo Wallet"
DEX_COMPANY: "KomodoPlatform"
DEX_VERSION: "0.6.1"
DEX_VERSION: "0.7.0"
DEX_WEBSITE: "https://atomicdex.io/"

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/atomicdex-desktop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
DEX_PROJECT_NAME: "komodo-wallet"
DEX_DISPLAY_NAME: "Komodo Wallet"
DEX_COMPANY: "KomodoPlatform"
DEX_VERSION: "0.6.1"
DEX_VERSION: "0.7.0"
DEX_WEBSITE: "https://atomicdex.io/"
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/b/vcpkg_cache
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include(vcpkg_prerequisites)
include(qt_prerequisites)
include(cfg_hash)

project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.6.1)
project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.7.0)
message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}")

include(cmake_default_options)
Expand Down Expand Up @@ -60,13 +60,13 @@ endif ()
##! We fetch our dependencies
if (APPLE)
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/dev/mm2_6d7d05f-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_6d7d05f-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_6d7d05f-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
1 change: 1 addition & 0 deletions assets/config/cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"notification_enabled": true,
"spamfilter_enabled": false,
"use_static_rpcpass": false,
"current_currency": "USD",
"current_fiat": "USD",
"current_currency_sign": "$",
Expand Down
6 changes: 6 additions & 0 deletions atomic_defi_design/Dex/Addressbook/AddAddressForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Dex.Rectangle
case "QRC-20": return "QTUM"
case "BEP-20": return "BNB"
case "ERC-20": return "ETH"
case "AVX-20": return "AVAX"
case "FTM-20": return "FTM"
case "PLG-20": return "MATIC"
case "Smart Chain": return "KMD"
case "SLP": return "USDT-SLP"
}
Expand All @@ -49,6 +52,9 @@ Dex.Rectangle
case "QRC-20": return true
case "BEP-20": return true
case "ERC-20": return true
case "PLG-20": return true
case "AVX-20": return true
case "FTM-20": return true
case "Smart Chain": return true
case "SLP": return true
}
Expand Down
9 changes: 9 additions & 0 deletions atomic_defi_design/Dex/Components/AmountFloatField.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import QtQuick 2.15

DefaultTextField
{
validator: RegExpValidator
{
regExp: /([0-9]*[.])?[0-9]+/
}
}
3 changes: 2 additions & 1 deletion atomic_defi_design/Dex/Components/AmountIntField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import QtQuick 2.15

DefaultTextField
{
property bool allowFloat: false
validator: RegExpValidator
{
regExp: /[0-9]+/
regExp: allowFloat ? /([0-9]*[.])?[0-9]+/ : /[0-9]+/
}
}
6 changes: 6 additions & 0 deletions atomic_defi_design/Dex/Components/CoinMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Menu {

MenuItem {
id: disable_action
height: 40
text: qsTr("Disable %1", "TICKER").arg(ticker)
onTriggered: API.app.disable_coins([ticker])
enabled: can_disable
Expand All @@ -41,22 +42,27 @@ Menu {
restart_modal.open()
}
enabled: disable_action.enabled && API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).is_custom_coin
visible: enabled
height: enabled ? 40 : 0
}

MenuItem {
height: 40
enabled: !General.prevent_coin_disabling.running
text: qsTr("Disable all %1 assets").arg(type)
onTriggered: API.app.disable_coins(API.app.portfolio_pg.get_all_coins_by_type(type))
}

MenuItem {
height: 40
enabled: !General.prevent_coin_disabling.running
text: qsTr("Disable all assets")
onTriggered: API.app.disable_coins(API.app.portfolio_pg.get_all_enabled_coins())
}

MenuItem
{
height: 40
enabled: !General.prevent_coin_disabling.running
text: qsTr("Disable 0 balance assets")
onTriggered: API.app.disable_no_balance_coins()
Expand Down
8 changes: 4 additions & 4 deletions atomic_defi_design/Dex/Components/SetupPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Item

leftPadding: 30
rightPadding: leftPadding
topPadding: leftPadding * 0.5
bottomPadding: topPadding
topPadding: 12
bottomPadding: 12
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

background: DefaultRectangle
Expand All @@ -69,9 +69,9 @@ Item

DexLanguage
{
y: 52
y: 24
anchors.right: parent.right
anchors.rightMargin: 52
anchors.rightMargin: 24
width: 72
}

Expand Down
122 changes: 66 additions & 56 deletions atomic_defi_design/Dex/Constants/General.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ QtObject {
readonly property string custom_coin_icons_path: os_file_prefix + API.app.settings_pg.get_custom_coins_icons_path() + "/"
readonly property string providerIconsPath: image_path + "providers/"

/* Timers */
property Timer prevent_coin_disabling: Timer { interval: 5000 }

function coinIcon(ticker)
{
if (ticker === "" || ticker === "All" || ticker===undefined)
Expand Down Expand Up @@ -67,19 +70,12 @@ QtObject {
}

function coinName(ticker) {
if(ticker === "" || ticker === "All" || ticker===undefined) {
return ""
} else {
const name = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).name
return name
}
return (ticker === "" || ticker === "All" || ticker===undefined) ? "" : API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).name
}

function canSend(ticker, progress=100)
{
if (!API.app.wallet_pg.send_available) return false
if (isZhtlc(ticker) && progress < 100) return false
return true
return !API.app.wallet_pg.send_available ? false : progress < 100 ? false : true
}

function isWalletOnly(ticker)
Expand All @@ -92,78 +88,84 @@ QtObject {
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 isCoinWithMemo(ticker)
{
return API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker).has_memos
}

function getLanguage()
{
return API.app.settings_pg.lang
}

function isZhtlc(ticker)
function isZhtlc(coin)
{
const coin_info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker)
return coin_info.is_zhtlc_family
return API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_zhtlc_family
}

function isZhtlcReady(ticker)
function isZhtlcReady(coin)
{
if (!isZhtlc(ticker)) return true
let activation_status = API.app.get_zhtlc_status(ticker)
let progress = zhtlcActivationProgress(activation_status, ticker)
if (progress == 100) return true
return false
return !isZhtlc(coin) ? true : (zhtlcActivationProgress(coin) == 100) ? true : false
}

function zhtlcActivationProgress(activation_status, coin='ARRR')
{
let progress = 100
if (!activation_status.hasOwnProperty("result")) return progress
const coin_info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin)
let block_offset = coin_info.checkpoint_height
if (!isZhtlc(coin)) return progress
if (!activation_status.hasOwnProperty("result"))
{
return progress
}
let status = activation_status.result.status
let details = activation_status.result.details
// use range from checkpoint block to present

if (!status)
{
return -1
return 0
}
else if (status == "Ok")
{
if (details.hasOwnProperty("error"))
{
console.log("["+coin+"] [zhtlcActivationProgress] Error enabling: " + JSON.stringify(details.error))
return 0
}
}
else if (status == "InProgress")
{
if (details.hasOwnProperty("UpdatingBlocksCache"))
{
block_offset = details.UpdatingBlocksCache.first_sync_block.actual
let n = details.UpdatingBlocksCache.current_scanned_block - block_offset
let d = details.UpdatingBlocksCache.latest_block - block_offset
progress = 5 + parseInt(n/d*20)
let current = details.UpdatingBlocksCache.current_scanned_block
let latest = details.UpdatingBlocksCache.latest_block
let abs_pct = parseFloat(current/latest)
progress = parseInt(15 * abs_pct)
// console.log("["+coin+"] [zhtlcActivationProgress] UpdatingBlocksCache ["+current+"/"+latest+" * "+abs_pct+" | "+progress+"%]: " + JSON.stringify(details.UpdatingBlocksCache))
}
else if (details.hasOwnProperty("BuildingWalletDb"))
{
block_offset = details.BuildingWalletDb.first_sync_block.actual
let n = details.BuildingWalletDb.current_scanned_block - block_offset
let d = details.BuildingWalletDb.latest_block - block_offset
progress = 45 + parseInt(n/d*60)
if (progress > 95) {
progress = 95
let current = details.BuildingWalletDb.current_scanned_block
let latest = details.BuildingWalletDb.latest_block
let abs_pct = parseFloat(current/latest)
progress = parseInt(98 * abs_pct)
// console.log("["+coin+"] [zhtlcActivationProgress] BuildingWalletDb ["+current+"/"+latest+" * "+abs_pct+" * 98 | "+progress+"%]: " + JSON.stringify(details.BuildingWalletDb))
if (progress < 15) {
progress = 15
}
else if (progress > 98) {
progress = 98
}

}
else if (details.hasOwnProperty("RequestingBalance")) progress = 95
else if (details.hasOwnProperty("ActivatingCoin")) progress = 5
else progress = 5
else if (details.hasOwnProperty("RequestingWalletBalance")) progress = 99
else if (details.hasOwnProperty("ActivatingCoin")) progress = 1
else
{
progress = 2
}
}
else console.log("["+coin+"] [zhtlcActivationProgress] Unexpected status: " + status)
else console.log("["+coin+"] [zhtlcActivationProgress] Unexpected status: " + JSON.stringify(status))
if (progress > 100) {
progress = 98
}

progress = 100
}
return progress
}

Expand Down Expand Up @@ -476,6 +478,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 @@ -678,13 +685,12 @@ QtObject {
return false
}

property Timer prevent_coin_disabling: Timer { interval: 5000 }

function canDisable(ticker) {
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 All @@ -695,19 +701,19 @@ QtObject {
if (ticker === "BCH") return !General.isParentCoinNeeded("BCH", "SLP")
if (ticker === "UBQ") return !General.isParentCoinNeeded("UBQ", "Ubiq")
if (ticker === "MOVR") return !General.isParentCoinNeeded("MOVR", "Moonriver")
if (ticker === "GLMR") return !General.isParentCoinNeeded("GLMR", "Moonbeam")
if (General.isZhtlc(ticker))
{
let progress = General.zhtlcActivationProgress(API.app.wallet_pg.ticker_infos.activation_status, ticker)
if (progress != 100) return false
}

if (ticker === "IRIS") return !General.isParentCoinNeeded("IRIS", "COSMOS")
if (ticker === "OSMO") return !General.isParentCoinNeeded("OSMO", "COSMOS")
if (ticker === "ATOM") return !General.isParentCoinNeeded("ATOM", "COSMOS")
return true
}

function tokenUnitName(type)
function tokenUnitName(current_ticker_infos)
{
return type === "QRC-20" ? "Satoshi" : "Gwei"
if (current_ticker_infos.type === "TENDERMINT" || current_ticker_infos.type === "TENDERMINTTOKEN")
{
return "u" + current_ticker_infos.name.toLowerCase()
}
return current_ticker_infos.type === "QRC-20" ? "Satoshi" : "Gwei"
}

function isSpecialToken(current_ticker_infos)
Expand All @@ -718,7 +724,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
Loading

0 comments on commit 791f450

Please sign in to comment.