Files
lez-programs/apps/amm/src/NewPositionRuntime.h
T
Ricardo Guilherme Schmidt 0327892a70 feat(amm-ui): complete new position liquidity flow
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.
2026-07-18 19:55:15 -03:00

43 lines
1.3 KiB
C++

#pragma once
#include <QJsonArray>
#include <QJsonObject>
#include <QString>
#include <QVariantMap>
#include "ActiveNetwork.h"
class AmmClient;
class WalletProvider;
class NewPositionRuntime {
public:
NewPositionRuntime(WalletProvider* wallet, AmmClient* client);
void clearWalletAccounts();
QVariantMap context(const QVariantMap& request,
const ActiveNetworkSnapshot& network,
bool walletOpen,
bool refreshWalletAccounts);
QVariantMap quote(const QVariantMap& request,
const ActiveNetworkSnapshot& network,
bool walletOpen);
QVariantMap submit(const QVariantMap& request,
const QString& quoteHash,
const ActiveNetworkSnapshot& network,
bool walletOpen);
private:
QJsonArray walletAccountReads(bool walletOpen, bool refresh) const;
QJsonObject buildQuoteInput(const QVariantMap& request,
const ActiveNetworkSnapshot& network,
bool walletOpen,
bool freshWalletAccounts,
QJsonObject* error) const;
WalletProvider* m_wallet;
AmmClient* m_client;
bool m_submitInFlight = false;
};