Monero C++ Library
Loading...
Searching...
No Matches
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 ()
 
bool is_view_only () const override
 
monero_version get_version () const override
 
monero_network_type get_network_type () const override
 
std::string get_seed () const override
 
std::string get_seed_language () const override
 
std::string get_private_view_key () const override
 
std::string get_private_spend_key () const override
 
std::string get_public_view_key () const override
 
std::string get_public_spend_key () const override
 
std::string get_primary_address () const override
 
std::string get_address (const uint32_t account_idx, const uint32_t subaddress_idx) const override
 
monero_integrated_address get_integrated_address (const std::string &standard_address="", const std::string &payment_id="") const override
 
monero_integrated_address decode_integrated_address (const std::string &integrated_address) const override
 
monero_account get_account (const uint32_t account_idx, bool include_subaddresses) const override
 
std::vector< monero_subaddressget_subaddresses (const uint32_t account_idx, const std::vector< uint32_t > &subaddress_indices) const override
 
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
 
monero_message_signature_result verify_message (const std::string &msg, const std::string &address, const std::string &signature) const override
 
void close (bool save=false) override
 
- Public Member Functions inherited from monero::monero_wallet
virtual ~monero_wallet ()
 
virtual void set_daemon_connection (const std::string &uri, const std::string &username="", const std::string &password="")
 
virtual void set_daemon_connection (const boost::optional< monero_rpc_connection > &connection)
 
virtual void set_daemon_proxy (const std::string &uri="")
 
virtual boost::optional< monero_rpc_connectionget_daemon_connection () const
 
virtual bool is_connected_to_daemon () const
 
virtual bool is_daemon_synced () const
 
virtual bool is_daemon_trusted () const
 
virtual bool is_synced () const
 
virtual std::string get_path () const
 
virtual monero_subaddress get_address_index (const std::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 uint64_t get_height_by_date (uint16_t year, uint8_t month, uint8_t day) const
 
virtual void add_listener (monero_wallet_listener &listener)
 
virtual void remove_listener (monero_wallet_listener &listener)
 
virtual std::set< monero_wallet_listener * > get_listeners ()
 
virtual monero_sync_result sync ()
 
virtual monero_sync_result sync (monero_wallet_listener &listener)
 
virtual monero_sync_result sync (uint64_t start_height)
 
virtual monero_sync_result sync (uint64_t start_height, monero_wallet_listener &listener)
 
virtual void start_syncing (uint64_t sync_period_in_ms=10000)
 
virtual void stop_syncing ()
 
virtual void scan_txs (const std::vector< std::string > &tx_hashes)
 
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 std::vector< monero_accountget_accounts () const
 
virtual std::vector< monero_accountget_accounts (bool include_subaddresses) const
 
virtual std::vector< monero_accountget_accounts (const std::string &tag) const
 
virtual std::vector< monero_accountget_accounts (bool include_subaddresses, const std::string &tag) const
 
virtual monero_account get_account (uint32_t account_idx) const
 
virtual monero_account create_account (const std::string &label="")
 
virtual std::vector< monero_subaddressget_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 std::string &label="")
 
virtual void set_subaddress_label (uint32_t account_idx, uint32_t subaddress_idx, const std::string &label="")
 
virtual std::vector< std::shared_ptr< monero_tx_wallet > > get_txs () const
 
virtual std::vector< std::shared_ptr< monero_tx_wallet > > get_txs (const monero_tx_query &query) const
 
virtual std::vector< std::shared_ptr< monero_transfer > > get_transfers (const monero_transfer_query &query) const
 
virtual std::vector< std::shared_ptr< monero_output_wallet > > get_outputs (const monero_output_query &query) const
 
virtual std::string export_outputs (bool all=false) const
 
virtual int import_outputs (const std::string &outputs_hex)
 
virtual std::vector< std::shared_ptr< monero_key_image > > export_key_images (bool all=false) const
 
virtual std::shared_ptr< monero_key_image_import_resultimport_key_images (const std::vector< std::shared_ptr< monero_key_image > > &key_images)
 
virtual void freeze_output (const std::string &key_image)
 
virtual void thaw_output (const std::string &key_image)
 
virtual bool is_output_frozen (const std::string &key_image)
 
virtual std::shared_ptr< monero_tx_walletcreate_tx (const monero_tx_config &config)
 
