monero-c
C ABI for using Monero
Loading...
Searching...
No Matches
monero_c_wallet.h File Reference
#include "utils/monero_c_utils.h"
#include "common/monero_c_rpc_connection.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for monero_c_wallet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  monero_wallet_listener_callbacks
 Callbacks of a wallet listener. More...
 

Typedefs

typedef struct monero_wallet monero_wallet
 Copyright (c) Libmonero.
 
typedef struct monero_wallet_listener monero_wallet_listener
 Opaque listener that receives the wallet's notifications.
 
typedef void(* monero_wallet_on_sync_progress_fn) (void *user_data, uint64_t height, uint64_t start_height, uint64_t end_height, double percent_done, const char *message)
 Called with the progress of a sync.
 
typedef void(* monero_wallet_on_new_block_fn) (void *user_data, uint64_t height)
 Called when a new block is processed.
 
typedef void(* monero_wallet_on_balances_changed_fn) (void *user_data, uint64_t new_balance, uint64_t new_unlocked_balance)
 Called when the balances of the wallet change.
 
typedef void(* monero_wallet_on_output_received_fn) (void *user_data, const char *output_json)
 Called when the wallet receives an output.
 
typedef void(* monero_wallet_on_output_spent_fn) (void *user_data, const char *output_json)
 Called when the wallet spends an output.
 
typedef struct monero_wallet_listener_callbacks monero_wallet_listener_callbacks
 Callbacks of a wallet listener.
 
typedef enum monero_message_signature_type monero_message_signature_type
 Key that signs a message.
 
typedef enum monero_tx_priority monero_tx_priority
 Fee priority of a transaction.
 

Enumerations

enum  monero_message_signature_type { MONERO_MESSAGE_SIGN_WITH_SPEND_KEY = 0 , MONERO_MESSAGE_SIGN_WITH_VIEW_KEY = 1 }
 Key that signs a message. More...
 
enum  monero_tx_priority { MONERO_TX_PRIORITY_DEFAULT = 0 , MONERO_TX_PRIORITY_UNIMPORTANT = 1 , MONERO_TX_PRIORITY_NORMAL = 2 , MONERO_TX_PRIORITY_ELEVATED = 3 }
 Fee priority of a transaction. More...
 

Functions

MONERO_EXPORT monero_result monero_wallet_create_random (const char *path, const char *password, int32_t network_type, const char *language, monero_wallet **out_wallet)
 Create a wallet with a new random seed and save it to disk.
 
MONERO_EXPORT monero_result monero_wallet_create_from_seed (const char *path, const char *password, int32_t network_type, const char *seed, const char *seed_offset, uint64_t restore_height, const char *language, monero_wallet **out_wallet)
 Restore a wallet from its mnemonic seed and save it to disk.
 
MONERO_EXPORT monero_result monero_wallet_create_from_keys (const char *path, const char *password, int32_t network_type, const char *address, const char *private_view_key, const char *private_spend_key, uint64_t restore_height, const char *language, monero_wallet **out_wallet)
 Restore a wallet from its keys and save it to disk.
 
MONERO_EXPORT monero_result monero_wallet_create (const char *config_json, monero_wallet **out_wallet)
 Create a full wallet from a monero_wallet_config, which the other creation functions can't do: it can connect the wallet to a daemon when it is created, set the trust in the daemon, scan more accounts and subaddresses than the 50 and 200 of wallet2, and restore a multisig wallet.
 
MONERO_EXPORT monero_result monero_wallet_open (const char *path, const char *password, int32_t network_type, monero_wallet **out_wallet)
 Open a wallet from its files on disk.
 
MONERO_EXPORT monero_result monero_wallet_exists (const char *path, bool *out_exists)
 Check if a wallet exists at the given path.
 
MONERO_EXPORT monero_result monero_wallet_get_seed_languages (char **out_json)
 Get the languages a mnemonic seed can be written in.
 
MONERO_EXPORT monero_result monero_wallet_keys_create_random (int32_t network_type, const char *language, monero_wallet **out_wallet)
 Create a keys-only wallet with a new random seed.
 
MONERO_EXPORT monero_result monero_wallet_keys_create_from_seed (int32_t network_type, const char *seed, const char *seed_offset, const char *language, monero_wallet **out_wallet)
 Restore a keys-only wallet from its mnemonic seed.
 
MONERO_EXPORT monero_result monero_wallet_keys_create_from_keys (int32_t network_type, const char *address, const char *private_view_key, const char *private_spend_key, const char *language, monero_wallet **out_wallet)
 Restore a keys-only wallet from its keys.
 
MONERO_EXPORT monero_result monero_wallet_save (monero_wallet *wallet)
 Save the wallet to disk.
 
MONERO_EXPORT monero_result monero_wallet_close (monero_wallet *wallet, bool save)
 Close the wallet.
 
MONERO_EXPORT monero_result monero_wallet_request_shutdown (monero_wallet *wallet)
 Ask a full wallet to stop what it is doing, so that the calls that other threads have in flight on it return soon.
 
MONERO_EXPORT void monero_wallet_free (monero_wallet *wallet)
 Release a wallet handle.
 
MONERO_EXPORT monero_result monero_wallet_get_network_type (monero_wallet *wallet, monero_utils_network_type *out_network_type)
 Get the network of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_is_view_only (monero_wallet *wallet, bool *out_view_only)
 Check if the wallet is view-only, which means it has no private spend key.
 
MONERO_EXPORT monero_result monero_wallet_is_multisig (monero_wallet *wallet, bool *out_multisig)
 Check if the wallet is a multisig wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_seed (monero_wallet *wallet, char **out_seed)
 Get the mnemonic seed of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_seed_language (monero_wallet *wallet, char **out_language)
 Get the language of the mnemonic seed.
 
MONERO_EXPORT monero_result monero_wallet_get_primary_address (monero_wallet *wallet, char **out_address)
 Get the primary address of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_private_view_key (monero_wallet *wallet, char **out_key)
 Get the private view key of the wallet, in hex.
 
MONERO_EXPORT monero_result monero_wallet_get_private_spend_key (monero_wallet *wallet, char **out_key)
 Get the private spend key of the wallet, in hex.
 
MONERO_EXPORT monero_result monero_wallet_get_height (monero_wallet *wallet, uint64_t *out_height)
 Get the height of the blocks the wallet has synced to.
 
MONERO_EXPORT monero_result monero_wallet_get_balance (monero_wallet *wallet, uint64_t *out_balance)
 Get the balance of the wallet, including funds that are still locked.
 
MONERO_EXPORT monero_result monero_wallet_get_unlocked_balance (monero_wallet *wallet, uint64_t *out_balance)
 Get the unlocked balance of the wallet, the part that can be spent now.
 
MONERO_EXPORT monero_result monero_wallet_get_account_balance (monero_wallet *wallet, uint32_t account_idx, uint64_t *out_balance)
 Get the balance of an account, including funds that are still locked.
 
MONERO_EXPORT monero_result monero_wallet_get_subaddress_balance (monero_wallet *wallet, uint32_t account_idx, uint32_t subaddress_idx, uint64_t *out_balance)
 Get the balance of a subaddress, including funds that are still locked.
 
MONERO_EXPORT monero_result monero_wallet_get_account_unlocked_balance (monero_wallet *wallet, uint32_t account_idx, uint64_t *out_balance)
 Get the unlocked balance of an account, the part that can be spent now.
 
MONERO_EXPORT monero_result monero_wallet_get_subaddress_unlocked_balance (monero_wallet *wallet, uint32_t account_idx, uint32_t subaddress_idx, uint64_t *out_balance)
 Get the unlocked balance of a subaddress, the part that can be spent now.
 
MONERO_EXPORT monero_result monero_wallet_get_address (monero_wallet *wallet, uint32_t account_idx, uint32_t subaddress_idx, char **out_address)
 Get the address of an account and subaddress.
 
MONERO_EXPORT monero_result monero_wallet_get_integrated_address (monero_wallet *wallet, const char *standard_address, const char *payment_id, char **out_json)
 Get the integrated address of a standard address and a payment ID.
 
MONERO_EXPORT monero_result monero_wallet_decode_integrated_address (monero_wallet *wallet, const char *integrated_address, char **out_json)
 Decode an integrated address into its standard address and payment ID.
 
MONERO_EXPORT monero_result monero_wallet_get_account (monero_wallet *wallet, uint32_t account_idx, bool include_subaddresses, char **out_json)
 Get an account, with or without its subaddresses.
 
MONERO_EXPORT monero_result monero_wallet_get_subaddresses (monero_wallet *wallet, uint32_t account_idx, const uint32_t *subaddress_indices, size_t num_subaddress_indices, char **out_json)
 Get the subaddresses of an account.
 
MONERO_EXPORT monero_result monero_wallet_sign_message (monero_wallet *wallet, const char *message, int32_t signature_type, uint32_t account_idx, uint32_t subaddress_idx, char **out_signature)
 Sign a message with the spend key or the view key of an account and subaddress.
 
MONERO_EXPORT monero_result monero_wallet_verify_message (monero_wallet *wallet, const char *message, const char *address, const char *signature, char **out_json)
 Verify a signature made by monero_wallet_sign_message() for an address.
 
MONERO_EXPORT monero_result monero_wallet_add_address_book_entry (monero_wallet *wallet, const char *address, const char *description, uint64_t *out_index)
 Add an address to the address book.
 
MONERO_EXPORT monero_result monero_wallet_edit_address_book_entry (monero_wallet *wallet, uint64_t index, const char *address, const char *description)
 Edit an address book entry.
 
MONERO_EXPORT monero_result monero_wallet_delete_address_book_entry (monero_wallet *wallet, uint64_t index)
 Delete an address book entry.
 
MONERO_EXPORT monero_result monero_wallet_get_address_book_entries (monero_wallet *wallet, const uint64_t *indices, size_t num_indices, char **out_json)
 Get the address book entries with the given indices.
 
MONERO_EXPORT monero_result monero_wallet_change_password (monero_wallet *wallet, const char *old_password, const char *new_password)
 Change the password of the wallet files.
 
MONERO_EXPORT monero_result monero_wallet_create_account (monero_wallet *wallet, const char *label, char **out_json)
 Create an account, with the next account index.
 
MONERO_EXPORT monero_result monero_wallet_create_subaddress (monero_wallet *wallet, uint32_t account_idx, const char *label, char **out_json)
 Create a subaddress in an account.
 
MONERO_EXPORT monero_result monero_wallet_get_accounts (monero_wallet *wallet, bool include_subaddresses, char **out_json)
 Get the accounts of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_address_index (monero_wallet *wallet, const char *address, char **out_json)
 Get the subaddress of an address.
 
MONERO_EXPORT monero_result monero_wallet_get_subaddress (monero_wallet *wallet, uint32_t account_idx, uint32_t subaddress_idx, char **out_json)
 Get a subaddress by its indices.
 
MONERO_EXPORT monero_result monero_wallet_set_subaddress_label (monero_wallet *wallet, uint32_t account_idx, uint32_t subaddress_idx, const char *label)
 Set the label of a subaddress.
 
MONERO_EXPORT monero_result monero_wallet_set_account_tag_label (monero_wallet *wallet, const char *tag, const char *label)
 Set the label of an account tag.
 
MONERO_EXPORT monero_result monero_wallet_get_account_tags (monero_wallet *wallet, char **out_json)
 Get the account tags of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_tag_accounts (monero_wallet *wallet, const char *tag, const uint32_t *account_indices, size_t num_account_indices)
 Tag accounts with a tag.
 
MONERO_EXPORT monero_result monero_wallet_untag_accounts (monero_wallet *wallet, const uint32_t *account_indices, size_t num_account_indices)
 Remove the tags of accounts.
 
MONERO_EXPORT monero_result monero_wallet_get_attribute (monero_wallet *wallet, const char *key, bool *out_found, char **out_value)
 Get an attribute, a key and value that the wallet stores with its files.
 
