Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/fix/dexpro/orderbook/bignum-al…
Browse files Browse the repository at this point in the history
…ignment' into nogeo
  • Loading branch information
cipig committed Aug 13, 2024
2 parents 2fd7c5d + fb1f352 commit 30b7206
Show file tree
Hide file tree
Showing 175 changed files with 2,511 additions and 2,293 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/atomicdex-desktop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- nogeo

env:
DEX_API: "mm2_kmd"
DEX_API: "kdf_kwd"
DEX_RPCPORT: 7762
DEX_RPC: "http://127.0.0.1:7762"
DEX_PROJECT_NAME: "komodo-wallet"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Thumbs.db
# --------
*.exe

/assets/tools/mm2/
/assets/tools/kdf/
/ci_tools_atomic_dex/vcpkg-repo/
/ci_tools_atomic_dex/ci_tools_atomic_dex
ci_tools_atomic_dex/build-Release
Expand Down
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ endif ()

##! We fetch our dependencies
if (APPLE)
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Darwin-Release.zip)
FetchContent_Declare(kdf
URL https://sdk.devbuilds.komodo.earth/main/kdf_35e9239-mac-x86-64.zip)
elseif (UNIX AND NOT APPLE)
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/main/mm2_35e9239-linux-x86-64.zip)
FetchContent_Declare(kdf
URL https://sdk.devbuilds.komodo.earth/main/kdf_35e9239-linux-x86-64.zip)
else ()
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Win64.zip)
FetchContent_Declare(kdf
URL https://sdk.devbuilds.komodo.earth/main/kdf_35e9239-win-x86-64.zip)
endif ()

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

FetchContent_MakeAvailable(mm2 jl777-coins qmaterial)
FetchContent_MakeAvailable(kdf jl777-coins qmaterial)

##! Configure our needs.
if (UNIX)
configure_file(${jl777-coins_SOURCE_DIR}/utils/coins_config_tcp.json ${CMAKE_CURRENT_SOURCE_DIR}/assets/config/${PROJECT_VERSION}-coins.json COPYONLY)
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/mm2/coins COPYONLY)
configure_file(${mm2_SOURCE_DIR}/mm2 ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/mm2/${DEX_API} COPYONLY)
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/kdf/coins COPYONLY)
configure_file(${kdf_SOURCE_DIR}/kdf ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/kdf/${DEX_API} COPYONLY)
file(COPY ${jl777-coins_SOURCE_DIR}/icons/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/atomic_defi_design/assets/images/coins/)
else ()
configure_file(${jl777-coins_SOURCE_DIR}/utils/coins_config_tcp.json ${CMAKE_BINARY_DIR}/bin/assets/config/${PROJECT_VERSION}-coins.json COPYONLY)
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/coins COPYONLY)
configure_file(${mm2_SOURCE_DIR}/mm2.exe ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/${DEX_API}.exe COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/msvcp140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/msvcp140.dll COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/vcruntime140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/vcruntime140.dll COPYONLY)
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/coins COPYONLY)
configure_file(${kdf_SOURCE_DIR}/kdf.exe ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/${DEX_API}.exe COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/msvcp140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/msvcp140.dll COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/vcruntime140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/vcruntime140.dll COPYONLY)
endif ()


Expand Down
1 change: 1 addition & 0 deletions assets/tools/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mm2
coins
kdf
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 @@ -175,7 +175,7 @@ QtObject {
}

