diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index f8690c0..46b3809 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -1473,6 +1473,22 @@ namespace monero { return vouts; } + string MoneroWallet::getOutputsHex() const { + return epee::string_tools::buff_to_hex_nodelimer(wallet2->export_outputs_to_str(true)); + } + + int MoneroWallet::importOutputsHex(const string& outputsHex) { + + // validate and parse hex data + cryptonote::blobdata blob; + if (!epee::string_tools::parse_hexstr_to_binbuff(outputsHex, blob)) { + throw runtime_error("Failed to parse hex."); + } + + // import hex and return result + return wallet2->import_outputs_from_str(blob); + } + vector> MoneroWallet::getKeyImages() const { cout << "MoneroWallet::getKeyImages()" << endl; @@ -1867,6 +1883,13 @@ namespace monero { return wallet2->get_tx_note(txHash); } + vector MoneroWallet::getTxNotes(const vector& txIds) const { + cout << "MoneroWallet::getTxNotes()" << endl; + vector txNotes; + for (const auto& txId : txIds) txNotes.push_back(getTxNote(txId)); + return txNotes; + } + void MoneroWallet::setTxNote(const string& txId, const string& note) { cout << "MoneroWallet::setTxNote" << endl; cryptonote::blobdata txBlob; @@ -1877,13 +1900,6 @@ namespace monero { wallet2->set_tx_note(txHash, note); } - vector MoneroWallet::getTxNotes(const vector& txIds) const { - cout << "MoneroWallet::getTxNotes()" << endl; - vector txNotes; - for (const auto& txId : txIds) txNotes.push_back(getTxNote(txId)); - return txNotes; - } - void MoneroWallet::setTxNotes(const vector& txIds, const vector& txNotes) { cout << "MoneroWallet::setTxNotes()" << endl; if (txIds.size() != txNotes.size()) throw runtime_error("Different amount of txids and notes"); @@ -2153,22 +2169,6 @@ namespace monero { return sendRequest; } - string MoneroWallet::getOutputsHex() const { - return epee::string_tools::buff_to_hex_nodelimer(wallet2->export_outputs_to_str(true)); - } - - int MoneroWallet::importOutputsHex(const string& outputsHex) { - - // validate and parse hex data - cryptonote::blobdata blob; - if (!epee::string_tools::parse_hexstr_to_binbuff(outputsHex, blob)) { - throw runtime_error("Failed to parse hex."); - } - - // import hex and return result - return wallet2->import_outputs_from_str(blob); - } - void MoneroWallet::setAttribute(const string& key, const string& val) { wallet2->set_attribute(key, val); } diff --git a/src/wallet/MoneroWallet.h b/src/wallet/MoneroWallet.h index 5fe2c05..526443e 100644 --- a/src/wallet/MoneroWallet.h +++ b/src/wallet/MoneroWallet.h @@ -251,6 +251,20 @@ namespace monero { */ string getMnemonic() const; + /** + * Get the language of the wallet's mnemonic phrase. + * + * @return the language of the wallet's mnemonic phrase + */ + string getLanguage() const; + + /** + * Get a list of available languages for the wallet's mnemonic phrase. + * + * @return the available languages for the wallet's mnemonic phrase + */ + vector getLanguages() const; + /** * Get the wallet's public view key. * @@ -279,18 +293,6 @@ namespace monero { */ string getPrivateSpendKey() const; - /** - * TODO - */ - string getLanguage() const; - - /** - * Get a list of available languages for the wallet's seed. - * - * @return the available languages for the wallet's seed - */ - vector getLanguages() const; - /** * Get the wallet's primary address. * @@ -648,6 +650,21 @@ namespace monero { */ vector> getOutputs(const MoneroOutputRequest& request) const; + /** + * Export all outputs in hex format. + * + * @return all outputs in hex format, empty string if no outputs + */ + string getOutputsHex() const; + + /** + * Import outputs in hex format. + * + * @param outputsHex are outputs in hex format + * @return the number of outputs imported + */ + int importOutputsHex(const string& outputsHex); + /** * Get all signed key images. * @@ -838,14 +855,6 @@ namespace monero { */ string getTxNote(const string& txId) const; - /** - * Set a note for a specific transaction. - * - * @param txId specifies the transaction - * @param note specifies the note - */ - void setTxNote(const string& txId, const string& note); - /** * Get notes for multiple transactions. * @@ -854,6 +863,14 @@ namespace monero { */ vector getTxNotes(const vector& txIds) const; + /** + * Set a note for a specific transaction. + * + * @param txId specifies the transaction + * @param note specifies the note + */ + void setTxNote(const string& txId, const string& note); + /** * Set notes for multiple transactions. * @@ -1070,21 +1087,6 @@ namespace monero { */ shared_ptr parsePaymentUri(const string& uri) const; - /** - * Export all outputs in hex format. - * - * @return all outputs in hex format, empty string if no outputs - */ - string getOutputsHex() const; - - /** - * Import outputs in hex format. - * - * @param outputsHex are outputs in hex format - * @return the number of outputs imported - */ - int importOutputsHex(const string& outputsHex); - /** * Set an arbitrary attribute. *