MONERO_EXPORT monero_result monero_wallet_set_attribute (monero_wallet *wallet, const char *key, const char *value)
 Set an attribute.
 
MONERO_EXPORT monero_result monero_wallet_get_default_fee_priority (monero_wallet *wallet, monero_tx_priority *out_priority)
 Get the default priority of the fee of the transactions.
 
MONERO_EXPORT monero_result monero_wallet_get_path (monero_wallet *wallet, char **out_path)
 Get the path of the wallet file.
 
MONERO_EXPORT monero_result monero_wallet_get_public_view_key (monero_wallet *wallet, char **out_key)
 Get the public view key of the wallet, in hex.
 
MONERO_EXPORT monero_result monero_wallet_get_public_spend_key (monero_wallet *wallet, char **out_key)
 Get the public spend key of the wallet, in hex.
 
MONERO_EXPORT monero_result monero_wallet_get_version (monero_wallet *wallet, char **out_json)
 Get the version of the wallet library.
 
MONERO_EXPORT monero_result monero_wallet_get_restore_height (monero_wallet *wallet, uint64_t *out_height)
 Get the height from which the wallet scans the blocks.
 
MONERO_EXPORT monero_result monero_wallet_set_restore_height (monero_wallet *wallet, uint64_t restore_height)
 Set the height from which the wallet scans the blocks.
 
MONERO_EXPORT monero_result monero_wallet_is_closed (monero_wallet *wallet, bool *out_closed)
 Check if the wallet is closed.
 
MONERO_EXPORT monero_result monero_wallet_export_key_images (monero_wallet *wallet, bool all, char **out_json)
 Export the key images of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_import_key_images (monero_wallet *wallet, const char *key_images_json, uint64_t offset, char **out_json)
 Import key images into the wallet.
 
MONERO_EXPORT monero_result monero_wallet_export_outputs (monero_wallet *wallet, bool all, char **out_hex)
 Export the outputs of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_import_outputs (monero_wallet *wallet, const char *outputs_hex, int32_t *out_num_imported)
 Import outputs into the wallet.
 
MONERO_EXPORT monero_result monero_wallet_freeze_output (monero_wallet *wallet, const char *key_image)
 Freeze an output, so the wallet doesn't spend it.
 
MONERO_EXPORT monero_result monero_wallet_thaw_output (monero_wallet *wallet, const char *key_image)
 Thaw a frozen output.
 
MONERO_EXPORT monero_result monero_wallet_is_output_frozen (monero_wallet *wallet, const char *key_image, bool *out_frozen)
 Check if an output is frozen.
 
MONERO_EXPORT monero_result monero_wallet_get_tx_note (monero_wallet *wallet, const char *tx_hash, char **out_note)
 Get the note of a transaction.
 
MONERO_EXPORT monero_result monero_wallet_set_tx_note (monero_wallet *wallet, const char *tx_hash, const char *note)
 Set the note of a transaction.
 
MONERO_EXPORT monero_result monero_wallet_get_tx_notes (monero_wallet *wallet, const char *const *tx_hashes, size_t num_tx_hashes, char **out_json)
 Get the notes of transactions.
 
MONERO_EXPORT monero_result monero_wallet_set_tx_notes (monero_wallet *wallet, const char *const *tx_hashes, const char *const *notes, size_t num_tx_hashes)
 Set the notes of transactions.
 
MONERO_EXPORT monero_result monero_wallet_set_daemon_connection (monero_wallet *wallet, const char *uri, const char *username, const char *password, const char *proxy_uri, const bool *is_trusted, bool ssl_verify)
 Set the daemon connection of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_daemon_connection (monero_wallet *wallet, char **out_json)
 Get the daemon connection of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_is_daemon_trusted (monero_wallet *wallet, bool *out_trusted)
 Check if the daemon is trusted.
 
MONERO_EXPORT monero_result monero_wallet_listener_create (const monero_wallet_listener_callbacks *callbacks, monero_wallet_listener **out_listener)
 Create a listener from its callbacks.
 
MONERO_EXPORT void monero_wallet_listener_free (monero_wallet_listener *listener)
 Release a listener.
 
MONERO_EXPORT monero_result monero_wallet_add_listener (monero_wallet *wallet, monero_wallet_listener *listener)
 Register a listener with a wallet.
 
MONERO_EXPORT monero_result monero_wallet_remove_listener (monero_wallet *wallet, monero_wallet_listener *listener)
 Unregister a listener from a wallet.
 
MONERO_EXPORT monero_result monero_wallet_remove_listeners (monero_wallet *wallet)
 Unregister all the listeners of a wallet.
 
MONERO_EXPORT monero_result monero_wallet_sync (monero_wallet *wallet, const uint64_t *start_height, monero_wallet_listener *listener, char **out_json)
 Synchronize the wallet with the daemon in the calling thread.
 
MONERO_EXPORT monero_result monero_wallet_start_syncing (monero_wallet *wallet, uint64_t sync_period_ms)
 Start a background thread that syncs the wallet with the daemon.
 
MONERO_EXPORT monero_result monero_wallet_stop_syncing (monero_wallet *wallet)
 Stop the background thread that syncs the wallet.
 
MONERO_EXPORT monero_result monero_wallet_is_connected_to_daemon (monero_wallet *wallet, bool *out_connected)
 Check if the wallet is connected to a daemon.
 
MONERO_EXPORT monero_result monero_wallet_is_daemon_synced (monero_wallet *wallet, bool *out_synced)
 Check if the daemon of the wallet is synced with the network.
 
MONERO_EXPORT monero_result monero_wallet_is_synced (monero_wallet *wallet, bool *out_synced)
 Check if the wallet is synced with the daemon.
 
MONERO_EXPORT monero_result monero_wallet_get_daemon_height (monero_wallet *wallet, uint64_t *out_height)
 Get the height the daemon of the wallet is synced to.
 
MONERO_EXPORT monero_result monero_wallet_get_daemon_max_peer_height (monero_wallet *wallet, uint64_t *out_height)
 Get the maximum height of the peers the daemon of the wallet is connected to.
 
MONERO_EXPORT monero_result monero_wallet_wait_for_next_block (monero_wallet *wallet, uint64_t *out_height)
 Wait until the next block is added to the chain.
 
MONERO_EXPORT monero_result monero_wallet_scan_txs (monero_wallet *wallet, const char *const *tx_hashes, size_t num_tx_hashes)
 Scan transactions by their hashes.
 
MONERO_EXPORT monero_result monero_wallet_rescan_blockchain (monero_wallet *wallet)
 Rescan the blockchain from scratch.
 
MONERO_EXPORT monero_result monero_wallet_rescan_spent (monero_wallet *wallet)
 Rescan the blockchain for spent outputs.
 
MONERO_EXPORT monero_result monero_wallet_get_height_by_date (monero_wallet *wallet, uint16_t year, uint8_t month, uint8_t day, uint64_t *out_height)
 Get the approximate height of the blockchain at a date.
 
MONERO_EXPORT monero_result monero_wallet_start_mining (monero_wallet *wallet, const uint64_t *num_threads, const bool *background_mining, const bool *ignore_battery)
 Start mining on the daemon.
 
MONERO_EXPORT monero_result monero_wallet_stop_mining (monero_wallet *wallet)
 Stop mining on the daemon.
 
MONERO_EXPORT monero_result monero_wallet_get_txs (monero_wallet *wallet, const char *query_json, char **out_json)
 Get the transactions of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_transfers (monero_wallet *wallet, const char *query_json, char **out_json)
 Get the incoming and outgoing transfers of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_outputs (monero_wallet *wallet, const char *query_json, char **out_json)
 Get the outputs of the wallet that it can spend.
 
MONERO_EXPORT monero_result monero_wallet_create_tx (monero_wallet *wallet, const char *config_json, char **out_json)
 Create a transaction that transfers funds from the wallet.
 
MONERO_EXPORT monero_result monero_wallet_create_txs (monero_wallet *wallet, const char *config_json, char **out_json)
 Create one or more transactions that transfer funds from the wallet.
 
MONERO_EXPORT monero_result monero_wallet_relay_tx (monero_wallet *wallet, const char *tx_metadata, char **out_hash)
 Relay a transaction that was created without relaying.
 
MONERO_EXPORT monero_result monero_wallet_relay_tx_json (monero_wallet *wallet, const char *tx_json, char **out_hash)
 Relay a transaction created without relaying, from its JSON.
 
MONERO_EXPORT monero_result monero_wallet_relay_txs (monero_wallet *wallet, const char *const *tx_metadatas, size_t num_tx_metadatas, char **out_json)
 Relay transactions that were created without relaying.
 
MONERO_EXPORT monero_result monero_wallet_relay_txs_json (monero_wallet *wallet, const char *txs_json, char **out_json)
 Relay transactions created without relaying, from a JSON array.
 
MONERO_EXPORT monero_result monero_wallet_submit_txs (monero_wallet *wallet, const char *signed_tx_hex, char **out_json)
 Submit signed transactions of a view-only wallet.
 
MONERO_EXPORT monero_result monero_wallet_sign_txs (monero_wallet *wallet, const char *unsigned_tx_hex, char **out_json)
 Sign unsigned transactions of a view-only wallet with the full wallet that created them.
 
MONERO_EXPORT monero_result monero_wallet_describe_tx_set (monero_wallet *wallet, const char *tx_set_json, char **out_json)
 Describe a transaction set with unsigned or multisig hex as structured transactions.
 
MONERO_EXPORT monero_result monero_wallet_sweep_output (monero_wallet *wallet, const char *config_json, char **out_json)
 Sweep an output with a given key image into the wallet.
 
MONERO_EXPORT monero_result monero_wallet_sweep_dust (monero_wallet *wallet, bool relay, char **out_json)
 Sweep the unmixable dust outputs back to the wallet, so they are easier to spend and mix.
 
MONERO_EXPORT monero_result monero_wallet_sweep_unlocked (monero_wallet *wallet, const char *config_json, char **out_json)
 Sweep the unlocked funds of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_move_to (monero_wallet *wallet, const char *path, const char *password)
 Move the wallet files to another path.
 
MONERO_EXPORT monero_result monero_wallet_get_payment_uri (monero_wallet *wallet, const char *config_json, char **out_uri)
 Create a payment URI from a transaction config.
 
MONERO_EXPORT monero_result monero_wallet_parse_payment_uri (monero_wallet *wallet, const char *uri, char **out_json)
 Parse a payment URI into a transaction config.
 
MONERO_EXPORT monero_result monero_wallet_get_tx_key (monero_wallet *wallet, const char *tx_hash, char **out_key)
 Get the secret key of a transaction from its hash.
 
MONERO_EXPORT monero_result monero_wallet_check_tx_key (monero_wallet *wallet, const char *tx_hash, const char *tx_key, const char *address, char **out_json)
 Check a transaction in the blockchain with its secret key.
 
MONERO_EXPORT monero_result monero_wallet_get_tx_proof (monero_wallet *wallet, const char *tx_hash, const char *address, const char *message, char **out_signature)
 Get a signature that proves a transaction sent to an address.
 
MONERO_EXPORT monero_result monero_wallet_check_tx_proof (monero_wallet *wallet, const char *tx_hash, const char *address, const char *message, const char *signature, char **out_json)
 Check a transaction proof, the signature made by monero_wallet_get_tx_proof().
 
MONERO_EXPORT monero_result monero_wallet_get_spend_proof (monero_wallet *wallet, const char *tx_hash, const char *message, char **out_signature)
 Get a signature that proves a spend of a transaction.
 
MONERO_EXPORT monero_result monero_wallet_check_spend_proof (monero_wallet *wallet, const char *tx_hash, const char *message, const char *signature, bool *out_good)
 Check a spend proof, the signature made by monero_wallet_get_spend_proof().
 
