Add a page for checking payments via the tx key

This commit is contained in:
moneromooo.monero
2016-11-05 14:58:49 +00:00
parent c9bb2f5718
commit 06e94e2fbe
7 changed files with 315 additions and 0 deletions

View File

@@ -164,6 +164,16 @@ QString WalletManager::paymentIdFromAddress(const QString &address, bool testnet
return QString::fromStdString(Bitmonero::Wallet::paymentIdFromAddress(address.toStdString(), testnet));
}
QString WalletManager::checkPayment(const QString &address, const QString &txid, const QString &txkey, const QString &daemon_address) const
{
uint64_t received = 0, height = 0;
std::string error = "";
bool ret = m_pimpl->checkPayment(address.toStdString(), txid.toStdString(), txkey.toStdString(), daemon_address.toStdString(), received, height, error);
// bypass qml being unable to pass structures without preposterous complexity
std::string result = std::string(ret ? "true" : "false") + "|" + QString::number(received).toStdString() + "|" + QString::number(height).toStdString() + "|" + error;
return QString::fromStdString(result);
}
void WalletManager::setLogLevel(int logLevel)
{
Bitmonero::WalletManagerFactory::setLogLevel(logLevel);

View File

@@ -93,6 +93,8 @@ public:
Q_INVOKABLE bool addressValid(const QString &address, bool testnet) const;
Q_INVOKABLE QString paymentIdFromAddress(const QString &address, bool testnet) const;
Q_INVOKABLE QString checkPayment(const QString &address, const QString &txid, const QString &txkey, const QString &daemon_address) const;
// QML missing such functionality, implementing these helpers here
Q_INVOKABLE QString urlToLocalPath(const QUrl &url) const;
Q_INVOKABLE QUrl localPathToUrl(const QString &path) const;