virtual std::vector< std::shared_ptr< monero_tx_wallet > > create_txs (const monero_tx_config &config)
 
virtual std::vector< std::shared_ptr< monero_tx_wallet > > sweep_unlocked (const monero_tx_config &config)
 
virtual std::shared_ptr< monero_tx_walletsweep_output (const monero_tx_config &config)
 
virtual std::vector< std::shared_ptr< monero_tx_wallet > > sweep_dust (bool relay=false)
 
virtual std::string relay_tx (const std::string &tx_metadata)
 
virtual std::string relay_tx (const monero_tx_wallet &tx)
 
virtual std::vector< std::string > relay_txs (const std::vector< std::shared_ptr< monero_tx_wallet > > &txs)
 
virtual std::vector< std::string > relay_txs (const std::vector< std::string > &tx_metadatas)
 
virtual monero_tx_set describe_tx_set (const monero_tx_set &tx_set)
 
virtual monero_tx_set sign_txs (const std::string &unsigned_tx_hex)
 
virtual std::vector< std::string > submit_txs (const std::string &signed_tx_hex)
 
virtual std::string get_tx_key (const std::string &tx_hash) const
 
virtual std::shared_ptr< monero_check_txcheck_tx_key (const std::string &tx_hash, const std::string &tx_key, const std::string &address) const
 
virtual std::string get_tx_proof (const std::string &tx_hash, const std::string &address, const std::string &message) const
 
virtual std::shared_ptr< monero_check_txcheck_tx_proof (const std::string &tx_hash, const std::string &address, const std::string &message, const std::string &signature) const
 
virtual std::string get_spend_proof (const std::string &tx_hash, const std::string &message) const
 
virtual bool check_spend_proof (const std::string &tx_hash, const std::string &message, const std::string &signature) const
 
virtual std::string get_reserve_proof_wallet (const std::string &message) const
 
virtual std::string get_reserve_proof_account (uint32_t account_idx, uint64_t amount, const std::string &message) const
 
virtual std::shared_ptr< monero_check_reservecheck_reserve_proof (const std::string &address, const std::string &message, const std::string &signature) const
 
virtual std::string get_tx_note (const std::string &tx_hash) const
 
virtual std::vector< std::string > get_tx_notes (const std::vector< std::string > &tx_hashes) const
 
virtual void set_tx_note (const std::string &tx_hash, const std::string &note)
 
virtual void set_tx_notes (const std::vector< std::string > &tx_hashes, const std::vector< std::string > &notes)
 
virtual std::vector< monero_address_book_entryget_address_book_entries (const std::vector< uint64_t > &indices) const
 
virtual uint64_t add_address_book_entry (const std::string &address, const std::string &description)
 
virtual void edit_address_book_entry (uint64_t index, bool set_address, const std::string &address, bool set_description, const std::string &description)
 
virtual void delete_address_book_entry (uint64_t index)
 
virtual std::string get_payment_uri (const monero_tx_config &config) const
 
virtual std::shared_ptr< monero_tx_configparse_payment_uri (const std::string &uri) const
 
virtual bool get_attribute (const std::string &key, std::string &value) const
 
virtual void set_attribute (const std::string &key, const std::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 bool is_multisig () const
 
virtual monero_multisig_info get_multisig_info () const
 
virtual std::string prepare_multisig ()
 
virtual std::string make_multisig (const std::vector< std::string > &multisig_hexes, int threshold, const std::string &password)
 
virtual monero_multisig_init_result exchange_multisig_keys (const std::vector< std::string > &mutisig_hexes, const std::string &password)
 
virtual std::string export_multisig_hex ()
 
virtual int import_multisig_hex (const std::vector< std::string > &multisig_hexes)
 
virtual monero_multisig_sign_result sign_multisig_tx_hex (const std::string &multisig_tx_hex)
 
virtual std::vector< std::string > submit_multisig_tx_hex (const std::string &signed_multisig_tx_hex)
 
virtual void change_password (const std::string &old_password, const std::string &new_password)
 
virtual void move_to (const std::string &path, const std::string &password)
 
virtual void save ()
 

Static Public Member Functions

static monero_wallet_keyscreate_wallet_random (const monero_wallet_config &config)
 
static monero_wallet_keyscreate_wallet_from_seed (const monero_wallet_config &config)
 
static monero_wallet_keyscreate_wallet_from_keys (const monero_wallet_config &config)
 
static std::vector< std::string > get_seed_languages ()
 

Detailed Description

Implements a Monero wallet to provide basic 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)
overridevirtual

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_wallet_config & config)
static

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