MONERO_EXPORT monero_result monero_wallet_get_reserve_proof_wallet (monero_wallet *wallet, const char *message, char **out_signature)
 Get a signature that proves the whole balance of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_get_reserve_proof_account (monero_wallet *wallet, uint32_t account_idx, uint64_t amount, const char *message, char **out_signature)
 Get a signature that proves an amount available in an account.
 
MONERO_EXPORT monero_result monero_wallet_check_reserve_proof (monero_wallet *wallet, const char *address, const char *message, const char *signature, char **out_json)
 Check a reserve proof, the signature made by monero_wallet_get_reserve_proof_wallet() or monero_wallet_get_reserve_proof_account().
 
MONERO_EXPORT monero_result monero_wallet_is_multisig_import_needed (monero_wallet *wallet, bool *out_needed)
 Check if importing multisig data is needed for a correct balance.
 
MONERO_EXPORT monero_result monero_wallet_get_multisig_info (monero_wallet *wallet, char **out_json)
 Get the multisig info of the wallet.
 
MONERO_EXPORT monero_result monero_wallet_prepare_multisig (monero_wallet *wallet, char **out_multisig_hex)
 Get the multisig hex to share with the participants, to start making a multisig wallet.
 
MONERO_EXPORT monero_result monero_wallet_make_multisig (monero_wallet *wallet, const char *const *multisig_hexes, size_t num_multisig_hexes, int32_t threshold, const char *password, char **out_multisig_hex)
 Make the wallet multisig from the multisig hex of the other participants.
 
MONERO_EXPORT monero_result monero_wallet_exchange_multisig_keys (monero_wallet *wallet, const char *const *multisig_hexes, size_t num_multisig_hexes, const char *password, char **out_json)
 Exchange the multisig hex with the other participants.
 
MONERO_EXPORT monero_result monero_wallet_export_multisig_hex (monero_wallet *wallet, char **out_multisig_hex)
 Export the multisig info of the wallet as hex, for the other participants.
 
MONERO_EXPORT monero_result monero_wallet_import_multisig_hex (monero_wallet *wallet, const char *const *multisig_hexes, size_t num_multisig_hexes, bool refresh_after_import, int32_t *out_num_imported)
 Import the multisig info of the other participants, as hex.
 
MONERO_EXPORT monero_result monero_wallet_sign_multisig_tx_hex (monero_wallet *wallet, const char *multisig_tx_hex, char **out_json)
 Sign multisig transactions, given as the hex shared when they were created.
 
MONERO_EXPORT monero_result monero_wallet_submit_multisig_tx_hex (monero_wallet *wallet, const char *signed_multisig_tx_hex, char **out_json)
 Submit signed multisig transactions, given as hex.
 
MONERO_EXPORT monero_result monero_wallet_rpc_connect (monero_rpc_connection *connection, monero_wallet **out_wallet)
 Connect to a monero-wallet-rpc server through a shared connection, with its proxy, timeout and TLS settings.
 
MONERO_EXPORT monero_result monero_wallet_rpc_open_wallet (monero_wallet *wallet, const char *name, const char *wallet_password)
 Open a wallet on the server of an RPC wallet.
 
MONERO_EXPORT monero_result monero_wallet_rpc_create_wallet (monero_wallet *wallet, const char *config_json)
 Create a wallet on the server of an RPC wallet and open it.
 
MONERO_EXPORT monero_result monero_wallet_rpc_open (const char *uri, const char *username, const char *password, const char *name, const char *wallet_password, monero_wallet **out_wallet)
 Open a wallet on a monero-wallet-rpc server.
 
MONERO_EXPORT monero_result monero_wallet_rpc_create_random (const char *uri, const char *username, const char *password, const char *name, const char *wallet_password, const char *language, monero_wallet **out_wallet)
 Create a random wallet on a monero-wallet-rpc server.
 
MONERO_EXPORT monero_result monero_wallet_rpc_create_from_seed (const char *uri, const char *username, const char *password, const char *name, const char *wallet_password, const char *seed, const char *seed_offset, uint64_t restore_height, const char *language, monero_wallet **out_wallet)
 Restore a wallet from its mnemonic seed on a monero-wallet-rpc server.
 
MONERO_EXPORT monero_result monero_wallet_rpc_create_from_keys (const char *uri, const char *username, const char *password, const char *name, const char *wallet_password, const char *address, const char *private_view_key, const char *private_spend_key, uint64_t restore_height, const char *language, monero_wallet **out_wallet)
 Restore a wallet from its keys on a monero-wallet-rpc server.
 
MONERO_EXPORT monero_result monero_wallet_rpc_stop (monero_wallet *wallet)
 Save and close the wallet and stop the monero-wallet-rpc server.
 
MONERO_EXPORT monero_result monero_wallet_rpc_get_seed_languages (monero_wallet *wallet, char **out_json)
 Get the seed languages that the monero-wallet-rpc server supports.
 
MONERO_EXPORT monero_result monero_wallet_rpc_get_connection (monero_wallet *wallet, char **out_json)
 Get the connection to the monero-wallet-rpc server.
 
MONERO_EXPORT monero_result monero_wallet_rpc_set_poll_period (monero_wallet *wallet, uint64_t period_ms)
 Set how often the RPC wallet polls the server for changes.
 
MONERO_EXPORT monero_result monero_wallet_rpc_get_balances (monero_wallet *wallet, const uint32_t *account_idx, const uint32_t *subaddress_idx, char **out_json)
 Get the balances of an account or a subaddress, from the server.
 
MONERO_EXPORT monero_result monero_wallet_rpc_get_account (monero_wallet *wallet, uint32_t account_idx, bool include_subaddresses, bool skip_balances, char **out_json)
 Get an account from the server, with or without its subaddresses and balances.
 
MONERO_EXPORT monero_result monero_wallet_rpc_get_accounts (monero_wallet *wallet, bool include_subaddresses, const char *tag, bool skip_balances, char **out_json)
 Get the accounts of the wallet from the server, optionally only those with a tag.
 
MONERO_EXPORT monero_result monero_wallet_rpc_get_subaddresses (monero_wallet *wallet, uint32_t account_idx, const uint32_t *subaddress_indices, size_t num_subaddress_indices, bool skip_balances, char **out_json)
 Get the subaddresses of an account from the server, with the given indices.
 
MONERO_EXPORT monero_result monero_wallet_rpc_set_daemon_connection (monero_wallet *wallet, const char *connection_json, bool is_trusted, const char *ssl_options_json)
 Set the daemon connection of an RPC wallet, with the SSL options of the connection.
 

Typedef Documentation

◆ monero_message_signature_type

Key that signs a message.

Values match monero-cpp's monero_message_signature_type.

◆ monero_tx_priority

Fee priority of a transaction.

Values match monero-cpp's monero_tx_priority.

◆ monero_wallet

typedef struct monero_wallet monero_wallet

Copyright (c) Libmonero.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Opaque handle to a wallet. Full wallets come from monero_wallet_create_random(), monero_wallet_create_from_seed(), monero_wallet_create_from_keys() and monero_wallet_open(). Keys-only wallets come from the monero_wallet_keys_create_*() functions. Release the handle with monero_wallet_free().

Thread safety
Don't use one handle from two threads at once, except to call monero_wallet_request_shutdown(). A listener callback runs on a thread of monero-cpp while the sync holds the lock of the wallet. Don't free the handle or a listener from it, and don't call monero_wallet_get_balance(), monero_wallet_get_unlocked_balance(), monero_wallet_get_txs(), monero_wallet_get_outputs() or monero_wallet_get_accounts() on the same wallet from it, since they wait for that lock and never return. Copy what the callback gets and make those calls from another thread.

◆ monero_wallet_listener

Opaque listener that receives the wallet's notifications.

Create it with monero_wallet_listener_create() and release it with monero_wallet_listener_free().

Thread safety
Don't add, remove or free the same listener from two threads at once. Adding one listener to two wallets from two threads is safe, and one of the adds fails.

◆ monero_wallet_listener_callbacks

Callbacks of a wallet listener.

The struct is copied by monero_wallet_listener_create(). A NULL callback is skipped.

◆ monero_wallet_on_balances_changed_fn

typedef void(* monero_wallet_on_balances_changed_fn) (void *user_data, uint64_t new_balance, uint64_t new_unlocked_balance)

Called when the balances of the wallet change.

Parameters
user_datais the user_data of the monero_wallet_listener_callbacks
new_balanceis the new balance in atomic units
new_unlocked_balanceis the new unlocked balance in atomic units

◆ monero_wallet_on_new_block_fn

typedef void(* monero_wallet_on_new_block_fn) (void *user_data, uint64_t height)

Called when a new block is processed.

Parameters
user_datais the user_data of the monero_wallet_listener_callbacks
heightis the height of the new block

◆ monero_wallet_on_output_received_fn

typedef void(* monero_wallet_on_output_received_fn) (void *user_data, const char *output_json)

Called when the wallet receives an output.

The JSON is valid only during the call.

Parameters
user_datais the user_data of the monero_wallet_listener_callbacks
output_jsonis a JSON object with the output in its transaction and its block, {"blocks":[...]}, as monero_wallet_get_outputs() returns it. The block has the height of the transaction, and none if the transaction is in the pool. The transaction has its hash, its unlock time and whether it is locked, and the output is in its "outputs" with its amount and the indices of its account and subaddress

◆ monero_wallet_on_output_spent_fn

typedef void(* monero_wallet_on_output_spent_fn) (void *user_data, const char *output_json)

Called when the wallet spends an output.

The JSON is valid only during the call.

Parameters
user_datais the user_data of the monero_wallet_listener_callbacks
output_jsonis a JSON object with the spent output in its transaction and its block, {"blocks":[...]}, as monero_wallet_get_outputs() returns it. The block has the height of the transaction, and none if the transaction is in the pool. The transaction has its hash, its unlock time and whether it is locked, and the output is in its "inputs" with its amount and the indices of its account and subaddress

◆ monero_wallet_on_sync_progress_fn

typedef void(* monero_wallet_on_sync_progress_fn) (void *user_data, uint64_t height, uint64_t start_height, uint64_t end_height, double percent_done, const char *message)

Called with the progress of a sync.

The message is valid only during the call.

Parameters
user_datais the user_data of the monero_wallet_listener_callbacks
heightis the height of the synced block
start_heightis the starting height of the sync request
end_heightis the ending height of the sync request
percent_doneis the sync progress, from 0 to 1
messageis a human-readable description of the progress

Enumeration Type Documentation

◆ monero_message_signature_type

Key that signs a message.

Values match monero-cpp's monero_message_signature_type.

Enumerator
MONERO_MESSAGE_SIGN_WITH_SPEND_KEY 
MONERO_MESSAGE_SIGN_WITH_VIEW_KEY 

◆ monero_tx_priority

Fee priority of a transaction.

Values match monero-cpp's monero_tx_priority.

Enumerator
MONERO_TX_PRIORITY_DEFAULT 
MONERO_TX_PRIORITY_UNIMPORTANT 
MONERO_TX_PRIORITY_NORMAL 
MONERO_TX_PRIORITY_ELEVATED 

Function Documentation

◆ monero_wallet_add_address_book_entry()

MONERO_EXPORT monero_result monero_wallet_add_address_book_entry ( monero_wallet *  wallet,
const char *  address,
const char *  description,
uint64_t *  out_index 
)

Add an address to the address book.

Parameters
walletis the wallet handle
addressis the address to add
descriptionis the description of the address. NULL or "" for none
out_indexreceives the index of the new entry
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_add_listener()

MONERO_EXPORT monero_result monero_wallet_add_listener ( monero_wallet *  wallet,
monero_wallet_listener *  listener 
)

Register a listener with a wallet.

Adding it again to the same wallet does nothing. A listener belongs to one wallet at a time, so adding it to another wallet fails until it is removed from the first one.

