mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-17 12:29:27 +00:00
Implement one create-pool and add-liquidity workflow. Add searchable token resolution, direct opening-price and deposit editing, optimistic pool activation, and base58 transaction IDs. Isolate network, wallet, AMM client, and runtime boundaries. Stabilize quote, submission, refresh, and pool-probe state while consolidating liquidity tests and removing obsolete liquidity paths.
85 lines
2.5 KiB
CMake
85 lines
2.5 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
project(AmmUiPlugin LANGUAGES CXX)
|
|
|
|
find_package(Qt6 6.8 REQUIRED COMPONENTS Core Gui Network Qml Quick QuickControls2)
|
|
qt_standard_project_setup(REQUIRES 6.8)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(BASE58 REQUIRED IMPORTED_TARGET libbase58)
|
|
|
|
include(CTest)
|
|
|
|
if(DEFINED ENV{LOGOS_MODULE_BUILDER_ROOT})
|
|
include($ENV{LOGOS_MODULE_BUILDER_ROOT}/cmake/LogosModule.cmake)
|
|
else()
|
|
message(FATAL_ERROR "LogosModule.cmake not found. Set LOGOS_MODULE_BUILDER_ROOT.")
|
|
endif()
|
|
|
|
set(LOGOS_WALLET_SOURCE_DIR
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../shared/wallet"
|
|
CACHE PATH "Path to the shared Logos wallet module"
|
|
)
|
|
set(LOGOS_WALLET_GENERATED_DIR
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/generated_code"
|
|
CACHE PATH "Path to generated Logos SDK sources"
|
|
)
|
|
add_subdirectory("${LOGOS_WALLET_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/shared-wallet")
|
|
|
|
# ui_qml module with a hand-written C++ backend (QtRO .rep view contract +
|
|
# generated *SimpleSource/*ViewPluginBase). Mirrors the LEZ wallet UI module.
|
|
logos_module(
|
|
NAME amm_ui
|
|
REP_FILE src/AmmUiBackend.rep
|
|
SOURCES
|
|
src/AmmUiPluginInterface.h
|
|
src/AmmUiPlugin.h
|
|
src/AmmUiPlugin.cpp
|
|
src/AmmUiBackend.h
|
|
src/AmmUiBackend.cpp
|
|
src/ActiveNetwork.h
|
|
src/ActiveNetwork.cpp
|
|
src/AmmClient.h
|
|
src/AmmClient.cpp
|
|
src/NewPositionRuntime.h
|
|
src/NewPositionRuntime.cpp
|
|
FIND_PACKAGES
|
|
Qt6Gui
|
|
Qt6Network
|
|
LINK_LIBRARIES
|
|
Qt6::Gui
|
|
Qt6::Network
|
|
PkgConfig::BASE58
|
|
LINK_TARGETS
|
|
logos_wallet_access
|
|
EXTERNAL_LIBS
|
|
amm_client
|
|
)
|
|
|
|
qt_add_resources(amm_ui_module_plugin amm_ui_config
|
|
PREFIX "/amm"
|
|
FILES
|
|
config/networks.json
|
|
)
|
|
|
|
if(BUILD_TESTING)
|
|
add_executable(amm_active_network_test
|
|
tests/cpp/ActiveNetworkTest.cpp
|
|
src/ActiveNetwork.cpp
|
|
)
|
|
target_include_directories(amm_active_network_test PRIVATE src)
|
|
target_link_libraries(amm_active_network_test PRIVATE Qt6::Core)
|
|
add_test(NAME amm_active_network COMMAND amm_active_network_test)
|
|
|
|
add_executable(amm_new_position_runtime_test
|
|
tests/cpp/NewPositionRuntimeTest.cpp
|
|
src/NewPositionRuntime.cpp
|
|
)
|
|
target_include_directories(amm_new_position_runtime_test PRIVATE src)
|
|
target_link_libraries(amm_new_position_runtime_test PRIVATE
|
|
Qt6::Core
|
|
PkgConfig::BASE58
|
|
logos_wallet_access
|
|
)
|
|
add_test(NAME amm_new_position_runtime COMMAND amm_new_position_runtime_test)
|
|
endif()
|