55#ifndef MONERO_C_UTILS_H
56#define MONERO_C_UTILS_H
62#if defined(_WIN32) || defined(__CYGWIN__)
64 #define MONERO_EXPORT __declspec(dllexport)
66 #define MONERO_EXPORT __declspec(dllimport)
69 #define MONERO_EXPORT __attribute__((visibility("default")))
122#define MONERO_C_ABI_VERSION_MAJOR 0
123#define MONERO_C_ABI_VERSION_MINOR 1
124#define MONERO_C_ABI_VERSION_PATCH 1
MONERO_EXPORT bool monero_utils_is_valid_mnemonic(const char *mnemonic, const char *language)
Check whether a mnemonic seed is valid.
MONERO_EXPORT monero_result monero_utils_validate_address(const char *address, int32_t network_type)
Validate an address for a given network, like monero_utils_is_valid_address() but reports the reason ...
MONERO_EXPORT monero_result monero_utils_parse_payment_uri(const char *uri, int32_t network_type, char **out_tx_config_json)
Parse a payment URI into a transaction configuration.
monero_result
Definition monero_c_utils.h:81
@ MONERO_ERROR
Definition monero_c_utils.h:83
@ MONERO_OK
Definition monero_c_utils.h:82
MONERO_EXPORT monero_result monero_utils_validate_payment_id(const char *payment_id)
Validate a payment id, like monero_utils_is_valid_payment_id() but reports the reason through monero_...
MONERO_EXPORT const char * monero_last_error(void)
Return the message of the most recent MONERO_ERROR result on the calling thread, from any monero_c fu...
MONERO_EXPORT bool monero_utils_is_valid_language(const char *language)
Indicates if the given language is valid.
MONERO_EXPORT bool monero_utils_is_valid_payment_id_long(const char *payment_id_str)
Check whether a long payment id is valid.
MONERO_EXPORT monero_result monero_utils_validate_private_view_key(const char *private_view_key)
Validate a private view key, like monero_utils_is_valid_private_view_key() but reports the reason thr...
MONERO_EXPORT monero_result monero_utils_validate_payment_id_long(const char *payment_id_str)
Validate a long payment id, like monero_utils_is_valid_payment_id_long() but reports the reason throu...
MONERO_EXPORT bool monero_utils_is_valid_payment_id(const char *payment_id)
Check whether a payment id is valid.
MONERO_EXPORT bool monero_utils_is_valid_address(const char *address, int32_t network_type)
Check whether an address is valid for a given network.
MONERO_EXPORT monero_result monero_utils_binary_blocks_fast_to_json(const uint8_t *data, size_t len, char **out_json)
Decodes a get_blocks_by_height.bin-style response.
MONERO_EXPORT bool monero_utils_is_valid_private_view_key(const char *private_view_key)
Check whether a private view key is valid.
MONERO_EXPORT monero_result monero_utils_validate_private_spend_key(const char *private_spend_key)
Validate a private spend key, like monero_utils_is_valid_private_spend_key() but reports the reason t...
MONERO_EXPORT bool monero_utils_is_valid_private_spend_key(const char *private_spend_key)
Check whether a private spend key is valid.
MONERO_EXPORT monero_result monero_utils_json_to_binary(const char *json, uint8_t **out_data, size_t *out_len)
Convert a JSON string to its binary-encoded (portable storage format) equivalent.
MONERO_EXPORT void monero_utils_configure_logging(const char *path, bool console)
Configures where log output is written.
MONERO_EXPORT bool monero_utils_parse_payment_id_long(const char *payment_id_str, uint8_t out_payment_id[32])
Parse a long payment ID from a string.
MONERO_EXPORT monero_result monero_utils_validate_public_view_key(const char *public_view_key)
Validate a public view key, like monero_utils_is_valid_public_view_key() but reports the reason throu...
MONERO_EXPORT bool monero_utils_is_valid_public_spend_key(const char *public_spend_key)
Check whether a public spend key is valid.
MONERO_EXPORT void monero_utils_set_log_level(int32_t level)
Set the log level, which picks default category filters (0 = warnings and errors only,...
MONERO_EXPORT monero_result monero_utils_validate_payment_id_short(const char *payment_id_str)
Validate a short payment id, like monero_utils_is_valid_payment_id_short() but reports the reason thr...
MONERO_EXPORT monero_result monero_utils_get_payment_uri(const char *tx_config_json, int32_t network_type, char **out_uri)
Create a payment URI from a transaction configuration.
MONERO_EXPORT monero_result monero_utils_validate_public_spend_key(const char *public_spend_key)
Validate a public spend key, like monero_utils_is_valid_public_spend_key() but reports the reason thr...
#define MONERO_EXPORT
Copyright (c) Libmonero.
Definition monero_c_utils.h:69
MONERO_EXPORT monero_result monero_utils_binary_to_json(const uint8_t *data, size_t len, char **out_json)
Convert a binary-encoded (portable storage format) buffer to its JSON equivalent.
MONERO_EXPORT void monero_utils_free(void *ptr)
Frees a string or byte buffer returned by any monero_utils_* function.
MONERO_EXPORT monero_result monero_utils_binary_blocks_to_json(const uint8_t *data, size_t len, char **out_json)
Decodes a get_blocks.bin-style response.
MONERO_EXPORT monero_result monero_utils_xmr_to_atomic_units(double amount_xmr, uint64_t *out_atomic_units)
Convert an amount in XMR to atomic units.
MONERO_EXPORT int32_t monero_utils_get_ring_size(void)
Return the network-enforced ring size.
MONERO_EXPORT void monero_utils_set_log_categories(const char *categories)
Set the log categories filter directly, overriding whatever monero_utils_set_log_level() last selecte...
MONERO_EXPORT bool monero_utils_is_valid_public_view_key(const char *public_view_key)
Check whether a public view key is valid.
MONERO_EXPORT monero_result monero_utils_get_abi_version(uint32_t *out_major, uint32_t *out_minor, uint32_t *out_patch)
Get the version of the C ABI of the loaded library.
MONERO_EXPORT bool monero_utils_parse_payment_id_short(const char *payment_id_str, uint8_t out_payment_id[8])
Parse a short payment ID from a string.
monero_utils_network_type
Definition monero_c_utils.h:90
@ MONERO_UTILS_NETWORK_MAINNET
Definition monero_c_utils.h:91
@ MONERO_UTILS_NETWORK_REGTEST
Definition monero_c_utils.h:94
@ MONERO_UTILS_NETWORK_TESTNET
Definition monero_c_utils.h:92
@ MONERO_UTILS_NETWORK_STAGENET
Definition monero_c_utils.h:93
MONERO_EXPORT double monero_utils_atomic_units_to_xmr(uint64_t amount_atomic_units)
Convert an amount in atomic units to XMR.
MONERO_EXPORT monero_result monero_utils_validate_mnemonic(const char *mnemonic, const char *language)
Validate a mnemonic seed, like monero_utils_is_valid_mnemonic() but reports the reason through monero...
MONERO_EXPORT bool monero_utils_is_valid_payment_id_short(const char *payment_id_str)
Check whether a short payment id is valid.
MONERO_EXPORT monero_result monero_utils_get_integrated_address(int32_t network_type, const char *standard_address, const char *payment_id, char **out_json)
Builds an integrated address from a standard address and payment id.