18 Commits

Author SHA1 Message Date
Ricardo Guilherme Schmidt
aafe5e900b fix(amm-ui): require explicit liquidity inputs
Keep wallet assets as token choices without automatically selecting a pair. Keep pool-probe amounts internal so active-pool quotes do not populate the form before user input.
2026-07-27 12:14:27 +02:00
r4bbit
01829a280c feat(apps/amm): add create-pool / new liquidity position flow
Add a "Create Pool" flow to the AMM app that lets a user open a new
liquidity position — seeding a pool's initial liquidity — from token
selection and amount entry, through a confirmation dialog, to on-chain
submission.

- client crate (apps/amm/client): pure, testable protocol logic — account
  decoding, pair/position modelling, and quote/plan computation — exposed to
  the app over a C ABI (config/networks.json drives network selection).
- C++ runtime + backend: AmmClient, ActiveNetwork, and NewPositionRuntime,
  wired into AmmUiBackend (new resolve/quote/submit slots).
- QML flow: NewPositionForm, NewPositionFlow state, NewPositionConfirmation-
  Dialog, TokenSelectorModal, and reusable Amm* presentational components
  (theme, surfaces, buttons) + AmountMath.js.
- tests: C++ (NewPositionRuntimeTest, ActiveNetworkTest) and QML
  (tst_NewPositionForm, tst_LiquidityPage, tst_TokenAmountInput, …).
2026-07-27 12:14:27 +02:00
r4bbit
266c20a90e fix(apps/amm): ensure changing endpoint works 2026-07-27 12:14:27 +02:00
r4bbit
1dcfb784f8 fix(apps/wallet): use @loader_path rpath for the QML plugin on macOS
The Logos.Wallet QML plugin was installed with an ELF "$ORIGIN" rpath.
macOS dyld does not expand "$ORIGIN", so loading the plugin failed with

  Cannot load library liblogos_wallet_qmlplugin.dylib:
  Library not loaded: @rpath/liblogos_wallet_qml.dylib

even though liblogos_wallet_qml.dylib sits in the same directory. Select
the rpath per platform: @loader_path on Apple, $ORIGIN elsewhere, so
@rpath/liblogos_wallet_qml.dylib resolves to the sibling library.
2026-07-27 12:14:27 +02:00
Ricardo Guilherme Schmidt
64ce091045 feat(wallet): add reusable wallet modules
Add program-neutral wallet access, a stable account model, reusable QML controls, transaction confirmation, submitted-transaction presentation, and isolated contract tests.
2026-07-27 12:14:27 +02:00
Andrea Franz
e03164baf3 fix(amm): LE-serialize instruction words; correct ELF→ProgramBinary docs; clarify sharedWalletIsOpen 2026-07-23 16:17:25 +02:00
Andrea Franz
cf92e5d111 fix(amm): guard resolvePool against stale callbacks; clarify deadline-ms and program-binary docs 2026-07-23 16:17:25 +02:00
Andrea Franz
fe41baf210 fix(amm): address Copilot review — exact BigInt min_out, fail on oversized pool fee, sync flake run docs 2026-07-23 16:17:25 +02:00
Andrea Franz
9b7a3dcaac feat(amm): swap via d70225ced program_id_hex API; pin wallet-module core to sequencer rev 415964d7 2026-07-23 16:17:25 +02:00
Andrea Franz
c0568e3a88 feat(amm): byte-encode swap instruction for QtRO + AMM_DEBUG tracing + token config 2026-07-23 16:17:25 +02:00
Andrea Franz
caf53d0409 fix(amm): order swap holdings/reserves by pool token order; accept base58 ids 2026-07-23 16:17:25 +02:00
Andrea Franz
906aa65b4f feat(amm): config-driven token picker wired to on-chain swaps 2026-07-23 16:17:25 +02:00
Andrea Franz
a0c8983302 feat(amm): wire Swap UI to on-chain resolvePool + swapExactInput 2026-07-23 16:17:25 +02:00
Andrea Franz
b51a71ddf2 feat(amm): resolvePool + swapExactInput backend slots for on-chain swaps 2026-07-23 16:17:25 +02:00
Andrea Franz
cfb62e4d2f build(amm): link amm_client_ffi into the AMM UI module 2026-07-23 16:17:25 +02:00
r4bbit
25b8b86103 chore(amm): add Logos Basecamp support
Provides the necessary instructions to run the AMM app inside Logos
Basecamp.

Closes #29
2026-07-15 18:31:39 +02:00
r4bbit
751d4ac530 feat(amm): wire the AMM app to the LEZ wallet module
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.
2026-07-02 18:57:01 +02:00
r4bbit
3622016e6c refactor: move programs into programs and UIs into apps
This refactors the repository structure as it has grown over time.
2026-05-26 14:05:52 +02:00