aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-05-05 11:35:03 +0200
committerRiccardo Spagni <ric@spagni.net>2017-05-05 11:35:03 +0200
commit81b370d5a13c798ca22f8c5c889f0e3b26da20d3 (patch)
treec1675173d0e24f7fdca885b0a94f52e5d1c0248b /src/wallet/api
parentMerge pull request #2009 (diff)
parentWallet API: add spend/view key getters (diff)
downloadmonero-81b370d5a13c798ca22f8c5c889f0e3b26da20d3.tar.xz
Merge pull request #2012
bbf4c210 Wallet API: add spend/view key getters (Jaquee)
Diffstat (limited to 'src/wallet/api')
-rw-r--r--src/wallet/api/wallet.cpp17
-rw-r--r--src/wallet/api/wallet.h5
2 files changed, 20 insertions, 2 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 21760ac49..611c1819f 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -618,11 +618,26 @@ std::string WalletImpl::integratedAddress(const std::string &payment_id) const
return m_wallet->get_account().get_public_integrated_address_str(pid, m_wallet->testnet());
}
-std::string WalletImpl::privateViewKey() const
+std::string WalletImpl::secretViewKey() const
{
return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key);
}
+std::string WalletImpl::publicViewKey() const
+{
+ return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_account_address.m_view_public_key);
+}
+
+std::string WalletImpl::secretSpendKey() const
+{
+ return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_spend_secret_key);
+}
+
+std::string WalletImpl::publicSpendKey() const
+{
+ return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_account_address.m_spend_public_key);
+}
+
std::string WalletImpl::path() const
{
return m_wallet->path();
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index c376dd6c1..e9e2cc580 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -73,7 +73,10 @@ public:
bool setPassword(const std::string &password);
std::string address() const;
std::string integratedAddress(const std::string &payment_id) const;
- std::string privateViewKey() const;
+ std::string secretViewKey() const;
+ std::string publicViewKey() const;
+ std::string secretSpendKey() const;
+ std::string publicSpendKey() const;
std::string path() const;
bool store(const std::string &path);
std::string filename() const;