aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-11-11 12:48:39 +0200
committerRiccardo Spagni <ric@spagni.net>2016-11-11 12:48:39 +0200
commit6a2bb62827d778b299e5bd34e4d33670b33d63cf (patch)
tree588e227bfd66a4a82bf39ffbc413094b1aca9690 /src/wallet/wallet2.h
parentMerge pull request #1321 (diff)
parentCreated monero-wallet-rpc, moving functionality from monero-wallet-cli (diff)
downloadmonero-6a2bb62827d778b299e5bd34e4d33670b33d63cf.tar.xz
Merge pull request #1316
358e068 Created monero-wallet-rpc, moving functionality from monero-wallet-cli (Lee Clagett)
Diffstat (limited to 'src/wallet/wallet2.h')
-rw-r--r--src/wallet/wallet2.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index 3c4b1015f..d42385caf 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -32,6 +32,9 @@
#include <memory>
#include <boost/archive/binary_iarchive.hpp>
+
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/variables_map.hpp>
#include <boost/serialization/list.hpp>
#include <boost/serialization/vector.hpp>
#include <atomic>
@@ -51,6 +54,7 @@
#include "ringct/rctOps.h"
#include "wallet_errors.h"
+#include "password_container.h"
#include <iostream>
#define WALLET_RCP_CONNECTION_TIMEOUT 200000
@@ -95,6 +99,21 @@ namespace tools
wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers(true), m_store_tx_info(true), m_default_mixin(0), m_default_priority(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true), m_refresh_from_block_height(0), m_confirm_missing_payment_id(true) {}
public:
+ static const char* tr(const char* str);// { return i18n_translate(str, "cryptonote::simple_wallet"); }
+
+ static bool has_testnet_option(const boost::program_options::variables_map& vm);
+ static void init_options(boost::program_options::options_description& desc_params);
+
+ //! Uses stdin and stdout. Returns a wallet2 if no errors.
+ static std::unique_ptr<wallet2> make_from_json(const boost::program_options::variables_map& vm, const std::string& json_file);
+
+ //! Uses stdin and stdout. Returns a wallet2 and password for `wallet_file` if no errors.
+ static std::pair<std::unique_ptr<wallet2>, password_container>
+ make_from_file(const boost::program_options::variables_map& vm, const std::string& wallet_file);
+
+ //! Uses stdin and stdout. Returns a wallet2 and password for wallet with no file if no errors.
+ static std::pair<std::unique_ptr<wallet2>, password_container> make_new(const boost::program_options::variables_map& vm);
+
wallet2(bool testnet = false, bool restricted = false) : m_run(true), m_callback(0), m_testnet(testnet), m_always_confirm_transfers(true), m_store_tx_info(true), m_default_mixin(0), m_default_priority(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true), m_refresh_from_block_height(0), m_confirm_missing_payment_id(true), m_restricted(restricted), is_old_file_format(false) {}
struct transfer_details
{