Aditya Kulkarni
6 years ago
17 changed files with 158 additions and 184 deletions
@ -1 +0,0 @@ |
|||
#include "unspentoutput.h" |
@ -1,15 +0,0 @@ |
|||
#ifndef UNSPENTOUTPUT_H |
|||
#define UNSPENTOUTPUT_H |
|||
|
|||
#include "precompiled.h" |
|||
|
|||
struct UnspentOutput { |
|||
QString address; |
|||
QString txid; |
|||
QString amount; |
|||
int confirmations; |
|||
bool spendable; |
|||
}; |
|||
|
|||
|
|||
#endif // UNSPENTOUTPUT_H
|
@ -1,72 +0,0 @@ |
|||
#include "utils.h" |
|||
#include "settings.h" |
|||
#include "mainwindow.h" |
|||
|
|||
const QString Utils::txidStatusMessage = QString("Tx submitted (right click to copy) txid:"); |
|||
|
|||
const QString Utils::getTokenName() { |
|||
if (Settings::getInstance()->isTestnet()) { |
|||
return "TAZ"; |
|||
} else { |
|||
return "ZEC"; |
|||
} |
|||
} |
|||
|
|||
const QString Utils::getDonationAddr(bool sapling) { |
|||
if (Settings::getInstance()->isTestnet()) |
|||
if (sapling) |
|||
return "ztestsapling1wn6889vznyu42wzmkakl2effhllhpe4azhu696edg2x6me4kfsnmqwpglaxzs7tmqsq7kudemp5"; |
|||
else |
|||
return "ztn6fYKBii4Fp4vbGhkPgrtLU4XjXp4ZBMZgShtopmDGbn1L2JLTYbBp2b7SSkNr9F3rQeNZ9idmoR7s4JCVUZ7iiM5byhF"; |
|||
else |
|||
if (sapling) |
|||
return "zs1gv64eu0v2wx7raxqxlmj354y9ycznwaau9kduljzczxztvs4qcl00kn2sjxtejvrxnkucw5xx9u"; |
|||
else |
|||
return "zcEgrceTwvoiFdEvPWcsJHAMrpLsprMF6aRJiQa3fan5ZphyXLPuHghnEPrEPRoEVzUy65GnMVyCTRdkT6BYBepnXh6NBYs"; |
|||
} |
|||
|
|||
const QString Utils::getDevSproutAddr() { |
|||
return "ztbGDqgkmXQjheivgeirwEvJLD4SUNqsWCGwxwVg4YpGz1ARR8P2rXaptkT14z3NDKamcxNmQuvmvktyokMs7HkutRNSx1D"; |
|||
} |
|||
|
|||
// Get the dev fee address based on the transaction
|
|||
const QString Utils::getDevAddr(Tx) { |
|||
return QString(); |
|||
} |
|||
|
|||
|
|||
double Utils::getMinerFee() { |
|||
return 0.0001; |
|||
} |
|||
|
|||
double Utils::getZboardAmount() { |
|||
return 0.0001; |
|||
} |
|||
|
|||
QString Utils::getZboardAddr() { |
|||
if (Settings::getInstance()->isTestnet()) { |
|||
return getDonationAddr(true); |
|||
} |
|||
else { |
|||
return "zs10m00rvkhfm4f7n23e4sxsx275r7ptnggx39ygl0vy46j9mdll5c97gl6dxgpk0njuptg2mn9w5s"; |
|||
} |
|||
} |
|||
double Utils::getDevFee() { |
|||
if (Settings::getInstance()->isTestnet()) { |
|||
return 0; |
|||
} else { |
|||
return 0; |
|||
} |
|||
} |
|||
|
|||
double Utils::getTotalFee() { return getMinerFee() + getDevFee(); } |
|||
|
|||
bool Utils::isValidAddress(QString addr) { |
|||
QRegExp zcexp("^z[a-z0-9]{94}$", Qt::CaseInsensitive); |
|||
QRegExp zsexp("^z[a-z0-9]{77}$", Qt::CaseInsensitive); |
|||
QRegExp ztsexp("^ztestsapling[a-z0-9]{76}", Qt::CaseInsensitive); |
|||
QRegExp texp("^t[a-z0-9]{34}$", Qt::CaseInsensitive); |
|||
|
|||
return zcexp.exactMatch(addr) || texp.exactMatch(addr) || |
|||
ztsexp.exactMatch(addr) || zsexp.exactMatch(addr); |
|||
} |
@ -1,34 +0,0 @@ |
|||
#ifndef UTILS_H |
|||
#define UTILS_H |
|||
|
|||
#include "precompiled.h" |
|||
|
|||
struct ToFields; |
|||
struct Tx; |
|||
|
|||
class Utils |
|||
{ |
|||
public: |
|||
static const QString txidStatusMessage; |
|||
|
|||
static const QString getTokenName(); |
|||
static const QString getDevSproutAddr(); |
|||
static const QString getDevAddr(Tx tx); |
|||
static const QString getDonationAddr(bool sapling); |
|||
|
|||
static double getMinerFee(); |
|||
static double getZboardAmount(); |
|||
static QString getZboardAddr(); |
|||
static double getDevFee(); |
|||
static double getTotalFee(); |
|||
|
|||
static bool isValidAddress(QString addr); |
|||
|
|||
static const int updateSpeed = 20 * 1000; // 20 sec
|
|||
static const int quickUpdateSpeed = 5 * 1000; // 5 sec
|
|||
static const int priceRefreshSpeed = 60 * 60 * 1000; // 1 hr
|
|||
private: |
|||
Utils() = delete; |
|||
}; |
|||
|
|||
#endif // UTILS_H
|
Loading…
Reference in new issue