Monero C++ Library
monero_wallet_keys.h
1 
53 #pragma once
54 
55 #include "monero_wallet.h"
56 #include "cryptonote_basic/account.h"
57 
58 using namespace std;
59 using namespace monero;
60 
64 namespace monero {
65 
70 
71  public:
72 
73  // --------------------------- STATIC WALLET UTILS --------------------------
74 
81  static monero_wallet_keys* create_wallet_random(const monero_network_type network_type, const string& language);
82 
89  static monero_wallet_keys* create_wallet_from_mnemonic(const monero_network_type network_type, const string& mnemonic, const string& seed_offset);
90 
100  static monero_wallet_keys* create_wallet_from_keys(const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const string& language = "English");
101 
107  static vector<string> get_mnemonic_languages();
108 
109  // ----------------------------- WALLET METHODS -----------------------------
110 
115 
119  monero_version get_version() const;
120  monero_network_type get_network_type() const { return m_network_type; }
121  string get_mnemonic() const { return m_mnemonic; }
122  string get_mnemonic_language() const { return m_language; }
123  string get_private_view_key() const { return m_prv_view_key; }
124  string get_private_spend_key() const { return m_prv_spend_key; }
125  string get_public_view_key() const { return m_pub_view_key; }
126  string get_public_spend_key() const { return m_pub_spend_key; }
127  string get_primary_address() const { return m_primary_address; }
128  string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const;
129  monero_integrated_address get_integrated_address(const string& standard_address = "", const string& payment_id = "") const;
130  monero_integrated_address decode_integrated_address(const string& integrated_address) const;
131  monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const;
132  vector<monero_subaddress> get_subaddresses(const uint32_t account_idx, const vector<uint32_t>& subaddress_indices) const;
133  string sign(const string& msg) const;
134  bool verify(const string& msg, const string& address, const string& signature) const;
135  void close(bool save = false);
136 
137  // --------------------------------- PRIVATE --------------------------------
138 
139  private:
140  monero_network_type m_network_type;
141  cryptonote::account_base m_account;
142  string m_mnemonic;
143  string m_language;
144  string m_pub_view_key;
145  string m_prv_view_key;
146  string m_pub_spend_key;
147  string m_prv_spend_key;
148  string m_primary_address;
149 
150  void init_common();
151  };
152 }
Definition: monero_daemon.cpp:58
Definition: monero_wallet.h:123
Definition: monero_wallet_model.h:318
string get_mnemonic() const
Definition: monero_wallet_keys.h:121
monero_network_type get_network_type() const
Definition: monero_wallet_keys.h:120
string get_mnemonic_language() const
Definition: monero_wallet_keys.h:122
Definition: monero_daemon_model.h:101
string get_primary_address() const
Definition: monero_wallet_keys.h:127
Definition: monero_wallet_keys.h:69
string get_private_view_key() const
Definition: monero_wallet_keys.h:123
Definition: monero_wallet_model.h:97
string get_public_spend_key() const
Definition: monero_wallet_keys.h:126
string get_private_spend_key() const
Definition: monero_wallet_keys.h:124
monero_network_type
Definition: monero_daemon_model.h:92
string get_public_view_key() const
Definition: monero_wallet_keys.h:125