Parameters
walletis the wallet handle
listeneris the listener to register
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_change_password()

MONERO_EXPORT monero_result monero_wallet_change_password ( monero_wallet *  wallet,
const char *  old_password,
const char *  new_password 
)

Change the password of the wallet files.

Parameters
walletis the wallet handle
old_passwordis the current password
new_passwordis the new password
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_check_reserve_proof()

MONERO_EXPORT monero_result monero_wallet_check_reserve_proof ( monero_wallet *  wallet,
const char *  address,
const char *  message,
const char *  signature,
char **  out_json 
)

Check a reserve proof, the signature made by monero_wallet_get_reserve_proof_wallet() or monero_wallet_get_reserve_proof_account().

Parameters
walletis the wallet handle
addressis the address of the wallet
messageis the message included in the signature. NULL or "" for none
signatureis the signature to check
out_jsonreceives the JSON-serialized monero_check_reserve. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_check_spend_proof()

MONERO_EXPORT monero_result monero_wallet_check_spend_proof ( monero_wallet *  wallet,
const char *  tx_hash,
const char *  message,
const char *  signature,
bool *  out_good 
)

Check a spend proof, the signature made by monero_wallet_get_spend_proof().

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
messageis the message included in the signature. NULL or "" for none
signatureis the signature to check
out_goodreceives true if the signature is good
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_check_tx_key()

MONERO_EXPORT monero_result monero_wallet_check_tx_key ( monero_wallet *  wallet,
const char *  tx_hash,
const char *  tx_key,
const char *  address,
char **  out_json 
)

Check a transaction in the blockchain with its secret key.

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
tx_keyis the secret key of the transaction
addressis the destination address of the transaction
out_jsonreceives the JSON-serialized monero_check_tx. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_check_tx_proof()

MONERO_EXPORT monero_result monero_wallet_check_tx_proof ( monero_wallet *  wallet,
const char *  tx_hash,
const char *  address,
const char *  message,
const char *  signature,
char **  out_json 
)

Check a transaction proof, the signature made by monero_wallet_get_tx_proof().

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
addressis the destination address of the transaction
messageis the message included in the signature. NULL or "" for none
signatureis the signature to check
out_jsonreceives the JSON-serialized monero_check_tx. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_close()

MONERO_EXPORT monero_result monero_wallet_close ( monero_wallet *  wallet,
bool  save 
)

Close the wallet.

Its methods fail afterwards, but the handle must still be freed.

Parameters
walletis the wallet handle
savesaves the wallet to disk before closing it
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create()

MONERO_EXPORT monero_result monero_wallet_create ( const char *  config_json,
monero_wallet **  out_wallet 
)

Create a full wallet from a monero_wallet_config, which the other creation functions can't do: it can connect the wallet to a daemon when it is created, set the trust in the daemon, scan more accounts and subaddresses than the 50 and 200 of wallet2, and restore a multisig wallet.

The wallet is restored from its seed if the config has one, from its keys if it has the address or the private keys, and has a new random seed otherwise.

The fields of the JSON, all optional but networkType, and the ones that are null are ignored:

  • path: the wallet file, written with its .keys file. Without it the wallet stays in memory
  • password: encrypts the wallet files
  • networkType: a monero_utils_network_type. 3 is regtest
  • seed, seedOffset: the mnemonic to restore, and its offset
  • primaryAddress, privateViewKey, privateSpendKey: the keys to restore. The spend key can be left out for a view-only wallet
  • restoreHeight: the first block to scan, 0 by default
  • language: the seed language, English by default
  • server: the daemon, as the JSON of a monero_rpc_connection (uri, username, password, proxyUri, sslVerify)
  • isTrustedDaemon: unset trusts a daemon on a local address only
  • accountLookahead, subaddressLookahead: the accounts and the subaddresses of each that the wallet scans. Both or none
  • isMultisig: restores a multisig wallet, and the seed is then its multisig data in hex, which monero_wallet_get_seed() returns for a multisig wallet

A seed and keys together fail. So does a restore height with neither of them, since a random wallet starts from the current height, or from 0 on regtest, and it can't start from another.

Parameters
config_jsonis the JSON-serialized monero_wallet_config
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create_account()

MONERO_EXPORT monero_result monero_wallet_create_account ( monero_wallet *  wallet,
const char *  label,
char **  out_json 
)

Create an account, with the next account index.

Parameters
walletis the wallet handle
labelis the label of the account. NULL or "" for none
out_jsonreceives the JSON-serialized monero_account. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create_from_keys()

MONERO_EXPORT monero_result monero_wallet_create_from_keys ( const char *  path,
const char *  password,
int32_t  network_type,
const char *  address,
const char *  private_view_key,
const char *  private_spend_key,
uint64_t  restore_height,
const char *  language,
monero_wallet **  out_wallet 
)

Restore a wallet from its keys and save it to disk.

Without a private spend key the wallet is view-only.

Parameters
pathis the path of the wallet file
passwordencrypts the wallet files. NULL or "" for no password
network_typeis the monero_utils_network_type of the wallet
addressis the primary address
private_view_keyis the private view key, in hex
private_spend_keyis the private spend key, in hex. NULL or "" for a view-only wallet
restore_heightis the first block to scan. 0 scans from the genesis block
languageis the seed language. NULL for English
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create_from_seed()

MONERO_EXPORT monero_result monero_wallet_create_from_seed ( const char *  path,
const char *  password,
int32_t  network_type,
const char *  seed,
const char *  seed_offset,
uint64_t  restore_height,
const char *  language,
monero_wallet **  out_wallet 
)

Restore a wallet from its mnemonic seed and save it to disk.

Parameters
pathis the path of the wallet file
passwordencrypts the wallet files. NULL or "" for no password
network_typeis the monero_utils_network_type of the wallet
seedis the mnemonic seed, at most 4096 bytes
seed_offsetis the passphrase that extends the seed. NULL or "" for none
restore_heightis the first block to scan. 0 scans from the genesis block
languageis the seed language. NULL for English
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create_random()

MONERO_EXPORT monero_result monero_wallet_create_random ( const char *  path,
const char *  password,
int32_t  network_type,
const char *  language,
monero_wallet **  out_wallet 
)

Create a wallet with a new random seed and save it to disk.

The keys are written to path + ".keys". The wallet scans from an estimate of the current height, or from 0 on regtest.

Parameters
pathis the path of the wallet file
passwordencrypts the wallet files. NULL or "" for no password
network_typeis the monero_utils_network_type of the wallet
languageis the seed language. NULL for English
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create_subaddress()

MONERO_EXPORT monero_result monero_wallet_create_subaddress ( monero_wallet *  wallet,
uint32_t  account_idx,
const char *  label,
char **  out_json 
)

Create a subaddress in an account.

Parameters
walletis the wallet handle
account_idxis the index of the account
labelis the label of the subaddress. NULL or "" for none
out_jsonreceives the JSON-serialized monero_subaddress. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create_tx()

MONERO_EXPORT monero_result monero_wallet_create_tx ( monero_wallet *  wallet,
const char *  config_json,
char **  out_json 
)

Create a transaction that transfers funds from the wallet.

It is relayed only if the config says so.

Parameters
walletis the wallet handle
config_jsonis the JSON-serialized monero_tx_config
out_jsonreceives a JSON object with the tx set of the transaction, {"txSets":[...]}. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_create_txs()

MONERO_EXPORT monero_result monero_wallet_create_txs ( monero_wallet *  wallet,
const char *  config_json,
char **  out_json 
)

Create one or more transactions that transfer funds from the wallet.

A view-only wallet creates the unsigned hex that monero_wallet_sign_txs() takes, in the tx set.

Parameters
walletis the wallet handle
config_jsonis the JSON-serialized monero_tx_config
out_jsonreceives a JSON object with the tx set of the transactions, {"txSets":[...]}. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_decode_integrated_address()

MONERO_EXPORT monero_result monero_wallet_decode_integrated_address ( monero_wallet *  wallet,
const char *  integrated_address,
char **  out_json 
)

Decode an integrated address into its standard address and payment ID.

Parameters
walletis the wallet handle
integrated_addressis the integrated address
out_jsonreceives the JSON-serialized monero_integrated_address. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_delete_address_book_entry()

MONERO_EXPORT monero_result monero_wallet_delete_address_book_entry ( monero_wallet *  wallet,
uint64_t  index 
)

Delete an address book entry.

Parameters
walletis the wallet handle
indexis the index of the entry
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_describe_tx_set()

MONERO_EXPORT monero_result monero_wallet_describe_tx_set ( monero_wallet *  wallet,
const char *  tx_set_json,
char **  out_json 
)

Describe a transaction set with unsigned or multisig hex as structured transactions.

Only the hex of the set is read, so the output of monero_wallet_create_txs() can be passed as it is.

Parameters
walletis the wallet handle
tx_set_jsonis the JSON-serialized monero_tx_set, with its unsignedTxHex or multisigTxHex, or the tx sets with one set
out_jsonreceives a JSON object with the tx set of the structured transactions, {"txSets":[...]}. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_edit_address_book_entry()

MONERO_EXPORT monero_result monero_wallet_edit_address_book_entry ( monero_wallet *  wallet,
uint64_t  index,
const char *  address,
const char *  description 
)

Edit an address book entry.

A NULL address or description is left unchanged.

Parameters
walletis the wallet handle
indexis the index of the entry
addressis the new address, or NULL
descriptionis the new description, or NULL
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_exchange_multisig_keys()

MONERO_EXPORT monero_result monero_wallet_exchange_multisig_keys ( monero_wallet *  wallet,
const char *const *  multisig_hexes,
size_t  num_multisig_hexes,
const char *  password,
char **  out_json 
)

Exchange the multisig hex with the other participants.

Repeat it with the new multisig hex of each participant until the result has an address. A 2 of 3 wallet needs two exchanges after make.

Parameters
walletis the wallet handle
multisig_hexesare the multisig hex of each participant
num_multisig_hexesis the number of elements in multisig_hexes
passwordis the password of the wallet
out_jsonreceives the JSON-serialized monero_multisig_init_result. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_exists()

MONERO_EXPORT monero_result monero_wallet_exists ( const char *  path,
bool *  out_exists 
)

Check if a wallet exists at the given path.

It looks for the keys file, path + ".keys".

Parameters
pathis the path of the wallet file
out_existsreceives true if the wallet exists
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_export_key_images()

MONERO_EXPORT monero_result monero_wallet_export_key_images ( monero_wallet *  wallet,
bool  all,
char **  out_json 
)

Export the key images of the wallet.

Parameters
walletis the wallet handle
allis true to include the key images of the spent outputs
out_jsonreceives the JSON-serialized monero_key_image_export_result. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_export_multisig_hex()

MONERO_EXPORT monero_result monero_wallet_export_multisig_hex ( monero_wallet *  wallet,
char **  out_multisig_hex 
)

Export the multisig info of the wallet as hex, for the other participants.

Parameters
walletis the wallet handle
out_multisig_hexreceives the hex. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_export_outputs()

MONERO_EXPORT monero_result monero_wallet_export_outputs ( monero_wallet *  wallet,
bool  all,
char **  out_hex 
)

Export the outputs of the wallet.

Parameters
walletis the wallet handle
allis true to include the spent outputs
out_hexreceives the outputs in hex. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_free()

MONERO_EXPORT void monero_wallet_free ( monero_wallet *  wallet)

Release a wallet handle.

A wallet that is still open is closed without saving, so call monero_wallet_save() first to keep the changes.

Parameters
walletis the handle to release

◆ monero_wallet_freeze_output()

MONERO_EXPORT monero_result monero_wallet_freeze_output ( monero_wallet *  wallet,
const char *  key_image 
)

Freeze an output, so the wallet doesn't spend it.

Fails for an unknown key image.

Parameters
walletis the wallet handle
key_imageis the key image of the output, in hex
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_account()

