Monero C++ Library
Loading...
Searching...
No Matches
monero_wallet_keys.h
1
52
53#pragma once
54
55#include "monero_wallet.h"
56#include "cryptonote_basic/account.h"
57#include <atomic>
58
59using namespace monero;
60
64namespace monero {
65
70
71 public:
72
73 // --------------------------- STATIC WALLET UTILS --------------------------
74
81
88
95
101 static std::vector<std::string> get_seed_languages();
102
103 // ----------------------------- WALLET METHODS -----------------------------
104
109
113 bool is_view_only() const override;
114 monero_version get_version() const override;
115 monero_network_type get_network_type() const override;
116 std::string get_seed() const override;
117 std::string get_seed_language() const override;
118 std::string get_private_view_key() const override;
119 std::string get_private_spend_key() const override;
120 std::string get_public_view_key() const override;
121 std::string get_public_spend_key() const override;
122 std::string get_primary_address() const override;
123 std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override;
124 monero_integrated_address get_integrated_address(const std::string& standard_address = "", const std::string& payment_id = "") const override;
125 monero_integrated_address decode_integrated_address(const std::string& integrated_address) const override;
126 monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override;
127 std::vector<monero_subaddress> get_subaddresses(const uint32_t account_idx, const std::vector<uint32_t>& subaddress_indices) const override;
128 std::string sign_message(const std::string& msg, monero_message_signature_type signature_type, uint32_t account_idx = 0, uint32_t subaddress_idx = 0) const override;
129 monero_message_signature_result verify_message(const std::string& msg, const std::string& address, const std::string& signature) const override;
130 std::string get_payment_uri(const monero_tx_config& config) const override;
131 std::shared_ptr<monero_tx_config> parse_payment_uri(const std::string& uri) const override;
132 void close(bool save = false) override;
133 bool is_closed() const override { return m_is_closed; }
134
135 // --------------------------------- PRIVATE --------------------------------
136
137 private:
138 bool m_is_view_only = false;
139 monero_network_type m_network_type;
140 cryptonote::account_base m_account;
141 std::string m_seed;
142 std::string m_language;
143 std::string m_pub_view_key;
144 std::string m_prv_view_key;
145 std::string m_pub_spend_key;
146 std::string m_prv_spend_key;
147 std::string m_primary_address;
148 std::atomic<bool> m_is_closed{false};
149
150 void init_common();
151 void assert_not_closed() const;
152 };
153}
Definition monero_wallet_keys.h:69
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override
Definition monero_wallet_keys.cpp:374
static monero_wallet_keys * create_wallet_from_keys(const monero_wallet_config &config)
Definition monero_wallet_keys.cpp:170
std::string get_private_view_key() const override
Definition monero_wallet_keys.cpp:288
bool is_closed() const override
Definition monero_wallet_keys.h:133
void close(bool save=false) override
Definition monero_wallet_keys.cpp:562
static monero_wallet_keys * create_wallet_random(const monero_wallet_config &config)
Definition monero_wallet_keys.cpp:110
std::vector< monero_subaddress > get_subaddresses(const uint32_t account_idx, const std::vector< uint32_t > &subaddress_indices) const override
Definition monero_wallet_keys.cpp:391
monero_version get_version() const override
Definition monero_wallet_keys.cpp:314
monero_message_signature_result verify_message(const std::string &msg, const std::string &address, const std::string &signature) const override
Definition monero_wallet_keys.cpp:478
bool is_view_only() const override
Definition monero_wallet_keys.cpp:266
static std::vector< std::string > get_seed_languages()
Definition monero_wallet_keys.cpp:253
std::string sign_message(const std::string &msg, monero_message_signature_type signature_type, uint32_t account_idx=0, uint32_t subaddress_idx=0) const override
Definition monero_wallet_keys.cpp:416
std::string get_payment_uri(const monero_tx_config &config) const override
Definition monero_wallet_keys.cpp:550
std::string get_seed_language() const override
Definition monero_wallet_keys.cpp:282
~monero_wallet_keys()
Definition monero_wallet_keys.cpp:261
std::string get_public_spend_key() const override
Definition monero_wallet_keys.cpp:304
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition monero_wallet_keys.cpp:330
static monero_wallet_keys * create_wallet_from_seed(const monero_wallet_config &config)
Definition monero_wallet_keys.cpp:135
std::string get_primary_address() const override
Definition monero_wallet_keys.cpp:309
std::string get_seed() const override
Definition monero_wallet_keys.cpp:276
std::shared_ptr< monero_tx_config > parse_payment_uri(const std::string &uri) const override
Definition monero_wallet_keys.cpp:556
std::string get_public_view_key() const override
Definition monero_wallet_keys.cpp:299
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_keys.cpp:322
std::string get_private_spend_key() const override
Definition monero_wallet_keys.cpp:293
monero_integrated_address decode_integrated_address(const std::string &integrated_address) const override
Definition monero_wallet_keys.cpp:358
monero_network_type get_network_type() const override
Definition monero_wallet_keys.cpp:271
Definition monero_wallet.h:123
virtual void save()
Definition monero_wallet.h:1416
Definition monero_error.h:61
monero_message_signature_type
Definition monero_wallet_model.h:465
monero_network_type
Definition monero_daemon_model.h:119
Definition monero_wallet_model.h:131
Definition monero_wallet_model.h:386
Definition monero_wallet_model.h:473
Definition monero_wallet_model.h:409
Definition monero_daemon_model.h:142
Definition monero_wallet_model.h:68