Monero C++ Library
Loading...
Searching...
No Matches
Functions
monero_utils Namespace Reference

Functions

void set_log_level (int level)
 
void configure_logging (const std::string &path, bool console)
 
monero_integrated_address get_integrated_address (monero_network_type network_type, const std::string &standard_address, const std::string &payment_id)
 
bool is_valid_address (const std::string &address, monero_network_type network_type)
 
bool is_valid_private_view_key (const std::string &private_view_key)
 
bool is_valid_private_spend_key (const std::string &private_spend_key)
 
void validate_address (const std::string &address, monero_network_type network_type)
 
void validate_private_view_key (const std::string &private_view_key)
 
void validate_private_spend_key (const std::string &private_spend_key)
 
void json_to_binary (const std::string &json, std::string &bin)
 
void binary_to_json (const std::string &bin, std::string &json)
 
void binary_blocks_to_json (const std::string &bin, std::string &json)
 
std::string serialize (const rapidjson::Document &doc)
 
template<class T >
void add_json_member (std::string key, T val, rapidjson::Document::AllocatorType &allocator, rapidjson::Value &root, rapidjson::Value &field)
 
void add_json_member (std::string key, std::string val, rapidjson::Document::AllocatorType &allocator, rapidjson::Value &root, rapidjson::Value &field)
 
void add_json_member (std::string key, bool val, rapidjson::Document::AllocatorType &allocator, rapidjson::Value &root)
 
template<class T >
rapidjson::Value to_rapidjson_val (rapidjson::Document::AllocatorType &allocator, const std::vector< std::shared_ptr< T > > &vals)
 
template<class T >
rapidjson::Value to_rapidjson_val (rapidjson::Document::AllocatorType &allocator, const std::vector< T > &vals)
 
rapidjson::Value to_rapidjson_val (rapidjson::Document::AllocatorType &allocator, const std::vector< std::string > &strs)
 
rapidjson::Value to_rapidjson_val (rapidjson::Document::AllocatorType &allocator, const std::vector< uint8_t > &nums)
 
rapidjson::Value to_rapidjson_val (rapidjson::Document::AllocatorType &allocator, const std::vector< uint32_t > &nums)
 
rapidjson::Value to_rapidjson_val (rapidjson::Document::AllocatorType &allocator, const std::vector< uint64_t > &nums)
 
std::string serialize (const boost::property_tree::ptree &node)
 
void deserialize (const std::string &json, boost::property_tree::ptree &root)
 
bool is_valid_language (const std::string &language)
 
std::shared_ptr< monero_blockcn_block_to_block (const cryptonote::block &cn_block)
 
std::shared_ptr< monero_txcn_tx_to_tx (const cryptonote::transaction &cn_tx, bool init_as_tx_wallet=false)
 

Detailed Description

Collection of utilities for the Monero library.

Function Documentation

◆ add_json_member()

template<class T >
void monero_utils::add_json_member ( std::string key,
T val,
rapidjson::Document::AllocatorType & allocator,
rapidjson::Value & root,
rapidjson::Value & field )

Add number, string, and boolean json members using template specialization.

TODO: add_json_member("key", "val", ...) treated as integer instead of string literal

◆ cn_block_to_block()

std::shared_ptr< monero_block > monero_utils::cn_block_to_block ( const cryptonote::block & cn_block)

Convert a cryptonote::block to a block in this library's native model.

Parameters
cn_blockis the block to convert
Returns
a block in this library's native model

◆ cn_tx_to_tx()

std::shared_ptr< monero_tx > monero_utils::cn_tx_to_tx ( const cryptonote::transaction & cn_tx,
bool init_as_tx_wallet = false )

Convert a cryptonote::transaction to a transaction in this library's native model.

Parameters
cn_txis the transaction to convert
init_as_tx_walletspecifies if a monero_tx xor monero_tx_wallet should be initialized

◆ is_valid_language()

bool monero_utils::is_valid_language ( const std::string & language)

Indicates if the given language is valid.

Parameters
languageis the language to validate
Returns
true if the language is valid, false otherwise