MONERO_EXPORT monero_result monero_wallet_get_account ( monero_wallet *  wallet,
uint32_t  account_idx,
bool  include_subaddresses,
char **  out_json 
)

Get an account, with or without its subaddresses.

Parameters
walletis the wallet handle
account_idxis the account index
include_subaddressesis true to include the subaddresses of the account
out_jsonreceives the JSON-serialized monero_account. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_account_balance()

MONERO_EXPORT monero_result monero_wallet_get_account_balance ( monero_wallet *  wallet,
uint32_t  account_idx,
uint64_t *  out_balance 
)

Get the balance of an account, including funds that are still locked.

Keys-only wallets don't support it.

Parameters
walletis the wallet handle
account_idxis the account index
out_balancereceives the balance in atomic units
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_account_tags()

MONERO_EXPORT monero_result monero_wallet_get_account_tags ( monero_wallet *  wallet,
char **  out_json 
)

Get the account tags of the wallet.

Full wallets don't support it.

Parameters
walletis the wallet handle
out_jsonreceives a JSON array of monero_account_tag. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_account_unlocked_balance()

MONERO_EXPORT monero_result monero_wallet_get_account_unlocked_balance ( monero_wallet *  wallet,
uint32_t  account_idx,
uint64_t *  out_balance 
)

Get the unlocked balance of an account, the part that can be spent now.

Keys-only wallets don't support it.

Parameters
walletis the wallet handle
account_idxis the account index
out_balancereceives the unlocked balance in atomic units
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_accounts()

MONERO_EXPORT monero_result monero_wallet_get_accounts ( monero_wallet *  wallet,
bool  include_subaddresses,
char **  out_json 
)

Get the accounts of the wallet.

Parameters
walletis the wallet handle
include_subaddressesis true to include the subaddresses of each account
out_jsonreceives a JSON array of monero_account. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_address()

MONERO_EXPORT monero_result monero_wallet_get_address ( monero_wallet *  wallet,
uint32_t  account_idx,
uint32_t  subaddress_idx,
char **  out_address 
)

Get the address of an account and subaddress.

Account 0, subaddress 0 is the primary address.

Parameters
walletis the wallet handle
account_idxis the account index
subaddress_idxis the subaddress index within the account
out_addressreceives the address. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_address_book_entries()

MONERO_EXPORT monero_result monero_wallet_get_address_book_entries ( monero_wallet *  wallet,
const uint64_t *  indices,
size_t  num_indices,
char **  out_json 
)

Get the address book entries with the given indices.

With no indices, all of them are returned.

Parameters
walletis the wallet handle
indicesare the indices of the entries
num_indicesis the number of elements in indices
out_jsonreceives a JSON array of monero_address_book_entry. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_address_index()

MONERO_EXPORT monero_result monero_wallet_get_address_index ( monero_wallet *  wallet,
const char *  address,
char **  out_json 
)

Get the subaddress of an address.

Parameters
walletis the wallet handle
addressis the address
out_jsonreceives the JSON-serialized monero_subaddress. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_attribute()

MONERO_EXPORT monero_result monero_wallet_get_attribute ( monero_wallet *  wallet,
const char *  key,
bool *  out_found,
char **  out_value 
)

Get an attribute, a key and value that the wallet stores with its files.

Parameters
walletis the wallet handle
keyis the key of the attribute
out_foundreceives true if the attribute exists
out_valuereceives the value, or NULL if it doesn't exist. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_balance()

MONERO_EXPORT monero_result monero_wallet_get_balance ( monero_wallet *  wallet,
uint64_t *  out_balance 
)

Get the balance of the wallet, including funds that are still locked.

Parameters
walletis the wallet handle
out_balancereceives the balance in atomic units
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_daemon_connection()

MONERO_EXPORT monero_result monero_wallet_get_daemon_connection ( monero_wallet *  wallet,
char **  out_json 
)

Get the daemon connection of the wallet.

Parameters
walletis the wallet handle
out_jsonreceives the JSON-serialized monero_rpc_connection, or NULL if there is none. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_daemon_height()

MONERO_EXPORT monero_result monero_wallet_get_daemon_height ( monero_wallet *  wallet,
uint64_t *  out_height 
)

Get the height the daemon of the wallet is synced to.

Parameters
walletis the wallet handle
out_heightreceives the height
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_daemon_max_peer_height()

MONERO_EXPORT monero_result monero_wallet_get_daemon_max_peer_height ( monero_wallet *  wallet,
uint64_t *  out_height 
)

Get the maximum height of the peers the daemon of the wallet is connected to.

Parameters
walletis the wallet handle
out_heightreceives the height
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_default_fee_priority()

MONERO_EXPORT monero_result monero_wallet_get_default_fee_priority ( monero_wallet *  wallet,
monero_tx_priority *  out_priority 
)

Get the default priority of the fee of the transactions.

Parameters
walletis the wallet handle
out_priorityreceives the priority
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_height()

MONERO_EXPORT monero_result monero_wallet_get_height ( monero_wallet *  wallet,
uint64_t *  out_height 
)

Get the height of the blocks the wallet has synced to.

Parameters
walletis the wallet handle
out_heightreceives the height
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_height_by_date()

MONERO_EXPORT monero_result monero_wallet_get_height_by_date ( monero_wallet *  wallet,
uint16_t  year,
uint8_t  month,
uint8_t  day,
uint64_t *  out_height 
)

Get the approximate height of the blockchain at a date.

It is a conservative estimate for scanning.

Parameters
walletis the wallet handle
yearis the year
monthis the month, from 1 to 12
dayis the day, from 1 to 31
out_heightreceives the height
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_integrated_address()

MONERO_EXPORT monero_result monero_wallet_get_integrated_address ( monero_wallet *  wallet,
const char *  standard_address,
const char *  payment_id,
char **  out_json 
)

Get the integrated address of a standard address and a payment ID.

Parameters
walletis the wallet handle
standard_addressis the standard address. NULL or "" for the primary address
payment_idis the payment ID, in hex. NULL or "" for a random one
out_jsonreceives the JSON-serialized monero_integrated_address. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_multisig_info()

MONERO_EXPORT monero_result monero_wallet_get_multisig_info ( monero_wallet *  wallet,
char **  out_json 
)

Get the multisig info of the wallet.

Parameters
walletis the wallet handle
out_jsonreceives the JSON-serialized monero_multisig_info. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_network_type()

MONERO_EXPORT monero_result monero_wallet_get_network_type ( monero_wallet *  wallet,
monero_utils_network_type *  out_network_type 
)

Get the network of the wallet.

Parameters
walletis the wallet handle
out_network_typereceives the network
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_outputs()

MONERO_EXPORT monero_result monero_wallet_get_outputs ( monero_wallet *  wallet,
const char *  query_json,
char **  out_json 
)

Get the outputs of the wallet that it can spend.

Parameters
walletis the wallet handle
query_jsonis the JSON-serialized monero_output_query, which can hold the monero_tx_query of the transactions of the outputs in "txQuery". NULL for all outputs
out_jsonreceives a JSON object with the blocks of the monero_tx_wallet that have the outputs, and each monero_output_wallet is in its transaction. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_path()

MONERO_EXPORT monero_result monero_wallet_get_path ( monero_wallet *  wallet,
char **  out_path 
)

Get the path of the wallet file.

Parameters
walletis the wallet handle
out_pathreceives the path. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_payment_uri()

MONERO_EXPORT monero_result monero_wallet_get_payment_uri ( monero_wallet *  wallet,
const char *  config_json,
char **  out_uri 
)

Create a payment URI from a transaction config.

Parameters
walletis the wallet handle
config_jsonis the JSON-serialized monero_tx_config
out_urireceives the payment URI. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_primary_address()

MONERO_EXPORT monero_result monero_wallet_get_primary_address ( monero_wallet *  wallet,
char **  out_address 
)

Get the primary address of the wallet.

Parameters
walletis the wallet handle
out_addressreceives the address. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_private_spend_key()

MONERO_EXPORT monero_result monero_wallet_get_private_spend_key ( monero_wallet *  wallet,
char **  out_key 
)

Get the private spend key of the wallet, in hex.

Fails for a view-only wallet.

Parameters
walletis the wallet handle
out_keyreceives the key. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_private_view_key()

MONERO_EXPORT monero_result monero_wallet_get_private_view_key ( monero_wallet *  wallet,
char **  out_key 
)

Get the private view key of the wallet, in hex.

Parameters
walletis the wallet handle
out_keyreceives the key. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_public_spend_key()

MONERO_EXPORT monero_result monero_wallet_get_public_spend_key ( monero_wallet *  wallet,
char **  out_key 
)

Get the public spend key of the wallet, in hex.

Parameters
walletis the wallet handle
out_keyreceives the key. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_public_view_key()

MONERO_EXPORT monero_result monero_wallet_get_public_view_key ( monero_wallet *  wallet,
char **  out_key 
)

Get the public view key of the wallet, in hex.

Parameters
walletis the wallet handle
out_keyreceives the key. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_reserve_proof_account()

MONERO_EXPORT monero_result monero_wallet_get_reserve_proof_account ( monero_wallet *  wallet,
uint32_t  account_idx,
uint64_t  amount,
const char *  message,
char **  out_signature 
)

Get a signature that proves an amount available in an account.

Parameters
walletis the wallet handle
account_idxis the index of the account
amountis the minimum amount to prove, in atomic units
messageis a message to include in the signature. NULL or "" for none
out_signaturereceives the signature. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_reserve_proof_wallet()

MONERO_EXPORT monero_result monero_wallet_get_reserve_proof_wallet ( monero_wallet *  wallet,
const char *  message,
char **  out_signature 
)

Get a signature that proves the whole balance of the wallet.

Parameters
walletis the wallet handle
messageis a message to include in the signature. NULL or "" for none
out_signaturereceives the signature. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_restore_height()

MONERO_EXPORT monero_result monero_wallet_get_restore_height ( monero_wallet *  wallet,
uint64_t *  out_height 
)

Get the height from which the wallet scans the blocks.

Parameters
walletis the wallet handle
out_heightreceives the height
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_seed()

MONERO_EXPORT monero_result monero_wallet_get_seed ( monero_wallet *  wallet,
char **  out_seed 
)

Get the mnemonic seed of the wallet.

Fails for a view-only wallet.

Parameters
walletis the wallet handle
out_seedreceives the seed. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_seed_language()

MONERO_EXPORT monero_result monero_wallet_get_seed_language ( monero_wallet *  wallet,
char **  out_language 
)

Get the language of the mnemonic seed.

Parameters
walletis the wallet handle
out_languagereceives the language name. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_seed_languages()

MONERO_EXPORT monero_result monero_wallet_get_seed_languages ( char **  out_json)

Get the languages a mnemonic seed can be written in.

Parameters
out_jsonreceives a JSON array of language names. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_spend_proof()

MONERO_EXPORT monero_result monero_wallet_get_spend_proof ( monero_wallet *  wallet,
const char *  tx_hash,
const char *  message,
char **  out_signature 
)

Get a signature that proves a spend of a transaction.

It doesn't need the destination address.

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
messageis a message to include in the signature. NULL or "" for none
out_signaturereceives the signature. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_subaddress()

MONERO_EXPORT monero_result monero_wallet_get_subaddress ( monero_wallet *  wallet,
uint32_t  account_idx,
uint32_t  subaddress_idx,
char **  out_json 
)

Get a subaddress by its indices.

Full wallets don't support it.

Parameters
walletis the wallet handle
account_idxis the index of the account
subaddress_idxis the index of the subaddress within the account
out_jsonreceives the JSON-serialized monero_subaddress. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_subaddress_balance()

MONERO_EXPORT monero_result monero_wallet_get_subaddress_balance ( monero_wallet *  wallet,
uint32_t  account_idx,
uint32_t  subaddress_idx,
uint64_t *  out_balance 
)

Get the balance of a subaddress, including funds that are still locked.

