Monero C++ Library
Public Member Functions | Static Public Member Functions | List of all members
monero::monero_wallet_keys Class Reference

#include <monero_wallet_keys.h>

Inheritance diagram for monero::monero_wallet_keys:
monero::monero_wallet

Public Member Functions

 ~monero_wallet_keys ()
 
monero_version get_version () const
 
monero_network_type get_network_type () const
 
string get_mnemonic () const
 
string get_mnemonic_language () const
 
string get_private_view_key () const
 
string get_private_spend_key () const
 
string get_public_view_key () const
 
string get_public_spend_key () const
 
string get_primary_address () const
 
string get_address (const uint32_t account_idx, const uint32_t subaddress_idx) const
 
monero_integrated_address get_integrated_address (const string &standard_address="", const string &payment_id="") const
 
monero_integrated_address decode_integrated_address (const string &integrated_address) const
 
monero_account get_account (const uint32_t account_idx, bool include_subaddresses) const
 
vector< monero_subaddress > get_subaddresses (const uint32_t account_idx, const vector< uint32_t > &subaddress_indices) const
 
string sign (const string &msg) const
 
bool verify (const string &msg, const string &address, const string &signature) const
 
void close (bool save=false)
 
- Public Member Functions inherited from monero::monero_wallet
virtual ~monero_wallet ()
 
virtual void set_daemon_connection (const string &uri, const string &username="", const string &password="")
 
virtual void set_daemon_connection (const monero_rpc_connection &connection)
 
virtual shared_ptr< monero_rpc_connection > get_daemon_connection () const
 
virtual bool is_connected () const
 
virtual bool is_daemon_synced () const
 
virtual bool is_daemon_trusted () const
 
virtual bool is_synced () const
 
virtual string get_path () const
 
virtual monero_subaddress get_address_index (const string &address) const
 
virtual uint64_t get_height () const
 
virtual uint64_t get_restore_height () const
 
virtual void set_restore_height (uint64_t restore_height)
 
virtual uint64_t get_daemon_height () const
 
virtual uint64_t get_daemon_max_peer_height () const
 
virtual void add_listener (monero_wallet_listener &listener)
 
virtual void remove_listener (monero_wallet_listener &listener)
 
virtual set< monero_wallet_listener * > get_listeners ()
 
virtual monero_sync_result sync ()
 
virtual monero_sync_result sync (monero_sync_listener &listener)
 
virtual monero_sync_result sync (uint64_t start_height)
 
virtual monero_sync_result sync (uint64_t start_height, monero_sync_listener &listener)
 
virtual void start_syncing ()
 
virtual void stop_syncing ()
 
virtual void rescan_spent ()
 
virtual void rescan_blockchain ()
 
virtual uint64_t get_balance () const
 
virtual uint64_t get_balance (uint32_t account_idx) const
 
virtual uint64_t get_balance (uint32_t account_idx, uint32_t subaddress_idx) const
 
virtual uint64_t get_unlocked_balance () const
 
virtual uint64_t get_unlocked_balance (uint32_t account_idx) const
 
virtual uint64_t get_unlocked_balance (uint32_t account_idx, uint32_t subaddress_idx) const
 
virtual vector< monero_account > get_accounts () const
 
virtual vector< monero_account > get_accounts (bool include_subaddresses) const
 
virtual vector< monero_account > get_accounts (const string &tag) const
 
virtual vector< monero_account > get_accounts (bool include_subaddresses, const string &tag) const
 
virtual monero_account get_account (uint32_t account_idx) const
 
virtual monero_account create_account (const string &label="")
 
virtual vector< monero_subaddress > get_subaddresses (const uint32_t account_idx) const
 
virtual monero_subaddress get_subaddress (const uint32_t account_idx, const uint32_t subaddress_idx) const
 
virtual monero_subaddress create_subaddress (uint32_t account_idx, const string &label="")
 
virtual vector< shared_ptr< monero_tx_wallet > > get_txs () const
 
