qml: refactor ChannelDetails. Add funding outpoint
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user