Keys-only wallets don't support it.

Parameters
walletis the wallet handle
account_idxis the account index
subaddress_idxis the subaddress index within the account
out_balancereceives the balance in atomic units
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_subaddress_unlocked_balance()

MONERO_EXPORT monero_result monero_wallet_get_subaddress_unlocked_balance ( monero_wallet *  wallet,
uint32_t  account_idx,
uint32_t  subaddress_idx,
uint64_t *  out_balance 
)

Get the unlocked balance of a subaddress, the part that can be spent now.

Keys-only wallets don't support it.

Parameters
walletis the wallet handle
account_idxis the account index
subaddress_idxis the subaddress index within the account
out_balancereceives the unlocked balance in atomic units
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_subaddresses()

MONERO_EXPORT monero_result monero_wallet_get_subaddresses ( monero_wallet *  wallet,
uint32_t  account_idx,
const uint32_t *  subaddress_indices,
size_t  num_subaddress_indices,
char **  out_json 
)

Get the subaddresses of an account.

With no indices, a full wallet returns all of them. Keys-only wallets can't enumerate their subaddresses, so they need the indices.

Parameters
walletis the wallet handle
account_idxis the account index
subaddress_indicesare the subaddress indices, or NULL for all of them
num_subaddress_indicesis the number of elements in subaddress_indices, 0 for all of them
out_jsonreceives a JSON array of monero_subaddress. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_transfers()

MONERO_EXPORT monero_result monero_wallet_get_transfers ( monero_wallet *  wallet,
const char *  query_json,
char **  out_json 
)

Get the incoming and outgoing transfers of the wallet.

Parameters
walletis the wallet handle
query_jsonis the JSON-serialized monero_transfer_query, which can hold the monero_tx_query of the transactions of the transfers in "txQuery". NULL for all transfers
out_jsonreceives a JSON object with the blocks of the monero_tx_wallet that have the transfers, and each transfer is in its transaction as a monero_incoming_transfer or a monero_outgoing_transfer. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_tx_key()

MONERO_EXPORT monero_result monero_wallet_get_tx_key ( monero_wallet *  wallet,
const char *  tx_hash,
char **  out_key 
)

Get the secret key of a transaction from its hash.

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
out_keyreceives the secret key. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_tx_note()

MONERO_EXPORT monero_result monero_wallet_get_tx_note ( monero_wallet *  wallet,
const char *  tx_hash,
char **  out_note 
)

Get the note of a transaction.

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
out_notereceives the note. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_tx_notes()

MONERO_EXPORT monero_result monero_wallet_get_tx_notes ( monero_wallet *  wallet,
const char *const *  tx_hashes,
size_t  num_tx_hashes,
char **  out_json 
)

Get the notes of transactions.

Parameters
walletis the wallet handle
tx_hashesare the hashes of the transactions
num_tx_hashesis the number of elements in tx_hashes
out_jsonreceives a JSON array of notes. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_tx_proof()

MONERO_EXPORT monero_result monero_wallet_get_tx_proof ( monero_wallet *  wallet,
const char *  tx_hash,
const char *  address,
const char *  message,
char **  out_signature 
)

Get a signature that proves a transaction sent to an address.

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
addressis the destination address of the transaction
messageis a message to include in the signature. NULL or "" for none
out_signaturereceives the signature. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_txs()

MONERO_EXPORT monero_result monero_wallet_get_txs ( monero_wallet *  wallet,
const char *  query_json,
char **  out_json 
)

Get the transactions of the wallet.

Parameters
walletis the wallet handle
query_jsonis the JSON-serialized monero_tx_query. NULL for all transactions
out_jsonreceives a JSON object with the blocks of the monero_tx_wallet that match, with their transfers. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_unlocked_balance()

MONERO_EXPORT monero_result monero_wallet_get_unlocked_balance ( monero_wallet *  wallet,
uint64_t *  out_balance 
)

Get the unlocked balance of the wallet, the part that can be spent now.

Parameters
walletis the wallet handle
out_balancereceives the unlocked balance in atomic units
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_get_version()

MONERO_EXPORT monero_result monero_wallet_get_version ( monero_wallet *  wallet,
char **  out_json 
)

Get the version of the wallet library.

Parameters
walletis the wallet handle
out_jsonreceives the JSON-serialized monero_version. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_import_key_images()

MONERO_EXPORT monero_result monero_wallet_import_key_images ( monero_wallet *  wallet,
const char *  key_images_json,
uint64_t  offset,
char **  out_json 
)

Import key images into the wallet.

Parameters
walletis the wallet handle
key_images_jsonis a JSON array of monero_key_image
offsetis the index of the first key image among the wallet's outputs
out_jsonreceives the JSON-serialized monero_key_image_import_result. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_import_multisig_hex()

MONERO_EXPORT monero_result monero_wallet_import_multisig_hex ( monero_wallet *  wallet,
const char *const *  multisig_hexes,
size_t  num_multisig_hexes,
bool  refresh_after_import,
int32_t *  out_num_imported 
)

Import the multisig info of the other participants, as hex.

Parameters
walletis the wallet handle
multisig_hexesare the multisig hex of each participant
num_multisig_hexesis the number of elements in multisig_hexes
refresh_after_importis true to refresh the wallet after the import
out_num_importedreceives the number of imported outputs
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_import_outputs()

MONERO_EXPORT monero_result monero_wallet_import_outputs ( monero_wallet *  wallet,
const char *  outputs_hex,
int32_t *  out_num_imported 
)

Import outputs into the wallet.

Parameters
walletis the wallet handle
outputs_hexare the outputs, in hex
out_num_importedreceives the number of imported outputs
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_closed()

MONERO_EXPORT monero_result monero_wallet_is_closed ( monero_wallet *  wallet,
bool *  out_closed 
)

Check if the wallet is closed.

Parameters
walletis the wallet handle
out_closedreceives true if the wallet is closed
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_connected_to_daemon()

MONERO_EXPORT monero_result monero_wallet_is_connected_to_daemon ( monero_wallet *  wallet,
bool *  out_connected 
)

Check if the wallet is connected to a daemon.

Parameters
walletis the wallet handle
out_connectedreceives true if the wallet is connected
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_daemon_synced()

MONERO_EXPORT monero_result monero_wallet_is_daemon_synced ( monero_wallet *  wallet,
bool *  out_synced 
)

Check if the daemon of the wallet is synced with the network.

Parameters
walletis the wallet handle
out_syncedreceives true if the daemon is synced
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_daemon_trusted()

MONERO_EXPORT monero_result monero_wallet_is_daemon_trusted ( monero_wallet *  wallet,
bool *  out_trusted 
)

Check if the daemon is trusted.

Parameters
walletis the wallet handle
out_trustedreceives true if the daemon is trusted
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_multisig()

MONERO_EXPORT monero_result monero_wallet_is_multisig ( monero_wallet *  wallet,
bool *  out_multisig 
)

Check if the wallet is a multisig wallet.

Keys-only wallets don't support multisig, so this fails for them.

Parameters
walletis the wallet handle
out_multisigreceives true for a multisig wallet
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_multisig_import_needed()

MONERO_EXPORT monero_result monero_wallet_is_multisig_import_needed ( monero_wallet *  wallet,
bool *  out_needed 
)

Check if importing multisig data is needed for a correct balance.

Parameters
walletis the wallet handle
out_neededreceives true if the import is needed
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_output_frozen()

MONERO_EXPORT monero_result monero_wallet_is_output_frozen ( monero_wallet *  wallet,
const char *  key_image,
bool *  out_frozen 
)

Check if an output is frozen.

Fails for an unknown key image.

Parameters
walletis the wallet handle
key_imageis the key image of the output, in hex
out_frozenreceives true if the output is frozen
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_synced()

MONERO_EXPORT monero_result monero_wallet_is_synced ( monero_wallet *  wallet,
bool *  out_synced 
)

Check if the wallet is synced with the daemon.

Parameters
walletis the wallet handle
out_syncedreceives true if the wallet is synced
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_is_view_only()

MONERO_EXPORT monero_result monero_wallet_is_view_only ( monero_wallet *  wallet,
bool *  out_view_only 
)

Check if the wallet is view-only, which means it has no private spend key.

Parameters
walletis the wallet handle
out_view_onlyreceives true for a view-only wallet
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_keys_create_from_keys()

MONERO_EXPORT monero_result monero_wallet_keys_create_from_keys ( int32_t  network_type,
const char *  address,
const char *  private_view_key,
const char *  private_spend_key,
const char *  language,
monero_wallet **  out_wallet 
)

Restore a keys-only wallet from its keys.

Without a private spend key the wallet is view-only.

Parameters
network_typeis the monero_utils_network_type of the wallet
addressis the primary address
private_view_keyis the private view key, in hex
private_spend_keyis the private spend key, in hex. NULL or "" for a view-only wallet
languageis the seed language. NULL for English
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_keys_create_from_seed()

MONERO_EXPORT monero_result monero_wallet_keys_create_from_seed ( int32_t  network_type,
const char *  seed,
const char *  seed_offset,
const char *  language,
monero_wallet **  out_wallet 
)

Restore a keys-only wallet from its mnemonic seed.

Parameters
network_typeis the monero_utils_network_type of the wallet
seedis the mnemonic seed, at most 4096 bytes
seed_offsetis the passphrase that extends the seed. NULL or "" for none
languageis the seed language. NULL for English
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_keys_create_random()

MONERO_EXPORT monero_result monero_wallet_keys_create_random ( int32_t  network_type,
const char *  language,
monero_wallet **  out_wallet 
)

Create a keys-only wallet with a new random seed.

It has no files, so monero_wallet_save() and monero_wallet_close(wallet, true) fail on it. It also has no height, sync or transactions.

Parameters
network_typeis the monero_utils_network_type of the wallet
languageis the seed language. NULL for English
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_listener_create()

MONERO_EXPORT monero_result monero_wallet_listener_create ( const monero_wallet_listener_callbacks *  callbacks,
monero_wallet_listener **  out_listener 
)

Create a listener from its callbacks.

The callbacks are copied, and the listener is released with monero_wallet_listener_free().

Parameters
callbacksare the callbacks to call
out_listenerreceives the listener
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_listener_free()

MONERO_EXPORT void monero_wallet_listener_free ( monero_wallet_listener *  listener)

Release a listener.

If the listener is registered with a wallet, it is removed first.

Parameters
listeneris the listener to release

◆ monero_wallet_make_multisig()

MONERO_EXPORT monero_result monero_wallet_make_multisig ( monero_wallet *  wallet,
const char *const *  multisig_hexes,
size_t  num_multisig_hexes,
int32_t  threshold,
const char *  password,
char **  out_multisig_hex 
)

Make the wallet multisig from the multisig hex of the other participants.

Parameters
walletis the wallet handle
multisig_hexesare the multisig hex of each participant
num_multisig_hexesis the number of elements in multisig_hexes
thresholdis the number of signatures needed to sign a transfer
passwordis the password of the wallet
out_multisig_hexreceives the hex to share with the participants, if another round is needed. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_move_to()

MONERO_EXPORT monero_result monero_wallet_move_to ( monero_wallet *  wallet,
const char *  path,
const char *  password 
)

Move the wallet files to another path.

The wallet is saved there with the new password.

Parameters
walletis the wallet handle
pathis the new path of the wallet file
passwordis the new password of the wallet files
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_open()

MONERO_EXPORT monero_result monero_wallet_open ( const char *  path,
const char *  password,
int32_t  network_type,
monero_wallet **  out_wallet 
)

Open a wallet from its files on disk.

Parameters
pathis the path of the wallet file
passworddecrypts the wallet files. NULL or "" for no password
network_typeis the monero_utils_network_type of the wallet
out_walletreceives the handle, released with monero_wallet_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_parse_payment_uri()

