status-desktop/ui/app/AppLayouts/Wallet/views/TokenSelectorView.qml

30 lines
779 B
QML

import QtQuick 2.15
import StatusQ.Core 0.1
StatusListView {
id: root
// expected model structure:
// tokensKey, name, symbol, decimals, currencyBalanceAsString (computed), iconSource, marketDetails, balances -> [ chainId, address, balance, iconUrl ]
// output API
signal tokenSelected(string tokensKey)
currentIndex: -1
delegate: TokenSelectorAssetDelegate {
required property var model
required property int index
tokensKey: model.tokensKey
name: model.name
symbol: model.symbol
currencyBalanceAsString: model.currencyBalanceAsString ?? ""
iconSource: model.iconSource
balancesModel: model.balances
onAssetSelected: (tokensKey) => root.tokenSelected(tokensKey)
}
}