1
0

qml: refactor ChannelDetails. Add funding outpoint

This commit is contained in:
Sander van Grieken
2023-11-10 13:02:55 +01:00
parent 2995bc8b37
commit 3967323842
2 changed files with 189 additions and 130 deletions

View File

@@ -19,7 +19,7 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
_logger = get_logger(__name__)
@pyqtEnum
class State(IntEnum): # subset, only ones we currently need in UI
class State(IntEnum): # subset, only ones we currently need in UI
Closed = ChannelState.CLOSED
Redeemed = ChannelState.REDEEMED
@@ -113,6 +113,14 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
return ''
return 'Local' if self._channel.constraints.is_initiator else 'Remote'
@pyqtProperty('QVariantMap', notify=channelChanged)
def fundingOutpoint(self):
outpoint = self._channel.funding_outpoint
return {
'txid': outpoint.txid,
'index': outpoint.output_index
}
@pyqtProperty(QEAmount, notify=channelChanged)
def capacity(self):
self._capacity.copyFrom(QEAmount(amount_sat=self._channel.get_capacity()))