Skip to content

Commit f620d0f

Browse files
authored
Merge pull request #2472 from KomodoPlatform/dev
v0.8.0 Release Candidate
2 parents 056f76f + 070cf55 commit f620d0f

File tree

199 files changed

+3130
-2443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+3130
-2443
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Please describe what you expected to happen.
2626
**Operating Environment(s):**
2727
- OS: [e.g. Windows/OSX/Linux. If Linux, include distro. ]
2828
- OS version: [e.g. 7/10/11, 10.13/10.15, 18.04/20.04 ]
29-
- Komodo Wallet Desktop Version: [e.g. 0.7.2]
29+
- Komodo Wallet Desktop Version: [e.g. 0.8.0]
3030
- Build branch: [e.g. master/dev]
3131

3232

.github/workflows/atomicdex-desktop-cd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
DEX_PROJECT_NAME: "komodo-wallet"
1010
DEX_DISPLAY_NAME: "Komodo Wallet"
1111
DEX_COMPANY: "KomodoPlatform"
12-
DEX_VERSION: "0.7.2"
12+
DEX_VERSION: "0.8.0"
1313
DEX_WEBSITE: "https://atomicdex.io/"
1414

1515
jobs:

.github/workflows/atomicdex-desktop-ci.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ on:
1111
workflow_dispatch:
1212

