monero-c
C ABI for using Monero
Loading...
Searching...
No Matches
monero_c_wallet.h
Go to the documentation of this file.
1
23#ifndef MONERO_C_WALLET_H
24#define MONERO_C_WALLET_H
25
28
29#include <stdbool.h>
30#include <stddef.h>
31#include <stdint.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37// ------------------------------- WALLET ------------------------------------
38// wraps the monero_wallet methods of the same name. A JSON argument can't nest deeper than 64
39// levels. On error the call returns MONERO_ERROR, monero_last_error() gives the message, string
40// outputs are NULL and scalar outputs are unchanged
41
57
67
78typedef 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);
79
86typedef void (*monero_wallet_on_new_block_fn)(void* user_data, uint64_t height);
87
95typedef void (*monero_wallet_on_balances_changed_fn)(void* user_data, uint64_t new_balance, uint64_t new_unlocked_balance);
96
106typedef void (*monero_wallet_on_output_received_fn)(void* user_data, const char* output_json);
107
117typedef void (*monero_wallet_on_output_spent_fn)(void* user_data, const char* output_json);
118
131
143MONERO_EXPORT monero_result monero_wallet_create_random(const char* path, const char* password, int32_t network_type, const char* language, monero_wallet** out_wallet);
144
158MONERO_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);
159
175MONERO_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);
176
204MONERO_EXPORT monero_result monero_wallet_create(const char* config_json, monero_wallet** out_wallet);
205
215MONERO_EXPORT monero_result monero_wallet_open(const char* path, const char* password, int32_t network_type, monero_wallet** out_wallet);
216
224MONERO_EXPORT monero_result monero_wallet_exists(const char* path, bool* out_exists);
225
233
243MONERO_EXPORT monero_result monero_wallet_keys_create_random(int32_t network_type, const char* language, monero_wallet** out_wallet);
244
255MONERO_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);
256
268MONERO_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);
269
277
286
298
306
315
324
334
343
352
361
370
379
388
397
406
416MONERO_EXPORT monero_result monero_wallet_get_account_balance(monero_wallet* wallet, uint32_t account_idx, uint64_t* out_balance);
417
428MONERO_EXPORT monero_result monero_wallet_get_subaddress_balance(monero_wallet* wallet, uint32_t account_idx, uint32_t subaddress_idx, uint64_t* out_balance);
429
439MONERO_EXPORT monero_result monero_wallet_get_account_unlocked_balance(monero_wallet* wallet, uint32_t account_idx, uint64_t* out_balance);
440
451MONERO_EXPORT monero_result monero_wallet_get_subaddress_unlocked_balance(monero_wallet* wallet, uint32_t account_idx, uint32_t subaddress_idx, uint64_t* out_balance);
452
460
470MONERO_EXPORT monero_result monero_wallet_get_address(monero_wallet* wallet, uint32_t account_idx, uint32_t subaddress_idx, char** out_address);
471
481MONERO_EXPORT monero_result monero_wallet_get_integrated_address(monero_wallet* wallet, const char* standard_address, const char* payment_id, char** out_json);
482
491MONERO_EXPORT monero_result monero_wallet_decode_integrated_address(monero_wallet* wallet, const char* integrated_address, char** out_json);
492
502MONERO_EXPORT monero_result monero_wallet_get_account(monero_wallet* wallet, uint32_t account_idx, bool include_subaddresses, char** out_json);
503
515MONERO_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);
516
528MONERO_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);
529
541MONERO_EXPORT monero_result monero_wallet_verify_message(monero_wallet* wallet, const char* message, const char* address, const char* signature, char** out_json);
542
552
562MONERO_EXPORT monero_result monero_wallet_add_address_book_entry(monero_wallet* wallet, const char* address, const char* description, uint64_t* out_index);
563
573MONERO_EXPORT monero_result monero_wallet_edit_address_book_entry(monero_wallet* wallet, uint64_t index, const char* address, const char* description);
574
583
593MONERO_EXPORT monero_result monero_wallet_get_address_book_entries(monero_wallet* wallet, const uint64_t* indices, size_t num_indices, char** out_json);
594
603MONERO_EXPORT monero_result monero_wallet_change_password(monero_wallet* wallet, const char* old_password, const char* new_password);
604
613MONERO_EXPORT monero_result monero_wallet_create_account(monero_wallet* wallet, const char* label, char** out_json);
614
624MONERO_EXPORT monero_result monero_wallet_create_subaddress(monero_wallet* wallet, uint32_t account_idx, const char* label, char** out_json);
625
634MONERO_EXPORT monero_result monero_wallet_get_accounts(monero_wallet* wallet, bool include_subaddresses, char** out_json);
635
644MONERO_EXPORT monero_result monero_wallet_get_address_index(monero_wallet* wallet, const char* address, char** out_json);
645
655MONERO_EXPORT monero_result monero_wallet_get_subaddress(monero_wallet* wallet, uint32_t account_idx, uint32_t subaddress_idx, char** out_json);
656
666MONERO_EXPORT monero_result monero_wallet_set_subaddress_label(monero_wallet* wallet, uint32_t account_idx, uint32_t subaddress_idx, const char* label);
667
677
686
696MONERO_EXPORT monero_result monero_wallet_tag_accounts(monero_wallet* wallet, const char* tag, const uint32_t* account_indices, size_t num_account_indices);
697
706MONERO_EXPORT monero_result monero_wallet_untag_accounts(monero_wallet* wallet, const uint32_t* account_indices, size_t num_account_indices);
707
717MONERO_EXPORT monero_result monero_wallet_get_attribute(monero_wallet* wallet, const char* key, bool* out_found, char** out_value);
718
727MONERO_EXPORT monero_result monero_wallet_set_attribute(monero_wallet* wallet, const char* key, const char* value);
728
737
746
755
764
773
782
791
800
810
820MONERO_EXPORT monero_result monero_wallet_import_key_images(monero_wallet* wallet, const char* key_images_json, uint64_t offset, char** out_json);
821
831
840MONERO_EXPORT monero_result monero_wallet_import_outputs(monero_wallet* wallet, const char* outputs_hex, int32_t* out_num_imported);
841
850
859
868MONERO_EXPORT monero_result monero_wallet_is_output_frozen(monero_wallet* wallet, const char* key_image, bool* out_frozen);
869
878MONERO_EXPORT monero_result monero_wallet_get_tx_note(monero_wallet* wallet, const char* tx_hash, char** out_note);
879
888MONERO_EXPORT monero_result monero_wallet_set_tx_note(monero_wallet* wallet, const char* tx_hash, const char* note);
889
899MONERO_EXPORT monero_result monero_wallet_get_tx_notes(monero_wallet* wallet, const char* const* tx_hashes, size_t num_tx_hashes, char** out_json);
900
910MONERO_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);
911
924MONERO_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);
925
934
943
953
960
971
980
988
989// ------------------------------- DAEMON ------------------------------------
990// these methods need a daemon connection, see monero_wallet_set_daemon_connection()
991
1001MONERO_EXPORT monero_result monero_wallet_sync(monero_wallet* wallet, const uint64_t* start_height, monero_wallet_listener* listener, char** out_json);
1002
1011
1019
1028
1037
1046
1055
1064
1076
1085MONERO_EXPORT monero_result monero_wallet_scan_txs(monero_wallet* wallet, const char* const* tx_hashes, size_t num_tx_hashes);
1086
1095
1103
1114MONERO_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);
1115
1125MONERO_EXPORT monero_result monero_wallet_start_mining(monero_wallet* wallet, const uint64_t* num_threads, const bool* background_mining, const bool* ignore_battery);
1126
1134
1135// ---------------------------- TRANSACTIONS ---------------------------------
1136// the JSON of a query or a config has the same fields as the monero-cpp model it describes
1137// NULL as a query means every item
1138//
1139// monero_wallet_get_txs(), monero_wallet_get_transfers() and monero_wallet_get_outputs() return their results in blocks, as
1140// {"blocks":[...]}, so that each result has its context. A block has its height and its timestamp, or neither if it holds the
1141// transactions that aren't in a block yet, in the pool or not relayed, which are all in one block. A block has the transactions
1142// of the result in its "txs", and a transaction has the transfers or the outputs of the result in "incomingTransfers",
1143// "outgoingTransfer" and "outputs". A query with no match gives {"blocks":[]}. The transactions come in the order of the blocks, so
1144// a query by hashes doesn't get them back in the order of its hashes, and the caller sorts them
1145//
1146// the calls that make transactions (monero_wallet_create_tx(), monero_wallet_create_txs(), monero_wallet_sweep_output(),
1147// monero_wallet_sweep_unlocked(), monero_wallet_sweep_dust()) and the ones that sign or describe them (monero_wallet_sign_txs(),
1148// monero_wallet_describe_tx_set()) return their transactions in tx sets, as {"txSets":[...]}. A tx set has its "txs" and the hex
1149// that signs or relays them: "unsignedTxHex" for a view-only wallet, "signedTxHex" and "multisigTxHex" where they apply. What
1150// they return can be passed as it is to monero_wallet_relay_tx_json(), monero_wallet_relay_txs_json() and
1151// monero_wallet_describe_tx_set(), which find the transactions and the set in it
1152
1161MONERO_EXPORT monero_result monero_wallet_get_txs(monero_wallet* wallet, const char* query_json, char** out_json);
1162
1171MONERO_EXPORT monero_result monero_wallet_get_transfers(monero_wallet* wallet, const char* query_json, char** out_json);
1172
1181MONERO_EXPORT monero_result monero_wallet_get_outputs(monero_wallet* wallet, const char* query_json, char** out_json);
1182
1191MONERO_EXPORT monero_result monero_wallet_create_tx(monero_wallet* wallet, const char* config_json, char** out_json);
1192
1202MONERO_EXPORT monero_result monero_wallet_create_txs(monero_wallet* wallet, const char* config_json, char** out_json);
1203
1212MONERO_EXPORT monero_result monero_wallet_relay_tx(monero_wallet* wallet, const char* tx_metadata, char** out_hash);
1213
1223MONERO_EXPORT monero_result monero_wallet_relay_tx_json(monero_wallet* wallet, const char* tx_json, char** out_hash);
1224
1234MONERO_EXPORT monero_result monero_wallet_relay_txs(monero_wallet* wallet, const char* const* tx_metadatas, size_t num_tx_metadatas, char** out_json);
1235
1245MONERO_EXPORT monero_result monero_wallet_relay_txs_json(monero_wallet* wallet, const char* txs_json, char** out_json);
1246
1255MONERO_EXPORT monero_result monero_wallet_submit_txs(monero_wallet* wallet, const char* signed_tx_hex, char** out_json);
1256
1265MONERO_EXPORT monero_result monero_wallet_sign_txs(monero_wallet* wallet, const char* unsigned_tx_hex, char** out_json);
1266
1276MONERO_EXPORT monero_result monero_wallet_describe_tx_set(monero_wallet* wallet, const char* tx_set_json, char** out_json);
1277
1286MONERO_EXPORT monero_result monero_wallet_sweep_output(monero_wallet* wallet, const char* config_json, char** out_json);
1287
1297
1306MONERO_EXPORT monero_result monero_wallet_sweep_unlocked(monero_wallet* wallet, const char* config_json, char** out_json);
1307
1316MONERO_EXPORT monero_result monero_wallet_move_to(monero_wallet* wallet, const char* path, const char* password);
1317
1326MONERO_EXPORT monero_result monero_wallet_get_payment_uri(monero_wallet* wallet, const char* config_json, char** out_uri);
1327
1337
1346MONERO_EXPORT monero_result monero_wallet_get_tx_key(monero_wallet* wallet, const char* tx_hash, char** out_key);
1347
1358MONERO_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);
1359
1370MONERO_EXPORT monero_result monero_wallet_get_tx_proof(monero_wallet* wallet, const char* tx_hash, const char* address, const char* message, char** out_signature);
1371
1383MONERO_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);
1384
1394MONERO_EXPORT monero_result monero_wallet_get_spend_proof(monero_wallet* wallet, const char* tx_hash, const char* message, char** out_signature);
1395
1406MONERO_EXPORT monero_result monero_wallet_check_spend_proof(monero_wallet* wallet, const char* tx_hash, const char* message, const char* signature, bool* out_good);
1407
1416MONERO_EXPORT monero_result monero_wallet_get_reserve_proof_wallet(monero_wallet* wallet, const char* message, char** out_signature);
1417
1428MONERO_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);
1429
1440MONERO_EXPORT monero_result monero_wallet_check_reserve_proof(monero_wallet* wallet, const char* address, const char* message, const char* signature, char** out_json);
1441
1442// ------------------------------- MULTISIG ----------------------------------
1443// the multisig hex is shared between the participants, in the order they were made
1444
1453
1462
1471
1483MONERO_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);
1484
1496MONERO_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);
1497
1506
1517MONERO_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);
1518
1527MONERO_EXPORT monero_result monero_wallet_sign_multisig_tx_hex(monero_wallet* wallet, const char* multisig_tx_hex, char** out_json);
1528
1537MONERO_EXPORT monero_result monero_wallet_submit_multisig_tx_hex(monero_wallet* wallet, const char* signed_multisig_tx_hex, char** out_json);
1538
1539// -------------------------------- RPC WALLETS --------------------------------
1540// a wallet on a monero-wallet-rpc server. It has the same handle as the other wallets, so the
1541// methods above work on it. The functions below need an RPC wallet and fail for the others
1542
1553
1562MONERO_EXPORT monero_result monero_wallet_rpc_open_wallet(monero_wallet* wallet, const char* name, const char* wallet_password);
1563
1574
1586MONERO_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);
1587
1600MONERO_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);
1601
1617MONERO_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);
1618
1636MONERO_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);
1637
1645
1654
1663
1672
1682MONERO_EXPORT monero_result monero_wallet_rpc_get_balances(monero_wallet* wallet, const uint32_t* account_idx, const uint32_t* subaddress_idx, char** out_json);
1683
1694MONERO_EXPORT monero_result monero_wallet_rpc_get_account(monero_wallet* wallet, uint32_t account_idx, bool include_subaddresses, bool skip_balances, char** out_json);
1695
1706MONERO_EXPORT monero_result monero_wallet_rpc_get_accounts(monero_wallet* wallet, bool include_subaddresses, const char* tag, bool skip_balances, char** out_json);
1707
1719MONERO_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);
1720
1730MONERO_EXPORT monero_result monero_wallet_rpc_set_daemon_connection(monero_wallet* wallet, const char* connection_json, bool is_trusted, const char* ssl_options_json);
1731
1732#ifdef __cplusplus
1733}
1734#endif
1735
1736#endif // MONERO_C_WALLET_H
struct monero_rpc_connection monero_rpc_connection
Copyright (c) Libmonero.
Definition monero_c_rpc_connection.h:50
monero_result
Definition monero_c_utils.h:81
#define MONERO_EXPORT
Copyright (c) Libmonero.
Definition monero_c_utils.h:69
monero_utils_network_type
Definition monero_c_utils.h:90
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_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_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 void monero_wallet_listener_free(monero_wallet_listener *listener)
Release a listener.
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 monero_result monero_wallet_is_closed(monero_wallet *wallet, bool *out_closed)
Check if the wallet is closed.
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.
struct monero_wallet_listener monero_wallet_listener
Opaque listener that receives the wallet's notifications.
Definition monero_c_wallet.h:66
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.
Definition monero_c_wallet.h:95
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_rpc_get_connection(monero_wallet *wallet, char **out_json)
Get the connection to the monero-wallet-rpc server.
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_seed(monero_wallet *wallet, char **out_seed)
Get the mnemonic seed 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_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.
void(* monero_wallet_on_output_spent_fn)(void *user_data, const char *output_json)
Called when the wallet spends an output.
Definition monero_c_wallet.h:117
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_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_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_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_rescan_blockchain(monero_wallet *wallet)
Rescan the blockchain from scratch.
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_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_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_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_remove_listeners(monero_wallet *wallet)
Unregister all the listeners of a wallet.
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_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_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_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_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_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_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_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_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.
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_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_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_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_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_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 void monero_wallet_free(monero_wallet *wallet)
Release a wallet handle.
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_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_stop_syncing(monero_wallet *wallet)
Stop the background thread that syncs 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...
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_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_get_version(monero_wallet *wallet, char **out_json)
Get the version of the wallet library.
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_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_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_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_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_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_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_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_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_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_get_primary_address(monero_wallet *wallet, char **out_address)
Get the primary address of the 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_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_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_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_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_tx_priority
Fee priority of a transaction.
Definition monero_c_wallet.h:546
@ MONERO_TX_PRIORITY_NORMAL
Definition monero_c_wallet.h:549
@ MONERO_TX_PRIORITY_DEFAULT
Definition monero_c_wallet.h:547
@ MONERO_TX_PRIORITY_ELEVATED
Definition monero_c_wallet.h:550
@ MONERO_TX_PRIORITY_UNIMPORTANT
Definition monero_c_wallet.h:548
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_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_is_daemon_trusted(monero_wallet *wallet, bool *out_trusted)
Check if the daemon is trusted.
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_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_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_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_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_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_rpc_stop(monero_wallet *wallet)
Save and close the wallet and stop the monero-wallet-rpc server.
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_get_txs(monero_wallet *wallet, const char *query_json, char **out_json)
Get the transactions of the wallet.
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_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_walle...
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_export_key_images(monero_wallet *wallet, bool all, char **out_json)
Export the key images of the wallet.
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_get_seed_languages(char **out_json)
Get the languages a mnemonic seed can be written in.
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_rescan_spent(monero_wallet *wallet)
Rescan the blockchain for spent 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.
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_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_close(monero_wallet *wallet, bool save)
Close the wallet.
struct monero_wallet monero_wallet
Copyright (c) Libmonero.
Definition monero_c_wallet.h:56
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_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_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_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_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_attribute(monero_wallet *wallet, const char *key, const char *value)
Set an attribute.
MONERO_EXPORT monero_result monero_wallet_export_outputs(monero_wallet *wallet, bool all, char **out_hex)
Export the outputs of the wallet.
void(* monero_wallet_on_output_received_fn)(void *user_data, const char *output_json)
Called when the wallet receives an output.
Definition monero_c_wallet.h:106
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_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_exists(const char *path, bool *out_exists)
Check if a wallet exists at the given path.
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_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_save(monero_wallet *wallet)
Save the wallet to disk.
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_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_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_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_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_get_daemon_connection(monero_wallet *wallet, char **out_json)
Get the daemon connection of the wallet.
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_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_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_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_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_get_network_type(monero_wallet *wallet, monero_utils_network_type *out_network_type)
Get the network of the wallet.
void(* monero_wallet_on_new_block_fn)(void *user_data, uint64_t height)
Called when a new block is processed.
Definition monero_c_wallet.h:86
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,...
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_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_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_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_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_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_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_remove_listener(monero_wallet *wallet, monero_wallet_listener *listener)
Unregister a listener from a wallet.
monero_message_signature_type
Key that signs a message.
Definition monero_c_wallet.h:456
@ MONERO_MESSAGE_SIGN_WITH_VIEW_KEY
Definition monero_c_wallet.h:458
@ MONERO_MESSAGE_SIGN_WITH_SPEND_KEY
Definition monero_c_wallet.h:457
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_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_thaw_output(monero_wallet *wallet, const char *key_image)
Thaw a frozen output.
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_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_get_accounts(monero_wallet *wallet, bool include_subaddresses, char **out_json)
Get the accounts of the wallet.
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_get_seed_language(monero_wallet *wallet, char **out_language)
Get the language of the mnemonic seed.
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_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_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_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_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...
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_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_wait_for_next_block(monero_wallet *wallet, uint64_t *out_height)
Wait until the next block is added to the chain.
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.
Definition monero_c_wallet.h:78
MONERO_EXPORT monero_result monero_wallet_stop_mining(monero_wallet *wallet)
Stop mining on the daemon.
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_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_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_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_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_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_account_tags(monero_wallet *wallet, char **out_json)
Get the account tags of the wallet.
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_delete_address_book_entry(monero_wallet *wallet, uint64_t index)
Delete an address book entry.
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.
Callbacks of a wallet listener.
Definition monero_c_wallet.h:123
monero_wallet_on_output_spent_fn on_output_spent
is called when the wallet spends an output, or NULL to skip
Definition monero_c_wallet.h:129
monero_wallet_on_balances_changed_fn on_balances_changed
is called when the balances change, or NULL to skip
Definition monero_c_wallet.h:127
void * user_data
is passed to every callback, and monero_c doesn't read it
Definition monero_c_wallet.h:124
monero_wallet_on_output_received_fn on_output_received
is called when the wallet receives an output, or NULL to skip
Definition monero_c_wallet.h:128
monero_wallet_on_new_block_fn on_new_block
is called with each new block, or NULL to skip
Definition monero_c_wallet.h:126
monero_wallet_on_sync_progress_fn on_sync_progress
is called with the progress of a sync, or NULL to skip
Definition monero_c_wallet.h:125