mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-19 18:41:29 +00:00
Merge pull request #396
6034eaf
Add parse_uri to libwalletqt (MoroccanMalinois)
This commit is contained in:
commit
e8a47e322d
4 changed files with 26 additions and 0 deletions
|
@ -456,6 +456,23 @@ bool Wallet::verifySignedMessage(const QString &message, const QString &address,
|
|||
return m_walletImpl->verifySignedMessage(message.toStdString(), address.toStdString(), signature.toStdString());
|
||||
}
|
||||
}
|
||||
bool Wallet::parse_uri(const QString &uri, QString &address, QString &payment_id, uint64_t &amount, QString &tx_description, QString &recipient_name, QVector<QString> &unknown_parameters, QString &error)
|
||||
{
|
||||
std::string s_address, s_payment_id, s_tx_description, s_recipient_name, s_error;
|
||||
std::vector<std::string> s_unknown_parameters;
|
||||
bool res= m_walletImpl->parse_uri(uri.toStdString(), s_address, s_payment_id, amount, s_tx_description, s_recipient_name, s_unknown_parameters, s_error);
|
||||
if(res)
|
||||
{
|
||||
address = QString::fromStdString(s_address);
|
||||
payment_id = QString::fromStdString(s_payment_id);
|
||||
tx_description = QString::fromStdString(s_tx_description);
|
||||
recipient_name = QString::fromStdString(s_recipient_name);
|
||||
for( const auto &p : s_unknown_parameters )
|
||||
unknown_parameters.append(QString::fromStdString(p));
|
||||
}
|
||||
error = QString::fromStdString(s_error);
|
||||
return res;
|
||||
}
|
||||
|
||||
Wallet::Wallet(Monero::Wallet *w, QObject *parent)
|
||||
: QObject(parent)
|
||||
|
|
|
@ -183,6 +183,8 @@ public:
|
|||
//! verify a signed message
|
||||
Q_INVOKABLE bool verifySignedMessage(const QString &message, const QString &address, const QString &signature, bool filename = false) const;
|
||||
|
||||
//! Parse URI
|
||||
Q_INVOKABLE bool parse_uri(const QString &uri, QString &address, QString &payment_id, uint64_t &amount, QString &tx_description, QString &recipient_name, QVector<QString> &unknown_parameters, QString &error);
|
||||
|
||||
//! saved payment id
|
||||
QString paymentId() const;
|
||||
|
|
|
@ -249,6 +249,12 @@ QString WalletManager::resolveOpenAlias(const QString &address) const
|
|||
res = std::string(dnssec_valid ? "true" : "false") + "|" + res;
|
||||
return QString::fromStdString(res);
|
||||
}
|
||||
bool WalletManager::parse_uri(const QString &uri, QString &address, QString &payment_id, uint64_t &amount, QString &tx_description, QString &recipient_name, QVector<QString> &unknown_parameters, QString &error)
|
||||
{
|
||||
if (m_currentWallet)
|
||||
return m_currentWallet->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error);
|
||||
return false;
|
||||
}
|
||||
|
||||
void WalletManager::setLogLevel(int logLevel)
|
||||
{
|
||||
|
|
|
@ -121,6 +121,7 @@ public:
|
|||
Q_INVOKABLE double getPasswordStrength(const QString &password) const;
|
||||
|
||||
Q_INVOKABLE QString resolveOpenAlias(const QString &address) const;
|
||||
Q_INVOKABLE bool parse_uri(const QString &uri, QString &address, QString &payment_id, uint64_t &amount, QString &tx_description, QString &recipient_name, QVector<QString> &unknown_parameters, QString &error);
|
||||
|
||||
signals:
|
||||
|
||||
|
|
Loading…
Reference in a new issue