Skip to content

feat(amm): wire the AMM app to the LEZ wallet module#197

Merged
0x-r4bbit merged 1 commit into
mainfrom
chore/amm-app-lez-module
Jul 2, 2026
Merged

feat(amm): wire the AMM app to the LEZ wallet module#197
0x-r4bbit merged 1 commit into
mainfrom
chore/amm-app-lez-module

Conversation

@0x-r4bbit

@0x-r4bbit 0x-r4bbit commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

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 the canonical LEZ wallet at ~/.lee/wallet (override: LEE_WALLET_HOME_DIR); standalone shares that keystore with other LEZ wallet clients, Basecamp shares accounts via adopt-on-start.

Requires Nix with flakes. macOS also needs Xcode + the Metal Toolchain (RISC0 builds GPU prover kernels):

xcodebuild -downloadComponent MetalToolchain

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:

cd apps/amm
nix run .
  • 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_qml C++ backend (AmmUiBackend.* + .rep) that opens/creates a local wallet, lists/creates accounts, syncs balances, and exposes an AccountModel to QML.
  • Add a Qt plugin entrypoint (AmmUiPlugin*) and build integration (CMakeLists.txt, metadata.json, flake.nix) to depend on logos_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.

Comment thread apps/amm/src/AmmUiBackend.cpp
Comment thread apps/amm/src/AmmUiBackend.cpp Outdated
Comment thread apps/amm/qml/components/wallet/AccountControl.qml
Comment thread apps/amm/qml/components/wallet/LogosCopyButton.qml
Comment thread apps/amm/qml/components/wallet/CreateWalletDialog.qml
Comment thread apps/amm/qml/components/wallet/CreateAccountDialog.qml
Comment thread apps/amm/qml/components/wallet/AccountDelegate.qml
Comment thread apps/amm/qml/components/wallet/AccountControl.qml
Comment thread apps/amm/qml/components/wallet/AccountComboBox.qml Outdated
@0x-r4bbit 0x-r4bbit force-pushed the chore/amm-app-lez-module branch 4 times, most recently from 06d275b to cd62413 Compare June 26, 2026 07:24
@3esmit 3esmit force-pushed the chore/amm-app-lez-module branch 2 times, most recently from 95f2bd2 to c2a22d1 Compare June 29, 2026 15:35
@3esmit 3esmit requested a review from Copilot June 29, 2026 16:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 44 changed files in this pull request and generated 2 comments.

Comment thread apps/amm/src/AmmUiBackend.cpp
Comment thread apps/amm/src/AmmUiBackend.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 37 out of 45 changed files in this pull request and generated 4 comments.

Comment thread apps/amm/src/AmmUiBackend.cpp Outdated
Comment thread apps/amm/src/AmmUiBackend.cpp
Comment thread apps/amm/src/AmmUiBackend.cpp
Comment thread apps/amm/qml/components/wallet/AccountControl.qml Outdated
@3esmit 3esmit force-pushed the chore/amm-app-lez-module branch 3 times, most recently from 295c4ef to 35c2dd7 Compare June 30, 2026 16:53
3esmit
3esmit previously requested changes Jun 30, 2026
Comment thread apps/amm/result Outdated
Comment thread apps/amm/src/AmmUiBackend.cpp Outdated
Comment thread apps/amm/src/AmmUiBackend.cpp Outdated
@0x-r4bbit 0x-r4bbit force-pushed the chore/amm-app-lez-module branch from 35c2dd7 to bf72123 Compare July 2, 2026 16:36
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.
@0x-r4bbit 0x-r4bbit force-pushed the chore/amm-app-lez-module branch from bf72123 to 2b3ecad Compare July 2, 2026 16:38
@0x-r4bbit 0x-r4bbit dismissed 3esmit’s stale review July 2, 2026 16:56

All comments addressed.

Dismissing review so we can merge.

@0x-r4bbit 0x-r4bbit merged commit 751d4ac into main Jul 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants