lez-programs/apps/amm/qml/components/liquidity/AmmTokenAccessory.qml
r4bbit b2753aa0c9
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-24 14:00:42 +02:00

47 lines
1.2 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
ColumnLayout {
id: root
required property var theme
property bool hasToken: false
property string tokenColor: root.theme.colors.noTokenCircle
property string tokenLetter: ""
property string tokenText: qsTr("Select token")
property string balance: ""
property string accessibleName: qsTr("Select token")
property bool invalid: false
signal clicked
spacing: 2
Text {
Layout.fillWidth: true
visible: root.balance.length > 0
text: qsTr("Balance %1").arg(root.balance)
color: root.theme.colors.textSecondary
font.pixelSize: 10
horizontalAlignment: Text.AlignRight
elide: Text.ElideRight
}
AmmTokenSelectButton {
objectName: "tokenSelectButton"
Layout.fillWidth: true
theme: root.theme
enabled: root.enabled
invalid: root.invalid
hasToken: root.hasToken
tokenColor: root.tokenColor
tokenLetter: root.tokenLetter
text: root.tokenText
maximumTextWidth: 112
Accessible.name: root.accessibleName
onClicked: root.clicked()
}
}