virtual vector< shared_ptr< monero_tx_wallet > > get_txs (const monero_tx_query &query) const
 
virtual vector< shared_ptr< monero_tx_wallet > > get_txs (const monero_tx_query &query, vector< string > &missing_tx_hashes) const
 
virtual vector< shared_ptr< monero_transfer > > get_transfers (const monero_transfer_query &query) const
 
virtual vector< shared_ptr< monero_output_wallet > > get_outputs (const monero_output_query &query) const
 
virtual string get_outputs_hex () const
 
virtual int import_outputs_hex (const string &outputs_hex)
 
virtual vector< shared_ptr< monero_key_image > > get_key_images () const
 
virtual shared_ptr< monero_key_image_import_result > import_key_images (const vector< shared_ptr< monero_key_image >> &key_images)
 
virtual monero_tx_set create_tx (monero_send_request &request)
 
virtual monero_tx_set create_tx (uint32_t account_index, string address, uint64_t amount)
 
virtual monero_tx_set create_tx (int account_index, string address, uint64_t amount, monero_send_priority priority)
 
virtual monero_tx_set create_txs (monero_send_request &request)
 
virtual string relay_tx (const string &tx_metadata)
 
virtual string relay_tx (const monero_tx_wallet &tx)
 
virtual vector< string > relay_txs (const vector< string > &tx_metadatas)
 
virtual vector< string > relay_txs (const vector< shared_ptr< monero_tx_wallet >> &txs)
 
virtual monero_tx_set send (const monero_send_request &request)
 
virtual monero_tx_set send (uint32_t account_index, string address, uint64_t amount)
 
virtual monero_tx_set send (uint32_t account_index, string address, uint64_t amount, monero_send_priority priority)
 
virtual monero_tx_set send_split (const monero_send_request &request)
 
virtual vector< monero_tx_set > sweep_unlocked (const monero_send_request &request)
 
virtual monero_tx_set sweep_output (const monero_send_request &request)
 
virtual monero_tx_set sweep_dust (bool do_not_relay=false)
 
virtual monero_tx_set parse_tx_set (const monero_tx_set &tx_set)
 
virtual string get_tx_key (const string &tx_hash) const
 
virtual shared_ptr< monero_check_tx > check_tx_key (const string &tx_hash, const string &txKey, const string &address) const
 
virtual string get_tx_proof (const string &tx_hash, const string &address, const string &message) const
 
virtual shared_ptr< monero_check_tx > check_tx_proof (const string &tx_hash, const string &address, const string &message, const string &signature) const
 
virtual string get_spend_proof (const string &tx_hash, const string &message) const
 
virtual bool check_spend_proof (const string &tx_hash, const string &message, const string &signature) const
 
virtual string get_reserve_proof_wallet (const string &message) const
 
virtual string get_reserve_proof_account (uint32_t account_idx, uint64_t amount, const string &message) const
 
virtual shared_ptr< monero_check_reserve > check_reserve_proof (const string &address, const string &message, const string &signature) const
 
virtual string get_tx_note (const string &tx_hash) const
 
virtual vector< string > get_tx_notes (const vector< string > &tx_hashes) const
 
virtual void set_tx_note (const string &tx_hash, const string &note)
 
virtual void set_tx_notes (const vector< string > &tx_hashes, const vector< string > &notes)
 
virtual vector< monero_address_book_entry > get_address_book_entries (const vector< uint64_t > &indices) const
 
virtual uint64_t add_address_book_entry (const string &address, const string &description, const string &payment_id="")
 
virtual void edit_address_book_entry (uint64_t index, bool set_address, const string &address, bool set_description, const string &description, bool set_payment_id=false, const string &payment_id="")
 
virtual void delete_address_book_entry (uint64_t index)
 
virtual string create_payment_uri (const monero_send_request &request) const
 
virtual shared_ptr< monero_send_request > parse_payment_uri (const string &uri) const
 
virtual bool get_attribute (const string &key, string &value) const
 
virtual void set_attribute (const string &key, const string &val)
 
