if(!monero_wallet_obj.get())throwstd::runtime_error("monero_wallet_full is not opened");
returnmonero_wallet_obj->add_address_book_entry(address,description);//unsigned int index = monero::monero_wallet_full::add_address_book_entry ( address, const std::string & description ); // adds an address book entry and returns the index of the added entry
std::vector<monero::monero_subaddress>unused_addresses=monero_wallet_obj->get_subaddresses(account_idx,subaddress_indices);// retrieve subaddress from account at 'account_idx'
std::cout<<((std::find(recent_address_list.begin(),recent_address_list.end(),unused_addresses[i].m_address.get())!=recent_address_list.end())?"\033[91m":"\033[0m")<<unused_addresses[i].m_index.get()<<""<<unused_addresses[i].m_address.get()<<"\033[0m"<<std::endl;// if subaddress is found in recent_address_list, mark it red
// skip any recently used subaddress (to ensure the uniqueness of a subaddress)
voidneroshop::Wallet::set_tx_note(conststd::string&txid,conststd::string&tx_note){}// "set_tx_note <txid> [free note text here]" - useful for filling address information
#define PICONERO 0.000000000001 // the smallest unit of a monero (monero has 12 decimal places) // https://web.getmonero.org/resources/moneropedia/denominations.html
// todo: create a function that connects a hardware wallet
monero::monero_subaddresscreate_subaddress(unsignedintaccount_idx,conststd::string&label="")const;// generates a new subaddress from main account // monero addresses start with 4 or 8
monero::monero_subaddresscreate_subaddress(unsignedintaccount_idx,conststd::string&label="")const;// generates a new subaddress from main account
virtualvoidtransfer(conststd::string&address,doubleamount);// "transfer" will be used for sending refunds
staticstd::stringgenerate_uri(conststd::string&payment_address,doubleamount=0.000000000000,conststd::string&description="",conststd::string&recipient="");// Generates a monero uri for qr code with the amount embedded into it
virtualstd::stringget_address(unsignedintindex)const;// returns address at "index"'s string (primary address is index 0) // "address all"
virtualstd::stringget_address(unsignedintindex)const;// returns address at index (primary address is index 0)
unsignedintget_address_count()const;
virtualuint64_tget_balance_raw()const;
@ -154,25 +154,22 @@ public:
unsignedintget_transactions_count()const;
// subaddress
std::stringget_last_subaddress()const;// returns the last subaddress to be created
// NOTE: use address_new to automatically generate a unique subaddress for each customer to make it easier to track who and where the payments are coming from