Parameters
configis the wallet configuration (network type, address, view key, spend key, language)

◆ create_wallet_from_seed()

monero_wallet_keys * monero::monero_wallet_keys::create_wallet_from_seed ( const monero_wallet_config & config)
static

Create a wallet from an existing mnemonic phrase or seed.

Parameters
configis the wallet configuration (network type, seed, seed offset, isMultisig)

◆ create_wallet_random()

monero_wallet_keys * monero::monero_wallet_keys::create_wallet_random ( const monero_wallet_config & config)
static

Create a new wallet with a randomly generated seed.

Parameters
configis the wallet configuration (network type and language)

◆ decode_integrated_address()

monero_integrated_address monero::monero_wallet_keys::decode_integrated_address ( const std::string & integrated_address) const
overridevirtual

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
overridevirtual

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()

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

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 std::string & standard_address = "",
const std::string & payment_id = "" ) const
overridevirtual

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_network_type()

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

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

Returns
the wallet's network type

Reimplemented from monero::monero_wallet.

◆ get_primary_address()

std::string monero::monero_wallet_keys::get_primary_address ( ) const
inlineoverridevirtual

Get the wallet's primary address.

Returns
the wallet's primary address

Reimplemented from monero::monero_wallet.

◆ get_private_spend_key()

std::string monero::monero_wallet_keys::get_private_spend_key ( ) const
inlineoverridevirtual

Get the wallet's private spend key.

Returns
the wallet's private spend key

Reimplemented from monero::monero_wallet.

◆ get_private_view_key()

std::string monero::monero_wallet_keys::get_private_view_key ( ) const
inlineoverridevirtual

Get the wallet's private view key.

Returns
the wallet's private view key

Reimplemented from monero::monero_wallet.

◆ get_public_spend_key()

std::string monero::monero_wallet_keys::get_public_spend_key ( ) const
inlineoverridevirtual

Get the wallet's public spend key.

Returns
the wallet's public spend key

Reimplemented from monero::monero_wallet.

◆ get_public_view_key()

std::string monero::monero_wallet_keys::get_public_view_key ( ) const
inlineoverridevirtual

Get the wallet's public view key.

Returns
the wallet's public view key

Reimplemented from monero::monero_wallet.

◆ get_seed()

std::string monero::monero_wallet_keys::get_seed ( ) const
inlineoverridevirtual

Get the wallet's mnemonic phrase or seed.

Returns
the wallet's mnemonic phrase or seed.

Reimplemented from monero::monero_wallet.

◆ get_seed_language()

std::string monero::monero_wallet_keys::get_seed_language ( ) const
inlineoverridevirtual

Get the language of the wallet's mnemonic phrase or seed.

Returns
the language of the wallet's mnemonic phrase or seed.

Reimplemented from monero::monero_wallet.

◆ get_seed_languages()

std::vector< std::string > monero::monero_wallet_keys::get_seed_languages ( )
static

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

Returns
the available languages for the wallet's seed

◆ get_subaddresses()

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

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
overridevirtual

Get the wallet's version.

Returns
the wallet's version

Reimplemented from monero::monero_wallet.

◆ is_view_only()

bool monero::monero_wallet_keys::is_view_only ( ) const
inlineoverridevirtual

Supported wallet methods.

Reimplemented from monero::monero_wallet.

◆ sign_message()

std::string monero::monero_wallet_keys::sign_message ( const std::string & msg,
monero_message_signature_type signature_type,
uint32_t account_idx = 0,
uint32_t subaddress_idx = 0 ) const
overridevirtual

Sign a message.

Parameters
msg- the message to sign
signature_type- sign with spend key or spend key
account_idx- the account index of the message signature (default 0)
subaddress_idx- the subaddress index of the message signature (default 0)
Returns
the message signature

Reimplemented from monero::monero_wallet.

◆ verify_message()

monero_message_signature_result monero::monero_wallet_keys::verify_message ( const std::string & msg,
const std::string & address,
const std::string & signature ) const
overridevirtual

Verify a message signature.

Parameters
msg- the signed message
address- signing address
signature- signature
Returns
the message signature result

Reimplemented from monero::monero_wallet.


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