MONERO_EXPORT monero_result monero_wallet_parse_payment_uri ( monero_wallet *  wallet,
const char *  uri,
char **  out_json 
)

Parse a payment URI into a transaction config.

Parameters
walletis the wallet handle
uriis the payment URI
out_jsonreceives the JSON-serialized monero_tx_config. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_prepare_multisig()

MONERO_EXPORT monero_result monero_wallet_prepare_multisig ( monero_wallet *  wallet,
char **  out_multisig_hex 
)

Get the multisig hex to share with the participants, to start making a multisig wallet.

Parameters
walletis the wallet handle
out_multisig_hexreceives the hex. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_relay_tx()

MONERO_EXPORT monero_result monero_wallet_relay_tx ( monero_wallet *  wallet,
const char *  tx_metadata,
char **  out_hash 
)

Relay a transaction that was created without relaying.

Parameters
walletis the wallet handle
tx_metadatais the metadata of the transaction
out_hashreceives the hash of the relayed transaction. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_relay_tx_json()

MONERO_EXPORT monero_result monero_wallet_relay_tx_json ( monero_wallet *  wallet,
const char *  tx_json,
char **  out_hash 
)

Relay a transaction created without relaying, from its JSON.

Only the metadata is used, so the output of monero_wallet_create_tx() can be passed as it is. A tx set, or the JSON of tx sets, works too if it holds one transaction.

Parameters
walletis the wallet handle
tx_jsonis the JSON-serialized monero_tx_wallet with its metadata, or the tx sets that hold it
out_hashreceives the hash of the relayed transaction. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_relay_txs()

MONERO_EXPORT monero_result monero_wallet_relay_txs ( monero_wallet *  wallet,
const char *const *  tx_metadatas,
size_t  num_tx_metadatas,
char **  out_json 
)

Relay transactions that were created without relaying.

Parameters
walletis the wallet handle
tx_metadatasare the metadata of the transactions
num_tx_metadatasis the number of elements in tx_metadatas
out_jsonreceives a JSON array of the hashes of the relayed transactions. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_relay_txs_json()

MONERO_EXPORT monero_result monero_wallet_relay_txs_json ( monero_wallet *  wallet,
const char *  txs_json,
char **  out_json 
)

Relay transactions created without relaying, from a JSON array.

Only their metadata is used. The JSON of tx sets, or one tx set, works too, and relays all the transactions in it.

Parameters
walletis the wallet handle
txs_jsonis a JSON array of monero_tx_wallet with their metadata, or the tx sets that hold them
out_jsonreceives a JSON array of the hashes of the relayed transactions. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_remove_listener()

MONERO_EXPORT monero_result monero_wallet_remove_listener ( monero_wallet *  wallet,
monero_wallet_listener *  listener 
)

Unregister a listener from a wallet.

Parameters
walletis the wallet handle
listeneris the listener to unregister
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_remove_listeners()

MONERO_EXPORT monero_result monero_wallet_remove_listeners ( monero_wallet *  wallet)

Unregister all the listeners of a wallet.

Parameters
walletis the wallet handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_request_shutdown()

MONERO_EXPORT monero_result monero_wallet_request_shutdown ( monero_wallet *  wallet)

Ask a full wallet to stop what it is doing, so that the calls that other threads have in flight on it return soon.

A request to the daemon is aborted and its call fails, and a sync stops after the batch of blocks that it is on. The calls that need the daemon fail from then on. It is the only function that may run while another thread is inside a call of the same wallet. Call monero_wallet_close() and monero_wallet_free() once those calls have returned, since they can't use a closed or freed wallet. A wallet that is already closed ignores it. Keys-only and RPC wallets have nothing to abort, so it fails for them.

Parameters
walletis the wallet handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rescan_blockchain()

MONERO_EXPORT monero_result monero_wallet_rescan_blockchain ( monero_wallet *  wallet)

Rescan the blockchain from scratch.

This discards local data that the blockchain can't restore, like destination addresses, tx keys and tx notes.

Parameters
walletis the wallet handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rescan_spent()

MONERO_EXPORT monero_result monero_wallet_rescan_spent ( monero_wallet *  wallet)

Rescan the blockchain for spent outputs.

It needs a trusted daemon.

Parameters
walletis the wallet handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_connect()

MONERO_EXPORT monero_result monero_wallet_rpc_connect ( monero_rpc_connection *  connection,
monero_wallet **  out_wallet 
)

Connect to a monero-wallet-rpc server through a shared connection, with its proxy, timeout and TLS settings.

No wallet is open until monero_wallet_rpc_open_wallet() or monero_wallet_rpc_create_wallet(). Free the handle with monero_wallet_free().

Parameters
connectionis the connection to the server. It can be freed after the call
out_walletreceives the handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_create_from_keys()

MONERO_EXPORT monero_result monero_wallet_rpc_create_from_keys ( const char *  uri,
const char *  username,
const char *  password,
const char *  name,
const char *  wallet_password,
const char *  address,
const char *  private_view_key,
const char *  private_spend_key,
uint64_t  restore_height,
const char *  language,
monero_wallet **  out_wallet 
)

Restore a wallet from its keys on a monero-wallet-rpc server.

Without a private spend key the wallet is view-only. Free the handle with monero_wallet_free().

Parameters
uriis the URI of the server
usernameis the username of the server. NULL or "" for none
passwordis the password of the server. NULL or "" for none
nameis the name of the new wallet on the server
wallet_passwordis the password of the wallet. NULL or "" for none
addressis the primary address
private_view_keyis the private view key, in hex
private_spend_keyis the private spend key, in hex. NULL or "" for a view-only wallet
restore_heightis the first block to scan. 0 scans from the genesis block
languageis the seed language. NULL for English
out_walletreceives the handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_create_from_seed()

MONERO_EXPORT monero_result monero_wallet_rpc_create_from_seed ( const char *  uri,
const char *  username,
const char *  password,
const char *  name,
const char *  wallet_password,
const char *  seed,
const char *  seed_offset,
uint64_t  restore_height,
const char *  language,
monero_wallet **  out_wallet 
)

Restore a wallet from its mnemonic seed on a monero-wallet-rpc server.

Free the handle with monero_wallet_free().

Parameters
uriis the URI of the server
usernameis the username of the server. NULL or "" for none
passwordis the password of the server. NULL or "" for none
nameis the name of the new wallet on the server
wallet_passwordis the password of the wallet. NULL or "" for none
seedis the mnemonic seed, at most 4096 bytes
seed_offsetis the passphrase that extends the seed. NULL or "" for none
restore_heightis the first block to scan. 0 scans from the genesis block
languageis the seed language. NULL for English
out_walletreceives the handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_create_random()

MONERO_EXPORT monero_result monero_wallet_rpc_create_random ( const char *  uri,
const char *  username,
const char *  password,
const char *  name,
const char *  wallet_password,
const char *  language,
monero_wallet **  out_wallet 
)

Create a random wallet on a monero-wallet-rpc server.

Free the handle with monero_wallet_free().

Parameters
uriis the URI of the server
usernameis the username of the server. NULL or "" for none
passwordis the password of the server. NULL or "" for none
nameis the name of the new wallet on the server
wallet_passwordis the password of the wallet. NULL or "" for none
languageis the seed language. NULL for English
out_walletreceives the handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_create_wallet()

MONERO_EXPORT monero_result monero_wallet_rpc_create_wallet ( monero_wallet *  wallet,
const char *  config_json 
)

Create a wallet on the server of an RPC wallet and open it.

A config with a seed restores the wallet from the seed, a config with keys restores it from the keys, and a config with neither creates a random wallet. The server has its own network, so the config has no network type.

Parameters
walletis the wallet handle of an RPC wallet
config_jsonis the JSON-serialized monero_wallet_config, with the wallet name in "path"
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_get_account()

MONERO_EXPORT monero_result monero_wallet_rpc_get_account ( monero_wallet *  wallet,
uint32_t  account_idx,
bool  include_subaddresses,
bool  skip_balances,
char **  out_json 
)

Get an account from the server, with or without its subaddresses and balances.

Parameters
walletis the wallet handle of an RPC wallet
account_idxis the account index
include_subaddressesis true to include the subaddresses of the account
skip_balancesis true to skip the balances, which is faster
out_jsonreceives the JSON-serialized monero_account. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_get_accounts()

MONERO_EXPORT monero_result monero_wallet_rpc_get_accounts ( monero_wallet *  wallet,
bool  include_subaddresses,
const char *  tag,
bool  skip_balances,
char **  out_json 
)

Get the accounts of the wallet from the server, optionally only those with a tag.

Parameters
walletis the wallet handle of an RPC wallet
include_subaddressesis true to include the subaddresses of each account
tagis the tag of the accounts. NULL or "" for all of them
skip_balancesis true to skip the balances, which is faster
out_jsonreceives a JSON array of monero_account. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_get_balances()

MONERO_EXPORT monero_result monero_wallet_rpc_get_balances ( monero_wallet *  wallet,
const uint32_t *  account_idx,
const uint32_t *  subaddress_idx,
char **  out_json 
)

Get the balances of an account or a subaddress, from the server.

Parameters
walletis the wallet handle of an RPC wallet
account_idxis the account index. NULL for none
subaddress_idxis the subaddress index within the account. NULL for none
out_jsonreceives the JSON-serialized monero_subaddress with the balances, or the string null if the server has none. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_get_connection()

MONERO_EXPORT monero_result monero_wallet_rpc_get_connection ( monero_wallet *  wallet,
char **  out_json 
)

Get the connection to the monero-wallet-rpc server.

Parameters
walletis the wallet handle of an RPC wallet
out_jsonreceives the JSON-serialized monero_rpc_connection. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_get_seed_languages()

MONERO_EXPORT monero_result monero_wallet_rpc_get_seed_languages ( monero_wallet *  wallet,
char **  out_json 
)

Get the seed languages that the monero-wallet-rpc server supports.

Parameters
walletis the wallet handle of an RPC wallet
out_jsonreceives a JSON array of language names. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_get_subaddresses()

MONERO_EXPORT monero_result monero_wallet_rpc_get_subaddresses ( monero_wallet *  wallet,
uint32_t  account_idx,
const uint32_t *  subaddress_indices,
size_t  num_subaddress_indices,
bool  skip_balances,
char **  out_json 
)

Get the subaddresses of an account from the server, with the given indices.

Parameters
walletis the wallet handle of an RPC wallet
account_idxis the account index
subaddress_indicesare the subaddress indices, or NULL for all of them
num_subaddress_indicesis the number of elements in subaddress_indices, 0 for all of them
skip_balancesis true to skip the balances, which is faster
out_jsonreceives a JSON array of monero_subaddress. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_open()

MONERO_EXPORT monero_result monero_wallet_rpc_open ( const char *  uri,
const char *  username,
const char *  password,
const char *  name,
const char *  wallet_password,
monero_wallet **  out_wallet 
)

Open a wallet on a monero-wallet-rpc server.

Free the handle with monero_wallet_free().

Parameters
uriis the URI of the server
usernameis the username of the server. NULL or "" for none
passwordis the password of the server. NULL or "" for none
nameis the name of the wallet on the server
wallet_passwordis the password of the wallet. NULL or "" for none
out_walletreceives the handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_open_wallet()

MONERO_EXPORT monero_result monero_wallet_rpc_open_wallet ( monero_wallet *  wallet,
const char *  name,
const char *  wallet_password 
)

Open a wallet on the server of an RPC wallet.

Parameters
walletis the wallet handle of an RPC wallet
nameis the name of the wallet on the server
wallet_passwordis the password of the wallet. NULL or "" for none
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_set_daemon_connection()

MONERO_EXPORT monero_result monero_wallet_rpc_set_daemon_connection ( monero_wallet *  wallet,
const char *  connection_json,
bool  is_trusted,
const char *  ssl_options_json 
)

Set the daemon connection of an RPC wallet, with the SSL options of the connection.

