@ -1,24 +1,31 @@ |
|||
# SilentDragonLite |
|||
|
|||
SilentDragonLite is a GUI wallet for the [Hush](https://myhush.org) cryptocoin, which does not require you to download the full blockchain! |
|||
SilentDragonLite is a lightwallet for HUSH ($HUSH) runs on Linux and Windows which does not require you to download the full blockchain. This is experimental software under active development! |
|||
|
|||
## PRIVACY NOTICE |
|||
|
|||
## Compiling from source |
|||
SilentDragonLite contacts a few different external websites to get various bits of data. * coingecko.com for price data API * explorer.myhush.org for explorer links * dexstats.info for address utilities, hush-lightwallet.de to get Data. |
|||
|
|||
This means your IP address is known to these servers. Enable Tor setting in SilentDragon to prevent this, or better yet, use TAILS: https://tails.boum.org/ |
|||
|
|||
## Installation |
|||
|
|||
* silentdragon is written in C++ 14, and can be compiled with g++/clang++/visual c++. |
|||
Go to the releases page and grab the latest installers or binary. https://github.com/MyHush/SilentDragonLite/releases |
|||
|
|||
## Compiling from source |
|||
* SilentDragonLite is written in C++ 14, and can be compiled with g++/clang++/visual c++. |
|||
* It also depends on Qt5, which you can get from [here](https://www.qt.io/download). |
|||
* You'll need Rust v1.37 + |
|||
|
|||
### Building on Linux |
|||
## Building on Linux |
|||
|
|||
``` |
|||
git clone https://github.com/MyHush/SilenDragonLite |
|||
cd SilentDragonLite |
|||
qmake silentdragon-lite.pro CONFIG+=debug |
|||
git clone https://github.com/MyHush/SilenDragonLite.git |
|||
cd silentdragonlite |
|||
/path/to/qt5/bin/qmake silentdragon-lite.pro CONFIG+=debug |
|||
make -j$(nproc) |
|||
``` |
|||
And to run the binary: |
|||
|
|||
``` |
|||
./silentdragonlite |
|||
``` |
|||
|
|||
|
|||
|
@ -1,24 +1,28 @@ |
|||
ifeq ($(shell uname),Darwin) |
|||
EXT := dylib |
|||
CFLAGS := "-mmacosx-version-min=10.11" |
|||
else |
|||
EXT := a |
|||
CFLAGS := "" |
|||
endif |
|||
|
|||
PWD := $(shell pwd) |
|||
|
|||
all: release |
|||
|
|||
winrelease: target/x86_64-pc-windows-gnu/release/silentdragonlite.lib |
|||
|
|||
target/x86_64-pc-windows-gnu/release/silentdragonlite.lib: src/lib.rs Cargo.toml |
|||
cargo build --lib --release --target x86_64-pc-windows-gnu |
|||
SODIUM_LIB_DIR="$(PWD)/libsodium-mingw/" cargo build --lib --release --target x86_64-pc-windows-gnu |
|||
|
|||
release: target/release/silentdragonlite.$(EXT) |
|||
debug: target/debug/silentdragonlite.$(EXT) |
|||
|
|||
target/release/silentdragonlite.$(EXT): src/lib.rs Cargo.toml |
|||
cargo build --lib --release |
|||
LIBS="" CFLAGS=$(CFLAGS) cargo build --lib --release |
|||
|
|||
target/debug/silentdragonlite.$(EXT): src/lib.rs Cargo.toml |
|||
cargo build --lib |
|||
LIBS="" CFLAGS=$(CFLAGS) cargo build --lib |
|||
|
|||
clean: |
|||
rm -rf target |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 451 KiB After Width: | Height: | Size: 451 KiB |
@ -0,0 +1,64 @@ |
|||
#include "camount.h" |
|||
#include "settings.h" |
|||
|
|||
#include "precompiled.h" |
|||
|
|||
const int NUMPLACES = 8; |
|||
const qint64 COIN = 100000000; |
|||
|
|||
double CAmount::toDecimalDouble() const { |
|||
return static_cast<double>(this->amount) / COIN; |
|||
} |
|||
|
|||
QString CAmount::toDecimalString() const { |
|||
if (amount < 0) { |
|||
CAmount negative(-1 * this->amount); |
|||
return "-" + negative.toDecimalString(); |
|||
} |
|||
|
|||
int wholePart = amount / COIN; |
|||
int decimalPart = amount % COIN; |
|||
|
|||
QString r = QString::number(wholePart); |
|||
if (decimalPart > 0) { |
|||
QString decimalPartStr = QString::number(decimalPart); |
|||
r = r + "." + decimalPartStr.rightJustified(NUMPLACES, '0'); |
|||
|
|||
// Trim tailing 0s
|
|||
while (r.right(1) == "0") { |
|||
r = r.left(r.length() - 1); |
|||
} |
|||
} |
|||
|
|||
return r; |
|||
} |
|||
|
|||
QString CAmount::toDecimalUSDString() const { |
|||
double dblAmount = static_cast<double>(this->amount) / COIN; |
|||
double price = Settings::getInstance()->getZECPrice(); |
|||
|
|||
return "$" + QLocale(QLocale::English).toString(dblAmount*price, 'f', 2); |
|||
} |
|||
|
|||
QString CAmount::toDecimalhushString() const { |
|||
return this->toDecimalString() % " " % Settings::getTokenName(); |
|||
} |
|||
|
|||
QString CAmount::toDecimalhushUSDString() const { |
|||
auto usdString = this->toDecimalUSDString(); |
|||
if (!usdString.isEmpty()) |
|||
return this->toDecimalhushString() % " (" % usdString % ")"; |
|||
else |
|||
return this->toDecimalhushString(); |
|||
} |
|||
|
|||
CAmount CAmount::fromDecimalString(QString decimalString) { |
|||
auto amtParts = decimalString.split("."); |
|||
qint64 r = amtParts[0].toULongLong() * COIN; |
|||
if (amtParts.length() == 2) { |
|||
auto trailingZeros = QString("0").repeated(NUMPLACES - amtParts[1].length()); |
|||
r += QString(amtParts[1] + trailingZeros).toULongLong(); |
|||
} |
|||
|
|||
return CAmount(r); |
|||
} |
@ -0,0 +1,55 @@ |
|||
#ifndef CAMOUNT_H |
|||
#define CAMOUNT_H |
|||
|
|||
#include "precompiled.h" |
|||
|
|||
class CAmount { |
|||
private: |
|||
CAmount(qint64 amount) { |
|||
this->amount = amount; |
|||
} |
|||
|
|||
qint64 amount; |
|||
|
|||
public: |
|||
static CAmount fromDecimalString(QString decimalString); |
|||
static CAmount fromqint64(qint64 a) { |
|||
return CAmount(a); |
|||
} |
|||
static CAmount fromDouble(double d) { |
|||
return CAmount::fromDecimalString(QString::number(d, 'f', 8)); |
|||
} |
|||
|
|||
CAmount() : amount(0) {}; |
|||
CAmount(const CAmount&) = default; |
|||
~CAmount() = default; |
|||
|
|||
double toDecimalDouble() const; |
|||
QString toDecimalString() const; |
|||
QString toDecimalUSDString() const; |
|||
QString toDecimalhushString() const; |
|||
QString toDecimalhushUSDString() const; |
|||
qint64 toqint64() const { return amount; }; |
|||
|
|||
CAmount operator+ (const CAmount& other) const { |
|||
return CAmount(this->amount + other.amount); |
|||
} |
|||
|
|||
CAmount operator- (const CAmount& other) const { |
|||
return CAmount(this->amount - other.amount); |
|||
} |
|||
|
|||
bool operator< (const CAmount& other) const { |
|||
return this->amount < other.amount; |
|||
} |
|||
|
|||
bool operator< (const qint64& other) const { |
|||
return this->amount < other; |
|||
} |
|||
|
|||
bool operator> (const CAmount& other) const { |
|||
return this->amount > other.amount; |
|||
} |
|||
}; |
|||
|
|||
#endif // CAMOUNT_H
|
@ -0,0 +1,165 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<ui version="4.0"> |
|||
<class>encryptionDialog</class> |
|||
<widget class="QDialog" name="encryptionDialog"> |
|||
<property name="geometry"> |
|||
<rect> |
|||
<x>0</x> |
|||
<y>0</y> |
|||
<width>400</width> |
|||
<height>300</height> |
|||
</rect> |
|||
</property> |
|||
<property name="windowTitle"> |
|||
<string>Encrypt Your Wallet</string> |
|||
</property> |
|||
<layout class="QGridLayout" name="gridLayout"> |
|||
<item row="3" column="0" colspan="2"> |
|||
<widget class="Line" name="line_2"> |
|||
<property name="orientation"> |
|||
<enum>Qt::Horizontal</enum> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="5" column="0"> |
|||
<widget class="QLabel" name="label_3"> |
|||
<property name="text"> |
|||
<string>Encryption Password:</string> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="6" column="0"> |
|||
<widget class="QLabel" name="label_4"> |
|||
<property name="text"> |
|||
<string>Confirm Password:</string> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="6" column="1"> |
|||
<widget class="QLineEdit" name="txtConfirmPassword"> |
|||
<property name="echoMode"> |
|||
<enum>QLineEdit::Password</enum> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="4" column="0" colspan="2"> |
|||
<widget class="QLabel" name="lblPasswordMatch"> |
|||
<property name="styleSheet"> |
|||
<string notr="true">color: red;</string> |
|||
</property> |
|||
<property name="text"> |
|||
<string>Passwords don't match</string> |
|||
</property> |
|||
<property name="alignment"> |
|||
<set>Qt::AlignCenter</set> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="5" column="1"> |
|||
<widget class="QLineEdit" name="txtPassword"> |
|||
<property name="echoMode"> |
|||
<enum>QLineEdit::Password</enum> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="8" column="0" colspan="2"> |
|||
<widget class="Line" name="line"> |
|||
<property name="orientation"> |
|||
<enum>Qt::Horizontal</enum> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="1" column="0" colspan="2"> |
|||
<widget class="QLabel" name="label_2"> |
|||
<property name="text"> |
|||
<string>WARNING: If you forget your password, the only way to recover the wallet is from the seed phrase.</string> |
|||
</property> |
|||
<property name="alignment"> |
|||
<set>Qt::AlignCenter</set> |
|||
</property> |
|||
<property name="wordWrap"> |
|||
<bool>true</bool> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="9" column="0" colspan="2"> |
|||
<widget class="QDialogButtonBox" name="buttonBox"> |
|||
<property name="orientation"> |
|||
<enum>Qt::Horizontal</enum> |
|||
</property> |
|||
<property name="standardButtons"> |
|||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
|||
</property> |
|||
<property name="centerButtons"> |
|||
<bool>true</bool> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item row="0" column="0" colspan="2"> |
|||
<spacer name="verticalSpacer_2"> |
|||
<property name="orientation"> |
|||
<enum>Qt::Vertical</enum> |
|||
</property> |
|||
<property name="sizeHint" stdset="0"> |
|||
<size> |
|||
<width>20</width> |
|||
<height>40</height> |
|||
</size> |
|||
</property> |
|||
</spacer> |
|||
</item> |
|||
<item row="2" column="0" colspan="2"> |
|||
<spacer name="verticalSpacer"> |
|||
<property name="orientation"> |
|||
<enum>Qt::Vertical</enum> |
|||
</property> |
|||
<property name="sizeHint" stdset="0"> |
|||
<size> |
|||
<width>20</width> |
|||
<height>40</height> |
|||
</size> |
|||
</property> |
|||
</spacer> |
|||
</item> |
|||
</layout> |
|||
</widget> |
|||
<tabstops> |
|||
<tabstop>txtPassword</tabstop> |
|||
<tabstop>txtConfirmPassword</tabstop> |
|||
</tabstops> |
|||
<resources/> |
|||
<connections> |
|||
<connection> |
|||
<sender>buttonBox</sender> |
|||
<signal>accepted()</signal> |
|||
<receiver>encryptionDialog</receiver> |
|||
<slot>accept()</slot> |
|||
<hints> |
|||
<hint type="sourcelabel"> |
|||
<x>248</x> |
|||
<y>254</y> |
|||
</hint> |
|||
<hint type="destinationlabel"> |
|||
<x>157</x> |
|||
<y>274</y> |
|||
</hint> |
|||
</hints> |
|||
</connection> |
|||
<connection> |
|||
<sender>buttonBox</sender> |
|||
<signal>rejected()</signal> |
|||
<receiver>encryptionDialog</receiver> |
|||
<slot>reject()</slot> |
|||
<hints> |
|||
<hint type="sourcelabel"> |
|||
<x>316</x> |
|||
<y>260</y> |
|||
</hint> |
|||
<hint type="destinationlabel"> |
|||
<x>286</x> |
|||
<y>274</y> |
|||
</hint> |
|||
</hints> |
|||
</connection> |
|||
</connections> |
|||
</ui> |
@ -1,13 +1,13 @@ |
|||
[Desktop Entry] |
|||
Name=silentdragon |
|||
Comment=Full node and wallet for hush |
|||
Name=SilentDragonLite |
|||
Comment=Lightclient UI wallet for Hush |
|||
GenericName=Wallet |
|||
Exec=/usr/local/bin/silentdragon %u |
|||
Icon=silentdragon.xpm |
|||
Exec=/usr/local/bin/silentdragonlite %u |
|||
Icon=silentdragonlite.xpm |
|||
Type=Application |
|||
StartupNotify=true |
|||
StartupWMClass=silentdragon |
|||
StartupWMClass=silentdragonlite |
|||
Categories=Utility; |
|||
MimeType=x-scheme-handler/hush; |
|||
Keywords=silentdragon; |
|||
Keywords=silentdragonlite; |
|||
|
|||
|
@ -1 +1 @@ |
|||
#define APP_VERSION "0.7.9" |
|||
#define APP_VERSION "1.0" |
|||
|