mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-04 12:17:25 -04:00
Add a page for checking payments via the tx key
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user