virtual void start_mining (boost::optional< uint64_t > num_threads, boost::optional< bool > background_mining, boost::optional< bool > ignore_battery)
 
virtual void stop_mining ()
 
virtual uint64_t wait_for_next_block ()
 
virtual bool is_multisig_import_needed () const
 
virtual monero_multisig_info get_multisig_info ()
 
virtual string prepare_multisig ()
 
virtual monero_multisig_init_result make_multisig (const vector< string > &multisig_hexes, int threshold, const string &password)
 
virtual monero_multisig_init_result exchange_multisig_keys (const vector< string > &mutisig_hexes, const string &password)
 
virtual string get_multisig_hex ()
 
virtual int import_multisig_hex (const vector< string > &multisig_hexes)
 
virtual monero_multisig_sign_result sign_multisig_tx_hex (const string &multisig_tx_hex)
 
virtual vector< string > submit_multisig_tx_hex (const string &signed_multisig_tx_hex)
 
virtual void save ()
 
virtual void move_to (string path, string password)
 

Static Public Member Functions

static monero_wallet_keys * create_wallet_random (const monero_network_type network_type, const string &language)
 
static monero_wallet_keys * create_wallet_from_mnemonic (const monero_network_type network_type, const string &mnemonic, const string &seed_offset)
 
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")
 
static vector< string > get_mnemonic_languages ()
 

Detailed Description

Monero wallet implementation to provide basic offline key management.

Constructor & Destructor Documentation

◆ ~monero_wallet_keys()

monero::monero_wallet_keys::~monero_wallet_keys ( )

Destruct the wallet.

Member Function Documentation

◆ close()

void monero::monero_wallet_keys::close ( bool  save = false)
virtual

Optionally save then close the wallet.

Parameters
savespecifies if the wallet should be saved before being closed (default false)

Reimplemented from monero::monero_wallet.

◆ create_wallet_from_keys()

monero_wallet_keys * monero::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" 
)
static

Create a wallet from an address, view key, and spend key.

Parameters
network_typeis the wallet's network type
addressis the address of the wallet to construct
view_keyis the private view key of the wallet to construct
spend_keyis the private spend key of the wallet to construct
languageis the wallet and mnemonic's language (default = "English")

◆ create_wallet_from_mnemonic()

monero_wallet_keys * monero::monero_wallet_keys::create_wallet_from_mnemonic ( const monero_network_type  network_type,
const string &  mnemonic,
const string &  seed_offset 
)
static

Create a wallet from an existing mnemonic phrase.

Parameters
network_typeis the wallet's network type
mnemonicis the mnemonic of the wallet to construct

◆ create_wallet_random()

monero_wallet_keys * monero::monero_wallet_keys::create_wallet_random ( const monero_network_type  network_type,
const string &  language 
)
static

Create a new wallet with a randomly generated seed.

Parameters
network_typeis the wallet's network type (default = monero_network_type.MAINNET)
languageis the wallet and mnemonic's language (default = "English")

◆ decode_integrated_address()

monero_integrated_address monero::monero_wallet_keys::decode_integrated_address ( const string &  integrated_address) const
virtual

Decode an integrated address to get its standard address and payment id.

Parameters
integrated_addressis an integrated address to decode
Returns
the decoded integrated address including standard address and payment id

Reimplemented from monero::monero_wallet.

◆ get_account()

monero_account monero::monero_wallet_keys::get_account ( const uint32_t  account_idx,
bool  include_subaddresses 
) const
virtual

Get an account.

Parameters
account_idxspecifies the account to get
include_subaddressesspecifies if subaddresses should be included
Returns
the retrieved account

Reimplemented from monero::monero_wallet.

◆ get_address()

string monero::monero_wallet_keys::get_address ( const uint32_t  account_idx,
const uint32_t  subaddress_idx 
) const
virtual

Get the address of a specific subaddress.

Parameters
account_idxspecifies the account index of the address's subaddress
subaddress_idxspecifies the subaddress index within the account
Returns
the receive address of the specified subaddress

