add taddr supply,zaddr supply and total supply

This commit is contained in:
Denio
2019-12-05 23:20:25 +01:00
parent f6bbfc0ed8
commit 47292f768d
4 changed files with 292 additions and 201 deletions

View File

@@ -254,6 +254,16 @@ void Controller::getInfoThenRefresh(bool force) {
model->setEncryptionStatus(isEncrypted, isLocked); model->setEncryptionStatus(isEncrypted, isLocked);
}); });
zrpc->fetchSupply([=] (const json& reply) {
int supply = reply["supply"].get<json::number_integer_t>();
ui->supply_taddr->setText(QString::number(supply));
int zfunds = reply["zfunds"].get<json::number_integer_t>();
ui->supply_zaddr->setText(QString::number(zfunds));
int total = reply["total"].get<json::number_integer_t>();
ui->supply_total->setText(QString::number(total));
});
if ( doUpdate ) { if ( doUpdate ) {
// Something changed, so refresh everything. // Something changed, so refresh everything.
refreshBalances(); refreshBalances();

View File

@@ -137,6 +137,13 @@ void LiteInterface::fetchInfo(const std::function<void(json)>& cb,
conn->doRPC("info", "", cb, err); conn->doRPC("info", "", cb, err);
} }
void LiteInterface::fetchSupply(const std::function<void(json)>& cb) {
if (conn == nullptr)
return;
conn->doRPCWithDefaultErrorHandling("coinsupply", "", cb);
}
void LiteInterface::fetchLatestBlock(const std::function<void(json)>& cb, void LiteInterface::fetchLatestBlock(const std::function<void(json)>& cb,
const std::function<void(QString)>& err) { const std::function<void(QString)>& err) {

View File

@@ -45,6 +45,8 @@ public:
void fetchInfo(const std::function<void(json)>& cb, void fetchInfo(const std::function<void(json)>& cb,
const std::function<void(QString)>& err); const std::function<void(QString)>& err);
void fetchLatestBlock(const std::function<void(json)>& cb, void fetchLatestBlock(const std::function<void(json)>& cb,
const std::function<void(QString)>& err); const std::function<void(QString)>& err);
@@ -62,6 +64,7 @@ public:
void clearWallet(const std::function<void(json)>& cb); void clearWallet(const std::function<void(json)>& cb);
void fetchWalletEncryptionStatus(const std::function<void(json)>& cb); void fetchWalletEncryptionStatus(const std::function<void(json)>& cb);
void fetchSupply(const std::function<void(json)>& cb);
void encryptWallet(QString password, const std::function<void(json)>& cb); void encryptWallet(QString password, const std::function<void(json)>& cb);
void unlockWallet(QString password, const std::function<void(json)>& cb); void unlockWallet(QString password, const std::function<void(json)>& cb);
void removeWalletEncryption(QString password, const std::function<void(json)>& cb); void removeWalletEncryption(QString password, const std::function<void(json)>& cb);

View File

@@ -18,11 +18,11 @@
<normaloff>:/icons/res/icon.ico</normaloff>:/icons/res/icon.ico</iconset> <normaloff>:/icons/res/icon.ico</normaloff>:/icons/res/icon.ico</iconset>
</property> </property>
<widget class="QWidget" name="centralWidget"> <widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_18">
<item row="0" column="0"> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>4</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@@ -948,7 +948,7 @@
</widget> </widget>
<widget class="QWidget" name="tab_5"> <widget class="QWidget" name="tab_5">
<attribute name="title"> <attribute name="title">
<string>Hush Daemon</string> <string>Information about Hush</string>
</attribute> </attribute>
<layout class="QHBoxLayout" name="horizontalLayout_14"> <layout class="QHBoxLayout" name="horizontalLayout_14">
<item> <item>
@@ -972,8 +972,8 @@
<property name="title"> <property name="title">
<string/> <string/>
</property> </property>
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="1">
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@@ -986,7 +986,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="0" colspan="3"> <item row="1" column="0">
<widget class="QLabel" name="label_16"> <widget class="QLabel" name="label_16">
<property name="font"> <property name="font">
<font> <font>
@@ -998,168 +998,235 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="3"> <item row="2" column="0">
<widget class="Line" name="line_3"> <widget class="Line" name="line_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_30"> <layout class="QGridLayout" name="gridLayout_5">
<property name="text"> <item row="2" column="1">
<string>BlockHeight</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="blockHeight">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Vendor</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_22">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="Vendor">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Version hushlightd</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_20"> <widget class="QLabel" name="label_20">
<property name="text"> <property name="text">
<string>|</string> <string>|</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="9" column="2">
<widget class="QLabel" name="Version"> <widget class="QLabel" name="supply_total">
<property name="text"> <property name="text">
<string>Loading...</string> <string>Loading...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="9" column="1">
<widget class="QLabel" name="label_38">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_32"> <widget class="QLabel" name="label_32">
<property name="text"> <property name="text">
<string>Next Halving</string> <string>Next Halving</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1">
<widget class="QLabel" name="label_13">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="halvingTime">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Last Notarized Block</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_26">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="7" column="2"> <item row="7" column="2">
<widget class="QLabel" name="last_notarized"> <widget class="QLabel" name="supply_taddr">
<property name="text"> <property name="text">
<string>Loading...</string> <string>Loading...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="6" column="1">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Longestchain</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_28">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="longestchain">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Difficulty</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="label_18"> <widget class="QLabel" name="label_18">
<property name="text"> <property name="text">
<string>|</string> <string>|</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="2"> <item row="0" column="2">
<widget class="QLabel" name="blockHeight">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Vendor</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="halvingTime">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="Vendor">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="last_notarized">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="difficulty"> <widget class="QLabel" name="difficulty">
<property name="text"> <property name="text">
<string>Loading...</string> <string>Loading...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="0" colspan="3"> <item row="5" column="1">
<widget class="QLabel" name="label_28">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_34">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Difficulty</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Last Notarized Block</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="Version">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_26">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_37">
<property name="text">
<string>Total Supply</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_13">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Longestchain</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_29">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Version hushlightd</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>BlockHeight</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>Supply zAddr</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_22">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="supply_zaddr">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="longestchain">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Supply tAddr</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<widget class="Line" name="line_2"> <widget class="Line" name="line_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="0" colspan="3"> <item row="5" column="0">
<widget class="QLabel" name="label_24"> <widget class="QLabel" name="label_24">
<property name="font"> <property name="font">
<font> <font>
@@ -1171,70 +1238,74 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="0" colspan="3"> <item row="6" column="0" colspan="2">
<widget class="Line" name="line_5"> <widget class="Line" name="line_5">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="0"> <item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_31"> <layout class="QGridLayout" name="gridLayout_6">
<property name="text"> <item row="0" column="2">
<string>Market Cap</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QLabel" name="label_11">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
<item row="13" column="2">
<widget class="QLabel" name="marketcapTab"> <widget class="QLabel" name="marketcapTab">
<property name="text"> <property name="text">
<string>Loading...</string> <string>Loading...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="14" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_31">
<property name="text"> <property name="text">
<string>Volume on Exchanges</string> <string>Market Cap</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="14" column="1"> <item row="1" column="1">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="text"> <property name="text">
<string>|</string> <string>|</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="14" column="2"> <item row="1" column="2">
<widget class="QLabel" name="volumeExchange"> <widget class="QLabel" name="volumeExchange">
<property name="text"> <property name="text">
<string>Loading...</string> <string>Loading...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="15" column="0" colspan="3"> <item row="1" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Volume on Exchanges</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_11">
<property name="text">
<string>|</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0" colspan="2">
<widget class="Line" name="line_4"> <widget class="Line" name="line_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="16" column="0" colspan="3"> <item row="9" column="0">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="label_14">
<property name="text"> <property name="text">
<string>This is a Lightwallet, you cant mine with it!</string> <string>This is a Lightwallet, you cant mine with it!</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="17" column="0"> <item row="10" column="0">
<spacer name="verticalSpacer_4"> <spacer name="verticalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>