mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-04 08:07:25 -04:00
Tx proof
This commit is contained in:
@@ -494,6 +494,36 @@ QString Wallet::getTxKey(const QString &txid) const
|
||||
return QString::fromStdString(m_walletImpl->getTxKey(txid.toStdString()));
|
||||
}
|
||||
|
||||
QString Wallet::checkTxKey(const QString &txid, const QString &tx_key, const QString &address)
|
||||
{
|
||||
uint64_t received;
|
||||
bool in_pool;
|
||||
uint64_t confirmations;
|
||||
bool success = m_walletImpl->checkTxKey(txid.toStdString(), tx_key.toStdString(), address.toStdString(), received, in_pool, confirmations);
|
||||
std::string result = std::string(success ? "true" : "false") + "|" + QString::number(received).toStdString() + "|" + std::string(in_pool ? "true" : "false") + "|" + QString::number(confirmations).toStdString();
|
||||
return QString::fromStdString(result);
|
||||
}
|
||||
|
||||
QString Wallet::getTxProof(const QString &txid, const QString &address, const QString &message) const
|
||||
{
|
||||
std::string error_str;
|
||||
QString result = QString::fromStdString(m_walletImpl->getTxProof(txid.toStdString(), address.toStdString(), message.toStdString(), error_str));
|
||||
if (!error_str.empty())
|
||||
result = QString::fromStdString("error|" + error_str);
|
||||
return result;
|
||||
}
|
||||
|
||||
QString Wallet::checkTxProof(const QString &txid, const QString &address, const QString &message, const QString &signature)
|
||||
{
|
||||
bool good;
|
||||
uint64_t received;
|
||||
bool in_pool;
|
||||
uint64_t confirmations;
|
||||
bool success = m_walletImpl->checkTxProof(txid.toStdString(), address.toStdString(), message.toStdString(), signature.toStdString(), good, received, in_pool, confirmations);
|
||||
std::string result = std::string(success ? "true" : "false") + "|" + std::string(good ? "true" : "false") + "|" + QString::number(received).toStdString() + "|" + std::string(in_pool ? "true" : "false") + "|" + QString::number(confirmations).toStdString();
|
||||
return QString::fromStdString(result);
|
||||
}
|
||||
|
||||
QString Wallet::signMessage(const QString &message, bool filename) const
|
||||
{
|
||||
if (filename) {
|
||||
|
||||
@@ -232,6 +232,9 @@ public:
|
||||
Q_INVOKABLE bool setUserNote(const QString &txid, const QString ¬e);
|
||||
Q_INVOKABLE QString getUserNote(const QString &txid) const;
|
||||
Q_INVOKABLE QString getTxKey(const QString &txid) const;
|
||||
Q_INVOKABLE QString checkTxKey(const QString &txid, const QString &tx_key, const QString &address);
|
||||
Q_INVOKABLE QString getTxProof(const QString &txid, const QString &address, const QString &message) const;
|
||||
Q_INVOKABLE QString checkTxProof(const QString &txid, const QString &address, const QString &message, const QString &signature);
|
||||
// Rescan spent outputs
|
||||
Q_INVOKABLE bool rescanSpent();
|
||||
|
||||
|
||||
@@ -216,16 +216,6 @@ QString WalletManager::paymentIdFromAddress(const QString &address, bool testnet
|
||||
return QString::fromStdString(Monero::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::setDaemonAddress(const QString &address)
|
||||
{
|
||||
m_pimpl->setDaemonAddress(address.toStdString());
|
||||
|
||||
@@ -104,8 +104,6 @@ public:
|
||||
|
||||
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;
|
||||
|
||||
Q_INVOKABLE void setDaemonAddress(const QString &address);
|
||||
Q_INVOKABLE bool connected() const;
|
||||
Q_INVOKABLE quint64 networkDifficulty() const;
|
||||
|
||||
Reference in New Issue
Block a user