Monero
wallet_rpc_server.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2018, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
30 
31 #pragma once
32 
33 #include <boost/program_options/options_description.hpp>
34 #include <boost/program_options/variables_map.hpp>
35 #include <string>
36 #include "common/util.h"
37 #include "net/http_server_impl_base.h"
39 #include "wallet2.h"
40 
41 #undef MONERO_DEFAULT_LOG_CATEGORY
42 #define MONERO_DEFAULT_LOG_CATEGORY "wallet.rpc"
43 
44 namespace tools
45 {
46  /************************************************************************/
47  /* */
48  /************************************************************************/
49  class wallet_rpc_server: public epee::http_server_impl_base<wallet_rpc_server>
50  {
51  public:
52  typedef epee::net_utils::connection_context_base connection_context;
53 
54  static const char* tr(const char* str);
55 
58 
59  bool init(const boost::program_options::variables_map *vm);
60  bool run();
61  void stop();
62  void set_wallet(wallet2 *cr);
63 
64  private:
65 
66  CHAIN_HTTP_TO_MAP2(connection_context); //forward http requests to uri map
67 
68  BEGIN_URI_MAP2()
69  BEGIN_JSON_RPC_MAP("/json_rpc")
70  MAP_JON_RPC_WE("get_balance", on_getbalance, wallet_rpc::COMMAND_RPC_GET_BALANCE)
71  MAP_JON_RPC_WE("get_address", on_getaddress, wallet_rpc::COMMAND_RPC_GET_ADDRESS)
72  MAP_JON_RPC_WE("get_address_index", on_getaddress_index, wallet_rpc::COMMAND_RPC_GET_ADDRESS_INDEX)
73  MAP_JON_RPC_WE("getbalance", on_getbalance, wallet_rpc::COMMAND_RPC_GET_BALANCE)
74  MAP_JON_RPC_WE("getaddress", on_getaddress, wallet_rpc::COMMAND_RPC_GET_ADDRESS)
75  MAP_JON_RPC_WE("create_address", on_create_address, wallet_rpc::COMMAND_RPC_CREATE_ADDRESS)
76  MAP_JON_RPC_WE("label_address", on_label_address, wallet_rpc::COMMAND_RPC_LABEL_ADDRESS)
77  MAP_JON_RPC_WE("get_accounts", on_get_accounts, wallet_rpc::COMMAND_RPC_GET_ACCOUNTS)
78  MAP_JON_RPC_WE("create_account", on_create_account, wallet_rpc::COMMAND_RPC_CREATE_ACCOUNT)
79  MAP_JON_RPC_WE("label_account", on_label_account, wallet_rpc::COMMAND_RPC_LABEL_ACCOUNT)
80  MAP_JON_RPC_WE("get_account_tags", on_get_account_tags, wallet_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS)
81  MAP_JON_RPC_WE("tag_accounts", on_tag_accounts, wallet_rpc::COMMAND_RPC_TAG_ACCOUNTS)
82  MAP_JON_RPC_WE("untag_accounts", on_untag_accounts, wallet_rpc::COMMAND_RPC_UNTAG_ACCOUNTS)
83  MAP_JON_RPC_WE("set_account_tag_description", on_set_account_tag_description, wallet_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION)
84  MAP_JON_RPC_WE("get_height", on_getheight, wallet_rpc::COMMAND_RPC_GET_HEIGHT)
85  MAP_JON_RPC_WE("getheight", on_getheight, wallet_rpc::COMMAND_RPC_GET_HEIGHT)
86  MAP_JON_RPC_WE("transfer", on_transfer, wallet_rpc::COMMAND_RPC_TRANSFER)
87  MAP_JON_RPC_WE("transfer_split", on_transfer_split, wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT)
88  MAP_JON_RPC_WE("sign_transfer", on_sign_transfer, wallet_rpc::COMMAND_RPC_SIGN_TRANSFER)
89  MAP_JON_RPC_WE("submit_transfer", on_submit_transfer, wallet_rpc::COMMAND_RPC_SUBMIT_TRANSFER)
90  MAP_JON_RPC_WE("sweep_dust", on_sweep_dust, wallet_rpc::COMMAND_RPC_SWEEP_DUST)
91  MAP_JON_RPC_WE("sweep_unmixable", on_sweep_dust, wallet_rpc::COMMAND_RPC_SWEEP_DUST)
92  MAP_JON_RPC_WE("sweep_all", on_sweep_all, wallet_rpc::COMMAND_RPC_SWEEP_ALL)
93  MAP_JON_RPC_WE("sweep_single", on_sweep_single, wallet_rpc::COMMAND_RPC_SWEEP_SINGLE)
94  MAP_JON_RPC_WE("relay_tx", on_relay_tx, wallet_rpc::COMMAND_RPC_RELAY_TX)
95  MAP_JON_RPC_WE("store", on_store, wallet_rpc::COMMAND_RPC_STORE)
96  MAP_JON_RPC_WE("get_payments", on_get_payments, wallet_rpc::COMMAND_RPC_GET_PAYMENTS)
97  MAP_JON_RPC_WE("get_bulk_payments", on_get_bulk_payments, wallet_rpc::COMMAND_RPC_GET_BULK_PAYMENTS)
98  MAP_JON_RPC_WE("incoming_transfers", on_incoming_transfers, wallet_rpc::COMMAND_RPC_INCOMING_TRANSFERS)
99  MAP_JON_RPC_WE("query_key", on_query_key, wallet_rpc::COMMAND_RPC_QUERY_KEY)
100  MAP_JON_RPC_WE("make_integrated_address", on_make_integrated_address, wallet_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS)
101  MAP_JON_RPC_WE("split_integrated_address", on_split_integrated_address, wallet_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS)
102  MAP_JON_RPC_WE("stop_wallet", on_stop_wallet, wallet_rpc::COMMAND_RPC_STOP_WALLET)
103  MAP_JON_RPC_WE("rescan_blockchain", on_rescan_blockchain, wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN)
104  MAP_JON_RPC_WE("set_tx_notes", on_set_tx_notes, wallet_rpc::COMMAND_RPC_SET_TX_NOTES)
105  MAP_JON_RPC_WE("get_tx_notes", on_get_tx_notes, wallet_rpc::COMMAND_RPC_GET_TX_NOTES)
106  MAP_JON_RPC_WE("set_attribute", on_set_attribute, wallet_rpc::COMMAND_RPC_SET_ATTRIBUTE)
107  MAP_JON_RPC_WE("get_attribute", on_get_attribute, wallet_rpc::COMMAND_RPC_GET_ATTRIBUTE)
108  MAP_JON_RPC_WE("get_tx_key", on_get_tx_key, wallet_rpc::COMMAND_RPC_GET_TX_KEY)
109  MAP_JON_RPC_WE("check_tx_key", on_check_tx_key, wallet_rpc::COMMAND_RPC_CHECK_TX_KEY)
110  MAP_JON_RPC_WE("get_tx_proof", on_get_tx_proof, wallet_rpc::COMMAND_RPC_GET_TX_PROOF)
111  MAP_JON_RPC_WE("check_tx_proof", on_check_tx_proof, wallet_rpc::COMMAND_RPC_CHECK_TX_PROOF)
112  MAP_JON_RPC_WE("get_spend_proof", on_get_spend_proof, wallet_rpc::COMMAND_RPC_GET_SPEND_PROOF)
113  MAP_JON_RPC_WE("check_spend_proof", on_check_spend_proof, wallet_rpc::COMMAND_RPC_CHECK_SPEND_PROOF)
114  MAP_JON_RPC_WE("get_reserve_proof", on_get_reserve_proof, wallet_rpc::COMMAND_RPC_GET_RESERVE_PROOF)
115  MAP_JON_RPC_WE("check_reserve_proof", on_check_reserve_proof, wallet_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF)
116  MAP_JON_RPC_WE("get_transfers", on_get_transfers, wallet_rpc::COMMAND_RPC_GET_TRANSFERS)
117  MAP_JON_RPC_WE("get_transfer_by_txid", on_get_transfer_by_txid, wallet_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID)
118  MAP_JON_RPC_WE("sign", on_sign, wallet_rpc::COMMAND_RPC_SIGN)
119  MAP_JON_RPC_WE("verify", on_verify, wallet_rpc::COMMAND_RPC_VERIFY)
120  MAP_JON_RPC_WE("export_outputs", on_export_outputs, wallet_rpc::COMMAND_RPC_EXPORT_OUTPUTS)
121  MAP_JON_RPC_WE("import_outputs", on_import_outputs, wallet_rpc::COMMAND_RPC_IMPORT_OUTPUTS)
122  MAP_JON_RPC_WE("export_key_images", on_export_key_images, wallet_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES)
123  MAP_JON_RPC_WE("import_key_images", on_import_key_images, wallet_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES)
124  MAP_JON_RPC_WE("make_uri", on_make_uri, wallet_rpc::COMMAND_RPC_MAKE_URI)
125  MAP_JON_RPC_WE("parse_uri", on_parse_uri, wallet_rpc::COMMAND_RPC_PARSE_URI)
126  MAP_JON_RPC_WE("get_address_book", on_get_address_book, wallet_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY)
127  MAP_JON_RPC_WE("add_address_book", on_add_address_book, wallet_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY)
128  MAP_JON_RPC_WE("delete_address_book",on_delete_address_book,wallet_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY)
129  MAP_JON_RPC_WE("refresh", on_refresh, wallet_rpc::COMMAND_RPC_REFRESH)
130  MAP_JON_RPC_WE("rescan_spent", on_rescan_spent, wallet_rpc::COMMAND_RPC_RESCAN_SPENT)
131  MAP_JON_RPC_WE("start_mining", on_start_mining, wallet_rpc::COMMAND_RPC_START_MINING)
132  MAP_JON_RPC_WE("stop_mining", on_stop_mining, wallet_rpc::COMMAND_RPC_STOP_MINING)
133  MAP_JON_RPC_WE("get_languages", on_get_languages, wallet_rpc::COMMAND_RPC_GET_LANGUAGES)
134  MAP_JON_RPC_WE("create_wallet", on_create_wallet, wallet_rpc::COMMAND_RPC_CREATE_WALLET)
135  MAP_JON_RPC_WE("open_wallet", on_open_wallet, wallet_rpc::COMMAND_RPC_OPEN_WALLET)
136  MAP_JON_RPC_WE("close_wallet", on_close_wallet, wallet_rpc::COMMAND_RPC_CLOSE_WALLET)
137  MAP_JON_RPC_WE("change_wallet_password", on_change_wallet_password, wallet_rpc::COMMAND_RPC_CHANGE_WALLET_PASSWORD)
138  MAP_JON_RPC_WE("is_multisig", on_is_multisig, wallet_rpc::COMMAND_RPC_IS_MULTISIG)
139  MAP_JON_RPC_WE("prepare_multisig", on_prepare_multisig, wallet_rpc::COMMAND_RPC_PREPARE_MULTISIG)
140  MAP_JON_RPC_WE("make_multisig", on_make_multisig, wallet_rpc::COMMAND_RPC_MAKE_MULTISIG)
141  MAP_JON_RPC_WE("export_multisig_info", on_export_multisig, wallet_rpc::COMMAND_RPC_EXPORT_MULTISIG)
142  MAP_JON_RPC_WE("import_multisig_info", on_import_multisig, wallet_rpc::COMMAND_RPC_IMPORT_MULTISIG)
143  MAP_JON_RPC_WE("finalize_multisig", on_finalize_multisig, wallet_rpc::COMMAND_RPC_FINALIZE_MULTISIG)
144  MAP_JON_RPC_WE("sign_multisig", on_sign_multisig, wallet_rpc::COMMAND_RPC_SIGN_MULTISIG)
145  MAP_JON_RPC_WE("submit_multisig", on_submit_multisig, wallet_rpc::COMMAND_RPC_SUBMIT_MULTISIG)
146  MAP_JON_RPC_WE("get_version", on_get_version, wallet_rpc::COMMAND_RPC_GET_VERSION)
147  END_JSON_RPC_MAP()
148  END_URI_MAP2()
149 
150  //json_rpc
151  bool on_getbalance(const wallet_rpc::COMMAND_RPC_GET_BALANCE::request& req, wallet_rpc::COMMAND_RPC_GET_BALANCE::response& res, epee::json_rpc::error& er);
152  bool on_getaddress(const wallet_rpc::COMMAND_RPC_GET_ADDRESS::request& req, wallet_rpc::COMMAND_RPC_GET_ADDRESS::response& res, epee::json_rpc::error& er);
153  bool on_getaddress_index(const wallet_rpc::COMMAND_RPC_GET_ADDRESS_INDEX::request& req, wallet_rpc::COMMAND_RPC_GET_ADDRESS_INDEX::response& res, epee::json_rpc::error& er);
154  bool on_create_address(const wallet_rpc::COMMAND_RPC_CREATE_ADDRESS::request& req, wallet_rpc::COMMAND_RPC_CREATE_ADDRESS::response& res, epee::json_rpc::error& er);
155  bool on_label_address(const wallet_rpc::COMMAND_RPC_LABEL_ADDRESS::request& req, wallet_rpc::COMMAND_RPC_LABEL_ADDRESS::response& res, epee::json_rpc::error& er);
156  bool on_get_accounts(const wallet_rpc::COMMAND_RPC_GET_ACCOUNTS::request& req, wallet_rpc::COMMAND_RPC_GET_ACCOUNTS::response& res, epee::json_rpc::error& er);
157  bool on_create_account(const wallet_rpc::COMMAND_RPC_CREATE_ACCOUNT::request& req, wallet_rpc::COMMAND_RPC_CREATE_ACCOUNT::response& res, epee::json_rpc::error& er);
158  bool on_label_account(const wallet_rpc::COMMAND_RPC_LABEL_ACCOUNT::request& req, wallet_rpc::COMMAND_RPC_LABEL_ACCOUNT::response& res, epee::json_rpc::error& er);
159  bool on_get_account_tags(const wallet_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS::request& req, wallet_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS::response& res, epee::json_rpc::error& er);
160  bool on_tag_accounts(const wallet_rpc::COMMAND_RPC_TAG_ACCOUNTS::request& req, wallet_rpc::COMMAND_RPC_TAG_ACCOUNTS::response& res, epee::json_rpc::error& er);
161  bool on_untag_accounts(const wallet_rpc::COMMAND_RPC_UNTAG_ACCOUNTS::request& req, wallet_rpc::COMMAND_RPC_UNTAG_ACCOUNTS::response& res, epee::json_rpc::error& er);
162  bool on_set_account_tag_description(const wallet_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION::request& req, wallet_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION::response& res, epee::json_rpc::error& er);
163  bool on_getheight(const wallet_rpc::COMMAND_RPC_GET_HEIGHT::request& req, wallet_rpc::COMMAND_RPC_GET_HEIGHT::response& res, epee::json_rpc::error& er);
164  bool validate_transfer(const std::list<wallet_rpc::transfer_destination>& destinations, const std::string& payment_id, std::vector<cryptonote::tx_destination_entry>& dsts, std::vector<uint8_t>& extra, bool at_least_one_destination, epee::json_rpc::error& er);
165  bool on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::request& req, wallet_rpc::COMMAND_RPC_TRANSFER::response& res, epee::json_rpc::error& er);
166  bool on_transfer_split(const wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT::request& req, wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT::response& res, epee::json_rpc::error& er);
167  bool on_sign_transfer(const wallet_rpc::COMMAND_RPC_SIGN_TRANSFER::request& req, wallet_rpc::COMMAND_RPC_SIGN_TRANSFER::response& res, epee::json_rpc::error& er);
168  bool on_submit_transfer(const wallet_rpc::COMMAND_RPC_SUBMIT_TRANSFER::request& req, wallet_rpc::COMMAND_RPC_SUBMIT_TRANSFER::response& res, epee::json_rpc::error& er);
169  bool on_sweep_dust(const wallet_rpc::COMMAND_RPC_SWEEP_DUST::request& req, wallet_rpc::COMMAND_RPC_SWEEP_DUST::response& res, epee::json_rpc::error& er);
170  bool on_sweep_all(const wallet_rpc::COMMAND_RPC_SWEEP_ALL::request& req, wallet_rpc::COMMAND_RPC_SWEEP_ALL::response& res, epee::json_rpc::error& er);
171  bool on_sweep_single(const wallet_rpc::COMMAND_RPC_SWEEP_SINGLE::request& req, wallet_rpc::COMMAND_RPC_SWEEP_SINGLE::response& res, epee::json_rpc::error& er);
172  bool on_relay_tx(const wallet_rpc::COMMAND_RPC_RELAY_TX::request& req, wallet_rpc::COMMAND_RPC_RELAY_TX::response& res, epee::json_rpc::error& er);
173  bool on_make_integrated_address(const wallet_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS::request& req, wallet_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS::response& res, epee::json_rpc::error& er);
174  bool on_split_integrated_address(const wallet_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS::request& req, wallet_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS::response& res, epee::json_rpc::error& er);
175  bool on_store(const wallet_rpc::COMMAND_RPC_STORE::request& req, wallet_rpc::COMMAND_RPC_STORE::response& res, epee::json_rpc::error& er);
176  bool on_get_payments(const wallet_rpc::COMMAND_RPC_GET_PAYMENTS::request& req, wallet_rpc::COMMAND_RPC_GET_PAYMENTS::response& res, epee::json_rpc::error& er);
177  bool on_get_bulk_payments(const wallet_rpc::COMMAND_RPC_GET_BULK_PAYMENTS::request& req, wallet_rpc::COMMAND_RPC_GET_BULK_PAYMENTS::response& res, epee::json_rpc::error& er);
178  bool on_incoming_transfers(const wallet_rpc::COMMAND_RPC_INCOMING_TRANSFERS::request& req, wallet_rpc::COMMAND_RPC_INCOMING_TRANSFERS::response& res, epee::json_rpc::error& er);
179  bool on_stop_wallet(const wallet_rpc::COMMAND_RPC_STOP_WALLET::request& req, wallet_rpc::COMMAND_RPC_STOP_WALLET::response& res, epee::json_rpc::error& er);
180  bool on_rescan_blockchain(const wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::request& req, wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::response& res, epee::json_rpc::error& er);
181  bool on_set_tx_notes(const wallet_rpc::COMMAND_RPC_SET_TX_NOTES::request& req, wallet_rpc::COMMAND_RPC_SET_TX_NOTES::response& res, epee::json_rpc::error& er);
182  bool on_get_tx_notes(const wallet_rpc::COMMAND_RPC_GET_TX_NOTES::request& req, wallet_rpc::COMMAND_RPC_GET_TX_NOTES::response& res, epee::json_rpc::error& er);
183  bool on_set_attribute(const wallet_rpc::COMMAND_RPC_SET_ATTRIBUTE::request& req, wallet_rpc::COMMAND_RPC_SET_ATTRIBUTE::response& res, epee::json_rpc::error& er);
184  bool on_get_attribute(const wallet_rpc::COMMAND_RPC_GET_ATTRIBUTE::request& req, wallet_rpc::COMMAND_RPC_GET_ATTRIBUTE::response& res, epee::json_rpc::error& er);
185  bool on_get_tx_key(const wallet_rpc::COMMAND_RPC_GET_TX_KEY::request& req, wallet_rpc::COMMAND_RPC_GET_TX_KEY::response& res, epee::json_rpc::error& er);
186  bool on_check_tx_key(const wallet_rpc::COMMAND_RPC_CHECK_TX_KEY::request& req, wallet_rpc::COMMAND_RPC_CHECK_TX_KEY::response& res, epee::json_rpc::error& er);
187  bool on_get_tx_proof(const wallet_rpc::COMMAND_RPC_GET_TX_PROOF::request& req, wallet_rpc::COMMAND_RPC_GET_TX_PROOF::response& res, epee::json_rpc::error& er);
188  bool on_check_tx_proof(const wallet_rpc::COMMAND_RPC_CHECK_TX_PROOF::request& req, wallet_rpc::COMMAND_RPC_CHECK_TX_PROOF::response& res, epee::json_rpc::error& er);
189  bool on_get_spend_proof(const wallet_rpc::COMMAND_RPC_GET_SPEND_PROOF::request& req, wallet_rpc::COMMAND_RPC_GET_SPEND_PROOF::response& res, epee::json_rpc::error& er);
190  bool on_check_spend_proof(const wallet_rpc::COMMAND_RPC_CHECK_SPEND_PROOF::request& req, wallet_rpc::COMMAND_RPC_CHECK_SPEND_PROOF::response& res, epee::json_rpc::error& er);
191  bool on_get_reserve_proof(const wallet_rpc::COMMAND_RPC_GET_RESERVE_PROOF::request& req, wallet_rpc::COMMAND_RPC_GET_RESERVE_PROOF::response& res, epee::json_rpc::error& er);
192  bool on_check_reserve_proof(const wallet_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF::request& req, wallet_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF::response& res, epee::json_rpc::error& er);
193  bool on_get_transfers(const wallet_rpc::COMMAND_RPC_GET_TRANSFERS::request& req, wallet_rpc::COMMAND_RPC_GET_TRANSFERS::response& res, epee::json_rpc::error& er);
194  bool on_get_transfer_by_txid(const wallet_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID::request& req, wallet_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID::response& res, epee::json_rpc::error& er);
195  bool on_sign(const wallet_rpc::COMMAND_RPC_SIGN::request& req, wallet_rpc::COMMAND_RPC_SIGN::response& res, epee::json_rpc::error& er);
196  bool on_verify(const wallet_rpc::COMMAND_RPC_VERIFY::request& req, wallet_rpc::COMMAND_RPC_VERIFY::response& res, epee::json_rpc::error& er);
197  bool on_export_outputs(const wallet_rpc::COMMAND_RPC_EXPORT_OUTPUTS::request& req, wallet_rpc::COMMAND_RPC_EXPORT_OUTPUTS::response& res, epee::json_rpc::error& er);
198  bool on_import_outputs(const wallet_rpc::COMMAND_RPC_IMPORT_OUTPUTS::request& req, wallet_rpc::COMMAND_RPC_IMPORT_OUTPUTS::response& res, epee::json_rpc::error& er);
199  bool on_export_key_images(const wallet_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES::request& req, wallet_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES::response& res, epee::json_rpc::error& er);
200  bool on_import_key_images(const wallet_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES::request& req, wallet_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES::response& res, epee::json_rpc::error& er);
201  bool on_make_uri(const wallet_rpc::COMMAND_RPC_MAKE_URI::request& req, wallet_rpc::COMMAND_RPC_MAKE_URI::response& res, epee::json_rpc::error& er);
202  bool on_parse_uri(const wallet_rpc::COMMAND_RPC_PARSE_URI::request& req, wallet_rpc::COMMAND_RPC_PARSE_URI::response& res, epee::json_rpc::error& er);
203  bool on_get_address_book(const wallet_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY::request& req, wallet_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY::response& res, epee::json_rpc::error& er);
204  bool on_add_address_book(const wallet_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY::request& req, wallet_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY::response& res, epee::json_rpc::error& er);
205  bool on_delete_address_book(const wallet_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY::request& req, wallet_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY::response& res, epee::json_rpc::error& er);
206  bool on_refresh(const wallet_rpc::COMMAND_RPC_REFRESH::request& req, wallet_rpc::COMMAND_RPC_REFRESH::response& res, epee::json_rpc::error& er);
207  bool on_rescan_spent(const wallet_rpc::COMMAND_RPC_RESCAN_SPENT::request& req, wallet_rpc::COMMAND_RPC_RESCAN_SPENT::response& res, epee::json_rpc::error& er);
208  bool on_start_mining(const wallet_rpc::COMMAND_RPC_START_MINING::request& req, wallet_rpc::COMMAND_RPC_START_MINING::response& res, epee::json_rpc::error& er);
209  bool on_stop_mining(const wallet_rpc::COMMAND_RPC_STOP_MINING::request& req, wallet_rpc::COMMAND_RPC_STOP_MINING::response& res, epee::json_rpc::error& er);
210  bool on_get_languages(const wallet_rpc::COMMAND_RPC_GET_LANGUAGES::request& req, wallet_rpc::COMMAND_RPC_GET_LANGUAGES::response& res, epee::json_rpc::error& er);
211  bool on_create_wallet(const wallet_rpc::COMMAND_RPC_CREATE_WALLET::request& req, wallet_rpc::COMMAND_RPC_CREATE_WALLET::response& res, epee::json_rpc::error& er);
212  bool on_open_wallet(const wallet_rpc::COMMAND_RPC_OPEN_WALLET::request& req, wallet_rpc::COMMAND_RPC_OPEN_WALLET::response& res, epee::json_rpc::error& er);
213  bool on_close_wallet(const wallet_rpc::COMMAND_RPC_CLOSE_WALLET::request& req, wallet_rpc::COMMAND_RPC_CLOSE_WALLET::response& res, epee::json_rpc::error& er);
214  bool on_change_wallet_password(const wallet_rpc::COMMAND_RPC_CHANGE_WALLET_PASSWORD::request& req, wallet_rpc::COMMAND_RPC_CHANGE_WALLET_PASSWORD::response& res, epee::json_rpc::error& er);
215  bool on_is_multisig(const wallet_rpc::COMMAND_RPC_IS_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_IS_MULTISIG::response& res, epee::json_rpc::error& er);
216  bool on_prepare_multisig(const wallet_rpc::COMMAND_RPC_PREPARE_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_PREPARE_MULTISIG::response& res, epee::json_rpc::error& er);
217  bool on_make_multisig(const wallet_rpc::COMMAND_RPC_MAKE_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_MAKE_MULTISIG::response& res, epee::json_rpc::error& er);
218  bool on_export_multisig(const wallet_rpc::COMMAND_RPC_EXPORT_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_EXPORT_MULTISIG::response& res, epee::json_rpc::error& er);
219  bool on_import_multisig(const wallet_rpc::COMMAND_RPC_IMPORT_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_IMPORT_MULTISIG::response& res, epee::json_rpc::error& er);
220  bool on_finalize_multisig(const wallet_rpc::COMMAND_RPC_FINALIZE_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_FINALIZE_MULTISIG::response& res, epee::json_rpc::error& er);
221  bool on_sign_multisig(const wallet_rpc::COMMAND_RPC_SIGN_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_SIGN_MULTISIG::response& res, epee::json_rpc::error& er);
222  bool on_submit_multisig(const wallet_rpc::COMMAND_RPC_SUBMIT_MULTISIG::request& req, wallet_rpc::COMMAND_RPC_SUBMIT_MULTISIG::response& res, epee::json_rpc::error& er);
223  bool on_get_version(const wallet_rpc::COMMAND_RPC_GET_VERSION::request& req, wallet_rpc::COMMAND_RPC_GET_VERSION::response& res, epee::json_rpc::error& er);
224 
225  //json rpc v2
226  bool on_query_key(const wallet_rpc::COMMAND_RPC_QUERY_KEY::request& req, wallet_rpc::COMMAND_RPC_QUERY_KEY::response& res, epee::json_rpc::error& er);
227 
228  // helpers
229  void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const crypto::hash &payment_id, const tools::wallet2::payment_details &pd);
230  void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::confirmed_transfer_details &pd);
231  void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::unconfirmed_transfer_details &pd);
232  void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &payment_id, const tools::wallet2::pool_payment_details &pd);
233  bool not_open(epee::json_rpc::error& er);
234  void handle_rpc_exception(const std::exception_ptr& e, epee::json_rpc::error& er, int default_error_code);
235 
236  template<typename Ts, typename Tu>
237  bool fill_response(std::vector<tools::wallet2::pending_tx> &ptx_vector,
238  bool get_tx_key, Ts& tx_key, Tu &amount, Tu &fee, std::string &multisig_txset, std::string &unsigned_txset, bool do_not_relay,
239  Ts &tx_hash, bool get_tx_hex, Ts &tx_blob, bool get_tx_metadata, Ts &tx_metadata, epee::json_rpc::error &er);
240 
242  std::string m_wallet_dir;
244  std::atomic<bool> m_stop;
246  const boost::program_options::variables_map *m_vm;
247  };
248 }
bool on_sweep_all(const wallet_rpc::COMMAND_RPC_SWEEP_ALL::request &req, wallet_rpc::COMMAND_RPC_SWEEP_ALL::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1082
bool on_get_tx_key(const wallet_rpc::COMMAND_RPC_GET_TX_KEY::request &req, wallet_rpc::COMMAND_RPC_GET_TX_KEY::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1798
Definition: wallet_rpc_server.h:49
bool on_start_mining(const wallet_rpc::COMMAND_RPC_START_MINING::request &req, wallet_rpc::COMMAND_RPC_START_MINING::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2563
bool on_get_accounts(const wallet_rpc::COMMAND_RPC_GET_ACCOUNTS::request &req, wallet_rpc::COMMAND_RPC_GET_ACCOUNTS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:467
std::string m_wallet_dir
Definition: wallet_rpc_server.h:242
bool on_get_tx_proof(const wallet_rpc::COMMAND_RPC_GET_TX_PROOF::request &req, wallet_rpc::COMMAND_RPC_GET_TX_PROOF::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1889
bool init(const boost::program_options::variables_map *vm)
Definition: wallet_rpc_server.cpp:152
bool on_sign_transfer(const wallet_rpc::COMMAND_RPC_SIGN_TRANSFER::request &req, wallet_rpc::COMMAND_RPC_SIGN_TRANSFER::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:922
void stop()
Definition: wallet_rpc_server.cpp:142
bool not_open(epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:243
Definition: unordered_containers_boost_serialization.h:37
bool on_delete_address_book(const wallet_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY::request &req, wallet_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2493
Definition: wallet2.h:151
bool on_sweep_dust(const wallet_rpc::COMMAND_RPC_SWEEP_DUST::request &req, wallet_rpc::COMMAND_RPC_SWEEP_DUST::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1057
bool on_open_wallet(const wallet_rpc::COMMAND_RPC_OPEN_WALLET::request &req, wallet_rpc::COMMAND_RPC_OPEN_WALLET::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2718
bool on_check_spend_proof(const wallet_rpc::COMMAND_RPC_CHECK_SPEND_PROOF::request &req, wallet_rpc::COMMAND_RPC_CHECK_SPEND_PROOF::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1983
bool on_prepare_multisig(const wallet_rpc::COMMAND_RPC_PREPARE_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_PREPARE_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2922
bool on_getheight(const wallet_rpc::COMMAND_RPC_GET_HEIGHT::request &req, wallet_rpc::COMMAND_RPC_GET_HEIGHT::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:602
bool on_get_languages(const wallet_rpc::COMMAND_RPC_GET_LANGUAGES::request &req, wallet_rpc::COMMAND_RPC_GET_LANGUAGES::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2613
bool on_create_account(const wallet_rpc::COMMAND_RPC_CREATE_ACCOUNT::request &req, wallet_rpc::COMMAND_RPC_CREATE_ACCOUNT::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:506
bool on_rescan_blockchain(const wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::request &req, wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1604
bool on_parse_uri(const wallet_rpc::COMMAND_RPC_PARSE_URI::request &req, wallet_rpc::COMMAND_RPC_PARSE_URI::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2378
bool on_split_integrated_address(const wallet_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS::request &req, wallet_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1332
crypto namespace.
Definition: crypto.cpp:59
Definition: blockchain_ancestry.cpp:70
bool on_import_key_images(const wallet_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES::request &req, wallet_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2307
bool on_get_version(const wallet_rpc::COMMAND_RPC_GET_VERSION::request &req, wallet_rpc::COMMAND_RPC_GET_VERSION::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:3284
bool on_check_tx_key(const wallet_rpc::COMMAND_RPC_CHECK_TX_KEY::request &req, wallet_rpc::COMMAND_RPC_CHECK_TX_KEY::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1827
bool on_get_transfers(const wallet_rpc::COMMAND_RPC_GET_TRANSFERS::request &req, wallet_rpc::COMMAND_RPC_GET_TRANSFERS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2068
bool fill_response(std::vector< tools::wallet2::pending_tx > &ptx_vector, bool get_tx_key, Ts &tx_key, Tu &amount, Tu &fee, std::string &multisig_txset, std::string &unsigned_txset, bool do_not_relay, Ts &tx_hash, bool get_tx_hex, Ts &tx_blob, bool get_tx_metadata, Ts &tx_metadata, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:755
void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const crypto::hash &payment_id, const tools::wallet2::payment_details &pd)
Definition: wallet_rpc_server.cpp:250
bool on_make_uri(const wallet_rpc::COMMAND_RPC_MAKE_URI::request &req, wallet_rpc::COMMAND_RPC_MAKE_URI::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2362
bool on_sign(const wallet_rpc::COMMAND_RPC_SIGN::request &req, wallet_rpc::COMMAND_RPC_SIGN::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1626
bool on_untag_accounts(const wallet_rpc::COMMAND_RPC_UNTAG_ACCOUNTS::request &req, wallet_rpc::COMMAND_RPC_UNTAG_ACCOUNTS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:572
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:224
bool on_create_address(const wallet_rpc::COMMAND_RPC_CREATE_ADDRESS::request &req, wallet_rpc::COMMAND_RPC_CREATE_ADDRESS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:435
bool on_change_wallet_password(const wallet_rpc::COMMAND_RPC_CHANGE_WALLET_PASSWORD::request &req, wallet_rpc::COMMAND_RPC_CHANGE_WALLET_PASSWORD::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2806
bool on_query_key(const wallet_rpc::COMMAND_RPC_QUERY_KEY::request &req, wallet_rpc::COMMAND_RPC_QUERY_KEY::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1565
bool on_finalize_multisig(const wallet_rpc::COMMAND_RPC_FINALIZE_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_FINALIZE_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:3098
bool on_incoming_transfers(const wallet_rpc::COMMAND_RPC_INCOMING_TRANSFERS::request &req, wallet_rpc::COMMAND_RPC_INCOMING_TRANSFERS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1513
bool on_get_bulk_payments(const wallet_rpc::COMMAND_RPC_GET_BULK_PAYMENTS::request &req, wallet_rpc::COMMAND_RPC_GET_BULK_PAYMENTS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1434
bool on_check_tx_proof(const wallet_rpc::COMMAND_RPC_CHECK_TX_PROOF::request &req, wallet_rpc::COMMAND_RPC_CHECK_TX_PROOF::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1922
bool on_getbalance(const wallet_rpc::COMMAND_RPC_GET_BALANCE::request &req, wallet_rpc::COMMAND_RPC_GET_BALANCE::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:335
bool on_export_key_images(const wallet_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES::request &req, wallet_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2284
bool on_get_spend_proof(const wallet_rpc::COMMAND_RPC_GET_SPEND_PROOF::request &req, wallet_rpc::COMMAND_RPC_GET_SPEND_PROOF::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1958
bool on_import_multisig(const wallet_rpc::COMMAND_RPC_IMPORT_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_IMPORT_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:3025
bool validate_transfer(const std::list< wallet_rpc::transfer_destination > &destinations, const std::string &payment_id, std::vector< cryptonote::tx_destination_entry > &dsts, std::vector< uint8_t > &extra, bool at_least_one_destination, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:617
Various Tools.
Definition: apply_permutation.h:39
bool on_import_outputs(const wallet_rpc::COMMAND_RPC_IMPORT_OUTPUTS::request &req, wallet_rpc::COMMAND_RPC_IMPORT_OUTPUTS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2247
CHAIN_HTTP_TO_MAP2(connection_context)
bool on_sweep_single(const wallet_rpc::COMMAND_RPC_SWEEP_SINGLE::request &req, wallet_rpc::COMMAND_RPC_SWEEP_SINGLE::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1137
bool on_close_wallet(const wallet_rpc::COMMAND_RPC_CLOSE_WALLET::request &req, wallet_rpc::COMMAND_RPC_CLOSE_WALLET::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2788
bool on_label_address(const wallet_rpc::COMMAND_RPC_LABEL_ADDRESS::request &req, wallet_rpc::COMMAND_RPC_LABEL_ADDRESS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:452
bool on_make_multisig(const wallet_rpc::COMMAND_RPC_MAKE_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_MAKE_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2948
bool on_is_multisig(const wallet_rpc::COMMAND_RPC_IS_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_IS_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2915
bool on_tag_accounts(const wallet_rpc::COMMAND_RPC_TAG_ACCOUNTS::request &req, wallet_rpc::COMMAND_RPC_TAG_ACCOUNTS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:557
bool on_stop_wallet(const wallet_rpc::COMMAND_RPC_STOP_WALLET::request &req, wallet_rpc::COMMAND_RPC_STOP_WALLET::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1675
bool on_submit_multisig(const wallet_rpc::COMMAND_RPC_SUBMIT_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_SUBMIT_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:3218
bool on_stop_mining(const wallet_rpc::COMMAND_RPC_STOP_MINING::request &req, wallet_rpc::COMMAND_RPC_STOP_MINING::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2598
bool on_label_account(const wallet_rpc::COMMAND_RPC_LABEL_ACCOUNT::request &req, wallet_rpc::COMMAND_RPC_LABEL_ACCOUNT::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:523
wallet2 * m_wallet
Definition: wallet_rpc_server.h:241
bool on_get_reserve_proof(const wallet_rpc::COMMAND_RPC_GET_RESERVE_PROOF::request &req, wallet_rpc::COMMAND_RPC_GET_RESERVE_PROOF::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2008
bool check_tx_proof(const hash &prefix_hash, const public_key &R, const public_key &A, const boost::optional< public_key > &B, const public_key &D, const signature &sig)
Definition: crypto.h:226
Definition: cryptonote_format_utils.h:41
bool on_export_multisig(const wallet_rpc::COMMAND_RPC_EXPORT_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_EXPORT_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2985
wallet_rpc_server()
Definition: wallet_rpc_server.cpp:103
const boost::program_options::variables_map * m_vm
Definition: wallet_rpc_server.h:246
bool on_set_account_tag_description(const wallet_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION::request &req, wallet_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:587
std::atomic< bool > m_stop
Definition: wallet_rpc_server.h:244
bool on_get_tx_notes(const wallet_rpc::COMMAND_RPC_GET_TX_NOTES::request &req, wallet_rpc::COMMAND_RPC_GET_TX_NOTES::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1741
bool on_submit_transfer(const wallet_rpc::COMMAND_RPC_SUBMIT_TRANSFER::request &req, wallet_rpc::COMMAND_RPC_SUBMIT_TRANSFER::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:997
void handle_rpc_exception(const std::exception_ptr &e, epee::json_rpc::error &er, int default_error_code)
Definition: wallet_rpc_server.cpp:2838
static const char * tr(const char *str)
Definition: wallet_rpc_server.cpp:97
bool on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::request &req, wallet_rpc::COMMAND_RPC_TRANSFER::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:814
bool on_relay_tx(const wallet_rpc::COMMAND_RPC_RELAY_TX::request &req, wallet_rpc::COMMAND_RPC_RELAY_TX::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1226
bool on_get_payments(const wallet_rpc::COMMAND_RPC_GET_PAYMENTS::request &req, wallet_rpc::COMMAND_RPC_GET_PAYMENTS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1385
bool run()
Definition: wallet_rpc_server.cpp:118
bool on_verify(const wallet_rpc::COMMAND_RPC_VERIFY::request &req, wallet_rpc::COMMAND_RPC_VERIFY::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1640
bool on_make_integrated_address(const wallet_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS::request &req, wallet_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1268
tools::private_file rpc_login_file
Definition: wallet_rpc_server.h:243
bool on_transfer_split(const wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT::request &req, wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:875
bool on_rescan_spent(const wallet_rpc::COMMAND_RPC_RESCAN_SPENT::request &req, wallet_rpc::COMMAND_RPC_RESCAN_SPENT::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2541
bool on_refresh(const wallet_rpc::COMMAND_RPC_REFRESH::request &req, wallet_rpc::COMMAND_RPC_REFRESH::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2519
bool on_getaddress_index(const wallet_rpc::COMMAND_RPC_GET_ADDRESS_INDEX::request &req, wallet_rpc::COMMAND_RPC_GET_ADDRESS_INDEX::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:414
bool on_get_address_book(const wallet_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY::request &req, wallet_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2391
POD_CLASS hash
Definition: hash.h:49
bool on_getaddress(const wallet_rpc::COMMAND_RPC_GET_ADDRESS::request &req, wallet_rpc::COMMAND_RPC_GET_ADDRESS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:374
bool on_store(const wallet_rpc::COMMAND_RPC_STORE::request &req, wallet_rpc::COMMAND_RPC_STORE::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1363
bool on_create_wallet(const wallet_rpc::COMMAND_RPC_CREATE_WALLET::request &req, wallet_rpc::COMMAND_RPC_CREATE_WALLET::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2619
bool m_restricted
Definition: wallet_rpc_server.h:245
void set_wallet(wallet2 *cr)
Definition: wallet_rpc_server.cpp:113
bool on_sign_multisig(const wallet_rpc::COMMAND_RPC_SIGN_MULTISIG::request &req, wallet_rpc::COMMAND_RPC_SIGN_MULTISIG::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:3149
epee::net_utils::connection_context_base connection_context
Definition: wallet_rpc_server.h:52
~wallet_rpc_server()
Definition: wallet_rpc_server.cpp:107
bool on_get_transfer_by_txid(const wallet_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID::request &req, wallet_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2134
bool on_set_attribute(const wallet_rpc::COMMAND_RPC_SET_ATTRIBUTE::request &req, wallet_rpc::COMMAND_RPC_SET_ATTRIBUTE::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1770
A file restricted to process owner AND process. Deletes file on destruction.
Definition: util.h:70
bool on_set_tx_notes(const wallet_rpc::COMMAND_RPC_SET_TX_NOTES::request &req, wallet_rpc::COMMAND_RPC_SET_TX_NOTES::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1698
bool on_export_outputs(const wallet_rpc::COMMAND_RPC_EXPORT_OUTPUTS::request &req, wallet_rpc::COMMAND_RPC_EXPORT_OUTPUTS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2218
bool on_check_reserve_proof(const wallet_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF::request &req, wallet_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2037
bool on_get_account_tags(const wallet_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS::request &req, wallet_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:538
bool on_get_attribute(const wallet_rpc::COMMAND_RPC_GET_ATTRIBUTE::request &req, wallet_rpc::COMMAND_RPC_GET_ATTRIBUTE::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:1785
bool on_add_address_book(const wallet_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY::request &req, wallet_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY::response &res, epee::json_rpc::error &er)
Definition: wallet_rpc_server.cpp:2418