Monero C++ Library
Functions
monero_utils Namespace Reference

Functions

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)
 
void addJsonMember (std::string key, uint8_t val, rapidjson::Document::AllocatorType &allocator, rapidjson::Value &root, rapidjson::Value &field)
 
void addJsonMember (std::string key, uint32_t val, rapidjson::Document::AllocatorType &allocator, rapidjson::Value &root, rapidjson::Value &field)
 
void addJsonMember (std::string key, uint64_t val, rapidjson::Document::AllocatorType &allocator, rapidjson::Value &root, rapidjson::Value &field)
 
void addJsonMember (std::string key, std::string val, rapidjson::Document::AllocatorType &allocator, rapidjson::Value &root, rapidjson::Value &field)
 
void addJsonMember (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_block > cn_block_to_block (const cryptonote::block &cn_block)
 
std::shared_ptr< monero_tx > cn_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

◆ cn_block_to_block()

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

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

Parameters
cn_blockis the Core 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 Monero Core crpytonote::transaction to a transaction in this library's native model.

Parameters
cn_txis the Core 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