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 void close(bool save = false) override;
131 bool is_closed() const override { return m_is_closed; }
132
133 // --------------------------------- PRIVATE --------------------------------
134
135 private:
136 bool m_is_view_only = false;
137 monero_network_type m_network_type;
138 cryptonote::account_base m_account;
139 std::string m_seed;
140 std::string m_language;
141 std::string m_pub_view_key;
142 std::string m_prv_view_key;
143 std::string m_pub_spend_key;
144 std::string m_prv_spend_key;
145 std::string m_primary_address;
146 std::atomic<bool> m_is_closed{false};
147
148 void init_common();
149 void assert_not_closed() const;
150 };
151}
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:310
static monero_wallet_keys * create_wallet_from_keys(const monero_wallet_config &config)
Definition monero_wallet_keys.cpp:138
std::string get_private_view_key() const override
Definition monero_wallet_keys.cpp:256
bool is_closed() const override
Definition monero_wallet_keys.h:131
void close(bool save=false) override
Definition monero_wallet_keys.cpp:363
static monero_wallet_keys * create_wallet_random(const monero_wallet_config &config)
Definition monero_wallet_keys.cpp:78
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:327
monero_version get_version() const override
Definition monero_wallet_keys.cpp:282
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:357
bool is_view_only() const override
Definition monero_wallet_keys.cpp:234
static std::vector< std::string > get_seed_languages()
Definition monero_wallet_keys.cpp:221
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:351
std::string get_seed_language() const override
Definition monero_wallet_keys.cpp:250
~monero_wallet_keys()
Definition monero_wallet_keys.cpp:229
std::string get_public_spend_key() const override
Definition monero_wallet_keys.cpp:272
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition monero_wallet_keys.cpp:298
static monero_wallet_keys * create_wallet_from_seed(const monero_wallet_config &config)
Definition monero_wallet_keys.cpp:103
std::string get_primary_address() const override
Definition monero_wallet_keys.cpp:277
std::string get_seed() const override
Definition monero_wallet_keys.cpp:244
std::string get_public_view_key() const override
Definition monero_wallet_keys.cpp:267
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_keys.cpp:290
std::string get_private_spend_key() const override
Definition monero_wallet_keys.cpp:261
monero_integrated_address decode_integrated_address(const std::string &integrated_address) const override
Definition monero_wallet_keys.cpp:304
monero_network_type get_network_type() const override
Definition monero_wallet_keys.cpp:239
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_daemon_model.h:142
Definition monero_wallet_model.h:68