34 #include <boost/program_options/options_description.hpp> 35 #include <boost/program_options/variables_map.hpp> 37 #include "net/http_server_impl_base.h" 43 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY 44 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "wallet.rpc" 56 static const char*
tr(
const char* str);
60 bool init(
const boost::program_options::variables_map *vm);
64 void handle_rpc_exception(
const std::exception_ptr& e, epee::json_rpc::error& er,
int default_error_code);
73 BEGIN_JSON_RPC_MAP("/json_rpc")
74 MAP_JON_RPC_WE("getbalance",
on_getbalance, wallet_rpc::COMMAND_RPC_GET_BALANCE)
75 MAP_JON_RPC_WE("getaddress",
on_getaddress, wallet_rpc::COMMAND_RPC_GET_ADDRESS)
76 MAP_JON_RPC_WE("getheight",
on_getheight, wallet_rpc::COMMAND_RPC_GET_HEIGHT)
77 MAP_JON_RPC_WE("transfer",
on_transfer, wallet_rpc::COMMAND_RPC_TRANSFER)
78 MAP_JON_RPC_WE("transfer_split",
on_transfer_split, wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT)
79 MAP_JON_RPC_WE("sweep_dust",
on_sweep_dust, wallet_rpc::COMMAND_RPC_SWEEP_DUST)
80 MAP_JON_RPC_WE("sweep_all",
on_sweep_all, wallet_rpc::COMMAND_RPC_SWEEP_ALL)
81 MAP_JON_RPC_WE("relay_tx",
on_relay_tx, wallet_rpc::COMMAND_RPC_RELAY_TX)
82 MAP_JON_RPC_WE("store",
on_store, wallet_rpc::COMMAND_RPC_STORE)
83 MAP_JON_RPC_WE("get_payments",
on_get_payments, wallet_rpc::COMMAND_RPC_GET_PAYMENTS)
84 MAP_JON_RPC_WE("get_bulk_payments",
on_get_bulk_payments, wallet_rpc::COMMAND_RPC_GET_BULK_PAYMENTS)
85 MAP_JON_RPC_WE("incoming_transfers",
on_incoming_transfers, wallet_rpc::COMMAND_RPC_INCOMING_TRANSFERS)
86 MAP_JON_RPC_WE("query_key",
on_query_key, wallet_rpc::COMMAND_RPC_QUERY_KEY)
89 MAP_JON_RPC_WE("stop_wallet",
on_stop_wallet, wallet_rpc::COMMAND_RPC_STOP_WALLET)
90 MAP_JON_RPC_WE("rescan_blockchain",
on_rescan_blockchain, wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN)
91 MAP_JON_RPC_WE("set_tx_notes",
on_set_tx_notes, wallet_rpc::COMMAND_RPC_SET_TX_NOTES)
92 MAP_JON_RPC_WE("get_tx_notes",
on_get_tx_notes, wallet_rpc::COMMAND_RPC_GET_TX_NOTES)
93 MAP_JON_RPC_WE("get_tx_key",
on_get_tx_key, wallet_rpc::COMMAND_RPC_GET_TX_KEY)
94 MAP_JON_RPC_WE("get_transfers",
on_get_transfers, wallet_rpc::COMMAND_RPC_GET_TRANSFERS)
97 MAP_JON_RPC_WE("sign",
on_sign, wallet_rpc::COMMAND_RPC_SIGN)
98 MAP_JON_RPC_WE("verify",
on_verify, wallet_rpc::COMMAND_RPC_VERIFY)
99 MAP_JON_RPC_WE("export_key_images",
on_export_key_images, wallet_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES)
100 MAP_JON_RPC_WE("import_key_images",
on_import_key_images, wallet_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES)
101 MAP_JON_RPC_WE("make_uri",
on_make_uri, wallet_rpc::COMMAND_RPC_MAKE_URI)
102 MAP_JON_RPC_WE("parse_uri",
on_parse_uri, wallet_rpc::COMMAND_RPC_PARSE_URI)
103 MAP_JON_RPC_WE("get_address_book",
on_get_address_book, wallet_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY)
104 MAP_JON_RPC_WE("add_address_book",
on_add_address_book, wallet_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY)
105 MAP_JON_RPC_WE("delete_address_book",
on_delete_address_book,wallet_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY)
106 MAP_JON_RPC_WE("rescan_spent",
on_rescan_spent, wallet_rpc::COMMAND_RPC_RESCAN_SPENT)
107 MAP_JON_RPC_WE("start_mining",
on_start_mining, wallet_rpc::COMMAND_RPC_START_MINING)
108 MAP_JON_RPC_WE("stop_mining",
on_stop_mining, wallet_rpc::COMMAND_RPC_STOP_MINING)
109 MAP_JON_RPC_WE("get_languages",
on_get_languages, wallet_rpc::COMMAND_RPC_GET_LANGUAGES)
110 MAP_JON_RPC_WE("create_wallet",
on_create_wallet, wallet_rpc::COMMAND_RPC_CREATE_WALLET)
111 MAP_JON_RPC_WE("open_wallet",
on_open_wallet, wallet_rpc::COMMAND_RPC_OPEN_WALLET)
112 MAP_JON_RPC_WE("close_wallet",
on_close_wallet, wallet_rpc::COMMAND_RPC_CLOSE_WALLET)
118 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);
119 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);
120 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);
121 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,
epee::json_rpc::error& er);
122 bool on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::request& req, wallet_rpc::COMMAND_RPC_TRANSFER::response& res,
epee::json_rpc::error& er);
123 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);
124 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);
125 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);
126 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);
127 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);
128 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);
129 bool on_store(const wallet_rpc::COMMAND_RPC_STORE::request& req, wallet_rpc::COMMAND_RPC_STORE::response& res,
epee::json_rpc::error& er);
130 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);
131 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);
132 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);
133 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);
134 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);
135 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);
136 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);
137 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);
138 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);
139 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);
140 bool on_save_transfers_to_csv(const wallet_rpc::COMMAND_RPC_SAVE_TRANSFERS_TO_CSV::request& req, wallet_rpc::COMMAND_RPC_SAVE_TRANSFERS_TO_CSV::response& res,
epee::json_rpc::error& er);
141 bool on_sign(const wallet_rpc::COMMAND_RPC_SIGN::request& req, wallet_rpc::COMMAND_RPC_SIGN::response& res,
epee::json_rpc::error& er);
142 bool on_verify(const wallet_rpc::COMMAND_RPC_VERIFY::request& req, wallet_rpc::COMMAND_RPC_VERIFY::response& res,
epee::json_rpc::error& er);
143 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);
144 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);
145 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);
146 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);
147 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);
148 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);
149 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);
150 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);
151 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);
152 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);
153 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);
154 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);
155 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);
156 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);
157 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);
160 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: unordered_containers_boost_serialization.h:38
crypto namespace.
Definition: crypto.cpp:47
Definition: block_queue.cpp:41
Definition: MicroCore.h:23
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:225
#define false
Definition: stdbool.h:38
Definition: connection_basic.cpp:91
POD_CLASS hash
Definition: hash.h:46
Definition: MicroCore.cpp:13
Definition: blockchain.h:80