34 #include <boost/program_options/options_description.hpp>
35 #include <boost/program_options/variables_map.hpp>
38 #include "net/http_server_impl_base.h"
39 #include "math_helper.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);
70 BEGIN_JSON_RPC_MAP("/json_rpc")
71 MAP_JON_RPC_WE("get_balance",
on_getbalance, wallet_rpc::COMMAND_RPC_GET_BALANCE)
73 MAP_JON_RPC_WE("get_address_index",
on_getaddress_index, wallet_rpc::COMMAND_RPC_GET_ADDRESS_INDEX)
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("create_address",
on_create_address, wallet_rpc::COMMAND_RPC_CREATE_ADDRESS)
77 MAP_JON_RPC_WE("label_address",
on_label_address, wallet_rpc::COMMAND_RPC_LABEL_ADDRESS)
78 MAP_JON_RPC_WE("get_accounts",
on_get_accounts, wallet_rpc::COMMAND_RPC_GET_ACCOUNTS)
79 MAP_JON_RPC_WE("create_account",
on_create_account, wallet_rpc::COMMAND_RPC_CREATE_ACCOUNT)
80 MAP_JON_RPC_WE("label_account",
on_label_account, wallet_rpc::COMMAND_RPC_LABEL_ACCOUNT)
81 MAP_JON_RPC_WE("get_account_tags",
on_get_account_tags, wallet_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS)
82 MAP_JON_RPC_WE("tag_accounts",
on_tag_accounts, wallet_rpc::COMMAND_RPC_TAG_ACCOUNTS)
83 MAP_JON_RPC_WE("untag_accounts",
on_untag_accounts, wallet_rpc::COMMAND_RPC_UNTAG_ACCOUNTS)
85 MAP_JON_RPC_WE("get_height",
on_getheight, wallet_rpc::COMMAND_RPC_GET_HEIGHT)
86 MAP_JON_RPC_WE("getheight",
on_getheight, wallet_rpc::COMMAND_RPC_GET_HEIGHT)
87 MAP_JON_RPC_WE("transfer",
on_transfer, wallet_rpc::COMMAND_RPC_TRANSFER)
88 MAP_JON_RPC_WE("transfer_split",
on_transfer_split, wallet_rpc::COMMAND_RPC_TRANSFER_SPLIT)
89 MAP_JON_RPC_WE("sign_transfer",
on_sign_transfer, wallet_rpc::COMMAND_RPC_SIGN_TRANSFER)
90 MAP_JON_RPC_WE("describe_transfer",
on_describe_transfer, wallet_rpc::COMMAND_RPC_DESCRIBE_TRANSFER)
91 MAP_JON_RPC_WE("submit_transfer",
on_submit_transfer, wallet_rpc::COMMAND_RPC_SUBMIT_TRANSFER)
92 MAP_JON_RPC_WE("sweep_dust",
on_sweep_dust, wallet_rpc::COMMAND_RPC_SWEEP_DUST)
93 MAP_JON_RPC_WE("sweep_unmixable",
on_sweep_dust, wallet_rpc::COMMAND_RPC_SWEEP_DUST)
94 MAP_JON_RPC_WE("sweep_all",
on_sweep_all, wallet_rpc::COMMAND_RPC_SWEEP_ALL)
95 MAP_JON_RPC_WE("sweep_single",
on_sweep_single, wallet_rpc::COMMAND_RPC_SWEEP_SINGLE)
96 MAP_JON_RPC_WE("relay_tx",
on_relay_tx, wallet_rpc::COMMAND_RPC_RELAY_TX)
97 MAP_JON_RPC_WE("store",
on_store, wallet_rpc::COMMAND_RPC_STORE)
98 MAP_JON_RPC_WE("get_payments",
on_get_payments, wallet_rpc::COMMAND_RPC_GET_PAYMENTS)
99 MAP_JON_RPC_WE("get_bulk_payments",
on_get_bulk_payments, wallet_rpc::COMMAND_RPC_GET_BULK_PAYMENTS)
100 MAP_JON_RPC_WE("incoming_transfers",
on_incoming_transfers, wallet_rpc::COMMAND_RPC_INCOMING_TRANSFERS)
101 MAP_JON_RPC_WE("query_key",
on_query_key, wallet_rpc::COMMAND_RPC_QUERY_KEY)
104 MAP_JON_RPC_WE("stop_wallet",
on_stop_wallet, wallet_rpc::COMMAND_RPC_STOP_WALLET)
105 MAP_JON_RPC_WE("rescan_blockchain",
on_rescan_blockchain, wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN)
106 MAP_JON_RPC_WE("set_tx_notes",
on_set_tx_notes, wallet_rpc::COMMAND_RPC_SET_TX_NOTES)
107 MAP_JON_RPC_WE("get_tx_notes",
on_get_tx_notes, wallet_rpc::COMMAND_RPC_GET_TX_NOTES)
108 MAP_JON_RPC_WE("set_attribute",
on_set_attribute, wallet_rpc::COMMAND_RPC_SET_ATTRIBUTE)
109 MAP_JON_RPC_WE("get_attribute",
on_get_attribute, wallet_rpc::COMMAND_RPC_GET_ATTRIBUTE)
111 MAP_JON_RPC_WE("check_tx_key",
on_check_tx_key, wallet_rpc::COMMAND_RPC_CHECK_TX_KEY)
112 MAP_JON_RPC_WE("get_tx_proof",
on_get_tx_proof, wallet_rpc::COMMAND_RPC_GET_TX_PROOF)
114 MAP_JON_RPC_WE("get_spend_proof",
on_get_spend_proof, wallet_rpc::COMMAND_RPC_GET_SPEND_PROOF)
115 MAP_JON_RPC_WE("check_spend_proof",
on_check_spend_proof, wallet_rpc::COMMAND_RPC_CHECK_SPEND_PROOF)
116 MAP_JON_RPC_WE("get_reserve_proof",
on_get_reserve_proof, wallet_rpc::COMMAND_RPC_GET_RESERVE_PROOF)
117 MAP_JON_RPC_WE("check_reserve_proof",
on_check_reserve_proof, wallet_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF)
118 MAP_JON_RPC_WE("get_transfers",
on_get_transfers, wallet_rpc::COMMAND_RPC_GET_TRANSFERS)
120 MAP_JON_RPC_WE("sign",
on_sign, wallet_rpc::COMMAND_RPC_SIGN)
121 MAP_JON_RPC_WE("verify",
on_verify, wallet_rpc::COMMAND_RPC_VERIFY)
122 MAP_JON_RPC_WE("export_outputs",
on_export_outputs, wallet_rpc::COMMAND_RPC_EXPORT_OUTPUTS)
123 MAP_JON_RPC_WE("import_outputs",
on_import_outputs, wallet_rpc::COMMAND_RPC_IMPORT_OUTPUTS)
124 MAP_JON_RPC_WE("export_key_images",
on_export_key_images, wallet_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES)
125 MAP_JON_RPC_WE("import_key_images",
on_import_key_images, wallet_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES)
126 MAP_JON_RPC_WE("make_uri",
on_make_uri, wallet_rpc::COMMAND_RPC_MAKE_URI)
127 MAP_JON_RPC_WE("parse_uri",
on_parse_uri, wallet_rpc::COMMAND_RPC_PARSE_URI)
128 MAP_JON_RPC_WE("get_address_book",
on_get_address_book, wallet_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY)
129 MAP_JON_RPC_WE("add_address_book",
on_add_address_book, wallet_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY)
130 MAP_JON_RPC_WE("delete_address_book",
on_delete_address_book,wallet_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY)
131 MAP_JON_RPC_WE("refresh",
on_refresh, wallet_rpc::COMMAND_RPC_REFRESH)
132 MAP_JON_RPC_WE("auto_refresh",
on_auto_refresh, wallet_rpc::COMMAND_RPC_AUTO_REFRESH)
133 MAP_JON_RPC_WE("rescan_spent",
on_rescan_spent, wallet_rpc::COMMAND_RPC_RESCAN_SPENT)
134 MAP_JON_RPC_WE("get_languages",
on_get_languages, wallet_rpc::COMMAND_RPC_GET_LANGUAGES)
135 MAP_JON_RPC_WE("create_wallet",
on_create_wallet, wallet_rpc::COMMAND_RPC_CREATE_WALLET)
136 MAP_JON_RPC_WE("open_wallet",
on_open_wallet, wallet_rpc::COMMAND_RPC_OPEN_WALLET)
137 MAP_JON_RPC_WE("close_wallet",
on_close_wallet, wallet_rpc::COMMAND_RPC_CLOSE_WALLET)
139 MAP_JON_RPC_WE("generate_from_keys",
on_generate_from_keys, wallet_rpc::COMMAND_RPC_GENERATE_FROM_KEYS)
141 MAP_JON_RPC_WE("is_multisig",
on_is_multisig, wallet_rpc::COMMAND_RPC_IS_MULTISIG)
142 MAP_JON_RPC_WE("prepare_multisig",
on_prepare_multisig, wallet_rpc::COMMAND_RPC_PREPARE_MULTISIG)
143 MAP_JON_RPC_WE("make_multisig",
on_make_multisig, wallet_rpc::COMMAND_RPC_MAKE_MULTISIG)
144 MAP_JON_RPC_WE("export_multisig_info",
on_export_multisig, wallet_rpc::COMMAND_RPC_EXPORT_MULTISIG)
145 MAP_JON_RPC_WE("import_multisig_info",
on_import_multisig, wallet_rpc::COMMAND_RPC_IMPORT_MULTISIG)
146 MAP_JON_RPC_WE("finalize_multisig",
on_finalize_multisig, wallet_rpc::COMMAND_RPC_FINALIZE_MULTISIG)
148 MAP_JON_RPC_WE("sign_multisig",
on_sign_multisig, wallet_rpc::COMMAND_RPC_SIGN_MULTISIG)
149 MAP_JON_RPC_WE("submit_multisig",
on_submit_multisig, wallet_rpc::COMMAND_RPC_SUBMIT_MULTISIG)
150 MAP_JON_RPC_WE("validate_address",
on_validate_address, wallet_rpc::COMMAND_RPC_VALIDATE_ADDRESS)
151 MAP_JON_RPC_WE("set_daemon",
on_set_daemon, wallet_rpc::COMMAND_RPC_SET_DAEMON)
152 MAP_JON_RPC_WE("set_log_level",
on_set_log_level, wallet_rpc::COMMAND_RPC_SET_LOG_LEVEL)
153 MAP_JON_RPC_WE("set_log_categories",
on_set_log_categories, wallet_rpc::COMMAND_RPC_SET_LOG_CATEGORIES)
154 MAP_JON_RPC_WE("get_version",
on_get_version, wallet_rpc::COMMAND_RPC_GET_VERSION)
252 template<typename Ts, typename Tu>
254 bool get_tx_key, Ts& tx_key, Tu &amount, Tu &fee,
std::
string &multisig_txset,
std::
string &unsigned_txset,
bool do_not_relay,
255 Ts &tx_hash,
bool get_tx_hex, Ts &tx_blob,
bool get_tx_metadata, Ts &tx_metadata,
epee::json_rpc::
error &er);
epee::net_utils::network_address get_address(const boost::string_ref value)
Definition: net_node.cpp:71
Definition: unordered_containers_boost_serialization.h:39
const
Definition: build_protob.py:9
crypto namespace.
Definition: crypto.cpp:58
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:294
POD_CLASS hash
Definition: hash.h:50
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:226
Definition: cryptonote_format_utils.h:44
std::shared_ptr< messages::Electroneum::ElectroneumGetTxKeyRequest > get_tx_key(const hw::device_cold::tx_key_data_t &tx_data)
Definition: protocol.cpp:1038
error
Tracks LMDB error codes.
Definition: error.h:45
Definition: blockchain_ancestry.cpp:73