1313
env:
14-
DEX_API: "mm2_kmd"
14+
DEX_API: "kdf_kwd"
1515
DEX_RPCPORT: 7762
1616
DEX_RPC: "http://127.0.0.1:7762"
1717
DEX_PROJECT_NAME: "komodo-wallet"
1818
DEX_DISPLAY_NAME: "Komodo Wallet"
1919
DEX_COMPANY: "KomodoPlatform"
20-
DEX_VERSION: "0.7.2"
20+
DEX_VERSION: "0.8.0"
2121
DEX_WEBSITE: "https://atomicdex.io/"
2222
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/b/vcpkg_cache
2323
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
@@ -159,9 +159,7 @@ jobs:
159159
export SHELL=/bin/bash
160160
echo "CHOOSENIM_CHOOSE_VERSION=1.6.2" >> $GITHUB_ENV
161161
export CHOOSENIM_CHOOSE_VERSION=1.6.2
162-
curl https://nim-lang.org/choosenim/init.sh > choosenim.sh
163-
chmod +x choosenim.sh
164-
./choosenim.sh -y
162+
./ci_tools_atomic_dex/ci_scripts/choosenim.sh -y
165163
export PATH=/home/runner/.nimble/bin:$PATH
166164
chmod +x /home/runner/.choosenim/toolchains/nim-1.6.2/bin/*
167165
@@ -170,9 +168,7 @@ jobs:
170168
run: |
171169
echo "CHOOSENIM_CHOOSE_VERSION=1.6.2" >> $GITHUB_ENV
172170
export CHOOSENIM_CHOOSE_VERSION=1.6.2
173-
curl https://nim-lang.org/choosenim/init.sh > choosenim.sh
174-
chmod +x choosenim.sh
175-
./choosenim.sh -y
171+
./ci_tools_atomic_dex/ci_scripts/choosenim.sh -y
176172
export PATH=/Users/runner/.nimble/bin:$PATH
177173
chmod +x /Users/runner/.choosenim/toolchains/nim-1.6.2/bin/*
178174

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Thumbs.db
6969
# --------
7070
*.exe
7171

72-
/assets/tools/mm2/
72+
/assets/tools/kdf/
7373
/ci_tools_atomic_dex/vcpkg-repo/
7474
/ci_tools_atomic_dex/ci_tools_atomic_dex
7575
ci_tools_atomic_dex/build-Release

CMakeLists.txt

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include(vcpkg_prerequisites)
1111
include(qt_prerequisites)
1212
include(cfg_hash)
1313

14-
project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.7.2)
14+
project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.8.0)
1515
message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}")
1616

1717
include(cmake_default_options)
@@ -59,14 +59,14 @@ endif ()
5959

6060
##! We fetch our dependencies
6161
if (APPLE)
62-
FetchContent_Declare(mm2
63-
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Darwin-Release.zip)
62+
FetchContent_Declare(kdf
63+
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.1.0-beta/mm2-35e923949-Darwin-Release.zip)
6464
elseif (UNIX AND NOT APPLE)
65-
FetchContent_Declare(mm2
66-
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Linux-Release.zip)
65+
FetchContent_Declare(kdf
66+
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.1.0-beta/mm2-35e923949-Linux-Release.zip)
6767
else ()
68-
FetchContent_Declare(mm2
69-
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Win64.zip)
68+
FetchContent_Declare(kdf
69+
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.1.0-beta/mm2-35e923949-Win64.zip)
7070
endif ()
7171

7272
#FetchContent_Declare(qmaterial URL https://github.com/KomodoPlatform/Qaterial/archive/last-clang-working-2.zip)
@@ -83,20 +83,20 @@ FetchContent_Declare(jl777-coins
8383
#FetchContent_Declare(adex-generics-coins
8484
# URL https://github.com/KomodoPlatform/komodo-wallet-desktop/archive/main.zip)
8585

86-
FetchContent_MakeAvailable(mm2 jl777-coins qmaterial)
86+
FetchContent_MakeAvailable(kdf jl777-coins qmaterial)
8787

8888
##! Configure our needs.
8989
if (UNIX)
9090
configure_file(${jl777-coins_SOURCE_DIR}/utils/coins_config_tcp.json ${CMAKE_CURRENT_SOURCE_DIR}/assets/config/${PROJECT_VERSION}-coins.json COPYONLY)
91-
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/mm2/coins COPYONLY)
92-
configure_file(${mm2_SOURCE_DIR}/mm2 ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/mm2/${DEX_API} COPYONLY)
91+
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/kdf/coins COPYONLY)
92+
configure_file(${kdf_SOURCE_DIR}/mm2 ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/kdf/${DEX_API} COPYONLY)
9393
file(COPY ${jl777-coins_SOURCE_DIR}/icons/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/atomic_defi_design/assets/images/coins/)
9494
else ()
9595
configure_file(${jl777-coins_SOURCE_DIR}/utils/coins_config_tcp.json ${CMAKE_BINARY_DIR}/bin/assets/config/${PROJECT_VERSION}-coins.json COPYONLY)
96-
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/coins COPYONLY)
97-
configure_file(${mm2_SOURCE_DIR}/mm2.exe ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/${DEX_API}.exe COPYONLY)
98-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/msvcp140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/msvcp140.dll COPYONLY)
99-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/vcruntime140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/vcruntime140.dll COPYONLY)
96+
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/coins COPYONLY)
97+
configure_file(${kdf_SOURCE_DIR}/mm2.exe ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/${DEX_API}.exe COPYONLY)
98+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/msvcp140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/msvcp140.dll COPYONLY)
99+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/vcruntime140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/vcruntime140.dll COPYONLY)
100100
endif ()
101101

102102

assets/tools/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
mm2
22
coins
3+
kdf

atomic_defi_design/Dex/Components/DexLabel.qml

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ Text
2020
}
2121
}
2222

23+
text: privacy && Dex.General.privacy_mode ? Dex.General.privacy_text : text_value
2324
font: monospace ? Dex.DexTypo.monoSmall : Dex.DexTypo.body2
24-
2525
color: enabled ? Dex.CurrentTheme.foregroundColor : Dex.CurrentTheme.textDisabledColor
26-
27-
text: privacy && Dex.General.privacy_mode ? Dex.General.privacy_text : text_value
2826
wrapMode: Text.WordWrap
29-
3027
onLinkActivated: Qt.openUrlExternally(link)
3128
linkColor: color
3229
}

atomic_defi_design/Dex/Components/DexTextField.qml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ TextField
1010

1111
property alias left_text: left_text.text_value
1212
property alias right_text: right_text.text_value
13+
property alias left_fontsize: left_text.font.pixelSize
14+
property alias right_fontsize: right_text.font.pixelSize
1315
property alias radius: background.radius
1416
property color backgroundColor: Dex.CurrentTheme.textFieldBackgroundColor
1517
property color backgroundColorActive: Dex.CurrentTheme.textFieldActiveBackgroundColor

atomic_defi_design/Dex/Components/PairItemBadge.qml

+17-18
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ DexRectangle
3030
Layout.leftMargin: 10
3131
Layout.rightMargin: 20
3232

33-
Dex.Text{
33+
DexLabel
34+
{
3435
anchors.bottom: parent.top
3536
anchors.bottomMargin: 5
3637
anchors.horizontalCenter: parent.horizontalCenter
@@ -46,6 +47,7 @@ DexRectangle
4647
Layout.leftMargin: 20
4748
Layout.rightMargin: 20
4849

50+
// Coin Icon
4951
Dex.Image
5052
{
5153
id: icon
@@ -58,49 +60,46 @@ DexRectangle
5860
Layout.topMargin: 0
5961
Layout.bottomMargin: 0
6062
}
63+
64+
//
6165
ColumnLayout
6266
{
6367
spacing: 2
6468
Layout.alignment: Qt.AlignVCenter
6569

66-
Dex.Text
70+
DexLabel
6771
{
6872
Layout.preferredWidth: parent.width - 15
69-
7073
text_value: `<font color="${Style.getCoinColor(ticker)}"><b>${ticker}</b></font>&nbsp;&nbsp;&nbsp;<font color="${Dex.CurrentTheme.foregroundColor}">${fullname}</font>`
71-
font.pixelSize: Style.textSizeSmall3
74+
font: Dex.DexTypo.body2
7275
elide: Text.ElideRight
7376
wrapMode: Text.NoWrap
7477
}
7578

76-
Dex.Text
79+
DexLabel
7780
{
7881
id: middle_line
79-
8082
property string coin_value: amount
81-
text: coin_value
83+
text_value: coin_value
8284
Layout.fillWidth: true
8385
elide: Text.ElideRight
84-
color: Dex.CurrentTheme.foregroundColor
85-
font: DexTypo.body2
8686
wrapMode: Label.NoWrap
87-
ToolTip.text: coin_value
88-
Component.onCompleted: font.pixelSize = 11.5
87+
font: DexTypo.body3
88+
ToolTip.text: text_value
89+
privacy: true
8990
}
9091

91-
Dex.Text
92+
DexLabel
9293
{
9394
id: bottom_line
94-
9595
property string fiat_value: General.getFiatText(amount, ticker)
96-
text: fiat_value
96+
text_value: fiat_value
9797
Layout.fillWidth: true
9898
elide: Text.ElideRight
99-
color: Dex.CurrentTheme.foregroundColor
100-
font: DexTypo.body2
99+
font: DexTypo.body3
101100
wrapMode: Label.NoWrap
102-
ToolTip.text: fiat_value
103-
Component.onCompleted: font.pixelSize = 11.5
101+
ToolTip.text: text_value
102+
privacy: true
104103
}
105104
}
106105
}

atomic_defi_design/Dex/Constants/General.qml

+40-12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ QtObject {
2525

2626
function coinIcon(ticker)
2727
{
28+
if (ticker.toLowerCase() == "smart chain")
29+
{
30+
return coin_icons_path + "smart_chain.png"
31+
}
32+
if (ticker.toLowerCase() == "avx")
33+
{
34+
return coin_icons_path + "avax.png"
35+
}
2836
if (ticker === "" || ticker === "All" || ticker===undefined)
2937
{
3038
return ""
@@ -175,7 +183,7 @@ QtObject {
175183
}
176184

177185
function coinContractAddress(ticker) {
178-
var cfg = API.app.trading_pg.get_raw_mm2_coin_cfg(ticker)
186+
var cfg = API.app.trading_pg.get_raw_kdf_coin_cfg(ticker)
179187
if (cfg.hasOwnProperty('protocol')) {
180188
if (cfg.protocol.hasOwnProperty('protocol_data')) {
181189
if (cfg.protocol.protocol_data.hasOwnProperty('contract_address')) {
@@ -187,7 +195,7 @@ QtObject {
187195
}
188196

189197
function coinPlatform(ticker) {
190-
var cfg = API.app.trading_pg.get_raw_mm2_coin_cfg(ticker)
198+
var cfg = API.app.trading_pg.get_raw_kdf_coin_cfg(ticker)
191199
if (cfg.hasOwnProperty('protocol')) {
192200
if (cfg.protocol.hasOwnProperty('protocol_data')) {
193201
if (cfg.protocol.protocol_data.hasOwnProperty('platform')) {
@@ -419,6 +427,14 @@ QtObject {
419427
}
420428

421429
function getFeesDetail(fees) {
430+
if (privacy_mode) {
431+
return [
432+
{"label": privacy_text},
433+
{"label": privacy_text},
434+
{"label": privacy_text},
435+
{"label": privacy_text}
436+
]
437+
}
422438
return [
423439
{"label": qsTr("<b>Taker tx fee:</b> "), "fee": fees.base_transaction_fees, "ticker": fees.base_transaction_fees_ticker},
424440
{"label": qsTr("<b>Dex tx fee:</b> "), "fee": fees.fee_to_send_taker_fee, "ticker": fees.fee_to_send_taker_fee_ticker},
@@ -434,10 +450,23 @@ QtObject {
434450
return feetype + " " + amount + " " + ticker + " (" + fiat_text + ")"
435451
}
436452

453+
function reducedBignum(text, decimals=8, max_length=12) {
454+
let val = new BigNumber(text).toFixed(decimals)
455+
if (val.length > max_length)
456+
{
457+
return val.substring(0, max_length)
458+
}
459+
return val
460+
}
461+
437462
function getSimpleFromPlaceholder(selectedTicker, selectedOrder, sell_ticker_balance) {
463+
if (privacy_mode)
464+
{
465+
return "0"
466+
}
438467
if (sell_ticker_balance == 0)
439468
{
440-
return qsTr("%1 balance is zero").arg(selectedTicker)
469+
return qsTr("Balance is zero!")
441470
}
442471
if (!isZhtlcReady(selectedTicker))
443472
{
@@ -489,6 +518,7 @@ QtObject {
489518
}
490519

491520
function getTxExplorerURL(ticker, txid, add_0x=true) {
521+
if (privacy_mode) return ''
492522
if(txid !== '') {
493523
const coin_info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker)
494524
const txid_prefix = (add_0x && coin_info.is_erc_family) ? '0x' : ''
@@ -497,6 +527,7 @@ QtObject {
497527
}
498528

499529
function getAddressExplorerURL(ticker, address) {
530+
if (privacy_mode) return ''
500531
if(address !== '') {
501532
const coin_info = API.app.portfolio_pg.global_cfg_mdl.get_coin_info(ticker)
502533
return coin_info.explorer_url + addressTxUri(coin_info) + address
@@ -505,12 +536,14 @@ QtObject {
505536
}
506537

507538
function viewTxAtExplorer(ticker, txid, add_0x=true) {
539+
if (privacy_mode) return ''
508540
if(txid !== '') {
509541
Qt.openUrlExternally(getTxExplorerURL(ticker, txid, add_0x))
510542
}
511543
}
512544

513545
function viewAddressAtExplorer(ticker, address) {
546+
if (privacy_mode) return ''
514547
if(address !== '') {
515548
Qt.openUrlExternally(getAddressExplorerURL(ticker, address))
516549
}
@@ -555,6 +588,7 @@ QtObject {
555588
}
556589

557590
function convertUsd(v) {
591+
if (privacy_mode) return ''
558592
let rate = API.app.get_rate_conversion("USD", API.app.settings_pg.current_currency)
559593
let value = parseFloat(v) / parseFloat(rate)
560594

@@ -566,6 +600,7 @@ QtObject {
566600
}
567601

568602
function formatFiat(received, amount, fiat, precision=2) {
603+
if (privacy_mode) return ''
569604
if (precision == 2 && fiat == "BTC") {
570605
precision = 8
571606
}
@@ -575,6 +610,7 @@ QtObject {
575610
}
576611

577612
function formatPercent(value, show_prefix=true) {
613+
if (privacy_mode) return ''
578614
let prefix = ''
579615
if(value > 0) prefix = '+ '
580616
else if(value < 0) {
@@ -619,6 +655,7 @@ QtObject {
619655
}
620656

621657
function formatCrypto(received, amount, ticker, fiat_amount, fiat, precision, trail_zeros) {
658+
if (privacy_mode) return ''
622659
return diffPrefix(received) + ticker + " " + formatDouble(amount, precision, trail_zeros) + (fiat_amount ? " (" + formatFiat("", fiat_amount, fiat) + ")" : "")
623660
}
624661

@@ -777,15 +814,10 @@ QtObject {
777814
}
778815

779816
function feeText(trade_info, base_ticker, has_info_icon=true, has_limited_space=false) {
780-
781-
782817
if(!trade_info || !trade_info.trading_fee) return ""
783-
784818
const tx_fee = txFeeText(trade_info, base_ticker, has_info_icon, has_limited_space)
785819
const trading_fee = tradingFeeText(trade_info, base_ticker, has_info_icon)
786820
const minimum_amount = minimumtradingFeeText(trade_info, base_ticker, has_info_icon)
787-
788-
789821
return tx_fee + "\n" + trading_fee +"<br>"+minimum_amount
790822
}
791823

@@ -804,13 +836,9 @@ QtObject {
804836
}
805837

806838
function txFeeText(trade_info, base_ticker, has_info_icon=true, has_limited_space=false) {
807-
808839
if(!trade_info || !trade_info.trading_fee) return ""
809-
810840
const has_parent_coin_fees = hasParentCoinFees(trade_info)
811-
812841
var info = qsTr('%1 Transaction Fee'.arg(trade_info.base_transaction_fees_ticker))+': '+ trade_info.base_transaction_fees + " (%1)".arg(getFiatText(trade_info.base_transaction_fees, trade_info.base_transaction_fees_ticker, has_info_icon))
813-
814842
if (has_parent_coin_fees) {
815843
info = info+"<br>"+qsTr('%1 Transaction Fee'.arg(trade_info.rel_transaction_fees_ticker))+': '+ trade_info.rel_transaction_fees + " (%1)".arg(getFiatText(trade_info.rel_transaction_fees, trade_info.rel_transaction_fees_ticker, has_info_icon))
816844
}

0 commit comments

Comments
 (0)