2016-04-12 22:20:14 +00:00
|
|
|
//
|
|
|
|
// Created by mwo on 13/04/16.
|
|
|
|
//
|
|
|
|
|
2016-04-15 21:48:37 +00:00
|
|
|
|
2016-04-12 22:20:14 +00:00
|
|
|
#ifndef CROWXMR_RPCCALLS_H
|
|
|
|
#define CROWXMR_RPCCALLS_H
|
|
|
|
|
|
|
|
#include "monero_headers.h"
|
|
|
|
|
2016-04-15 21:48:37 +00:00
|
|
|
#include <mutex>
|
|
|
|
|
2016-04-12 22:20:14 +00:00
|
|
|
namespace xmreg
|
|
|
|
{
|
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
using namespace cryptonote;
|
|
|
|
using namespace crypto;
|
|
|
|
using namespace std;
|
2016-04-12 22:20:14 +00:00
|
|
|
|
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
class rpccalls
|
|
|
|
{
|
|
|
|
string deamon_url ;
|
|
|
|
uint64_t timeout_time;
|
2016-04-12 22:20:14 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
std::chrono::milliseconds timeout_time_ms;
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
epee::net_utils::http::url_content url;
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
epee::net_utils::http::http_simple_client m_http_client;
|
|
|
|
std::mutex m_daemon_rpc_mutex;
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
string port;
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
public:
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
rpccalls(string _deamon_url = "http:://127.0.0.1:18081",
|
|
|
|
uint64_t _timeout = 200000);
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
bool
|
|
|
|
connect_to_monero_deamon();
|
2017-02-07 00:56:17 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
uint64_t
|
|
|
|
get_current_height();
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
bool
|
|
|
|
get_mempool(vector<tx_info>& mempool_txs);
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
bool
|
|
|
|
commit_tx(tools::wallet2::pending_tx& ptx, string& error_msg);
|
2016-10-11 05:38:27 +00:00
|
|
|
|
2017-05-11 04:17:10 +00:00
|
|
|
bool
|
|
|
|
get_network_info(COMMAND_RPC_GET_INFO::response& info);
|
|
|
|
|
2017-04-28 05:45:30 +00:00
|
|
|
};
|
2016-04-12 22:20:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif //CROWXMR_RPCCALLS_H
|