Parameters
walletis the wallet handle of an RPC wallet
connection_jsonis the JSON-serialized monero_rpc_connection of the daemon
is_trustedis true if the daemon is trusted
ssl_options_jsonis the JSON-serialized ssl_options. NULL or empty for none
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_set_poll_period()

MONERO_EXPORT monero_result monero_wallet_rpc_set_poll_period ( monero_wallet *  wallet,
uint64_t  period_ms 
)

Set how often the RPC wallet polls the server for changes.

Polling starts with the first call.

Parameters
walletis the wallet handle of an RPC wallet
period_msis the poll period in milliseconds, from 1 to 2147483647. A period of 0 would poll again at once, over and over
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_rpc_stop()

MONERO_EXPORT monero_result monero_wallet_rpc_stop ( monero_wallet *  wallet)

Save and close the wallet and stop the monero-wallet-rpc server.

Calls on the handle fail afterwards.

Parameters
walletis the wallet handle of an RPC wallet
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_save()

MONERO_EXPORT monero_result monero_wallet_save ( monero_wallet *  wallet)

Save the wallet to disk.

Parameters
walletis the wallet handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_scan_txs()

MONERO_EXPORT monero_result monero_wallet_scan_txs ( monero_wallet *  wallet,
const char *const *  tx_hashes,
size_t  num_tx_hashes 
)

Scan transactions by their hashes.

Parameters
walletis the wallet handle
tx_hashesare the hashes of the transactions
num_tx_hashesis the number of elements in tx_hashes
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_set_account_tag_label()

MONERO_EXPORT monero_result monero_wallet_set_account_tag_label ( monero_wallet *  wallet,
const char *  tag,
const char *  label 
)

Set the label of an account tag.

Full wallets don't support it.

Parameters
walletis the wallet handle
tagis the tag
labelis the new label
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_set_attribute()

MONERO_EXPORT monero_result monero_wallet_set_attribute ( monero_wallet *  wallet,
const char *  key,
const char *  value 
)

Set an attribute.

Parameters
walletis the wallet handle
keyis the key of the attribute
valueis the value of the attribute
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_set_daemon_connection()

MONERO_EXPORT monero_result monero_wallet_set_daemon_connection ( monero_wallet *  wallet,
const char *  uri,
const char *  username,
const char *  password,
const char *  proxy_uri,
const bool *  is_trusted,
bool  ssl_verify 
)

Set the daemon connection of the wallet.

Parameters
walletis the wallet handle
uriis the URI of the daemon
usernameis the username of the daemon. NULL or "" for none
passwordis the password of the daemon. NULL or "" for none
proxy_uriis the URI of a proxy. NULL or "" for none
is_trustedis true if the daemon is trusted and false if it is not. NULL trusts it only if its address is local
ssl_verifyis true to verify the daemon's TLS certificate and hostname
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_set_restore_height()

MONERO_EXPORT monero_result monero_wallet_set_restore_height ( monero_wallet *  wallet,
uint64_t  restore_height 
)

Set the height from which the wallet scans the blocks.

Parameters
walletis the wallet handle
restore_heightis the height
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_set_subaddress_label()

MONERO_EXPORT monero_result monero_wallet_set_subaddress_label ( monero_wallet *  wallet,
uint32_t  account_idx,
uint32_t  subaddress_idx,
const char *  label 
)

Set the label of a subaddress.

Parameters
walletis the wallet handle
account_idxis the index of the account
subaddress_idxis the index of the subaddress within the account
labelis the new label. NULL or "" to clear it
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_set_tx_note()

MONERO_EXPORT monero_result monero_wallet_set_tx_note ( monero_wallet *  wallet,
const char *  tx_hash,
const char *  note 
)

Set the note of a transaction.

Parameters
walletis the wallet handle
tx_hashis the hash of the transaction
noteis the note
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_set_tx_notes()

MONERO_EXPORT monero_result monero_wallet_set_tx_notes ( monero_wallet *  wallet,
const char *const *  tx_hashes,
const char *const *  notes,
size_t  num_tx_hashes 
)

Set the notes of transactions.

Each note goes with the hash at the same position.

Parameters
walletis the wallet handle
tx_hashesare the hashes of the transactions
notesare the notes
num_tx_hashesis the number of elements in tx_hashes and notes
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_sign_message()

MONERO_EXPORT monero_result monero_wallet_sign_message ( monero_wallet *  wallet,
const char *  message,
int32_t  signature_type,
uint32_t  account_idx,
uint32_t  subaddress_idx,
char **  out_signature 
)

Sign a message with the spend key or the view key of an account and subaddress.

Parameters
walletis the wallet handle
messageis the message to sign
signature_typeis the monero_message_signature_type, the key that signs the message
account_idxis the account index
subaddress_idxis the subaddress index within the account
out_signaturereceives the signature. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_sign_multisig_tx_hex()

MONERO_EXPORT monero_result monero_wallet_sign_multisig_tx_hex ( monero_wallet *  wallet,
const char *  multisig_tx_hex,
char **  out_json 
)

Sign multisig transactions, given as the hex shared when they were created.

Parameters
walletis the wallet handle
multisig_tx_hexis the multisig transaction hex
out_jsonreceives the JSON-serialized monero_multisig_sign_result. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_sign_txs()

MONERO_EXPORT monero_result monero_wallet_sign_txs ( monero_wallet *  wallet,
const char *  unsigned_tx_hex,
char **  out_json 
)

Sign unsigned transactions of a view-only wallet with the full wallet that created them.

Parameters
walletis the wallet handle
unsigned_tx_hexis the unsigned transaction hex, from when the transactions were created
out_jsonreceives a JSON object with the tx set of the signed transactions, {"txSets":[...]}. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_start_mining()

MONERO_EXPORT monero_result monero_wallet_start_mining ( monero_wallet *  wallet,
const uint64_t *  num_threads,
const bool *  background_mining,
const bool *  ignore_battery 
)

Start mining on the daemon.

It needs a trusted daemon.

Parameters
walletis the wallet handle
num_threadsis the number of mining threads. NULL for one thread
background_miningis true to mine in the background. NULL for false
ignore_batteryis true to mine on battery power. NULL for false
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_start_syncing()

MONERO_EXPORT monero_result monero_wallet_start_syncing ( monero_wallet *  wallet,
uint64_t  sync_period_ms 
)

Start a background thread that syncs the wallet with the daemon.

Stop it with monero_wallet_stop_syncing().

Parameters
walletis the wallet handle
sync_period_msis the maximum time between two syncs in milliseconds, from 1 to 2147483647. A period of 0 would sync again at once, over and over
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_stop_mining()

MONERO_EXPORT monero_result monero_wallet_stop_mining ( monero_wallet *  wallet)

Stop mining on the daemon.

Parameters
walletis the wallet handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_stop_syncing()

MONERO_EXPORT monero_result monero_wallet_stop_syncing ( monero_wallet *  wallet)

Stop the background thread that syncs the wallet.

Parameters
walletis the wallet handle
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_submit_multisig_tx_hex()

MONERO_EXPORT monero_result monero_wallet_submit_multisig_tx_hex ( monero_wallet *  wallet,
const char *  signed_multisig_tx_hex,
char **  out_json 
)

Submit signed multisig transactions, given as hex.

Parameters
walletis the wallet handle
signed_multisig_tx_hexis the signed multisig transaction hex, from monero_wallet_sign_multisig_tx_hex()
out_jsonreceives a JSON array of the hashes of the submitted transactions. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_submit_txs()

MONERO_EXPORT monero_result monero_wallet_submit_txs ( monero_wallet *  wallet,
const char *  signed_tx_hex,
char **  out_json 
)

Submit signed transactions of a view-only wallet.

Parameters
walletis the wallet handle
signed_tx_hexis the signed transaction hex, from monero_wallet_sign_txs()
out_jsonreceives a JSON array of the hashes of the submitted transactions. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_sweep_dust()

MONERO_EXPORT monero_result monero_wallet_sweep_dust ( monero_wallet *  wallet,
bool  relay,
char **  out_json 
)

Sweep the unmixable dust outputs back to the wallet, so they are easier to spend and mix.

Parameters
walletis the wallet handle
relayis true to relay the transactions
out_jsonreceives a JSON object with the tx sets of the transactions, {"txSets":[...]}, none if there is no dust. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_sweep_output()

MONERO_EXPORT monero_result monero_wallet_sweep_output ( monero_wallet *  wallet,
const char *  config_json,
char **  out_json 
)

Sweep an output with a given key image into the wallet.

Parameters
walletis the wallet handle
config_jsonis the JSON-serialized monero_tx_config of the sweep
out_jsonreceives a JSON object with the tx set of the transaction, {"txSets":[...]}. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_sweep_unlocked()

MONERO_EXPORT monero_result monero_wallet_sweep_unlocked ( monero_wallet *  wallet,
const char *  config_json,
char **  out_json 
)

Sweep the unlocked funds of the wallet.

Parameters
walletis the wallet handle
config_jsonis the JSON-serialized monero_tx_config of the sweep
out_jsonreceives a JSON object with the tx sets of the transactions, {"txSets":[...]}. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_sync()

MONERO_EXPORT monero_result monero_wallet_sync ( monero_wallet *  wallet,
const uint64_t *  start_height,
monero_wallet_listener *  listener,
char **  out_json 
)

Synchronize the wallet with the daemon in the calling thread.

Parameters
walletis the wallet handle
start_heightis the height to sync from, ignored if it is less than the last processed block. NULL for none
listenerreceives the notifications of this sync. NULL for none. Free it after the call returns
out_jsonreceives the JSON-serialized monero_sync_result. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_tag_accounts()

MONERO_EXPORT monero_result monero_wallet_tag_accounts ( monero_wallet *  wallet,
const char *  tag,
const uint32_t *  account_indices,
size_t  num_account_indices 
)

Tag accounts with a tag.

Full wallets don't support it.

Parameters
walletis the wallet handle
tagis the tag
account_indicesare the indices of the accounts
num_account_indicesis the number of elements in account_indices
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_thaw_output()

MONERO_EXPORT monero_result monero_wallet_thaw_output ( monero_wallet *  wallet,
const char *  key_image 
)

Thaw a frozen output.

Fails for an unknown key image.

Parameters
walletis the wallet handle
key_imageis the key image of the output, in hex
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_untag_accounts()

MONERO_EXPORT monero_result monero_wallet_untag_accounts ( monero_wallet *  wallet,
const uint32_t *  account_indices,
size_t  num_account_indices 
)

Remove the tags of accounts.

Full wallets don't support it.

Parameters
walletis the wallet handle
account_indicesare the indices of the accounts
num_account_indicesis the number of elements in account_indices
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_verify_message()

MONERO_EXPORT monero_result monero_wallet_verify_message ( monero_wallet *  wallet,
const char *  message,
const char *  address,
const char *  signature,
char **  out_json 
)

Verify a signature made by monero_wallet_sign_message() for an address.

A signature that doesn't match is not an error. The result has isGood set to false.

Parameters
walletis the wallet handle
messageis the signed message
addressis the address that signed the message
signatureis the signature
out_jsonreceives the JSON-serialized monero_message_signature_result. Free with monero_utils_free()
Returns
MONERO_OK or MONERO_ERROR

◆ monero_wallet_wait_for_next_block()

MONERO_EXPORT monero_result monero_wallet_wait_for_next_block ( monero_wallet *  wallet,
uint64_t *  out_height 
)

Wait until the next block is added to the chain.

It blocks until a block arrives, and the wallet must be syncing in the background with monero_wallet_start_syncing(), or it never returns. Neither monero_wallet_stop_syncing() nor monero_wallet_close() wakes it, so call it from a thread that the application can leave behind, or use a listener instead.

Parameters
walletis the wallet handle
out_heightreceives the height of the new block
Returns
MONERO_OK or MONERO_ERROR