function coinContractAddress(ticker) {
var cfg = API.app.trading_pg.get_raw_mm2_coin_cfg(ticker)
var cfg = API.app.trading_pg.get_raw_kdf_coin_cfg(ticker)
if (cfg.hasOwnProperty('protocol')) {
if (cfg.protocol.hasOwnProperty('protocol_data')) {
if (cfg.protocol.protocol_data.hasOwnProperty('contract_address')) {
Expand All @@ -187,7 +187,7 @@ QtObject {
}

function coinPlatform(ticker) {
var cfg = API.app.trading_pg.get_raw_mm2_coin_cfg(ticker)
var cfg = API.app.trading_pg.get_raw_kdf_coin_cfg(ticker)
if (cfg.hasOwnProperty('protocol')) {
if (cfg.protocol.hasOwnProperty('protocol_data')) {
if (cfg.protocol.protocol_data.hasOwnProperty('platform')) {
Expand Down Expand Up @@ -434,6 +434,15 @@ QtObject {
return feetype + " " + amount + " " + ticker + " (" + fiat_text + ")"
}

function reducedBignum(text, decimals=8, max_length=12) {
let val = new BigNumber(text).toFixed(decimals)
if (val.length > max_length)
{
return val.substring(0, max_length) + "..."
}
return val
}

function getSimpleFromPlaceholder(selectedTicker, selectedOrder, sell_ticker_balance) {
if (sell_ticker_balance == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ MultipageModal
{
id: config_section

readonly property var default_config: API.app.trading_pg.get_raw_mm2_coin_cfg(rel_ticker)
readonly property var default_config: API.app.trading_pg.get_raw_kdf_coin_cfg(rel_ticker)
readonly property bool is_dpow_configurable: config_section.default_config.requires_notarization || false

width: dex_pair_badges.width - 40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Item
Layout.fillHeight: true
Layout.minimumWidth: 90
Layout.alignment: Qt.AlignVCenter
text: { new BigNumber(price).toFixed(8) }
text: General.reducedBignum(price)
font.family: DexTypo.fontFamily
font.pixelSize: 12
color: isAsk ? Dex.CurrentTheme.warningColor : Dex.CurrentTheme.okColor
Expand All @@ -200,7 +200,7 @@ Item
Layout.fillHeight: true
Layout.minimumWidth: 90
Layout.alignment: Qt.AlignVCenter
text: { new BigNumber(base_max_volume).toFixed(6) }
text: General.reducedBignum(base_max_volume)
font.family: DexTypo.fontFamily
font.pixelSize: 12
horizontalAlignment: Text.AlignRight
Expand All @@ -219,7 +219,7 @@ Item
Layout.alignment: Qt.AlignVCenter
font.family: DexTypo.fontFamily
font.pixelSize: 12
text: { new BigNumber(total).toFixed(6) }
text: General.reducedBignum(total)
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
Expand Down
2 changes: 1 addition & 1 deletion atomic_defi_design/Dex/Screens/Startup/Logging.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SetupPage
DefaultText
{
Layout.alignment: Qt.AlignHCenter
text_value: (current_status === "initializing_mm2" ? qsTr("Initializing MM2") :
text_value: (current_status === "initializing_kdf" ? qsTr("Initializing KDF") :
current_status === "enabling_coins" ? qsTr("Enabling assets") : qsTr("Getting ready")) + "..."
}
}
Expand Down
2 changes: 1 addition & 1 deletion atomic_defi_design/Dex/Settings/AddCustomCoinModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MultipageModal

onCustom_token_dataChanged: {
const data = custom_token_data
if(!data.mm2_cfg) return
if(!data.kdf_cfg) return

var fields = General.clone(config_fields)

Expand Down
8 changes: 4 additions & 4 deletions atomic_defi_design/Dex/Settings/SettingModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,15 @@ Qaterial.Dialog
{
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
text: qsTr("MM2 version")
text: qsTr("KDF version")
}

DexCopyableLabel
{
Layout.alignment: Qt.AlignVCenter
text: API.app.settings_pg.get_mm2_version()
onCopyNotificationTitle: qsTr("MM2 Version")
onCopyNotificationMsg: qsTr("MM2 Version copied to clipboard.")
text: API.app.settings_pg.get_kdf_version()
onCopyNotificationTitle: qsTr("KDF Version")
onCopyNotificationMsg: qsTr("KDF Version copied to clipboard.")
}
}

Expand Down
Loading

0 comments on commit 30b7206

Please sign in to comment.