fiat and balance amount fixes
This commit is contained in:
@@ -253,7 +253,9 @@ Pane {
|
|||||||
Connections {
|
Connections {
|
||||||
target: Daemon.fx
|
target: Daemon.fx
|
||||||
function onQuotesUpdated() {
|
function onQuotesUpdated() {
|
||||||
amountFiat.text = Daemon.fx.fiatValue(Config.unitsToSats(amount.text))
|
amountFiat.text = amount.text == ''
|
||||||
|
? ''
|
||||||
|
: Daemon.fx.fiatValue(Config.unitsToSats(amount.text))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,9 @@ Pane {
|
|||||||
Connections {
|
Connections {
|
||||||
target: Daemon.fx
|
target: Daemon.fx
|
||||||
function onQuotesUpdated() {
|
function onQuotesUpdated() {
|
||||||
amountFiat.text = Daemon.fx.fiatValue(Config.unitsToSats(amount.text))
|
amountFiat.text = amount.text == ''
|
||||||
|
? ''
|
||||||
|
: Daemon.fx.fiatValue(Config.unitsToSats(amount.text))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,6 @@ class QEFX(QObject):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
sd = Decimal(satoshis)
|
sd = Decimal(satoshis)
|
||||||
#if sd == 0:
|
|
||||||
#return ''
|
|
||||||
except:
|
except:
|
||||||
return ''
|
return ''
|
||||||
if plain:
|
if plain:
|
||||||
@@ -118,8 +116,6 @@ class QEFX(QObject):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
sd = Decimal(satoshis)
|
sd = Decimal(satoshis)
|
||||||
if sd == 0:
|
|
||||||
return ''
|
|
||||||
except:
|
except:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|||||||
@@ -225,20 +225,22 @@ class QEWallet(QObject):
|
|||||||
|
|
||||||
balanceChanged = pyqtSignal()
|
balanceChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty('quint64', notify=balanceChanged)
|
@pyqtProperty(QEAmount, notify=balanceChanged)
|
||||||
def frozenBalance(self):
|
def frozenBalance(self):
|
||||||
return self.wallet.get_frozen_balance()
|
self._frozenbalance = QEAmount(amount_sat=self.wallet.get_frozen_balance())
|
||||||
|
return self._frozenbalance
|
||||||
|
|
||||||
@pyqtProperty('quint64', notify=balanceChanged)
|
@pyqtProperty(QEAmount, notify=balanceChanged)
|
||||||
def unconfirmedBalance(self):
|
def unconfirmedBalance(self):
|
||||||
return self.wallet.get_balance()[1]
|
self._unconfirmedbalance = QEAmount(amount_sat=self.wallet.get_balance()[1])
|
||||||
|
return self._unconfirmedbalance
|
||||||
|
|
||||||
@pyqtProperty('quint64', notify=balanceChanged)
|
@pyqtProperty(QEAmount, notify=balanceChanged)
|
||||||
def confirmedBalance(self):
|
def confirmedBalance(self):
|
||||||
c, u, x = self.wallet.get_balance()
|
c, u, x = self.wallet.get_balance()
|
||||||
self._logger.info('balance: ' + str(c) + ' ' + str(u) + ' ' + str(x) + ' ')
|
self._logger.info('balance: ' + str(c) + ' ' + str(u) + ' ' + str(x) + ' ')
|
||||||
|
self._confirmedbalance = QEAmount(amount_sat=c+x)
|
||||||
return c+x
|
return self._confirmedbalance
|
||||||
|
|
||||||
@pyqtSlot('QString', int, int, bool)
|
@pyqtSlot('QString', int, int, bool)
|
||||||
def send_onchain(self, address, amount, fee=None, rbf=False):
|
def send_onchain(self, address, amount, fee=None, rbf=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user