feat(amm): wire the AMM app to the LEZ wallet module#197
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Wires the AMM QML UI module (apps/amm) to the on-chain LEZ wallet module by introducing a Qt Remote Objects (QtRO) C++ backend + plugin, and updating the UI to support connect/create/disconnect and account selection.
Changes:
- Add a
ui_qmlC++ backend (AmmUiBackend.*+.rep) that opens/creates a local wallet, lists/creates accounts, syncs balances, and exposes anAccountModelto QML. - Add a Qt plugin entrypoint (
AmmUiPlugin*) and build integration (CMakeLists.txt,metadata.json,flake.nix) to depend onlogos_execution_zone. - Update QML UI (navbar + new wallet components) to support Connect/Connected/account selector/+Account/Disconnect flows.
Reviewed changes
Copilot reviewed 21 out of 24 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/amm/src/AmmUiPluginInterface.h | Adds Qt plugin marker interface / IID for the AMM UI plugin. |
| apps/amm/src/AmmUiPlugin.h | Declares plugin entrypoint that owns and exposes the backend. |
| apps/amm/src/AmmUiPlugin.cpp | Implements plugin init wiring of LogosAPI to the backend. |
| apps/amm/src/AmmUiBackend.rep | Defines QtRO contract for wallet lifecycle + account operations. |
| apps/amm/src/AmmUiBackend.h | Declares backend implementation and exposes AccountModel to QML. |
| apps/amm/src/AmmUiBackend.cpp | Implements wallet open/create/adopt, account refresh, balance sync, clipboard. |
| apps/amm/src/AccountModel.h | Adds QAbstractListModel for accounts (name/address/balance/public). |
| apps/amm/src/AccountModel.cpp | Implements model reset from JSON + per-account balance updates. |
| apps/amm/README.md | Documents wallet/chain integration and operational notes. |
| apps/amm/qml/NavBar.qml | Adds wallet account control to the navbar and exposes selected address. |
| apps/amm/qml/Main.qml | Bridges backend replica + account model into QML and gates readiness. |
| apps/amm/qml/components/wallet/LogosCopyButton.qml | Adds copy-to-clipboard icon button with feedback state. |
| apps/amm/qml/components/wallet/icons/copy.svg | Adds copy icon asset. |
| apps/amm/qml/components/wallet/icons/checkmark.svg | Adds checkmark icon asset. |
| apps/amm/qml/components/wallet/CreateWalletDialog.qml | Adds password-only wallet creation modal. |
| apps/amm/qml/components/wallet/CreateAccountDialog.qml | Adds public/private account creation modal. |
| apps/amm/qml/components/wallet/AccountDelegate.qml | Adds account row delegate (tag, balance, copy address). |
| apps/amm/qml/components/wallet/AccountControl.qml | Adds Connect/Connected/account selector/+Account/Disconnect control. |
| apps/amm/qml/components/wallet/AccountComboBox.qml | Adds account selector dropdown bound to AccountModel. |
| apps/amm/metadata.json | Declares module main plugin + dependency on logos_execution_zone and runtime packages. |
| apps/amm/flake.nix | Pins and wires logos_execution_zone flake input. |
| apps/amm/CMakeLists.txt | Adds CMake build for the amm_ui module with QtRO rep + C++ sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
06d275b to
cd62413
Compare
95f2bd2 to
c2a22d1
Compare
295c4ef to
35c2dd7
Compare
3esmit
previously requested changes
Jun 30, 2026
35c2dd7 to
bf72123
Compare
Turns the dummy-data AMM UI into a real client of the on-chain LEZ wallet.
Adds a hand-written ui_qml C++ backend (src/AmmUi*) over the core
logos_execution_zone module: create/open a local wallet, create and list
public/private accounts, and a navbar Connect / Connected + account-selector
+ Disconnect flow. Onboarding is password-only (no path picking) with a
per-app wallet at ~/.lee/amm-wallet (override: AMM_WALLET_HOME_DIR);
standalone gets its own wallet, Basecamp shares accounts via adopt-on-start.
Requires Nix with flakes; macOS also needs `sandbox = false` (the default).
The logos_execution_zone input is pinned to a module rev whose LEZ (lssa)
already includes the macOS Metal-build fix, so no `--override-input` is
needed — plain `nix run .` works:
cd apps/amm
nix run .
- create_new now returns the new wallet's BIP39 mnemonic (not an int status);
the app currently discards it, so the wallet can't yet be recovered. Surfacing
it in onboarding (+ restore_storage) is a follow-up.
- The wallet password is currently a no-op upstream (storage.rs: "TODO: use
password for storage encryption"); storage.json is plaintext. So Disconnect
is a UI-level lock and reconnect does not (cannot yet) re-prompt for it.
- wallet-ffi requires explicit config/storage paths; a *_default() FFI would
let the app drop its path handling.
- Bundled network config: connects to whatever WalletConfig::default() points
at; real testnet endpoints still TBD.
bf72123 to
2b3ecad
Compare
All comments addressed.
Dismissing review so we can merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns the dummy-data AMM UI into a real client of the on-chain LEZ wallet. Adds a hand-written ui_qml C++ backend (src/AmmUi*) over the core logos_execution_zone module: create/open a local wallet, create and list public/private accounts, and a navbar Connect / Connected + account-selector
Requires Nix with flakes. macOS also needs Xcode + the Metal Toolchain (RISC0 builds GPU prover kernels):
If the build still reports "missing Metal Toolchain", reboot (Xcode 26 mounts the toolchain per-user; a reboot makes it visible to nix's build users). Builds also require nix
sandbox = false(default on macOS). Linux needs none of the Metal steps.The pinned core module still references a pre-fix LEZ rev, so the LEZ input is repointed to a build that includes the macOS Metal fix (github:), already wired in apps/amm/flake.nix — plain
nix run .works: