Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/request.h
// Copyright (c) 2018 The Bitcoin developers | // Copyright (c) 2018 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_RPC_REQUEST_H | #ifndef BITCOIN_RPC_REQUEST_H | ||||
#define BITCOIN_RPC_REQUEST_H | #define BITCOIN_RPC_REQUEST_H | ||||
#include <string> | #include <string> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
namespace util { | |||||
class Ref; | |||||
} // namespace util | |||||
UniValue JSONRPCRequestObj(const std::string &strMethod, const UniValue ¶ms, | UniValue JSONRPCRequestObj(const std::string &strMethod, const UniValue ¶ms, | ||||
const UniValue &id); | const UniValue &id); | ||||
UniValue JSONRPCReplyObj(const UniValue &result, const UniValue &error, | UniValue JSONRPCReplyObj(const UniValue &result, const UniValue &error, | ||||
const UniValue &id); | const UniValue &id); | ||||
std::string JSONRPCReply(const UniValue &result, const UniValue &error, | std::string JSONRPCReply(const UniValue &result, const UniValue &error, | ||||
const UniValue &id); | const UniValue &id); | ||||
UniValue JSONRPCError(int code, const std::string &message); | UniValue JSONRPCError(int code, const std::string &message); | ||||
Show All 10 Lines | |||||
public: | public: | ||||
UniValue id; | UniValue id; | ||||
std::string strMethod; | std::string strMethod; | ||||
UniValue params; | UniValue params; | ||||
bool fHelp; | bool fHelp; | ||||
std::string URI; | std::string URI; | ||||
std::string authUser; | std::string authUser; | ||||
std::string peerAddr; | std::string peerAddr; | ||||
const util::Ref &context; | |||||
JSONRPCRequest() : id(NullUniValue), params(NullUniValue), fHelp(false) {} | JSONRPCRequest(const util::Ref &contextIn) | ||||
: id(NullUniValue), params(NullUniValue), fHelp(false), | |||||
context(contextIn) {} | |||||
void parse(const UniValue &valRequest); | void parse(const UniValue &valRequest); | ||||
}; | }; | ||||
#endif // BITCOIN_RPC_REQUEST_H | #endif // BITCOIN_RPC_REQUEST_H |