mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 22:21:16 +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.
43 lines
1.3 KiB
C++
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;
|
|
};
|