Reimplemented from monero::monero_wallet.

◆ get_integrated_address()

monero_integrated_address monero::monero_wallet_keys::get_integrated_address ( const string &  standard_address = "",
const string &  payment_id = "" 
) const
virtual

Get an integrated address from a standard address and a payment id.

Parameters
standard_addressis the integrated addresse's standard address (defaults to wallet's primary address)
payment_idis the integrated addresse's payment id (defaults to randomly generating new payment id)
Returns
the integrated address

Reimplemented from monero::monero_wallet.

◆ get_mnemonic()

string monero::monero_wallet_keys::get_mnemonic ( ) const
inlinevirtual

Get the wallet's mnemonic phrase.

Parameters
mnemonicis assigned the wallet's mnemonic phrase

Reimplemented from monero::monero_wallet.

◆ get_mnemonic_language()

string monero::monero_wallet_keys::get_mnemonic_language ( ) const
inlinevirtual

Get the language of the wallet's mnemonic phrase.

Returns
the language of the wallet's mnemonic phrase

Reimplemented from monero::monero_wallet.

◆ get_mnemonic_languages()

vector< string > monero::monero_wallet_keys::get_mnemonic_languages ( )
static

Get a list of available languages for the wallet's mnemonic phrase.

Returns
the available languages for the wallet's mnemonic phrase

◆ get_network_type()

monero_network_type monero::monero_wallet_keys::get_network_type ( ) const
inlinevirtual

Get the wallet's network type (mainnet, testnet, or stagenet).

Returns
the wallet's network type

Reimplemented from monero::monero_wallet.

◆ get_primary_address()

string monero::monero_wallet_keys::get_primary_address ( ) const
inlinevirtual

Get the wallet's primary address.

Returns
the wallet's primary address

Reimplemented from monero::monero_wallet.

◆ get_private_spend_key()

string monero::monero_wallet_keys::get_private_spend_key ( ) const
inlinevirtual

Get the wallet's private spend key.

Returns
the wallet's private spend key

Reimplemented from monero::monero_wallet.

◆ get_private_view_key()

string monero::monero_wallet_keys::get_private_view_key ( ) const
inlinevirtual

Get the wallet's private view key.

Returns
the wallet's private view key

Reimplemented from monero::monero_wallet.

◆ get_public_spend_key()

string monero::monero_wallet_keys::get_public_spend_key ( ) const
inlinevirtual

Get the wallet's public spend key.

Returns
the wallet's public spend key

Reimplemented from monero::monero_wallet.

◆ get_public_view_key()

string monero::monero_wallet_keys::get_public_view_key ( ) const
inlinevirtual

Get the wallet's public view key.

Returns
the wallet's public view key

Reimplemented from monero::monero_wallet.

◆ get_subaddresses()

vector< monero_subaddress > monero::monero_wallet_keys::get_subaddresses ( const uint32_t  account_idx,
const vector< uint32_t > &  subaddress_indices 
) const
virtual

Get subaddresses in an account.

Parameters
account_idxspecifies the account to get subaddresses within
subaddress_indicesare specific subaddresses to get (optional)
Returns
the retrieved subaddresses

Reimplemented from monero::monero_wallet.

◆ get_version()

monero_version monero::monero_wallet_keys::get_version ( ) const
virtual

Supported wallet methods.

Reimplemented from monero::monero_wallet.

◆ sign()

string monero::monero_wallet_keys::sign ( const string &  msg) const
virtual

Sign a message.

Parameters
msgis the message to sign
Returns
the signature

Reimplemented from monero::monero_wallet.

◆ verify()

bool monero::monero_wallet_keys::verify ( const string &  msg,
const string &  address,
const string &  signature 
) const
virtual

Verify a signature on a message.

Parameters
msgis the signed message
addressis the signing address
signatureis the signature
Returns
true if the signature is good, false otherwise

Reimplemented from monero::monero_wallet.


The documentation for this class was generated from the following files: